Answer the question
In order to leave comments, you need to log in
How to get a user's nickname on the server using a Python discord bot?
import discord
client = discord.Client()
@client.event
if message.content.startswith('!имя') :
caller = message.author
caller = str(caller)
await message.channel.send(caller)
Answer the question
In order to leave comments, you need to log in
If the message was written in private, and not in the channel, then nothing. Because privates work past the server and are not connected with it in any way. If in a channel, then message.author.nick will return the nickname on that server.
The bot can sort through its servers for the presence of this user on them to identify it, but since the bot with the user can have more than one common server, this idea is so-so.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question