mirror of
https://github.com/kurbezz/discord-bot.git
synced 2025-12-06 07:05:36 +01:00
Update
This commit is contained in:
@@ -124,7 +124,10 @@ async def create_discord_event(event: CreateDiscordEvent):
|
|||||||
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(),
|
json=event.model_dump(),
|
||||||
headers={"Authorization": f"Bot {config.DISCORD_BOT_TOKEN}"}
|
headers={
|
||||||
|
"Authorization": f"Bot {config.DISCORD_BOT_TOKEN}",
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if response.status_code == 400:
|
if response.status_code == 400:
|
||||||
@@ -150,7 +153,10 @@ async def edit_discord_event(event_id: str, event: UpdateDiscordEvent):
|
|||||||
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(),
|
json=event.model_dump(),
|
||||||
headers={"Authorization": f"Bot {config.DISCORD_BOT_TOKEN}"}
|
headers={
|
||||||
|
"Authorization": f"Bot {config.DISCORD_BOT_TOKEN}",
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if response.status_code == 400:
|
if response.status_code == 400:
|
||||||
|
|||||||
Reference in New Issue
Block a user