/[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 102 by rakin, Mon Jul 29 17:28:36 2024 UTC revision 106 by rakin, Mon Jul 29 17:28:37 2024 UTC
# Line 15  export async function unmute(client: Dis Line 15  export async function unmute(client: Dis
15      try {                  try {            
16          await History.create(user.id, user.guild!, 'unmute', d.id, null);          await History.create(user.id, user.guild!, 'unmute', d.id, null);
17    
18          const role = await user.guild!.roles.fetch(client.config.get('mute_role'));          const role = await user.guild!.roles.fetch(client.config.props[user.guild.id].mute_role);
19          await user.roles.remove(role!);          await user.roles.remove(role!);
20    
21          const { default: Punishment } = await import('../../models/Punishment');          const { default: Punishment } = await import('../../models/Punishment');
# Line 30  export async function unmute(client: Dis Line 30  export async function unmute(client: Dis
30                      const json = JSON.parse(timeout.row.params);                      const json = JSON.parse(timeout.row.params);
31    
32                      if (json) {                      if (json) {
33                          if (json[1] === user.id) {                          if (json[1] === user.id && timeout.row.filePath.endsWith('unmute-job')) {
34                              await clearTimeoutv2(timeout);                              await clearTimeoutv2(timeout);
35                          }                          }
36                      }                      }

Legend:
Removed from v.102  
changed lines
  Added in v.106

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26