How to use the eris.VoiceChannel 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 Yahweasel / craig / craig / eris-flavor.js View on Github external
});
})(Eris.Shard.prototype);

Eris.TextChannel.prototype.send = Eris.TextChannel.prototype.createMessage;

odf(Eris.User.prototype, "send", function () {
    const args = arguments;
    const user = this;
    return new Promise((res, rej) => {
        user.getDMChannel().then((channel) => {
            channel.createMessage.apply(channel, args).then(res).catch(rej);
        }).catch(rej);
    });
});

odg(Eris.VoiceChannel.prototype, "joinable", function(){return this.permissionsOf(this.guild.shard.client.user.id).has("voiceConnect");});
odg(Eris.VoiceChannel.prototype, "members", function(){return this.voiceMembers;});

odg(Eris.VoiceConnection.prototype, "channel", function () {
    var ret = this.flavorSavedChannel;
    if (!ret)
        ret = this.flavorSavedChannel = this.shard.client.guilds.get(this.id).channels.get(this.channelID);
    return ret;
});
github Yahweasel / craig / craig / eris-flavor.js View on Github external
})(Eris.Shard.prototype);

Eris.TextChannel.prototype.send = Eris.TextChannel.prototype.createMessage;

odf(Eris.User.prototype, "send", function () {
    const args = arguments;
    const user = this;
    return new Promise((res, rej) => {
        user.getDMChannel().then((channel) => {
            channel.createMessage.apply(channel, args).then(res).catch(rej);
        }).catch(rej);
    });
});

odg(Eris.VoiceChannel.prototype, "joinable", function(){return this.permissionsOf(this.guild.shard.client.user.id).has("voiceConnect");});
odg(Eris.VoiceChannel.prototype, "members", function(){return this.voiceMembers;});

odg(Eris.VoiceConnection.prototype, "channel", function () {
    var ret = this.flavorSavedChannel;
    if (!ret)
        ret = this.flavorSavedChannel = this.shard.client.guilds.get(this.id).channels.get(this.channelID);
    return ret;
});