T
T
Tim Novikov2021-09-10 10:55:38
Python
Tim Novikov, 2021-09-10 10:55:38

How to forward messages from a PM discord bot?

bot = commands.Bot(command_prefix = PREFIX)

@bot.command(pass_context = True)
@commands.has_role("Admin")
async def sayls(ctx, member: discord.Member,*, text):
    await ctx.message.delete()
    await member.send(text)


The function above sends private messages to the person mentioned in the mention.
Thus, you can write on behalf of the bot, but you can’t get a response from the user,
I want to send all messages that users send to the bot’s personal to a specific channel.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-09-10
@Tim_1527

Have you read the documentation ? There is also an on_message event.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question