Skip to content

Instantly share code, notes, and snippets.

@lethaldev
Created January 3, 2018 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lethaldev/b006eecd6fc2bae5829f2cc0fe12154d to your computer and use it in GitHub Desktop.
Save lethaldev/b006eecd6fc2bae5829f2cc0fe12154d to your computer and use it in GitHub Desktop.
Delayed voice Cinch bot
# encoding: utf-8
require 'cinch'
bot = Cinch::Bot.new do
configure do |c|
c.server = "some.irc.network"
c.port = 6697
c.ssl.use = true
c.ssl.verify = true
c.nick = "bot"
c.user = "ident"
c.realname = "bot name"
c.channels = ["#mychannel"]
end
on :join do |m|
unless m.user.nick == bot.nick
User(m.user).send("Welcome to our channel! To avoid spam, the channel is moderated. You will be auto-voiced in one minute.", notice=true)
Timer(60, shots: 1) { m.channel.voice(m.user) }
end
end
end
bot.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment