#python #discord
#python #Discord
Вопрос:
...on_message():
channel = message.channel
embed = discord.Embed(title=f"**Ok {member_name}**", description=f"Command cancelled. You might get better results with a second read.nnOr please see {info_chan} under 'Updating Stats' for other update options.", color=0xcc79a7)
await channel.send(embed=embed)
по какой-то причине это не работает. У меня есть тот же код в других операторах on_message if, которые работают отлично
Комментарии:
1. Вы получаете какую-либо ошибку?
Ответ №1:
Я думаю, что могу тебе помочь!
Похоже, ваше on_message не отправляется, потому что вы забыли добавить параметры при создании своего события (вы могли бы иметь это, но не показывали его)! Кроме того, этот цвет не существует, поэтому я бы дважды проверил ваш шестнадцатеричный код. Вот как вы можете решить свою проблему:
@bot.event
async def on_message(message): # I defined my message
channel = message.channel
embed = discord.Embed(
title = f"Okay {message.author.name}#{message.author.discriminator}",
# I did this only so that way if the event gets called in a private channel ^,
# you wont get an error (message.author returns abc.User if it's in a private channel.)
description = f"Command cancelled. You might get better results with a second read.nnOr please see {info_chan} under 'Updating Stats' for other update options.",
color = CC79A7) # did a pink for you
await channel.send(embed=embed)
Вы можете проверить discord.py документы здесь: https://discordpy.readthedocs.io/en/latest/api.html ?выделить = вставить #discord.Embed.color