您好我试图使用discord.py重写进行教育测试的自我机器人 .
我目前正在制作一个响应命令的简单命令 .
当我输入并发送“>>> test”时,我希望我的selfbot说“oof”
这是我的代码:
import asyncio
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix=(">>>"), self_bot=True)
@bot.event
async def on_ready():
print("Bot presence t u r n e d on ( ͡° ͜ʖ ͡°)")
@bot.command()
async def test(self, ctx):
await self.bot.say("oof")
bot.run("my token", bot=False)
1 回答
自我机器人不是使用
self
的机器人,它不会做任何需要的东西),所以你应该通过他们的网站 Build 一个机器人账户并为你的机器人使用机器人账户 .也就是说,
bot.say
已被重写中的ctx.send
替换,并且're not in a cog so you shouldn' t使用self
作为全部 .