Skip to content

Commit f4dfedd

Browse files
fix: only override the webhook ID for configuring webhooks
this makes it easier to configure webhooks: we now only need to set their ID and not their channel. Setting the channel ID is only use for botstrap configuration, anyhow.
1 parent 268963e commit f4dfedd

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

bot/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class Webhook(BaseModel):
264264
channel: int
265265

266266

267-
class _Webhooks(EnvConfig, env_prefix="webhooks_"):
267+
class _Webhooks(EnvConfig, env_prefix="webhooks_", nested_model_default_partial_update=True):
268268

269269
big_brother: Webhook = Webhook(id=569133704568373283, channel=Channels.big_brother)
270270
dev_log: Webhook = Webhook(id=680501655111729222, channel=Channels.dev_log)

botstrap.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ def create_webhook(self, name: str, channel_id_: int) -> str:
319319
webhook_channel_id = int(all_channels[webhook_name])
320320
webhook_id = discord_client.create_webhook(formatted_webhook_name, webhook_channel_id)
321321
config_str += f"webhooks_{webhook_name}__id={webhook_id}\n"
322-
config_str += f"webhooks_{webhook_name}__channel={all_channels[webhook_name]}\n"
323322

324323
config_str += "\n#Emojis\n"
325324
config_str += "emojis_trashcan=🗑️"

0 commit comments

Comments
 (0)