Skip to content

Commit

Permalink
fixed apollo not responding to message on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mole1424 committed Oct 31, 2023
1 parent 4fd6708 commit fa36036
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions cogs/commands/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,16 @@ async def on_ready(self):
logging.error("message id invalid, cannot fetch message id")
return

message = await channel.fetch_message(latest.message_id)
name = message.author.display_name
match latest.kind:
case EventKind.RESTART:
await message.reply(
f"Hello {name}. Apollo, version {self.version_from_file}, started!"
)
case EventKind.UPDATE:
await message.reply(
f"Hello {name}. Apollo updated to version {self.version_from_file}!"
)
try:
message = await channel.fetch_message(latest.message_id)
name = message.author.display_name
except discord.NotFound:
message = None
name = "World"
send = message.reply if message else channel.send
await send(
f"Hello {name}. Apollo, has {'started in' if latest.kind == EventKind.RESTART else 'updated to '} version {self.version_from_file}"
)
latest.acknowledged = True
db_session.commit()

Expand Down

0 comments on commit fa36036

Please sign in to comment.