Fix actions

This commit is contained in:
Nils Schweinsberg 2017-09-05 22:00:40 +02:00
parent dacbf44d44
commit 3dd02bb94d

View File

@ -68,6 +68,27 @@ class Dope(Plugin):
],
}
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):
"""Smoke weed everyday
@ -79,37 +100,14 @@ class Dope(Plugin):
strain_type = random.choice(strain_types)
strain = random.choice(self.STRAINS[strain_type])
actions = {
'joint': [
'passes',
'rolls',
'lights',
],
'bong': [
'passes',
'preps',
'lights',
],
'vape': [
'passes',
],
'blunt': [
'passes',
'rolls',
'lights',
],
}
consume_type = random.choice(list(self.ACTIONS.keys()))
action = random.choice(self.ACTIONS[consume_type])
consume_type = random.choice(list(actions.keys()))
action = random.choice(actions[consume_type])
nick = args.get('<nick>', mask.nick)
if args['<nick>']:
nick = args['<nick>']
else:
nick = mask.nick
self.bot.action(target, '{action} a {consume_type} of the finest {strain_type} "{strain}" to {nick}'.format(
action=action,
self.bot.action(target, '{action0} a {consume_type} of the finest {strain_type} "{strain}" {action1} {nick}'.format(
action0=action[0],
action1=action[1],
consume_type=consume_type,
strain_type=strain_type,
strain=strain,