trying to make my bot reply to DMs with "this is a dm" but no luck, here's my code:
@client.event
async def on_message(message):
if message.guild == null:
await message.channel.send('this is a dm')
else:
pass
I've also tried using this:
@client.event
async def on_message(message):
if isinstance(message.channel, discord.channel.DMChannel):
await ctx.send('This is a DM')
On that last one, I get an error due to context (ctx)