1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- # -*- coding: utf-8 -*-
- from __future__ import print_function
- import willie
- import random
- COFFEE_RULE = '(make[_-]me[_-](a[_-])?)?coffee'
- def setup(bot):
- """Called by willie upon loading this plugin."""
- pass
- def shutdown(bot):
- """Called by willie upon unloading this plugin."""
- pass
- @willie.module.rule(r'(?i)(hi|hallo|moin|morgen|guten morgen|re)[ \t]*$')
- def ffpb_greeting(bot, trigger):
- stats = bot.memory['ffpb_stats'] if 'ffpb_stats' in bot.memory else None
- if stats is None:
- print("ffpb_greeting: stats is None -> keine Antwort")
- return
- greeting = random.choice((
- 'Hi {0}, bist du einer der {2} Clients an unseren {1} Knoten?',
- 'Hey {0}, schön dich zu sehen. Gerade sind übrigens {1} Knoten mit {2} Clients online.',
- '{1} Knoten online, {2} Clients im Netz und {0} gibt uns die Ehre - Herzlich Willkommen :)'))
- bot.say(greeting.format(trigger.nick, stats["nodes_active"], stats["clients"]))
- @willie.module.rule(r'(?i)(alles )?fake[?!]?')
- def ffpb_nofake(bot, trigger):
- msg = random.choice((
- u'zweifelt {0}s Glaubwürdigkeit an.',
- 'glaubt nicht, dass {0} echt ist.',
- ))
- bot.action(msg.format(trigger.nick))
- @willie.module.commands('fake')
- def ffpb_fakecmd(bot, trigger):
- bot.say('Public Service Announcement: {0} ist ein Fake.'.format(trigger.nick))
- @willie.module.rule(r'(?i)!(sudo )?rm -rf (--no-preserve-root )?/')
- def ffpb_rmrf(bot, trigger):
- bot.action("liest dann mal sehr schnell " + trigger.nick + "s Mails o.O")
- @willie.module.rule(r'(?i)!' + COFFEE_RULE)
- def ffpb_kaffee(bot, trigger):
- bot.say("Kein sudo, kein Kaffee.")
- @willie.module.rule(r'(?i)!sudo ' + COFFEE_RULE)
- def ffpb_sudokaffee(bot, trigger):
- bot.action("reicht " + trigger.nick + " eine dampfende, aromatisch duftende Tasse Kaffee.")
- @willie.module.rule(r'(?i).*(teurer|besser|neuer|cooler|geiler|mehr|weniger) wie')
- def ffpb_grammarnazi_als(bot, trigger):
- bot.say("*als")
- @willie.module.rule(r'(?i).*(genauso|genau so) als')
- def ffpb_grammarnazi_wie(bot, trigger):
- bot.say("*wie")
- @willie.module.rule(r'(?i).*als wie')
- def ffpb_grammarnazi_alswie(bot, trigger):
- bot.action("denkt spontan an seine Deutschlehrerin")
- @willie.module.rule(r'(?i)gi(ve |m)me the key to your heart')
- def ffpb_botkey(bot, trigger):
- bot.reply('ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJfsG/myO4y9WzJSP+ixluHFmkIMJJRsvRT8t5h4y/5A7QzovOw1GpCmWJWnZ6GKXilTxb8ycqVfDcFPB2NRkdJUjYL+v4IMriPeBigAjc6FoUZXOS3TOZVhaTlNT4XxXKOYF/Rpgscv5f0iu1SG0Tp4mb2TX04pZjbnLNBABbjn592abEuMG5bH/g9odi50S0MoU/qCH9AZvkoc8vGu+flOBrKfFi+7g2GxF/w66mMvCJfK27QFSPOiFV3CT6ZfSZM138OCdC1SOi89X9+oCEQ3LB9A+bJgyYnxqp8eVpRPui6K9sPkax71tMimRJA5Xgdvqt9HpcgtNYxKJ4gYMR ffpb-statusbot')
|