Python 使用重写的Discord.py Self Bot

Python 使用重写的Discord.py Self Bot,python,python-3.x,discord.py,Python,Python 3.x,Discord.py,我正在尝试使用discord.py rewrite制作一个selfbot 我在尝试创建简单命令时遇到问题 我希望我的selfbot在发送“>>>测试”时用“oof”进行响应 这是我的密码: import asyncio import discord from discord.ext import commands bot = commands.Bot(command_prefix=(">>>"), self_bot=True) @bot.event a

我正在尝试使用discord.py rewrite制作一个selfbot

我在尝试创建简单命令时遇到问题

我希望我的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)

self bot不是使用
self
的bot,而是使用您的凭据而不是bot帐户登录的bot。Self-bot反对Discord-TOS(而且你没有做任何需要它的事情),因此你应该通过他们的网站建立一个bot帐户,并为你的bot使用一个bot帐户

这就是说,
bot.say
已被重写中的
ctx.send
所取代,并且您不在cog中,因此您不应该像所有人一样使用
self

from discord.ext import commands

bot = commands.Bot(">>>", self_bot=True)

@bot.event
async def on_ready():
    print("Bot presence t u r n e d on ( ͡° ͜ʖ ͡°)")

@bot.command()
async def test(ctx):
    await ctx.send("oof")

bot.run("my token", bot=False)

self bot不是使用
self
的bot,而是使用您的凭据而不是bot帐户登录的bot。Self-bot反对Discord-TOS(而且你没有做任何需要它的事情),因此你应该通过他们的网站建立一个bot帐户,并为你的bot使用一个bot帐户

这就是说,
bot.say
已被重写中的
ctx.send
所取代,并且您不在cog中,因此您不应该像所有人一样使用
self

from discord.ext import commands

bot = commands.Bot(">>>", self_bot=True)

@bot.event
async def on_ready():
    print("Bot presence t u r n e d on ( ͡° ͜ʖ ͡°)")

@bot.command()
async def test(ctx):
    await ctx.send("oof")

bot.run("my token", bot=False)