我试图定义一个函数,当调用该函数时,它会将消息发布到特定的discord通道。我不知道怎么做。这就是我目前所拥有的。有人能帮忙吗
编辑:我需要它在调用output()函数时运行,而不考虑其他事件
import discord
import asyncio
token = 'BOT TOKEN'
channelid = 'CHANNEL ID'
client = discord.Client()
def respond(output):
#this should make a discord bot send a message with a value of output to the channel of channelid
client.run(token)
respond('hello world')
您可以使用bot.get_频道(channelid)
这只是一个示例,很抱歉,堆栈溢出中的格式设置不好
相关问题 更多 >
编程相关推荐