S
S
Sunter2021-07-13 21:07:50
Python
Sunter, 2021-07-13 21:07:50

How to make the bot write a message in another channel when writing a message in one channel?

There is a channel, if a person writes something in it, the bot sends a message in another channel ("Hello, {user id here}')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dream, 2021-07-13
@dreameddd

It is not clear what you want to be sent 1 time (on the first message of the user) or always? (for each user message). If the 1st case - then you need a database, there you can count how many messages the user has using on_message
Code to send a message to another channel:

channel = bot.get_channel(id канала)
await channel.send('Hello, ...')

To get the user id use ctx.author.id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question