erichaagdev / KappaBot

The derpiest chat bot of them all.
1 stars 1 forks source link

Implement bot functions concept #12

Closed erichaagdev closed 4 years ago

erichaagdev commented 4 years ago

The purpose of this PR is to allow for easier additions to but functionality by breaking each function into its own class implementing a common interface. Current examples of bot functions are mobile Slashdot URL parsing and commands.

The new BotFunction interface consists of two methods:

New implementations of BotFunction are picked up automatically and any integrations that need to process messages can simply call the process method in the new FunctionProcessor class and an appropriate response will be returned.