discord.io Release 2.5.3

A small, single-file, fully featured Discordapp library for Node.js and browsers.

Required
:

  • Node.js 0.10.x
    or greater
  • Web Browser
    if not using Node.js

Optional
:

  • Audio
    • Node.js 0.12.x
    • ffmpeg/avconv
      (needs to be added to PATH)

Documentation / Gitbooks

Stable
npm install discord.io

Latest
npm install izy521/discord.io

var
 Discord =
require
('
discord.io'

);  var
 bot =
new
Discord.Client
({     token:
"
"

,     autorun:
true
 });  bot
.on
('
ready'

, function
() {     console
.log
('
Logged in as %s - %sn
'

, bot
.username
, bot
.id
); });  bot
.on
('
message'

, function
(user
, userID
, channelID
, message
, event
) {     if
 (message ===
"
ping"

) {         bot
.sendMessage
({             to:
 channelID,             message:
"
pong"

         });     } });

discord.io is a Javascript (node.js) framework that allows for creating Discord web clients.

34 questions
votes
1
answer
33 views

client.guilds coming up as 'undefined'

Okay, so I’m writing a discord bot that outputs all the usernames in a guild (server). Here is the code I have so far. var Discord = require(‘discord.io’); var logger = require(‘winston’); var auth =…
votes
1
answer
16 views

Getting number of active voice connections

I usually work with discord.js but now I’m contributing to a package that supports discord.io too (it’s dbots.js btw). I need to post bot stats to discordbotlist’s API and they support the number of …
votes
1
answer
47 views

Variable message is string

client.on(«message», async (message) => { }); variable message is string with only user name. Things like message.content are undefined. I need more than only user name. I’ve tried: client.on(«…
votes
1
answer
85 views

Discord bot randomly sending ad links

I’m making a discord bot and am new to discord.io. My bot randomly sends ad messages every 1-2 hours or so. I am working with only one file (bot.js) and none of it mentions the ad message. The message …
votes
45 views

Having trouble launching discord bot, SyntaxError: Unexpected token

I’m creating a small Discord bot that every time you enter !lenny, it will respond with a lennyface. However, I’m having trouble getting the bot started up. It’s throwing a SyntaxError that the token …
votes
49 views

Discord bot not starting up without error message

When i try to start up my bot via node the program quits again without any errors var Discord = require(‘discord.io’); var bot = new Discord.Client({ token: «nope» }); bot.connect(); console….
votes
1
answer
38 views

TypeError: Cannot read property 'id' of undefined whenever i type a PM to my bot on discord

While just starting out coding my bot, I suddenly receive the error Cannot read property ‘id’ of undefined whenever I private message the bot. The code and error stack are below. var Discord = …
1
vote
1
answer
141 views

Send message to specific channel with discord.io

With Discord.io I’m trying to send a message to a different channel than what it is sent from, but after a lot of Googling and experimenting I still can’t seem to find a way to do so. I tried to …
votes
74 views

Discord Bot Creation for a Beginner

I have never coded a Discord Bot before but am familiar with Javascript so I figured I would give it a shot. I used the beginner files from this site Digital Trends but am running into some issues. I …
2
votes
1
answer
78 views

Javascript Discord Bot mention author in output

I want: ME (Veak): !voting Bot: Veak started a vote How it is: Me (Veak): !voting Bot: undefined started a vote The code for I used is ‘message.author + ‘started a vote’ I did try message….
-1
votes
1
answer
66 views

Error: Cannot read property “get” of undefined. How to use bot.channnels.get function?

I’m unable to use the bot.channels.get function or whatever it is (apologies, i’m new to javascript and I don’t know many of the terms). All I’m trying to do is send a test message using the bot. It …
votes
1
answer
496 views

Send Image via Discord Bot — NodeJS

I already create token, and permission and authorize the correct server Code var Discord = require(‘discord.io’); var logger = require(‘winston’); var auth = require(‘./auth.json’); // Configure …
3
votes
2
answers
269 views

Have a discord bot send many messages with only one command

I am making a cultist bot for discord, and I want it to send a message that repeats a message five times when an appropriate command is given !praise. All the other commands run correctly (below I …
votes
1
answer
203 views

Cannot read property 'bot' of undefined [duplicate]

I’m trying to make a little and simple bot to delete messages (if they start with some specific characters) posted by users in a text channel. This is the code: var Discord = require(‘discord.io’); …
votes
21 views

Discord.io Running to shutdown audio data stream closes bot

When I call the command «!endSong» it shuts down the bot, and the code that I’m executing this with is: case ‘endSong’: stream.stop(); break; I don’t want the bot to shutdown so …
153050per page
1
2
3
next
Рейтинг автора
5
Подборку подготовил
Андрей Ульянов
Наш эксперт
Написано статей
168
Ссылка на основную публикацию
Похожие публикации