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
Add a comment  | 

1 Answer 1

Reset to default 0

This 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