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

Refactor bot command definition style #19

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

smf8
Copy link
Member

@smf8 smf8 commented Oct 24, 2022

I created a new style to define new bot commands, which I believe is more human-readable and easier to maintain.
With this model, each command will have a file in the command and message packages representing the command definition and its message templates.

For pattern matching, each command will have to define a regular expression for it's command messages in a Match(message string) bool function. It must also have a Handle(event *gomatrix.Event) error for command handling.

This PR is not ready for merge. We need to migrate all commands to the new style if the new style is acceptable.

@smf8 smf8 requested review from anvari1313 and parsaaes October 24, 2022 06:54
internal/matrix/bot.go Outdated Show resolved Hide resolved
internal/matrix/command/shift.go Outdated Show resolved Hide resolved
internal/matrix/command/shift.go Show resolved Hide resolved
@smf8
Copy link
Member Author

smf8 commented Oct 30, 2022

I've made some new modifications regarding your comments. Could you please check again @parsaaes

@parsaaes
Copy link
Member

I've made some new modifications regarding your comments. Could you please check again @parsaaes

Thank you @smf8. I'm good with the new changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants