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/plugins/slogan.py
2013-10-03 22:28:06 +13:00

17 lines
430 B
Python
Executable file

from util import hook, text
import random
with open("./data/slogans.txt") as f:
slogans = [line.strip() for line in f.readlines()
if not line.startswith("//")]
@hook.command
def slogan(inp):
"""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)