Discord.py Self Bot using rewrite(Discord.py Self Bot 使用重写)
问题描述
我正在尝试使用 discord.py rewrite 制作一个 selfbot.
I'm trying to make a selfbot using discord.py rewrite.
我在尝试创建简单命令时遇到问题.
I'm encountering issues when attempting to create a simple command.
我希望我的 selfbot 以oof"响应.当>>>测试"时已发送.
I'd like my selfbot to respond with "oof" when ">>>test" is sent.
这是我的代码:
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 的机器人,它是使用您的凭据而不是机器人登录的机器人帐户.自我机器人违反了 Discord TOS(而且您不需要做任何事情),因此您应该通过他们的网站设置机器人帐户并为您的机器人使用机器人帐户.
A self-bot isn't a bot that uses self, it's a bot that logs in using your credentials instead of a bot account. Self bots are against the Discord TOS (and you're not doing anything that requires one), so you should set up a bot account through their website and use a bot account for your bot.
也就是说,bot.say 在重写中已被 ctx.send 取代,并且您不在 cog 中,因此您不应该使用 自我.
That said, bot.say has been replaced by ctx.send in rewrite, and you're not in a cog so you shouldn't use self as all.
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)
这篇关于Discord.py Self Bot 使用重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Discord.py Self Bot 使用重写
基础教程推荐
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 包装空间模型 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 求两个直方图的卷积 2022-01-01
