/[sudobot]/trunk/src/commands/moderation/UnmuteCommand.ts
ViewVC logotype

Diff of /trunk/src/commands/moderation/UnmuteCommand.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 427 by rakin, Mon Jul 29 17:30:02 2024 UTC revision 428 by rakin, Mon Jul 29 17:30:11 2024 UTC
# Line 26  import MessageEmbed from '../../client/M Line 26  import MessageEmbed from '../../client/M
26  import getMember from '../../utils/getMember';  import getMember from '../../utils/getMember';
27    
28  import PunishmentType from '../../types/PunishmentType';  import PunishmentType from '../../types/PunishmentType';
29    import UnmuteQueue from '../../queues/UnmuteQueue';
30    
31  export async function unmute(client: DiscordClient, user: GuildMember, d: User) {  export async function unmute(client: DiscordClient, user: GuildMember, d: User) {
32      try {                  try {            
# Line 67  export async function unmute(client: Dis Line 68  export async function unmute(client: Dis
68              await hardmute.delete();              await hardmute.delete();
69          }          }
70    
71          const timeouts = getTimeouts();          // const timeouts = getTimeouts();
72                    
73          for (const timeout of timeouts.values()) {          // for (const timeout of timeouts.values()) {
74              if (timeout.row.params) {          //     if (timeout.row.params) {
75                  try {          //         try {
76                      const json = JSON.parse(timeout.row.params);          //             const json = JSON.parse(timeout.row.params);
77    
78                      if (json) {          //             if (json) {
79                          if (json[1] === user.id && timeout.row.filePath.endsWith('unmute-job')) {          //                 if (json[1] === user.id && timeout.row.filePath.endsWith('unmute-job')) {
80                              await clearTimeoutv2(timeout);          //                     await clearTimeoutv2(timeout);
81                          }          //                 }
82                      }          //             }
83                  }          //         }
84                  catch (e) {          //         catch (e) {
85                      console.log(e);                              //             console.log(e);                    
86                  }          //         }
87            //     }
88            // }
89    
90            for await (const queue of client.queueManager.queues.values()) {
91                if (queue instanceof UnmuteQueue && queue.data!.memberID === user.id && queue.data!.guildID === user.guild!.id) {
92                    await queue.cancel();
93              }              }
94          }          }
95    

Legend:
Removed from v.427  
changed lines
  Added in v.428

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26