diff --git a/src/bot.ts b/src/bot.ts index 38c9b31a4828d86c9b826cff38317aebf660adae..04b2b4cc0f0d4349825a814a3d64fdb054e21701 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -194,6 +194,10 @@ export class DiscordBot { if (botUser) { const webhooks = await chan.fetchWebhooks(); hook = webhooks.filterArray((h) => h.name === "_matrix").pop(); + // Create a new webhook if none already exists + if (!hook) { + hook = await chan.createWebhook("_matrix", "", "Matrix Bridge: Allow rich user messages"); + } } try { if (!botUser) {