feat(command): Add contact command (#293)

* feat(command): Add contact command

The contact command allows the user to ask the bot to provide its
public key as a clickable contact. This allows the user to then DM the
bot outside of a channel.

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>

* fix(contact): harden matching and self_info handling, add tests and docs

Review follow-ups on the contact command:

- Match through _cleaned_content_matches so a non-matching message keeps its
  original content. The raw cleanup_message_for_matching call rewrote
  message.content in place during the keyword scan, which is the #267
  regression every other command already avoids.
- Match against self.keywords so a configured alias works.
- Read self_info defensively (dict or object, may be absent) and validate the
  public key instead of sending a literal "<None:1:None>" over the air.
- Drop the hardcoded '!' prefix strip in execute; matching already normalizes
  the content, and prefixes are configurable.
- Forward skip_channel_check to the base can_execute.
- Remove copy-paste docstring leftovers from the roll command.
- Move [Contact_Command] into the alphabetical run in config.ini.example and
  fix the "chanels" typo.
- Add tests, a docs/command-reference.md entry, and flesh out the changelog.

---------

Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Co-authored-by: agessaman <adam@gessaman.com>
This commit is contained in:
Gerard Hickey
2026-09-19 20:19:38 -07:00
committed by GitHub
co-authored by agessaman
parent 38b259156e
commit f9b1cbddb8
6 changed files with 282 additions and 39 deletions
+13
View File
@@ -97,6 +97,19 @@ cmd
---
### `contact`
Share the bot's own contact card so you can add it and send DMs without waiting for an advert.
**Usage:**
```
contact
```
**Response:** A clickable contact card containing the bot's public key and device name.
---
### `version`
Show the bot's current software version.