mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-16 16:15:59 +00:00
feat(commands): improve discovery and normalize parameters
This commit is contained in:
1 parent
3316eec74c
commit
f5ba9d4032
31 files changed
+479
-56
No files matched your search
@@ -128,10 +128,18 @@ func senderMention(u *models.User) string {
|
||||
}
|
||||
|
||||
func disclaimerCommand(name, description, defaultTarget string, allowCustomTarget bool) modules.Command {
|
||||
parameters := ""
|
||||
example := ""
|
||||
if allowCustomTarget {
|
||||
parameters = "[target...]"
|
||||
example = "/" + name + " FBI"
|
||||
}
|
||||
return modules.Command{
|
||||
Name: name,
|
||||
Visibility: modules.VisibilityPublic,
|
||||
Description: description,
|
||||
Parameters: parameters,
|
||||
Example: example,
|
||||
Handler: func(ctx context.Context, b *bot.Bot, update *models.Update) error {
|
||||
if update.Message == nil {
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user