@@ -18,36 +18,36 @@ import (
1818
1919func ReportAction (b * dbot.Bot ) handler.Component {
2020 return handler.Component {
21- Name : "action" ,
21+ Name : "report- action" ,
2222 Handler : reportActionHandler (b ),
2323 }
2424}
2525
2626func ReportConfirm (b * dbot.Bot ) handler.Component {
2727 return handler.Component {
28- Name : "confirm" ,
28+ Name : "report- confirm" ,
2929 Handler : reportConfirmHandler (b ),
3030 }
3131}
3232
3333func ReportDelete (b * dbot.Bot ) handler.Component {
3434 return handler.Component {
35- Name : "delete" ,
35+ Name : "report- delete" ,
3636 Handler : reportDeleteHandler (b ),
3737 }
3838}
3939
4040func ReportActionConfirm (b * dbot.Bot ) handler.Modal {
4141 return handler.Modal {
42- Name : "action-confirm" ,
42+ Name : "report- action-confirm" ,
4343 Handler : reportActionConfirmHandler (b ),
4444 }
4545}
4646
4747func reportConfirmHandler (b * dbot.Bot ) handler.ComponentHandler {
4848 return func (e * events.ComponentInteractionCreate ) error {
4949 args := strings .Split (e .Data .CustomID (), ":" )
50- reportID , err := parseReportID (args [0 ])
50+ reportID , err := parseReportID (args [2 ])
5151 if err != nil {
5252 return err
5353 }
@@ -131,7 +131,7 @@ func reportConfirmHandler(b *dbot.Bot) handler.ComponentHandler {
131131 Components : & []discord.ContainerComponent {
132132 discord.ActionRowComponent {
133133 discord.SelectMenuComponent {
134- CustomID : fmt .Sprintf ("cmd :report: action:%d" , reportID ),
134+ CustomID : fmt .Sprintf ("handler :report- action:%d" , reportID ),
135135 Placeholder : "Select an action" ,
136136 MinValues : json .NewPtr (1 ),
137137 MaxValues : 1 ,
@@ -146,7 +146,7 @@ func reportConfirmHandler(b *dbot.Bot) handler.ComponentHandler {
146146func reportDeleteHandler (b * dbot.Bot ) handler.ComponentHandler {
147147 return func (e * events.ComponentInteractionCreate ) error {
148148 args := strings .Split (e .Data .CustomID (), ":" )
149- reportID , err := parseReportID (args [0 ])
149+ reportID , err := parseReportID (args [2 ])
150150 if err != nil {
151151 return err
152152 }
@@ -181,7 +181,7 @@ func reportActionHandler(b *dbot.Bot) handler.ComponentHandler {
181181 return func (e * events.ComponentInteractionCreate ) error {
182182
183183 args := strings .Split (e .Data .CustomID (), ":" )
184- reportID , err := parseReportID (args [0 ])
184+ reportID , err := parseReportID (args [2 ])
185185 if err != nil {
186186 return err
187187 }
@@ -252,7 +252,7 @@ func reportActionHandler(b *dbot.Bot) handler.ComponentHandler {
252252
253253 case "timeout" :
254254 return e .CreateModal (discord.ModalCreate {
255- CustomID : fmt .Sprintf ("cmd :report: action-confirm:timeout:%s" , report .UserID ),
255+ CustomID : fmt .Sprintf ("handler :report- action-confirm:timeout:%s" , report .UserID ),
256256 Title : "Timeout User" ,
257257 Components : []discord.ContainerComponent {
258258 discord.ActionRowComponent {
@@ -281,7 +281,7 @@ func reportActionHandler(b *dbot.Bot) handler.ComponentHandler {
281281
282282 case "kick" :
283283 return e .CreateModal (discord.ModalCreate {
284- CustomID : fmt .Sprintf ("cmd :report: action-confirm:kick:%s" , report .UserID ),
284+ CustomID : fmt .Sprintf ("handler :report- action-confirm:kick:%s" , report .UserID ),
285285 Title : "Kick User" ,
286286 Components : []discord.ContainerComponent {
287287 discord.ActionRowComponent {
@@ -299,7 +299,7 @@ func reportActionHandler(b *dbot.Bot) handler.ComponentHandler {
299299
300300 case "ban" :
301301 return e .CreateModal (discord.ModalCreate {
302- CustomID : fmt .Sprintf ("cmd :report: action-confirm:ban:%s" , report .UserID ),
302+ CustomID : fmt .Sprintf ("handler :report- action-confirm:ban:%s" , report .UserID ),
303303 Title : "Ban User" ,
304304 Components : []discord.ContainerComponent {
305305 discord.ActionRowComponent {
@@ -341,11 +341,11 @@ func reportActionHandler(b *dbot.Bot) handler.ComponentHandler {
341341func reportActionConfirmHandler (b * dbot.Bot ) handler.ModalHandler {
342342 return func (e * events.ModalSubmitInteractionCreate ) error {
343343 args := strings .Split (e .Data .CustomID , ":" )
344- userID := snowflake .MustParse (args [1 ])
344+ userID := snowflake .MustParse (args [3 ])
345345 reason := e .Data .Text ("reason" )
346346
347347 var content string
348- switch args [0 ] {
348+ switch args [2 ] {
349349 case "timeout" :
350350 until := time .Now ()
351351 duration , err := time .ParseDuration (e .Data .Text ("duration" ))
0 commit comments