Add a link to the message itself in logged messages. Closes #17
This commit is contained in:
parent
fd67945660
commit
4becc8a4e9
@ -32,9 +32,9 @@ class ChannelLogger:
|
||||
|
||||
return self.client.get_channel(str(log_channel))
|
||||
|
||||
async def send_to_log_channel(self, log_channel: discord.Channel, embed: discord.Embed):
|
||||
async def send_to_log_channel(self, log_channel: discord.Channel, embed: discord.Embed, text: str = None):
|
||||
try:
|
||||
await self.client.send_message(log_channel, embed=embed)
|
||||
await self.client.send_message(log_channel, embed=embed, content=text)
|
||||
except discord.Forbidden:
|
||||
# TODO: spew big error
|
||||
self.logger.warning(
|
||||
@ -75,9 +75,7 @@ class ChannelLogger:
|
||||
embed.set_thumbnail(url=message_image)
|
||||
|
||||
message_link = "https://discordapp.com/channels/{}/{}/{}".format(server_id, channel_id, message_id)
|
||||
embed.author.url = message_link
|
||||
|
||||
await self.send_to_log_channel(log_channel, embed)
|
||||
await self.send_to_log_channel(log_channel, embed, message_link)
|
||||
|
||||
async def log_message_deleted(self, conn,
|
||||
server_id: str,
|
||||
|
@ -1,15 +1,12 @@
|
||||
import os
|
||||
|
||||
import discord
|
||||
import logging
|
||||
import re
|
||||
import traceback
|
||||
from typing import Tuple, Optional, Union
|
||||
|
||||
from pluralkit import db
|
||||
from pluralkit.system import System
|
||||
from pluralkit.member import Member
|
||||
from pluralkit.bot import embeds, utils
|
||||
from pluralkit.member import Member
|
||||
from pluralkit.system import System
|
||||
|
||||
logger = logging.getLogger("pluralkit.bot.commands")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user