This commit is contained in:
2024-08-10 18:26:15 +02:00
parent 911ca61fac
commit 029a0bbd8b

View File

@@ -111,7 +111,7 @@ async def create_discord_event(event: CreateDiscordEvent):
async with AsyncClient() as client: async with AsyncClient() as client:
response = await client.post( response = await client.post(
f"https://discord.com/api/v10/guilds/{config.DISCORD_GUILD_ID}/scheduled-events", f"https://discord.com/api/v10/guilds/{config.DISCORD_GUILD_ID}/scheduled-events",
json=event.model_dump(), data=event.model_dump_json(),
headers={"Authorization": f"Bot {config.DISCORD_BOT_TOKEN}"} headers={"Authorization": f"Bot {config.DISCORD_BOT_TOKEN}"}
) )
@@ -131,7 +131,7 @@ async def edit_discord_event(event_id: str, event: UpdateDiscordEvent):
async with AsyncClient() as client: async with AsyncClient() as client:
response = await client.patch( response = await client.patch(
f"https://discord.com/api/v10/guilds/{config.DISCORD_GUILD_ID}/scheduled-events/{event_id}", f"https://discord.com/api/v10/guilds/{config.DISCORD_GUILD_ID}/scheduled-events/{event_id}",
json=event.model_dump(), data=event.model_dump_json(),
headers={"Authorization": f"Bot {config.DISCORD_BOT_TOKEN}"} headers={"Authorization": f"Bot {config.DISCORD_BOT_TOKEN}"}
) )