Skip to content

Commit

Permalink
Fixed post-copy error response formatting, added success response
Browse files Browse the repository at this point in the history
  • Loading branch information
paranox committed Oct 6, 2024
1 parent d0694f1 commit 8c1c325
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mybot.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,20 +345,23 @@ async def post_copy(self, ctx, channel, message_reference):
id = int(message_id)
except ValueError:
await ctx.send_response(
content="Virheellinen viittaus kopioitavaan viestiin {message_reference}->{message_id}.",
content="Virheellinen viittaus kopioitavaan viestiin {}->{}.".format(message_reference, message_id),
ephemeral=True)
return

try:
message = await ctx.fetch_message(id)
except Exception as e:
await ctx.send_response(
content="Viestin {message_id} hakeminen epäonnistui, virhe: '{e}'",
content="Viestin {} hakeminen epäonnistui, virhe: '{}'".format(message_id, str(e)),
ephemeral=True)
return

text = message.content
await channel.send(text)
await ctx.send_response(
content="Viestin {} kopioiminen onnistui".format(message_id),
ephemeral=True)

async def midnight_winners_command(self, ctx):
with self.connection_pool.get_connection() as conn:
Expand Down

0 comments on commit 8c1c325

Please sign in to comment.