build(gokord): upgrade to 0.7.0
This commit is contained in:
parent
24f0db3721
commit
642025681b
11 changed files with 125 additions and 31 deletions
|
@ -12,7 +12,7 @@ import (
|
||||||
|
|
||||||
func ConfigShow(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
func ConfigShow(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
cfg := config.GetGuildConfig(i.GuildID)
|
cfg := config.GetGuildConfig(i.GuildID)
|
||||||
resp := utils.ResponseBuilder{C: s, I: i}
|
resp := utils.NewResponseBuilder(s, i)
|
||||||
roles := ""
|
roles := ""
|
||||||
l := len(cfg.XpRoles) - 1
|
l := len(cfg.XpRoles) - 1
|
||||||
for i, r := range cfg.XpRoles {
|
for i, r := range cfg.XpRoles {
|
||||||
|
@ -80,8 +80,7 @@ func ConfigShow(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
|
|
||||||
func ConfigXP(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
func ConfigXP(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
optMap := utils.GenerateOptionMapForSubcommand(i)
|
optMap := utils.GenerateOptionMapForSubcommand(i)
|
||||||
resp := utils.ResponseBuilder{C: s, I: i}
|
resp := utils.NewResponseBuilder(s, i).IsEphemeral()
|
||||||
resp.IsEphemeral()
|
|
||||||
// verify every args
|
// verify every args
|
||||||
t, ok := optMap["type"]
|
t, ok := optMap["type"]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -214,8 +213,7 @@ func ConfigXP(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
|
|
||||||
func ConfigChannel(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
func ConfigChannel(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
optMap := utils.GenerateOptionMapForSubcommand(i)
|
optMap := utils.GenerateOptionMapForSubcommand(i)
|
||||||
resp := utils.ResponseBuilder{C: s, I: i}
|
resp := utils.NewResponseBuilder(s, i).IsEphemeral()
|
||||||
resp.IsEphemeral()
|
|
||||||
// verify every args
|
// verify every args
|
||||||
t, ok := optMap["type"]
|
t, ok := optMap["type"]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -286,8 +284,7 @@ func ConfigChannel(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
|
|
||||||
func ConfigFallbackChannel(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
func ConfigFallbackChannel(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
optMap := utils.GenerateOptionMapForSubcommand(i)
|
optMap := utils.GenerateOptionMapForSubcommand(i)
|
||||||
resp := utils.ResponseBuilder{C: s, I: i}
|
resp := utils.NewResponseBuilder(s, i).IsEphemeral()
|
||||||
resp.IsEphemeral()
|
|
||||||
// verify every args
|
// verify every args
|
||||||
salon, ok := optMap["channel"]
|
salon, ok := optMap["channel"]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -329,8 +326,7 @@ func ConfigFallbackChannel(s *discordgo.Session, i *discordgo.InteractionCreate)
|
||||||
|
|
||||||
func ConfigPeriodBeforeReduce(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
func ConfigPeriodBeforeReduce(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
optMap := utils.GenerateOptionMapForSubcommand(i)
|
optMap := utils.GenerateOptionMapForSubcommand(i)
|
||||||
resp := utils.ResponseBuilder{C: s, I: i}
|
resp := utils.NewResponseBuilder(s, i).IsEphemeral()
|
||||||
resp.IsEphemeral()
|
|
||||||
// verify every args
|
// verify every args
|
||||||
days, ok := optMap["days"]
|
days, ok := optMap["days"]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func Credits(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
func Credits(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
resp := utils.ResponseBuilder{C: s, I: i}
|
resp := utils.NewResponseBuilder(s, i)
|
||||||
err := resp.Embeds([]*discordgo.MessageEmbed{
|
err := resp.Embeds([]*discordgo.MessageEmbed{
|
||||||
{
|
{
|
||||||
Type: discordgo.EmbedTypeRich,
|
Type: discordgo.EmbedTypeRich,
|
||||||
|
|
|
@ -14,7 +14,7 @@ func Rank(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
msg := "Votre niveau"
|
msg := "Votre niveau"
|
||||||
m := i.Member
|
m := i.Member
|
||||||
var err error
|
var err error
|
||||||
resp := utils.ResponseBuilder{C: s, I: i}
|
resp := utils.NewResponseBuilder(s, i)
|
||||||
if v, ok := optMap["copaing"]; ok {
|
if v, ok := optMap["copaing"]; ok {
|
||||||
u := v.UserValue(s)
|
u := v.UserValue(s)
|
||||||
if u.Bot {
|
if u.Bot {
|
||||||
|
|
|
@ -10,15 +10,13 @@ import (
|
||||||
func Reset(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
func Reset(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
var copaings []*user.Copaing
|
var copaings []*user.Copaing
|
||||||
gokord.DB.Where("guild_id = ?", i.GuildID).Delete(&copaings)
|
gokord.DB.Where("guild_id = ?", i.GuildID).Delete(&copaings)
|
||||||
resp := utils.ResponseBuilder{C: s, I: i}
|
if err := utils.NewResponseBuilder(s, i).IsEphemeral().Message("L'XP a été reset.").Send(); err != nil {
|
||||||
if err := resp.IsEphemeral().Message("L'XP a été reset.").Send(); err != nil {
|
|
||||||
utils.SendAlert("commands/reset.go - Sending success (all)", err.Error())
|
utils.SendAlert("commands/reset.go - Sending success (all)", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func ResetUser(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
func ResetUser(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
resp := utils.ResponseBuilder{C: s, I: i}
|
resp := utils.NewResponseBuilder(s, i).IsEphemeral()
|
||||||
resp.IsEphemeral()
|
|
||||||
optMap := utils.GenerateOptionMap(i)
|
optMap := utils.GenerateOptionMap(i)
|
||||||
v, ok := optMap["user"]
|
v, ok := optMap["user"]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
|
@ -11,13 +11,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func Top(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
func Top(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||||
resp := utils.ResponseBuilder{C: s, I: i}
|
resp := utils.NewResponseBuilder(s, i).IsDeferred()
|
||||||
err := resp.IsDeferred().Send()
|
err := resp.Send()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.SendAlert("commands/top.go - Sending deferred", err.Error())
|
utils.SendAlert("commands/top.go - Sending deferred", err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp.NotDeferred().IsEdit()
|
|
||||||
embeds := make([]*discordgo.MessageEmbed, 3)
|
embeds := make([]*discordgo.MessageEmbed, 3)
|
||||||
wg := sync.WaitGroup{}
|
wg := sync.WaitGroup{}
|
||||||
|
|
||||||
|
|
80
config.go
Normal file
80
config.go
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/anhgelus/gokord"
|
||||||
|
"github.com/pelletier/go-toml/v2"
|
||||||
|
"gorm.io/driver/postgres"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Config struct {
|
||||||
|
Debug bool `toml:"debug"`
|
||||||
|
Author string `toml:"author"`
|
||||||
|
Redis *gokord.RedisCredentials `toml:"redis"`
|
||||||
|
Database *PostgresConfig `toml:"database"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type PostgresConfig struct {
|
||||||
|
Host string `toml:"host"`
|
||||||
|
User string `toml:"user"`
|
||||||
|
Password string `toml:"password"`
|
||||||
|
DBName string `toml:"db_name"`
|
||||||
|
Port int `toml:"port"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PostgresConfig) SetDefaultValues() {
|
||||||
|
p.Host = "localhost"
|
||||||
|
p.User = ""
|
||||||
|
p.Password = ""
|
||||||
|
p.DBName = ""
|
||||||
|
p.Port = 5432
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PostgresConfig) Connect() (*gorm.DB, error) {
|
||||||
|
db, err := gorm.Open(postgres.Open(p.generateDsn()), &gorm.Config{})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return db, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// generateDsn for the connection to postgres using the given config.SQLCredentials
|
||||||
|
func (p *PostgresConfig) generateDsn() string {
|
||||||
|
return fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=disable TimeZone=Europe/Paris",
|
||||||
|
p.Host, p.User, p.Password, p.DBName, p.Port,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Config) IsDebug() bool {
|
||||||
|
return c.Debug
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Config) GetAuthor() string {
|
||||||
|
return c.Author
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Config) GetRedisCredentials() *gokord.RedisCredentials {
|
||||||
|
return c.Redis
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Config) SetDefaultValues() {
|
||||||
|
c.Debug = false
|
||||||
|
c.Author = "anhgelus"
|
||||||
|
c.Redis = &gokord.RedisCredentials{}
|
||||||
|
c.Redis.SetDefaultValues()
|
||||||
|
c.Database = &PostgresConfig{}
|
||||||
|
c.Database.SetDefaultValues()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Config) GetSQLCredentials() gokord.SQLCredentials {
|
||||||
|
return c.Database
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Config) Marshal() ([]byte, error) {
|
||||||
|
return toml.Marshal(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Config) Unmarshal(bytes []byte) error {
|
||||||
|
return toml.Unmarshal(bytes, c)
|
||||||
|
}
|
5
go.mod
5
go.mod
|
@ -3,9 +3,10 @@ module github.com/anhgelus/les-copaings-bot
|
||||||
go 1.24
|
go 1.24
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/anhgelus/gokord v0.6.3
|
github.com/anhgelus/gokord v0.7.0
|
||||||
github.com/bwmarrin/discordgo v0.28.1
|
github.com/bwmarrin/discordgo v0.28.1
|
||||||
github.com/redis/go-redis/v9 v9.8.0
|
github.com/redis/go-redis/v9 v9.8.0
|
||||||
|
gorm.io/driver/postgres v1.5.11
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
@ -23,5 +24,5 @@ require (
|
||||||
golang.org/x/sync v0.14.0 // indirect
|
golang.org/x/sync v0.14.0 // indirect
|
||||||
golang.org/x/sys v0.33.0 // indirect
|
golang.org/x/sys v0.33.0 // indirect
|
||||||
golang.org/x/text v0.25.0 // indirect
|
golang.org/x/text v0.25.0 // indirect
|
||||||
gorm.io/driver/postgres v1.5.11 // indirect
|
gorm.io/gorm v1.26.1 // indirect
|
||||||
)
|
)
|
||||||
|
|
16
go.sum
16
go.sum
|
@ -16,6 +16,22 @@ github.com/anhgelus/gokord v0.6.2 h1:jR5l6NVGio+yChg8kxeNJSm6mbBfWxSLkvR6FPoh5E4
|
||||||
github.com/anhgelus/gokord v0.6.2/go.mod h1:R1SMf1+C8FshZ1/fDyBBt1Y9ob097UShHON21btlw2s=
|
github.com/anhgelus/gokord v0.6.2/go.mod h1:R1SMf1+C8FshZ1/fDyBBt1Y9ob097UShHON21btlw2s=
|
||||||
github.com/anhgelus/gokord v0.6.3 h1:4Z57e64YcecI6gokGVpIq8YOfvybJofX2Kx1HYRTuwo=
|
github.com/anhgelus/gokord v0.6.3 h1:4Z57e64YcecI6gokGVpIq8YOfvybJofX2Kx1HYRTuwo=
|
||||||
github.com/anhgelus/gokord v0.6.3/go.mod h1:UIpun+/+pgtvMQZdXvsy3qBhNSPG+q18shwDShDEI3Y=
|
github.com/anhgelus/gokord v0.6.3/go.mod h1:UIpun+/+pgtvMQZdXvsy3qBhNSPG+q18shwDShDEI3Y=
|
||||||
|
github.com/anhgelus/gokord v0.6.4-0.20250521131643-7da533f7f3bf h1:7dspKr7pByg/NK5y+/FTtSUixV6JFOL75EU8OKGTjbY=
|
||||||
|
github.com/anhgelus/gokord v0.6.4-0.20250521131643-7da533f7f3bf/go.mod h1:SfGKyMMGjNS9F9ehiEb5Cc58P+uoDdLDGGYqXSiMCus=
|
||||||
|
github.com/anhgelus/gokord v0.6.4-0.20250521133345-2e168a16e7c4 h1:mRp+EVtIVST0wG+cJD31NPF6eePAGon/25gSh5VCqIg=
|
||||||
|
github.com/anhgelus/gokord v0.6.4-0.20250521133345-2e168a16e7c4/go.mod h1:SfGKyMMGjNS9F9ehiEb5Cc58P+uoDdLDGGYqXSiMCus=
|
||||||
|
github.com/anhgelus/gokord v0.6.4-0.20250521141937-ca8f3d5a9972 h1:yvqA7TeG0xa7IOSYoY1p1gAXjz9XvKe99bQdZoTxACU=
|
||||||
|
github.com/anhgelus/gokord v0.6.4-0.20250521141937-ca8f3d5a9972/go.mod h1:SfGKyMMGjNS9F9ehiEb5Cc58P+uoDdLDGGYqXSiMCus=
|
||||||
|
github.com/anhgelus/gokord v0.6.4-0.20250521142735-c6a77bac401e h1:G8bPf9snE+C5UeBtvIQC+9iG3QIT/+z6p+Fa+TdMiEw=
|
||||||
|
github.com/anhgelus/gokord v0.6.4-0.20250521142735-c6a77bac401e/go.mod h1:SfGKyMMGjNS9F9ehiEb5Cc58P+uoDdLDGGYqXSiMCus=
|
||||||
|
github.com/anhgelus/gokord v0.6.4-0.20250521143137-6aab0f8d9c26 h1:h0HMHZXE+pEpPscPPyLBU2h6eEzXvcQQTfmIe+4NJzk=
|
||||||
|
github.com/anhgelus/gokord v0.6.4-0.20250521143137-6aab0f8d9c26/go.mod h1:SfGKyMMGjNS9F9ehiEb5Cc58P+uoDdLDGGYqXSiMCus=
|
||||||
|
github.com/anhgelus/gokord v0.6.4-0.20250521150912-98e83fc9532b h1:TeK9/A1lqyqtfKgjVK/uBOmGppKrqItdxvQm2NpnLDk=
|
||||||
|
github.com/anhgelus/gokord v0.6.4-0.20250521150912-98e83fc9532b/go.mod h1:SfGKyMMGjNS9F9ehiEb5Cc58P+uoDdLDGGYqXSiMCus=
|
||||||
|
github.com/anhgelus/gokord v0.6.4-0.20250521152340-0569047e55ef h1:FZ7ga9B56jxxDJMuaT5DRlFmzlRiFw+NV5WDNVSaySc=
|
||||||
|
github.com/anhgelus/gokord v0.6.4-0.20250521152340-0569047e55ef/go.mod h1:SfGKyMMGjNS9F9ehiEb5Cc58P+uoDdLDGGYqXSiMCus=
|
||||||
|
github.com/anhgelus/gokord v0.7.0 h1:G9GrxD3/xEreXsiz3etKxbeHsNHrwT5I/VEKSWpyrj4=
|
||||||
|
github.com/anhgelus/gokord v0.7.0/go.mod h1:SfGKyMMGjNS9F9ehiEb5Cc58P+uoDdLDGGYqXSiMCus=
|
||||||
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
|
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
|
||||||
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
|
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
|
||||||
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
|
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
|
||||||
|
|
13
main.go
13
main.go
|
@ -31,7 +31,7 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
err := gokord.SetupConfigs(nil, []*gokord.ConfigInfo{})
|
err := gokord.SetupConfigs(&Config{}, []*gokord.ConfigInfo{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,6 @@ func main() {
|
||||||
adm := gokord.AdminPermission
|
adm := gokord.AdminPermission
|
||||||
|
|
||||||
rankCmd := gokord.NewCommand("rank", "Affiche le niveau d'un copaing").
|
rankCmd := gokord.NewCommand("rank", "Affiche le niveau d'un copaing").
|
||||||
HasOption().
|
|
||||||
AddOption(gokord.NewOption(
|
AddOption(gokord.NewOption(
|
||||||
discordgo.ApplicationCommandOptionUser,
|
discordgo.ApplicationCommandOptionUser,
|
||||||
"copaing",
|
"copaing",
|
||||||
|
@ -59,7 +58,6 @@ func main() {
|
||||||
).
|
).
|
||||||
AddSub(
|
AddSub(
|
||||||
gokord.NewCommand("xp", "Modifie l'xp").
|
gokord.NewCommand("xp", "Modifie l'xp").
|
||||||
HasOption().
|
|
||||||
AddOption(gokord.NewOption(
|
AddOption(gokord.NewOption(
|
||||||
discordgo.ApplicationCommandOptionString,
|
discordgo.ApplicationCommandOptionString,
|
||||||
"type",
|
"type",
|
||||||
|
@ -83,7 +81,6 @@ func main() {
|
||||||
).
|
).
|
||||||
AddSub(
|
AddSub(
|
||||||
gokord.NewCommand("disabled-channels", "Modifie les salons désactivés").
|
gokord.NewCommand("disabled-channels", "Modifie les salons désactivés").
|
||||||
HasOption().
|
|
||||||
AddOption(gokord.NewOption(
|
AddOption(gokord.NewOption(
|
||||||
discordgo.ApplicationCommandOptionString,
|
discordgo.ApplicationCommandOptionString,
|
||||||
"type",
|
"type",
|
||||||
|
@ -101,7 +98,6 @@ func main() {
|
||||||
).
|
).
|
||||||
AddSub(
|
AddSub(
|
||||||
gokord.NewCommand("period-before-reduce", "Temps avant la perte d'xp (affecte aussi le /top)").
|
gokord.NewCommand("period-before-reduce", "Temps avant la perte d'xp (affecte aussi le /top)").
|
||||||
HasOption().
|
|
||||||
AddOption(gokord.NewOption(
|
AddOption(gokord.NewOption(
|
||||||
discordgo.ApplicationCommandOptionInteger,
|
discordgo.ApplicationCommandOptionInteger,
|
||||||
"days",
|
"days",
|
||||||
|
@ -111,7 +107,6 @@ func main() {
|
||||||
).
|
).
|
||||||
AddSub(
|
AddSub(
|
||||||
gokord.NewCommand("fallback-channel", "Modifie le salon textuel par défaut").
|
gokord.NewCommand("fallback-channel", "Modifie le salon textuel par défaut").
|
||||||
HasOption().
|
|
||||||
AddOption(gokord.NewOption(
|
AddOption(gokord.NewOption(
|
||||||
discordgo.ApplicationCommandOptionChannel,
|
discordgo.ApplicationCommandOptionChannel,
|
||||||
"channel",
|
"channel",
|
||||||
|
@ -121,16 +116,13 @@ func main() {
|
||||||
).SetPermission(&adm)
|
).SetPermission(&adm)
|
||||||
|
|
||||||
topCmd := gokord.NewCommand("top", "Copaings les plus actifs").
|
topCmd := gokord.NewCommand("top", "Copaings les plus actifs").
|
||||||
HasOption().
|
|
||||||
SetHandler(commands.Top)
|
SetHandler(commands.Top)
|
||||||
|
|
||||||
resetCmd := gokord.NewCommand("reset", "Reset l'xp").
|
resetCmd := gokord.NewCommand("reset", "Reset l'xp").
|
||||||
HasOption().
|
|
||||||
SetHandler(commands.Reset).
|
SetHandler(commands.Reset).
|
||||||
SetPermission(&adm)
|
SetPermission(&adm)
|
||||||
|
|
||||||
resetUserCmd := gokord.NewCommand("reset-user", "Reset l'xp d'un utilisation").
|
resetUserCmd := gokord.NewCommand("reset-user", "Reset l'xp d'un utilisation").
|
||||||
HasOption().
|
|
||||||
AddOption(gokord.NewOption(
|
AddOption(gokord.NewOption(
|
||||||
discordgo.ApplicationCommandOptionUser,
|
discordgo.ApplicationCommandOptionUser,
|
||||||
"user",
|
"user",
|
||||||
|
@ -140,7 +132,6 @@ func main() {
|
||||||
SetPermission(&adm)
|
SetPermission(&adm)
|
||||||
|
|
||||||
creditsCmd := gokord.NewCommand("credits", "Crédits").
|
creditsCmd := gokord.NewCommand("credits", "Crédits").
|
||||||
HasOption().
|
|
||||||
SetHandler(commands.Credits)
|
SetHandler(commands.Credits)
|
||||||
|
|
||||||
innovations, err := gokord.LoadInnovationFromJson(updatesData)
|
innovations, err := gokord.LoadInnovationFromJson(updatesData)
|
||||||
|
@ -168,7 +159,7 @@ func main() {
|
||||||
Content: "Les Copaings Bot " + Version.String(),
|
Content: "Les Copaings Bot " + Version.String(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Commands: []*gokord.GeneralCommand{
|
Commands: []gokord.CommandBuilder{
|
||||||
rankCmd,
|
rankCmd,
|
||||||
configCmd,
|
configCmd,
|
||||||
topCmd,
|
topCmd,
|
||||||
|
|
3
restart.sh
Normal file
3
restart.sh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
podman compose down && podman compose build && podman compose up -d
|
10
updates.json
10
updates.json
|
@ -18,5 +18,15 @@
|
||||||
"config"
|
"config"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "3.0.1",
|
||||||
|
"commands": {
|
||||||
|
"added": [],
|
||||||
|
"removed": [],
|
||||||
|
"updated": [
|
||||||
|
"config", "ping"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue