izy521 / discord.io

A small, single-file library for creating DiscordApp clients from Node.js or the browser
https://discord.gg/0MvHMfHcTKVVmIGP
MIT License
535 stars 155 forks source link

Cannot run any of my bots #238

Open squalx opened 6 years ago

squalx commented 6 years ago

I've had some bots I've built and some have been running for two years. Today they suddenly stopped working. When I try and run the bots from the terminal nothing happens. I went to check the tokens on the bots on Discord and they all changed. So I tried with the new tokens. Installed the latest Discord.io too, same result.

I don't even see an error. When I do node botName.js It looks like something is running, and then I get the prompt again. Like it fails to connect to Discord, but I get no error message.

I even tried your example code to see if that would work. I've tried multiple tokens from two different accounts. And I've tested on my computer and a remote Ubuntu server where I run my bots. Same result everywhere.

Any ideas?

This code fails to run too. Fails silently that is:

var Discord = require('discord.io');

var bot = new Discord.Client({
    token: "TOKEN_HERE",
    autorun: true
});

bot.on('ready', function() {
    console.log('Logged in as %s - %s\n', bot.username, bot.id);
});

Thanks

CheweyZ commented 6 years ago

V5 Gateway is now depreciated You can use npm install woor/discord.io#gateway_v6 to fix your bots

squalx commented 6 years ago

Thanks! That did it.

KuJoe commented 6 years ago

Did they silently depreciate V5? I've been looking all over for change logs or some notice but this is the first I'm hearing of it. Thank god I found this Issue on accident because this was driving me nuts.

The output I was getting was "Bot disconnected from Discord with code 4012 for reason: undefined" but Google has no info of a return code 4012 and "undefined" means nothing so Discord really dropped the ball there also.

CheweyZ commented 6 years ago

V5 was announced as being depreciated a while ago its only recently they have actually turned off the gateway for it

StevenDStanton commented 6 years ago

Do we have any ETA on this being in the main branch? While I can do npm install discord.io

when I try npm install woor/discord.io#gateway_v6

I get the following error log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   'woor/discord.io#gateway_v6' ]
2 info using npm@5.5.1
3 info using node@v8.9.3
4 verbose npm-session d72da826dadc34a8
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData error for github:woor/discord.io#gateway_v6 Command failed: /usr/bin/git clone --depth=1 -q -b gateway_v6 git://github.com/woor/discord.io.git /home/sds/.npm/_cacache/tmp/git-clone-979101e4
7 silly fetchPackageMetaData /home/sds/.npm/_cacache/tmp/git-clone-979101e4/.git: Permission denied
8 verbose stack Error: Command failed: /usr/bin/git clone --depth=1 -q -b gateway_v6 git://github.com/woor/discord.io.git /home/sds/.npm/_cacache/tmp/git-clone-979101e4
8 verbose stack /home/sds/.npm/_cacache/tmp/git-clone-979101e4/.git: Permission denied
8 verbose stack
8 verbose stack     at ChildProcess.exithandler (child_process.js:275:12)
8 verbose stack     at emitTwo (events.js:126:13)
8 verbose stack     at ChildProcess.emit (events.js:214:7)
8 verbose stack     at maybeClose (internal/child_process.js:925:16)
8 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
9 verbose cwd /var/www/http
10 verbose Linux 4.4.0-103-generic
11 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "woor/discord.io#gateway_v6"
12 verbose node v8.9.3
13 verbose npm  v5.5.1
14 error code 1
15 error Command failed: /usr/bin/git clone --depth=1 -q -b gateway_v6 git://github.com/woor/discord.io.git /home/sds/.npm/_cacache/tmp/git-clone-979101e4
15 error /home/sds/.npm/_cacache/tmp/git-clone-979101e4/.git: Permission denied
16 verbose exit [ 1, true ]
krazyito65 commented 6 years ago

Was this ever fixed in the main dependency?

CheweyZ commented 6 years ago

The above issue is about git not being installed however no the main branch still doesn't support gateway v6 so for now it's still the woor branch

trevorglick commented 6 years ago

Thank you for this workaround!