only publish set guild's events to website

This commit is contained in:
leander committed 2026-10-24 04:39:14 +02:00
1 parent 0e695e81df
commit 89b0a793e4
1 file changed
+6
+6
View File
@@ -68,6 +68,9 @@ class WebsiteEvents(commands.Cog):
event (discord.ScheduledEvent): The created event event (discord.ScheduledEvent): The created event
""" """
if event.guild_id != self.bot.guild_id:
return
# Convert timezone to Europe/Oslo # Convert timezone to Europe/Oslo
# We need to set a timezone unit before being able to convert it to another timezone # We need to set a timezone unit before being able to convert it to another timezone
# That's why this line is so fucking weird # That's why this line is so fucking weird
@@ -107,6 +110,9 @@ class WebsiteEvents(commands.Cog):
event (discord.ScheduledEvent): The deleted event event (discord.ScheduledEvent): The deleted event
""" """
if event.guild_id != self.bot.guild_id:
return
mutation = {"mutations": [{"delete": {"id": str(event.id)}}]} mutation = {"mutations": [{"delete": {"id": str(event.id)}}]}
response = requests.post(self.api_url, headers=self.auth_header, data=json.dumps(mutation)) response = requests.post(self.api_url, headers=self.auth_header, data=json.dumps(mutation))