How to use the eris.Permission function in eris

To help you get started, we’ve selected a few eris examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aetheryx / spotify-connect / src / events / onMessageCreate.js View on Github external
if (!msg.content.startsWith(prefix)) {
    return;
  }

  const [ commandName, ...args ] = msg.content.slice(prefix.length).split(/ +/g);
  const command = this.commands.get(this.commandTriggers.get(commandName));
  if (
    !command || (
      command.props.ownerOnly && msg.author.id !== process.env.BOT_OWNER_ID
    )) {
    return;
  }

  const permissions = msg.channel.guild
    ? msg.channel.permissionsOf(this.user.id)
    : new Permission(383040); // DM channels

  if (!permissions.has('sendMessages')) {
    return;
  }

  command
    ._execute(msg, args)
    .catch(err => {
      console.error(err);

      return {
        title: '⚠ Something went wrong while executing this command.',
        color: 0xFF0000,
        description: codeblock(
          err.message + (
            err.body && err.body.error
github macdja38 / pvpcraft / modules / moderationV2.js View on Github external
function permissionsListFromNumber(permissions) {
  return arrayOfTrues(new Eris.Permission(permissions).json).toString();
}
github SideProjectGuys / invite-manager-bot / src / util.ts View on Github external
public permissionsOf(memberID: string): Permission {
		return new Permission(0b1111111111111111111111111111111, 0);
	}
}