#development
1 messages Β· Page 812 of 1
you don't need integer
the dependant will install it
it's node-gyp that's causing it
parse error: Expected another key-value pair at line 11, column 3parse error: Expected another key-value pair at line 11, column 3
json error?
I put in a comma by accident
oh
Item could not be created:
Your account has reached its concurrent builds limiItem could not be created:
Your account has reached its concurrent builds limi
Yes why
throw err;1:39 PM
^1:39 PM
1:39 PM
Error: Cannot find module '/rbd/pnpm-volume/04d2b97d-b6b0-4096-bd33-46a980d362e6/node_modules/sqlite3/lib/binding/node-v72-linux-x64/node_sqlite3.node'1:39 PM
Require stackπ39 PM
- /rbd/pnpm-volume/04d2b97d-b6b0-4096-bd33-46a980d362e6/node_modules/sqlite3/lib/sqlite3.js1:39 PM
- /rbd/pnpm-volume/04d2b97d-b6b0-4096-bd33-46a980d362e6/node_modules/discord-money/index.js1:39 PM
Jump To- /app/server.js1:39 PM```
Error
gyp ERR! cwd /tmp/build_908c912218be718dae003ed9c0a1f643/node_modules/integer
gyp ERR! node -v v13.10.1
gyp ERR! node-gyp -v v5.0.7
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! integer@1.0.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the integer@1.0.7 install script.```
same
am i the only one that never had problems with it
Lol
@mossy vine nope
xD
I read like 50 docs before adding even a line
so I dont get much errors
π€·π»ββοΈ I just wasn't allowed to use it period tried adding it to my bot and everything said NOPE!!!!
Apparenly, heroku can't install integer
How does one install an integer?
Help
I could not join the voice channel: Error: Could not locate the bindings file. Tried:
β /rbd/pnpm-volume/0f5820b6-fa0f-4e8f-ba68-8ab021a8e3bf/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/build/node-opus.node
β /rbd/pnpm-volume/0f5820b6-fa0f-4e8f-ba68-8ab021a8e3bf/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/build/Debug/node-opus.node
β /rbd/pnpm-volume/0f5820b6-fa0f-4e8f-ba68-8ab021a8e3bf/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/build/Release/node-opus.node
β /rbd/pnpm-volume/0f5820b6-fa0f-4e8f-ba68-8ab021a8e3bf/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/out/Debug/node-opus.node
β /rbd/pnpm-volume/0f5820b6-fa0f-4e8f-ba68-8ab021a8e3bf/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/Debug/node-opus.node
β /rbd/pnpm-volume/0f5820b6-fa0f-4e8f-ba68-8ab021a8e3bf/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/out/Release/node-opus.node
β /rbd/pnpm-volume/0f5820b6-fa0f-4e8f-ba68-8ab021a8e3bf/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/Release/node-opus.node
β /rbd/pnpm-volume/0f5820b6-fa0f-4e8f-ba68-8ab021a8e3bf/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/build/default/node-opus.node
β /rbd/pnpm-volume/0f5820b6-fa0f-4e8f-ba68-8ab021a8e3bf/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/compiled/10.15.3/linux/x64/node-opus.node```
How do I fix this
i am trying to make economy using discord-money package but i want to make if user mention user send how much have money
message.mentions.users.first()
OK
@storm bluff const user = message.mentions.users.first().id || message.author.id
money.fetchBal(user.then(whatever))
Hi, when i use client.guilds.cache.size and client.users.cache.size, these give me 0? How can i resolve?
thx
Code for a background image on my bots page?
yeah
ty sm 
do you not know css?
Please can anyone answer me?
@pale vessel We need to add thaht on description ?
yes
Thx dude
<style>HERE</style>
@golden condor what glitch node version?
10
update
??
Hi, when i use
client.guilds.cache.sizeandclient.users.cache.size, these give me 0? How can i resolve?
maybe that causing error

@torn nebula json "engines": { "node": "12.6.1" }, ?
@pale vessel No, because in the bot status i use client.guilds.cache.size and give me 11
that's 12
@pale vessel yeh its broken
broken?
Hey @Callum-OKane Iβve moved this to a different topic, since I think itβs with a different package than the original topic was for - node-opus rather than better-sqlite3. Aside from the error message youβre seeing in the console what are the other side effects of this failur...
mhm
send the full code
@pale vessel Yes
v12 right? no shit
#bot-details-page { background-image: url(https://i.pinimg.com/236x/35/f2/ea/35f2eabf6aa50066f5961bd32509484a.jpg); padding-top: 120px; } thats what i added
did you add <style> and </style>?
also remove padding-top: 120px;
that was just the extracted code
@torn nebula all my packages are on v10
where at?
its not published
oh
? wdym by your node is 12v
but packages are in v10?

#bot-details-page {
background-image: url(https://i.pinimg.com/236x/35/f2/ea/35f2eabf6aa50066f5961bd32509484a.jpg);
}
where do i add it in there?
did you add <style> and </style>
for the third time
I am rebuilding it
<style>
#bot-details-page {
background-image:
url(https://i.pinimg.com/236x/35/f2/ea/35f2eabf6aa50066f5961bd32509484a.jpg);
}
</style>
Basic HTML
yep
okay now how do i stop it tileing them?
what
@pale vessel Can i contact you in DM?
background-repeat: no-repeat;
Sounds like no-repeat
learn css
self-ping
This is plain sponfeeding tbh
and then the strech?
l e a r n
how can i make if user bot don't save data in sql package discord-money
user !== bot
i make that but he save the bot data
like it's adding bots money to?
if(message.author.bot) return;
how to change description background color ?
what do you mean by description background color?
thats CSS correct?
long description probably
.longdescription .content
dd
tias
and longdescription text color ?
color: hex
It just change text color without <h1></h1>
yes
@soft ferry is there only 1 h1?
just put <h1 style="color: #fff;"> on every h1
is that <pre>?
<style>
body {
background-repeat: no-repeat;
background-size: cover !important;
background-attachment: fixed !important;
background-image: url("https://linkhere.png"),linear-gradient(rgb(32,32,32),rgb(32,32,32)) !important;
background-blend-mode: overlay !important;
}
.page .container {
border: none !important;
}
#bot-details-page .bot-img {
box-shadow: none !important;
}
.longdescription .content {
background-color: #202020;
color: #ffffff
}
</style>
<br>
<img width="150" height="150" align="left" style="float: left; margin: 0 10px 0 0;" alt="LogsBot" src="https://i.goopics.net/RQQww.png">
<h1 style="color: #fff;>LogsBot</h1>
π» LogsBot is a new discord bot which has the particularity to make only logs! It has more than 20 different logs and you can choose the channel of each log and activate it or not!
It has only one feature but it's very well done!
</br>
<h1 style="color: #fff;>Setup :</h1>
\`\`\`
* LANGUAGE :
log!setup language <french/english>
* CHANNEL :
log!setup channel <event name> #channel
* ENABLE :
log!setup enable <event name>
* DISABLE :
log!setup disable <event name>
* PREMIUM :
log!setup enable/disable log_bots
\`\`\`
<h1 style="color: #fff;>Links :</h1>
is your bot not published?
he isn't
<pre style="background-color: #000; color: #fff">
content
</pre>
How to change table color ?
i'm too lazy to add class=""
oh he can just use h1 { color: #fff; } you're right
plz
i don't know about html and css
Simple Googling
or duckduckgoing
Apply class"something" attribute to an element and to element it you edit .something
.table {
color: #2bfafa
}
no?
like that ?
what
do you know how to use the inspector?
no
ctrl shift c is a good combination too because you can just hover the element and check the attributes
.longdescription .content h2 {
color: #fff
}```
when it says class you add a dot to it
when its only inside <> you dont
id would be #
that's <pre>
i thought you wanted to style a table
use the element inspector, click on your things, see what their classes and tag names are, and create you css accordingly
no need to ask us for every single css rule
sadly not all elements work like that (like table)
you can also test them directly in the inspector
you can click the plus button here
to add your css and test it live
I don't understand π
we can't
you
made using lightshot\β’οΈ
yup
you need to add .longdescription before it so that it only applies inside it
How to change bot name color ?
find the class name
I don't understand html
what's padding ?
space inside an element
how to add shadow ?
box-shadow
box-shadow: 10px ?
tias
google for box-shadow
Am I the only one who just uses the properties with big values to see what they do π
Explaining the logic is alright
3px is enough for me
With margins and paddings I use like 50px at the very least to see if it's good and then go from there
use inspector
.menu {
background: #101010
}
yes
I don't see it
Isn't that the nav element
id
no
menu is an id
not a class
so it would be #menu instead
nav also works but who knows, he might have nav inside the description who am i kidding
thx
Shouldn't that nav have its own class/id
it does
How would i get the 252... and 261... inside this collection? I'm logging the members from a certain voiceChannel
Collection [Map] {
'252082945551106048' => GuildMember {
...
},
Collection [Map] {
'261...' => GuildMember {
...}
collection.find(m => m.id == "252...")
but the ids would be variable hm?
so it cant really know the id up front
collection.map or something?
is it user input or what?
its an output from logging to a certain page
so above is what i get back in my console log who's in the channel
although, i want to figure which users are in there
you want all users?
yes
then use map
all users ids.
for some reason i'm still thinking to use collection.map(id) xD but that would be wrong due to it's not a constant/variable i have to input
thnx for your help @pale vessel
Its quite a workaround though
you'll get used to it
Like i'm working on a page which automaticly would detect which channel the user is in
but i'm either not able to obtain the channelid based on the users id
that would be find
or i would need to write a message
Thx flazepe π
client.channels.find(user_id) ?
xD it would need to iterate over nearly 16k channels as for now
@grizzled raven what's the difference between yours and collection.map(m => m.id)
i think get gets that one particular member
like find
you don't need to pass a function to get()
starting to learn more and more xD
nice
how to add a button ?
style it or just use useless html button
you really need to learn html and css for buttons
Trying to do HTML without knowing it is painful
agreed
and HTML will bite you
i found it reasonable ez compared to javascript
it's not really comparable to js but yeah it's ez
HTML is easy, styling the whole page quite isn't
i didnt know both and now (for my personal skill lvl) i think i set up quite a nice and decent website + discord bot combining the 2
if you plan on creating a website, use combine html with php
Styling for me made it easy to see things in different boxes and then shape as i want.
havn't touched php yet as it would most likely disrupt my learning curve
Dansgame php
Was a joke, i like vanilla php
ok
i'll have a look at it sooner or later
never tried any frameworks though
^
Started off with a simple bot, turned into a big project using all sort of stuff now like classes etc π
Laravel lol
Much fun experiencing new things every day
basically all of us
nice
I mean this damn bot thing if you have a slight passion towards programming , is going to be addictive
yeah, i keep adding useless commands to mine

I did a pr with my apo
i applied for yahoo weather and they never replied :(
Api*
did they merge it?
Hell no there are like 70prs open
82 as of right now
OpenWeatherAPI not good nough?
Ye
Lul

I even have gitbooks page and stuff
Boredom xd
Obviously it is in my bot too xd
msg.channel.send(new Discord.MessageEmbed().setTitle("Random Romanian Joke").setDescription(json.joke));```
i didn't see random one?
Ye
Kapp

WideHard ?
Sounds like non-development topic
yeah
i can literally create a website to login with discord and choose banners for mystats on my bot and so on, lazy as fuck man
Probably could use vue
programmers could do anything but they're just lazy to do it
@slender thistle tends to get out of development sometimes 
I mean @pale vessel yes. At some point i might need to do it fnl
Fml*
how is it fml
fantastic mindblowing life
Css my enemy lel
it's at least something to do rather than being depressed doing nothing
I mean not like i don't have to update my bot to vs12
soon
^
How can i fix Error: Connection not established within 15 seconds. ?
what language
discord.js
Normally that error tends to mean somthing is stopping it connecting to the gateway within the timeout
what i need to do for fix this?
possibly blocking code or somthing taking too long to load
Hi, when i use client.guilds.cache.size and client.users.cache.size in a command file.js, these give me 0? How can i resolve?
I have already use them in the index.js and they works correctly.
p.s. he uses commando
how early in the code are you using this?
because the earlier you do it, the less users that are cached
also, does commando support v12?
@crimson vapor yes, command supports v12 because i use it in index.js and all works correctly
ok
@crimson vapor If you allow me to send you a DM, i can send you some code screenshots
@crimson vapor Yes
are you doing a console log or what?
@crimson vapor yes
when is it called? at start?
@balmy knoll show code
Tim you were the one to make discord.js-light, correct?
ye
it cleans up memory and edits classes to they do not take up as much memory right
ye
discord.js-light v12 when
its v12 lol
does it remove any functions of client?
Oh
it doesnt "remove" functions, but some things will not work
what are some of those?
for example, checking for presences such as online status is disabled
nickname/username updates are also disabled
could you not fetch a user and use the user's status?
member join / member leave need extra setup in your discord application
its possible to request presences via request guild members
but thats also disabled without enabling priviledged presences in your discord application
there is a suggestion on discord api docs to include the status and activity data through REST but discord being discord it'll probably get implemented never
i want to make if user mention a bot
if (message.mentions.users.first().id == client.user.id)
I forget how mentions work, that code is just checking if the author is a bot
yeah, flazepe got it
yeah
is it possible to customise your dbl page with css
if (message.mentions.users.first().id == client.user.id) return message.channel.send(`Bots don't have ${config.coins}`)```
I think that would be the code
why would it return though
probably because its ending
he wants the bot to reply to the mention
no he is checking if the mentioned user is a bot and if it is, returning
if (message.mentions.users.first().bot) return message.channel.send(`Bots don't have ${config.coins}`)```
oh
I think that is what he wants
im guessing you cant set the background colour
the colour flashed for a second then disappeared
I remember reading that you can only change one atribute per <script> </script>, idk if its true but you might have 2 there
not true
lulw
You can set multiple attributes per tag
alright guess I read something false
-bots @earnest phoenix
no
`
<style>
body {
background: linear-gradient(black, white);
}
</style>
</body>
`
`
<style>
body {
background: linear-gradient(black, white);
}
</style>
`
that still doesnt work, flashes on refresh
dont you have to add a degree?
like linear-gradient(0deg,color1,color2...)
yeah
try that @honest perch
so <style>
body {
background: linear-gradient(0deg, black, white);
}
</style>
yep
that doesnt work either
hm
what did it show though
just flashes
try to tell the css to color every div in the body, so change body to body>div
if it doesnt work then ree
or just copy the class from the background div and change its color from there
erm
does message.guild.channel.cache.some not work anymore in js?
channels
bruh
you right xD
let sChannel = message.guild.channels.cache.find(x => x.name === " ")
^
TypeError: Cannot read property 'find' of undefined
let sChannel = message.guild.channels.cache.some(x => x.name === " ")
^
TypeError: Cannot read property 'some' of undefined```
mh...
Need a help here ... Discord.js
This only doesnt work here ...
try client.users.get(message.guild.owner.id) instead of client.users.get(message.guild.ownerID) @heavy marsh
that wont work
why not? error?
i got the answer Timo AardappelToday at 14:50 Do you honesty think that you would cache the owner of a 90k members server Fetch them first, then get their avatar
@regal saddle which version of discord.js are you using?
probably 12
oh
user message.guild.fetchMember() @heavy marsh
didnt see that
hmm ok
also, dont forget fetching returns a promise
because it needs to make a request do discord
Is there no easy way to get it without adding more lines
@regal saddle which version of discord.js are you using?
V12
no because you literally dont have the guild owner data available
you need to explicitly request it from discord to get it
hmm ok
its only 1 more line, really
So how will it work?
you can even one-line it
and its still giving you the same error?
wait ill test real quick
I need to know, should I add configurability with the cost of adding more to a class?
and its still giving you the same error?
let sChannel = message.guild.channels.cache.find(x => x.name === "")
^
TypeError: Cannot read property 'find' of undefined
still the same π¦
@heavy marsh ```js
let user = await client.fetchUser(message.guild.ownerID);
let member = await message.guild.fetchMember(user);
// do things with either user or member
that will only work in an async function correct
@regal saddle show more code
yes, you need an async function to use the await keyword
yep i use it in an async function
let user = await client.fetchUser(message.guild.ownerID);
let owner = await message.guild.fetchMember(user);
embed.setAuthor(`${message.guild.name} ${xp}`, owner.avatarURL);```
so is this correct like this?
avatarURL is a user property, not a member property
you can get it directly from the user, no need for the member
user.avatarURL
Tim, i sended you my full code btw
yes
ooh ok
Lol discord.js might be a hell
Someone give me the power of will to update my bot to latest discordjs version
@regal saddle are you sure you're on v12 ? because this is also not valid in v12
@vernal yoke you've got the power

Start a XGH while listening to ameno and you'll do it
Hahahah
oh, isnt it a thing anymore in v12 Tim?
Tim is the latest version stable or is it daed
no, in v12 its message.guild.members.cache.get()
oh, ok
@quartz kindle thanks alot it works now π
but your errors sound like you're on v11 not v12 lol
is function(res) {} the same as res=>{}
Ye
for the most part yes
k thx
the scoping is a little different
wdym with that
when using classes, they interpret this differently
He never said you did, just explained
Lol aren't you the "copyrighted avatar" guy?
Nup
hmmmmm
Wait wdym

I copyrighted it because its mine?
k but im not gonna enter it xd
Tim π© or anyone, is the latest version stable or is acting weird
I like it
Use npm i discord.js@11.5.1 (ver 11.5.1)
@quartz kindle can you please provide me with that website with all the v12 changes? you actually pasted it once here 2-3 days ago. thanks
thank you kindly
i have mixed feelings with v12
@pale vessel How ?
you need to use the element inspector
I can't Im on my phone rn
How do I make it so it displays how many servers the bot is in?
Please can you gimme the id or class ? plz
diy
client.guilds.size should work
might
@pale vessel I dont have my pc
π
Got a problem that get my radio bot offline ...
throw er; // Unhandled 'error' event
Error: Error: Connection not established within 15 seconds.
anyone knows quickly what's the equivalent of v12 for message.member.voiceChannel
voice.channel
thanks
np
you can always you know browse the docs π
i could not find that particular bit
because it's changed
hence the reason for asking
it's called voicemanager or smth
^ thanks
use keyword searching
4 out of 150 commands. fucking hell im going to die
search only the key words in your query
like voice
^
mind-blowing right
indeed
also yall know
if you use a proper IDE
you can quickly scrap up a regex to replace old properties with new ones automatically
you don't even have to use regex
even a basic search replace would do
so people can never complain about not wanting to migrate/upgrade
@earnest phoenix cof cof intellij cof cof
Error: Error: Connection not established within 15 seconds.```
Any fix for this?
I check all three ...
let perms = voiceChannel.permissionsFor(message.client.user);
if (!perms.has('VIEW_CHANNEL')) return message.channel.send(` **No \`VIEW CHANNEL\` permissions to view the channels in the server!**`);
if (!perms.has('CONNECT')) return message.channel.send(` **No \`CONNECT\` permissions to connect to the voice channel!**`);
if (!perms.has('SPEAK')) return message.channel.send(` **No \`SPEAK\` permissions to speak in this voice channel!**`);
lmao
keep on trying
@heavy marsh are you catching the error?
channel.connect().catch(console.log)
or is it join()
idk i dont use voice
Like, he used ` for wrapping the string, isn't this the error?
no
backticks are string templates in js
although hes using them as regular strings, so its unneeded
Lol so js have 3 kinds of string?
yup
maybe too lazy to escape quotes
And people say java is hard

python has like 274892 ways to template strings
Lol
`\ you cant escape them?
lmao idk
wanna hear a fun thing
markdown parsing is different on all three platforms
`YOu can escape em`
so a lot of the time it works on one platform but not the other 2
mobile not supporting syntax highlighting pisses me off
@earnest phoenix You cant escape one inside of an inline code block on desktop
is what we mean
```
just turns into that
What is bot?
bot for top.gg's server list
tbh that bot should be renamed to "top.gg server list"
there are so many "server list" bots that you never know which is for which website
should I sacrifice memory (a small amount) for more customization per command?
Anyone making a bot using javascript know how to create a line-graph that has ping for the last 10 minutes?
Use canvas and draw lines relative to the clients ping
and send the rendered output
how would one add an image above the created by section of the page
what kind of image?
the only way would be to add a background image, clip it and change the element's height
@soft ferry google "css after pseudo-element"
hey can anyone help me create a line plot using canvas?
no
@quartz kindle
@honest perch you cant add images, the only way is via css background
you can manipulate an existing element's size to fit your image there as a background
ok thanks,
@rugged hatch lets say you have a canvas 200px high and your data set looks like [23,56,34,75,33,23,15,34]
first you need to define the maximum ping value Math.max(...data)
then each item in your data set needs to be converted to a Y position in your canvas, from 0 to 200: canvas.height - data[i] * canvas.height / maxValue
make a loop and use this formula to set the coordinates of each ctx.lineTo()
after the loop ends, stroke the line
@quartz kindle Sorry If I disturb you but I am not really good at canvas could you show me the code please?
are you using node-canvas or browser canvas?
node-canvas
check the quick example here
you create a new canvas, and set its height and width in pixels, then you need to get the 2d context
then you can follow this guide that shows examples how to draw basic shapes
https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes
that guide is for browser, not for node, so ignore everything that is not related to the canvas context
ok
you only need the parts that start with ctx.
70% updating done
Fuck man
I actually like new version @quartz kindle makes more sense
hey im getting an error on my server can anyone help
just say ur issue
be alot easier for us to help u if we know whats actually happening :P
itβs 503 vlc failed
i have nailed it down to an memory issue but i canβt get further
when a role is unpingable
message.mentions dont have it
Any way to get it without making it mentionable?
d.js
v11
i need to be able for someone to type !block and get 1233511
client.on('message', msg => {
if(message.author.bot) return; if (msg.content === 'ping') {
msg.reply('Pong!');
} if (msg.content === '!block') {
msg.reply('This is a koala!', {files: [https://abe.dash.org/chain/Dash/q/getblockcount); }
});
so instead of a "file" i want to display the text 1233511
makes sense?
remove the file bit and replace with 1233511 
i the value always changes cause the block height changes
see if you refresh page [https://abe.dash.org/chain/Dash/q/getblockcount the block height is 1233515
yea yea i know all that.. I am just giving example . New to bot making
Ah Okay
how about you just send the string you want
Yeah exactly
msg.channel.send
also the second line will return error
message is undefined
no clue what that mean . So far i use this index.js and can get the bot to respond by showing a file of the text from https://abe.dash.org/chain/Dash/q/getblockcount
you should probably first line JS a little bit?
client.on('message', msg => {
if(message.author.bot) return; if (msg.content === 'ping') {
msg.reply('Pong!');
} if (msg.content === 'koala') {
msg.reply('This is a koala!', {files: ['https://upload.wikimedia.org/wikipedia/commons/thumb/4/49/Koala_climbing_tree.jpg/480px-Koala_climbing_tree.jpg']}); }
});
this i have gotten working but i need this do generate the text from a url
website body. Does this make sense to anyone
anyone work with discord.js?
you want to scrape text from a website?
if scrap mean pull the text numbers from the url above yes
you need to load the website and get data from it
lol
you need an http library
there are many you can chose, such as node's internal http and https libraries, and other custom made libraries such as node-fetch, got, bent, axios, etc...
like i said i am new to all this but if i do:
if(message.author.bot) return; if (msg.content === 'ping') {
msg.reply('Pong!');
} if (msg.content === '!block') {
msg.reply('This is a koala!', {files: [https://abe.dash.org/chain/Dash/q/getblockcount); }
});
it give me a file with the TEXT i want lol
crazy!!!!
You should probably learn about post apis and http and stuff before starting to make a bot
i dont need the file . I just need it to display the text number lol
My god
because you dont understand how the code works. The data you want is in a website. so you have to make your code access this website, like you would do in your browser
^
to do that, you need an http library as i said above
@silver wraith if you want to code a bot, learn the language first.
I did not learn the language first and I kinda regret it
what is the hardest part about coding a bot for you?
if you learned java, why not make a bot in java lul
^
someone said java?
I do believe it was mentioned
i will never need to build another bot after this. I just need a simple text read from a url. Only 1 thing in the page a bunch of numbers
wdym
i know we have a genius level bot maker that can alter my WORKING command to do what i need
i already told you
that is not how it works
the reason that your code works as a file is because discord.js has an option to INTERNALLY access the website and download a file from it
but the folks that made discord.js made it only for files
to get the text, you have to do it yourself, using an http library that downloads the content from the website into a variable
there are many of them and they are easy to use
for example, using got: ```js
let response = await got('https://yourwebsite.com');
let text = response.body;
then just msg.reply(text)
imagine sending the link as file
i love how d.js does half the things the end user should do because the devs know that their userbase is incompetent
It removes redundancy though, I'm fine with it. No reason to make coding so difficult no one wants to do it
the thing is that he wanted the text/body content as a string, not as a buffer
...as an attachment?
that seems highly unproductive
best approach would be yours
GET and reply with the response
After playing music for an hour, my bot stops playing music with an http error in the console(discordjs v12, ytdl-core) and then I have to restart it to fix it
thank you for providing your error
heroku?
@earnest phoenix he wanted to get it and post the text response, but he wanted discord.js to do it for him via {file:url} lol
which was giving him a file instead of the text, because discord.js gets remote urls as buffers, and he was complaining about that ("i only want the text, not a file")
heroku
well can be heroku's problem
as it doesnt like things running for long
idk what he wants, like text no image or image no text
lmao
what
(async function() {codes here yes})()
{} declare a scope
hm
yeah but scopes inherit async dont they
but they are inherited so my example works
nvm, made the whole thing before ```js
if
you're using the wrong terminology
yes
why is js not async by default
because async in js isn't really async
wym
because why would you use await in synchronous programming
Thats why .then exists
shut up
I mean
yes
use .then
who tf cares about async
putting the whole shit in async will make it slower
@earnest phoenix stop being so rude please
lol
Library?
discord.js
Version
Is that normal that i have this error ?
no
no
@limber saddle the .flat function doesnt exist
ouh
@limber saddle whats your node.js version?
Actually the lastest
you're on glitch right?
yeah
do you have engines in your package.json?
yes
what version?
10.x
can someonehelp me setting up a working webhook with heroku to get dbl votes?
heroku is cancer, you can use your own or glitch
glitch is as cancer as heroku
Glitch makes it easier to edit code tho
@tight plinth all you need is to enable a web dyno and then use dblapi.js
ideally you shouldnt even be editing code using a webeditor anyway
version control is vvvv usefull
git 
hm
2020-03-07T21:04:25.748324+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-07T21:04:25.538553+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-03-07T21:04:25.538778+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-03-07T21:04:25.733743+00:00 heroku[web.1]: Process exited with status 137
@quartz kindle
what is your procfile?
worker: npm start
what port did you set?
port is set by heroku itself
in procfile or in config var
you just need to pull it from environment variable
It stops
.listen(process.env.PORT || 3000)
My bot
you have an existing webserver?
I have to go, sorry guys
kk bye
btw can someone help me also about discord oauth in flask (python), it just forgets the access token when I redirect to another page
how about url params lul
so do you mean should i pass the access token to another page?
it will be insecure then i think
i will try setting the cookie then, thank you
use cookies
they are the most secure way
remember to encrypt
You can check for an existing cookie with that key and make like a "keep me logged in" system too
Well yeah thats definitely more useful
keep me logged in shouldn't exist in oauth logins
well
as the session length is determined by the access token lifetime
you can set like the cookie lifetime as that tokens lifetime
i meant the option to choose it*
depending on what you want to do, you can also cache the user's data and use a remember-me based on that
im just trying to login with discord then show the server list to the user
my bot no longer shows image embed. nothings changed server side, any ideas? nothings changed on the api
not sure what i changed but it worked yesterday
stripped down code:
const Discord = require('discord.js');
module.exports = {
name: [
"hug",
],
description: "format messages",
run(client, message, args, command) {
const nsfwTags = ["neko",],
if (nsfwTags.includes(command.toLowerCase())) {
if (!message.channel.nsfw) return message.channel.send('You can use this command in an NSFW Channel!')
}
superagent.get(`http://api.(mydomain):8080/api/${command.toLowerCase()}`)
.end((err, response) => {
const lewdembed = new Discord.RichEmbed()
.setTitle(command.charAt(0).toUpperCase() + command.slice(1))
.setImage(response.body.url)
.setColor(`#000000`)
.setURL(response.body.url);
message.channel.send(lewdembed);
have you tried debugging
did you update anything?
- logging the image url etc
why is discord sending my messages so slowly again
I didnt change anything on the api. I really dont remember if i updated the bot between last night and today.
And like posting it to console? no but ill try
always and i mean always inspect your variables
I know the command does go through but ill add more details
I'm bacc
i'm not sure but is there a possibility this part causing a issue --> ["neko",]
The comma at the end?
you have an existing webserver?
@quartz kindle wdym by webserver
@earnest phoenix yep
Ill try removing that first since it easy brb
@tight plinth anything along the lines of express.js, app.listen, http.createServer
if not, what port did you set in webhookPort?
Hmmmmmmm
I rly don't have setup anything for webhooks, not even a webserver or a port
Coz idk how to do
Sorry to be a noob
did you install dblapi.js? lol
then add the webhook options
{ webhookPort: 5000, webhookAuth: 'password' }
```? if yes, time to find port ~~there is no password I guess~~
or the password is 'password'
im dumb..... i just realized what i changed.....
ill change it back to url and it should work. thanks for your help!
"image" on the api and the bot was looking for "url"
I have to actually create the webhook?






