【发布时间】:2020-07-14 07:33:46
【问题描述】:
如何向特定频道发送消息?
为什么我会收到此错误?我的ChannelID 是对的
代码:
from discord.ext import commands
client = commands.Bot(command_prefix='!')
channel = client.get_channel('693503765059338280')
@client.event
async def on_ready():
print('Bot wurde gestartet: ' + client.user.name)
#wts
@client.command()
async def test(ctx,name_schuh,preis,festpreis):
await channel.send(discord.Object(id='693503765059338280'),"Name:" + name_schuh +"\n Preis: " + preis +"\n Festpreis: " + festpreis)
错误:
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'send'
【问题讨论】:
标签: python discord discord.py