· 8 years ago · Aug 13, 2018, 08:24 PM
1import asyncio
2import json
3
4import codecs
5import os
6import random
7import re
8
9from cloudbot import hook
10from cloudbot.util import textgen
11
12nick_re = re.compile("^[A-Za-z0-9_|.\-\]\[\{\}]*$", re.I)
13
14#
15# https://github.com/CloudBotIRC/CloudBot/tree/master/plugins
16# https://pastebin.com/u/Hack5190
17#
18# Hack5190 (at) gmail.com
19#
20# v1.0 - 13-Aug-2018 - Initial release
21#
22
23hotdog = ['bacon-wrapped hot dog nestled in a steamed bolillo rolls and topped with pinto beans, chopped tomatoes, onions, mustard, mayo, and jalapeños',
24 'steamed beef frank in a natural casing, served in a steamed split-top bun, and topped with a minced meat chili (no tomatoes or beans), chopped raw onions, and mustard',
25 'griddled natural casing all-beef hot dog served in steamed side-cut roll with meat sauce, mustard, chopped onion, and a dash of celery salt',
26 'hot dog slathered with a sweet, finely chopped, mayo-based slaw',
27 'hot dog slathered with a chili-slaw (cole slaw, mustard, raw onion, minced all-meat chili) and BBQ',
28 'skinny all-beef hot dog deep fried and stuffed into a half-round of Italian bread along with fried onion, peppers, and potato rounds',
29 'all beef dog in a steamed poppy seed bun, topped with minced raw onion, neon sweet relish, sport peppers, pickle spear, halved tomato slices, yellow mustard, celery salt and NO ketchup',
30 'all-beef natural casing dog served in steamed buns and topped with minced meat chili, mustard, chopped onions and shredded cheddar',
31 'all-beef frank in a natural casing, griddled and served on a toasted bun with deli-style mustard, tart sauerkraut',
32 'all-beef dog sliced down the middle and stuffed with Cheez Whiz and crispy bacon, then grilled and served on a toasted bun',
33 'kosher all-beef dog, wrapped in bologna, griddled, lined with yellow mustard, fit snugly into a toasted bun',
34 'all-beef hot dog, grilled and nestled into a soft, chewy bun, then loaded with lump crab meat, hot gooey macaroni & cheese, and a generous dusting of Old Bay']
35
36def is_valid(target):
37 """ Checks if a string is a valid IRC nick. """
38 if nick_re.match(target):
39 return True
40 else:
41 return False
42
43
44@asyncio.coroutine
45@hook.command
46def hotdog(text, action):
47 """<user> - gives <user> a hotdog"""
48 user = text.strip()
49
50 if not is_valid(user):
51 return "I can't give a hot dog to that user."
52
53 hotdog_style = random.choice(hotdog)
54
55 action("prepares a {} for {}, enjoy.".format(hotdog_style, user))