【发布时间】:2021-03-27 16:28:54
【问题描述】:
我正在尝试定义一个函数,该函数将在调用该函数时将消息发布到特定的不和谐频道。我不知道该怎么做。这就是我到目前为止所拥有的。有人可以帮忙吗?
编辑:无论其他事件如何,只要调用 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')
【问题讨论】:
标签: python python-3.x discord