if message.content.startswith('Imagine'):
#Mentioned or not
if len(message.mentions) == 0:
#no one is mentioned
return
pinged_user = message.mentions[0]
await message.channel.send([pinged_user, "got ora ora ora'd and is no longer with us"])
Right now when I try it, it shows this I want it to show this
#另一个问题,我希望只有当你说“想象(提到的人)生活”时才会发生 提前致谢!
答案 0 :(得分:0)
欢迎堆栈溢出!这很完美,希望对您有所帮助。
import discord
from discord.ext import commands
prefix = "!"
intents = discord.Intents.default()
client = commands.Bot(command_prefix=prefix, intents=intents)
@client.event
async def on_ready():
print('connected to Discord as {0.user}'.format(client))
await client.change_presence(activity=discord.Game(name="example"))
@client.command()
async def imagine(ctx, member: discord.Member = None):
if member == None: return
await ctx.send(f"{member.mention} got ora ora ora'd and is no longer with us")
client.run('token')