mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
configurable gender
This commit is contained in:
parent
80eb810238
commit
4380aeb6cf
@ -5,7 +5,7 @@ This is the SpiceBot AI system. Based On Chatty cathy
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from sopel.tools import Identifier
|
from sopel.tools import Identifier
|
||||||
from sopel.config.types import StaticSection, ListAttribute
|
from sopel.config.types import StaticSection, ListAttribute, ValidatedAttribute
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
@ -17,6 +17,7 @@ from .Config import config as botconfig
|
|||||||
|
|
||||||
class SpiceBot_AI_MainSection(StaticSection):
|
class SpiceBot_AI_MainSection(StaticSection):
|
||||||
extra = ListAttribute('extra')
|
extra = ListAttribute('extra')
|
||||||
|
gender = ValidatedAttribute('gender', default='female')
|
||||||
|
|
||||||
|
|
||||||
class SpiceBot_AI():
|
class SpiceBot_AI():
|
||||||
@ -61,6 +62,7 @@ class SpiceBot_AI():
|
|||||||
|
|
||||||
def load_bot_values(self, bot):
|
def load_bot_values(self, bot):
|
||||||
self.aiml_kernel.setBotPredicate("nick", bot.nick)
|
self.aiml_kernel.setBotPredicate("nick", bot.nick)
|
||||||
|
self.aiml_kernel.setBotPredicate("gender", bot.config.SpiceBot_AI.gender)
|
||||||
|
|
||||||
def load_extras(self, bot):
|
def load_extras(self, bot):
|
||||||
if len(bot.config.SpiceBot_AI.extra):
|
if len(bot.config.SpiceBot_AI.extra):
|
||||||
|
|||||||
@ -35,3 +35,4 @@ def configure(config):
|
|||||||
|
|
||||||
config.define_section("SpiceBot_AI", SpiceBot_AI_MainSection, validate=False)
|
config.define_section("SpiceBot_AI", SpiceBot_AI_MainSection, validate=False)
|
||||||
config.SpiceBot_AI.configure_setting('extra', 'extra aiml directories to import matches from')
|
config.SpiceBot_AI.configure_setting('extra', 'extra aiml directories to import matches from')
|
||||||
|
config.SpiceBot_AI.configure_setting('gender', 'bot gender')
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<category>
|
<category>
|
||||||
<pattern>BOTNICK WHAT IS YOUR GENDER</pattern>
|
<pattern>BOTNICK WHAT IS YOUR GENDER</pattern>
|
||||||
<template>If societal genders are binary, my gender is female</template>
|
<template>If societal genders are binary, my gender is <bot name="gender"/></template>
|
||||||
</category>
|
</category>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user