[英]I am not able to receive a response message when send a message in Discord?
在 Discord 中發送消息時,我無法收到響應消息? 我認為我在這里的交互有問題。發送(“你好!)
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)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.