#development
1 messages · Page 640 of 1

@earnest phoenix That's still considered spoonfeeding 
if you spoonfeed this man
Wait
I swear
spoonfeeeding?
that is when you give people code and not teach them how to code
Just search on google 4TriX
I'm teaching to people how to spoonfeed
@earnest phoenix yes i did and they dont
okay..
@earnest phoenix lets take it to DMs

hello developers
Hello
Do you need help?
yup
@near igloo this isn't really a chat for saying hi but if you have a question you can drop it here.
Ask your question
how will i make my webpage public?
but hi, hope you're having a good day so far. 
are you referring to being listed in dbl or something else ?
i create a webpage by using HTML so i wanna make it public so any 1 can surch it on it...
nobody cant help you
look the topic of the channel @near igloo
I have another question, if my boy was declined for a reason, can I fix that and apply again?
yes
Yep
every 1 is rude\
then help me to make a discord bot
Okay
where is the word bot ?
Read the topic of the channel before talking in the channel
Move out of this channel if you are not going to ask any question about programming
learn and apply what you have learn
ie learned HTML
There are plenty videos on youtube too about how to get started
wot is this??
get started on a bot
It teaches you how to get started with programming a bot.
do you mean node ?
i typed in cmd too
just create a file called that 🤠
you don't need to type anything in cmd until you wanna run the bot.
sure
Once it’s finished enough
if you want
If the bot is offline/only has 1 feature they’ll reject it
or does not comply with the rules
i have q can i ask it?
uh yea
q=questions
okok
i made a bot on my laptop but its off linr for 30 or more then 30 days
how will i make the bot online again
running the bot?
you need to keep the process that connects to the gateway up
aka you have to run the code and keep it open
what ?????????????//
theoretically you could make the code run as a windows service on startup so you don't have to bother with it but that's advanced right now
i have to keep coding??????????
No
you don't have to keep coding, you have to keep the process that runs the code open
mean?
you should probably backtrack (a lot) and first learn how to code before trying to run a bot
w8 how old r u guys?
18
16
#memes-and-media @near igloo
@near igloo you can host your bot 24/7 if you have a laptop or computer
discord.js better for beginner
yes
14 years old me dont know where to goo im lost😰
i went from discord.io to discord.py
i wanna cry
goldy, id recommend looking up some tutorials and then coming back
@near igloo okay, just dont shitposting here
ok master
if you have a question ask your question
Keep this chat for questions, keep all other things in #memes-and-media
shit posting
well here's some advice, go find a good tutorial, like node js, and if you have questions come and contact us
And that's a mute
He left
meh, telling people what to use as their starting language is generally bad. let the person pick themselves, what seems satisfying to you may seem unsatisfying to someone else
hey discord bot have c++ library?
google is your friend
-_-
Yeah in the future please do your best to see if you can google any of the questions you may have.
most of c++ libs are abandoned or lack a lot of support for new features
if not all actually
To answer, I don’t think so. They’re pretty dead.
F
Is the dm command acceptable if it says who sent the message like: (message) sent by Pablo
?
Yes
As long as it’s clear, yes.
So basically my bot gets a error called
Npm moving to pnpm remame node module from blankety to blankety
mmm
pnpm install (module name here)
I'm going on my computer brb
so if you're using djs do like pnpm install discord.js
If it appears in the dms like Today we have an event going on at 6, be ready sent by Pablo
It's ok?
I just wanna be sure
It needs permissions to be sent so not everyone can do it
Ofc im using discord.js
would do like
From Baron Der Pablo#1627: Today we have an event going on at 6, be ready!
but as long as it's clear the author of the message, it's allowed.
@earnest phoenix your one is fine.
It could even go in the footer if it’s an embed.
What is the #1 bot
As long as you see who it’s from.
There's no #1 bot imo
We can’t say the #1 bot, if you mean in terms of severs or?
Ok
And is it permitted to send a message to all members with a specific role? Like:
From Baron Der Pablo#1627: Be ready players for our game night
if we're speaking in numbers, rythm
Sent to users with a mentioned role
Wait so is it normal for glitch to turn off a bot for a couple hours/minutes and turn it back on
i mean yeah but make sure not to abuse discord api :')
Oh that's why...
@earnest phoenix if a bot isn’t used for 5 minutes it turns off until you re edit it
Ok
You can add a ping or a loophole however.
Enzo - it shuts off if no ping after 5 mins
but if it's on for 12h or more it'll shut off itself
so you'll need an outside ping-er thingy
There are many good ones, uptime robot for examples. Look online or get a host.
loop a function to ping the http address of your project
use increment or setInterval
i got a lil issue uwu, ask now ir when whatever is above is solved though.
ask away ^
where do i put setintervla
no like where in my code
discord.js
My code:
let att = msg.attachments;
if (!att) return msg.channel.send(`:warning: Please upload the banner directly to discord. when using \`${config.prefix}setbanner\``);
let attUrl = att.array()[0].url;```
Error:
```error
TypeError: Cannot read property 'url' of undefined```
veri sad
in a place where the code will run lol
usually main bot file
the error is where i define attUrl
function game1(){
bot.user.setPresence();
setTimeout(game2, 10000);
};
function game2(){
bot.user.setPresence();
setTimeout(game1, 10000);
};
``` example from stackoverflow
after you need to call the function
oh i have setinterval
try .first instead of .array()[0]
in your bot.on('ready' event
const express = require('express');
const app = express();
app.get("/", (request, response) => {
console.log(Date.now() + " Ping Received");
response.sendStatus(200);
});
app.listen(process.env.TOKEN);
setInterval(() => {
http.get(`https://${process.package.url}.glitch.me/`);
}, 280000);
it can be out of ready event too, doesn't really matter
glitch is best lool
that's like saying stale bread is the best type of bread ??
u mean i put teh setinterval() in client.on(ready
// This event will run if the bot starts, and logs in, successfully.
console.log(`Bot has started, with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`);
console.log(`Bot Tag: ${client.user.tag}`)
console.log(` `);
console.log(`Will Now be Logging Commands`);
console.log(`====================================`);
console.log(`Command Logs:`);
console.log(` `);
client.channels.get('586350574057029652').send(`Bot has started, with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`);
client.user.setActivity(`${client.users.size} Users | e@help`, {type: "LISTENING"})
}); ```
@earnest phoenix if(!message.attachments) will always be false, since it's always defined
you want to check if the size is 0 there
message.attachments.size == 0
@earnest phoenix - check if message.attatchments.first is defined
activity loop
function game1(){
bot.user.setPresence();
setTimeout(game2, 10000);
};
function game2(){
bot.user.setPresence();
setTimeout(game1, 10000);
};
why not setInterval?
put that above your client.on('ready'
setpresence is discord py
and then call the function in your events
no
discord.js
setTimeout to change between them
yes
game1 sets a timeout to game2, which sets a timeout back to game1
i wanna have one say listening to client.users.size
or use a boolean and a.. forgot what its called
true ? something : something_else
and watching client.guilds.size
after you need to call the function in your events like setTimeout(game1, 10000);
@earnest phoenix - hi, please refrain from asking to be spoonfed, but you should be a loop function before ready event or within
@iron sentinel json
sujeden: ternary
but the easiest method is to just have an array
(oops)
nope
^
TypeError: Cannot read property 'url' of undefined```
code: ```js
let att = msg.attachments;
if (!att.size == 0) return msg.channel.send(`:warning: Please upload the banner directly to discord. when using \`${config.prefix}setbanner\``);
let attUrl = att.array()[0].url;
no
still wrong
not !
you are doing if(true == 0)
what.
your code is doing this:
if(has attachament) return
exactly
exactly
because you try to read an attachment when there's none
your if statement is wrong
if (!att.size == 0) return 
exactly
you want to stop if there are 0 attachments
oh wait
yes lmao
take away the == 0 and its good
not if the negation of the size is equal to 0
what? @inner jewel
!att.size == 0 means "is the negation of att.size equal to 0"
have a good day :)
my unban command no work
ok so
lib is discord js and lang is javascript
my error is that it not unban user
my code is following
if(!message.guild.member(message.author).hasPermission("BAN_MEMBERS")) return message.reply('You don\'t have permission to do that.');
if(!message.guild.member(bot.user).hasPermission("BAN_MEMBERS")) return message.reply('I don\'t have the permission to do that!');
let user = args[0];
let reason = message.content.split(" ").slice(2).join(" ");
if(!reason) return message.reply("you need to enter a reason");
if (!user) return message.reply ("you need to enter an ID");
let modlog = message.guild.channels.find("name", "bans");
message.guild.unban(user);
const unbanembed = new Discord.RichEmbed()
.setColor(0xd9a744)
.setAuthor('Unbanned ' + user)
.setTimestamp()
.addField("Unban information", '**Unbanned user: **' + user + '\n**Moderator: **' + message.author);
if(modlog) modlog.send(unbanembed)
console.log(`${user} got unbanned by ${message.author.tag} in ${message.channel.name}`)
client.channels.get("586350574057029652").send(`${message.author.tag} Used the "unban" command`);
}```
Show ur full actual error
}
^
SyntaxError: missing ) after argument list
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
Fix it
ohh that was the thing
ok i fixed it
but when i do unban it dont unban the user
oh so now thats the error
(node:8205) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 31 ready listeners added. Use emitter.setMaxListeners() to increase limit
jesus christ
you don't have to create a new handler for each command
do it all in one handler
oh my
Where do people get the idea that you have to create a listener for each command
god knows
I've never seen a tutorial or anything that does that
If you do have errors, it would first recommend if they are frequent to follow a tutorial, as chances are they would be able to assist or you could follow their method which is usually easier and also more people would use it.
@dusky marsh they dont know it any better
Anyone know about this error?
Traceback (most recent call last):
File "c:\Users\qbwvw.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\ptvsd_launcher.py", line 43, in <module>
main(ptvsdArgs)
File "c:\Users\qbwvw.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\lib\python\ptvsd_main_.py", line 434, in main
run()
File "c:\Users\qbwvw.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\lib\python\ptvsd_main_.py", line 296, in run_file
setup_connection()
File "c:\Users\qbwvw.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\lib\python\ptvsd_main_.py", line 284, in setup_connection
if not daemon.wait_for_launch(addr):
File "c:\Users\qbwvw.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\lib\python\ptvsd\runner.py", line 61, in wait_for_launch
_, start_session = self.start_client(addr)
File "c:\Users\qbwvw.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\lib\python\ptvsd\daemon.py", line 217, in start_client
connect(client, addr)
File "c:\Users\qbwvw.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\lib\python\ptvsd\socket.py", line 197, in connect
sock.connect(addr)
TimeoutError: [WinError 10060]
i'm using python and IDE is VS code
TimeoutError: [WinError 10060]
yea.. i don't know how can handle that.
it is just didn't connect with discord bot?
member.ban()
try{
member.send("**Vous avez été banni car vous êtes sur la liste noire du bot pour la raison suivante : __" + motif_msg + "__. Pour plus d'informations, rejoignez ce serveur : **")
} catch(e) {
return
}
} catch(e) {
console.log(`impossible de ban un blacklist.`)
}```
it's say `cannot send message to this user` but i have put an try !?
@inner jewel How can i solve this problem?
It means you can't send a message to that user (DMs closed most likely) and that it has logged the error in the catch block.
ok thx$
it didn't log in the catch
send is async
try-catch is sync
send() returns before the message is sent
so there's no way to catch that error
unless you await it
Mhm.
or use .catch

Yeah @inner jewel xD
I have right to use this : try { member.guild.owner.send("") } catch(e) { }
still won't work
you need to await it or call .catch() on the promise returned by send
^
ok
Also send message before banning
any1 know how can solve this error "TimeoutError: [WinError 10060]" ?
and the message sending/banning is a race condition
it might send the message or it might not
send(...).finally(() => ban())
bot goes online and offline
Is it sending an error or is it just going online and offline and repeat?

i know you already host on glitch
so that in its self is its own problem
but someone should be able to help
I think I know the issue
Go to glitch help center and request new IP
Does it go back online itself? Or does it just randomly go offline
@earnest phoenix How long does the loop take? Does it take 5 mins to go offline?
Honestly don't even know your issue so hard to resolve 
As glitch projects shutdown after 5mins if they are not pinged.
No details provided
And they come online as soon as you open the glitch page associated to it.
But in the future include details.
Cough Uptime Robot does that, it's a free website.
Every 4 mins will suffice but
you asked about this earlier already. You can loop a function to self-ping it using setInterval and a 3rd party ping-er as it'll shut down itself in 12h of continuous running
at Promise (/rbd/pnpm-volume/4479fb6b-4973-4a2c-82ce-7d5fbe829ed0/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/rest/RESTMethods.js:34:54)
at new Promise (<anonymous>)
at RESTMethods.login (/rbd/pnpm-volume/4479fb6b-4973-4a2c-82ce-7d5fbe829ed0/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/rest/RESTMethods.js:33:12)
at Client.login (/rbd/pnpm-volume/4479fb6b-4973-4a2c-82ce-7d5fbe829ed0/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/Client.js:280:30)
at Object.<anonymous> (/app/index.js:584:8)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
(node:20350) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:20350) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
You gave an invalid token
Best bit about Uptime Robot which I use which was recommended on here I believe was that if it detects it's offline it'll ping it until it comes back online or if it can't, it will email you.
Go to Discord Bot Developer Page thingy and grab new token
1500 is way too much
Either: you had a space in your token or what iara said. I would recommend resetting the token and re-doing it as sometimes there is an issue on my side.
tell me ur project doesnt restart everytime you edit the code
ping per 1500ms is way too much i mean
I would ping 600000ms (10min) at the quickest.
so the bot would turn off every 10 minutes
would do it every 4 mins. 1500ms means it pings once every 1.5 seconds which is too quickly.
do setInterval
Or an easier method would be use a third-party method.
with my testing bots I do third-party and internal loops
cuz uptimerobot has been down in the past
Regardless, your token is wrong so generate a new one
True but I mean I host 4 or so bots on Uptime Robot and I have had no complaints of it being down.
Of course have a fail safe ready but.
do setInterval like iara said
replace timeout with interval
Yes
ok
That'll work
Have you sorted out the token issue first? That is more important..
Yes
Ok, so is there another reason why it is contently restarting? Are you editing the code? Have you got it set in the settings that each edit restarts the app?
No
What are you hosting on? Self hosting or possibly on glitch
glitch
Glitch restarts the bot as soon as theres an edit to code
Today
Unless you add a special file
@split hazel You can disable that though, and apparently Enzo has.
I added unban command
Anything else?
And it don't work
Do you have a watch.json file
Is there an error in the code at all?
Not true, my bot wasn't affected.
There's a way to make it not refresh per edit without watch json
Just edit it in settings
Of glitch
Ok
@earnest phoenix could you go into the glitch console and run curl -I https://discordapp.com/api/v7/gateway and tell us what happens
@earnest phoenix When you are on your page, click on the project title at the top, then look at the settings and UNTICK "Refresh App on Changes" see if that helps.
Please update us when you have so we know if we have helped you. 😃
ok gotchu
The command will let us know that your bot isn't on a banned host
@earnest phoenix Worked? 🙂
didnt do it yet
Date: Sat, 22 Jun 2019 18:17:55 GMT
Content-Type: application/json
Content-Length: 35
Connection: keep-alive
Set-Cookie: __cfduid=d0552afd001471c4d92420a08e643bb801561227475; expires=Sun, 21-Jun-20 18:17:55 GMT; path=/; domain=.discordapp.com; HttpOnly
Strict-Transport-Security: max-age=31536000; includeSubDomains
Via: 1.1 google
Alt-Svc: clear
CF-Cache-Status: HIT
Expires: Sat, 22 Jun 2019 18:47:55 GMT
Cache-Control: public, max-age=1800
Accept-Ranges: bytes
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 4eb038c8ce04246c-IAD
That can be excluded, your host isn't banned.
Now try my thing, turning that setting off.
uhh how
Lmao
By doing what I said above Enzo
He said this earlier:
When you are on your page, click on the project title at the top, then look at the settings and UNTICK "Refresh App on Changes" see if that helps.
ok
You guys are doing so good job to keep your mod
That can't be the issue, One of my bots that are on Glitch work fine
So i figured out how to make the bot say from who is the message for the dm command, and it works!
but i still get an error
like this one
(node:11600) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:11600) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
but it works
is confusing
Are you showing the full error?
imma try self hosting it
@earnest phoenix Add this to your bots code above the ready event
client.on('debug', event => console.info(event))
And paste everything that logs onto pastebin or something
I can see a missing )
And send the link here.
the first thing that gets logged is your token, so make sure to hide it before giving us a link
(node:11600) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
at item.request.gen.end (C:\Users\Dany\Desktop\DiscordBot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15)
at then (C:\Users\Dany\Desktop\DiscordBot\node_modules\snekfetch\src\index.js:215:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:11600) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:11600) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
this is it
i got a error
with putting the debug
unexpected token client
client.on('debug', event => console.info(event)
client.on("ready", () => {
it's confusing cuz it works but it still sends an error
You missed an )
What did you define your client as?
After (event).
@earnest phoenix You're running a method towards a message that wasn't resolved
It should be:
client.on('debug', event => console.info(event)) client.on("ready", () => {
client.on('debug', event => console.info(event))
ok
Cough thats why we don't spoonfeed and why you shouldn't copy and paste code and always check it xd.

pfft
I find stuff for py rewrite and redo it for async all the time
I'm used to translating it
writing my own code?????? are you crazy??!?!
No we are not.
I spent some time figuring out how to send the author's username too :P
its still online
You should read the libs docs, it's very useful.
bruh
i know that
@earnest phoenix Did it work then? 😃
@west spoke username
nien
@earnest phoenix You can't do that I think it has to be user prop
no
You can
it is something like this
case 'dm':
if (!message.member.hasPermission("ADMINISTRATOR")) return message.channel.sendMessage('❌ ***Nu ai permisiuni bos*** ❌ ')
msg = message.content.toLowerCase();
if (message.author.bot) return;
if (!args[1]) return message.channel.send('ce? cine? cui?');
mention = message.mentions.users.first();
message.delete();
mentionMessage = `From ${message.author.username}:` + args.join(' ').slice(24);
mention.send(mentionMessage);
message.author.send ('sent!');
break;

if its not in dm you can
and yes, i'm that kind of a noob
member its a guild member
@earnest phoenix Try it? If an error then send it here 😃
No you can't @earnest phoenix
but still sends an error
uwu
permissions don't exist dms and you can't delete other user's message
@earnest phoenix what error
iarapls
(node:11600) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
at item.request.gen.end (C:\Users\Dany\Desktop\DiscordBot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15)
at then (C:\Users\Dany\Desktop\DiscordBot\node_modules\snekfetch\src\index.js:215:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:11600) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:11600) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
You can only do message.member.user.tag xd
its the sameee
If the error isn't useful, you can do some self debugging, like logging 1, 2 etc at each part of code to see where it stops

yeaaaah
Guildmember and user is not the same hon
@earnest phoenix It means there is an unknown message, as Speedy said try sections of the code.
@earnest phoenix This means either the message doesn't exist or you're not fetching from the channel the message was in
@spare goblet yes i'm dumb
iara told me about running a method towards a message that wasn't resolved
You're not 
now excuse y'all i need to get my bots code ready for sharding 🙂
I fixed it guys, I just replaced message.author.username with message.author.tag
:D
Thanks for everything
No problem 😃
I made that mistake once, and usually the tag is a better all-round thing.
twst
Can you guys make noob of the year contest if not it's ok
no and wrong channel
Ok
If i get a guild property via broadcast eval from another shard, can i then use <guild>.members.get(id) without any issues?
(discord.js)
anyone know how to do webhook
For DBL api webhook, move to #topgg-api @earnest phoenix
@earnest phoenix Whatcha mean exactly?
ok
Webhooks
The easiest solution that came to my mind. Send a discord webhook POST request
Easiest would be to use a webhook but its guild channel only, for dms you need a back end
create a webhook for the specific channel, get the url and get a module that allows you to send json data via post and your json data will be "msg": (whatever you wanna send to webhook, but for an embed its a little trickier
and then send the post request to the webhook
Did you create the contact form?
So go to the part where it sends the email
and replace that with the discord webhook post request
const Discord = require("discord.js");
module.exports.run = async (client, message, args) => {
let member1 = currentTeamMembers1[0];
let savoir = message.guild.roles.find(`name`, "Savoir");
if(!savoir) {
try {
savoir = await message.guild.createRole({
name: "Savoir",
color: "#1240cf",
permissions:[]
});
message.guild.channels.forEach(async (channel, id) => {
channel.overwritePermissions(savoir, {});});
}catch(e){console.log(e.stack)}
}
member1.addRole(savoir)
//for(var i = 0; i < currentTeamMembers1.length; i++){member1.member.addRole(savoir)}
}
Error: addRole is not a function
Can u help me?
(currentTeamMembers1 is a global araylist)
<@id>
thats not an object that doesnt have the .addRole function
id suggest filling the array with normal ids (not the <@...>)
and then doing message.guild.members.get(member1).addRole(etc..)
and also passing functions to .find
that too, itll work but eventually its gonna leave deprecation
please don't randomly ping people
im also completely lost what you just said
?
he ask if arabic bot is allowed i think @slim heart
in that case yes they are
i mean yea sure
but they need to have some form of entry for english people via some help command
??

On discord.js is there a way to see if a specific shard is online?
?
you can broadcastEval, reconnecting/disconnected ws props
i mean for reading the docs
aha! client.status
Did the DBL API change?
My bots count no longer updates....
Like.... 4+ days?
no. has it taken that long?
hm, so its been those 4 days
Not sure if 4 days...
More a week apparently
Sharding wouldn't be the issue right?
I use a Java wrapper and only provide the total count
shouldnt be? did u shard when this happened?
because you can supply shard and server count
via [shard0servercount, shard1servercount, etc.]
yeah
But right now I have a seperate issue where the bot only performs an update once and then just.... dies
(go ahead and supply your stuff, someone else should come by and help, i gtg and eat sorry :p)
Anyone here
if you have a question its better to just ask and wait for someone to help
does anyone know how i can get my bot online, cause i did node . but id didnt send back anything
nvm it wroked
congrats

you can but depending on how you use it it can be p broke
Its allowed
I use it, others use it
<iframe src="http://neko-bot.net">

Mine?
Tbh my webpage isnt comete
No
It's a webkit animation
Movements
just moves the image around
Wdym
hmmm
hmm?
hey guy's i'm trying to run a simple java program with vsc, but I get the following error:
Error: Could not find or load main class .\HelloWorld
and here's the code:
class HelloWorld
{
public static void main(String args[])
{
System.out.println("Hello, World");
}
}
these are the commands I run to run my java program:
javac HelloWorld.java; and
java HelloWorld
anyway to correct my configuration? does this have anything to do with my operating system
i just downloaded the latest updates from the java site... maybe i need to download the JDK too?
i ran the same commands and it's working just fine
Cant answer that tbh, I dont use vsc for java
i really like working with python, but recently i've been interested to develop skills in java/c++ recently
i'm downloading the latest JDK
let's see if this helps
has anyone worked with x86 assembler
must be something to do with my OS. i'll download the latest JDK and update you guys...
if you want you can try developing java apps on intellij
intellij helped me a lot in my developing process
nah the update didn't help 😦 i'm very used to VSC and i love its hotkeys is there anyway i can make it work with VSC...
actually it doesn't even work on PowerShell lol
Im not sure why if thats the case then. goumen 
usually intelli j detects stuff that went wrong
library?
?
yes
guilds have a roles property
which returns all roles
Those roles have a calculatedPosition
Don't know if the highest or the lowest would be 0
Go test stuff with it
so just grab the guildMember object, grab roles of them and find the highest for the position 
sorry hon we can't spoonfeed you. but basically you'll have to insert a guildMember object, and one of the properties are roles (i.e. guildMember.roles) and then filter the role with highest number by position
For reference: https://discord.js.org/#/docs/main/stable/class/GuildMember
C++ library?
There aren't any libs for discord really maintained for c++ from my knowledge
uh idk. most people use js or py
ik
@digital sparrow https://github.com/yourWaifu/sleepy-discord Maby this one?
ok so i ran the same java program on my desktop and it works fine!
but on my laptop, it doesn't
i have no idea why...
error?
so on my laptop, i'm trying to run a simple HelloWorld.java program and it reads error! cannot find main method to run the program
but on my desktop, that same program works fine with no errors
Hi, I can create two guildMemberAdd events ?
Yeah you can but I don't suggest it?
why ?
you can always put more than one listener for something :') but it's not recommended cuz it creates messy code
But if Not, can I?
As I said beforehand, it's possible, but it's not recommended personally
ok
You can always just put a function under the current ones in your already created event listener
Why would you want to create two?
To have an event with message otherwise I lost a little
lost what?
I'm losing my sense of code, etc.
Ok - best practice here: create one event for each single event you wanna listen for. Run the functions within those event listeners, if you need to, write them outside the file and just declare then call it.
but this not fonctionnaly :
if(!db.get("raid_mode").find({ serveur : server }).value()) {
return
} else {
try {
member.kick()
try {
member.send("**test**")
} catch(e) {
return
}
} catch(e) {
return
}
}
@cunning oxide
no need to ping, they're already replying
i'm not sure what it's doing, lowkey
are you getting an error ?
Ya my guy that code will never work lol
no
yes
ça va :3
Sorry, I’ve been on planes for 20 hours
Ah ui xD
all those try, catches... i'm out 
😂
other languages in #memes-and-media thanks ~
i love catch xD
okay first of all, what the fuck is that code
second, thats not how you catch promises
i love French! 😃
i feel like you were told that at least 3 times yesterday
@mossy vine said it, not me!
#memes-and-media please @earnest spear
eh, some people just never listen
#development is for asking questions about development
I'll be fine.
i did ask a question about development above
Joris, this is #development, not #memes-and-media. Last warning
and talking about development, not languages 
about the java programming
@earnest spear chut
just resolve the promise Vinx
you could also try the ES6 async and await for promise handling
instead of using .then etc. but both work!!
in async
in that case use async/await
Mhm.
quick q, can you do js .catch().then()
basically what i'm doing is checking if the invite is valid
let invite = bot.fetchInvite(obj.pinv).catch(() => {
return msg.channel.send(':no_entry: Your invite is invalid.');
});```
and if its not valid it throws an error
and if its valid it does coder below
ugh stupid question
cuz it finds the invite only after it executes the code below, aka it doesn't look iftheres an error instantly
i think promises let you do that
i think so
if the promise fails it will do the catch callback, if it resolves it will do the then callback
var p1 = new Promise(function(resolve, reject) {
resolve('Success');
});
p1.then(function(value) {
console.log(value); // "Success!"
throw new Error('oh, no!');
}).catch(function(e) {
console.log(e.message); // "oh, no!"
}).then(function(){
console.log('after a catch the chain is restored');
}, function () {
console.log('Not fired due to the catch');
});
// The following behaves the same as above
p1.then(function(value) {
console.log(value); // "Success!"
return Promise.reject('oh, no!');
}).catch(function(e) {
console.log(e); // "oh, no!"
}).then(function(){
console.log('after a catch the chain is restored');
}, function () {
console.log('Not fired due to the catch');
});```
actually can you chain them like that


lemme try it out
im confused about that as well, lemme get the docs
uh ok
p.then(onFulfilled[, onRejected]);
p.then((value) => {
// fulfillment
}, (reason) => {
// rejection
});```
OH
SO THATS HOW IT DOES THAT
lemme make an example
does that mean js .catch().then(catch has no error, catch has error)?
one sec, im trying out something
ok
ah i see
p = new Promise((resolve, reject) => {
resolve('e')
})
p.then(res => {
console.log(`Resolved with: ${res}`)
}, rej => {
console.log(`Rejected with: ${rej}`)
})
the res callback is triggered if the promise is resolved, the rej callback is triggered if the promise is rejected
yeah what
the code above is the same as this
p = new Promise((resolve, reject) => {
reject('e')
})
p.then(res => {
console.log(`Resolved with: ${res}`)
}).catch(rej => {
console.log(`Rejected with ${rej}`)
})
if you were to use .catch().then(), it would execute the then block IF the catch fires AS WELL
which is pretty useless
as you can just put the code in the .catch() anyways
and that is why both of your responses fired in your original code
in the example .then().catch() would the catch callback only fire if the then callback throws an error?
lemme try it out
and i was right, if you do .then().catch() then the catch block will execute if the promise rejects OR then block throws error
it doesnt matter the order, .then().catch() is same as .catch().then() i think 👀 oop i'm wrong apparently o-o
i see 👀
if you want to do thing a if promise resolves and thing b if promise rejects, then .then() with 2 callbacks seems to be the best option
When will my bot get aproval??
takes about a week
you added your bot 3 minutes ago
wait AT LEAST 7 days before asking again
Is it possible to manually move a server to another shard?
no
if you have a question just ask it
yeetask2ask
By asking if you can ask a question, you have already asked a question so simply just ask the actual question. State exactly what the problem is so someone can help you as soon as possible.
yea please
i have this
2019-06-23T09:21:03.398697+00:00 heroku[web.1]: State changed from starting to crashed
2019-06-23T09:21:03.236796+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2019-06-23T09:21:03.236849+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-06-23T09:21:03.374571+00:00 heroku[web.1]: Process exited with status 137
what it mean
okay first of all, you are using deprecated things
second, is there any other error that isnt you using a function in a deprecated way?
no
did you trying search the error on google "heroku web process failed to bind to $PORT within 60 seconds of launch"?
how do I setup shards for my bot?
@bleak vortex are you using discord.js?
yes'
A guide made by the community of discord.js for its users.
¨thanks
anyone now why when I playFile(), my .mp3 file not fully playing? I mean like 90% of full length.
its like the sound fading out at the end. and theres no error. im using discord.js btw
Code?
oof
Please provide as much information as possible to get the most efficient assistance as soon as possible; state the library, language, the specific part of the code in question, and what you are trying to do and/or what you think may be causing the error.
Code, and what you think the error is.
Is there a return that could of tripped? Is there an error? Is there a timer?
Probably is if it cuts out at the same place all the times
const dispatcher = connection.playFile(`./soundboard/${sound}.mp3` , { volume: 0.5, passes: 3 });
What about more of the code?
var sound = args[0];
if (!vc)
return message.channel.send(`**${message.author.username}, you have to be in voice channel to use this command.**`);
const connection = await vc.join();
const dispatcher = connection.playFile(`./soundboard/${sound}.mp3` , {
volume: 0.5,
passes: 3
});```
Is there anything below that?
no, just that
Is the file all correct?
and this error when the sound is playing
(node:8013) [DEP0112] DeprecationWarning: Socket.prototype._handle is deprecated
file is correct, sounds playing
but not full length
Like is there an error in the code somewhere else that could make it restart?
I got to quickly go for lunch, I will be back in 15-20 minutes otherwise someone else could help you here.
readdir(cmdPath, (err, files) => {
if (err) console.error(err);
files.forEach(cmd => {
const command = new (require(`../commands/${cmd}`))(this);
this.commands.set(command.info.name, command);
command.info.aliases.forEach(al => this.aliases.set(al, command.info.name));
});
});
How does the Command class look like
module.exports = class Command {
constructor (client, options) {
this.client = client;
this.cooldown = new Set();
this.info = {
name: options.name || undefined,
aliases: options.aliases || [],
description: options.description || "No description specified!",
usage: options.usage || "",
category: options.category || "general",
requirements: {
cooldown: options.cooldown || null,
userPerm: options.userPerm || "SEND_MESSAGES",
clientPerm: options.clientPerm || "SEND_MESSAGES",
guildOnly: options.guildOnly || false,
}
}
}
startCooldown (user) {
this.cooldown.add(user);
setTimeout(() => {
this.cooldown.delete(user);
}, this.info.cooldown);
}
}
Hii
👀
What did I just see?
Who keeps posting a bit of code and deleting.
You can edit it right? @tribal violet
@frail ocean how can i send coloured message?
hii
You do 3 "" and then a JS on the first line after the 3 ""s
constructor (client, options) {
this.client = client;
this.cooldown = new Set();
this.info = {
name: options.name || undefined,
aliases: options.aliases || [],
description: options.description || "No description specified!",
usage: options.usage || "",
category: options.category || "general",
requirements: {
cooldown: options.cooldown || null,
userPerm: options.userPerm || "SEND_MESSAGES",
clientPerm: options.clientPerm || "SEND_MESSAGES",
guildOnly: options.guildOnly || false,
}
}
}
startCooldown (user) {
this.cooldown.add(user);
setTimeout(() => {
this.cooldown.delete(user);
}, this.info.cooldown);
}
}```
but no colour is coming
No problem. 😃
Only works for JS code tho.
ohh
Bro
Can you join my server and do some help for my bot
@frail ocean My Bot is not working
You can ask for help here!
Please provide as much information as possible to get the most efficient assistance as soon as possible; state the library, language, the specific part of the code in question, and what you are trying to do and/or what you think may be causing the error.
@frail ocean Can you help me
Read the embed ^
State the issues here.
Use the documentations online and tutorials but we don't spoonfeed (rule 7a)
ohh
if (!message.member.hasPermission("MANAGE_CHANNELS") || message.author.id !== '282504799897780225')
but when i use command it says that i dont have perms to do it
your code is saying:
if the member who is typing the command doesn't have manage channels or their user id isn't 282504799897780225, then ...
whats the function it runs after ?
i need to check
if user not have MANAGE_CHANNELS perms and he/she is not me
send message => no perms to do it
then it should be &&
You have to use && cuz unless both those permissions are true it won’t work
not ||
oh
|| means or
&& means and
no
what ?
How can i do the Streaming Status for my Bot? Its Not working for me
You need to provide a legitimate streaming link

@slim heart Ok
Please don’t do random pings and social conversation go to #memes-and-media
@stray garnet You using discord.js?
Yes @split hazel
client.user.setActivity(`some status text after streaming`, { type: 'STREAMING' }); @stray garnet
Optionally, if you wish to have your bots streaming status to have a link to a legitemate stream, include one in the url property
@split hazel All of them have to have legitimate stream or else it won't work 👀
^^
I’m dming you and you’re ignoring me but
@stray garnet we apologize for the mix up, disregard this sorry. You have to use the url option in order for it to register as Streaming ...
Optional
It's not optional, trust me
(not for streaming its not)
SPEEDY stop arguing here, go to my DMs
speedy why does tht embed look so good
@amber fractal shh, we already solved this, url is required periodt
I probably have a little older d.js version
the url needs to be a twitch url, d.js probably sets the url to twitch's url internally by default
how can i do a command for Staff only?
Someone is using Discordgo Library and knows if they rate limit calls for changing the status?
ratelimits are dynamic, they don't have a specific value
and there's a ratelimit for everything
@west spoke Wrong channel bud
Nah


