Fix webhook test message
This commit is contained in:
parent
2d8abfa479
commit
c546379194
@ -295,8 +295,12 @@ class LoggingCog(commands.Cog):
|
|||||||
await ctx.send(f"✅ Successfully configured logging to send messages to {channel.mention} via the new webhook `{new_webhook.name}`.")
|
await ctx.send(f"✅ Successfully configured logging to send messages to {channel.mention} via the new webhook `{new_webhook.name}`.")
|
||||||
# Test send (optional)
|
# Test send (optional)
|
||||||
try:
|
try:
|
||||||
test_embed = self._create_log_embed("✅ Logging Setup Complete", f"Logs will now be sent to this channel via the webhook `{new_webhook.name}`.", color=discord.Color.green())
|
test_embed = self._create_log_embed(
|
||||||
await new_webhook.send(embed=test_embed, username=webhook_name, avatar_url=self.bot.user.display_avatar.url)
|
"✅ Logging Setup Complete",
|
||||||
|
f"Logs will now be sent to this channel via the webhook `{new_webhook.name}`.",
|
||||||
|
color=discord.Color.green(),
|
||||||
|
)
|
||||||
|
await new_webhook.send(view=test_embed, username=webhook_name, avatar_url=self.bot.user.display_avatar.url)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(f"Failed to send test message via new webhook for guild {guild.id}: {e}")
|
log.error(f"Failed to send test message via new webhook for guild {guild.id}: {e}")
|
||||||
await ctx.send("⚠️ Could not send a test message via the new webhook, but the URL has been saved.")
|
await ctx.send("⚠️ Could not send a test message via the new webhook, but the URL has been saved.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user