Coder Social home page Coder Social logo

eris's People

Contributors

abalabahaha avatar ak-s avatar alex-taxiera avatar apacheli avatar aurieh avatar brayzure avatar briantanner avatar bsian03 avatar cryptiklemur avatar donovandmc avatar eritbh avatar evanwashere avatar fuechschen avatar hsiw avatar iifdct avatar jagrosh avatar justcat80 avatar khaaz avatar ljneon avatar macdja38 avatar merghq avatar motoenduroboy avatar oathompsonjones avatar ratismal avatar reboxer avatar retrixe avatar skillz4killz avatar snazzah avatar tttie avatar zerefdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eris's Issues

bot.joinVoiceChannel doesn't work in dev

bot.joinVoiceChannel(config.voicechannel_id).catch((error) => { bot.editMessage(config.textchannel_id, sentMessage.id, ":warning: |ERROR| Error joining voice channel, check console!"); console.log("VOICE CHANNEL JOINING ERROR: " + error.message); return; }).then((connection) => {

Doesn't seem to join the channel, works in 0.2.0 but not in dev.

Enhancement: PermissionOverwrite should contain permissions

The PermissionOverwrite object (From GuildChannels) should not only contain a .has method, but also a permission number. Would help out a lot.

(Example: msg.channel has a method to set the permissions number for the (dis)allowed perms, but the property permissionOverwrites doesn't hold the permissions number.)

Possible issue with self bots

As of a few hours ago my selfbot stopped readying up. No change in code or anything, it just stopped.
Two other bots on the same connection and using the same library work fine. If I change the self tag and use a bot token on the code, it works. Ran an empty bot with only the ready event but nothing happend.
After a while I get this error [Error: Existing connection detected]

Possible issue with self bots?

Banning guild members crashes bot

Hi,

Whenever I ban a user on the latest dev build, my bot crashes with this error:

path\to\node_modules\eris\lib\rest\RequestHandler.js:122
                    this.ratelimits[url].latency = latency;
                                                 ^

TypeError: Cannot set property 'latency' of undefined
    at IncomingMessage.__dirname.request.req.once.resp.once.err (path\to\node_modules\eris\lib\rest\RequestHandler.js:122:50)
    at IncomingMessage.g (events.js:286:16)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:973:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Any fix would be greatly appreciated.

opusscript is required

Per the package.json opusscript is optional however when using eris 0.3.0 you get the error below:

1:14:47 PM web.1 |  module.js:442
1:14:47 PM web.1 |      throw err;
1:14:47 PM web.1 |      ^
1:14:47 PM web.1 |  Error: Cannot find module 'opusscript'
1:14:47 PM web.1 |      at Function.Module._resolveFilename (module.js:440:15)
1:14:47 PM web.1 |      at Function.Module._load (module.js:388:25)
1:14:47 PM web.1 |      at Module.require (module.js:468:17)
1:14:47 PM web.1 |      at require (internal/module.js:20:19)
1:14:47 PM web.1 |      at Object.<anonymous> (/Users/nandub/development/source/discord-webhook/node_modules/eris/lib/voice/VoiceConnection.js:10:20)
1:14:47 PM web.1 |      at Module._compile (module.js:541:32)
1:14:47 PM web.1 |      at Object.Module._extensions..js (module.js:550:10)
1:14:47 PM web.1 |      at Module.load (module.js:458:32)
1:14:47 PM web.1 |      at tryModuleLoad (module.js:417:12)
1:14:47 PM web.1 |      at Function.Module._load (module.js:409:3)
1:14:47 PM web.1 |  module.js:442
1:14:47 PM web.1 |      throw err;

Remove `xkcdpass` support (Deprecated)

XKCD-style invite codes are no longer support in Discord - the option is ignored in the API and it returns the new short-style invite codes.

createInvite() option options.xkcdpass should be removed.

[Voice] YTDL Issues

dev branch of Eris.

Steps to replicate?

  1. Stream a random YTDL song
  2. Stream 2nd YTDL song
  3. ???
  4. Proffit, you get 3 min delayed song, isn't it amazing!?
  5. Possible that the song will be delayed even more next time.

Case-Insensitive Commands

Would be nice to see support for case-insensitive commands such as !command, !Command, !COMMAND, etc. maybe by default or via a flag under the command options param.

Restrictions by ID prevents commands from working in Private and Group Messages

Adding a restriction to a command in the generator, such as {requirements : { "userIDs": ["139412744439988224"] }} , prevents these commands from working in a group message and Private Messages. These same commands work perfectly well in a regular channel.

Here's an example command:

bot.registerCommand("prune", (msg, args) => {
  var msgCount = parseInt(args);
  bot.getMessages(msg.channel.id, 100)
  .then((messages) => {
    var filtered = messages.filter(m=> m.author.id === bot.user.id);
    filtered.length = msgCount+1;
    filtered.map((msg, i) => bot.deleteMessage(msg.channel.id, msg.id));
  });
}, {requirements : { "userIDs": ["139412744439988224"] }});

This command does not work in PM/GM but works in a channel.

Add command boolean to message

If the client is a CommandClient, message should contain a boolean called command. True if it's a registered command and false if it's not.

Emoji Support

Custom emojis have been a thing for some time. When, if ever, can we expect to see support for them in Eris? This functionality is in place in many libs, such as discord.js. I also noticed that SnazzyPines made a pull request to implement this, but it was denied. I would really appreciate this functionality as it's something that I feel would be useful.

Discord Docs: https://discordapp.com/developers/docs/resources/guild#emoji-object
discord.js: http://hydrabolt.github.io/discord.js/#!/docs/tag/master/class/Emoji
PR: #70

Guild.ownerID docs issue

ownerID String The user ID to transfer server ownership to (bot user must be owner) should be changed.

getDMChannel, channel is undefined or null

This is happening to some users, no idea how widespread the issue is.

this.client.getDMChannel(user.id)
	.then(channel => this.sendMessage(channel, text))
	.catch(err => this.logger.error(err));

VoiceConnection#playFile() crashes bot with 'TypeError: Bad argument'

Hi,

I've been trying to make a simple music bot with Eris for learning experience. The objective is to have it join a voice channel, play an existing song file, and leave. Joining and leaving the voice channel has been working, but whenever I attempt to play the song the bot crashes.

Here is the code that I'm executing:

voiceConnections[msg.channel.guild.id].playFile("file.mp3");

where voiceConnections is an object containing VoiceConnection objects mapped to guild IDs, and "file.mp3" is an existing mp3 file.

The bot then crashes with this message:

events.js:141
      throw er; // Unhandled 'error' event
      ^

TypeError: Bad argument
    at TypeError (native)
    at ChildProcess.spawn (internal/child_process.js:274:26)
    at Object.exports.spawn (child_process.js:362:9)
    at VoiceConnection.playStream (c:\Users\user\WebstormProjects\pomfbot\node_modules\eris\lib\core\VoiceConnection.js:307:36)
    at VoiceConnection.playFile (c:\Users\user\WebstormProjects\pomfbot\node_modules\eris\lib\core\VoiceConnection.js:298:14)
    at Client.<anonymous> (c:\Users\user\WebstormProjects\pomfbot\pomf.js:83:56)
    at emitOne (events.js:77:13)
    at Client.emit (events.js:169:7)
    at Shard.wsEvent (c:\Users\user\WebstormProjects\pomfbot\node_modules\eris\lib\core\Shard.js:319:33)
    at WebSocket.<anonymous> (c:\Users\user\WebstormProjects\pomfbot\node_modules\eris\lib\core\Shard.js:953:34)

I know for sure that the issue isn't finding the file, because if I tell it to play a nonexisting file it crashes with an ENOENT error.

I have all the necessary libs, such as node-gyp, node-opus, and ffmpeg. I have installed Eris without the --no-optional tag. I will be more than happy to provide any additional information.

Thank you for your time,
Ratismal

commandOption ignoreBots set to false, crashes when webhook bot sends message.

new CommandClient("token", {}, {
  ignoreBots: false
})

When the above is set and a webhook bot sends command message, the bot crashes with the following error message.

events.js:160
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'roles' of undefined
    at Command.permissionCheck (/Users/aalonso128/Desktop/azoy/node_modules/eris/lib/command/Command.js:116:65)

I'm assuming this happens because the webhook bot's msg has member: undefined

`requirements` are now being ignored

At the moment, the userIDs requiement in both defaultCommandOptions and in a registerCommand function are being ignored.

defaultCommanOptions being defined as such:

  prefix: "/",
  ignoreSelf: false,
  defaultHelpCommand: false,
  defaultCommandOptions: {requirements : { "userIDs": ["139412744439988224"] }}
});

And in a specific command:

bot.registerCommand("ping", "Pong!", { // Make a ping command
// Responds with "Pong!" when someone says "!ping"
    description: "Pong!",
    fullDescription: "This command could be used to check if the bot is up. Or entertainment when you're bored."
}, {requirements : { "userIDs": ["139412744439988224"] }});

Upon ending a stream, next stream immediately emits end event

If playStream is called immediately following the ending of another stream, the second stream's end event will be emitted immediately. I used VoiceConnection#stopPlaying to end the first event, and played the second stream upon receiving the first streams end event.

Could be related to #68.

Possible workaround is to set voiceDataTimeout to a large number or -1.

Both streams are emitting their end event at this line

From my testing (which could be borked) this line is false the first time because this.playing is false. It's false the second time because buffer is null.

Shard Status Property

Property added to shards that gives the current status of the shard, wheather its disconnected, errored, connected, ect

[Feature Request] Default Command Options

It would be nice to set default command options. For instance, setting default requirements (useful for selfbot or admin bots), or serverOnly. Something like:

bot.setDefaultOptions({
  requirements : { "userIDs": ["139412744439988224"] },
  serverOnly: true;

Command.permissionCheck() breaking because of requirements.userIDs

Permission checks will always be skipped unless requirements.userIDs is provided.

https://github.com/abalabahaha/eris/blob/master/lib/command/Command.js#L124-126

if(!this.permissionCheck(msg)) {
    return;
}

https://github.com/abalabahaha/eris/blob/master/lib/command/Command.js#L80-82

if(this.requirements.userIDs.length === 0 || ~this.requirements.userIDs.indexOf(msg.author.id)) {
    return true;
}

this.requirements.userIDs.length === 0 is true by default, triggering the return true, meaning that !this.permissionCheck(msg) is false, causing the permission check to be skipped and the command is executed without ever even checking the other requirements... oops.

editedTimestamp is null on messageUpdate

When a message is updated, the editedTimestamp is undefined (as in the parent). This is because of line ~117 in /lib/core/Message.js:

this.editedTimestamp = !data.edited_timestamp ? Date.parse(data.edited_timestamp) : this.editedTimestamp;

If the edited_timestamp is undefined, it will be parsed. This timestamp is always undefined if the message is created, and an integer if the message was edited, so on edit, the code will take the original undefined value again.

Removing the ! negation gives a correct editedTimestamp.

[Feature Request] Modify volume of VoiceConnection

Hi,

I've been using this library's voice capabilities, and was wondering if it would be possible to modify the volume of a VoiceConnection? As VoiceConnection#playRaw() already iterates through the stream, I believe it would be possible to modify the buffer there by a volume variable before emitting it to discord. This would save users from having to implement methods to modify their streams beforehand. I hope you consider adding this. Thank you for your time.

Sincerely,
ratismal (stupid cat)

Random disconnect when switching regions

While the bot is in the channel, if the region is switched, it reconnects and restarts playback fine. Around 30 seconds later, the voice connection spontaneously disconnects.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.