Compare commits

...

2 Commits

Author SHA1 Message Date
an 9d4b991b19 style fixes 2019-07-17 19:01:03 -04:00
an 8970810891 use SSL on IRC backend 2019-07-17 19:00:54 -04:00
3 changed files with 16 additions and 9 deletions

View File

@ -107,14 +107,16 @@ module Backend_IRC
@real = Cinch::Bot.new do @real = Cinch::Bot.new do
configure do |cfg| configure do |cfg|
cfg.server = info[:server] cfg.server = info[:server]
cfg.nick = info[:nick] || "vrobot4" cfg.nick = info[:nick] || "vrobot4"
cfg.port = info[:port] if info.key? :port cfg.port = info[:port] if info.key? :port
cfg.password = info[:pass] if info.key? :pass cfg.password = info[:pass] if info.key? :pass
cfg.modes = info[:modes] if info.key? :modes cfg.modes = info[:modes] if info.key? :modes
cfg.channels = info[:channels] if info.key? :channels cfg.channels = info[:channels] if info.key? :channels
cfg.realname = "vrobot4" cfg.ssl = true
cfg.user = "vrobot4" cfg.ssl.verify = true
cfg.realname = "vrobot4"
cfg.user = "vrobot4"
cfg.message_split_start = "" cfg.message_split_start = ""
cfg.message_split_end = "" cfg.message_split_end = ""
end end

View File

@ -4,9 +4,11 @@ class Mod_RoleChooser < Vrobot4::Module::Module
def initialize info def initialize info
super super
register :c_addvrole, "addvroles", "Adds another vanity role to you." register :c_addvrole, "addvroles", "Adds another vanity role to you."
register :c_delvrole, "delvroles", "Removes a vanity role from you." register :c_delvrole, "delvroles", "Removes a vanity role from you."
register :c_listvroles, "listvroles", "Lists available vanity roles." register :c_listvroles, "listvroles", "Lists available vanity roles."
@info.map! do |id| id.resolve_id end @info.map! do |id| id.resolve_id end
end end
@ -32,7 +34,7 @@ class Mod_RoleChooser < Vrobot4::Module::Module
def c_listvroles m, argv def c_listvroles m, argv
text = "" text = ""
for role in @info do for role in @info do
text << m.chan.real.server.role(role).name + "\n" text << m.chan.real.server.role(role).name + ?\n
end end
m.reply text m.reply text
end end

View File

@ -76,6 +76,9 @@ module Vrobot4::Server
# @return [void] # @return [void]
def load_mod mod def load_mod mod
mt = Vrobot4::Module.get_module_type(mod) mt = Vrobot4::Module.get_module_type(mod)
if mt == nil
raise ArgumentError, "No such module #{mod} exists"
end
if mt[:server] and mt[:server] != self.class.type or if mt[:server] and mt[:server] != self.class.type or
mt[:servflags] and mt[:servflags] !~ flags then mt[:servflags] and mt[:servflags] !~ flags then
raise ArgumentError, "Module #{mod} is not valid for this server" raise ArgumentError, "Module #{mod} is not valid for this server"