Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 525 Bytes

Plugin-MeAnnounce.md

File metadata and controls

25 lines (18 loc) · 525 Bytes

Description

Just a very basic plugin for announcements.

Usage

/me SOME_ACTION

/me Waves

/me Dances

/me Slaps KandanAdmin with a Trout

Code

class Kandan.Plugins.MeAnnounce

  @options:
    regex: /^/me /

  @init: ()->
    Kandan.Modifiers.register @options.regex, (message, state) =>
      actor = message.user.username || message.user.email
      message.content = message.content.replace @options.regex, "#{actor} "
      return Kandan.Helpers.Activities.buildFromBaseTemplate(message)