我一直在尝试制作一个对某个频道中的消息做出反应的不和谐机器人。但是我用我当前的代码无法实现它。我被告知要使用get_channel,我尝试了几种不同的方法,但它没有用。那么我如何使用get_channel仅对某个频道中的消息作出反应?
if message.content.startswith('@'):
currevents = get_channel(273977792159416321)
if message.channel is currevents:
await client.add_reaction(message, ":nocheck:432565697349025803")
await client.add_reaction(message, ":yescheck:432565678529052672")
这是我得到的错误:
Ignoring exception in on_message
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/discord/client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "APSIAbot.py", line 28, in on_message
currevents = get_channel("273977792159416321")
NameError: name 'get_channel' is not defined