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

cmddocsgen: note un/nick hist cmds disabled #1765

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.")
Copy link
Contributor

@l-zeuch l-zeuch Nov 15, 2024

Choose a reason for hiding this comment

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

Perhaps "disabled on this instance" instead? Though I'm not sure if the average self-hoster bothers to host their own docs, let alone generate command docs, so maybe not, plus it is questionable whether it makes sense for users reading our documentation what we even mean by "this instance".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's my thought as well, if you're using gencmddocs you can always mod the source code.

commands.AddRootCommands(p, cmd)
}
}
}
}

Expand Down