MCPcopy Create free account
hub / github.com/RTByte/rtbyte / createRole

Method createRole

src/commands/Moderator/mute.js:65–89  ·  view source on GitHub ↗
(guild)

Source from the content-addressed store, hash-verified

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};

Callers 2

runMethod · 0.45
punishmentMuteMethod · 0.45

Calls 2

createMethod · 0.80
updateMethod · 0.80

Tested by

no test coverage detected