Sha256: f0571a48308da18f4bcc19d15e54877599373da6e196ef38a370831138d02152
Contents?: true
Size: 948 Bytes
Versions: 43
Compression:
Stored size: 948 Bytes
Contents
module Admin class Channels include Cinch::Plugin include Cinch::Helpers enable_acl(:operator, true) set( plugin_name: 'ChannelAdmin', help: "Bot administrator-only private commands.\nUsage: `?join [channel]`; `?part [channel] <reason>`; `?quit [reason]`;", ) # Regex match /join (.+)/, method: :join match /part(?: (\S+))?(?: (.+))?/, method: :part, group: :part def join(m, channel) channel.split(", ").each {|ch| Channel(ch).join @bot.handlers.dispatch :admin, m, "Attempt to join #{ch.split[0]} by #{m.user.nick}...", m.target } end def part(m, channel=nil, msg=nil) channel ||= m.channel.name msg ||= m.user.nick Channel(channel).part(msg) if channel @bot.handlers.dispatch :admin, m, "Parted #{channel}#{" - #{msg}" unless msg.nil?}", m.target end end end # AutoLoad Bot.config.plugins.plugins.push Admin::Channels
Version data entries
43 entries across 43 versions & 1 rubygems