Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
5249a38
lib/template: don't evaluate '.' as float64 (#1971)
l-zeuch Nov 4, 2025
214ebc2
templates: consider `uint`s for comparison in `in` (#1972)
l-zeuch Nov 4, 2025
ad73bb5
added stubs for events that spam the logs (#1974)
ashishjh-bst Nov 4, 2025
a58c38d
add structs for undocumented activity component to prevent breaking m…
ashishjh-bst Nov 4, 2025
ffe56e6
added more stubs for spammy events (#1976)
ashishjh-bst Nov 6, 2025
f50d81f
fix broken in, virtual smack for poor testing on the maintainer
ashishjh-bst Nov 6, 2025
6ac05c3
added support for more component types in modals (#1977)
ashishjh-bst Nov 12, 2025
29da0d0
Bugfix: use templates.SDict for modal values (#1978)
ashishjh-bst Nov 13, 2025
e2aa7fd
resolved conflicts
ashishjh-bst Nov 13, 2025
8913eff
set identify ratelimit to 5 shards per 5 seconds
ashishjh-bst Nov 13, 2025
a87eb83
Changed Control Panel button on home page to a Login button if the us…
ashishjh-bst Nov 14, 2025
af598c1
added Set on modalBuilder (#1980)
ashishjh-bst Nov 15, 2025
04f784d
fix overwriting components in modalbuilder.Set and add support for sl…
ashishjh-bst Nov 16, 2025
5defd3f
allow cmodal to be used for newer gen components (#1982)
ashishjh-bst Nov 17, 2025
9168169
fixes to handling mute overrides (#1981)
ashishjh-bst Nov 17, 2025
8a5f64e
added more error logs around verification (#1983)
ashishjh-bst Nov 18, 2025
1f00cce
build(deps): bump golang.org/x/crypto from 0.43.0 to 0.45.0 (#1984)
dependabot[bot] Nov 22, 2025
db9478b
return error from sendMessage to handle it in try catch in template …
ashishjh-bst Nov 22, 2025
6045138
handle panic on converting db entries (#1986)
ashishjh-bst Nov 22, 2025
89e99ab
bumped to go v1.25.4
ashishjh-bst Nov 22, 2025
f67af79
Fix bug with message forwards not working
ashishjh-bst Nov 23, 2025
1f555c1
Added twitch feeds! (#1987)
ashishjh-bst Nov 25, 2025
4f93633
change premium limits for twitch and add twitch to premium perks
ashishjh-bst Nov 25, 2025
2203cb3
delete two annoying spaces [Twitch & YouTube] (#1988)
Borbot33 Nov 27, 2025
d1d0802
Add support for new voice transport encryption modes (#1989)
ashishjh-bst Nov 28, 2025
0c139ca
Fix Possible Race Conditions (#1990)
ashishjh-bst Dec 2, 2025
394e30d
Added logic to restart reddit feed if the last success was older than…
ashishjh-bst Dec 9, 2025
7fc3b3e
Reduce health check duration, and improve logs
ashishjh-bst Dec 9, 2025
916794b
Fix stop logic
ashishjh-bst Dec 9, 2025
b4aaf86
fix waitgroup accounting
ashishjh-bst Dec 9, 2025
19b47be
Added Voice roles
ashishjh-bst Dec 11, 2025
a376062
Added Voice roles (#1993)
ashishjh-bst Dec 11, 2025
1d10d64
Merge branch 'dev' of github.com:botlabs-gg/yagpdb into feature/voice…
ashishjh-bst Dec 11, 2025
666a7bd
Fix broken sql query in schema.go
ashishjh-bst Dec 11, 2025
c68024c
rolecommands: Clarify rmenu arg help text wording (#1991)
Wolveric Dec 11, 2025
31ef8f0
fix voice roles path in widgt
ashishjh-bst Dec 13, 2025
88a1265
fixes to unknown component handling
ashishjh-bst Dec 14, 2025
f5efa15
restricted max role effects to 5 for free and 10 for premium per even…
ashishjh-bst Dec 15, 2025
c0ed1e5
Revert "restricted max role effects to 5 for free and 10 for premium …
ashishjh-bst Dec 15, 2025
c038d21
Added mechanism to drop PresenceUpdate events in case the event queue…
ashishjh-bst Dec 16, 2025
4167cdf
Fix plausible memory leak because of command exec (#1998)
ashishjh-bst Dec 16, 2025
294fae1
added a trivia leaderboard (#1999)
ashishjh-bst Dec 17, 2025
b7010e6
improved mqueue error handling and logging (#2000)
ashishjh-bst Dec 17, 2025
27ef499
added trivia reset lb command and changed score to 2 for correct and …
ashishjh-bst Dec 17, 2025
287c803
moved old user cleanup to bgworker
ashishjh-bst Dec 17, 2025
5b4e564
add sort by correct and incorrect in trivia
ashishjh-bst Dec 17, 2025
5ab15b8
change emoji for leaderboard for incorrect answers
ashishjh-bst Dec 18, 2025
d83a81d
add appropriate indexes for sorting leaderboard
ashishjh-bst Dec 18, 2025
39ebac9
fix command overwrites not blocking 'trivia' if used with out any sub…
ashishjh-bst Dec 18, 2025
0cf2ec5
added difficulty selection on trivia, and refactored embed and answer…
ashishjh-bst Dec 18, 2025
0108265
changes to reddit feed post fetching to prevent 500 errors from reddi…
ashishjh-bst Dec 20, 2025
0547eb4
Revert "changes to reddit feed post fetching to prevent 500 errors fr…
ashishjh-bst Dec 24, 2025
4391b25
fix reddit feed not stopping on sigterm
ashishjh-bst Dec 24, 2025
c358e63
Added Role Change Trigger for Custom Commands. (#2003)
ashishjh-bst Dec 30, 2025
94c7d43
Minor Enhancements (#2004)
ashishjh-bst Dec 30, 2025
c360e70
Several bug fixes in role trigger custom commands. (#2005)
ashishjh-bst Jan 6, 2026
e807ed4
minor refactor of handler for role triggers
ashishjh-bst Jan 6, 2026
a79fd46
replace col-auto in custom command with appropriate col values to pre…
ashishjh-bst Jan 6, 2026
9ed331e
more layout improvements on the custom command edit page
ashishjh-bst Jan 6, 2026
953724d
cmddocs: improve markdown formatter (#2006)
l-zeuch Jan 7, 2026
ea453ef
ignore access logs
ashishjh-bst Jan 7, 2026
8b51fc8
Reduce spamminess of dm interactions
ashishjh-bst Jan 8, 2026
8f8c1f1
Revert "fix reddit feed not stopping on sigterm"
ashishjh-bst Jan 9, 2026
19186c8
reduce autoheal window and revert changes to autoheal mechanism
ashishjh-bst Jan 9, 2026
badcb34
templates: consider all bases for toInt/toInt64 (#2007)
l-zeuch Jan 9, 2026
33d95b3
Add a separate base argument toInt and toInt64 (#2008)
ashishjh-bst Jan 10, 2026
ef3a71d
Added support for threaded tickets (#2009)
ashishjh-bst Jan 13, 2026
44cef44
add new features to premium perks list
ashishjh-bst Jan 14, 2026
fde6c2d
Add more details to premium claim instructions
ashishjh-bst Jan 14, 2026
67d52a7
fix issues with ticket close from button
ashishjh-bst Jan 14, 2026
397de85
Fixed issues with adminonly toggle for tickets (#2010)
ashishjh-bst Jan 15, 2026
e107cba
tweak attachment check in SpamTrigger
ashishjh-bst Jan 15, 2026
891d120
fix weird logic in ticket ao
ashishjh-bst Jan 16, 2026
042be91
Add aliases to cleardm command (#2014)
savage4618 Jan 21, 2026
0188c81
customcommands: enable dcct as a slash command (#2012)
l-zeuch Jan 21, 2026
9e3aaf1
don't send custom announcement for vod if vod notification is disable…
ashishjh-bst Jan 21, 2026
4bc381d
change to showing text-only channels for channel selections where bot…
ashishjh-bst Jan 22, 2026
0867d34
Added option to have a dedicated error channel for a custom command g…
ashishjh-bst Jan 27, 2026
20edaf3
added check for member joined at to prevent sending join messages in …
ashishjh-bst Jan 28, 2026
18bd783
allow removing components and embeds while editing a message (#2019)
ashishjh-bst Jan 28, 2026
33a37ce
add announcement channel in textOnlyChannelOptions
ashishjh-bst Jan 28, 2026
c8a627d
add icon for announcement-channel
ashishjh-bst Jan 28, 2026
6fbe926
Fix panic when custom command has no group
ashishjh-bst Jan 28, 2026
a498b89
fix ratelimiter deadlock issues
ashishjh-bst Jan 28, 2026
cfcf44c
Revert "fix ratelimiter deadlock issues"
ashishjh-bst Jan 28, 2026
63334a2
add a guildscope cooldown on clean for 120 seconds
ashishjh-bst Jan 28, 2026
91a925d
disable pin related features
ashishjh-bst Jan 28, 2026
5395ef2
Restore clean's -nopin flag (#2020)
galen8183 Jan 30, 2026
d483d08
migrated to new pin endpoints (#2021)
ashishjh-bst Jan 31, 2026
e5c26bf
reduce cooldown on clean command, and make cooldown error readable
ashishjh-bst Jan 31, 2026
57bdfa7
discordgo: fix EndpointChannelMessageCrosspost (#2023)
galen8183 Feb 2, 2026
028772a
Fixed error response in case of ticket being closed with an interacti…
ashishjh-bst Feb 2, 2026
25cf223
fix error for tmplGetChannelPins when channel has no pins
ashishjh-bst Feb 3, 2026
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jobs: # basic units of work in a run
build: # runs not using Workflows must have a `build` job as entry point
docker: # run the steps with Docker
# CircleCI Go images available at: https://hub.docker.com/r/circleci/golang/
- image: cimg/go:1.25.0 #
- image: cimg/go:1.25.4 #

# directory where steps are run. Path must conform to the Go Workspace requirements
working_directory: ~/app
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cmd/yagpdb/static/index.html
cmd/yagpdb/cert
cmd/yagpdb/access_log
cmd/yagpdb/access.log
cmd/yagpdb/*.log
cmd/yagpdb/static/report.html
cmd/yagpdb/yagpdb
cmd/yagpdb/templates/plugins/*.html
Expand Down
2 changes: 1 addition & 1 deletion automod/assets/automod.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ <h2 class="card-title">List: <span contenteditable="true" data-content-editable-
{{textChannelOptionsMulti .ActiveGuild.Channels nil}}
</select>
<select id="automod-channel-single-template" class="form-control">
{{textChannelOptions .ActiveGuild.Channels nil true "None"}}
{{textOnlyChannelOptions .ActiveGuild.Channels nil true "None"}}
</select>
<select id="automod-list-selection-template" class="form-control">
{{range .AutomodLists}}
Expand Down
5 changes: 3 additions & 2 deletions automod/triggers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,7 @@ func (spam *SpamTrigger) CheckMessage(triggerCtx *TriggerContext, cs *dstate.Cha
settingsCast := triggerCtx.Data.(*SpamTriggerData)

mToCheckAgainst := strings.TrimSpace(strings.ToLower(m.Content))
totalAttachments := len(m.GetMessageAttachments())

count := 1

Expand Down Expand Up @@ -1102,8 +1103,8 @@ func (spam *SpamTrigger) CheckMessage(triggerCtx *TriggerContext, cs *dstate.Cha
break
}

if len(v.GetMessageAttachments()) > 0 {
break // treat any attachment as a different message, in the future i may download them and check hash or something? maybe too much
if len(v.GetMessageAttachments()) != totalAttachments {
break // attachment count don't match
}

contentStripped := strings.TrimSpace(v.Content)
Expand Down
5 changes: 3 additions & 2 deletions autorole/autorole.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ func RegisterPlugin() {
}

type AutoroleConfig struct {
Role int64 `json:",string" valid:"role,true"`
RequiredDuration int `valid:"0,"`
Role int64 `json:",string" valid:"role,true"`
Roles []int64 `json:"role" valid:"role,true"`
RequiredDuration int `valid:"0,"`

RequiredRoles []int64 `valid:"role,true"`
IgnoreRoles []int64 `valid:"role,true"`
Expand Down
90 changes: 42 additions & 48 deletions bot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,56 +260,50 @@ type identifyRatelimiter struct {
lastRatelimitAt time.Time
}

var identifyMaxConcurrency int
var identifyConcurrencyOnce sync.Once

func (rl *identifyRatelimiter) getIdentifyMaxConcurrency() int {
identifyConcurrencyOnce.Do(func() {
identifyMaxConcurrency = 0
const redisKey = "yagpdb.gateway.identify.max_concurrency"
lockKey := redisKey + ":lock"
err := common.BlockingLockRedisKey(lockKey, 0, 30)
if err != nil {
logger.WithError(err).Warn("failed to acquire lock for fetching gateway bot info")
return
}
defer common.UnlockRedisKey(lockKey)
var cached string
if err := common.RedisPool.Do(radix.Cmd(&cached, "GET", redisKey)); err == nil && cached != "" {
if parsed, perr := strconv.Atoi(cached); perr == nil && parsed > 0 {
identifyMaxConcurrency = parsed
logger.Infof("Gateway identify max_concurrency (cached): %d", identifyMaxConcurrency)
return
}
}
s, err := discordgo.New(common.GetBotToken())
if err != nil {
logger.WithError(err).Warn("failed to create session to fetch gateway bot info")
return
}
resp, err := s.GatewayBot()
if err != nil {
logger.WithError(err).Warn("failed to fetch gateway bot info")
return
}
if resp != nil && resp.SessionStartLimit.MaxConcurrency > 0 {
identifyMaxConcurrency = resp.SessionStartLimit.MaxConcurrency
}
const ttlSeconds = 21600 // cache for 6 hours, this doesn't change often.
_ = common.RedisPool.Do(radix.FlatCmd(nil, "SETEX", redisKey, ttlSeconds, strconv.Itoa(identifyMaxConcurrency)))
logger.Infof("Gateway identify max_concurrency: %d", identifyMaxConcurrency)
})
return identifyMaxConcurrency
}
// var identifyMaxConcurrency int
// var identifyConcurrencyOnce sync.Once

// func (rl *identifyRatelimiter) getIdentifyMaxConcurrency() int {
// identifyConcurrencyOnce.Do(func() {
// identifyMaxConcurrency = 0
// const redisKey = "yagpdb.gateway.identify.max_concurrency"
// lockKey := redisKey + ":lock"
// err := common.BlockingLockRedisKey(lockKey, 0, 30)
// if err != nil {
// logger.WithError(err).Warn("failed to acquire lock for fetching gateway bot info")
// return
// }
// defer common.UnlockRedisKey(lockKey)
// var cached string
// if err := common.RedisPool.Do(radix.Cmd(&cached, "GET", redisKey)); err == nil && cached != "" {
// if parsed, perr := strconv.Atoi(cached); perr == nil && parsed > 0 {
// identifyMaxConcurrency = parsed
// logger.Infof("Gateway identify max_concurrency (cached): %d", identifyMaxConcurrency)
// return
// }
// }
// s, err := discordgo.New(common.GetBotToken())
// if err != nil {
// logger.WithError(err).Warn("failed to create session to fetch gateway bot info")
// return
// }
// resp, err := s.GatewayBot()
// if err != nil {
// logger.WithError(err).Warn("failed to fetch gateway bot info")
// return
// }
// if resp != nil && resp.SessionStartLimit.MaxConcurrency > 0 {
// identifyMaxConcurrency = resp.SessionStartLimit.MaxConcurrency
// }
// const ttlSeconds = 21600 // cache for 6 hours, this doesn't change often.
// _ = common.RedisPool.Do(radix.FlatCmd(nil, "SETEX", redisKey, ttlSeconds, strconv.Itoa(identifyMaxConcurrency)))
// logger.Infof("Gateway identify max_concurrency: %d", identifyMaxConcurrency)
// })
// return identifyMaxConcurrency
// }

func (rl *identifyRatelimiter) RatelimitIdentify(shardID int) {
mc := 0
for mc == 0 {
mc = rl.getIdentifyMaxConcurrency()
if mc == 0 {
time.Sleep(5 * time.Second)
}
}
mc := 5
// total buckets is equal to the value of max_concurrency.
bucket := shardID % mc
key := "yagpdb.gateway.identify.bucket." + strconv.Itoa(bucket)
Expand Down
8 changes: 6 additions & 2 deletions bot/discordevents.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ func handleDmGuildInfoInteraction(evt *eventsystem.EventData) {
logger.Errorf("DM interaction received with incorrect customID: %s from user %d", customID, ic.User.ID)
}
gs, err := evt.Session.Guild(guild_id)
logger.WithError(err).Errorf("Failed getting guild info for DM %s from user %d", customID, ic.User.ID)
if err != nil {
logger.WithError(err).Errorf("Failed getting guild info for DM %s from user %d", customID, ic.User.ID)
}
response := discordgo.InteractionResponse{
Type: discordgo.InteractionResponseChannelMessageWithSource,
Data: &discordgo.InteractionResponseData{Flags: 64},
Expand All @@ -337,7 +339,9 @@ func handleDmGuildInfoInteraction(evt *eventsystem.EventData) {
}
response.Data.Content = content
err = evt.Session.CreateInteractionResponse(ic.ID, ic.Token, &response)
logger.WithError(err).Printf("Interaction Response!")
if err != nil {
logger.WithError(err).Errorf("DM interaction response failed.")
}
}

func HandleInteractionCreate(evt *eventsystem.EventData) {
Expand Down
Loading