mirror of
https://github.com/evennia/evennia.git
synced 2026-04-04 15:07:16 +02:00
Fix look of default command.py example in search beginner tutorial. Resolve #3555
This commit is contained in:
parent
d6de25f4ca
commit
a49b61a509
2 changed files with 7 additions and 5 deletions
|
|
@ -23,12 +23,15 @@ On the `DefaultObject` is a `.search` method which we have already tried out whe
|
|||
- It will always return exactly one match. If it found zero or more than one match, the return is `None`. This is different from `evennia.search` (see below), which always returns a list.
|
||||
- On a no-match or multimatch, `.search` will automatically send an error message to `obj`. So you don't have to worry about reporting messages if the result is `None`.
|
||||
|
||||
In other words, this method handles error messaging for you. A very common way to use it is in commands:
|
||||
In other words, this method handles error messaging for you. A very common way to use it is in commands. You can put your command anywhere, but let's try the pre-filled-in `mygame/commands/command.py`.
|
||||
|
||||
```python
|
||||
# in for example mygame/commands/command.py
|
||||
|
||||
from evennia import Command
|
||||
from evennia import Command as BaseCommand
|
||||
|
||||
class Command(BaseCommand):
|
||||
# ...
|
||||
|
||||
class CmdQuickFind(Command):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue