Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions daemon/panels.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/TicketsBot-cloud/common/premium"
"github.com/TicketsBot-cloud/common/sentry"
"github.com/rxdn/gdl/cache"
"github.com/TicketsBot-cloud/gdl/cache"
)

const freePanelLimit = 3
Expand Down Expand Up @@ -40,17 +40,18 @@ func (d *Daemon) sweepPanels(ctx context.Context) {
// get guild owner
guild, err := d.cache.GetGuild(ctx, guildId)
if err != nil {
if errors.Is(err, cache.ErrNotFound) {
continue // if bot's been kicked doesn't matter, when we rejoin we'll purge
} else {
// if bot's been kicked doesn't matter, when we rejoin we'll purge
if !errors.Is(err, cache.ErrNotFound) {
sentry.Error(err)
}

continue
}

// TODO: Ignore voting?
tier, _, err := d.premiumClient.GetTierByGuild(ctx, guild)
if err != nil {
d.Logger.Printf("error getting premium status for guild %d: %s", guild.Id, err.Error())
d.Logger.Printf("error getting premium status for guild %d: %s", guildId, err.Error())
sentry.Error(err)
continue
}
Expand All @@ -63,7 +64,7 @@ func (d *Daemon) sweepPanels(ctx context.Context) {
// Instead, select X-3 panels first
panels, err := d.db.Panel.GetByGuild(ctx, guildId)
if err != nil {
d.Logger.Printf("error getting panels for guild %d: %s", guild.Id, err.Error())
d.Logger.Printf("error getting panels for guild %d: %s", guildId, err.Error())
sentry.Error(err)
continue
}
Expand All @@ -75,7 +76,7 @@ func (d *Daemon) sweepPanels(ctx context.Context) {

if !d.dryRun {
if err := d.db.Panel.ForceDisableSome(ctx, guildId, freePanelLimit); err != nil {
d.Logger.Printf("error disabling panels for guild %d: %s", guild.Id, err.Error())
d.Logger.Printf("error disabling panels for guild %d: %s", guildId, err.Error())
sentry.Error(err)
continue
}
Expand Down
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ go 1.25.0
//replace github.com/TicketsBot-cloud/gdl => ../gdl

require (
github.com/TicketsBot-cloud/common v0.0.0-20260620182815-55fda9a14c01
github.com/TicketsBot-cloud/database v0.0.0-20260621202541-dd80c4370280
github.com/TicketsBot-cloud/gdl v0.0.0-20260306134952-cccb0116fef6
github.com/TicketsBot-cloud/common v0.0.0-20260827064609-69131fc7bd3e
github.com/TicketsBot-cloud/database v0.0.0-20260827185255-75ab724b0bca
github.com/TicketsBot-cloud/gdl v0.0.0-20260612070331-a3947b410d3e
github.com/go-redis/redis/v8 v8.11.5
github.com/jackc/pgx/v4 v4.18.3
github.com/joho/godotenv v1.5.1
github.com/rxdn/gdl v0.0.0-20240612163900-621eccf40179
)

require (
Expand Down
18 changes: 8 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/ReneKroon/ttlcache v1.6.0/go.mod h1:DG6nbhXKUQhrExfwwLuZUdH7UnRDDRA1IW+nBuCssvs=
github.com/TicketsBot-cloud/common v0.0.0-20260620182815-55fda9a14c01 h1:BTBphQxBilbCjiNUYHd67kG5yCdEQ9YRAvzRBxOgjkA=
github.com/TicketsBot-cloud/common v0.0.0-20260620182815-55fda9a14c01/go.mod h1:IA3watwJMLySOt5tsO5GPwAsHAFw6x9aqchxNWUqlog=
github.com/TicketsBot-cloud/database v0.0.0-20260621202541-dd80c4370280 h1:jhxiqdD2t32cQ8Cl0sEZVVD+NldxSGieyMkmk2Gw95s=
github.com/TicketsBot-cloud/database v0.0.0-20260621202541-dd80c4370280/go.mod h1:HQXAgmNSm7/FmBYwcsa6qpZqMrDhbLoEl+AyqFQ+RwY=
github.com/TicketsBot-cloud/gdl v0.0.0-20260306134952-cccb0116fef6 h1:ucG0xLPt7xixW7/LvL0hXDBDouDRS1Nf+77qP8iJ/X0=
github.com/TicketsBot-cloud/gdl v0.0.0-20260306134952-cccb0116fef6/go.mod h1:CdwBR2egPtxUXjD2CgC9ZwfuB8dz9HPePM8nuG6dt7Y=
github.com/TicketsBot-cloud/common v0.0.0-20260827064609-69131fc7bd3e h1:66mDH3lvotbWSgQXNVbssCvUgy6Yg1mqKl7RmEdr6y4=
github.com/TicketsBot-cloud/common v0.0.0-20260827064609-69131fc7bd3e/go.mod h1:yL+VPSYNVK5gxUkA+fbb0WdTjGfWXnr7ScfL0rwk29g=
github.com/TicketsBot-cloud/database v0.0.0-20260827185255-75ab724b0bca h1:9YyYtPAgnJn+TKw8C9EvEQsZQN4rCBkFgVlciwFPzhs=
github.com/TicketsBot-cloud/database v0.0.0-20260827185255-75ab724b0bca/go.mod h1:HQXAgmNSm7/FmBYwcsa6qpZqMrDhbLoEl+AyqFQ+RwY=
github.com/TicketsBot-cloud/gdl v0.0.0-20260612070331-a3947b410d3e h1:qCibZQmO2rrBFrvn6+oAchPEQ7k/0Izr3ruL5P9aVZU=
github.com/TicketsBot-cloud/gdl v0.0.0-20260612070331-a3947b410d3e/go.mod h1:CdwBR2egPtxUXjD2CgC9ZwfuB8dz9HPePM8nuG6dt7Y=
github.com/TicketsBot/ttlcache v1.6.1-0.20200405150101-acc18e37b261 h1:NHD5GB6cjlkpZFjC76Yli2S63/J2nhr8MuE6KlYJpQM=
github.com/TicketsBot/ttlcache v1.6.1-0.20200405150101-acc18e37b261/go.mod h1:2zPxDAN2TAPpxUPjxszjs3QFKreKrQh5al/R3cMXmYk=
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
Expand Down Expand Up @@ -153,8 +153,6 @@ github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6po
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
github.com/rxdn/gdl v0.0.0-20240612163900-621eccf40179 h1:nHchiPmheQeH9bPQ8ix7wHcYs+dFFZeO5uXoKGmrKO4=
github.com/rxdn/gdl v0.0.0-20240612163900-621eccf40179/go.mod h1:HtxfLp4OaoPoDJHQ4JOx/QeLH2d40VgT3wNOf7ETsRE=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
Expand All @@ -176,8 +174,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
Expand Down
Loading