Skip to content

Commit

Permalink
Fixed issues with long ccs failing in CC command
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishjh-bst committed Aug 12, 2024
1 parent 0f17419 commit 8e3d422
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions customcommands/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (diag triggeredCmdDiagnosis) WriteTo(out *strings.Builder) {
var cmdDiagnoseCCTriggers = &commands.YAGCommand{
CmdCategory: commands.CategoryDebug,
Name: "DiagnoseCCTriggers",
Aliases: []string{"diagnosetriggers", "debugtriggers"},
Aliases: []string{"debugcctriggers", "diagnosetriggers", "debugtriggers", "dcct"},
Description: "List all custom commands that would trigger on the input and identify potential issues",
Arguments: []*dcmd.ArgDef{
{Name: "input", Type: dcmd.String},
Expand Down Expand Up @@ -293,7 +293,11 @@ var cmdDiagnoseCCTriggers = &commands.YAGCommand{
diagnosis.WriteTo(&out)
out.WriteByte('\n')
}
return out.String(), nil
msg := &discordgo.MessageSend{
Flags: discordgo.MessageFlagsSuppressEmbeds,
Content: out.String(),
}
return msg, nil
},
}

Expand Down Expand Up @@ -359,7 +363,7 @@ var cmdListCommands = &commands.YAGCommand{
msg := &discordgo.MessageSend{Flags: discordgo.MessageFlagsSuppressEmbeds}

responses := fmt.Sprintf("```\n%s\n```", strings.Join(cc.Responses, "```\n```"))
if data.Switches["file"].Value != nil || len(responses) >= 2000 && data.Switches["raw"].Value == nil {
if data.Switches["file"].Value != nil || len(responses) > 1500 && data.Switches["raw"].Value == nil {
var buf bytes.Buffer
buf.WriteString(strings.Join(cc.Responses, "\nAdditional response:\n"))

Expand Down

0 comments on commit 8e3d422

Please sign in to comment.