D
D
dpushin12020-11-17 13:15:56
Python
dpushin1, 2020-11-17 13:15:56

How to send a message as a discord bot?

@tasks.loop(seconds=1.0)
async def printer():
    channel = client.get_channel(778145298672779324)
    await channel.send('@everyone до конца КД осталось меньше 5 минут!')

printer.start()

This code and this error:
AttributeError: 'NoneType' object has no attribute 'send'

How to fix it to send a message on behalf of the bot?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
s4q, 2020-11-17
@dpushin1

Isn't it obvious? The API was unable to obtain such a feed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question