'How to get the member's server nickname discord.py

I want to get the member's nickname from a certain server which i chose. Not the server the command is sent in



Solution 1:[1]

  1. Your bot needs to be in the guild you want to get the nickname from.
  2. You then can fetch/get the guild using: guild = await client.fetch_guild(guild_id)
  3. Then you can fetch the member from that guild using: member = await guild.fetch_member(member_id)
  4. Using the nick attribute you can return the nick. print(member.nick)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 XoutDragon