feat: add /madd slash cmd#2234
Open
7he4lph4 wants to merge 2 commits into
Open
Conversation
1drturtle
approved these changes
Nov 18, 2025
Comment on lines
+411
to
+424
| seen_objects = set() | ||
| for name, mid in favorites: | ||
| if mid and mid in choices_by_id: | ||
| monster = choices_by_id[mid] | ||
| if monster not in seen_objects: | ||
| recent.append(monster) | ||
| seen_objects.add(monster) | ||
| elif name in choices_by_name_homebrew: | ||
| for monster in choices_by_name_homebrew[name]: | ||
| if monster not in seen_objects: | ||
| recent.append(monster) | ||
| seen_objects.add(monster) | ||
| if len(recent) >= AUTOCOMPLETE_MAX_RESULTS: | ||
| break |
Contributor
There was a problem hiding this comment.
a comment or two here would be great to improve clarity
| ) | ||
|
|
||
| @commands.command(hidden=True) | ||
| async def mfav(self, ctx): |
Contributor
There was a problem hiding this comment.
!monster favorites maybe?
Contributor
Author
There was a problem hiding this comment.
isn't that just a monster called "favourites" lol I thought we keep this as a hidden dev cmd that no one really would use, users should be able to use their top 25 fav monsters already in the auto-complete when they do /madd
|
|
||
| batch = [] | ||
| batch_size = 100 | ||
| async for key in self.bot.rdb.iscan(match=pattern): |
Contributor
There was a problem hiding this comment.
some comments here explaining behavior would be great
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements a new
/maddslash command as a secondary way of adding monsters to combat initiative./maddlearns user's favourite monsters over time as they keep adding monsters to combat, it then boosts user's frequently added monsters to the top of the autocomplete search results.Changelog Entry
/maddas a secondary way of adding monsters to combat initiative.Checklist
PR Type
Other