Skip to content

Commit

Permalink
Moved on-success message logic
Browse files Browse the repository at this point in the history
  • Loading branch information
LobaDK committed Mar 30, 2024
1 parent 36b3880 commit 308c64d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions QuantumKat.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,6 @@ async def setup(bot: commands.Bot):
await bot.load_extension(extension)
await bot.start(TOKEN, reconnect=True)

if Path("rebooted").exists():
with open("rebooted", "r") as f:
IDs = f.read()
# Order: message ID, channel ID, guild ID
IDs = IDs.split("\n")
message = await bot.get_channel(int(IDs[1])).fetch_message(int(IDs[0]))
if message:
await message.edit(content="Rebooted successfully!")
else:
# if the message is not found, instead send a message to the bot owner
await bot.get_user(int(OWNER_ID)).send("Rebooted successfully!")
Path("rebooted").unlink()


@bot.event
async def on_ready():
Expand All @@ -134,6 +121,19 @@ async def on_ready():
except sqlite3.Error as e:
logger.error(f"Error creating chat table: {e}")

if Path("rebooted").exists():
with open("rebooted", "r") as f:
IDs = f.read()
# Order: message ID, channel ID, guild ID
IDs = IDs.split("\n")
message = await bot.get_channel(int(IDs[1])).fetch_message(int(IDs[0]))
if message:
await message.edit(content="Rebooted successfully!")
else:
# if the message is not found, instead send a message to the bot owner
await bot.get_user(int(OWNER_ID)).send("Rebooted successfully!")
Path("rebooted").unlink()

bot.appinfo = await bot.application_info()
quantum = ["reality", "universe", "dimension", "timeline"]
message = f"""
Expand Down

0 comments on commit 308c64d

Please sign in to comment.