import disnake
from disnake.ext import commands
intents = disnake.Intents.default()
intents.members = True
intents.message_content = True
command_sync_flags = commands.CommandSyncFlags.default()
command_sync_flags.sync_commands_debug = False
TOKEN = "тут был токен"
bot =
commands.Bot (
command_prefix='=',
command_sync_flags=command_sync_flags,
intents=intents
)
@bot.command()
async def hello(ctx):
await ctx.reply("Hello!")
bot.run (TOKEN)
Сам код:
import disnake from disnake.ext import commands intents = disnake.Intents.default() intents.members = True intents.message_content = True command_sync_flags = commands.CommandSyncFlags.default() command_sync_flags.sync_commands_debug = False TOKEN = "тут был токен " bot = commands.Bot ( command_prefix='=', command_sync_flags=command_sync_flags, intents=intents ) bot = commands.Bot (command_prefix='=') @bot.command() async def hello(ctx): await ctx.reply("Hello!") bot.run (TOKEN)
Ошибка:
This may cause limited functionality for prefix commands. If you want prefix commands, pass an intents object with message_content set to True. If you don't need any prefix functionality, consider using InteractionBot. Alternatively, set prefix to disnake.ext.commands.when_mentioned to silence this warning.
bot = commands.Bot (command_prefix='=')