#development
1 messages · Page 1900 of 1
is open synchronous or async
async
Then you need to await it
alright
i defeated dynamodb
':hkey': "team-up",
':rkey': new Date().getTime()
}),```
needed to add marshall
nit picky, but you can change new Date.getTime() to Date.now()
oh nice. and that avoids using the new keyword which you are never supposed to use in JS
new is even pre es-6 and people who say that are dumb because it's just an initializer. The fact that JS is now mostly class based is good because less duplicated allocs in memory because of prototypes
They said it's for 1 server. JSON is allowed
the guy who made JSON thinks new is a bad thing to use in JS
he categorizes the language into good parts and bad parts
The worst is class. It's only for Java programmers, who don't want to learn JavaScript. For those "Who don't know how miserable they are."
kinda a mean thing for him to say
Great. It's one thing for someone to make such a claim and it's another to provide actual tangible evidence as of why and not just some edge case
It sounds like this guy is petty because he's shitting on parts of the language which make javascript high level and modern
for what purpose?
checkout this book
https://www.oreilly.com/library/view/javascript-the-good/9780596517748/
it's pretty old, but most of it is still true
i bet it's been update too
out of curiosity is there a way to show on my website if my bot is online (I know that there is one by top.gg but it seems to show always online)
You can make an API that returns the status of your bot
that sounds smart, thanks
but why does top.gg have https://top.gg/api/widget/status/[id].svg if it will always show online
eg cheemsbot is currently offline https://top.gg/api/widget/status/659584424047935489.svg @tidal rampart
but is showing online
It's not reliable anymore
Pretty sure it used to use Luca to get a bot's status until they kicked all bots from this server
Would [] technically be Array<undefined>, or just something like Array<>?
I know, but I mean if I have an empty array, what would I call the type?
Ig Object
object is probably the best option
Since everything extends Object
I'm talking about TypeScript, but yes the same thing applies I'm pretty sure
Ik, but even in js everything extends Object
It is like, the common ancestor of all non-primitive types
as ive said, its only for one server.
imo prototypes were a weird idea in the first place
They make sense for object oriented programming
an empty array will always be Array<unknown>
if you plan on actually pushing anything to the array, then it will inherit the type being pushed to it if all items are of the same type
if you have mixed types, use unknown
Oh, thanks
also, not working
ive even moved it on to my vps to run it
doesn't help
Then look at a tutorial to load a JSON because idk how python works
What im doing rn
that is what they say todo, it may be something with discord.py
I'm using Google Translate to speak. Does anyone, when they go to vote for such a bot, and try to login, go back directly to a page with the 500 error?
in enhanced dpy (dpy fork), how do i make a component usable more than once?
like when i click the button more than once it says interaction failed
How do you put hex code in Embed color - Not hexadecimal in discord.py
wat
Example:
@bot.command()
async def test
embed=discord.Embed(title="", description="", color=[Hex color code] but we can only put Hexadecimal
Example: #36393e hex code
Ok
Huh
So 0x383249?
yes
Let me have a look
instead of #383249
Alr
@ripe prairie
How can i access it then?
Anything that subclasses it has access to its fields
I don't understand what you're trying to do
I'm wondering, does a slashcommand only bot even needs permissions besides the application scope?
It does, application scope only lets the bot access the slash commands in a server. It would still need other guild based permissions to perform actions like kick / ban etc
I see, i came to that conclusion because i removed the abiltiy to write in a channel and my bot was still able to respond
Well thats something which slash commands override, yeah
but yeah makes sense that these actions are still tied to the permission
but in theory, when my bot dont need any guild based permissions like kick / ban, im fine as long as he is granted the application scope
can i make an slash cmd handler for v12?
yes you can
how?
listein to INTERACTION_CREATE event in client.ws
and for replying, you need to play with the token given there
ok ty
How can I fetch the ids of all the mentions in a message not like message.mentions.members.first() I wanna fetch ids of all mentions for an afk command? Can anyone please help
You don’t need to fetch them
The property mentions contains any mention
No matter it’s a user, channel etc.
const bigCanvasRenderService = new ChartJSNodeCanvas({ width, height, chartCallback: (chartJS) => {
chartJS.register(chartjsPluginDatalabels);
chartJS.register({
beforeDraw: function (chartInstance: any) {
const localCtx = chartInstance.chart.ctx;
localCtx.fillStyle = 'white';
localCtx.fillRect(0, 0, chartInstance.chart.width, chartInstance.chart.height);
}
});
}});
is fun
Shouldnt message.mentions include all mentions?
log it
So I can just do?
const targets = message.mentions.members.id? And then get request data from my database?
Well if it’s only one mentioned member, then yes
If more got mentioned the property members is a collection
Which means you need a loop then or filter etc.
Yeah I mean that only I want to loop across every mention if then request data from database
Tysm
That's what the errors say?
Funny enough I found exact that code used in a chart.js issue from 2016
https://github.com/chartjs/Chart.js/issues/2830#issuecomment-227867969
How would I go ahead and return a value there properly? As far as I understand it .register() adds that stuff into the chart and doesnt require and returned values
@ripe prairie
👍
const express = require('express')
const app = express()
const router = express.Router();
const axios = require('axios')
app.set("trust proxy", true)
router.get('/', function(req, res) {
const response = axios(`http://IPADDRESS/check/USERID`{headers: {"Authorization": "APIKEY"}});
res.send(response.data)
});
app.use('/api', router);
app.listen(3001);
console.log('Running at Port 3001');```
whats going wrong here
const express = require('express')
const app = express()
const router = express.Router();
const axios = require('axios')
app.set("trust proxy", true)
router.get('/', function(req, res) {
const response = axios(`http://IPADDRESS/check/USERID`{headers: {"Authorization": "APIKEY"});
res.send(response.data)
});
app.use('/api', router);
app.listen(3001);
console.log('Running at Port 3001');
@spark flint now check
alr
?
trying it now
K
same issue
Axios request return a promise, you need to await it
Ah
looks like an internal error
@rustic nova ^
any ideas on how i can pull these info's based on the day:
so tomorrow, it would move pull info from the oct 15 tab
v
ping me if you know the answer. Thanks!
I know
but how would i pull info in the first place
i tried the networking inspection method but couldn't really find anything useful
https://www.marketwatch.com/tools/earningscalendar this is the link and chart i want to pull
its rendered on server side
so you need to scrape it by yourself
hmmm..
How would i ever scrape these info's.
i mean i know how to make get requests
GET request and use a package like cheerio
well using either fetch or any other package
i use axios.
Would that work too
yeah of course
axios can only be used for getting the HTML
you'll need something to extract the text with
cheerio?
isn't cheerio for web js only?
nah
Personally I'd use JSDom
but what part of the site should i actually put in to parse and get.
justt the whole website link
i suppose that's not the right approach
...
Make HTTP request to get the site's html, load it in cheerio then get the table via the following query: .tablesorter
and there you go, then you'll have to go over all the rows to get the actual data
since its rendered on server side, there's no other way than taking the whole page
if there is no official API for the site then this is the only approach
okay it sounds really hard but i'll try my best...
It's a few lines of code but yeah
i just read this and its kinda lit
okay so i've used fetch to get the whole webpage.
i would need to load it into cheerio now?
yes
var fetchUrl = require("fetch").fetchUrl;
fetchUrl('https://www.marketwatch.com/tools/earningscalendar', function(error, meta, body){
let result = body.toString();
});
yeahh i was looking at it already.
you say u used axios
but the response (result) is damn long. How would i know what attribute to load in
isn't fetch already build in node js
well response.data
i switched to fetch
no
load the entire HTML, aka result
there's a lot of tutorial online
where?
yt?
okh maam
yup i've done that
and i need to assign it to a variable and use .tablesorter?
.tablesorter is the selector for the table
const $ = cheerio.load(result);
console.log($.html)```i a messing things up.
use $(selector) to get the element you looking for
and then get the data that you needed
hmm okay.
And we are trying to get the .tablesorter right?
const $ = cheerio.load(result);
for (const child of $(".tablesorter").children("td")) {
console.log(child);
}
try this
ex: ```js
const {data} = await axios.get(....);
const $ = cheerio.load(data);
const companyNames = $(".daypage.selected tbody tr").map((i, e) => $(e).find("td").first().text()).get()
/// ["Sensient Technologies Corp.", ......]
didn't log anything.
ugh I hate cheerio
lol
i will try this
owh that actually worked!
And how would i get all the numbers?
which number
these bassically
its all td element so uhh
ex: ```js
const {data} = await axios.get(....);
const $ = cheerio.load(data);
const theData = $(".daypage.selected tbody tr").map((i, e) => {
const td = $(e).find("td");
return {
companyName: td.eq(0).text(),
symbol: td.eq(1).text(),
....
}
}).get()
/// [{companyName: "Sensient Technologies Corp.", symbol: .....}, ......]
something like that maybe
i dunno if the eq index is start from 0 or not
so try it yourself
that actually does work
aye
@rose warren
Ty
errr...why u wanna open an anchor url in a new tab?
target="_blank"
how can I do so embed waits for the promise to be fulfilled on the previous forEach
the strings are going empty, even if I fill them after the promise
and even if the embed fields are only added later in the code
🤔 show your code
.then() doesn't work on void
forget the redlines, I have neither NodeJS or eslint on this machine
the code is skipping to .addFields before forEach is finished
if I do something else other than a promise, everything goes fine and in order
yeah because for each is sync, you cannot do async work inside the callback (I mean, you can, but the code later will be executed before the forEach is complete)
use a regular for loop
so how do I get the docs?
with a regular for loop instead of forEach
i know
but I can't think rn
for (i = 0; i < query.size; i++) {
const doc = query.document;
}
something like this?
sure, or
for (const doc of query) {
// code...
}
that
I always forget that's possible
tysm
@cinder patio query has no iterator
const refP = db.collection('perfis');
const query = await refP.orderBy('xp', 'desc').limit(10).get();
is that mongodb?
Firestore
well find a way to convert query to an array
const msg = await message.channel.send({ embeds: [pages.firstPage] });
if (pages.size === 1){
return;
};
const prev = client.emojis.cache.get('890490643548352572') || '◀';
const next = client.emojis.cache.get('890490558492061736') || '▶';
const terminate = client.emojis.cache.get('888264104081522698') || '❌';
const filter = (_, user) => user.id === message.author.id;
const collector = msg.createReactionCollector(filter);
const navigators = [ prev, next, terminate ];
let timeout = setTimeout(()=> collector.stop(), 90000);
for (let i = 0; i < navigators.length; i++) {
setTimeout(async () => {
msg.react(prev);
}, 1000)
setTimeout(async () => {
await msg.react(next);
}, 2000)
setTimeout(async () => {
await msg.react(terminate);
}, 3000)
};
collector.on('collect', async reaction => {
switch(reaction.emoji.name){
case prev instanceof GuildEmoji ? prev.name : prev:
msg.edit(pages.previous());
break;
case next instanceof GuildEmoji ? next.name : next:
msg.edit(pages.next());
break;
case terminate instanceof GuildEmoji ? terminate.name : terminate:
collector.stop();
break;
};
await reaction.users.remove(message.author.id);
timeout.refresh();
});
collector.on('end', async () => await msg.reactions.removeAll());
It's react to the embed then it remove the reactions what is the problem?
worked, thanks!
No work
does anyone know why the fuck is the bot login request being aborted? this has been going on for 16 hours repeteadly
bad wifi connection?
seemed strange as its a vps, usually they have pretty good internet
tried pinging the ip from my local and seems ok
@top-gg/sdk isn't wokring in djs v13
what do you mean with that
whats not working
Did your bot login more than 1000 times per 24 h?
You should receive an error or status code if so.
discord would be too kind to give you an error message
I've only had one before
when i accidentally leaked my token
but a different message
Well some people working on their code need to test any line or few characters they wrote by starting the bot and see what’s going on.
1000 logins per 24 h can be reached damn fast then
Want to do you know how?
Feud already answered
How can i get i.reply id
It happened when i tried to create shard
i'm working on a python module - how do i do something like this:
blacklist = blacklister.join("APIKEY", member)
if blacklist == True:
reason = blacklist.reason()
else:
pass``` etc
so like if blacklister.join returns True, then be able to get the reason from that
And this is why you make a reload command 
Aye
https://bens-files.xyz/shot_211015_163607.png current error
blacklist = blacklister.join("APIKEY", member)
if blacklist == True:
reason = blacklist.reason
I'll give you some time to think about this
now that u tell me that, I'll work on one too
nah I just typed that out
i know i also need () on the end of blacklist.reason
Do you?
Read this error
And look at that snippet
Doesn't work
.addFields([
{
name: "Synonyms",
value: data.anilist.synonyms.length ? data.anilist.synonyms.length.join("\n") || "Not Provided.",
inline: false,
},
{
name: "Episodes:",
value: data.episode.toString()
},
{
name: "Duration:",
value: `${formatTime(data.from).toString()} - ${formatTime(data.to).toString()}`
},
{
name: "Similarity:",
value: data.similarity * 100).toFixed(2).toString() + "%" }
])
error: unexpected token ","
what line does it say the error is on?
would say at a guess where it says inline: false,
cuz there is no line under it
i.guild.channels.cache.find(c => c.name === "t")
I have channel named as t but it returns false
find returns a result or undefined
Thats why you should try to reload with the same login instead of restarting for each change
I solved it
no
Stop add commas on the last property.
inline: false,
You're missing a ( in front of data
value: data.similarity * 100).toFixed(2).toString() + "%"
you better ping @everyone
ping?

🤨
how tf can i send daily emails
I'm doing a daily capybara email thing for no reason and I've got a way to give random images everyday, but how do I automatically send these emails to a mailing list?
#development message
Keep that in mind hosting an own mailserver
You can just use a relayer to send mail to your list
Like google or Amazon
Just as example
A mail framework or library will usually make sending emails easy
I have Sendinblue setup
so thats not an issue
thanks
but how do I automate the daily sending
stick with the American(🇺🇸) Standard Code for Information Interchange
cough JavaScript
POV : Your trying to make a v2 of ur bot that support slash commands and start over
cmd
i get this error when trying to start the bot
Error: Cannot find module 'node:events'
Require stack:
- C:\Users\Islam\Desktop\Eqtron V2\node_modules\discord.js\src\client\BaseClient.js
- C:\Users\Islam\Desktop\Eqtron V2\node_modules\discord.js\src\index.js
- C:\Users\Islam\Desktop\Eqtron V2\index.js
←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:725:27)←[39m
←[90m at Module.require (internal/modules/cjs/loader.js:952:19)←[39m
←[90m at require (internal/modules/cjs/helpers.js:88:18)←[39m
at Object.<anonymous> (C:\Users\Islam\Desktop\Eqtron V2\node_modules\←[4mdiscord.js←[24m\src\client\BaseClient.js:3:22)
←[90m at Module._compile (internal/modules/cjs/loader.js:1063:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:928:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:769:14)←[39m
←[90m at Module.require (internal/modules/cjs/loader.js:952:19)←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: [
←[32m'C:\\Users\\Islam\\Desktop\\Eqtron V2\\node_modules\\discord.js\\src\\client\\BaseClient.js'←[39m,
←[32m'C:\\Users\\Islam\\Desktop\\Eqtron V2\\node_modules\\discord.js\\src\\index.js'←[39m,
←[32m'C:\\Users\\Islam\\Desktop\\Eqtron V2\\index.js'←[39m
]
}
Code:
const { Client } = require("discord.js");
const client = new Client({intents: 3});
const { Token } = require("./config.json");
client.once("ready", () =>{
console.log("Working")
});
client.login(Token);
what's your node.js version?
node -v
14.15
discord.js requires node.js 16.6.0 and up
someone got any ideas for something to make?
when i start the bot
err
PS C:\Users\Islam\Desktop\Eqtron V2> node .
C:\Users\Islam\Desktop\Eqtron V2\node_modules\discord.js\src\client\websocket\WebSocketManager.js:249
throw new Error(WSCodes[error.code]);
^
Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.
at WebSocketManager.createShards (C:\Users\Islam\Desktop\Eqtron V2\node_modules\discord.js\src\client\websocket\WebSocketManager.js:249:15)
at async Client.login (C:\Users\Islam\Desktop\Eqtron V2\node_modules\discord.js\src\client\Client.js:245:7) {
[Symbol(code)]: 'DISALLOWED_INTENTS'
}
@cinder patiohelp
anyone
help
Enable the privileged intent if you use it
intent is new to me
Member or presence intent whatever you use
Need to be enabled in the developer portal
i will learn abt them in yt
If you don’t need them in your bot then don’t subscribe them
ty anyways
client.user.setPresence({ activity: {name: 'Crypto, Hash {//}',type: "WATCHING"}, status: 'dnd' ,})
it be dnd but it dont set the activity
V13
the next level is class free oop
Not working
And bro u u know about how to connect database to 24/7 command in DJs music bot@opaque fern
@opaque fern I need my bot in vc 24/7 with out paid vps
Poor init about to get pinged a hundred times
@opaque fern

Python?
yes
"7" is a string not an integer
so what is the fix?
If that’s your error 
1 is an integer, "1" is a string

client.command.set(command.name, command);
^
TypeError: Cannot read properties of undefined (reading 'set')
uhh
it is
await PG(`${process.cwd()}/Commands/*/*.js`)).map(async (file) => {
const command = require(file);
Did you define client.command as map/collection somewhere? Probably not
i did
off
nvm
i did client.commands = new Collection();
Yeah s as I assumed
MainGuild.commands.set(commandsArray).then(async (command) => {
^
TypeError: Cannot read properties of undefined (reading 'commands')
commands is defined
i followed a tuto and he did that
how do I get information in a class with python
ah wait
class Person:
def __init__(self, name, age):
self.name = name
self.age = age```
thats the w3schools tutorial
if you want to get data inside the class externally you just do <person instance>.name
lt and gt symbols omitted of course
python oop 🤢
yup
its the language I use so
Have you looked into other OOP langs like Java or C# 
are you trying to convert them on the fly
for gcse I only had python and now I have python + lua as a 2 year course
I just wish our class went faster
I'm only taking it because it gives me college credit
otherwise I'd jump to the level above it
and I have to make a game in a crappy lua game engine as my course work
roblox 
I really don't like lua
it's so unpredictable
a lot of shit that would usually error in even loosely typed languages doesn't error there
it just silently dies
my languages of choice are typescript, c#, and C++
maybe java if I really have to use it, just because it's easily portable
same except i replace ts with js+jsdoc since ts for me personally limits productivity
I end up sitting fighting with the ts compiler over minute shit most of the time
ts compiler prevents a lot of shitcode in js tbh
Just because you never used PHP 
that's the point of js!
You're right, I never have used PHP
and I love it because it allows you to build something so fast
It does
Poor fellow
However I prefer to be told if I have mismatched types at compile time and not runtime
I also prefer something like what deno does, abstracts the compilation process of ts behind the scenes
otherwise I always get reminded typescript just becomes js at the end of the day 😭
than what to do
abt this
My exam won't even have python on
and I'm learning it
the exam will be in OCR reference language
which is like psuedocode mixed with Python, JS and Java
wtf
so pretty much nothing works on it
our exam is gonna be handwriting java and hoping to god it compiles and works as intended first try
which I think is stupid
len(variable) nope
variable.length() nope
variable.length yes
oh christ
I think that's counterintuitive
Because it's very difficult to write complex code that works correctly on the first try
Well good question, I’ve no clue what you wanna do
If you’re command got added to the collection then do whatever you need with it
example of ocr rl
I'd rather write jsfuck than that
10gb file size mmm
I feel you
why would they not just have you write... in a real language
the exam board thinks its more fair
but how? It's teaching you useless information
and also probs can't be bothered to write three different papers
I guess it's not COMPLETELY useless since it teaches the fundamental ideas of languages, but still
why bother learning a fictional language when they could just not be lazy fucks and accept a real language
exactly
A tip from somebody who’s out of school for more than a decade
More than 50% of what u learn in school is useless nonsense you will never need again
I've literally learned WAY more from just doing things on my own than I've learned from school (in comp sci)
Yeah life is an ongoing learning process
some say javascript is better
others say it's java
but everyone agrees, pseudocode is shit
yes
I have to know a language called "Little man computing" which is basically the cheap discounted expired version of assembly language
I know all the assembly operands which makes learning this annoying btec assembly seem pointless
and we absolutely cannot learn modern cpu architectures we have to learn the decades old terrible vonn neumann architecture
which only consists of one general purpose register and is bottlenecked by the ram
TIL: In JS, writing an Error to process.stdout or process.stderr from within a worker_thread doesn't work and will only show an empty object in the console. {}
You have to write the error message and stack in a string in order for the error to show in the console.
Kinda weird, but okay.
Edit: Or it may have been my jank json stringify method not collecting the props correctly
fixed i was missing :
You mean you replaced || by a :
Since it’s not a valid syntax for shorthand statements
Broo why did I get pinged
at everyone is at here
If I put MongoDB Collection objects in a dictionary and use them from there, will that work?
Will calling methods and getting attributes work if they are in a dictionary?
I figured it would be more efficient if I did it like that instead of calling getCollection every time
If you're caching results from your db, that could be efficient if that data is "hot" and needed often. The problem might then be data parity between cached results and what's in the database as you read/write
It's target="_blank"
Yeah that doesn't work won't show up on site when I save it
Hey anyone here has worked with patreon API?
I wanted to make my premium system automated through the API but now I'm not sure how to do it....
Anyone
Use Chargebee. Thank me later 
Dump Patreon altogether
Thanks the patreon api gave me a headache so I took painkillers and I'm on bed I will really check it out once I feel little better 😅
@drowsy crag
hi, so i keep on getting this error when i go to the profile's page of my website, what do i even do because i dont really know what the error means.
If the above error is not helpful, you may want to try EJS-Lint:
https://github.com/RyanZim/EJS-Lint
Or, if you meant to create an async function, pass `async: true` as an option.
at new Function (<anonymous>)
at Template.compile (/home/runner/kore-botlist/node_modules/ejs/lib/ejs.js:662:12)
at Object.compile (/home/runner/kore-botlist/node_modules/ejs/lib/ejs.js:396:16)
at handleCache (/home/runner/kore-botlist/node_modules/ejs/lib/ejs.js:233:18)
at tryHandleCache (/home/runner/kore-botlist/node_modules/ejs/lib/ejs.js:272:16)
at View.exports.renderFile [as engine] (/home/runner/kore-botlist/node_modules/ejs/lib/ejs.js:489:10)
at View.render (/home/runner/kore-botlist/node_modules/express/lib/view.js:135:8)
at tryRender (/home/runner/kore-botlist/node_modules/express/lib/application.js:640:10)
at Function.render (/home/runner/kore-botlist/node_modules/express/lib/application.js:592:3)
at ServerResponse.render (/home/runner/kore-botlist/node_modules/express/lib/response.js:1012:7)
at ServerResponse.res.render (/home/runner/kore-botlist/node_modules/express-minify-html-terser/minifier.js:82:16)
at /home/runner/kore-botlist/src/routers/profile/index.js:18:13
at processTicksAndRejections (internal/process/task_queues.js:97:5)```
update your node version
okie
v13 at least needs node v16.6
I'm trying to fetch Discord API guild data (https://discord.com/api/v9/guilds/guild_id) but some guilds are returning 403 Missing Access. How can I fix this? What is the reason for this error ?
<div class="card-content-inner">
Current Market Price: <strong>9,769 Silver</strong> <a href="steakhistoryk.php">```how do i get this info from the current code i have: ```js
var fetchUrl = require("fetch").fetchUrl;
const cheerio = require('cheerio');
fetchUrl('https://farmrpg.com/steakmarket.php', function(error, meta, body){
let result = body.toString()
const $ = cheerio.load(result);```. Would i have to do $(".card-conent-inner")?
could anyone help me with this. Never really got the hang of it.
JS Question:
I have a json with 2 subs, 'yes' and 'no'
I have a variable that is default on 'no' and if a thing is enabled then it will change to 'yes' but that won't matter currently.
I'm trying to reach the sub by using that one variable.
I remembered that it would've looked something like this: json.`${variable}`.value
But it gives errors
Identifier expected
Thats wrong
json.["yes"].value
Double Your'e Welcome :D
can u show ur authorization headers?
'Authorization': `Bot ${client.token}`
``` that's right because I can fetch some guild's data
@drowsy crag
It's json["yes"].value, or json.yes.value
The latter won't work for this case because it will use a variable
What's the event for DOM that triggers if a number input has updated by user input or the arrows?
cant see nothing wrong
const $ = cheerio.load(result);
let m = $.html()
const theData = $(".card-content-inner")
let g = theData.html().toString()
let final1 = g.replace( /^\D+/g, '');```i am trying to only get numbers, but it doesn't seem to work:
json.[variable].value
10,282 Silver</strong> <a href="steakhistoryk.php">[View History]</a>
index.js:45
show the code were its requesting stuff to the api
Then json[variable].value
where*
There's no period.
Yeah that's work too
no period before the []'s
I had to use it double
This wouldn't work :c
Yeah, I think so too
show the code where its requesting stuff to the api
Could someone... 
currently using oninput
aint workin
Would be easier for you to scrap the content between the <strong> tags
I don't quite understand, can you explain a little more?
how would i addd the .strong attribute then
i tried doing: const theData = $(".card-content-inner .strong")
but that's as dumb as my ass
.strong doesn’t exist as strong is no class
${} not $()?
.card-content-inner > strong
like show the code where ur doing stuff to the api
ex.
axios.request({
url: "https://nerver.gonna.give/you/up",
method: "PUT",
...
})
Thanks
Oh okay i try
axios.get(`https://discord.com/api/v9/guilds/818106816276725780`, {
method: "GET",
headers: {
'Authorization': `Bot ${client.token}`
}
}).then(res => {
console.log(res.data)
}).catch(e => console.log);
``` like this ?
OH SORRY hahahahahahah
yes
Missing Access has nothing to do with a wrong authorization header
That would return unauthorized
Yes but axios give me data: { message: 'Missing Access', code: 50001 }
403 is forbidden
Oh right
Missing Access
To rephrase that, the client may be authorized within the API itself, but it does not have access to that specific route/resource
It gets guild data
Fetching guild data
Can you even fetch guild data your bot isn’t in?
You can't
Well then you got your answer
Really? but the bot can pull the data of all its users to a certain extent?
Isn’t there any sort of public guild data like user data?
I did not know that
Let me test it out
Yes, I'm trying it too. (banner, name, icon, etc.)
Found one
anyone know what kind of thing is this?
array(2) {
["time"]=> int(1634383502)
["title"]=> string(28) "Shuumatsu no Harem Episode 1"
}
and how to parse it
yup
Thanks Mods
Returns 403 for a guild the bot isn't in
Preview is different endpoint
Yeah the ressource is publicly open
Just change guilds/guild_id to guilds/guild_id/preview and no errors
The preview one?
But the preview object only return a few details
Yes
Returns the guild preview object for the given id. If the user is not in the guild, then the guild must be lurkable (it must be Discoverable or have a live public stage).
I just learned this. That's what I need
Thanks @boreal iron
All I need is banner, icon and name
Ah ok
See this as well
If the user is not in the guild, then the guild must be lurkable (it must be Discoverable or have a live public stage).
Oh, no banner
Just name and icon
It shows emojis but no banners, really discord?
Don’t forget to check if the preview object is empty if a guild is unavailable or private as shiv said
ok i'll keep it in mind
Thanks
Well blame discord
It returns 404 if the guild isn't public
Good to know
Could be such a good morning… then I saw python 
I live for your tears. 
lmao
Custom Select's @ Bootstrap not as shown
https://a-blob.is-inside.me/lfs9Gr0L.png
https://a-blob.is-inside.me/aR99yooR.png
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="inputGroupSelect02">Heats</label>
</div>
<select id="selectdetect2" class="custom-select" id="inputGroupSelect02">
<option selected>Kies</option>
<option value="1">1 Heat</option>
<option value="2">2 Heats</option>
<option value="3">3 Heats</option>
</select>
</div>```
Bootstrap's Code https://a-blob.is-inside.me/2HVcPT1h.png
Why do you have 2 IDs attached to the select element
Does it matter?
It might as well
someone help me with html/css?
Ight I'll replace things and try
It does matter
Since your label element uses for
Targeting the ID of you select tags
The second ID tag doesn’t overwrite the first one
I wanted the site to have different styles on different devices.
I made each one have a different background, but it doesn't work
Pc:
Phone:
What's your code?
wait lol
I wonder if those labels are doing anything in the first place
They are the wrapper of the select element
android.css:
body {
background: grey;
color: white;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}```
pc.css:
```css
body {
background: #42445A;
color: white;
font-family: Arial, Helvetica, sans-serif;
}
html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TestSite</title>
<link rel="stylesheet" href="/css/android.css" media="(min-width:320px)">
<link rel="stylesheet" href="/css/pc.css" media="(min-width:1281px)">
<link rel="stylesheet" href="/css/pc.css" media="(min-width:1025px)">
</head>
<body>
<p>Nothing to see here...</p>
<script src="main.js"></script>
</body>
</html>
Instead of working with different files use media queries to scale by screen size not user agent
okeh
Oh lol I see
And for a note: as FakE said, it's better to refer to screen size as that's always present by the browser, as opposed to User-Agent, which is not what I'd consider a reliable source for such data
I'd like to resume this
What does updateResults do?
function updateResults() {
var current = "no";
if (inputs.$ === "1") {
// Weekend on
current = "yes";
var childst = 0;
var oldert = 0;
childst = defaults[`${current}`][`${inputs["d2"]}`].child * parseInt(inputs.childs);
oldert = defaults[`${current}`][`${inputs["d2"]}`].older * parseInt(inputs.older);
var temp = childst + oldert; passInfo(temp.toString().replace('.', ','))
} else {
// Weekend off
current = "no";
var childst = 0;
var oldert = 0;
childst = defaults[`${current}`][`${inputs["d2"]}`].child * parseInt(inputs.childs);
oldert = defaults[`${current}`][`${inputs["d2"]}`].older * parseInt(inputs.older);
var temp = childst + oldert; passInfo(temp.toString().replace('.', ','))
}
}```
kinda repeated code which i could've done way easier
error is under else {
childst = to be precise
Why all the string templates
sorry what
@media only screen and (min-width: 1921px)
{
body
{
...
}
}
@media only screen and (max-width: 1920px)
{
body
{
...
}
}
@media only screen and (max-width: 960px), (hover: none)
{
body
{
...
}
}
@media only screen and (max-width: 960px)
{
body
{
...
}
}
@media only screen and (max-width: 480px)
{
body
{
...
}
}
That's the scrren sizes how I scale
Template literals, sorry
The string within backticks
it doesn't have to be that
(hover: none) represents a device using TOUCH not a mouse
I'm used to doing that
Why are you stringifying them in the first place
in each bracket
I assume
defaults[`${current}`]
returns undefined
What's the sense of using template strings if the value is a string already?
^
hold on
defaults[current][inputs["d2"]]
Most of the time you shouldn't stringify values you use as map/object properties
As seen in your code
current = "yes"; is yes or no
Which is already a string
No need to use template strings to stringify a string

That's like parseInt(3)
c my issue now?
the yes part works fine but the no part doesnt
I'm not a very experienced programmer
inputs.$ === "1" is one actually a string?
'also why are you making it a string if it is already'
aintt
1 is a value on selection
current = "no"
what's with it
nope he hasn't
lmao
Anyone please
<a href="..." target="_blank">pew pew</a>
When i save this it doesn't work
And I checked view source target doesn't show up there
huh wut, lemme check
Ight my issue has been revolved expect for the css bootstrap thing.
I changed things during testing but didn't do the others because I wasn't doing that one yet.
Try
Yeah, works for me
No it doesnt
Would have wondered if not
@boreal iron dmed
Are you having issues with the styling?
Who me?@slender thistle
No
<a href="https://top.gg/" target="_blank">test link - shivaco sucks</a>
Opens a new tab
No styling errs
empty console
In my <a> I have button
Styling
gimme a second
It works for my server page
Ight figured out that I had to add form-control to the select class="custom select"
Yeah, can confirm
but
target option been removed
Works in preview but not after saving your code.

Oh, huh
form-select ight
I think JS isnt being filtered out in the preview but is in the actual page
might be why
not sure tho
Ight fixed https://dev.rubendb.nl/projects/defabriek
not needed to share the link as it won't work for us anyways
lmao dns cache ig
nope, the content security policy will block your inline scripts
on any "modern" browser
<script src""></script> right
@boreal iron Can I preview more than one server at a time ? Rate Limit ✨
I didn't see any note about special rate limiting this ressource, means global rate limits are in place
If u find a way do tell me c:
Of opening in new tab
Oof
JS will be thrown out as well
What about <a> with target attribute?
Exactly, do you have any suggestions for that?
? global rate limits allow... what 60 requests / min
idk
take a look on the dev page
Okki thanks
All bots can make up to 50 requests per second to our API. This is independent of any individual rate limit on a route. If your bot gets big enough, based on its functionality, it may be impossible to stay below 50 requests per second during normal operations.
just a little bit more than 60/min
but I was close
?
The last part is not talking to myself
If you wanna fetch 9, create a loop or better a function of your API request using the guild ID as parameter
boom call the function in your loop or 9 times per hand
how do we upload websites to our topgg page?
Okay thanks again
either by passing your html and css code into the "description" or by using an iframe
err
C:\Users\Islam\Desktop\Eqtron V2\index.js:24
client.handleEvents(eventFiles, "./src/events");
^
TypeError: client.handleEvents is not a function
full code handleevents ```js
module.exports = (client) => {
client.handleEvents = async (eventFiles, path) => {
for (const file of eventFiles) {
const event = require(../events/${file});
if (event.once) {
client.once(event.name, (...args) => event.execute(...args, client));
} else {
client.on(event.name, (...args) => event.execute(...args, client));
}
}
};
};
anyone
the file that sets the handleEvents method is being imported and run after you try to use the method
mhm i didnt understand
;-;
@drowsy crag
bruh
slay can u help on this
you're running client.handleEvents before you set it as a function
Ty
you're welcome Mac
how i can fix it
set the function before you run it
🤔
how can i do that
He means did you import your module before using it?
But is target="_blank" javascript?
fuckThis()
function fuckThis() {}
Will log your error
uhh
No it's not but still get's sorted out
fake can u check this
He means did you import your module before using it?
They shd fix this
guys which one is better?
first pic:
loc: US
second pic:
loc: Germany
Where do u live
fuck i cant understand anything u say
how does that matter?
i think using less cpu and memory is better?
so second pic?
Yes
How can you not understand what they are saying
Do you have any experience with the language you are using, even basic knowledge ?
He seems to be not having basic js knowledge
well my bot runs around 100mb+ memory
Prove to me mongo DB is better than PostgreSQL

Because mongo sucks
If you lack the basics please learn them
Show the code which imports your module and above
This is a fairly simple issue to resolve
(your event module)
?
||my bot runs around 100mb+ in memory||
TIL that dyno discord bot is a terminal application, and 2 that dyno discord bot runs off of mongo
i use mongo 
i managed to get my hands on the dyno discord bot V4 source code
yeah v12 basic
imagine using v12 
you are still using nodejs v12
Wot abt js
Imaging not using eris
AM TRYING TO UPDATE TO V13
OMG
Prove to me mongo DB is better than PostgreSQL
Well all this depends on your needs, document based or table (relational) based database
Scam scam scam
Eris is god
i did make some website using it
think he meant djs v12
not nodejs v12
this fucking error i dont know how to fix
I see
either way bad
I found the code that starts dyno
async function init() {
log(logo, '\n');
log(`Starting [${env} ${config.pkg.version}]`);
if (env === 'production') {
return Promise.resolve();
}
try {
log(`Packages:`);
await listPackages();
} catch (err) {}
try {
log(`Repo:`);
await gitInfo();
} catch (err) {}
return Promise.resolve();
}

:)
yuh djs v12
I doubt this.
Nope thats it
No one would make something so useless
wth does this do
Im good
dyno?
its called init so i guess thats to start dyno
u mean the bot or something else
dyno isn't even open source last I heard
say what
yep

its not actually dynos code I can bet that much
Its actually cool
This is the Dyno-Development repo
it has the docker file and env and all the cool stuff
tbh why clone an already popular discord bot
Even if it is dynos code it is probably old
Long stack traces for node.js inspired by https://github.com/tlrobinson/long-stack-traces
its v4
so yeah, its old
But its still cool
cant u guys just show me how i can fix this
still a big if tho
Non OOP style 🤮
...
Ewww
I found if statement hell
if (process.env.hasOwnProperty('awaitReady')) {
options.awaitReady = process.env.awaitReady;
}
if (process.env.shardId) {
options.shardId = parseInt(process.env.shardId, 10);
}
if (process.env.clusterId) {
options.clusterId = parseInt(process.env.clusterId, 10);
}
if (process.env.shardCount) {
options.shardCount = parseInt(process.env.shardCount, 10);
}
if (process.env.clusterCount) {
options.clusterCount = parseInt(process.env.clusterCount, 10);
}
if (process.env.firstShardId) {
options.firstShardId = process.env.firstShardId ? parseInt(process.env.firstShardId, 10) : null;
options.lastShardId = process.env.lastShardId ? parseInt(process.env.lastShardId, 10) : null;
}
.......
If satement hellscape
there is more too
Can you actually watch the chat and answer the questions?
Since the conditions have nothing to do with each other, that's absolutelly okay
I honestly doubt it's even dynos code even if it's old
They confirmed its the code
It's probably just some random guy claiming it
If the devs confirrmed it. its kinda true.
should just use Object.keys() for that
lol
using a for loop and stuff



