Created
March 14, 2010 15:52
-
-
Save kylef/332048 to your computer and use it in GitHub Desktop.
Support plugin for ZMB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Support | |
def initialize(sender, settings=nil) | |
@delegate = sender | |
end | |
def commands | |
{ | |
'support' => [:support, 1, { :help => 'request support' }], | |
} | |
end | |
def support(e, message='no message') | |
if e.respond_to?('users') then | |
staff = e.users.users.reject{ |user| not user.permission?('support') } | |
staff.each{ |user| e.delegate.message(user.username, "#{e.name} is trying to get some help. (#{message})") } | |
"Support team notified." | |
end | |
end | |
end | |
Plugin.define do | |
name "support" | |
description "Support" | |
object Support | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment