#development
1 messages Β· Page 353 of 1
it has some code breaking changes so you're gonna need to change some stuff
run npm i hydrabolt/discord.js
that's the name of the guy who made d.js
Thanks @tawny lava got it to work
@tawny lava my bot is just dnd, help
ok
wouldn't matter anyways cuz trash
I'll delet
π
Question!
Answer!
Anyone know how to make your website embed on discord when you send it
use ogp
anyone know the thing to check if you cant dm someone
What dbl non-cert union says, those are meta tags
<meta property="og:title" content="TItle"/>
<meta property="og:description" content="Description"/>
<meta property="og:url" content="yoursiteurl"/>
<meta property="og:site_name" content="sitename"/>
<meta property="og:image" content="image_if_you_like.png"/>
<meta property="og:type" content="website" />
Place them between <head> and </head>
nvm
how would i change the background? and also add buttons?
you could change the background-image of the body or some div
or add an image setting it to fill the screen
uh.. how would add an image?
<img src="<your image url>" />
...you mean a background image?
yes.
use the background-image css rule
any of you know whats going wrong here
im using a passport discord strategy
however once i get to discords authentication
it wont go to the callback
did you set the redirect url to the callback
and in the url?
can it redirect to localhost
should be able to
oh wait it should be able to
i did it successfully once
idk why it just is broken now
here is the strat im using https://i.imgur.com/eKmLkxp.png
and the routing https://i.imgur.com/iiRXlza.png
litterally have no clue
whats wrong
@jagged plume any luck?
also srry about the whole keeping routing and passport stuff on main file
this isnt a big project meant for production or anything just something stupid
mine looks basically the same
this is frusturating as heck
except i have successRedirect as well as failureRedirect ?
i havent used it in ages
might be something to try
probably
because it goes to discord fine and dandy
but not back
ill just make a new app
if I see correctly, clicking authorize does nothing?
it might be trying to redirect and the page isnt responding
exactly
yea
ok um hold on
ill output if discord tries to redirect ect
nope
https://i.imgur.com/ziqAaI0.png this is the setup
the authorize button wont click
i even tried manually putting in the callback into url
when i change the redirect to google.com it still dosnt work
it has to be discord
mk
AHA!
you did it
@bitter sundial i owe you my life
time to go to sleep
gnight
lol
got school tom and its 12:30
Ok
How do I get users in my playing
wich lib
py
Alright I got a scenario
I have a React app
which I want to serve at ip.ip.ip.ip/
and an api I have running on the same server at port 1234 which I want to serve at ip.ip.ip.ip/api
how do I do this with an apache vhost?
e
Can someone help me? I updated my discord.js to version 12.0.0 but I couldn't get anything to work so I downgraded back to version 11.2.1 and when I try to play music it says fix Error: FFMPEG not found To make sure it was installed I even installed it globally. Same issue. So how do I get node to recognize ffmpeg again?
It worked before I updated discord.js
is the executeble still on the same location ΒΏ
Yes?
yes with a question mark, go check it
Do you mean the FFMPEG executable?
yes
I can check
try moving it a folder up
npm i ffmpeg-binaries @quiet bobcat
I already have it installed Lizard
I tried updating it same problem
What do you mean try moving it a folder up @north fog ?`
out of the folde node_modules folder
that it is placed by the same files where the bot self is
then i dont know
π¦
I tried doing ffmpeg
in cmd
and it says its not recognized as an internal or external command, operable program or batch file.
So ffmpeg isnt even installed
π€¦π»
I tried installing ffmpeg and adding it to my path and then restarting cmd
but still the same thing
try restarting ur pc @quiet bobcat it helped me π
Alright I got a scenario
I have a React app
which I want to serve at ip.ip.ip.ip/
and an api I have running on the same server at port 1234 which I want to serve at ip.ip.ip.ip/api
how do I do this with an apache vhost?
Is there a way to play xspf, pls or m3u files through vc?
@fervent goblet i dont think you can but you can redirect ip.ip.ip.ip/api to ip.ip.ip.ip:1234
And maybe it will work
Can someone help me? I'm trying to make a pause and resume command. I've got the pause down but I can't resume it. The code I've got so far is fix message.member.voiceChannel.connection.dispatcher.resume()
@fervent goblet that would be much easier with nginx
since you could use proxy_pass
its not "easier" with nginx
@quiet bobcat Stilll having the issue?
Yeah
s>ev msg.guild.music
shhoot forgot
Instead of dispatcher try doing it on connection
Not sure why your having that issue while it works for me.
Where are you testing this at?
Does anyone have a recommendation on how to modify a Opus Encoded Stream's volume
How to make Jimp to merge two pictures? Yes i did tried everything
@earnest phoenix You haven't seen this one by chance have you?
https://stackoverflow.com/questions/31663511/nuget-package-installed-but-references-not-resolved
i used jimp to make a program that puts messages onto potatoes
like superimposes text onto a picture of a potato?
oh damn
@lethal sun first of all DONT use jimp
I wonder if there's a version mismatch between the package and the VS project
that's really all I can think of
How can I make so if my embed exceeds 2048 characters it continues on a new embed?
Using discord.js
hey\
is it ok to like
i dont know
store all of this on a cookie https://i.imgur.com/eqgfSAn.png
is that the discord api access token?
oh, then yeah that looks pretty normal
it's okay, but I would consider storing a single user identifier and then retrieving it on the backend
so like append a randomly generated token to that data, store it to a database and give the users that token
i guess that would be better and more practical
that's what I did
kk
k so I wanna make users be able to login to my website with their discord acc but don't know where to start 
google passportjs, express-sessions, and discord-passport strategy @thorny hinge
Seems like alot
@bitter sundial yea guna use express sessions god bless

@thorny hinge yea sorta i guess i can send you some boilerplate i just wrote if u want
Yeah
how do i do Syntax Highlighting on my bot
https://pastebin.com/raw/pjGbXHGu here is the boilerplate i use
Nice
semicolons are only necessary if you have sameline code
its not necessary so why bother

lol
also the xss module
is to filter usernames ect
it basically turns <>& ect ect into their html equivilant
xss(string here) returns html safe text
its lovely
i need to read express sessions docs now to get that done
ffs
Secureβ’
i joke ofc
im having a bitch of a time setting session data
with express sessions
really?
yeah
its only the coolest thing in town
I use npm for front end but that's about it
I've been using Scala lately
it's my jam
i use node for pretty much everything
cuz im a nerd
when making desktop apps
i just use node + electron
lol
lol
yea
but i mean
the mean stack is like
crazy awesome
for scalable and easy programming
mongo expresse and node are my shit
angular not so much
feels way to corporate compared to things like react ect
that's a good way of putting it
wannabe react with lots of extra crap that I don't want
that's a good secret
fix ur indentation pls
for some reason my bot is getting slower and slower
until i restart it
but only this one specific command
when its ran it freezes the whole bot
oh yea im sorry
finally got it working https://i.imgur.com/1k6VSQn.gifv
@uncut slate https://i.imgur.com/Iv4te6O.png fixed babe
just changed secret
im not sure you should be sharing the secret
it's just a decoy
pythonjs
^
I want to build a dashboard
wa
But Python is my best lang (actually maybe the only lang)
And I know jack shit about Django
That is JS right?
JS sounds doable
js can do anything
But couldn't you see a JS file?
So if I load in a JS file
Couldn't my user see all that?
Or could I just use something like a chmod
its this weird thing
you can run js files basically
not in browser
but server side
like uh
a file that listens on a port and responds files ect
maybe this will help
this is my current layout https://i.imgur.com/JcyFh6C.png
nodejs is a neat thing
https://i.imgur.com/7h7zoLW.png best cookie
2017
NodeJS is JS on v8 without browser API
NodeJS is server-side, meaning clients wouldn't - of couse - see the source code
But yea, imo, Python code is more readable
python is more readable but not as practical imo
python isn't that bad for backend api stuff, but node.js is also dam usefull
!<HELP
!<help
is there a way to pass session data from req.sessions to socketio?
finally got my boilerplate template done
if anyone wants to check it out https://github.com/ubermadness/express-boilerplate
i need helpio
xd
How can I make my bot just continue to try connecting to the internet, rather than stopping after about 3 tries?
using Discord.js
you cant
and its not 3 tries
its actually 20 times
after that it wont try to reconnect again
u are mom gay
what
what
what

So what can I do instead to keep trying to connect? I want the bot to connect as soon as it gets an internet connection
listen to the disconnect event and exist the process, use pm2 and let it restart
thats what most do
if you delete the code then you will never have errors
ok
its a process manager what restart your bot automatical when it crashes/exists
pretty usefull in production
same
i have never made anything for production before :/ or done any unit testing of any sort
i should learn that up
like automatic deployment
ect
I should too, it'd be nice to edit with Notepad++ rather than Nano in a PuTTY prompt
what
huh I've just been using an
bot.connect();
});```
everythign about that
@shell bane no
just
no
delet dis
and use pm2
@heady bough notepad++ or nano
what are you
What do you expect me to use, my main PC is Windows and the server my bot is running on is FreeBSD
I've never used Atom
atom runs off of electron which can be a bit laggy sometimes
vscode is nice but not near as modular ect as atom
Doesn't vscode require the whole visual studio installation?
no
vscode is its own thing
its super neat and lightweight imo
this is vs code
if you are trying out atom i recommend looking up some of the more popular plugins
like beutify
which automatically indents and properly spaces everything ect when you save
ect ect
ooh
yea since its written on electron its all platform
idk bout vscode im pretty sure its only windows
ARM too?
neat
ohh, I see
yea its like
its like a website with access to nodes functions like writing files ect
electron is neat
i played with it a few times
i also have some boilerplate scripts ect on github for bots & projects if u ever need it
im super lazy so i make boilerplate codes for later use
Alright
Do I need to use any code for pm2, or just install and launch my main.js with it?
nonono so like
do npm install pm2 -g
navigate to your js script
type pm2 start main.js --name "BLAH"
then type pm2 list
yea it has a 0 downtime restart
Can I now access the console for the server somehow?
meaning if you restart it it will be down for only a few ms
right so once its started in pm2
you can close ect
its like
a screen
and whenever it errors or crashes
it will autorestart
I see
its pretty neat
Does it autorestart when the system restarts, too?
no but theres a way to do that
let me pull it up
its like
pm2 startup ubuntu
pm2 save
these are the os options
[ubuntu | ubuntu14 | ubuntu12 | centos | centos6 | arch | oracle | amazon | macos | darwin | freebsd | systemd | systemv | upstart | launchd | rcd | openrc]
So has it now run the commands, or do I have to go through what it output and run the commands?
Like, it produced a lot of output
I was wondering if it did everything to make it autostart
er not sure i dont have it restart like that automatically
if you want to see your scripts output
do pm2 logs yourprocessname
http://pm2.keymetrics.io/docs/usage/startup/ here are docs
for auto startup
@heady bough at the end it should have something to run if you did it with no sudo
else it's now fine
tonkku is best badmin
Mine will probably never be proper until I implement databases
you don't "implement" dbs
true
How can I get the total time of a song? Using discord.js.
Hey guys, I'm having weird exceptions thrown. My bot is using JDA. It starts working at first, but then I get 'Stream closed' and 'RestAction queue returned falure'... has anyone had problems with that before? I am starting to believe it's discord's fault, but I dunno. I only recently started exploring the JDA..
Edit - I have diagnosed the problem.
code?
what this
Your bot @brave thorn was declined. Reason: No command list, only 1 of two listed commands worked|
There is a list of commands but this is called for a server support technical menu command *help
this quran bot
quran bot
Yes we can see that
this quran
muslims book
muslims book arabic not english
Yes but the moderators don't know arabic
copy
And did you list the command *Ψ§ΩΩΨ±Ψ§Ω?
yes
And maybe put in some info that the bot only responds to arabic
So there isn't any confusion
Shouldn't it be Ψ§ΩΩΨ±Ψ§Ω* if it's in arabic?
maybe make the help command in english telling them to run *Ψ§ΩΩΨ±Ψ§Ω?
yeah ^^
Just make the bot respond to *help
did you put that information also in the description ΒΏΒΏΒΏ
for just one command
@lusty plaza this my bot
*help-m
Sure that's the correct
say
but he just did *help
nobody excpect *help-m
Yes
everyone expect help wihtout any extra's
Yes
also, try adding more command info in your bot command that they can test/find out
because they couldn't find the correct help command they thougt it was broken
When arraying was looking at your bot
command help
If it existed before, then why couldn't arraying use it
And why is this conversation even in #development
idon't no
For the love of god this has nothing to do with development
You should know, it's your bot
hey
What?
*bot-m
@latent helm yes I know quaran bot replied to this message, but it still shows that the actual help command reply did not send for that specific bot
rip #rules
^^
defuk, no rules anymore ΒΏ
wow true
ANARCHY /s
how do you use a discord oauth access token?
I can find absolutely no documentation or tutorials
you use it on normal endpoints
Bearer <token>
uh should I cache the stuff I'm getting from the user endpoint
As auth header
I'm afraid I might end up with outdated avatars
don't want those spicy 404s
I'll cache for 30 minutes I guess
@foggy sinew let's talk here π
and what do you mean someone voted?
you mean reacted to a message?
Someone voted on discordbots.org
In my bot
I want to give them a gift if they do
I know
I just want to get a good understanding first
Ok
once you got that, lmk
Is there a good example bot that has this?
does your wrapper have support for jars + build paths?
So this basically uses data from a websites?
ye
you can download a jar from bintray
the only dependencies are okhttp and org.json
iirc
no
but it's easier if you're not familiar with making HTTP requests
download this
and add to your classpath
if you have JDA already it's all done
Yeah I have JDA
So do I need gradle or maven now?
I have gradle installed I think
One of the two
https://discordbots.org/beta/bot/arraybot how can I make all the text on the site white?
I set body color to white but it's not all of the text
* {
color: white !important;
}
but the proper way is to write a separate rule for each individual element
don't be Lazyβ’
I don't care about the proper way
I'm a backend dev
now
how do I add this
as a style tag?
<style>
stuff {
foo: bar;
}
</style>
coolio
#prefix { color: green !important; } isn't making the prefix green
the prefix is in a span with the ID of prefix
probably the * {} ?
uh i wouldn't think so
if you look in the styling panel of the web dev tools, you'll see only one of the color rules isn't struck out
that'll be the one with highest priority
i'm pretty sure * matchers have the lowest priority
there is no color that isn't striked out
<style>
code {
background-color: whitesmoke;
color: #000000;
font-size: 0.875em;
font-weight: normal;
padding: 0.25em 0.5em 0.25em;
}
</style>```
works for me
i can see in your screenshot the wildcard selector's color rule isn't
@scenic crest use that code
odds are your prefix selector didn't actually work
ok so your * selector has higher priority than your .color-blue selector
i'm so confused tbh
ok thanks for the help my 0.34 shits have been used up
most of it works, you just can't see the prefix LOL
oh hell we're all stupid
you need to apply the rule to #prefix.color-blue > code
not just #prefix.color-blue
I blame whoever wrote the new bot page for putting that in a <code> block in the first place because why would you do that
lol thanks
@woven drum
<div id="details" style="max-width: 1264px;margin: 10px auto;">
is an improvement

ya and the "bot profile" text
I would maybe add a background for those?
or you could replace the text with an image with the text that stands out more
like black font with white borders or something
maybe
or the inverse
how to do it with css
you would make the text transparent and then give the div a background image
nice
what's wrong with it?
what css rule did you use?
you could make it more specific by adding an additional rule for the <a> tags
#createdby {
color: #FFFFFF !important;
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
}
ah yeah that would include the child tags as well
yep
just do #createdby a { text-shadow: none } or something
it works
it looks really good like this imo
with the text improvements on top of that
if you want that as well, you can do
`#details {
max-width: 1264px;
margin: 10px auto;
box-shadow: 4px 4px 0 0 #424f80, inset 4px 4px 0 0 rgba(204, 214, 248, 0.8), inset -4px -4px 0 0 #a5b3e6;
}
#details .container {
border: none;
}
`
@woven drum I recommend it
somehow your status div is misaligned now
#bot-details-page .status::before { vertical-align: middle; }
made the image circular
also, for the #details .container, change it to #bot-details-page #details .container to get rid of that border
the change didn't take
circular image looks nice
#bot-details-page .bot-btns2 { width: 188px; margin: auto; }
to center it
@next bluff do you still have the page open
if you do dont close it
take me the css
another dev overwrote it
I did not, crap
@shrewd field
cannot read property 'name' of undefined - check that props.help exists first
before continuing
ok
@shrewd field make yourself familiar with rule 7b please
wouldn't want you accidentally breaking the rules
7.
a. Donβt spoon-feed or attack beginners.
Everyone starts somewhere and asking questions is smart. Do not attack people for not knowing how to code. Point them to great learning sources and help them with problems.
However, you shouldnβt just give them finished code because then they only learn to copy more.
b. If you are a beginner, have a will to learn and do not expect to be spoon-fed.
have the will to learn what the code does
be prepared to read a few paragprahs on coding concepts
try to actually uinderstand and create code yourself
ok
stack overflow is excellent π
You will also be required to read the error
So I have a
let var = somevalue; in a js file, how can I use this variable in my html file?
I wanna make the header of my page the value in my js variable
get the element and set its innerText attribute
you might use document.getElementById('something') for example
hello I can't figure out what to do with this error can someone help me
Bananya
You will need:
- A Token for the Bot.
- Make sure that it is in your server.
- Go to https://www.discord.js.org/ and go to documentation.
- Copy the examlpe there and edit on it.
with only 1 command
that is ping pong
you then can edit on the example to add more code
yes that is it
hello can someone help me with this error.
C:\Users\toshiba\Desktop\Valkbot\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:490
return this.send(content, Object.assign(options, { code: lang }));
^
RangeError: Maximum call stack size exceeded```
are you recursively invoking the function?
no
what i did was I had sendCode depreciated so I went to the directory of the bot file and chaged everything from sendcode to send
Well you have a memory leak somewhere
call stack size sounds like the part of the stack allocated for function calls
and the only time I can think of where that becomes full is if you recursively call the function over and over and over again
but I don't know JS so I can't rlly tell
ok i didn't understand a single word from what you said
Like i said he has a memory leak somewhere by calling that function too often
huh
function foo()
{
foo();
}```
It seems like 2 functions are calling each other until max call size is reached
what could i do now then
see if you find any examples of this happening in your code
idk ask the person who linked you to the site xD
you need to go to documentation
then copy the example and change the place next to the word login in client.login() to your token
Would someone be able to help me with a simple problem
I know the solution is with object.keys I'm just not entirely sure how to implement it properly
So i have one object that has say 10 properties and another object that has let's say 3 of those properties. All properties are numbers
How would I check which common properties they have and add them together
I know I can just get rudimentary and to an if check for each of the 10 properties to see if it exists but I feel like that's a waste of time and space
@shrewd field dont make a new account and ask in d.js
You were banned for a reason
He is banned yes
Deni banned again? OOF
He were always banned on d.js
let's not get offtopic in here x)
What library are you using
What language?
XD
Programming language
That's....
...
I need to learn English Programming Language kthxbye
My bot is legit coded in english too
for f in lol:
is english
using hwat programming lang?
what*
Show me your code then?
What
that has nothing to do with this
If you just made your bot app then you haven't even coded anything
You got to choose a language to code the bot in
The bot. You need to code it
a PROGRAMMING language
and yes, you can clone a bot, but don't clone a bot, thats bad

Lol
Some libraries to use for coding are discord.js, discord.py, Eris, JDA ect
You cant say that 1 libary "is the best"
Disclaimer, don't listen to a word I say unless stated otherwise, this is probably for your own safety
or the safety of yo bot
Ok noted blocked
xDl
thats why I'm extending nitro
So can someone help me with my quest up there ^^^
What quest?
Question sorry
What question?
Sorry didn't see it
uh
I don't know how to do any of that
Sorry
Suh
I basically need help with understanding how to use object.keys to verify if certain properties of an object exist and adding their values
Oh checking if exist
I'm thinking of making a new bot
Here is something called hasownproperty
Tells u if value in a object @shell bane
Lemme get docs
Or u could do if(!obj[val])
But what I'm trying to do is use a for loop to iterate through the properties and add them if they exist
So I don't need to have an if case fir each potential property
So like for(item in obj) ?
Essentially yes
for(val in object_name){
object_name[val]
}
I want something like
Im at work on phone so sorry for awful formatring lol
For(obj1 properties){
If(obj2.property)
Obj1.property+=obj2.property
}
Something like that but makes sense
Add it but ya
Pce
can someone good at java help me
I am getting a NullPointerExecption at this code
.setGame(Game.of("ne-help | " + jda.getGuilds().size()))
(btw it is in my jdabuilder)
wasn't game.of deprecated?
still using deprecated methods is bad
how would I fix
.size()
393921573653839873
also .size() returns an int
reading is hard

I want it to display my guild count
yes
you cant use game.of() with an int since you cant do "string" + int
you need to do .toString() on that int
so jda.getGuilds.size().toString()
you miss a (
fuck
im still getting this
and here is my whole main class https://upldr.me/f/ncQn7v8.png
Your JDA builder is a JDABuilder until you call .buildBlocking(); on it
brb gotta shit
use shardmanager
huh
he can just call the setGame after the building
than he is fine
and he should update since game.of is deprecated

outdated versions 
yup
p!help
suh friends
a-suh dude
@shell bane still need help?
why
oh shit
my bad
lol
yea
wrong copy and paste
lol
Why can't I download python? It says The installer has encountered an unexpected error installing this package. This may indicate a problem with this package.The error code is 2203
Same thing
I can't even delete the files
Because I get an error
lol
Ok they're gone. And I tried installing python again but I just got the same error
thonk
What would be the best way to store upgrades, totally not making a clicking game clone
Hi
hi
Jw, how many commands at least is required for a bot to be on the site?
None
did your bot have like only help ping and something
yeah
your bot provides nothing
Yeah i realised I forgot to add the docs command to the help menu, and the main purpose of it is to check js syntax
Can someone just show me the steps on how to shard a bot? Just want the steps. Not the full code. JavaScript - discord.js
shared?
discord.js has an autosharder
^
but it's cancer
iirc they were working on one that doesn't spawn a process per shard
Is that blocking or async
if its not blocking, please send me a blocking lib
I need blocking requests
Python?


