This repository has been archived on 2023-04-13. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
CloudBot/disabled_stuff/slogan.py

19 lines
437 B
Python
Raw Normal View History

import random
2014-02-14 16:36:57 +13:00
from util import hook, text
2012-03-23 13:32:48 +13:00
with open("plugins/data/slogans.txt") as f:
slogans = [line.strip() for line in f.readlines()
if not line.startswith("//")]
2012-03-23 13:32:48 +13:00
@hook.command
def slogan(inp):
2013-09-04 18:30:04 +08: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)