/role fails on long role strings #229

Open
opened 2026-07-18 23:35:08 +00:00 by TenType · 2 comments
TenType commented 2026-07-18 23:35:08 +00:00 (Migrated from codeberg.org)

Steps to Reproduce

Run

/role count ("Boss and McGill" AND "Clyde House") OR ("Boss and McGill" AND "Donner") OR ("Boss and McGill" AND "E-Tower") OR ("Boss and McGill" AND "Hamerschlag") OR ("Boss and McGill" AND "Henderson") OR ("Boss and McGill" AND "Maggie Mo") OR ("Boss and McGill" AND "Morewood Gardens")

in the CMU 2030 server.

The bot should return the number of users with those specified roles. Instead, the bot gives "There was an error while executing this command!". Logs show Error executing command: with nothing after the colon (this empty error message is from #230, so it may become clearer what the problem is once that is fixed) See the comments below

A smaller expression, such as

/role count ("Boss and McGill" AND "Clyde House") OR ("Boss and McGill" AND "Donner") OR ("Boss and McGill" AND "E-Tower") OR ("Boss and McGill" AND "Hamerschlag") OR ("Boss and McGill" AND "Henderson") OR ("Boss and McGill" AND "Maggie Mo")

works as intended.

Other test cases

/role count (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA)
/role count CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA

Suspected Issue

The bot is probably timing out on cache lookups. Is this something we can improve?

Some ideas:

  • Don't make more than one call to the Discord cache for the same role
  • Make calls in "batches" to not hit the rate limit, with a deferral

If it's not feasible, we should give a different error message.

See the comments below

### Steps to Reproduce Run ``` /role count ("Boss and McGill" AND "Clyde House") OR ("Boss and McGill" AND "Donner") OR ("Boss and McGill" AND "E-Tower") OR ("Boss and McGill" AND "Hamerschlag") OR ("Boss and McGill" AND "Henderson") OR ("Boss and McGill" AND "Maggie Mo") OR ("Boss and McGill" AND "Morewood Gardens") ``` in the CMU 2030 server. The bot should return the number of users with those specified roles. Instead, the bot gives "There was an error while executing this command!". ~~Logs show `Error executing command:` with nothing after the colon (this empty error message is from #230, so it may become clearer what the problem is once that is fixed)~~ See the comments below A smaller expression, such as ``` /role count ("Boss and McGill" AND "Clyde House") OR ("Boss and McGill" AND "Donner") OR ("Boss and McGill" AND "E-Tower") OR ("Boss and McGill" AND "Hamerschlag") OR ("Boss and McGill" AND "Henderson") OR ("Boss and McGill" AND "Maggie Mo") ``` works as intended. ### Other test cases ``` /role count (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) OR (CFA AND CFA) ``` ``` /role count CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA OR CFA ``` ### Suspected Issue ~~The bot is probably timing out on cache lookups. Is this something we can improve?~~ ~~Some ideas:~~ - ~~Don't make more than one call to the Discord cache for the same role~~ - ~~Make calls in "batches" to not hit the rate limit, with a deferral~~ ~~If it's not feasible, we should give a different error message.~~ See the comments below
TenType commented 2026-07-18 23:41:00 +00:00 (Migrated from codeberg.org)

Originally, I wanted to run this massive command to conduct pairwise comparisons on dorm roles:

/role count ("Boss and McGill" AND "Clyde House") OR ("Boss and McGill" AND "Donner") OR ("Boss and McGill" AND "E-Tower") OR ("Boss and McGill" AND "Hamerschlag") OR ("Boss and McGill" AND "Henderson") OR ("Boss and McGill" AND "Maggie Mo") OR ("Boss and McGill" AND "Morewood Gardens") OR ("Boss and McGill" AND "Mudge") OR ("Boss and McGill" AND "Res on Fifth") OR ("Boss and McGill" AND "Scobell") OR ("Boss and McGill" AND "Stever") OR ("Boss and McGill" AND "Welch") OR ("Clyde House" AND "Donner") OR ("Clyde House" AND "E-Tower") OR ("Clyde House" AND "Hamerschlag") OR ("Clyde House" AND "Henderson") OR ("Clyde House" AND "Maggie Mo") OR ("Clyde House" AND "Morewood Gardens") OR ("Clyde House" AND "Mudge") OR ("Clyde House" AND "Res on Fifth") OR ("Clyde House" AND "Scobell") OR ("Clyde House" AND "Stever") OR ("Clyde House" AND "Welch") OR ("Donner" AND "E-Tower") OR ("Donner" AND "Hamerschlag") OR ("Donner" AND "Henderson") OR ("Donner" AND "Maggie Mo") OR ("Donner" AND "Morewood Gardens") OR ("Donner" AND "Mudge") OR ("Donner" AND "Res on Fifth") OR ("Donner" AND "Scobell") OR ("Donner" AND "Stever") OR ("Donner" AND "Welch") OR ("E-Tower" AND "Hamerschlag") OR ("E-Tower" AND "Henderson") OR ("E-Tower" AND "Maggie Mo") OR ("E-Tower" AND "Morewood Gardens") OR ("E-Tower" AND "Mudge") OR ("E-Tower" AND "Res on Fifth") OR ("E-Tower" AND "Scobell") OR ("E-Tower" AND "Stever") OR ("E-Tower" AND "Welch") OR ("Hamerschlag" AND "Henderson") OR ("Hamerschlag" AND "Maggie Mo") OR ("Hamerschlag" AND "Morewood Gardens") OR ("Hamerschlag" AND "Mudge") OR ("Hamerschlag" AND "Res on Fifth") OR ("Hamerschlag" AND "Scobell") OR ("Hamerschlag" AND "Stever") OR ("Hamerschlag" AND "Welch") OR ("Henderson" AND "Maggie Mo") OR ("Henderson" AND "Morewood Gardens") OR ("Henderson" AND "Mudge") OR ("Henderson" AND "Res on Fifth") OR ("Henderson" AND "Scobell") OR ("Henderson" AND "Stever") OR ("Henderson" AND "Welch") OR ("Maggie Mo" AND "Morewood Gardens") OR ("Maggie Mo" AND "Mudge") OR ("Maggie Mo" AND "Res on Fifth") OR ("Maggie Mo" AND "Scobell") OR ("Maggie Mo" AND "Stever") OR ("Maggie Mo" AND "Welch") OR ("Morewood Gardens" AND "Mudge") OR ("Morewood Gardens" AND "Res on Fifth") OR ("Morewood Gardens" AND "Scobell") OR ("Morewood Gardens" AND "Stever") OR ("Morewood Gardens" AND "Welch") OR ("Mudge" AND "Res on Fifth") OR ("Mudge" AND "Scobell") OR ("Mudge" AND "Stever") OR ("Mudge" AND "Welch") OR ("Res on Fifth" AND "Scobell") OR ("Res on Fifth" AND "Stever") OR ("Res on Fifth" AND "Welch") OR ("Scobell" AND "Stever") OR ("Scobell" AND "Welch") OR ("Stever" AND "Welch")
Originally, I wanted to run this massive command to conduct pairwise comparisons on dorm roles: ``` /role count ("Boss and McGill" AND "Clyde House") OR ("Boss and McGill" AND "Donner") OR ("Boss and McGill" AND "E-Tower") OR ("Boss and McGill" AND "Hamerschlag") OR ("Boss and McGill" AND "Henderson") OR ("Boss and McGill" AND "Maggie Mo") OR ("Boss and McGill" AND "Morewood Gardens") OR ("Boss and McGill" AND "Mudge") OR ("Boss and McGill" AND "Res on Fifth") OR ("Boss and McGill" AND "Scobell") OR ("Boss and McGill" AND "Stever") OR ("Boss and McGill" AND "Welch") OR ("Clyde House" AND "Donner") OR ("Clyde House" AND "E-Tower") OR ("Clyde House" AND "Hamerschlag") OR ("Clyde House" AND "Henderson") OR ("Clyde House" AND "Maggie Mo") OR ("Clyde House" AND "Morewood Gardens") OR ("Clyde House" AND "Mudge") OR ("Clyde House" AND "Res on Fifth") OR ("Clyde House" AND "Scobell") OR ("Clyde House" AND "Stever") OR ("Clyde House" AND "Welch") OR ("Donner" AND "E-Tower") OR ("Donner" AND "Hamerschlag") OR ("Donner" AND "Henderson") OR ("Donner" AND "Maggie Mo") OR ("Donner" AND "Morewood Gardens") OR ("Donner" AND "Mudge") OR ("Donner" AND "Res on Fifth") OR ("Donner" AND "Scobell") OR ("Donner" AND "Stever") OR ("Donner" AND "Welch") OR ("E-Tower" AND "Hamerschlag") OR ("E-Tower" AND "Henderson") OR ("E-Tower" AND "Maggie Mo") OR ("E-Tower" AND "Morewood Gardens") OR ("E-Tower" AND "Mudge") OR ("E-Tower" AND "Res on Fifth") OR ("E-Tower" AND "Scobell") OR ("E-Tower" AND "Stever") OR ("E-Tower" AND "Welch") OR ("Hamerschlag" AND "Henderson") OR ("Hamerschlag" AND "Maggie Mo") OR ("Hamerschlag" AND "Morewood Gardens") OR ("Hamerschlag" AND "Mudge") OR ("Hamerschlag" AND "Res on Fifth") OR ("Hamerschlag" AND "Scobell") OR ("Hamerschlag" AND "Stever") OR ("Hamerschlag" AND "Welch") OR ("Henderson" AND "Maggie Mo") OR ("Henderson" AND "Morewood Gardens") OR ("Henderson" AND "Mudge") OR ("Henderson" AND "Res on Fifth") OR ("Henderson" AND "Scobell") OR ("Henderson" AND "Stever") OR ("Henderson" AND "Welch") OR ("Maggie Mo" AND "Morewood Gardens") OR ("Maggie Mo" AND "Mudge") OR ("Maggie Mo" AND "Res on Fifth") OR ("Maggie Mo" AND "Scobell") OR ("Maggie Mo" AND "Stever") OR ("Maggie Mo" AND "Welch") OR ("Morewood Gardens" AND "Mudge") OR ("Morewood Gardens" AND "Res on Fifth") OR ("Morewood Gardens" AND "Scobell") OR ("Morewood Gardens" AND "Stever") OR ("Morewood Gardens" AND "Welch") OR ("Mudge" AND "Res on Fifth") OR ("Mudge" AND "Scobell") OR ("Mudge" AND "Stever") OR ("Mudge" AND "Welch") OR ("Res on Fifth" AND "Scobell") OR ("Res on Fifth" AND "Stever") OR ("Res on Fifth" AND "Welch") OR ("Scobell" AND "Stever") OR ("Scobell" AND "Welch") OR ("Stever" AND "Welch") ```
TenType commented 2026-07-19 20:53:12 +00:00 (Migrated from codeberg.org)

Error message after #230 was fixed:
image

The problem is that the embed title character limit is exceeded. We can call .slice(0, 254) or similar on the embed title to fix this bug.

Error message after #230 was fixed: ![image](/attachments/d0514a63-2e60-41ac-89f0-fd447681ea1d) The problem is that the embed title character limit is exceeded. We can call `.slice(0, 254)` or similar on the embed title to fix this bug.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ScottyLabs/dalmatian#229
No description provided.