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) {
|
||||
cfg := config.GetGuildConfig(i.GuildID)
|
||||
resp := utils.ResponseBuilder{C: s, I: i}
|
||||
resp := utils.NewResponseBuilder(s, i)
|
||||
roles := ""
|
||||
l := len(cfg.XpRoles) - 1
|
||||
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) {
|
||||
optMap := utils.GenerateOptionMapForSubcommand(i)
|
||||
resp := utils.ResponseBuilder{C: s, I: i}
|
||||
resp.IsEphemeral()
|
||||
resp := utils.NewResponseBuilder(s, i).IsEphemeral()
|
||||
// verify every args
|
||||
t, ok := optMap["type"]
|
||||
if !ok {
|
||||
|
@ -214,8 +213,7 @@ func ConfigXP(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
|||
|
||||
func ConfigChannel(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||
optMap := utils.GenerateOptionMapForSubcommand(i)
|
||||
resp := utils.ResponseBuilder{C: s, I: i}
|
||||
resp.IsEphemeral()
|
||||
resp := utils.NewResponseBuilder(s, i).IsEphemeral()
|
||||
// verify every args
|
||||
t, ok := optMap["type"]
|
||||
if !ok {
|
||||
|
@ -286,8 +284,7 @@ func ConfigChannel(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
|||
|
||||
func ConfigFallbackChannel(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||
optMap := utils.GenerateOptionMapForSubcommand(i)
|
||||
resp := utils.ResponseBuilder{C: s, I: i}
|
||||
resp.IsEphemeral()
|
||||
resp := utils.NewResponseBuilder(s, i).IsEphemeral()
|
||||
// verify every args
|
||||
salon, ok := optMap["channel"]
|
||||
if !ok {
|
||||
|
@ -329,8 +326,7 @@ func ConfigFallbackChannel(s *discordgo.Session, i *discordgo.InteractionCreate)
|
|||
|
||||
func ConfigPeriodBeforeReduce(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||
optMap := utils.GenerateOptionMapForSubcommand(i)
|
||||
resp := utils.ResponseBuilder{C: s, I: i}
|
||||
resp.IsEphemeral()
|
||||
resp := utils.NewResponseBuilder(s, i).IsEphemeral()
|
||||
// verify every args
|
||||
days, ok := optMap["days"]
|
||||
if !ok {
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
)
|
||||
|
||||
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{
|
||||
{
|
||||
Type: discordgo.EmbedTypeRich,
|
||||
|
|
|
@ -14,7 +14,7 @@ func Rank(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
|||
msg := "Votre niveau"
|
||||
m := i.Member
|
||||
var err error
|
||||
resp := utils.ResponseBuilder{C: s, I: i}
|
||||
resp := utils.NewResponseBuilder(s, i)
|
||||
if v, ok := optMap["copaing"]; ok {
|
||||
u := v.UserValue(s)
|
||||
if u.Bot {
|
||||
|
|
|
@ -10,15 +10,13 @@ import (
|
|||
func Reset(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||
var copaings []*user.Copaing
|
||||
gokord.DB.Where("guild_id = ?", i.GuildID).Delete(&copaings)
|
||||
resp := utils.ResponseBuilder{C: s, I: i}
|
||||
if err := resp.IsEphemeral().Message("L'XP a été reset.").Send(); err != nil {
|
||||
if err := utils.NewResponseBuilder(s, i).IsEphemeral().Message("L'XP a été reset.").Send(); err != nil {
|
||||
utils.SendAlert("commands/reset.go - Sending success (all)", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func ResetUser(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||
resp := utils.ResponseBuilder{C: s, I: i}
|
||||
resp.IsEphemeral()
|
||||
resp := utils.NewResponseBuilder(s, i).IsEphemeral()
|
||||
optMap := utils.GenerateOptionMap(i)
|
||||
v, ok := optMap["user"]
|
||||
if !ok {
|
||||
|
|
|
@ -11,13 +11,12 @@ import (
|
|||
)
|
||||
|
||||
func Top(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||
resp := utils.ResponseBuilder{C: s, I: i}
|
||||
err := resp.IsDeferred().Send()
|
||||
resp := utils.NewResponseBuilder(s, i).IsDeferred()
|
||||
err := resp.Send()
|
||||
if err != nil {
|
||||
utils.SendAlert("commands/top.go - Sending deferred", err.Error())
|
||||
return
|
||||
}
|
||||
resp.NotDeferred().IsEdit()
|
||||
embeds := make([]*discordgo.MessageEmbed, 3)
|
||||
wg := sync.WaitGroup{}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue