From 552903f76014b2ce5891d82d37aab5dd1d551df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Thu, 16 Nov 2023 23:17:26 +0100 Subject: [PATCH] fix not finding message --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index d7e0e92..9b51204 100644 --- a/main.py +++ b/main.py @@ -9,6 +9,7 @@ bot = discord.Bot() with open('storage.json') as user_file: storage = json.loads(user_file.read()) + @bot.event async def on_ready(): bot.add_view(CounterView()) @@ -37,7 +38,7 @@ class CounterView(discord.ui.View): # Create a class called MyView that subclas storage["counter"] = storage["counter"] + 1 with open('storage.json', 'w') as f: json.dump(storage, f) - message = bot.get_message(storage["message_id"]) + message = bot.get_message(int(storage["message_id"])) await message.edit(embed=create_embed(storage["counter"]), view=CounterView()) await interaction.response.send_message("Fertig", ephemeral=True)