Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import codecs
- import json
- import os
- import random
- import asyncio
- import re
- from cloudbot import hook
- from cloudbot.util import textgen
- from cloudbot.util import colors
- @hook.on_start()
- def load_responses(bot):
- path = os.path.join(bot.data_dir, "decoys.txt")
- global responses
- with codecs.open(path, encoding="utf-8") as f:
- responses = [line.strip() for line in
- f.readlines() if not line.startswith("//")]
- @asyncio.coroutine
- @hook.command("decoy")
- def decoy(chan, conn):
- """it does something"""
- meh = random.choice(responses)
- message = colors.parse("".format(meh))
- conn.message(chan, message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement