#development
1 messages · Page 561 of 1
But thank you all for your help and support! I couldnt have done it probably without you
Why 🤔
functions don't have length
Because if my array has not result how should i send an error message?
you never get an array
Anyone here use RethinkDB with node before?
Dresseur.Sac is my array @inner jewel
if (filterItems.length == 0)
filterItems is not an array
it will never have a length == 0
My code return the results of an array
I want if there is no result it sends a message
But if (filterItems.length == 0) return message.channel.sen("Erreur :Croix: : Aucun résultat") this line not work
go learn javascript
You did not understand
Extremely random but has anyone worked with RestSharp and sent a restRequest that has parameters replaced by AddUrlSegment, which then has an extra parameter BEFORE even doing any AddUrlSegment's?
For some reason my requests were coming back invalid and when I opened the object by breakpointing it I noticed the Parameters property contained 5 values instead of 4, the 0th value is the end of my URL and the 4th parameter I wanted to replace
I rewrote my bot to add polymorphism to it and for some reason it ends up like that, I mean since it's a list I can just delete it which is my temporary hack until I figure out what's going on with it
I need some help with my bot for discord when I node it it says Error: Cannot find module 'C:\Users\n---\bot.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:611:15)
at Function.Module._load (internal/modules/cjs/loader.js:537:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:801:12)
at executeUserCode (internal/bootstrap/node.js:526:15)
at startMainThreadExecution (internal/bootstrap/node.js:439:3) But I have the module. Can someone help please.
are you opening your shell in the folder bot.js is in?
alright let's call it command prompt or console then, the thing you type your "node <file>" command into
yeah i know about that
yea, have you tried opening that from the folder your bot is located in
no
what this error output tells you is that file file doesnt exist in the directory you used the node command in
press shift+right click in the folder bot.js is in, you should see an option to open the command prompt from that folder in the little list that pops up
do that and then try to node bot.js
thanks
alternatively you can just open the command prompt elsewhere and cd <file's directory> and then node bot.js
how does that not work
cd means change directory
and how do i do that exactly....
...
i started coding today
oh boy
and i cant do anything
cd <path>
ok thanks
What is this At line:1 char:4
- cd <New folder>
- ~
The '<' operator is reserved for future use.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : RedirectionNotSupported

what
not to offend but ur joking saying you started coding today if you cant even use basic command prompt
ok
cd path where path is your file's path
cd C:\folder\my\bot\file\is\in
Set-Location : A positional parameter cannot be found that accepts argument 'folder'.
At line:1 char:1
- cd New folder
-
+ CategoryInfo : InvalidArgument: (:) [Set-Location], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
i knew this was gonna happen

alright, new approach
ok
Follow this tutorial to learn how to work with command prompt and change directories. Don't forget to check out our site http://howtech.tv/ for more free how...
oh no powershell
open your folder in the file explorer (double click on it)
click on the bar at the top that window that has your folder's name
https://i.ryeqb.me/ea697975ea.png copy what's in there and use that as your path
sure'
spoiler: the thing you will copy won't look like the one in my screenshot
make sure to open the folder your bot.js file is in
ok
I need to make an RPC connection between the bot processes and I'd use a redis PUB/SUB channel for that
I'd make it JSON formatted which would contain a function call and a unique command identifier if I expect an output back from each process
the question is what is the most wise idea to capture all the outputs sent back from the processes?
Set-Location : A positional parameter cannot be found that accepts argument 'C:\Users\n---\Documents\New'.
At line:1 char:1
- cd path C:\Users\n---\Documents\New folder
-
+ CategoryInfo : InvalidArgument: (:) [Set-Location], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
I can only think of waiting for 1s and if I don't get back an output from one process then I display a timed out message for that process
as an example, shard latencies command where I want to list all the latencies
cool
how can you use "the wrong command prompt"
fucc no*
eh
idk
seriously i just learned this froma video on how to make bots
from a*
on windows there’s powershell and cmd prompt
both works
@shy thistle stop
what
ok then
too bad
sololearn is ok
sololearn is pretty decent
only teaches syntax tho, doesnt give actual programming knowledge
ok
How could I loop through every channel and change the permissions for that channel
I am doing this for a mute command
Discord.py rewrite btw
don’t do that, just make a muteRole setting and when a user executes that command make it assign the mute role to the user who was muted
i give up
const DBL = require('dblapi.js');
const dbl = new DBL("token", { webhookPort: 5555, webhookAuth: 'auth'});
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(vote.type)
//console.log(`User with ID ${vote.user} just voted!`);
});```
So I'm using this code with discord.js, and it's not registering votes or tests. Anyone have any idea why?
is your token set to your dbl token
yes
huh
if you're not receiving votes, double check your webhook url
also check for possible firewalls
How could I loop through every channel and change the permissions for that channel
I am doing this for a mute command\
?*
in what language
he said he uses the discord.py rewrite
👌
Eh
I hate roles though
:<
They bother me a fuck ton
Also, dyno manages to do it how come they aren't abusing the API
don't they have a mass role option
oh yeah some server i was in gave like 3500 people a role lmfao
Their mute cmd uses channel looping I think or idk how they doo it
but the mute cmd changes the channel permissions for the pinged person
a role named "muted" that overrides permissions
I haven't seen anyone get that role when I have muted them using dyno
btw it says "Webhook running at http://0.0.0.0:6666/dblwebhook" on the console
is the 0.0.0.0 why?
it's not working?
you need a webserver to recieve webhook requests
0.0.0.0 specifically ties to your machine only
receive*
dbl api creates a webserver for you
0.0.0.0 means receive connections from any ip address
but in your dbl edit page you need to use your machine's external ip address, not 0.0.0.0
your vps's external address then
Yay it works now! Thanks!
well essentially you'd still be creating permission overrides on every channel but for the role itself which means that you'll only have to override channel permissions once to have the mute effect apply to anyone who gets the muted role instead of overriding permissions twice whenever you mute/unmute a single user
My bot has a command for checking a table for the #th item in a table (the number is given by the user). If the bot finds the entry in the table, it will return info about the item in the table (name, time it was entered in, etc). However, when I run it, the bot doesn't send anything to the channel and I go in my console to find this: 2019-01-26 13:03:04 | [ERROR] | 400 - BAD REQUEST : POST https://discordapp.com/api/v7/channels/532127293452189696/messages
I'm using Discordia.
What does the error mean and how do I fix it?
oh
bot.on('guildCreate', (guild) => {
const join_embed = new Discord.RichEmbed()
.setFooter(`Made with ❤ by andre#1337 and the community!`)
.setColor(65519)
.setThumbnail(bot.user.avatarURL)
.addField(`Thanks for inviting me!`, `I'm a multipurpose bot, with fun, economy and other miscellaneous commands. You can use me by doing m$command, or if you want to set your own prefix, do m$prefix newprefix. Do m$help to get started on the commands. I get updated very frequently, so expect minor downtimes here and there for new cool features! Have fun :)`, false)
.setDescription("Announcement: Added per-server prefixes, Eco reset in 31st of January.")
let message_channel = guild.channels.filter(c => c.permissionsFor(guild.me).has('SEND_MESSAGES')).id
message_channel.send(join_embed);
});```
So i want the bot to send this message to the first channel with send messages permissions but im getting an error
and im smacking my head against the wall i tried so many different ways
what are you adding the ".id" for
- no channel
.id
someone told it could fix
you can't send messages to strings
well that someone appears to have no clue
no
it doesnt send anything
it tries to send to the id of the first channel
it's pretty much the same as "272764566411149314".send(...)
try running it 
.filter() returns a collections of channels, not a single channel
use .find() to return a single channel
uhm im confused now
you want channel.send()
yes
let message_channel = guild.channels.find(c => c.permissionsFor(guild.me).has('SEND_MESSAGES'))```
filter gets you all channels that match your filter
yes, find gets you the first occurence
ok
let me test
OH also
it said message_channel.send is not a function
message_channel.send(join_embed);```
after you changed it to find?
no after i removed the .id after the let message_channel = ...
find will fix that
ok let me see
how bad is it by fetching offline members on startup?
depends on the size of your bot
still the same error
but can increase your ram usage and startup time
bot.on('guildCreate', (guild) => {
const join_embed = new Discord.RichEmbed()
.setFooter(`Made with ❤ by andre#1337 and the community!`)
.setColor(65519)
.setThumbnail(bot.user.avatarURL)
.addField(`Thanks for inviting me!`, `I'm a multipurpose bot, with fun, economy and other miscellaneous commands. You can use me by doing m$command, or if you want to set your own prefix, do m$prefix newprefix. Do m$help to get started on the commands. I get updated very frequently, so expect minor downtimes here and there for new cool features! Have fun :)`, false)
.setDescription("Announcement: Added per-server prefixes, Eco reset in 31st of January.")
let message_channel = guild.channels.find(c => c.permissionsFor(guild.me).has('SEND_MESSAGES'))
message_channel.send(join_embed);
});```
try logging message_channel to see what it even gets you
ik about the RAM usage, but I wanted to know how exactly bad it will get, like 2-3 times more than without them
then either your find function is wrong, or there isnt any channel with enough permissions
also, don't the offline users get fetched at some point anyway when member update event fires up?
they should get fetched as they appear online
if they never come online, i dont think so
I would create a role in a guild by doing ctx.guild.create_role right? discord.py rewrite
ok another thing, is it a good practice to have an infinite loop without sleeping at some point?
depends on the size of your bot and how many big guilds it has
depends on how long the loop runs
and what lang/runtime
eg if it's an event loop you should avoid infinite loops without yielding control back to the runtime
lets say to run through each member of each server (without interacting with them)
@lost swallow i just tested the code here and it works
can you try console.logging message_channel?
i did now
weird, it should work then
but is it a good practice, like will that make it crash at some point?
how do i send the embed to the channel then?
guild.message_channel.send(join_embed);```
try scrolling to the beginning, does it say "TextChannel" at some point?
it won't crash, but if you lock it too long (assuming event loop) it'd lead to disconnects
too long is about 60-90 seconds
for discord
because this is still saying send of undefined
like i said cant read it all in putty
let me remove the send
its not really an event, but more of a on_ready that triggers the infinite loop
then try console.log(message_channel.type)
and wdym by locking?
this would kill the whole process
since only one piece of python code can run
due to the GIL
@lost swallow thats the problem then
you need to add a check in your find function to return only text channels, not category channels
(assuming cpython, other impls may or may not have a GIL)
actually on my other bot there is this infinite loop in on_ready that updates it's user status every 2 minutes, and it doesn't seem like it ever broke by running it for almost a week so far
.find(c => c.permissionsFor(guild.me).has('SEND_MESSAGES') && c.type === "text")
let message_channel = guild.channels.find(c => c.permissionsFor(guild.me).has('SEND_MESSAGES'))```
if there is an await, it's a different case
ohh
because it's actually breaking the loop
then returning
still same @quartz kindle
console.log the channel type again
bot.on('guildCreate', (guild) => {
const join_embed = new Discord.RichEmbed()
.setFooter(`Made with ❤ by andre#1337 and the community!`)
.setColor(65519)
.setThumbnail(bot.user.avatarURL)
.addField(`Thanks for inviting me!`, `I'm a multipurpose bot, with fun, economy and other miscellaneous commands. You can use me by doing m$command, or if you want to set your own prefix, do m$prefix newprefix. Do m$help to get started on the commands. I get updated very frequently, so expect minor downtimes here and there for new cool features! Have fun :)`, false)
.setDescription("Announcement: Added per-server prefixes, Eco reset in 31st of January.")
let message_channel = guild.channels.find(c => c.permissionsFor(guild.me).has('SEND_MESSAGES') && c.type === "text")
console.log(message_channel.type)
});```
well, you removed the send function
and still same error?
mhm
i have no idea then lol
console.log(message_channel.id)
then try doing guild.channels.get(id).send(your embed)
where id is the id that comes up in your console
as a string, with quotes
But its for multiple guilds not only one
yes, but just to test

https://cdn.discordapp.com/attachments/403974062872723496/538858434397732879/unknown.png
Does everyone knows how to make this? I can't find it on google, it's kinda hard to find something like this.
you won't find anything on google
that's not something simple
it's pretty much an unique implementation for every bot that does it
Would that need js?
a dashboard for a bot?
yes
can be done in a gazilion languages
he said in #topgg-api on dbl
can be done with js, can be done without
the only hard requirement is an http server
and basic knowledge of html/css
Discord.py rewrite:
How could I check if a role exists so it doesn't keep creating the same role everytime someone is muted
could be done with dart 

it should work
any idea on th url?
glitch offers you a subdomain routed to port 3000 no?
cause when i test vote doesnt' come by
your webhook has to be set to port 3000
ok but the url?
don't really know i'm still looking
Ready to share your creation with the world? Here's how to find the URL to your finished app! ===================== Don't forget to subscribe and follow us! ...

if i recall correctly, they redirect port 80 to 3000
you have to set port 3000 in your webhook code
not in the url
hmm
Try it without the :3000
@earnest phoenix go to a computer and run enable-pnpm in the console
const discord = require ('discord.js');
const filter = m => m.author.id === message.author.id;
class Game1Command extends commando.Command
{
constructor(client)
{
super(client,{
name: 'game1',
group: 'games',
memberName: 'game1',
description: 'Try out Game 1 :D'
});
}
async run(message, args)
{
message.channel.send('What is your name?')
message.channel.awaitMessages(filter,{
max: 1, time: 10000}).then(collected => {
let answer1 = args[0];
});
}
}
module.exports = Game1Command;
console.log('Game1 command is online')``` how do i make the ``let answer1 = args[0]`` only work for the first question
args here is coming from the original message
so it will be whatever you type in the original command
if you want the answer, you need to get it from the collected message
i'm trying to put avatar of the author in canvas so the avatar is invisible
someone can help me ?
@earnest phoenix const guildLog = new Discord.RichEmbed()
changed still doesn't
Do you have an error ?
In your console
no
wth
nope
Anyways someone ping me if you know what's wrong
why the avatar is invisible
displayAvatarURL is not asynchronous, you don't need to await it
I don't think variables are ever asynchronous
even in master with it being a function it isn't async
Hey, is there someway for client.on("messageReactionAdd", ... to track messages before the bot starts? Otherwise everytime the bot restarts there needs to be a new message
I'm trying to make a bot assign roles depending on reactions on a message
how about checking the message object for the total number of reactions
Do I do that under messageReactionAdd?
you can do it anywhere. but it makes sense
Ahhh thanks - I couldn't find the raw event in the docs
Can someone help me with the API?
My code:
const request = require('request');
const options = {
"Authentication": "TOKEN"
};
request.get('https://discordbots.org/api/bots/442184461405126656/votes', options, (e,r,b) => {
console.log(b);
});
I get the error
{"error":"Unauthorized"}
isnt it /stats?
?
the pages look similar
stackoverflow says this
var options = {
method: 'POST',
uri: 'http://your.url.com/',
form: {
field1: 'somevalue',
field2: 666.66
},
headers: {
'Authorization': 'Basic ' + new Buffer("username:password").toString('base64')
}
};
request(options, function(error, response, body) {
// do stuff
})```
change as needed
thanks
'Authorization': 'yourtoken'
oooohhh
and change from post to get
What does client.emit(...) do?
fires an event
should i be concerned about this
or is it on discord's end
ive been having troubles with the bot losing connection to shards randomly
while remaining connected to others
yeah it's been having a lot of issues it seems
i thought maybe the bot was growing too fast and i wasn't optimizing it enough or something
but it works perfectly for most of the day
then randomly does shit like this
I've noticed it as well
certain shards are lightning fast while others will take tens of seconds to respond
I usually just restart the bot when I notice it because that ends up fixing it for a few hours
Does anyone know why https://github.com/AnIdiotsGuide/discordjs-bot-guide/blob/master/coding-guides/raw-events.md only runs once
client.on("raw", packet => { // For messages no longer in cache (before bot start)
if (!['MESSAGE_REACTION_ADD', 'MESSAGE_REACTION_REMOVE'].includes(packet.t)) return;
const channel = client.channels.get(packet.d.channel_id);
if (channel.messages.has(packet.d.message_id)) return;
channel.fetchMessage(packet.d.message_id).then(message => {
const emoji = packet.d.emoji.id ? `${packet.d.emoji.name}:${packet.d.emoji.id}` : packet.d.emoji.name;
// This gives us the reaction we need to emit the event properly, in top of the message object
const reaction = message.reactions.get(emoji);
// Adds the currently reacting user to the reaction's users collection.
if (reaction) reaction.users.set(packet.d.user_id, client.users.get(packet.d.user_id));
if (packet.t === 'MESSAGE_REACTION_ADD') {
console.log("RAW even emits MESSAGE_REACTION_ADD");
client.emit('messageReactionAdd', reaction, client.users.get(packet.d.user_id));
}
if (packet.t === 'MESSAGE_REACTION_REMOVE') {
console.log("RAW even emits MESSAGE_REACTION_REMOVE");
client.emit('messageReactionRemove', reaction, client.users.get(packet.d.user_id));
}
});
});
It only console.logs once
all right so
it's been a while since i've made a new bot iteration, so should i use npm or yarn?
looking for reasons to use both here, but i'm interested in trying out yarn
npm is definitely a lot more popular now
hmm
this module i use has a callback, how do i convert it to return a promise?
wasnt there some module called promisify or is that something else
return new Promise((resolve, reject) => functionWithCallbacks((res, err) => err ? reject(err) : resolve(res)))
no such thing
@lusty dew I know only Heroku and Glitch
@lusty dew One time u can use thia resources,when u dont buy VPS hosting
?
@pseudo lion Hm?
What? :d
@lusty dew hi, may I recommend host?
@earnest phoenix Sure
DigitalOcean, OVH, Scaleway, AWS, Google Cloud
last two offer trial periods
DigitalOcean have trial
I need some help!
client.on("voiceStateUpdate", async (message, oldMember, newMember) => {
const log = message.guild.channels.find(ch => ch.name === 'bot-voice-log');
let newUserChannel = newMember
let oldUserChannel = oldMember.voiceChannel
if (!log) return;
if(oldUserChannel !== undefined && newUserChannel === undefined) {
var logembed = new Discord.RichEmbed()
.setTitle('voice log')
.setDescription(`**${oldMember} just enter to <#${oldMember.voiceChannel.id}>!!**`)
.setFooter(`log`)
.setTimestamp()
log.send(logembed);
} else{
var logembed2 = new Discord.RichEmbed()
.setTitle('voice log')
.setDescription(`**${oldMember} just left voice channel**`)
.setFooter(`log`)
.setTimestamp()
log.send(logembed2);
}
})
i want just logging user join or left the voice channel
but it logging user mic update too..
how can i fix it T.T
let newUserChannel = newMember you're not even getting the voicechannel of newMember
oh.. but if i delete let newUserChannel = newMember
how can remake it..?
um... but
if i don't write message
how can i send log..?
get the guild from member
oldmember.guild.channels
or newmember.guild.channels
both work
also, voiceStateUpdate checks user join/leave and also user mute/unmute
i want fix that..
so your else needs to be more specific
if(newuser && !olduser) {
// joined
} else if(!newuser && olduser) {
// left
}```
um.. can i ask Other(?) question?
sure
const log = oldMember.guild.channels.find(ch => ch.name === 'log-channel');
can(?) work?
yes
i have another error
it isn't send log..
but thx a lot T.T
have a nice day!!
what error?
bot.on("voiceStateUpdate", async (oldMember, newMember) => {
const 로그 = oldMember.guild.channels.find(ch => ch.name === 'w봇-보이스1로그');
if (!로그) return;
if(newMember && !oldMember) {
var logembed = new Discord.RichEmbed()
.setTitle('음성로그')
.setDescription(`**${oldMember}님이 <#${oldMember.voiceChannel.id}>를 들어가셨습니다.**`)
.setFooter(`WBOT 로그`)
.setTimestamp()
로그.send(logembed);
} else if(!newMember && oldMember) {
var logembed2 = new Discord.RichEmbed()
.setTitle('음성로그')
.setDescription(`**${oldMember}님이 통화방을 나가셨습니다.**`)
.setFooter(`WBOT 로그`)
.setTimestamp()
로그.send(logembed2);
}
})
it isn't send log..
((sorry to not translate(?) korean to english
newmember and oldmember must be the voice channel
newMember.voiceChannel && !oldMember.voiceChannel
oh
it means
fix it like
bot.on("voiceStateUpdate", async (oldMember, newMember) => {
const 로그 = oldMember.guild.channels.find(ch => ch.name === 'w봇-보이스1로그');
if (!로그) return;
if(newMember.voiceChannel && !oldMember.voiceChannel) {
var logembed = new Discord.RichEmbed()
.setTitle('음성로그')
.setDescription(`**${oldMember}님이 <#${oldMember.voiceChannel.id}>를 들어가셨습니다.**`)
.setFooter(`WBOT 로그`)
.setTimestamp()
로그.send(logembed);
} else if(!newMember.voiceChannel && oldMember.voiceChannel) {
var logembed2 = new Discord.RichEmbed()
.setTitle('음성로그')
.setDescription(`**${oldMember}님이 통화방을 나가셨습니다.**`)
.setFooter(`WBOT 로그`)
.setTimestamp()
로그.send(logembed2);
}
})
it?
or do something like
let new = newMember.voiceChannel
let old = oldMember.voiceChannel
if(new && !old) ...```
yes that should work
um.. error..
what error?
oh
the first if is for join, right? so newMember.voiceChannel.id
not oldMember.voiceChannel.id?
just write voiceChannel.id ??
no
oldMember.voiceChannel doesnt exist
because user just joined
id did not have a voicechannel before
oh
so you have to use newMember, not oldMember
to get the name of the voice channel they just joined
no
T.T
you can add me as friend, but i dont help in dms
okay!
Hi i have a big problem
My command https://hastebin.com/fajuzicili.js
Crash when the user give a number bigger than 1024 the limit of carachter
How can I avoid that?
don't allow >1024 chars...?
Substr 1, 1000
🤔
I go look
I don't understand everythink you can explain me @soft plaza ? I have to do what ?
Tu dois couper la taille du texte
Ouais
Ok ok
Le texte que tu essaye d'envoyer est trop long, donc tu doit le couper
Je t'ai donné un lien pr la ressource mdn
Tu coupe de l'index 0 à 1000 ou 1024
Comme ça tu peut envoyer ton texte
var Discord = require("discord.js");
var cfg = require("../cfg/cfg.json");
var quick = require("quick.db")
exports.run = async (bot, message, args) => {
try {
if (message.author.id !== cfg.ownerID) {
message.channel.send(`You cannot run this command`);
} else {
let new_announcement = args.slice(0).join(" ");
if (!new_announcement) return message.channel.send(":x: Please, provide the new announcement!");
var output = await quick.set(`join.announcement`, `${new_announcement}`)
message.reply(`The announcement was successfully changed to ${new_announcement}`)
} catch (e) {
console.log(`Command error ${exports.help.name} >> ${e}`)
}
}
}
exports.help = {
name: "setannouncement"
};```
unexpected token catch
You have to close your else and your try before adding the catch
try {
if() {
} else {
}
} catch(e) {console.error(e) }
var Discord = require("discord.js");
var cfg = require("../cfg/cfg.json");
var quick = require("quick.db")
exports.run = async (bot, message, args) => {
try {
if (message.author.id !== cfg.ownerID) {
message.channel.send(`You cannot run this command`);
} else {
let new_announcement = args.slice(0).join(" ");
if (!new_announcement) return message.channel.send(":x: Please, provide the new announcement!");
var output = await quick.set(`join.announcement`, `${new_announcement}`);
message.reply(`The announcement was successfully changed to ${new_announcement}`);
}
}
} catch (e) {console.log(`Command error ${exports.help.name} >> ${e}`)}
exports.help = {
name: "setannouncement"
};```
Almost it, just stay in your function
uhm
var Discord = require("discord.js");
var cfg = require("../cfg/cfg.json");
var quick = require("quick.db")
exports.run = async (bot, message, args) => {
try {
if (message.author.id !== cfg.ownerID) {
message.channel.send(`You cannot run this command`);
} else {
let new_announcement = args.slice(0).join(" ");
if (!new_announcement) return message.channel.send("❌ Please, provide the new announcement!");
var output = await quick.set(`join.announcement`, `${new_announcement}`);
message.reply(`The announcement was successfully changed to ${new_announcement}`);
}
}catch (e) {console.log(`Command error ${exports.help.name} >> ${e}`)}
}
exports.help = {
name: "setannouncement"
};```
👌

-botinfo @steady ruin
uhm
Uncaught Exception: Error: Cannot find module 'ytdl'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (./commands/play.js:2:14)
at Module._compile (internal/modules/cjs/loader.js:721:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:20:18)
at cmds.forEach (./bot.js:50:21)
at Array.forEach (<anonymous>)
at fs.readdir (./bot.js:49:8)
at FSReqCallback.args [as oncomplete] (fs.js:146:20)
i have ytdl installed
const Discord = require("discord.js");
const ytdl = require("ytdl");
exports.run = async (bot, message, args) => {
if (!message.member.voiceChannel) return message.channel.send(':no_entry_sign: Please join a voice channel.');
if (message.guild.me.voiceChannel) return message.channel.send(':no_entry_sign: Error, the bot is already connected to another music channel or a song is playing.');
if (!args[0]) return message.channel.send(':no_entry_sign: Error, please enter a **URL** following the command.');
let validate = await ytdl.validateURL(args[0]);
if (!validate) return message.channel.send(':no_entry_sign: Error, please input a __valid__ url following the command.');
let info = await ytdl.getInfo(args[0]);
let connection = await message.member.voiceChannel.join();
let dispatcher = await connection.playStream(ytdl(args[0], {
filter: 'audioonly'
}));
let playembed = new Discord.RichEmbed()
.setTitle("Now playing")
.setDescription(`${info.title}`)
message.channel.send(playembed);
}
exports.help = {
name: "play",
};```
Hi i have a big problem
My command https://hastebin.com/fajuzicili.js
Crash when the user give a number bigger than 1024 the limit of carachter
How can I avoid that?
Hey anyone can give me a example of music bot in python
hmm?
NebulusAujourd'hui à 14:05
Hi i have a big problem
My command https://hastebin.com/fajuzicili.js
Crash when the user give a number bigger than 1024 the limit of carachter
How can I avoid that?```
truncate it? lmao
What ?
A number bigger than 1024 characters isnt even named yet
what do you mean number bigger than 1024, like 1025 or like 1024 characters
^
RangeError: RichEmbed field values may not exceed 1024 characters.
at RichEmbed.addField (/home/Akimitsu_Dev/node_modules/discord.js/src/structures/RichEmbed.js:157:36)
at Object.channellogs (/home/Akimitsu_Dev/function.js:21:14)
at Client.client.on.message (/home/Akimitsu_Dev/pokemon.js:3160:22)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at MessageCreateHandler.handle (/home/Akimitsu_Dev/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/home/Akimitsu_Dev/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (/home/Akimitsu_Dev/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/home/Akimitsu_Dev/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/home/Akimitsu_Dev/node_modules/ws/lib/event-target.js:120:16)
error: Forever detected script exited with code: 1
error: Script restart attempt #1
/home/Akimitsu_Dev/function.js:28``` error if i use my command with too much caracters :
Bah si je rentre ?gift @Nebulus 184467440737095516158364274623846237462834672346843623745673245283452378453278457234527384523784532745237452374852387453278452387453458475238745238745375422374628346723468436237456732452834523784532784572345273845237845327452374523748523874532723746283467234684362374567324528345237845327845723452738452378453274523745237485238745327237462834672346843623745673245283452378453278457234527384523784532745237452374852387453272374628346723468436237456732452834523784532784572345273845237845327452374523748523874532723746283467234684362374567324528345237845327845723452738452378453274523745237485238745327237462834672346843623745673245283452378453278457234527384523784532745237452374852387453272374628346723468436237456732452834523784532784572345273845237845327452374523748523874532723746283467234684362374567324528345237845327845723452738452378453274523745237485238745327237462834672346843623745673245283452378453278457234527384523784532745237452374852387453272374628346723468436237456732452834523784532784572345273845237845327452374523748523874532723746283467234684362374567324528345237845327845723452738452378453274523745237485238745327237462834672346843623745673245283452378453278457234527384523784532745237452374852387453272374628346723468436237456732452834523784532784572345273845237845327452374523748523874532723746283467234684362374567324528345237845327845723452738452378453274523745237485238745327237462834672346843623745673245283452378453278457234527384523784532745237452374852387453272374628346723468436237456732452834523784532784572345273845237845327452374523748523874532723746283467234684362374567324528345237845327845723452738452378453274523745237485238745327237462834672346843623745673245283452378453278457234527384523784532745
Yea
lmao
But that number isnt even named 
peak iq hours
If anyone passes it with your bot, you should be real happy they use it for that long
there is no embed in the code you sent
If a person finds the flaw he can crash my bot no matter when
s0 d0n't make 8t ex8ceed
?
its an embed range error, but the code you posted has no embeds in it
I have aldready test : if (achievement1.lenght > 1024) return
if(achievement1.length > 1024)?
But he don't <ork
Ok
you cant use .length on numbers
you have to use it before you convert into a number
mmmmhhh
the compiler doesn't complain because js is rarted
also, why do you have a parseInt in there doing nothing?
Just use .toString()
bot.on("guildCreate", async(guild) => {
const { WebhookClient, RichEmbed } = require('discord.js');
let webhook_url = 'https://discordapp.com/api/webhooks/538905072629973012/onhVaPEIrj4TC6Jca4NBgKtZZavjEgkBPtUDHAkz9f64tauEWAfSFwVhe3dfIDJubXW';
const guildWebhook = new WebhookClient(webhook_url.split('/').slice(5)[0], webhook_url.split('/').slice(5)[1]);
let users = guild.members.filter(u => !u.user.bot).size;
let bots = guild.members.filter(u => u.user.bot).size;
const guildLog = new RichEmbed()
.setAuthor(guild.name, guild.iconURL({ format: 'png' }))
.setTitle(`Joined a new server!`).setURL(`https://discordbots.org/bot/522771517365420032/vote`)
.setColor('#ED1B24')
.addField('ID', `${guild.id}`, true)
.addField('Members', `${users} user${users > 1 ? 's' : ''} **|** ${bots} bot${bots > 1 ? 's' : ''}`, true)
.addField('Owned by', `${guild.owner.user.tag} [\`${guild.ownerID}\`]`)
.setTimestamp()
guildWebhook.send(guildLog);
});
.toString().length()
Why is this not sending
hum
Will change later
why use toString when the input is already a string? lmao
He converted it to a number
just do it before conveting
So I have to do a how?
Either way works 
thanks for that token
Then ?
np
@earnest phoenix what token ?
anyway nebulus, did you understand?
you have to check the .length before converting to a number
How am I doing this? @quartz kindle ?
.>

Because I already did: if (achievement1.lenght > 1024) return
because you made achievement1 into a number
let achievement1 = Number(args.join("")) // achievement1 is a number```
Yes yes
why not simply not allow such ridicilous numbers
So
so either check the length of the args.join() or make a new variable to save args.join() in
10^1023 
Mmmmmhhhh
bot.on("guildCreate", async(guild) => {
const { WebhookClient, RichEmbed } = require('discord.js');
let webhook_url = 'https://discordapp.com/api/webhooks/538905072629973012/onhVaPEIrj4TC6Jca4NBgKtZZavjEgkBPtUDHAkz9f64tauEWAfSFwVhe3dfIDJubXW';
const guildWebhook = new WebhookClient(webhook_url.split('/').slice(5)[0], webhook_url.split('/').slice(5)[1]);
let users = guild.members.filter(u => !u.user.bot).size;
let bots = guild.members.filter(u => u.user.bot).size;
const guildLog = new RichEmbed()
.setAuthor(guild.name, guild.iconURL({ format: 'png' }))
.setTitle(`Joined a new server!`).setURL(`https://discordbots.org/bot/522771517365420032/vote`)
.setColor('#ED1B24')
.addField('ID', `${guild.id}`, true)
.addField('Members', `${users} user${users > 1 ? 's' : ''} **|** ${bots} bot${bots > 1 ? 's' : ''}`, true)
.addField('Owned by', `${guild.owner.user.tag} [\`${guild.ownerID}\`]`)
.setTimestamp()
guildWebhook.send(guildLog);
});```
It's not sending the webhook and it's not giving me an error
@quartz kindle how should I do this? beacause i defined already achievement in number
can you try logging guildWebhook?
have you tried sending a normal string instead of an embed?
have you tried hardcoding the webhook id and token instead of spliting it from the url?
no
How should I do this? beacause i defined already achievement in number?
do it before you make it a number
Except that before a number the variable will not be defined
achievemt1 is not defined, but how did you define it?
you have args
and you have args.join
define a new one that is not a number
.>
do the same thing without the Number() part
thats what is turning it into a number
I have change : var achievement1 = args.join("")
And add : if (achievement1 > 800) return message.channel.send("No")
@amber fractal
Well it isnt 
args // array
args.join("") // string
Number(args.join("")) // number
let a = args // a is an array
let a = args.join("") // a is a string
let a = Number(args.join("")) // a is a number```
?
You're passing ({format: 'png'}) into it when it's not a function
@quartz kindle i just don't understand you can edit my code and explain me ?
Quickly done
yeah idk what to do to fix this Steven
Make it not a function
not call something that's not a function
how
easy
args.length // length of array
args.join("").length // length of string
Number(args.join("")).length // undefined, numbers dont have length
let a = args;
a.length // length of array
let a = args.join("");
a.length // length of string
let a = Number(args.join(""));
a.length // undefined, numbers dont have length```
@lofty hamlet
remove ({format:'png'})
ok
Hum i look
when you add ()'s to something you're telling the code its a function
most of the time
hmm
you wont need to format it anyways, it will be a png if they uploaded it as a png
Wait
.... @quartz kindle ... i just don't understand you can edit my code and explain me ?
Quickly done
Dont listen to me
you can get it as png, jpeg or webp
@lofty hamlet no. if you dont understand, study more
discord allows those 3 formats
no spoonfeeding
regardless of what it was uploaded as
But it's just a line
GUILD_DELETE
Tell me what to do then @quartz kindle
d.js is guildDelete
I don't understand what you say
use google translate to translate it to french
I use this
thanks
what is so hard to understand?
you have args
args is what? is the words that the person put in the command
its an array, a list of words
if you do args.join("") you combine all the words into one string, one text
then you can check how big the text is by using .length
then if you use Number() you are converting the text into a number, so then it becomes Math, not text, so you cant see the length of the text anymore
It will not work like even watching with this command it's about the same
@quartz kindle
?
Look
My line : if (pokeraison.length > 500) return message.channel.send('No') not work
While pokeraison is a string
define doesn't work
@inner jewel ?
you're slicing 22 characters off of it
you have to use a string that is bigger than 522 characters, have you tested?
Thats the length of a mention
Once a boy gets approved when I make changes does have to get approved again or is it one time
? @quartz kindle
once a boy gets approved he becomes a man
One time
you are checking if your string length is bigger than 500
mentions don't have a fixed length
have you tested it with a string that's long enough
<@id>
they could be anywhere from 4 to 24 characters
no
ids are unsigned 64 bit integers
those can have 1 to 20 characters
when printed in base 10
@quartz kindle ... is not work
Ok
Can u guys try out my bot
Even with a thong you saw
Give feedback
@lofty hamlet show the command you tested
Yes
https://hastebin.com/meyukodumo.js @quartz kindle
AH :
else if tree command handlers ftw
I always use .slice(22) and it has never failed
then you never got any old user
@quartz kindle
@quartz kindle
@quartz kindle
i am being harassed
Yes
also @amber fractal if a user has a nickname in a server, his mention will have an ! in it
?poke @Nebulus#8919 JUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSS @quartz kindle it's the command
W0w just an hour
Just for this little error
not my problem, we are not obliged to code for you
Wew
😢
you can avoid errors by learning the language and being consistent within your code
You couldve solved the problem you told us in 1 line tho?
your code is a mess, there is a bunch of other problems in it lol
https://i.ryeqb.me/31771fecc4.png like damn
but for now, try doing console.log(pokeraison)
var let const let holy shit
yeah lmao
@quartz kindle when i used : ?poke @Nebulus EFEZ the console return EFEZ
this one command +- pending cleanup/fixing is 40 lines, since he's using an else if tree i don't even want to imagine the mess of a code file his message handler is
then it should work
But is not work ...
do console.log(pokeraison.length, pokeraison.length > 10)
then test a command once with a text smaller than 10, then again with a text bigger than 10
@quartz kindle when i used ?poke @Nebulus EFEZUDQUQIQIU the console return : 13 true
Where ?
in the if length > 522
so it worked
...
Hum yes he work 🤔
But if i change 10 by 50 he don't work @quartz kindle 😂
WTF
with a text bigger than 50?
No wait
const Discord = require("discord.js");
const cfg = require("../cfg/cfg.json");
const YTDL = require("ytdl-core");
exports.run = async (bot, message, args) => {
function play(connection, message) {
var server = servers[message.guild.id];
server.dispatcher = connection.playStream(YTDL(server.queue[0], {
filter: "audioonly"
}));
server.queue.shift();
server.dispatcher.on("end", function () {
if (server.queue[0]) play(connection, message);
else connection.disconnect();
});
}
let song_url = args[0]
var servers = {};
if (!message.guild.member(bot.user).hasPermission('SPEAK')) return message.channel.send(':x: Sorry, but i cant join/speak in this channel!').catch(console.error);
if (!song_url) {
message.channel.send(":x: Please provide a URL YouTube link to me to play song.");
return;
}
if (!message.member.voiceChannel) {
message.channel.send(":x: I think it may work better if you are in a voice channel!");
return;
}
if (console.error) {
message.channel.send(":x: Sorry, I'm still unable to search music on YouTube");
return;
}
if (!servers[message.guild.id]) servers[message.guild.id] = {
queue: []
};
var server = servers[message.guild.id];
server.queue.push(song_url);
message.channel.sendMessage('``You song has been added to the queue.``')
if (!message.guild.voiceConnection) message.member.voiceChannel.join().then(function (connection) {
play(connection, message);
});
}
exports.help = {
name: "play"
};```
its giving the unable to search error when i provide an url
catch (e) then?
@quartz kindle is work with ?poke UJIUJIJIJIDUDHJDJ but a big message : ?poke @Nebulus JUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSJUFEHIUSDHU7FYYU7UFDSUSDUDFSUYDFSSSSSSSSSSSSSSSSSSS
Is not work
This error : RangeError: RichEmbed field values may not exceed 1024 characters.
...
WTF
then its another problem
@lost swallow where do you want to place that error message?
under which condition?
But what is the problme @quartz kindle wtf ?
When I put more than 10 but less than 1024 it works more than 1024 it does not work wtf?
because theres a limit on embed fields
literally tells you embed fields can't exceed 1024 characters
you cant just fill them with junk
I klnow 😂 you You did not follow the mistakes
what did you put in the .length >
if (pokeraison.length > 10) return message.channel.send('No') @quartz kindle
strange
wtf
Ok
@quartz kindle ... : ```if (value.length > 1024) throw new RangeError('RichEmbed field values may not exceed 1024 characters.');
^
RangeError: RichEmbed field values may not exceed 1024 characters.
at RichEmbed.addField (/home/Akimitsu_Dev/node_modules/discord.js/src/structures/RichEmbed.js:157:36)
at Object.channellogs (/home/Akimitsu_Dev/function.js:21:14)
at Client.client.on.message (/home/Akimitsu_Dev/pokemon.js:3159:22)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at MessageCreateHandler.handle (/home/Akimitsu_Dev/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/home/Akimitsu_Dev/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (/home/Akimitsu_Dev/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/home/Akimitsu_Dev/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/home/Akimitsu_Dev/node_modules/ws/lib/event-target.js:120:16)
error: Forever detected script exited with code: 1
error: Script restart attempt #1
yo tim its not playing the next song in the queue
The same
what does your console.log say
@quartz kindle ... : ```if (value.length > 1024) throw new RangeError('RichEmbed field values may not exceed 1024 characters.');
^
RangeError: RichEmbed field values may not exceed 1024 characters.
at RichEmbed.addField (/home/Akimitsu_Dev/node_modules/discord.js/src/structures/RichEmbed.js:157:36)
at Object.channellogs (/home/Akimitsu_Dev/function.js:21:14)
at Client.client.on.message (/home/Akimitsu_Dev/pokemon.js:3159:22)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at MessageCreateHandler.handle (/home/Akimitsu_Dev/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/home/Akimitsu_Dev/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (/home/Akimitsu_Dev/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/home/Akimitsu_Dev/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/home/Akimitsu_Dev/node_modules/ws/lib/event-target.js:120:16)
error: Forever detected script exited with code: 1
error: Script restart attempt #1
Ah not me
Exuse me
econnreset means it disconnected from discord
can be a network failure, or your bot got stuck in an infinite loop
const Discord = require("discord.js");
const cfg = require("../cfg/cfg.json");
const YTDL = require("ytdl-core");
exports.run = async (bot, message, args) => {
function play(connection, message) {
var server = servers[message.guild.id];
server.dispatcher = connection.playStream(YTDL(server.queue[0], {
filter: "audioonly"
}));
server.queue.shift();
server.dispatcher.on("end", function () {
if (server.queue[0]) play(connection, message);
else connection.disconnect();
});
}
let song_url = args[0]
var servers = {};
if (!message.guild.member(bot.user).hasPermission('SPEAK')) return message.channel.send(':x: Sorry, but i cant join/speak in this channel!').catch(console.error);
if (!song_url) {
message.channel.send(":x: Please provide a URL YouTube link to me to play song.");
return;
}
if (!message.member.voiceChannel) {
message.channel.send(":x: I think it may work better if you are in a voice channel!");
return;
}
if (!servers[message.guild.id]) servers[message.guild.id] = {
queue: []
};
var server = servers[message.guild.id];
server.queue.push(song_url);
message.channel.sendMessage('``You song has been added to the queue.``')
if (!message.guild.voiceConnection) message.member.voiceChannel.join().then(function (connection) {
play(connection, message);
});
}
exports.help = {
name: "play"
};```
it did lag when i queued a new song
thats when the error was generated
does that run everytime you use a command?
this is the play command
because you're not saving the queue anywhere
every time you're regenerating the queue
the server and servers are being regenerated every time you run the command
so you're not really adding it to any queue
how do i save it
your queues need to be saved outside of the function
and then just added/removed from it
why does no one use discord.py
I wonder why you think of that, discord.py and discord.js are 2 the most used libraries
const lol = new Trash()
lol.takeItout()```
Fixed the bot now it won't respond to help
if anyone knows better sqlite 3, would you be able to help me set this up: server id: case numb user id mod id reason case numb 2... server id 2...
const { app, Tray, Menu } = require("electron");
const path = require("path");
app.on("ready", () => {
const TrayApp = new Tray(path.join(__dirname, "Hammer.icns"));
TrayApp.setToolTip("This is a test.");
TrayApp.setContextMenu(Menu.buildFromTemplate([
{ role: "quit" }
]));
});``````sh
Uncaught Exception: TypeError: Error processing argument at index 0, conversion failure from /Users/sinistercyborg/Projects/HammerRPC/Hammer.icns
at App.app.on (/Users/sinistercyborg/Projects/HammerRPC/main.js:6:21)
at App.emit (events.js:187:15)```
how would one set up vote checking for a bot in discord.py
so that the bot knows if a user voted or not
@compact mauve algorithm based on user input
Let me clarify what I was asking for: I probably wasn't making this clear before, and I apologize, but I was wondering if there was example code one could show in discord.py that counts voting
Hi developers how do I want to switch to my bot account?
Why are the bots down on my server
why are b0ts d0wn 0n m8y se8rver
🤔
Does anyone know how to use Vue.js?
Ok
Help please
xd
I am trying to implement vue
into a checkbox
so when the checkbox is clicked
it shows a form
<label class="checkbox is-2">
<input type="checkbox" name="Dev">
</label>
I am trying to implement vue into this
Using
new Vue({
el: "#app",
data:{
visible: true
},
methods: {
toggle: function(){
this.visible = !this.visible
}
}
})
using the
@click="toggle"
but idk where to put it at
in the lable or in the input
Will Discord rate limit me for calling http://discordapp.com/api/users/@me and one for guilds whenever page loads?
model binding will update the value, and since vue is reactive, you can use conditional if to show forms
anyone has some experience with express
@round glade I have some
I have created wwebsites
He didn't say they were?
He just asked if I have
🤔 Where is the logic behind what you said
I need help with my bot
My bot crashes when it tries to load the superduberultimateoliydestroyer.ex
thanks, that worked
2019-01-27T22:05:25.404631+00:00 app[worker.1]: def json(self, *, loads=json.loads):2019-01-27T22:05:25.404655+00:00 app[worker.1]: AttributeError: module 'json' has no attribute 'loads'
How do i fix it
Suicide jokes aren't funny
Can someone help me
@prime oriole python?
Yes
I don't do python, so I can't help you.
<ignore>
;-;
lol
@inner jewel hey qt, wanna help with d0cker
SwiftiToday at 11:50 PM
Suicide jokes aren't funny
prove me wrong, but literally everyone who's not suicidal gets offended by suicide jokes lol
oh this is dev
whoops
lol
Can someone help me?
2019-01-27T22:05:25.404631+00:00 app[worker.1]: def json(self, *, loads=json.loads):2019-01-27T22:05:25.404655+00:00 app[worker.1]: AttributeError: module 'json' has no attribute 'loads'
What dose it mean?
@earnest phoenix "What does it mean? lol"

