From 771ca93fa38c8e68a311fb246a777c0272a98e1c Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 2 Jan 2023 21:27:19 -0800 Subject: feat: data source --- rubys_song_skipper/bot.py | 12 ++++++------ 1 file 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( -- cgit v1.2.3