Dustin Pianalto 128011c79a
Some checks are pending
CI / build (push) Waiting to run
Add comment command
2021-02-23 21:56:10 -09:00

15 lines
323 B
Go

package discord_utils
import "github.com/dustinpianalto/disgoman"
func GetDisplayName(ctx disgoman.Context, id string) (string, error) {
member, err := ctx.Session.GuildMember(ctx.Guild.ID, id)
if err != nil {
return "", err
}
if member.Nick != "" {
return member.Nick, nil
}
return member.User.Username, nil
}