Skip to content

Commit

Permalink
refact(moderation): Allow non-ephemeral moderation (#1785)
Browse files Browse the repository at this point in the history
* refact(moderation): Allow non-ephemeral ban msg

* refact(moderation): Allow non-ephemeral unban msg

* refact(moderation): Allow non-ephemeral kick msg

* refact(moderation): Allow non-ephemeral mute msg

* refact(moderation): Allow non-ephemeral unmute msg

* refact(moderation): Allow non-ephemeral timeout msg

* refact(moderation): Allow non-ephemeral rto msg

* refact(moderation): Allow non-ephemeral report msg

* refact(moderation): Allow non-ephemeral clean msg

* refact(moderation): Allow non-ephemeral warn msg
  • Loading branch information
Wolveric authored Dec 7, 2024
1 parent 2da06ed commit 86c5404
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions moderation/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ var ModerationCommands = []*commands.YAGCommand{
ArgumentCombos: [][]int{{0, 1, 2}, {0, 2, 1}, {0, 1}, {0, 2}, {0}},
SlashCommandEnabled: true,
DefaultEnabled: false,
IsResponseEphemeral: true,
IsResponseEphemeral: false,
RunFunc: func(parsed *dcmd.Data) (interface{}, error) {
if parsed.Context().Value(commands.CtxKeyExecutedByNestedCommandTemplate) == true {
return nil, errors.New("cannot nest exec/execAdmin calls")
Expand Down Expand Up @@ -230,7 +230,7 @@ var ModerationCommands = []*commands.YAGCommand{
RequireBotPerms: [][]int64{{discordgo.PermissionAdministrator}, {discordgo.PermissionBanMembers}},
SlashCommandEnabled: true,
DefaultEnabled: false,
IsResponseEphemeral: true,
IsResponseEphemeral: false,
RunFunc: func(parsed *dcmd.Data) (interface{}, error) {
config, _, err := MBaseCmd(parsed, 0) //No need to check member role hierarchy as banned members should not be in server
if err != nil {
Expand Down Expand Up @@ -281,7 +281,7 @@ var ModerationCommands = []*commands.YAGCommand{
},
RequireBotPerms: [][]int64{{discordgo.PermissionAdministrator}, {discordgo.PermissionKickMembers}},
SlashCommandEnabled: true,
IsResponseEphemeral: true,
IsResponseEphemeral: false,
RunFunc: func(parsed *dcmd.Data) (interface{}, error) {
if parsed.Context().Value(commands.CtxKeyExecutedByNestedCommandTemplate) == true {
return nil, errors.New("cannot nest exec/execAdmin calls")
Expand Down Expand Up @@ -345,7 +345,7 @@ var ModerationCommands = []*commands.YAGCommand{
ArgumentCombos: [][]int{{0, 1, 2}, {0, 2, 1}, {0, 1}, {0, 2}, {0}},
SlashCommandEnabled: true,
DefaultEnabled: false,
IsResponseEphemeral: true,
IsResponseEphemeral: false,
RunFunc: func(parsed *dcmd.Data) (interface{}, error) {
if parsed.Context().Value(commands.CtxKeyExecutedByNestedCommandTemplate) == true {
return nil, errors.New("cannot nest exec/execAdmin calls")
Expand Down Expand Up @@ -413,7 +413,7 @@ var ModerationCommands = []*commands.YAGCommand{
RequireBotPerms: [][]int64{{discordgo.PermissionAdministrator}, {discordgo.PermissionManageRoles}},
SlashCommandEnabled: true,
DefaultEnabled: false,
IsResponseEphemeral: true,
IsResponseEphemeral: false,
RunFunc: func(parsed *dcmd.Data) (interface{}, error) {
if parsed.Context().Value(commands.CtxKeyExecutedByNestedCommandTemplate) == true {
return nil, errors.New("cannot nest exec/execAdmin calls")
Expand Down Expand Up @@ -472,7 +472,7 @@ var ModerationCommands = []*commands.YAGCommand{
ArgumentCombos: [][]int{{0, 1, 2}, {0, 2, 1}, {0, 1}, {0, 2}, {0}},
SlashCommandEnabled: true,
DefaultEnabled: false,
IsResponseEphemeral: true,
IsResponseEphemeral: false,
RunFunc: func(parsed *dcmd.Data) (interface{}, error) {
if parsed.Context().Value(commands.CtxKeyExecutedByNestedCommandTemplate) == true {
return nil, errors.New("cannot nest exec/execAdmin calls")
Expand Down Expand Up @@ -534,7 +534,7 @@ var ModerationCommands = []*commands.YAGCommand{
RequireBotPerms: [][]int64{{discordgo.PermissionAdministrator}, {discordgo.PermissionModerateMembers}},
SlashCommandEnabled: true,
DefaultEnabled: false,
IsResponseEphemeral: true,
IsResponseEphemeral: false,
RunFunc: func(parsed *dcmd.Data) (interface{}, error) {
config, target, err := MBaseCmd(parsed, parsed.Args[0].Int64())
if err != nil {
Expand Down Expand Up @@ -583,7 +583,7 @@ var ModerationCommands = []*commands.YAGCommand{
},
SlashCommandEnabled: true,
DefaultEnabled: false,
IsResponseEphemeral: true,
IsResponseEphemeral: false,
RunFunc: func(parsed *dcmd.Data) (interface{}, error) {
config, _, err := MBaseCmd(parsed, 0)
if err != nil {
Expand Down Expand Up @@ -676,7 +676,7 @@ var ModerationCommands = []*commands.YAGCommand{
ArgumentCombos: [][]int{{0}, {0, 1}, {1, 0}},
SlashCommandEnabled: true,
DefaultEnabled: false,
IsResponseEphemeral: true,
IsResponseEphemeral: false,
RunFunc: func(parsed *dcmd.Data) (interface{}, error) {
config, _, err := MBaseCmd(parsed, 0)
if err != nil {
Expand Down Expand Up @@ -862,7 +862,7 @@ var ModerationCommands = []*commands.YAGCommand{
RequiredDiscordPermsHelp: "ManageMessages or ManageGuild",
SlashCommandEnabled: true,
DefaultEnabled: false,
IsResponseEphemeral: true,
IsResponseEphemeral: false,
RunFunc: func(parsed *dcmd.Data) (interface{}, error) {
if parsed.Context().Value(commands.CtxKeyExecutedByNestedCommandTemplate) == true {
return nil, errors.New("cannot nest exec/execAdmin calls")
Expand Down

0 comments on commit 86c5404

Please sign in to comment.