mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-30 07:21:16 -05:00
Corona: obey countryFirst config on all searches
This commit is contained in:
parent
8357a0ba69
commit
02d372e3c5
@ -661,7 +661,8 @@ class Corona(callbacks.Plugin):
|
|||||||
search = countries[search.upper()]
|
search = countries[search.upper()]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
if search and self.countries.get(search):
|
|
||||||
|
def reply_country():
|
||||||
irc.reply(
|
irc.reply(
|
||||||
"\x02\x1F{0}\x1F: World Rank: #{1} | Cases: \x0307{2}\x03 "
|
"\x02\x1F{0}\x1F: World Rank: #{1} | Cases: \x0307{2}\x03 "
|
||||||
"(\x0307+{3}\x03) (\x0307+{4}\x03) | Deaths: \x0304{5}\x03 "
|
"(\x0307+{3}\x03) (\x0307+{4}\x03) | Deaths: \x0304{5}\x03 "
|
||||||
@ -691,7 +692,8 @@ class Corona(callbacks.Plugin):
|
|||||||
self.time_created(self.updated),
|
self.time_created(self.updated),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
elif search and self.states.get(search):
|
|
||||||
|
def reply_state():
|
||||||
irc.reply(
|
irc.reply(
|
||||||
"\x02\x1F{0}\x1F: USA Rank: #{1} | Cases: \x0307{2}\x03 "
|
"\x02\x1F{0}\x1F: USA Rank: #{1} | Cases: \x0307{2}\x03 "
|
||||||
"(\x0307+{3}\x03) (\x0307+{4}\x03) | Deaths: \x0304{5}\x03 "
|
"(\x0307+{3}\x03) (\x0307+{4}\x03) | Deaths: \x0304{5}\x03 "
|
||||||
@ -710,7 +712,8 @@ class Corona(callbacks.Plugin):
|
|||||||
self.time_created(self.updated),
|
self.time_created(self.updated),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
|
||||||
|
def reply_global():
|
||||||
irc.reply(
|
irc.reply(
|
||||||
"\x02\x1F{0}\x1F: Cases: \x0307{1}\x03 (\x0307+{2}\x03) "
|
"\x02\x1F{0}\x1F: Cases: \x0307{1}\x03 (\x0307+{2}\x03) "
|
||||||
"(\x0307+{3}\x03) | Deaths: \x0304{4}\x03 (\x0304{5}\x03) "
|
"(\x0307+{3}\x03) | Deaths: \x0304{4}\x03 (\x0304{5}\x03) "
|
||||||
@ -758,6 +761,21 @@ class Corona(callbacks.Plugin):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if self.registryValue("countryFirst", msg.channel):
|
||||||
|
if search and self.countries.get(search):
|
||||||
|
reply_country()
|
||||||
|
elif search and self.states.get(search):
|
||||||
|
reply_state()
|
||||||
|
else:
|
||||||
|
reply_global()
|
||||||
|
else:
|
||||||
|
if search and self.states.get(search):
|
||||||
|
reply_state()
|
||||||
|
elif search and self.countries.get(search):
|
||||||
|
reply_country()
|
||||||
|
else:
|
||||||
|
reply_global()
|
||||||
|
|
||||||
@wrap([optional("text")])
|
@wrap([optional("text")])
|
||||||
def top10(self, irc, msg, args, search):
|
def top10(self, irc, msg, args, search):
|
||||||
"""[usa|global]
|
"""[usa|global]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user