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/plugins/slogan.py
2012-08-23 14:56:00 +12:00

18 lines
432 B
Python
Executable file

from util import hook, text
import random
with open("plugins/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)