all repos — disgord @ 2d217f4b2580d9476ffdac02449fe8a4b6da212e

A simple Discord bot in Go.

src/globals.go (view raw)

 1package src
 2
 3import (
 4	"os"
 5
 6	"github.com/BiRabittoh/disgord/src/myconfig"
 7	"github.com/BiRabittoh/disgord/src/mylog"
 8	"github.com/bwmarrin/discordgo"
 9	"github.com/kkdai/youtube/v2"
10)
11
12const (
13	msgError = "Something went wrong."
14	helpFmt  = "%s - _%s_"
15)
16
17var (
18	CommitID string
19	Config   *myconfig.Config[MyConfig]
20
21	logger = mylog.NewLogger(os.Stdout, "main", mylog.DEBUG)
22	yt     = youtube.Client{}
23)
24
25type KeyValuePair struct {
26	Name  string `json:"name"`
27	Value string `json:"value"`
28}
29
30type MyConfig struct {
31	ApplicationID string `json:"applicationId"`
32	Token         string `json:"token"`
33
34	Prefix string `json:"prefix"`
35
36	Outros []KeyValuePair `json:"outros"`
37	Radios []KeyValuePair `json:"radios"`
38
39	MagazineSize uint `json:"magazineSize"`
40}
41
42type BotCommand struct {
43	Handler   func([]string, *discordgo.Session, *discordgo.MessageCreate) string
44	ShortCode string
45	Help      string
46}