Answer the question
In order to leave comments, you need to log in
How to make the command work only in pm + log?
As planned, the bot should respond to the command that is sent to the PM. If the command is sent in a server channel - no response. In fact, the bot perceives the command both in LAN and in channels.
1. How to actually do so that the reaction to the command would be only in PM?
2. How to make a bot message log, for example, for 24 hours, in the form user/message?
@bot.command()
async def anon(ctx, *, arg):
if discord.ChannelType.private:
channel = bot.get_channel(#id)
await channel.send(arg)
Answer the question
In order to leave comments, you need to log in
1. https://discordpy.readthedocs.io/en/stable/ext/com...
@bot.command()
@commands.dm_only()
async def cmd(...):
isinstance(ctx.channel, discord.DMchannel)
# или
ctx.channel.type == discord.ChannelType.private
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question