So I know that there is a similar question on stack overflow but it is for discord.js and I use discord.py so can someone tell me (also this is my first question on stack overflow)
How can I make my discord.py bot mentions someone mentioned in my message?
462 views Asked by SYCK playz At
2
There are 2 answers
3
On
(This is my first reply aswell!)
so lets say
import discord
from discord.ext import commands #or command I can't remember)
#setup setting(on_ready.. etc)
@client.command(ctx, target:discord.Member == None) #CTX represents your command, target means your mentioned member
if target == None:
await ctx.send("You didn't mention anyone!")
else:
await ctx.send(target.mention)
#client run token
Okay so the above one is almost correct. The solution is:
so it's
target:discord.Member = None
instead oftarget:discord.Member == None
and that async def thingy ofcourse :)