Reputation: 11
I am not able to receive a response message when send a message in Discord? I think I have something wrong at here interaction.send("Hello!)
import nextcord
from nextcord import Button, Interaction
from nextcord.ext import commands
from config import DISCORD_ALERT_TOKEN
TESTING_GUILD_ID = 123456789 # Replace with your own guild IDs
client = commands.Bot(command_prefix="?")
@client.event
async def on_ready():
print(f"{client.user.name} has connected to Discord.")
await client.wait_until_ready()
channel = client.get_channel(int(966316317890207779))
await channel.send(f"{client.user.name} has connected to Discord.")
@client.slash_command(description="My first slash command", guild_ids=[TESTING_GUILD_ID])
async def hello(interaction: nextcord.Integration):
await interaction.send("Hello!")
client.run(DISCORD_ALERT_TOKEN)
Upvotes: 1
Views: 92
Reputation: 86
So after searching I found the problem.
If the scope application command is unchecked it will not work. You then have to select this and invite the bot again.
Upvotes: 1