Humblemonk / DiceMaiden

Dice bot for Discord
Apache License 2.0
125 stars 56 forks source link

Allow Creation of Custom Aliases #106

Closed mechjacktv closed 4 years ago

mechjacktv commented 4 years ago

Is your feature request related to a problem? Please describe. Instead of needing to open an issue for every game system people want to see an alias for, it would be nice if we could create our own aliases using regex.

Describe the solution you'd like I want to have a command like !dm alias d6system /d6s(\d+)d/ '$1d6 + 1d6 ie' where the $1 is replaced with the value of group 1 in the regex.

Additional Possible Commands:

Describe alternatives you've considered The only existing alternative I see is opening an issue for each alias people want created.

Additional context None. :)

ThatGuyWhatsMadeofCheese commented 4 years ago

I was thinking this would be cool too, but I'm guessing that it's set up in a way that doing an alias for a specific server wouldn't work. You could always host your own instance though, and add whatever aliases you want to that.

mechjacktv commented 4 years ago

I wondered about that too, but it can't hurt to ask.

ThatGuyWhatsMadeofCheese commented 4 years ago

I just realized that it already stores server-specific prefixes, so it's not out of the question.

But also, if you're willing to make this a thing, but are concerned about DiceMaiden getting bogged down with a bunch of aliases it has to check for across all the servers it's in, I wonder if it'd be better to have a second bot, made specifically for aliases.

Something that just scans for new alias registers, and for any that have already been registered on that server. If it sees one, it just prints the relevant !roll command, so that all DM sees is the long-form, and doesn't have to know about the server-specific alias.

I was considering making one on my end, but then I realized DM doesn't listen to bots, so it wouldn't work. So really, even just an option to have DM 'whitelist' certain bots to listen to would let anyone make a bot like that how they wanted, or alter a bot that's already in the server to do it. That way you wouldn't even need to take the time to write the code yourself.

Now, this would only allow for aliases that simply act as macros for longer commands, not ones that change the display, but that seems to cover at least half of what people want anyway. And it means that anyone who wants to, for instance, use snm for a normal roll, but snma have "!Attack Roll" appended to the end, could do that without it interfering with other aliases, or taking up more space on the main program.

mechjacktv commented 4 years ago

Yeah, I saw that DM had some server specific configuration but I didn’t really look into the implementation at all. I’ve never done any Discord not development so I’m not sure what the pitfalls are.

Humblemonk commented 4 years ago

I don't really want to go down the route right now of supporting custom aliases. There is a lot of heavily lifting required for the bot to maintain custom aliases. Id rather keep them static and support the major game systems out there today.

AncientSwordRage commented 2 years ago

Could you use pinned messages to define the commands? Then they're stored per channel.