diff options
| author | Fuwn <[email protected]> | 2023-01-02 21:27:19 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-01-02 21:27:19 -0800 |
| commit | 771ca93fa38c8e68a311fb246a777c0272a98e1c (patch) | |
| tree | 60d8d29273ab1ff4d78c7be3c152360567277408 | |
| parent | feat: auto refresh (diff) | |
| download | rubys_song_skipper-771ca93fa38c8e68a311fb246a777c0272a98e1c.tar.xz rubys_song_skipper-771ca93fa38c8e68a311fb246a777c0272a98e1c.zip | |
feat: data source
| -rw-r--r-- | rubys_song_skipper/bot.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/rubys_song_skipper/bot.py b/rubys_song_skipper/bot.py index a40f459..b3202ad 100644 --- a/rubys_song_skipper/bot.py +++ b/rubys_song_skipper/bot.py @@ -23,12 +23,12 @@ class Bot(commands.Bot): @commands.command(name="skip") async def skip(self, ctx): with open("code.txt", "r") as file: - empty = file.read() - data = file.readlines() + data = file.read() + lines = data.split("\n") - access = data[0].strip() - refresh = data[1].strip() - expire = data[2].strip() + access = lines[0].strip() + refresh = lines[1].strip() + expire = lines[2].strip() if time.time() > expire: file.close() @@ -40,7 +40,7 @@ class Bot(commands.Bot): with open("code.txt", "w") as file: file.write(f"{access}\n{refresh}\n{new_expire}") - if empty == "": + if data == "": await ctx.send("i'm not authorized to do that. sign in.") else: requests.post( |