Add comment command
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package discord_utils
|
||||
|
||||
import "github.com/dustinpianalto/disgoman"
|
||||
|
||||
func GetChannelName(ctx disgoman.Context, id string) (string, error) {
|
||||
channel, err := ctx.Session.Channel(id)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return channel.Name, nil
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user