3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-29 06:02:38 +01:00

handlers, fantasy: migrate away from irc.botdata (#273)

This commit is contained in:
James Lu 2017-03-05 00:10:33 -08:00
parent d318fbac77
commit e8bf1d08bc
2 changed files with 5 additions and 5 deletions

View File

@ -75,7 +75,7 @@ def handle_whois(irc, source, command, args):
# 3) +H is set, but whois_use_hideoper is disabled in config
isHideOper = (irc.umodes.get('hideoper'), None) in user.modes
if (not isHideOper) or (isHideOper and sourceisOper) or \
(isHideOper and not irc.botdata.get('whois_use_hideoper', True)):
(isHideOper and not conf.conf['bot'].get('whois_use_hideoper', True)):
# Let's be gramatically correct. (If the opertype starts with a vowel,
# write "an Operator" instead of "a Operator")
n = 'n' if user.opertype[0].lower() in 'aeiou' else ''

View File

@ -1,5 +1,5 @@
# fantasy.py: Adds FANTASY command support, to allow calling commands in channels
from pylinkirc import utils, world
from pylinkirc import utils, world, conf
from pylinkirc.log import log
def handle_fantasy(irc, source, command, args):
@ -9,7 +9,7 @@ def handle_fantasy(irc, source, command, args):
# Break if the IRC network isn't ready.
return
respondtonick = irc.botdata.get("respondtonick")
respondtonick = conf.conf['bot'].get("respondtonick")
channel = args['target']
orig_text = args['text']
@ -32,8 +32,8 @@ def handle_fantasy(irc, source, command, args):
# Try to look up a prefix specific for this bot in
# bot: prefixes: <botname>, falling back to the default prefix if not
# specified.
prefixes = [irc.botdata.get('prefixes', {}).get(botname) or
irc.botdata.get('prefix')]
prefixes = [conf.conf['bot'].get('prefixes', {}).get(botname) or
conf.conf['bot'].get('prefix')]
# If responding to nick is enabled, add variations of the current nick
# to the prefix list: "<nick>," and "<nick>:"