【问题标题】:Discord.py Self Bot using rewriteDiscord.py Self Bot 使用重写
【发布时间】:2018-08-29 18:56:37
【问题描述】:

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

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

我希望我的 selfbot 在发送“>>>test”时回复“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)

【问题讨论】:

    标签: python python-3.x discord.py


    【解决方案1】:

    自我机器人不是使用self 的机器人,而是使用您的凭据而不是机器人帐户登录的机器人。自我机器人违反了 Discord TOS(而且您不需要做任何事情),因此您应该通过他们的网站设置一个机器人帐户并为您的机器人使用一个机器人帐户。

    也就是说,bot.say 在重写中已被 ctx.send 替换,并且您不在齿轮中,因此您不应该使用 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)
    

    【讨论】:

    • 它不再工作了。 on_ready 没有被解雇
    • @Volatil3 对自我机器人的支持已被删除,因为它违反了 Discord ToS。
    猜你喜欢
    • 2017-12-09
    • 2020-11-13
    • 2021-08-19
    • 2020-02-23
    • 2019-02-26
    • 2020-07-21
    • 1970-01-01
    • 1970-01-01
    • 2020-12-06
    相关资源
    最近更新 更多