admin管理员组文章数量:1122832
I wanted to try adding / commands to my bot but for some reason it allways tells me the errormessage "Couldnt react in time" in discord why is this happening
import discord
import os
from discord.ext import commands
from discord import app_commands, Interaction
BOT_TOKEN = 'mycode'
# Create bot instance with intents
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='.', intents=intents)
# Define slash command arguments
@bot.treemand(name='test', description='Gibt es monkeys')
async def test(interaction: Interaction):
response = f"Received: Hallo"
await interaction.response.send_message(response)
@bot.event
async def on_ready():
try:
print(f'Signed in as {bot.user}')
await bot.tree.sync() # Sync slash commands
print(f"Successfully synced commands.")
except Exception as e:
print(f"Error syncing commands: {e}")
@botmand()
async def Test(ctx):
await ctx.send("test")
# Run the bot
bot.run(BOT_TOKEN)
I wanted to try adding / commands to my bot but for some reason it allways tells me the errormessage "Couldnt react in time" in discord why is this happening
import discord
import os
from discord.ext import commands
from discord import app_commands, Interaction
BOT_TOKEN = 'mycode'
# Create bot instance with intents
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='.', intents=intents)
# Define slash command arguments
@bot.tree.command(name='test', description='Gibt es monkeys')
async def test(interaction: Interaction):
response = f"Received: Hallo"
await interaction.response.send_message(response)
@bot.event
async def on_ready():
try:
print(f'Signed in as {bot.user}')
await bot.tree.sync() # Sync slash commands
print(f"Successfully synced commands.")
except Exception as e:
print(f"Error syncing commands: {e}")
@bot.command()
async def Test(ctx):
await ctx.send("test")
# Run the bot
bot.run(BOT_TOKEN)
Share
Improve this question
asked Nov 21, 2024 at 12:49
Manu YTManu YT
1
1
- Could you post the whole error message so that we can further troubleshoot the issue? – Pearoo Commented Nov 24, 2024 at 15:21
1 Answer
Reset to default 0This is not a problem with your code/bot. Discord was having an "Issue preventing some bot interactions". The issue is fixed now and you can see the status here.
本文标签: pythonDiscordpy not respondingStack Overflow
版权声明:本文标题:python - Discord.py not responding - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736310772a1934497.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论