@@ -2,10 +2,10 @@ package discord_utils
|
||||
|
||||
import "github.com/dustinpianalto/disgoman"
|
||||
|
||||
func GetChannelName(ctx disgoman.Context, id string) (string, error) {
|
||||
func GetChannelName(ctx disgoman.Context, id string) string {
|
||||
channel, err := ctx.Session.Channel(id)
|
||||
if err != nil {
|
||||
return "", err
|
||||
return ""
|
||||
}
|
||||
return channel.Name, nil
|
||||
return channel.Name
|
||||
}
|
||||
|
||||
@@ -2,13 +2,13 @@ package discord_utils
|
||||
|
||||
import "github.com/dustinpianalto/disgoman"
|
||||
|
||||
func GetDisplayName(ctx disgoman.Context, id string) (string, error) {
|
||||
func GetDisplayName(ctx disgoman.Context, id string) string {
|
||||
member, err := ctx.Session.GuildMember(ctx.Guild.ID, id)
|
||||
if err != nil {
|
||||
return "", err
|
||||
return ""
|
||||
}
|
||||
if member.Nick != "" {
|
||||
return member.Nick, nil
|
||||
return member.Nick
|
||||
}
|
||||
return member.User.Username, nil
|
||||
return member.User.Username
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user