Mentioning a user using a command [duplicate]









up vote
0
down vote

favorite













This question already has an answer here:



  • Getting a discord bot to mention other users

    2 answers



Now I was doing a random command called !insult to roast a person I tag with @

So my idea was going to write a message in discord chat such as
!insult @Diz and the bot would respond with @Diz you're bad

It's working fine with randomizing the "roasts" but I'm stuck on the @ part to tag that person I want.



If anyone could help me and knows a solution, I would appreciate it a lot.










share|improve this question















marked as duplicate by Cris Luengo, Patrick Haugh python
Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 10 at 23:36


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Welcome to Stack Overflow! See: The expectation on SO is that the user asking a question not only does research to answer their own question but also shares that research, code attempts, and results. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Without doing this, you may start to get downvotes.
    – Mozahler
    Nov 10 at 17:12














up vote
0
down vote

favorite













This question already has an answer here:



  • Getting a discord bot to mention other users

    2 answers



Now I was doing a random command called !insult to roast a person I tag with @

So my idea was going to write a message in discord chat such as
!insult @Diz and the bot would respond with @Diz you're bad

It's working fine with randomizing the "roasts" but I'm stuck on the @ part to tag that person I want.



If anyone could help me and knows a solution, I would appreciate it a lot.










share|improve this question















marked as duplicate by Cris Luengo, Patrick Haugh python
Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 10 at 23:36


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Welcome to Stack Overflow! See: The expectation on SO is that the user asking a question not only does research to answer their own question but also shares that research, code attempts, and results. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Without doing this, you may start to get downvotes.
    – Mozahler
    Nov 10 at 17:12












up vote
0
down vote

favorite









up vote
0
down vote

favorite












This question already has an answer here:



  • Getting a discord bot to mention other users

    2 answers



Now I was doing a random command called !insult to roast a person I tag with @

So my idea was going to write a message in discord chat such as
!insult @Diz and the bot would respond with @Diz you're bad

It's working fine with randomizing the "roasts" but I'm stuck on the @ part to tag that person I want.



If anyone could help me and knows a solution, I would appreciate it a lot.










share|improve this question
















This question already has an answer here:



  • Getting a discord bot to mention other users

    2 answers



Now I was doing a random command called !insult to roast a person I tag with @

So my idea was going to write a message in discord chat such as
!insult @Diz and the bot would respond with @Diz you're bad

It's working fine with randomizing the "roasts" but I'm stuck on the @ part to tag that person I want.



If anyone could help me and knows a solution, I would appreciate it a lot.





This question already has an answer here:



  • Getting a discord bot to mention other users

    2 answers







python python-3.x discord discord.py






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 19:57









Tristo

9552519




9552519










asked Nov 10 at 16:57









Volkoff

1




1




marked as duplicate by Cris Luengo, Patrick Haugh python
Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 10 at 23:36


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Cris Luengo, Patrick Haugh python
Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 10 at 23:36


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • Welcome to Stack Overflow! See: The expectation on SO is that the user asking a question not only does research to answer their own question but also shares that research, code attempts, and results. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Without doing this, you may start to get downvotes.
    – Mozahler
    Nov 10 at 17:12
















  • Welcome to Stack Overflow! See: The expectation on SO is that the user asking a question not only does research to answer their own question but also shares that research, code attempts, and results. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Without doing this, you may start to get downvotes.
    – Mozahler
    Nov 10 at 17:12















Welcome to Stack Overflow! See: The expectation on SO is that the user asking a question not only does research to answer their own question but also shares that research, code attempts, and results. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Without doing this, you may start to get downvotes.
– Mozahler
Nov 10 at 17:12




Welcome to Stack Overflow! See: The expectation on SO is that the user asking a question not only does research to answer their own question but also shares that research, code attempts, and results. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Without doing this, you may start to get downvotes.
– Mozahler
Nov 10 at 17:12












1 Answer
1






active

oldest

votes

















up vote
0
down vote













To tag a user you can use discord.User.mention just like it says in the documentation

For example, you can have something like



@bot.command()
async def test(user:discord.User):
await bot.say(f"user.mention you're bad")





share|improve this answer




















  • Thanks Tristo, that helped me, the exact command didn't work but I found a way,this is how it worked for me: @bot.command() async def insult(user:discord.User): await bot.say(random.choice(["%s blob." % user.mention]))
    – Volkoff
    Nov 11 at 9:09


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













To tag a user you can use discord.User.mention just like it says in the documentation

For example, you can have something like



@bot.command()
async def test(user:discord.User):
await bot.say(f"user.mention you're bad")





share|improve this answer




















  • Thanks Tristo, that helped me, the exact command didn't work but I found a way,this is how it worked for me: @bot.command() async def insult(user:discord.User): await bot.say(random.choice(["%s blob." % user.mention]))
    – Volkoff
    Nov 11 at 9:09















up vote
0
down vote













To tag a user you can use discord.User.mention just like it says in the documentation

For example, you can have something like



@bot.command()
async def test(user:discord.User):
await bot.say(f"user.mention you're bad")





share|improve this answer




















  • Thanks Tristo, that helped me, the exact command didn't work but I found a way,this is how it worked for me: @bot.command() async def insult(user:discord.User): await bot.say(random.choice(["%s blob." % user.mention]))
    – Volkoff
    Nov 11 at 9:09













up vote
0
down vote










up vote
0
down vote









To tag a user you can use discord.User.mention just like it says in the documentation

For example, you can have something like



@bot.command()
async def test(user:discord.User):
await bot.say(f"user.mention you're bad")





share|improve this answer












To tag a user you can use discord.User.mention just like it says in the documentation

For example, you can have something like



@bot.command()
async def test(user:discord.User):
await bot.say(f"user.mention you're bad")






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 10 at 17:27









Tristo

9552519




9552519











  • Thanks Tristo, that helped me, the exact command didn't work but I found a way,this is how it worked for me: @bot.command() async def insult(user:discord.User): await bot.say(random.choice(["%s blob." % user.mention]))
    – Volkoff
    Nov 11 at 9:09

















  • Thanks Tristo, that helped me, the exact command didn't work but I found a way,this is how it worked for me: @bot.command() async def insult(user:discord.User): await bot.say(random.choice(["%s blob." % user.mention]))
    – Volkoff
    Nov 11 at 9:09
















Thanks Tristo, that helped me, the exact command didn't work but I found a way,this is how it worked for me: @bot.command() async def insult(user:discord.User): await bot.say(random.choice(["%s blob." % user.mention]))
– Volkoff
Nov 11 at 9:09





Thanks Tristo, that helped me, the exact command didn't work but I found a way,this is how it worked for me: @bot.command() async def insult(user:discord.User): await bot.say(random.choice(["%s blob." % user.mention]))
– Volkoff
Nov 11 at 9:09




這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

Museum of Modern and Contemporary Art of Trento and Rovereto