diff --git a/bot/plugins/admin.py b/bot/plugins/admin.py index d5be95a..8757013 100644 --- a/bot/plugins/admin.py +++ b/bot/plugins/admin.py @@ -2,8 +2,7 @@ import logging import irc3 -# noinspection PyPackageRequirements -from docopt import Dict as DocOptDict +from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString @@ -13,8 +12,7 @@ logger = logging.getLogger(__name__) @command(permission='admin', show_in_help_list=False) -def reload(bot: irc3.IrcBot, mask: IrcString, target: IrcString, - args: DocOptDict): +def reload(bot: irc3.IrcBot, mask: IrcString, target: IrcString, args: Dict): """Reloads a plugin or the whole bot. %%reload [] diff --git a/bot/plugins/coins.py b/bot/plugins/coins.py index f006726..883c62a 100644 --- a/bot/plugins/coins.py +++ b/bot/plugins/coins.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import irc3 import requests -from docopt import Dict as DocOptDict +from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString @@ -21,7 +21,7 @@ class Coins(Plugin): } @command - def btc(self, mask: IrcString, target: IrcString, args: DocOptDict): + def btc(self, mask: IrcString, target: IrcString, args: Dict): """Gets the Bitcoin values from cryptowatch. %%btc [] @@ -29,14 +29,14 @@ class Coins(Plugin): return self.cryptowat_summary('btc', args) @command - def eth(self, mask: IrcString, target: IrcString, args: DocOptDict): + def eth(self, mask: IrcString, target: IrcString, args: Dict): """Gets the Ethereum values from cryptowatch. %%eth [] """ return self.cryptowat_summary('eth', args) - def cryptowat_summary(self, crypto: str, args: DocOptDict): + def cryptowat_summary(self, crypto: str, args: Dict): currency = args.get('', 'usd') if currency not in self.CURRENCIES or crypto == currency: diff --git a/bot/plugins/ctcp.py b/bot/plugins/ctcp.py index 86cfcbc..ba5c998 100644 --- a/bot/plugins/ctcp.py +++ b/bot/plugins/ctcp.py @@ -2,7 +2,7 @@ import time import irc3 -from docopt import Dict as DocOptDict +from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString @@ -20,7 +20,7 @@ class CTCP(Plugin): def _ctcp(self, name: str, nick: str, reply: str): return '\x02[{}]\x02 {}: {}'.format(name.upper(), nick, reply) - async def ctcp(self, name: str, mask: IrcString, args: DocOptDict): + async def ctcp(self, name: str, mask: IrcString, args: Dict): nick = args.get('', mask.nick) data = await self.bot.ctcp_async(nick, name.upper(), self.TIMEOUT) @@ -34,7 +34,7 @@ class CTCP(Plugin): return self._ctcp(name, nick, reply) @command - async def ping(self, mask: IrcString, target: IrcString, args: DocOptDict): + async def ping(self, mask: IrcString, target: IrcString, args: Dict): """Sends ping via CTCP to user and sends the time needed %%ping [] @@ -58,7 +58,7 @@ class CTCP(Plugin): return self._ctcp('ping', nick, reply) @command - async def time(self, mask: IrcString, target: IrcString, args: DocOptDict): + async def time(self, mask: IrcString, target: IrcString, args: Dict): """Gets the client time from nick via CTCP %%time [] @@ -66,7 +66,7 @@ class CTCP(Plugin): return await self.ctcp('time', mask, args) @command - async def ver(self, mask: IrcString, target: IrcString, args: DocOptDict): + async def ver(self, mask: IrcString, target: IrcString, args: Dict): """Gets the client version from nick via CTCP %%ver [] diff --git a/bot/plugins/isup.py b/bot/plugins/isup.py index 7455ab7..6f5b206 100644 --- a/bot/plugins/isup.py +++ b/bot/plugins/isup.py @@ -3,7 +3,7 @@ from urllib.parse import urlparse import irc3 import requests -from docopt import Dict as DocOptDict +from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString @@ -16,7 +16,7 @@ class Useless(DatabasePlugin): 'bot.plugins.storage'] @command - def isup(self, mask: IrcString, target: IrcString, args: DocOptDict): + def isup(self, mask: IrcString, target: IrcString, args: Dict): """Checks if a address is up. %%isup
diff --git a/bot/plugins/linux.py b/bot/plugins/linux.py index 6ed101c..7854581 100644 --- a/bot/plugins/linux.py +++ b/bot/plugins/linux.py @@ -3,7 +3,7 @@ import random import irc3 import feedparser -from docopt import Dict as DocOptDict +from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString @@ -35,7 +35,7 @@ class Linux(Plugin): self.bot.privmsg(target, GNU_LINUX) @command - def kernel(self, mask: IrcString, target: IrcString, args: DocOptDict): + def kernel(self, mask: IrcString, target: IrcString, args: Dict): """Get Linux kernel releases. %%kernel diff --git a/bot/plugins/mcmaniac.py b/bot/plugins/mcmaniac.py index 4e53729..9fa361c 100644 --- a/bot/plugins/mcmaniac.py +++ b/bot/plugins/mcmaniac.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import irc3 -from docopt import Dict as DocOptDict +from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString from psycopg2 import Error @@ -16,7 +16,7 @@ class McManiac(DatabasePlugin): 'bot.plugins.storage'] @command(options_first=True) - def mcmaniac(self, mask: IrcString, target: IrcString, args: DocOptDict): + def mcmaniac(self, mask: IrcString, target: IrcString, args: Dict): """Get a random McManiaC or by index. %%mcmaniac [] diff --git a/bot/plugins/quotes.py b/bot/plugins/quotes.py index acac85a..176159d 100644 --- a/bot/plugins/quotes.py +++ b/bot/plugins/quotes.py @@ -2,7 +2,7 @@ import re import irc3 -from docopt import Dict as DocOptDict +from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString from psycopg2 import Error @@ -61,7 +61,7 @@ class Quotes(DatabasePlugin): '''.format(order=order), [nick, index]) @command(options_first=True) - def q(self, mask: IrcString, target: IrcString, args: DocOptDict): + def q(self, mask: IrcString, target: IrcString, args: Dict): """Get, add or delete quotes for an user. %%q ... diff --git a/bot/plugins/rape.py b/bot/plugins/rape.py index 8a677eb..fc8e332 100644 --- a/bot/plugins/rape.py +++ b/bot/plugins/rape.py @@ -2,7 +2,7 @@ import random import irc3 -from docopt import Dict as DocOptDict +from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString from psycopg2 import Error @@ -16,7 +16,7 @@ class Rape(DatabasePlugin): 'bot.plugins.storage'] @command - def owe(self, mask: IrcString, target: IrcString, args: DocOptDict): + def owe(self, mask: IrcString, target: IrcString, args: Dict): """Shows how much a nick owes. %%owe [] @@ -44,7 +44,7 @@ class Rape(DatabasePlugin): return '{nick} owes: \x03{fines}\x03'.format(nick=nick, fines=fines) @command - def rape(self, mask: IrcString, target: IrcString, args: DocOptDict): + def rape(self, mask: IrcString, target: IrcString, args: Dict): """Rapes a nick and eventually charge for it. %%rape diff --git a/bot/plugins/seen.py b/bot/plugins/seen.py index 279e6dd..2535576 100644 --- a/bot/plugins/seen.py +++ b/bot/plugins/seen.py @@ -3,7 +3,7 @@ import re from datetime import datetime import irc3 -from docopt import Dict as DocOptDict +from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString from psycopg2 import Error @@ -17,7 +17,7 @@ class Seen(DatabasePlugin): 'bot.plugins.storage'] @command - def seen(self, mask: IrcString, target: IrcString, args: DocOptDict): + def seen(self, mask: IrcString, target: IrcString, args: Dict): """Get last seen date and message for a nick. %%seen [] diff --git a/bot/plugins/tell.py b/bot/plugins/tell.py index 1192757..e6fbb1b 100644 --- a/bot/plugins/tell.py +++ b/bot/plugins/tell.py @@ -2,7 +2,7 @@ from datetime import datetime import irc3 -from docopt import Dict as DocOptDict +from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString from psycopg2 import Error @@ -34,7 +34,7 @@ class Tell(DatabasePlugin): self.tell_queue[nick].append(res[1:]) @command - def tell(self, mask: IrcString, target: IrcString, args: DocOptDict): + def tell(self, mask: IrcString, target: IrcString, args: Dict): """Saves a message for nick to forward on activity %%tell ... diff --git a/bot/plugins/timer.py b/bot/plugins/timer.py index d79cce8..16868d1 100644 --- a/bot/plugins/timer.py +++ b/bot/plugins/timer.py @@ -5,8 +5,7 @@ from datetime import datetime import irc3 from aiocron import crontab -from docopt import Dict as DocOptDict -from irc3.plugins.command import command +from docopt import Dict from irc3.utils import IrcString from psycopg2 import Error from psycopg2.extras import DictRow @@ -26,7 +25,7 @@ class Timer(DatabasePlugin): crontab('0 * * * *', func=self.set_timers) @command - def timer(self, mask: IrcString, target: IrcString, args: DocOptDict): + def timer(self, mask: IrcString, target: IrcString, args: Dict): """Sets a timer, delay can be: s, m, h, d, w, mon, y %%timer ... diff --git a/bot/plugins/urban.py b/bot/plugins/urban.py index ff731bc..41df606 100644 --- a/bot/plugins/urban.py +++ b/bot/plugins/urban.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import irc3 import requests -from docopt import Dict as DocOptDict +from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString @@ -15,7 +15,7 @@ class Urban(Plugin): URL = 'https://api.urbandictionary.com/v0/define' @command - def ud(self, mask: IrcString, target: IrcString, args: DocOptDict): + def ud(self, mask: IrcString, target: IrcString, args: Dict): """Searches for a term on YouTube and returns first result. %%ud ... diff --git a/bot/plugins/useless.py b/bot/plugins/useless.py index 591162d..9b80baf 100644 --- a/bot/plugins/useless.py +++ b/bot/plugins/useless.py @@ -3,7 +3,7 @@ import random import re import irc3 -from docopt import Dict as DocOptDict +from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString from psycopg2 import Error @@ -42,7 +42,7 @@ class Useless(DatabasePlugin): ) @command(permission='admin', show_in_help=False) - def kim(self, mask: IrcString, target: IrcString, args: DocOptDict): + def kim(self, mask: IrcString, target: IrcString, args: Dict): """Kicks Kim, most useful command. %%kim @@ -83,7 +83,7 @@ class Useless(DatabasePlugin): self.bot.privmsg(target, '\x02[{} INTENSIFIES]'.format(msg.upper())) @command - def kill(self, mask: IrcString, target: IrcString, args: DocOptDict): + def kill(self, mask: IrcString, target: IrcString, args: Dict): """Kills a user with a random message %%kill [] @@ -103,7 +103,7 @@ class Useless(DatabasePlugin): )) @command - def yiff(self, mask: IrcString, target: IrcString, args: DocOptDict): + def yiff(self, mask: IrcString, target: IrcString, args: Dict): """Yiffs a user with a random message %%yiff [] @@ -124,7 +124,7 @@ class Useless(DatabasePlugin): )) @command - def waifu(self, mask: IrcString, target: IrcString, args: DocOptDict): + def waifu(self, mask: IrcString, target: IrcString, args: Dict): """Get waifu for a user (set with prefixing the user with =) %%waifu [...] @@ -132,7 +132,7 @@ class Useless(DatabasePlugin): return self.husbando_waifu('waifu', mask, target, args) @command - def husbando(self, mask: IrcString, target: IrcString, args: DocOptDict): + def husbando(self, mask: IrcString, target: IrcString, args: Dict): """Get husbando for a user (set with prefixing the user with =) %%husbando [...] @@ -140,7 +140,7 @@ class Useless(DatabasePlugin): return self.husbando_waifu('husbando', mask, target, args) @command - def storyofpomfface(self, mask: IrcString, target: IrcString, args: DocOptDict): + def storyofpomfface(self, mask: IrcString, target: IrcString, args: Dict): """Story of pomf face %%storyofpomfface @@ -149,7 +149,7 @@ class Useless(DatabasePlugin): self.bot.privmsg(target, face) @command - def choose(self, mask: IrcString, target: IrcString, args: DocOptDict): + def choose(self, mask: IrcString, target: IrcString, args: Dict): """Decides between items (separated by comma) %%choose ... @@ -158,7 +158,7 @@ class Useless(DatabasePlugin): return '{}: {}'.format(mask.nick, choice.strip()) @command - def jn(self, mask: IrcString, target: IrcString, args: DocOptDict): + def jn(self, mask: IrcString, target: IrcString, args: Dict): """Decides between yes and no (for a question). %%jn ... @@ -168,7 +168,7 @@ class Useless(DatabasePlugin): return '{}: \x02\x030{}'.format(mask.nick, choice) @command - def kiss(self, mask: IrcString, target: IrcString, args: DocOptDict): + def kiss(self, mask: IrcString, target: IrcString, args: Dict): """Kisses a user %%kiss [] @@ -176,7 +176,7 @@ class Useless(DatabasePlugin): return '(づ。◕‿‿◕。)\x0304。。・゜゜・。。・゜❤\x03 {} \x0304❤'.format(args.get('', mask.nick)) @command - def hug(self, mask: IrcString, target: IrcString, args: DocOptDict): + def hug(self, mask: IrcString, target: IrcString, args: Dict): """Hugs a user %%hug [] @@ -184,7 +184,7 @@ class Useless(DatabasePlugin): return '\x0304♥♡❤♡♥\x03 {} \x0304♥♡❤♡♥'.format(args.get('', mask.nick)) @command - def bier(self, mask: IrcString, target: IrcString, args: DocOptDict): + def bier(self, mask: IrcString, target: IrcString, args: Dict): """Gives a user a beer %%bier [] @@ -193,7 +193,7 @@ class Useless(DatabasePlugin): self.bot.action(target, 'schenkt ein kühles Blondes an {} aus.'.format(nick)) @command - def fucken(self, mask: IrcString, target: IrcString, args: DocOptDict): + def fucken(self, mask: IrcString, target: IrcString, args: Dict): """Kills and fucks a user %%fucken [] @@ -202,7 +202,7 @@ class Useless(DatabasePlugin): self.bot.action(target, 'fuckt {0} und tötet {0} anschließend.'.format(nick, nick)) @command(aliases=['anhero', 'sudoku']) - def seppuku(self, mask: IrcString, target: IrcString, args: DocOptDict): + def seppuku(self, mask: IrcString, target: IrcString, args: Dict): """Kicks a user %%seppuku @@ -210,7 +210,7 @@ class Useless(DatabasePlugin): self.bot.kick(target, mask.nick, 'Sayonara bonzai-chan...') @command - def hack(self, mask: IrcString, target: IrcString, args: DocOptDict): + def hack(self, mask: IrcString, target: IrcString, args: Dict): """Hacks (a user) %%hack [] @@ -219,7 +219,7 @@ class Useless(DatabasePlugin): return 'hacking{}...'.format(' %s' % nick if nick else '') @command - def gay(self, mask: IrcString, target: IrcString, args: DocOptDict): + def gay(self, mask: IrcString, target: IrcString, args: Dict): """Make someone gay (alias to rainbow) %%gay ... @@ -227,7 +227,7 @@ class Useless(DatabasePlugin): return self.rainbow(mask, target, args) @command - def rainbow(self, mask: IrcString, target: IrcString, args: DocOptDict): + def rainbow(self, mask: IrcString, target: IrcString, args: Dict): """Colorize a word in rainbow colors %%rainbow ... @@ -242,7 +242,7 @@ class Useless(DatabasePlugin): return ''.join(word) @command - def wrainbow(self, mask: IrcString, target: IrcString, args: DocOptDict): + def wrainbow(self, mask: IrcString, target: IrcString, args: Dict): """Colorize words in a sentence with rainbow colors %%wrainbow ... @@ -250,7 +250,7 @@ class Useless(DatabasePlugin): return ' '.join([self._rainbow(i, word) for i, word in enumerate(args[''])]) @command - def halfwidth(self, mask: IrcString, target: IrcString, args: DocOptDict): + def halfwidth(self, mask: IrcString, target: IrcString, args: Dict): """Turns UPPERCASE words into halfwidth characters %%halfwidth ... @@ -262,7 +262,7 @@ class Useless(DatabasePlugin): return '\x02[HALFWIDTH]\x02 {}'.format(re.sub(r'(?:\b)[A-Z]+(?:\b)', replace, ' '.join(args['']))) @command - def asshole(self, mask: IrcString, target: IrcString, args: DocOptDict): + def asshole(self, mask: IrcString, target: IrcString, args: Dict): """Checks how much of an asshole you are %%asshole [] @@ -280,7 +280,7 @@ class Useless(DatabasePlugin): return 'Asshole scan... {} is {}% of an asshole.'.format(nick, asshole_perc) @command - def assume(self, mask: IrcString, target: IrcString, args: DocOptDict): + def assume(self, mask: IrcString, target: IrcString, args: Dict): """Assumes the gender of a nick or yourself %%assume [] @@ -290,7 +290,7 @@ class Useless(DatabasePlugin): return 'Assuming {}\'s gender... they\'re a {}.'.format(nick, gender) - def husbando_waifu(self, field: str, mask: IrcString, target: IrcString, args: DocOptDict): + def husbando_waifu(self, field: str, mask: IrcString, target: IrcString, args: Dict): nick = args.get('', mask.nick) if isinstance(nick, list): nick = ' '.join(nick) diff --git a/bot/plugins/weather.py b/bot/plugins/weather.py index a2cd44d..4761335 100644 --- a/bot/plugins/weather.py +++ b/bot/plugins/weather.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import irc3 import requests -from docopt import Dict as DocOptDict +from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString @@ -17,7 +17,7 @@ class Weather(Plugin): '(select woeid from geo.places(1) where text="{}")' @command - def weather(self, mask: IrcString, target: IrcString, args: DocOptDict): + def weather(self, mask: IrcString, target: IrcString, args: Dict): """Gets the weather from Yahoo weather API. %%weather ... diff --git a/bot/plugins/youtube.py b/bot/plugins/youtube.py index a8fde0f..0079505 100644 --- a/bot/plugins/youtube.py +++ b/bot/plugins/youtube.py @@ -4,7 +4,7 @@ import re import irc3 import requests -from docopt import Dict as DocOptDict +from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString @@ -61,7 +61,7 @@ class YouTube(Plugin): self.bot.privmsg(target, data) @command - def yt(self, mask: IrcString, target: IrcString, args: DocOptDict): + def yt(self, mask: IrcString, target: IrcString, args: Dict): """Searches for query on YouTube and returns first result. %%yt ...