diff --git a/bot/dope.py b/bot/drugs.py similarity index 76% rename from bot/dope.py rename to bot/drugs.py index ffee116..99d11b7 100644 --- a/bot/dope.py +++ b/bot/drugs.py @@ -1,15 +1,14 @@ # -*- coding: utf-8 -*- import random -import irc3 from docopt import Dict from irc3.plugins.command import command from irc3.utils import IrcString from . import Plugin -class Dope(Plugin): +class Drugs(Plugin): # All strains from https://www.leafly.com/explore STRAINS = { 'sativa': [ @@ -26,7 +25,7 @@ class Dope(Plugin): 'Maui Wowie', 'Chocolope', 'Harlequin', - ], + ], 'indica': [ 'Granddaddy Purple', 'Bubba Kush', @@ -45,7 +44,7 @@ class Dope(Plugin): 'Skywalker', 'White Rhino', 'Hindu Kush', - ], + ], 'hybrid': [ 'Blue Dream', 'Girl Scout Cookies', @@ -65,29 +64,28 @@ class Dope(Plugin): 'Platinum Girl Scout Cookies', 'Golden Goat', 'Agent Orange', - ], - } - + ], + } ACTIONS = { 'joint': [ ('passes', 'to'), ('rolls', 'for'), ('lights', 'for'), - ], + ], 'bong': [ ('passes', 'to'), ('preps', 'for'), ('lights', 'for'), - ], + ], 'vape': [ ('passes', 'to'), - ], + ], 'blunt': [ ('passes', 'to'), ('rolls', 'for'), ('lights', 'for'), - ], - } + ], + } @command def dope(self, mask: IrcString, target: IrcString, args: Dict): @@ -95,20 +93,16 @@ class Dope(Plugin): %%dope [] """ - strain_types = list(self.STRAINS.keys()) - strain_type = random.choice(strain_types) - strain = random.choice(self.STRAINS[strain_type]) + strain_type = random.choice(strain_types) + consume_type = random.choice(list(self.ACTIONS.keys())) + action = random.choice(self.ACTIONS[consume_type]) - consume_type = random.choice(list(self.ACTIONS.keys())) - action = random.choice(self.ACTIONS[consume_type]) - - nick = args.get('', mask.nick) - - self.bot.action(target, '{action0} a {consume_type} of the finest {strain_type} "{strain}" {action1} {nick}'.format( + self.bot.action(target, '{action0} a {consume} of the finest {type} "{strain}" {action1} {nick}'.format( action0=action[0], action1=action[1], - consume_type=consume_type, - strain_type=strain_type, - strain=strain, - nick=nick)) + consume=consume_type, + strain=random.choice(self.STRAINS[strain_type]), + nick=args.get('', mask.nick), + type=strain_type, + )) diff --git a/files/config.json b/files/config.json index 4232b6b..5d898df 100644 --- a/files/config.json +++ b/files/config.json @@ -14,6 +14,7 @@ "bot.admin", "bot.coins", "bot.ctcp", + "bot.drugs", "bot.isup", "bot.linux", "bot.mcmaniac",