mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-02 15:44:06 +01:00
Added networkIrc, owner, admin.
This commit is contained in:
parent
e2e5acbac0
commit
640241bd11
@ -245,6 +245,18 @@ def getChannelDb(irc, msg, args, state, **kwargs):
|
|||||||
else:
|
else:
|
||||||
getChannel(irc, msg, args, state, **kwargs)
|
getChannel(irc, msg, args, state, **kwargs)
|
||||||
|
|
||||||
|
def getNetworkIrc(irc, msg, args, state, errorIfNoMatch=False):
|
||||||
|
if args:
|
||||||
|
for otherIrc in world.ircs:
|
||||||
|
if otherIrc.network.lower() == args[0].lower():
|
||||||
|
state.args.append(otherIrc)
|
||||||
|
del args[0]
|
||||||
|
return
|
||||||
|
if errorIfNoMatch:
|
||||||
|
raise callbacks.ArgumentError
|
||||||
|
else:
|
||||||
|
state.args.append(irc)
|
||||||
|
|
||||||
def getHaveOp(irc, msg, args, state, action='do that'):
|
def getHaveOp(irc, msg, args, state, action='do that'):
|
||||||
if state.channel not in irc.state.channels:
|
if state.channel not in irc.state.channels:
|
||||||
irc.error('I\'m not even in %s.' % state.channel, Raise=True)
|
irc.error('I\'m not even in %s.' % state.channel, Raise=True)
|
||||||
@ -432,6 +444,12 @@ def checkCapability(irc, msg, args, state, cap):
|
|||||||
if not ircdb.checkCapability(msg.prefix, cap):
|
if not ircdb.checkCapability(msg.prefix, cap):
|
||||||
irc.errorNoCapability(cap, Raise=True)
|
irc.errorNoCapability(cap, Raise=True)
|
||||||
|
|
||||||
|
def owner(irc, msg, args, state):
|
||||||
|
checkCapability(irc, msg, args, state, 'owner')
|
||||||
|
|
||||||
|
def admin(irc, msg, args, state):
|
||||||
|
checkCapability(irc, msg, args, state, 'admin')
|
||||||
|
|
||||||
def anything(irc, msg, args, state):
|
def anything(irc, msg, args, state):
|
||||||
state.args.append(args.pop(0))
|
state.args.append(args.pop(0))
|
||||||
|
|
||||||
@ -546,6 +564,7 @@ wrappers = ircutils.IrcDict({
|
|||||||
'inChannel': inChannel,
|
'inChannel': inChannel,
|
||||||
'onlyInChannel': onlyInChannel,
|
'onlyInChannel': onlyInChannel,
|
||||||
'nickInChannel': nickInChannel,
|
'nickInChannel': nickInChannel,
|
||||||
|
'networkIrc': getNetworkIrc,
|
||||||
'callerInGivenChannel': callerInGivenChannel,
|
'callerInGivenChannel': callerInGivenChannel,
|
||||||
'plugin': getPlugin,
|
'plugin': getPlugin,
|
||||||
'boolean': getBoolean,
|
'boolean': getBoolean,
|
||||||
@ -569,6 +588,8 @@ wrappers = ircutils.IrcDict({
|
|||||||
'regexpMatcher': getMatcher,
|
'regexpMatcher': getMatcher,
|
||||||
'validChannel': validChannel,
|
'validChannel': validChannel,
|
||||||
'regexpReplacer': getReplacer,
|
'regexpReplacer': getReplacer,
|
||||||
|
'owner': owner,
|
||||||
|
'admin': admin,
|
||||||
'checkCapability': checkCapability,
|
'checkCapability': checkCapability,
|
||||||
'checkChannelCapability': checkChannelCapability,
|
'checkChannelCapability': checkChannelCapability,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user