Skip to content

Instantly share code, notes, and snippets.

@leejarvis
Created May 10, 2010 17:38
Show Gist options
  • Save leejarvis/396294 to your computer and use it in GitHub Desktop.
Save leejarvis/396294 to your computer and use it in GitHub Desktop.
# TESTING - not current Cinch syntax
# part the current channel
bot.plugin "part" do |m|
m.channel.part
end
# With a part message
bot.plugin "part :message" do |m|
m.channel.part m.args[:message]
end
# Return a list of all channels
bot.plugin "chanlist" do |m|
m.reply bot.channels.to_a.join(', ')
end
# Kick a user
bot.plugin "kick :user" do |m|
m.channel.kick m.args[:user]
end
# The LONG method of sending a PRIVMSG
bot.plugin "say :text" do |m|
bot.channels[m.channel].privmsg m.args[:text]
end
# Return a list of all users in the current channel
bot.plugin "users" do |m|
m.reply m.channel.users.join(', ')
end
# Return a list of all users in a different channel
bot.plugin "users :chan" do |m|
m.reply bot.channels[m.args[:chan]].users.join(', ')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment