dgc icon indicating copy to clipboard operation
dgc copied to clipboard

Dynamic guild specific prefixes

Open mcdearman opened this issue 4 years ago • 2 comments

Not sure if you have support for this, but if not I would love to see it implemented. The idea arises in the following use case: suppose my bot is in many servers and there is a command to add and remove prefixes. Each guild has it's own list of prefixes stored in the database. These lists are subject to change. So one way to set the prefixes (the way discord.py does it) is to pass in a callable as the command prefix that takes a bot and a message as params. This way the prefixes are fetched using that callable inside the router's message handler. In the case of dgo I would assume you'd want to take in a session. Let me know if this is feasible or something you're interested in adding. Thanks.

mcdearman avatar Jul 20 '20 07:07 mcdearman

Actually, thinking about it more, if you want to be able to get the db from inside the callable, you wouldn't pass a session but an interface. This way someone can have custom types and logic (they don't have to be querying a db).

mcdearman avatar Jul 20 '20 07:07 mcdearman

Hey^^

Yeah, I'm currently busy working on another project, but I plan to rewrite the whole command routing, because it is pretty inefficient/buggy. I will think about your suggestion when I get to it!

lus avatar Jul 20 '20 08:07 lus