diff options
Diffstat (limited to 'commands/stats.go')
| -rw-r--r-- | commands/stats.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/commands/stats.go b/commands/stats.go index 15f258b..28c0bcc 100644 --- a/commands/stats.go +++ b/commands/stats.go @@ -111,10 +111,10 @@ func Stats(ctx context.Context, dg bot.Session, i *interaction.ApplicationComman func statsAll(ctx context.Context, dg bot.Session, i *interaction.ApplicationCommand, days int) (io.WriterTo, error) { return stats(ctx, dg, i, days, func(before, after string) *gorm.DB { - return common.GetDB(ctx).Raw( + return nil /*common.GetDB(ctx).Raw( before+"WHERE guild_id = ? and created_at > ?"+after, i.GuildID, exp.TimeStampNDaysBefore(ctx, uint(days)), - ) + )*/ }) } @@ -124,10 +124,10 @@ func statsMember(ctx context.Context, dg bot.Session, i *interaction.Application return nil, err } return stats(ctx, dg, i, days, func(before, after string) *gorm.DB { - return common.GetDB(ctx).Raw( + return nil /*common.GetDB(ctx).Raw( before+"WHERE guild_id = ? and created_at > ? and copaing_id = ?"+after, i.GuildID, exp.TimeStampNDaysBefore(ctx, uint(days)), user.GetCopaing(ctx, discordID, i.GuildID).ID, - ) + )*/ }) } @@ -171,7 +171,7 @@ func stats(ctx context.Context, dg bot.Session, i *interaction.ApplicationComman for _, raw := range rawData { _, ok := copaings[raw.CopaingID] if !ok { - var cp user.Copaing + /*var cp user.Copaing if err := common.GetDB(ctx).First(&cp, raw.CopaingID).Error; err != nil { if !errors.Is(err, gorm.ErrRecordNotFound) { bot.Logger(ctx).Error("finding copaing", "error", err, "copaing", raw.CopaingID) @@ -180,7 +180,7 @@ func stats(ctx context.Context, dg bot.Session, i *interaction.ApplicationComman bot.Logger(ctx).Warn("copaing not found, skipping", "copaing", raw.CopaingID) continue } - copaings[raw.CopaingID] = &cp + copaings[raw.CopaingID] = &cp*/ } pts, ok := stats[raw.CopaingID] now := time.Now().Unix() |
