mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
gendersub msg method removed positional argument
`text` in the msg method of GenderSub is a positional argument causing it to not function as expected in regard to projects documentation on the DefaultObject.msg method. This changes text to being an optional kwarg.
This commit is contained in:
parent
e7efffd629
commit
e85ff125fb
1 changed files with 5 additions and 1 deletions
|
|
@ -120,7 +120,7 @@ class GenderCharacter(DefaultCharacter):
|
|||
pronoun = _GENDER_PRONOUN_MAP[gender][typ.lower()]
|
||||
return pronoun.capitalize() if typ.isupper() else pronoun
|
||||
|
||||
def msg(self, text, from_obj=None, session=None, **kwargs):
|
||||
def msg(self, text=None, from_obj=None, session=None, **kwargs):
|
||||
"""
|
||||
Emits something to a session attached to the object.
|
||||
Overloads the default msg() implementation to include
|
||||
|
|
@ -141,6 +141,10 @@ class GenderCharacter(DefaultCharacter):
|
|||
All extra kwargs will be passed on to the protocol.
|
||||
|
||||
"""
|
||||
if text is None:
|
||||
super().msg(from_obj=from_obj, session=session, **kwargs)
|
||||
return
|
||||
|
||||
try:
|
||||
if text and isinstance(text, tuple):
|
||||
text = (_RE_GENDER_PRONOUN.sub(self._get_pronoun, text[0]), *text[1:])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue