#development
1 messages · Page 523 of 1
being a noob is no excuse for you to make ur bot try to mention everyone in every server (and probably break tos) lol
?
lmao
try this:
C:\Python36\python.exe C:\Users\Username\Desktop\your_bot.py
using cmd or powershell (cli = cmd) (same shit)
how do you find permissions for your bot in a channel in eris
i've tried this
!ctx.channel.permissionOverwrites.find(p => p.id == ctx.me.id).has('createInvite')``` but it just says
```TypeError: Cannot read property 'has' of undefined```
@bright spear it’s not against T.O.S. and what’s wrong with that
@sick cloud depends, not all channel have that property
you'll have to check the instance type
i had a look and it doesnt have permission overrides for my bot, so thats where thats wrong
so uh
how would i add a fallback?
since the bot needs to create invites, and i dunno how to do perms right tbh
in the find fn, I'd include a check for .type as well
hm ok
i tried doing it for the guild perms and that failed
lol
alright i got it
had to do that

it worked tho
brokecord
kek
it happens in my bot
@sick cloud https://i.imgur.com/IkJa8YE.png
Here's the best way to check
then just do a bit flag & to check

oh
usually that does it
but I'd do the channel check and then check for roles as well
if channel flag doesn't exist, check role permissions
if either pass, you can try to create invite, if neither pass, it's prob safe to say that it can't
discord permission in a nut shell
@sick cloud You can always do try catch, that always works
@keen drift hello yes what is |=
netflix api
let's see
@sick cloud what do you need from netflix api
oh
Plus the only thing you can do with that for discord is looking the title up, you can't play that, unless you figure out how to make it share screens in a dm, it's not much things you can do with it
okay
Yes, this will take you a long time to create, or simply destroy your bot(what I mean is going to have a ton and a ton of errors)
Lol
*
k e k
Which API is it for?
That might be decrepited, it was create in December 2015 about 3 years ago, so I wouldn't be surprised if it doesn't work
Its best to say that it will take you ages to create a command like what your asking, not that you can't do it, I know you can do it, but it's your resources that will stop you.
i've seen others doing it
Have you check when they were last updated?
nope
You might want to see if you can
@sick cloud I was able to replicate the request: https://i.imgur.com/JbwKywa.png
The request only needs NetflixId cookie
i need to look into the query structure, but this seems doable
So it's not decrepit?
it's not hard to use, yes
Ok
I can prob automatically obtain the session, I'll just have to look at the login endpoint now
What kind of ide is that fishy?
What would be an easy way to make like a kind of soft restart thing so it starts up another bot process and waits for it to log in and then shuts down the first one so there's no realizable downtime
User not found
@sick cloud https://pastebin.com/DKC1K8Z0 if you want to look at the struct
are you asking about like in hosting terms or in the bot code @slim heart
Much the structure can be compacted
I mean I'd like to integrate it with the bot code so I can run a command to do it
But yeah I guess in terms of actually running the bot yes
what lang are you doing?
js
ok, give me a second
so, do you want it to be a full one restart the bot, or reload/restart the commands?
just a full restart the bot
But I dont want it to just stop and run again
I want it to run a whole other process of the bot, wait till the bot connects and then shut down the first one
so it's seamless
ummm
cuz like i can obviously do it manually
yes
but i wanna add it as like a command
i know i am not supposed to promote servers, but if you want a server that is mainly based on discord.js, i can give an invite link, i know there are a few guys there that would be more help than me
the actual official djs server lol?
halp halp halp galp galp I need help
no
if (command === 'suggest') {
let title = args[0]
let suggestion = args.slice(1).join(" ")
let r = new Discord.RichEmbed()
.addField(`${title}`, `${suggestion}`)
.addField('From:', `${message.author.username}`)
.addBlankField(true)
Client.guilds.get('459515118254817281').channels.get('514234126493286420').send({r});
``` doesnt seem to work
its like a youtuber server
@empty owl args is an array
@slim heart you can use child_process to start the main file
?
and exit the current process
change args[0] to args[1]
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();```
nvrm by b
o ok
I should use intellijs built in http thing
that should be args[0]
*golanda
what exactly isnt working
*golands
btw
doesnt seem to work doesnt help
also shouldnt it be args[1]
@empty owl you don't have to do Client.guilds.get('459515118254817281').channels.get('514234126493286420').send({r});
oh ok
?
you can just do client.channels.get("514234126493286420")
is there any errors in the console?
do
really?
yea
args.join(" ").slice(1)
ok
Client.guilds.get('459515118254817281').channels.get('514234126493286420').send({r});
bot has access to channels.
@knotty steeple yeah that's kind of what I want but the problem is I want to wait until the new process logs into discord
then stop proc1
Cooper samurai and jpb soved it
Yeah but I want to wait for the new one to log into discord, THEN stop the first
or do let suggestEmbed = new Discord.RichEmbed(){ ....... Client.guilds.get('459515118254817281`).channel.get(`514234126493286420').send(suggestEmbed);
you think I could make a data file that just tells it when i restart that the bot is off and then when it readies it sets it on and then when it's on the first process stops
maybe when it starts you can make it send a message to a channel and if it gets a message from that channel then stop the process but 
you can check for last message right?
so like .. bot process ............... / ⬇️soft-restart ordered master_ <-------- ................\ new process (newly spawned) ..........................⬆️emits ws event on ready
when the ws event is recieved by the master one it kills og process
also my ghetto diagram is amazing fight me
it is quite amazing but still kind of confused how I'd actually do that
lmao
On the new process, via IPC emit to the controller, then controller will kill the old
whats a ipc
i could like post the PID as something somewhere idk and then it'd read it on ready and kill that process
Inter-process communication
yeah
i just got my clip stuck inside another clip
a n y w a y s
wait but what do if the bot actually crashes then it wont write any pid file sks
o
well
You could have a slave-master heartbeat interval
and start a new slave if that interval is interupted
i mean if u start two different instances of the bot it just runs them
hm
[discord.js]
"DiscordAPIError: Missing Permissions"
Trying to kick & ban members, checking if user has permission before attempting, still doesn't work```
bot doesnt have those perms
It means your bot doesn't have perms
Check if it has perms and then reply to their message if the bot doesn't have the permission to do so
Does the adminisrator role have the administrator permission lol
some random kid as a test. no admin.
let me see the code?
one sec
Ummm, ok what's up?
sure
OMIIIWAII EDOTESSTI I need help with the voting thing
Anyone willing to help me?
aNYONE?
okay and
if (cooldown.has(message.author.id)){
message.delete();
let d = new Discord.RichEmbed()
.setTitle('You cannot use this command for another 5 seconds.')
.setDescription('To bypass, please vote here', 'https://discordbots.org/bot/510276597987934210/vote')
return message.channel.send({embed: d})
}
if (!message.author.hasVoted === true) {
cooldown.add(message.author.id);
}```
but its not working
What specifically isn't working
the whole cooldown part
Is cooldown a set?
yes
Is it persistent
const cooldown = new Set();
const cdsec = 5;
ok
ok
people can see ur .env files iirc
lol
thats horrible
im highlighting the reg thing
so
im not finished
bob i think i have an idea for you
that code is just horrendous
o
I don't even
go to line 78 @wanton walrus
i'm not able to even understand half of that
yeah mostly
no
to learn
clearly you've learnt nothing
@mighty sky ez on the code images 
ok
that what i typed
i was doing the whole thing bc i have no clue what the hell, im doing
um @wanton walrus @west raptor the problem is on 78
of index.js
shut
@empty owl stop pinging kirb
ok
r u on my code?
no
ok
@earnest phoenix
why the ping
so noones going to help me eh?
r00d
love how you all use guides
@carmine berry
🤦
I just store the users last interaction time and run a cached db query to check
same
Pretty speedy and makes selfbot detection a breeze
ok
so uh, how do i parse a buffer into json
i tried using my modules parser but it errors
ask it nicely
._.
@sick cloud hhhhhhhhhhhhhuuhhhhhhhhh
it worked smoothly: https://i.imgur.com/WlSXDVY.png
hey so i'm making my bot in d.js and i was wondering how i'd do an eval command
@earnest phoenix ```js
bot.on("message", message => {
const args = message.content.split(" ").slice(1);
function clean(text) {
if (typeof(text) === "string")
return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
else
return text;
}
if (message.content.startsWith(stuff.prefix + "eval")) {
const botowner = bot.users.get("142408079177285632")
if (message.author != botowner) {
message.reply("You do not have permission to run this command!")
return;
}
try {
const code = args.join(" ");
let evaled = eval(code);
if (typeof evaled !== "string")
evaled = require("util").inspect(evaled);
message.channel.send(clean(evaled), {
code: "xl"
});
} catch (err) {
message.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
}
}
});```
change settings accordingly
such as stuff.prefix and botowner's id
and bot

lmao
how i draft up website layouts is also pretty meme worthy
i draft up applications and websites in ms paint
like heres one where this guy wanted an iframed web app with some additional functions to run as an application on their pc
release vs draft
lol
i draft everything in ms paint
its wounderful
Qq - I got a stupid Nginx thing that's supposed to lose the .php extensions. Problem is, it's not showing index.php. Anyone help? ;;
node sockets express > nginx php
Thanks, that really helps. Now, for an actual answer?
are they standard .php or with diffrent extentions
ive known people to do that
@keen drift I need help
With one part
They're standard php
Sorry for ping
try using this in your websites nginx settings
I want my nginx make display all url's clean.
http://www.mydomain.com/indexhtml.html as http://www.mydomain.com/indexhtml
http://www.mydomain.com/indexphp.php as http://www.mydomain.com/indexphp...
location / {
try_files $uri $uri.html $uri/ @extensionless-php;
index index.html index.htm index.php;
}
location ~ \.php$ {
try_files $uri =404;
}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
..i did..
and you restarted the nginx service?
No, I haven't been restarting my Nginx service every time I left nano while also running nginx -t.
try restarting nginx service manually
That's what I've been doing. -.-
oh i thought you said you hadnt
Sarcasm.
the fuck
thought you were meming me
there's like 10k other people
Reaction role
Boi
ya im not amazing with php so im out of solutions
XD
whenever i had hid the extention
i had just used that stack
but if it isnt working for you dunno
what you need help for in php
mind showing that file
nginx log?
108.162.241.211 - - [20/Nov/2018:04:35:19 +0000] "GET /game/ HTTP/1.1" 404 143 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"
108.162.241.211 - - [20/Nov/2018:04:35:20 +0000] "GET /game/ HTTP/1.1" 404 143 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"
108.162.241.199 - - [20/Nov/2018:04:44:04 +0000] "GET /game/ HTTP/1.1" 404 143 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"
108.162.241.157 - - [20/Nov/2018:04:44:04 +0000] "GET /favicon.ico HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"```
(Cloudflare IPs)
Yes, because you live in Cloudflare.
Can you describe what you are trying to do
me?
no
Told you, it's cloudflare
Drop the .php extensions, @keen drift
LOL
Do you want it to base back to an index?
If there are no returns, mhm
location / {
try_files $uri $uri.html $uri/ @extensionless-php;
index index.html index.htm index.php;
}
perhaps
woah u just d doxed urself
who me
ya
dw
Can't do that, @keen drift. It has to be /game
then use /game
ofc i am
Wrong.
wow big if true
If I don't include the try_files, then it'll direct correctly.
bare doxing
...
I want my nginx make display all url's clean.
http://www.mydomain.com/indexhtml.html as http://www.mydomain.com/indexhtml
http://www.mydomain.com/indexphp.php as http://www.mydomain.com/indexphp...
replace first block with /game
You're telling me to turn on and off my computer again when I already did that 17 times
wow toxic
No, it's a perfect response to something that's been suggested over and over again.
t
x i c
I don't have time for this
i mean
i use nginx
i google when i run into walls and solve issues through that
🤷
Really
ya
Because I think I recall googling my issues before talking to anyone.
that sucks that ur running into the problem ur facing
it's in the nginx config
nice
please keep this channel to development only discussion!!!!!
You did start it.
woot finished the frontpage of the new app! :D
m.reactions.find(r => r.emoji.name == '⬅' && r.users.find(u => u.id == msg.author.id)).delete()
``` is this like incorrect or something
my bot doesnt work when i try to use it
define doesn't work
S
@hollow fulcrum Please refrain from the shitposty comments that are unnecessary here
@sick cloud also I'm not sure if you can check .find result like that
it doesn't return a bool
perhaps use .some?
that's my first notice
breaks?
like it doesnt work with some
oh
at m.awaitReactions.then (C:\Users\ThatTonybo\Desktop\reaction-help\bot.js:20:106)
at process._tickCallback (internal/process/next_tick.js:68:7)```
delete isnt a function
hm
yeah, v12
so
also .users isn't cached
so you'll need additional step
m.reactions.find(r => r.emoji.name == '⬅' && r.users.some(u => u.id == msg.author.id)).users.get(msg.author.id).remove()
i cache already
so thats fine
you cached already?
yep
you ran .users.fetch()?
yeah
also TypeError: m.reactions.find(...).users.get(...).remove is not a function remove doesnt work
remove(user)
oh
yeah
oh wait
lol missing perms
one thing tho, i dunno why but it listens to message react remove too
i just want it to listen to add
you can block that in the client options
to ignore that event
if you don't use it
but that may cause reactions cache to be unsynced
so i'd leave it on
yeah, i don't wanna do that
also that wouldn't work i dont think
its awaitReactions @keen drift
👀
O I never done awaitreaction
I'm guessing it's a wrapper
But yeah my bot doesn't use that
async with .then
I dont think thats a good idea
unless you have the reason to do so
@sinful lotus I did not understand yet, are u a female or a male? or just an hentai girl.
wow.
Girls don't exist on the Internet
poofs away
@lofty hamlet ask your question
dont ping random people
uwu
Exue me
fonction.channellogs(message)
let xoargs = message.content.split(" ").slice(1);
let xo03 = xoargs.join(" ")
if (!xo03) return message.reply(':Croix: **Tu as oublié(e) le Pokémon après la commande** :Croix:')
if (Dresseur.SacH.content(xo03`)) {
var embedGlobal = new Discord.RichEmbed()
.setColor(embedcolor)
.setTitle("Companion définis avec succès")
.setThumbnail(message.author.displayAvatarURL)
.addField("Companion : ", xo03)
.setFooter(bot.user.username + " - by Nebulus")
.setTimestamp()
message.channel.send(embedGlobal)
}
else {
message.channel.send(`Tu n'as pas ce Pokémon dans ton PC trouve le et ensuite refait la commande !`)
}
}```
This code not work
Can you help me ?
Dresseur.SacH is a jo
what's the error
fix it so it becomes a function
Its a property
No way to do what I did?
Not a function
Just remove the () after it
A property is a value
So to compare you do value == "this"
what are you even trying to achieve?
discord.js docs says .content is not a function but a property
Basically I want that when it happens in the folder.json the trainer there's this pokemon bah it's the rest
Well i gtg
Exuse me i fench ...
yes that doesnt matter if you are french but we could not help you properly if we cannot understand what you are trying to say
Ok so :
I want that when I make the order if the bag of the Trainer therefore: Trainer.StyleH / Contains the xo03
Said: Yes you have this pokemon or you have not
You understand ?
i dont
is dresseur.sach an array?
What do you not understand?
if yes, then if(dresseur.sach.includes(value))
if dresseur.sach is an object, then if(dresseur.sach[value])
Dresseur.Sac
so dresseur.sac.includes(value)
but its an object isnt it
also, you need to normalize capitals
fonction.channellogs(message)
let xoargs = message.content.split(" ").slice(1);
let xo03 = xoargs.join(" ")
if (!xo03) return message.reply(':Croix: **Tu as oublié(e) le Pokémon après la commande** :Croix:')
if (Dresseur.SacH.content == xo03) {
var embedGlobal = new Discord.RichEmbed()
.setColor(embedcolor)
.setTitle("Companion définis avec succès")
.setThumbnail(message.author.displayAvatarURL)
.addField("Companion : ", xo03)
.setFooter(bot.user.username + " - by Nebulus")
.setTimestamp()
message.channel.send(embedGlobal)
}
else {
message.channel.send(`Tu n'as pas ce Pokémon dans ton PC trouve le et ensuite refait la commande !`)
}
}```
You can edit my code and then explain to me because I do not understand anything: '( Plz ?
Ok but look my code you understand what I want ?
i told you, Dresseur.SacH.includes(xo03)
Hu ?
You can edit my code and then explain to me because I do not understand anything: '( Plz ?
no
that is what you call
spoonfeed
Can you guys help me how to make an array of guilds?
wym
you should stay away from making advanced bots yet, if you cannot understand a simple property and function
who downloads screenshots
no one
exactly
nvm that my head meme
Intresting...
Dresseur.SacH // ["pokemon1","pokemon2","etc..."]
Dresseur.SacH.content // undefined
Dresseur.SacH.content == xo03 // always false
Dresseur.SacH.includes("pokemon1") // true
Dresseur.SacH.includes(xo03) // true if xo03 is a pokemon that exists in Dresseur.SacH
understand?
What are you asking me?
Yes
I set you line
Look screenshot
But waves appared i don't understand
ur missing () around it
😂
Bruh exuse me
I test this code
I have the pokemon Chlorobule in my sac but isn't work
we are trying to help you here
Does myClient.channels.array().sort() gives me the about of channel?
if you said you tested it, why dont you do it your own. I mean they are already trying to help you
I go eat i come back
why do you need an array of channels
I’m just asking, since i’m trying to make an array of guild names, channels, and members
Ah, thanks
do console.log(Dresseur.Sac,xo03)
Where ?
right before the if(Dresseur...)
yeah it should @_@
do console.log(Dresseur.Sac.includes(xo03))
What does “dresseur” mean
same place
Ok
Are you checking if Dresseur has a certain item
Dresseur.Sac is an array that contains the pokemons he owns
He say : True:') @quartz kindle
Ah
Got it
explaining to fiq lol
Just the console say true
Not really advanced at cs
the code for SETC2
I try both
yeah but SETC2 is cut
It's code is equal
The same?
is that JS?
yes
ok so this makes no sense, the console.log returns true, but the if doesnt?
Yes 😦
Is he supposed to write a hexcolor or just “RANDOM”
He make no sense
did you define Embedcolor?
It's nothing
Then what is the problem
if his bot is sending the message in the else part, then the if is not working
There’s a problem in the if part
Is it supposed to be fonction
just delete everything and do js if(Dresseur.Sac.includes(xo03)) { console.log(true) } else { console.log(false) }
Ok
lmao
Lol

maybe its function in french
Oh nvrm
It’s there again
It’s right but why fonction lol
Why not just use client as a function store kthnx
Also, do you need to use message.author.displayAvatarURL or message.author.avatarURL
...or both
Just avatarURL
But it's not the probleme here
I usually used .avatarURL, not sure about .displayAvatarURL
................................................................................
Thats the error
No it works
But is not the problem !
Huh

.displayAvatarURL is a thing a p p a r e n t l y
lmao
I say is not the problem
It is
Ohohohoh
he already deleted everything anyway
Lol
Oops
Lol
i have no idea why xo03 is undefined
^
😂
Where did he define xo03
Sksksksks
I must go back to class to resume this code tonight: ')
me
Goodbye See you tonight
bye
i think i need glasses
S a m e
@earnest phoenix @slim heart avatarURL will only work if the user set an avatar but displayAvatarURL will show the default avatar the user has if they haven't set one
Oh thanks :)
Yw
Anyone see this before
Remote Desktop within Remote Desktop
Those are both my vps
VMs
XD
First one you see on phone is
Intel Xeon 2vcpu 8gb of ddr3-4 memory Disk: 120gb of SSD storage Network: 1 Gigabits Upload and download
Second Intel Xeon 4vcpus 16gb ram Storage 1tb of SSD storage Network: 2 gigabits upload and download speed
To run my discord bot of off
And I get it for free
LOL
my upgrade
xD
im using discord.js and im having this error happen and i dont know what to do ```if (!msg.member.roles.includes(role18P)) {
^
TypeError: msg.member.roles.includes is not a function```
Is msg defined as ur message?
its defined with the client.on
if (msg.content.toLowerCase().startsWith(config.prefix+'role')) {
const role18S = msg.guild.roles.find(role => role.name === "Bosses");
const role18P = msg.guild.roles.find(role => role.name === "18+ Bosses");
var cmd = config.prefix+'role ';
const args = msg.content.slice(config.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
if (["add","remove","list"].includes(args[0])) {
if (args[0] === "add") {
if (msg.content === '<>role add') {
return msg.channel.send('Please specify what role you want added. For more information say `<>role list`');
}
if (args[1] === '18+') {
if (role18P === null) {
return msg.channel.send(':thinking: thats weird. Please Notify Serabus About this issue.');
}
if (!msg.member.roles.includes(role18P)) {```
Nice lol
it works now thanks.
Np
rtfd
i guess
I think they think member.roles is an array
okay so im looking into the Eris lib and i dont really understand what a "Bucket" is can someone explain
or rather, how it works and what its used for
yes but like, what would it be used for?
O o f
in js if an object property is null i can check for it with if(!object.property) console.log("tis not exist") right?
sounds more like lua to me
Can you store the whole message object in MongoDB with mongoose, so like: new Schema({ msgObj: Object });
You could get out circular refs by filtering by type
It'd be really good if it's possible but ok
techically, you could turn the object to JSON, then parse it back to a javascript object\
well i guess storing only message content, date and user id is just fine for a snipe command
1st its better
no i did not read
Microsoft Azure
^
how
Azure hardware for the price isn't the best.
eh
depends
Microsoft is a big name company: they can charge pretty much whatever they want, and people will still buy them
So they don't stree about the hardware they give people
The hardware's amazing for the price for the vm i have
im sharing my vps vm with another dev
check this out: https://www.vpsbenchmarks.com/compare/azure_vs_vultr
This is how azure goes toe-to-to with a more affordable Vultr
They trade blows sure, but the margins aren't impressive enough
wait dude what plan do you think i have
XD
2gb
you think i have 1 core and 2gb of ram
XD
you dont need 16gb for a 12 guild bot
Dude i use it for not just hosting my bot
oh what else your 60 websites?
oml
XD
no
- I plan for the future 2nd. I use it for other stuff other than Discord bots like my backup for all my shit and for hosting other applications that i do @knotty steeple
and i share it with my friend also another developer
you can store backups somewhere else like a usb
well i prefer to have an online backup and a backup on my external hdd i have
and thats not an excuse since backups dont use ram
oh my
and your very welcome for the ip
can you not literally run vsc on your pc and transfer the code 
omg ffs. No i cannot i do not have my laptop and desktop on all the time neither do i have internet i am on the go alot so i have data LTE Hotspot
<style>
.votebutton btn btn-orange btn-2x {
background-color: red
}
</style>```
i want to change vote button color\
So i went with microsoft azure
Now lets drop this
ignorance is bliss
do you even know what ignorant means
Yes but your being annoying cause you don’t get why I have 16gb of ram and Intel Xeon v4
doesnt look like you know what it means
Just tell me what’s your problem with me
I don't mean to be a backseat mod™ but is this really needed-
Just gonna say I use it for more than just bot coding
And the other things I do on it needed more ram and cpu cores so I upgraded
What are the main things I need to know before sharding?
Apart from the code to run and the 2k guilds recommendation
lib?
A guide made by the community of discord.js for its users.
Thanks a lot 😄 ❤
np
increased cpu/memory usage, etc
So nothing too bad can happen if you shard to early? Nothing major??
@west raptor u sure
@knotty steeple yes, if you make more shards than necessary
Whats the best amount to start off at?
then i dont see any downsides
2 shards? 1 shard?
@earnest phoenix discord.js can determine that for u iirc
Indeed it can but I would rather do it manually tbf
100 per shard?
ye
So what about 150 ish guilds?




