aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go22
-rw-r--r--user/xp.go4
2 files changed, 13 insertions, 13 deletions
diff --git a/main.go b/main.go
index ff8c55a..e313c17 100644
--- a/main.go
+++ b/main.go
@@ -68,11 +68,11 @@ func init() {
func handleDynamicMessageComponent(
b *gokord.Bot,
handler func(
- *discordgo.Session,
- *discordgo.InteractionCreate,
- *interaction.MessageComponentData,
- []string, *cmd.ResponseBuilder,
-),
+ *discordgo.Session,
+ *discordgo.InteractionCreate,
+ *interaction.MessageComponentData,
+ []string, *cmd.ResponseBuilder,
+ ),
pattern string,
) {
compiledPattern := regexp.MustCompile(pattern)
@@ -94,12 +94,12 @@ func handleDynamicMessageComponent(
func handleDynamicModalComponent(
b *gokord.Bot,
handler func(
- *discordgo.Session,
- *discordgo.InteractionCreate,
- *interaction.ModalSubmitData,
- []string,
- *cmd.ResponseBuilder,
-),
+ *discordgo.Session,
+ *discordgo.InteractionCreate,
+ *interaction.ModalSubmitData,
+ []string,
+ *cmd.ResponseBuilder,
+ ),
pattern string,
) {
compiledPattern := regexp.MustCompile(pattern)
diff --git a/user/xp.go b/user/xp.go
index d130cae..96a8a27 100644
--- a/user/xp.go
+++ b/user/xp.go
@@ -61,10 +61,10 @@ func (c *Copaing) GetXPForDays(n uint) (uint, error) {
c.ID,
).
Rows()
- defer rows.Close()
if err != nil {
return 0, err
}
+ defer rows.Close()
for rows.Next() {
var cxp CopaingXP
err = gokord.DB.ScanRows(rows, &cxp)
@@ -86,10 +86,10 @@ func GetBestXP(guildId string, n uint, d int) ([]CopaingAccess, error) {
d = int(cfg.DaysXPRemains)
}
rows, err := gokord.DB.Model(&Copaing{}).Where("guild_id = ?", guildId).Rows()
- defer rows.Close()
if err != nil {
return nil, err
}
+ defer rows.Close()
var l []*cXP
wg := sync.WaitGroup{}
for rows.Next() {