【问题标题】:How do I make my bot writhe a welcome message in a chat?如何让我的机器人在聊天中写欢迎消息?
【发布时间】:2021-07-30 17:22:02
【问题描述】:

大家好,我正在尝试让我的机器人在特定聊天中扭动欢迎消息并使用此代码。 但是什么也没发生,我不知道为什么


import discord
from discord.ext import commands, tasks


intents = discord.Intents(messages=True, guilds=True, reactions=True, members=True, presences=True,)
client = commands.Bot(command_prefix='Ayaka ')


@client.event
async def on_member_join(member):
    await client.get_channel(channelID).send(f"{member.name} has joined")

@client.event
async def on_member_remove(member):
    await client.get_channel(channelID).send(f"{member.name} has left")
    
client.run(Token)    

【问题讨论】:

标签: python discord.py


【解决方案1】:

定义前缀后,添加逗号并输入intents=intents。根据经验,我了解到顶行只会定义意图。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-23
    • 2020-10-14
    • 1970-01-01
    • 2020-05-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多