This commit is contained in:
deathbybandaid 2019-06-04 09:04:40 -04:00
parent 4dfaf106f5
commit 8457d358d1
2 changed files with 10 additions and 7 deletions

View File

@ -89,6 +89,9 @@ class SpiceBot_AI():
return aiml_response
def bot_message_precipher(self, bot, trigger, message):
puct_dict = {"!": "exclamationmark", ".": "period", "?": "questionmark", ",": "comma"}
for puctuation in puct_dict.keys():
message = message.replace(puctuation, puct_dict[puctuation])
for botitem in ["nick"]:
message = message.replace(str(eval("bot." + botitem)), "bot" + botitem)
for triggeritem in ["nick", "sender"]:

View File

@ -2,18 +2,18 @@
<aiml version="1.0">
<category>
<pattern>BOTNICK!</pattern>
<pattern>BOTNICKexclamationmark</pattern>
<template>triggernick!</template>
</category>
<category>
<pattern>BOTNICKquestionmark</pattern>
<template>That's my name, don't wear it out!</template>
</category>
<category>
<pattern>BOTNICK</pattern>
<template>
<random>
<li>That's my name, don't wear it out!</li>
<li>I'm here, triggernick</li>
</random>
</template>
<template>I'm here, triggernick</template>
</category>
</aiml>