Skip to content

Commit

Permalink
cmddocsgen: note un/nick hist cmds disabled (#1765)
Browse files Browse the repository at this point in the history
Signed-off-by: SoggySaussages <[email protected]>
  • Loading branch information
SoggySaussages authored Nov 20, 2024
1 parent 9623ea3 commit ad2f8b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var (
flagLogTimestamp bool

flagSysLog bool
flagGenCmdDocs bool
FlagGenCmdDocs bool
flagGenConfigDocs bool

flagLogAppName string
Expand All @@ -59,7 +59,7 @@ func init() {
flag.BoolVar(&flagSysLog, "syslog", false, "Set to log to syslog (only linux)")
flag.StringVar(&flagLogAppName, "logappname", "yagpdb", "When using syslog, the application name will be set to this")
flag.BoolVar(&flagRunBWC, "backgroundworkers", false, "Run the various background workers, atleast one process needs this")
flag.BoolVar(&flagGenCmdDocs, "gencmddocs", false, "Generate command docs and exit")
flag.BoolVar(&FlagGenCmdDocs, "gencmddocs", false, "Generate command docs and exit")
flag.BoolVar(&flagGenConfigDocs, "genconfigdocs", false, "Generate config docs and exit")

flag.BoolVar(&flagLogTimestamp, "ts", false, "Set to include timestamps in log")
Expand Down Expand Up @@ -135,7 +135,7 @@ func Run() {

commands.InitCommands()

if flagGenCmdDocs {
if FlagGenCmdDocs {
GenCommandsDocs()
return
}
Expand Down
7 changes: 7 additions & 0 deletions logs/plugin_bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"emperror.dev/errors"
"github.com/botlabs-gg/yagpdb/v2/bot/paginatedmessages"
"github.com/botlabs-gg/yagpdb/v2/common/config"
"github.com/botlabs-gg/yagpdb/v2/common/run"

"github.com/botlabs-gg/yagpdb/v2/bot"
"github.com/botlabs-gg/yagpdb/v2/bot/eventsystem"
Expand All @@ -30,6 +31,12 @@ func (p *Plugin) AddCommands() {
commands.AddRootCommands(p, cmdLogs, cmdWhois, cmdNicknames, cmdUsernames, cmdClearNames)
} else {
commands.AddRootCommands(p, cmdLogs, cmdWhois)
if run.FlagGenCmdDocs {
for _, cmd := range []*commands.YAGCommand{cmdNicknames, cmdUsernames, cmdClearNames} {
cmd.Description = fmt.Sprint(cmd.Description, " Disabled on the public instance.")
commands.AddRootCommands(p, cmd)
}
}
}
}

Expand Down

0 comments on commit ad2f8b8

Please sign in to comment.