Closed bazz1tv closed 8 years ago
yup, http://www.rubydoc.info/gems/cinch/Cinch/Bot#quit-instance_method
works for me:
require 'cinch'
class Quit
include Cinch::Plugin
match(/q (.+)/, method: :q)
def q(m, qm)
m.bot.quit(qm)
end
end
bot = Cinch::Bot.new do
configure do |c|
c.nick = 'QuitBot'
c.server = 'irc.snoonet.org'
c.port = 6697
c.ssl.use = true
c.channels = ['#examplechannel']
c.verbose = true
c.plugins.plugins = [
Quit,
]
end
end
bot.start
(It's admitted by me that the example misses two lines that I used, my bot's sasl username and password, but that's not relevant to the example)
04:32:00 <@pt> !q a
04:32:05 -!- QuitBot [cinch@user/pt/bot/ptbot] has quit [Quit: a]
Nice, I just realize I want to have a custom particular quit message also when I quit my bot via ctrl-c signal. I think I will be able to come up with that on my own. I feel comfortable closing this issue then. Thanks 😃
Is this already possible?