So, I'm working on a discord bot. And am using the on_message() event, which works both on private messages and on servers. I want this to only work in private messages and am unsure of how to go about this. If anyone can help me, that would be great.
import os
import discord
from discord.ext import commands
TOKEN = ''
quotedUsers = []
client = commands.Bot(command_prefix = '/')
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
await client.change_presence(activity=discord.Game(name='with myself.'))
@client.event
async def on_message(message):
await message.author.send("Recieved: " + message.content)
@client.command()
async def search(ctx, *, question):
await ctx.author.send("Searching: " + question)
client.run(TOKEN)