Last active
December 20, 2015 06:59
-
-
Save ConnorWGarvey/6089889 to your computer and use it in GitHub Desktop.
IRC commands for Hubot
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
# Description: | |
# Anyone can have voice or op | |
# | |
# Commands: | |
# hubot make me an op | |
# hubot make <name> an op | |
# hubot give me voice | |
# hubot give <name> voice | |
module.exports = (robot) -> | |
robot.respond /make me an op$/i, (msg) -> | |
robot.adapter.command('MODE', msg.message.user.room, '+o', msg.message.user.name) | |
robot.respond /make @?([\w .\-_]+) an op$/i, (msg) -> | |
robot.adapter.command('MODE', msg.message.user.room, '+o', msg.match[1].trim()) | |
robot.respond /give me voice$/i, (msg) -> | |
robot.adapter.command('MODE', msg.message.user.room, '+v', msg.message.user.name) | |
robot.respond /give @?([\w .\-_]+) voice$/i, (msg) -> | |
robot.adapter.command('MODE', msg.message.user.room, '+v', msg.match[1].trim()) | |
# Automatically give everyone voice and op (as an example) | |
robot.enter (msg) -> | |
robot.adapter.command('MODE', msg.message.user.room, '+v', msg.message.user.name) | |
robot.adapter.command('MODE', msg.message.user.room, '+o', msg.message.user.name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment