from istring import istring
from datetime import datetime
from decimal import Decimal, InvalidOperation
-from pseudoclient import sys_options, sys_log, sys_antiflood
+from pseudoclient import sys_options, sys_log, sys_antiflood, inviteable
from utils import *
from pyva import *
import pyva_net_rizon_acid_core_Acidictive as Acidictive
import pyva_net_rizon_acid_core_AcidCore as AcidCore
import pyva_net_rizon_acid_core_User as User
-import pyva_net_rizon_acid_core_Channel as Channel
-class erepublik(AcidPlugin):
+class erepublik(
+ AcidPlugin,
+ inviteable.InviteablePseudoclient
+):
initialized = False
def bind_function(self, function):
self.options.stop()
self.options.db_close()
- def join(self, channel):
- me = User.findUser(self.nick)
- me.joinChan(channel)
-
- def part(self, channel):
- me = User.findUser(self.nick)
- chan = Channel.findChannel(channel)
- if chan:
- me.partChan(chan)
-
def errormsg(self, target, message):
self.msg(target, '@b@c4Error:@o %s' % message)
self.channels.remove(channel)
self.elog.request('Channel @b%s@b was dropped. Deleting it.' % channel)
- def onNotice(self, source, target, message):
- if not self.initialized:
- return
-
- me = User.findUser(self.nick)
- user = User.findUser(target)
- userinfo = User.findUser(source)
-
- if me != user or (userinfo != None and userinfo['nick'] != 'ChanServ'):
- return
-
- try:
- msg = message.strip()
- except:
- return
-
- if msg.startswith('[#'): #It's a channel welcome message. Let's ignore it.
- return
-
- self.elog.chanserv('%s' % msg)
- sp = msg.split(' ')
-
- if userinfo == None:
- if 'tried to kick you from' in msg:
- nick = strip_ascii_irc(sp[1])
- channel = strip_ascii_irc(sp[7])
- self.notice(nick, 'To remove this bot (must be channel founder): @b/msg %s remove %s@b' % (self.nick, channel))
-
- return
-
- if "isn't registered" in msg:
- self.auth.reject_not_registered(strip_ascii_irc(sp[1]))
- return
-
- if len(sp) < 6:
- return
-
- if 'inviting' in sp[2]: #It's an invite notice. Let's ignore it.
- return
-
- nick = strip_ascii_irc(sp[0])
- channel = sp[5][0:len(sp[5]) - 1]
-
- if 'Founder' in sp[2]:
- self.auth.accept(nick)
- else:
- self.auth.reject_not_founder(nick, channel)
-
def onPrivmsg(self, source, target, message):
if not self.initialized:
return
from istring import istring
from datetime import datetime
from decimal import Decimal, InvalidOperation
-from pseudoclient import sys_options, sys_log, cmd_manager, sys_antiflood
+from pseudoclient import sys_options, sys_log, cmd_manager, sys_antiflood, inviteable
from utils import *
from pyva import *
import pyva_net_rizon_acid_core_Acidictive as Acidictive
import pyva_net_rizon_acid_core_AcidCore as AcidCore
import pyva_net_rizon_acid_core_User as User
-import pyva_net_rizon_acid_core_Channel as Channel
-class esim(AcidPlugin):
+class esim(
+ AcidPlugin,
+ inviteable.InviteablePseudoclient
+):
def bind_function(self, function):
func = types.MethodType(function, self, esim)
setattr(esim, function.__name__, func)
self.options.stop()
self.options.db_close()
- def join(self, channel):
- me = User.findUser(self.nick)
- me.joinChan(channel)
-
- def part(self, channel):
- me = User.findUser(self.nick)
- chan = Channel.findChannel(channel)
- if chan:
- me.partChan(chan)
-
def errormsg(self, target, message):
self.msg(target, '@b@c4Error:@o %s' % message)
self.channels.remove(channel)
self.elog.request('Channel @b%s@b was dropped. Deleting it.' % channel)
- def onNotice(self, source, target, message):
- if not self.initialized:
- return
-
- me = User.findUser(self.nick)
- user = User.findUser(target)
- userinfo = User.findUser(source)
-
- if me != user or (userinfo != None and userinfo['nick'] != 'ChanServ'):
- return
-
- try:
- msg = message.strip()
- except:
- return
-
- if msg.startswith('[#'): #It's a channel welcome message. Let's ignore it.
- return
-
- self.elog.chanserv('%s' % msg)
- sp = msg.split(' ')
-
- if userinfo == None:
- if 'tried to kick you from' in msg:
- nick = strip_ascii_irc(sp[1])
- channel = strip_ascii_irc(sp[7])
- self.notice(nick, 'To remove this bot (must be channel founder): @b/msg %s remove %s@b' % (self.nick, channel))
-
- return
-
- if "isn't registered" in msg:
- self.auth.reject_not_registered(strip_ascii_irc(sp[1]))
- return
-
- if len(sp) < 6:
- return
-
- if 'inviting' in sp[2]: #It's an invite notice. Let's ignore it.
- return
-
- nick = strip_ascii_irc(sp[0])
- channel = sp[5][0:len(sp[5]) - 1]
-
- if 'Founder' in sp[2]:
- self.auth.accept(nick)
- else:
- self.auth.reject_not_founder(nick, channel)
-
def onPrivmsg(self, source, target, message):
if not self.initialized:
return
import pyva_net_rizon_acid_core_Acidictive as Acidictive
import pyva_net_rizon_acid_core_AcidCore as AcidCore
import pyva_net_rizon_acid_core_User as User
-import pyva_net_rizon_acid_core_Channel as Channel
class internets(
AcidPlugin,
self.options.stop()
self.options.db_close()
- def join(self, channel):
- me = User.findUser(self.nick)
- me.joinChan(channel)
-
- def part(self, channel):
- me = User.findUser(self.nick)
- chan = Channel.findChannel(channel)
- if chan:
- me.partChan(chan)
-
def errormsg(self, target, message):
self.msg(target, '@b@c4Error:@o %s' % message)
self.limit_monitor.stop()
def join(self, channel):
- me = User.findUser(self.nick)
- me.joinChan(channel)
- self.msg('ChanServ', 'OP %s' % channel) # and the channel is not empty. For now, use /cs op
-
- def part(self, channel):
- me = User.findUser(self.nick)
- chan = Channel.findChannel(channel)
- if chan:
- me.partChan(chan)
+ super(limitserv, self).join(channel)
+ self.msg('ChanServ', 'OP %s' % channel) # and the channel is not empty. For now, use /cs op
def msg(self, target, message):
if message != '':
from core import anope_major
import pyva_net_rizon_acid_core_User as User
+import pyva_net_rizon_acid_core_Channel as Channel
#---------------------------------------------------------------------#
# this is terrible
def do_accept(self, nick, channel):
self.auth.accept(nick)
+ def join(self, channel):
+ me = User.findUser(self.nick)
+ me.joinChan(channel)
+
+ def part(self, channel):
+ me = User.findUser(self.nick)
+ chan = Channel.findChannel(channel)
+ if chan:
+ me.partChan(chan)
+
def onNotice(self, source, target, message):
if not self.initialized:
return
self.options.db_close()
def join(self, channel):
- me = User.findUser(self.nick)
- me.joinChan(channel)
+ super(quotes, self).join(channel)
self.dbp.execute("INSERT IGNORE INTO quotes_chans(name) VALUES(%s)", (str(channel),))
def part(self, channel):
- me = User.findUser(self.nick)
- chan = Channel.findChannel(channel)
- if chan:
- me.partChan(chan)
+ super(quotes, self).part(channel)
self.dbp.execute("DELETE FROM quotes_quotes WHERE channel=%s", (self.get_cid(channel),))
self.dbp.execute("DELETE FROM quotes_chans WHERE name=%s", (str(channel),))
import pyva_net_rizon_acid_core_Acidictive as Acidictive
import pyva_net_rizon_acid_core_AcidCore as AcidCore
import pyva_net_rizon_acid_core_User as User
-import pyva_net_rizon_acid_core_Channel as Channel
class trivia(
AcidPlugin,
self.trivias.clear()
def join(self, channel):
- me = User.findUser(self.nick)
- me.joinChan(channel)
+ super(trivia, self).join(channel)
self.dbp.execute("INSERT IGNORE INTO trivia_chans(name) VALUES(%s)", (str(channel),))
def part(self, channel):
- me = User.findUser(self.nick)
- chan = Channel.findChannel(channel)
- if chan:
- me.partChan(chan)
+ super(trivia, self).part(channel)
self.stop_trivia(channel, True)
self.dbp.execute("DELETE FROM trivia_chans WHERE name=%s", (str(channel),))