I have a working bot already, but I'm looking to add a feature to it. At the moment, the bot is only ran in my IRC channel. But I'm looking to allow other people to use it as well. What I would like to do is make it so they can make their own chat commands.

Example:

"Bob" has the bot in his channel "#bob". Anytime Bob types "!dog" the bot will do "/msg #bob Bob has a dog!".

Users can add a command with something like:

!addcom !dog Bob has a dog!

That would then add the command to the script, and only work in #bob. Does anybody have a code snippit or able to point me in the right direction?