Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a top-level !user command with subcommands #13

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

ryanlerch
Copy link
Collaborator

This replaces the old !user command (which displayed user info) with a new top level !user command with the following sub-commands (localtime, hello, info).

Had to implement aliases for these 3 subcommands manually, as maubot wont let you alias a command-level to a command + subcommand. So these are done with a passive command.

fedora/fas.py Outdated Show resolved Hide resolved
fedora/fas.py Outdated Show resolved Hide resolved
fedora/fas.py Show resolved Hide resolved
fedora/fas.py Outdated Show resolved Hide resolved
fedora/fas.py Outdated Show resolved Hide resolved
fedora/fas.py Outdated Show resolved Hide resolved
fedora/fas.py Outdated Show resolved Hide resolved
fedora/fas.py Outdated
"""
await self._user_localtime(evt, username)

@command.passive("^!(hi|hello|hello2|hellomynameis|fasinfo|localtime)(?:\\s+|$)(.*)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can user the r"" trick here as well.

tests/test_bot.py Show resolved Hide resolved
This replaces the old !user command (which displayed user info) with a
new top level !user command with the following sub-commands (localtime,
hello, info).

Had to implement aliases for these 3 subcommands manually, as maubot
wont let you alias a command-level to a command + subcommand. So these
are done with a passive command.

Signed-off-by: Ryan Lerch <[email protected]>
@ryanlerch ryanlerch force-pushed the top-level-user-command branch from eb5856d to 4fdc89a Compare October 12, 2023 11:15
@ryanlerch
Copy link
Collaborator Author

Okay, fixed:

  • the type checking issues on the username params
  • added the r"" string prefix on the regex

other comments i have commented back with my thoughts

@ryanlerch ryanlerch requested a review from abompard October 12, 2023 11:17
@ryanlerch ryanlerch merged commit 4665250 into fedora-infra:main Oct 12, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants