/[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 235 by rakin, Mon Jul 29 17:29:08 2024 UTC revision 335 by rakin, Mon Jul 29 17:29:36 2024 UTC
# Line 31  export async function unmute(client: Dis Line 31  export async function unmute(client: Dis
31          const { default: MuteRecord } = await import("../../models/MuteRecord");          const { default: MuteRecord } = await import("../../models/MuteRecord");
32    
33          const hardmute = await Hardmute.findOne({          const hardmute = await Hardmute.findOne({
34              where: {              user_id: user.id,
35                  user_id: user.id,              guild_id: user.guild.id
                 guild_id: user.guild.id,  
             },  
             order: [  
                 ['id', 'DESC']  
             ]  
36          });          });
37    
38          if (hardmute) {          if (hardmute) {
39              for await (const roleID of hardmute.get().roles) {              for await (const roleID of hardmute.roles) {
40                  try {                  try {
41                      const role = await user.guild.roles.fetch(roleID);                      const role = await user.guild.roles.fetch(roleID);
42    
# Line 54  export async function unmute(client: Dis Line 49  export async function unmute(client: Dis
49                  }                  }
50              }              }
51    
52              await hardmute.destroy();              await hardmute.delete();
53          }          }
54    
55          const timeouts = getTimeouts();          const timeouts = getTimeouts();
# Line 85  export async function unmute(client: Dis Line 80  export async function unmute(client: Dis
80          });          });
81    
82          const muteRecord = await MuteRecord.findOne({          const muteRecord = await MuteRecord.findOne({
83              where: {              user_id: user.user.id,
84                  user_id: user.user.id,              guild_id: user.guild.id
                 guild_id: user.guild.id  
             }  
85          });          });
86    
87          if (muteRecord) {          if (muteRecord) {
88              await muteRecord.destroy();              await muteRecord.delete();
89          }          }
90    
91          try {          try {

Legend:
Removed from v.235  
changed lines
  Added in v.335

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26