minerbot-phoenix/plugins/backronym.py

15 lines
414 B
Python
Raw Normal View History

2018-12-15 06:12:07 +00:00
import words, plugin, random
from titlecase import titlecase
words.loadDict("words")
@plugin.command("backronym","<word>")
def backronym(bot,channel,nick,word):
result = []
for char in word:
result.append(random.choice(words.getWords("^{}.*".format(char))))
bot.say(channel,nick+": "+titlecase(" ".join(result)))
@plugin.command("kwam","")
def kwam(bot,channel,nick,*a):
backronym(bot,channel,nick,"kwam")