def on_message(self,msg):
if self.bot.user.id == msg.author.id:
if isinstance(msg.channel,discord.DMChannel) is False:
try:
if self.bot.log_config.get(msg.guild.id):
if str(msg.channel.id) in self.bot.log_config[msg.guild.id]['channel']:
return
except:
pass
if isinstance(msg.channel,discord.TextChannel) is False:
utils.prCyan("PRIVATE")
utils.prGreen("<Event Send> {} : {} |||{}".format(self.Time(), msg.author.name, msg.clean_content))
else:
try:
if msg.embeds:
table = PrettyTable() #best to use it i guess
data = msg.embeds[0].fields
if data:
for x in data:
table.add_column(x.name,x.value.split("\n"))
content = str(msg.embeds[0].description) +"\n"
content +="\n" + str(table)
else:
content = msg.clean_content
utils.prGreen("<Event Send> {} : {} ||| {} ||| ({}) ||| {}".format(self.Time(), msg.author.name,msg.guild.name,msg.guild.id, content))
except:
utils.prGreen("<Event Send> {} : {} ||| {} ||| ({}) ||| {}".format(self.Time(), msg.author.name,msg.guild.name,msg.guild.id,msg.embeds))
评论列表
文章目录