(guild)
| 63 | } |
| 64 | |
| 65 | async createRole(guild) { |
| 66 | const mutedRole = await guild.roles.create({ data: { name: 'Muted' }, reason: `${this.client.user.username} initialization: Muted role` }); |
| 67 | await guild.settings.update('roles.muted', mutedRole, guild); |
| 68 | |
| 69 | await guild.channels.forEach(async (channel) => { |
| 70 | if (channel.type === 'text') { |
| 71 | await channel.updateOverwrite(mutedRole, { |
| 72 | CREATE_INSTANT_INVITE: false, |
| 73 | ADD_REACTIONS: false, |
| 74 | SEND_MESSAGES: false, |
| 75 | SEND_TTS_MESSAGES: false, |
| 76 | EMBED_LINKS: false, |
| 77 | ATTACH_FILES: false, |
| 78 | USE_EXTERNAL_EMOJIS: false |
| 79 | }, |
| 80 | `${this.client.user.username} initialization: Adjusting channel permissions for muted role`); |
| 81 | } |
| 82 | |
| 83 | if (channel.type === 'voice') { |
| 84 | await channel.updateOverwrite(mutedRole, { SPEAK: false }, `${this.client.user.username} initialization: Adjusting channel permissions for muted role`); |
| 85 | } |
| 86 | }); |
| 87 | |
| 88 | return; |
| 89 | } |
| 90 | |
| 91 | }; |
no test coverage detected