UNPKG

la-cosa-nostra

Version:

A Mafia bot designed to run in Discord - beware the traitors and the lies!

30 lines (17 loc) 603 B
module.exports = async function (game) { if (game.channels.mafia !== undefined) { var channel = game.getChannel("mafia"); var read_perms = game.config["base-perms"]["read"]; var mafia = game.findAll(x => x.see_mafia_chat === true); for (var i = 0; i < mafia.length; i++) { if (!mafia[i].getSpecialChannels().some(x => x.id === channel.id)) { mafia[i].addSpecialChannel(channel); }; var member = mafia[i].getGuildMember(); if (!member) { continue; }; await channel.overwritePermissions(member, read_perms); }; }; };