Created
September 23, 2011 09:15
-
-
Save tyama/1237003 to your computer and use it in GitHub Desktop.
pircbotx groovy example.
This file contains hidden or 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
@Grab(group='org.pircbotx', module='pircbotx', version='1.5') | |
import org.pircbotx.PircBotX | |
import org.pircbotx.hooks.ListenerAdapter | |
def botName = "your_bot_name" | |
def serverName = "your.servername.com" | |
def channel = "#channel" | |
def bot = new PircBotX() | |
bot.name = bot.nick = bot.login = botName | |
bot.verbose=false | |
bot.getListenerManager().addListener( | |
[onMessage:{e -> | |
println "(${e.user.nick}) ${e.message} [${new Date().format('yyyy/MM/dd HH:mm:ss')}]" | |
//"say -v Kyoko -r 300 \"${e.message}、と、${e.user.nick}が、言っとる\"".execute() | |
}] as ListenerAdapter | |
) | |
bot.connect serverName | |
bot.joinChannel channel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment