This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
CloudBot/disabled_stuff/slogan.py

19 lines
437 B
Python
Raw Normal View History

import random
2014-02-14 04:36:57 +01:00
from util import hook, text
2012-03-23 01:32:48 +01:00
with open("plugins/data/slogans.txt") as f:
slogans = [line.strip() for line in f.readlines()
if not line.startswith("//")]
2012-03-23 01:32:48 +01:00
@hook.command
def slogan(inp):
2013-09-04 12:30:04 +02:00
"""slogan <word> -- Makes a slogan for <word>."""
out = random.choice(slogans)
if inp.lower() and out.startswith("<text>"):
inp = text.capitalize_first(inp)
return out.replace('<text>', inp)