Skip to content

Slash commands are not working #492

Description

@master-of-darkness

Summary

Slash command not working

Reproduction Steps

I just created simple slash command and during 2 hours its not appearing

Minimal Reproducible Code

@bot.slash_command(name="news", description="Only for admins")
async def news(interaction: disnake.ApplicationCommandInteraction):
    print(interaction.author.roles)
    if "Модератор" in interaction.author.roles:
        await interaction.response.send_modal(modal=news.News(bot=bot))
        interaction.response.is_done()
    else:
        interaction.response.is_done()


@bot.slash_command(name="online", description="Получить статус сервера")
async def online(interaction: disnake.ApplicationCommandInteraction):
    await interaction.response.send_message(embed=disnake.Embed(title="Статус сервера", description=f"**Онлайн {mc_status.players.online}/{mc_status.players.max}\n{mc_status.players.sample if mc_status.players.sample != False else 'Никого нет('}```"))

Expected Results

My slash command started working

Actual Results

It didn't working and nothing happening

Intents

nothing

System Information

  • Python v3.10.4-final
  • disnake v2.4.0-final
    • disnake pkg_resources: v2.4.0
  • aiohttp v3.7.4.post0
  • system info: Linux 5.16.19-200.fc35.x86_64 Extra features #1 SMP PREEMPT Fri Apr 8 15:34:44 UTC 2022

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

I waited 2 hours and my slash command not appearing in commands list and it's not working.Maybe I did smth wrong? I'm sorry for my English cuz I'm from Ukraine. I hope you will help me with my issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    unconfirmed bugSomething might not be working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions