This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
PermissionGacha/modules/commands/shard.go

25 lines
465 B
Go

package commands
import (
"fmt"
"github.com/bwmarrin/discordgo"
"PermissionGacha/db"
)
func handleShardCommand(s *discordgo.Session, args []string, m *discordgo.MessageCreate) error {
shard, err := db.GetShard(m.Author.ID)
if err != nil {
return fmt.Errorf("commands: handleShardCommand: error while getting shards: %w", err)
}
s.ChannelMessageSend(
m.ChannelID,
fmt.Sprintf(
"<@%s> has %d shards.",
m.Author.ID, shard,
),
)
return nil
}