要删除它们,您需要通过指定您的公会来同步树: # this will update the client commands which are only from your guild await ctx.bot.tree.sync(guild=ctx.guild) 您只需要运行一次。本站已为你智能检索到如下内容,以供参考: 🐻 相关问答 6 个 1、Discord JS:通过slash命令关闭bot 2、在没有GuildID的...
在应用仪表板中配置Bot和slash commands等相关设置。 3.配置Bot 转到“Bot”选项卡,点击“Add Bot”以添加一个Bot到您的应用。获取Bot的token,这将在后续步骤中用于验证。设置Bot的权限,确保它具有执行必要操作的权限,例如发送消息、读取消息历史记录等。 4.创建Slash Commands 转到“Interactions”选项卡,点击“Add ...
在“Scopes”部分,选择“bot”复选框。然后,根据您的需求,选择适当的权限。一般来说,您至少需要“Send Messages”和“Read Messages”权限。然后,复制生成的URL并在浏览器中打开。选择要将机器人添加到的服务器,并按照提示完成添加过程。 编写discord.py代码:使用您喜欢的文本编辑器,创建一个新的Python文件,并使用d...
python discord discordapp discord-bot discord-server discord-py slash-commands python-bot hacktoberfest discordbot krypton discord-bot-template python-discord-bot discord-automation user-discord python-discord-bot-template discord-slash-commands Updated Apr 9, 2025 Python dolfies / discord.py-self...
discord.py 是一个流行的 Python 库,用于创建和管理 Discord 机器人。斜杠命令(Slash Commands)是 Discord 引入的一种新型命令系统,它允许用户在消息中直接输入命令,而不是传统的以感叹号或前缀开头的命令。 基础概念 在discord.py 中使用斜杠命令时,有时需要预定义时间格式。这通常涉及到使用 datetime 模块来处理日...
🚀 Dismake is a framework for building stateless Discord bots with Slash Commands, built on top of FastAPI. dismake-docs.netlify.app Topics python python3 slash-commands interactions discord-bot-framework discord-bots discord-interactions discord-slash-commands dismake Resources Readme License...
const commands = [new SlashCommandBuilder().setName('ask').setDescription('Ask MUDBot a yes or no question').addStringOption(option => option.setName('question') .setDescription('The question that you want answered') .setRequired(true)); 然后,在斜杠命令上有了选项后,在运行该命令时获取该...
Bot in Discord with discord.js (1) 前言 利用discord.js 建立一个 Discord 机器人。 我也是第一次上手,利用博客来记录我的学习过程,定期整理后再发到公众号。 在简单对比了 discord.js (JavaScript),discordgo (Go),discord.py (Python),Discord4J (Java),JDA (Java) 和 D++ (C++) 等项目后,我选择了...
I ran my bot, python3.9 MinecraftBot.py Minimal Reproducible Code import json, requests, discord, asyncio, time, itertools, os, topgg Expected Results Everything to run smoothly and the Slash commands to be working. Actual Results Traceback (most recent call last): File "/home/quartz_i...
1.定义discord.Client和commands.Bot 你应该只使用一个,为了我下面的例子的目的,我将使用commands.bot...