本文介紹了Discord bot 盡管獲得了許可,但不能提及所有人的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
這里是 sendMessage 函數:
Here is the sendMessage function:
async def sendMessage(color, title, value, should_delete=True, channel=""):
embed = discord.Embed(color=color)
embed.add_field(name=title, value=value, inline=False)
if channel == "":
msg = await client.send_message(message_obj.channel, embed=embed)
else:
msg = await client.send_message(client.get_channel(channel), embed=embed)
if should_delete:
await delete_msg(msg)
機器人可以在此處提及除所有人之外的任何人.盡管提到了所有人的許可.
The bot can mention anyone but everyone and here. Despite having mention everyone permission.
sendMessage(OK_COLOR_HASH, "title", "Hello @everyone")
當我將消息類型轉換為普通類型而不是嵌入類型時,它起作用了.
When I converted the message type to the normal one instead of embed one, it worked.
推薦答案
您可以嘗試通過 default_role
屬性向所有人發送提及
You can try to sending a mention to everyone through the default_role
attribute
@bot.command(pass_context=True)
async def evy(msg):
await bot.say(msg.message.server.default_role)
這篇關于Discord bot 盡管獲得了許可,但不能提及所有人的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!