fix not finding message

This commit is contained in:
2023-11-16 23:17:26 +01:00
parent 0555bd7a03
commit 552903f760

View File

@@ -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)