Skip to content

More convenient way extend bot functionnalities #7

@rayfranco

Description

@rayfranco

Writing on the Bot prototype seems a bad idea to me.

What about creating a mixin option like underscore do to extend the bot functionnalities ?

bot.mixin
  hear: (regex, callback) ->
    event: 'user:talk'
    trigger: (r) -> #...

Allow better control on what is added as prototype method.

Even extending the class seems nicer to me :

class MyBot extends fatbot.Bot
  constuctor: (settings, myargument, args...)
    super(settings, args...)
    @coolstuff = myarguments.coolstuff
    # ...
  hear: (regex, callback) ->
    #...

bot = new MyBot settings, stuff

bot.connect()

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions