summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rubys_song_skipper/bot.py12
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(