Skip to content

Instantly share code, notes, and snippets.

@tyama
Created September 23, 2011 09:15
Show Gist options
  • Save tyama/1237003 to your computer and use it in GitHub Desktop.
Save tyama/1237003 to your computer and use it in GitHub Desktop.
pircbotx groovy example.
@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