Created
January 3, 2018 02:06
-
-
Save lethaldev/b006eecd6fc2bae5829f2cc0fe12154d to your computer and use it in GitHub Desktop.
Delayed voice Cinch bot
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
# 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