1@bot.event
2async def on_message(message):
3 if message.content == "pong":
4 await message.channel.send('ping')
1@bot.event
2async def on_message(message):
3 if isinstance(message.channel, discord.channel.DMChannel) and message.author != bot.user:
4 await message.channel.send('This is a DM')