Skip to content

Commit

Permalink
Merge pull request CloudBotIRC#207 from IlGnome/gonzobot
Browse files Browse the repository at this point in the history
rework of dwi.py
  • Loading branch information
edwardslabs authored Nov 21, 2017
2 parents f1470fa + f19d775 commit 93de966
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 51 deletions.
78 changes: 78 additions & 0 deletions data/reactionmacros.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"deal_with_it_macros": [
"https://i.imgur.com/WhgY2sX.gif",
"https://i.imgur.com/eGInc.jpg",
"https://i.imgur.com/KA3XSt5.gif",
"https://i.imgur.com/rsuXB69.gif",
"https://i.imgur.com/fFXmuSS.jpg",
"https://j.gifs.com/L9mmYr.gif",
"https://i.imgur.com/nxMBqb4.gif",
"https://i.imgur.com/LZFE3y1.gif",
"https://i.imgur.com/cky1KZB.gif",
"https://i.imgur.com/ubPvLt4.jpg",
"https://i.imgur.com/xMlks5p.jpg",
"https://i.imgur.com/Awqpq.gif",
"http://nerdist.com/wp-content/uploads/2016/04/Thanks-Obama-2.gif"
],
"facepalm_macros": [
"https://i.imgur.com/iWKad22r.jpg",
"https://i.imgur.com/3Jauxrw.jpg",
"https://i.imgur.com/kFyKOgj.gif",
"https://i.imgur.com/5JaFlhU.jpg?1",
"https://i.imgur.com/qbnNXWy.gif",
"https://i.imgur.com/h46ycmx.png",
"https://i.imgur.com/gPNQzaf.jpg",
"https://i.imgur.com/9I8A9C5.jpg",
"https://i.imgur.com/pSVD0jZ.jpg",
"https://i.imgur.com/2kX7tdb.jpg",
"https://i.imgur.com/R7ZPh.png",
"https://i.imgur.com/8p2VGIY.jpg",
"https://i.imgur.com/8VYMSq8.gif",
"https://i.imgur.com/WVn7B8O.jpg",
"https://i.imgur.com/GTxRRuv.gif"
],
"head_desk_macros": [
"https://i.imgur.com/Pg9nt.gif",
"https://baudattitude.files.wordpress.com/2012/02/twilightsparkleheaddesk.gif",
"https://i.imgur.com/LFzzTd8.gif",
"https://i.imgur.com/DS0uEfv.jpg",
"https://i.imgur.com/31ZJ2mT.jpg",
"https://68.media.tumblr.com/20a0fe049b41d2be7562d19543fc9bf2/tumblr_inline_mq00ylPF1l1qz4rgp.gif",
"https://i.imgur.com/RW2NAcQ.jpg",
"https://i.imgur.com/1bmcUnj.gif",
"https://i.imgur.com/r43WCSK.gif",
"http://img.photobucket.com/albums/v642/StarRose/GIFS/headdesk.gif"
],
"fetish_macros": [
"https://i.imgur.com/FFy1IEg.jpg",
"https://i.imgur.com/RspJyHy.gif",
"https://i.imgur.com/J6EB8vs.gif",
"https://imgur.com/LoYBEhZ",
"https://i.imgur.com/bn2pnT6.gif",
"https://i.imgur.com/MfZydOB.gif",
"https://i.imgur.com/8N3DmQ6.gif",
"https://imgur.com/veDLZc6",
"https://i.imgur.com/jRTllgX.gif",
"https://i.imgur.com/r9187c5.gif",
"https://i.imgur.com/HUW0L1q.jpg",
"https://i.imgur.com/rDhDhIU.gif",
"https://i.imgur.com/QYypuG1.gif",
"https://i.imgur.com/SE0Wzjx.gif",
"https://i.imgur.com/SUNo8wV.gif",
"https://i.imgur.com/xcruehZ.gif",
"https://i.imgur.com/dTtAQyI.gif",
"https://i.imgur.com/DIK7Tpb.gif",
"https://i.imgur.com/uDlBc7X.gif",
"https://i.imgur.com/dIy5gdd.gif",
"https://i.imgur.com/9TGDK39.jpg",
"https://i.imgur.com/fSiBZOj.gif",
"https://i.imgur.com/f5JMDGK.jpg",
"https://i.imgur.com/Wy2URSw.gif",
"https://i.imgur.com/CVfuIwe.jpg",
"https://i.imgur.com/3xKiDnC.gif",
"https://i.imgur.com/WDszWfj.gif",
"https://i.imgur.com/1DRvg1V.gif",
"https://i.imgur.com/WK723Wk.jpg",
"https://i.imgur.com/DJiaI7L.png"
]
}
51 changes: 0 additions & 51 deletions plugins/dwi.py

This file was deleted.

48 changes: 48 additions & 0 deletions plugins/reactions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import codecs
import json
import os
import random
from cloudbot import hook


deal_with_it_phrases = [ 'Stop complaining, \x02{}\x02, and',
'Jesus fuck \x02{}\x02, just',
'Looks like \x02{}\x02 needs to',
'Ever think that \x02{}\x02 just needs to']


@hook.on_start()
def load_macros(bot):
global reaction_macros
with codecs.open(os.path.join(bot.data_dir, "reaction_macros.json"), encoding="utf-8") as macros:
reaction_macros = json.load(macros)


@hook.command('dwi', 'dealwithit')
def deal_with_it(text, message):
"""<nick> - Tell <nick> in the channel to deal with it. Code located in reactions.py"""
person_needs_to_deal = text.strip()
phrase = random.choice(deal_with_it_phrases)
formated_phrase = phrase.format(person_needs_to_deal)
message('{} {}'.format(formated_phrase, random.choice(reaction_macros['deal_with_it_macros'])))


@hook.command('fp', 'facepalm')
def face_palm(text, message):
"""<nick> - Expresses your frustration with <Nick>. Code located in reactions.py"""
face_palmer = text.strip()
message('Dammit {} {}'.format(face_palmer, random.choice(reaction_macros['facepalm_macros'])))


@hook.command('hd', 'headdesk')
def head_desk(text, message):
"""<nick> - Hit your head against the desk becausae of <nick>. Code located in reactions.py"""
idiot = text.strip()
message('{} {}'.format(idiot, random.choice(reaction_macros['head_desk_macros'])))


@hook.command('fetish', 'tmf')
def my_fetish(text, message):
"""<nick> - Did some one just mention what your fetish was? Let <nick> know! Code located in reactions.py"""
person_to_share_fetish_with = text.strip()
message('{} {}'.format(person_to_share_fetish_with, random.choice(reaction_macros['fetish_macros'])))

0 comments on commit 93de966

Please sign in to comment.