#development
1 messages · Page 76 of 1
"I didnt dm him out of the blue, we had been talking before." Meaning, I didnt message him from the server.
they were in my past dms
It went over my head
I deleted the invite immediately anyways
what
👀 I don't see this on record anywhere.
It sounds like this may have been mishandled.
But it seems it didn't happen from the account you're on. Do you mind dming me the user ID this happened with so I can look into it.
Answered in #general
you can do with both
but javascript support more things (i guess)
Guessed wrong
Java wrapper for the popular chat & VOIP service: Discord https://discord.com - GitHub - DV8FromTheWorld/JDA: Java wrapper for the popular chat & VOIP service: Discord https://discord.com
if anything javascript supports LESS, not more
nah djs has full coverage
I also saw fake in my room after I told him he had a skill issue
On an unrelated note, I'm trying to dive into procedural generation in C#, but the runtime I'm using is super limiting in what it can do so I find myself struggling.
The runtime compiles the C# into asm for the runtime which mostly comprises of EXTERN calls which are expensive to make and can destroy cpu performance
the vm has no math interpreter, so all math is EXTERNed
@boreal iron thought you might like once you're done driving
don't fight me kid
Damn... that looks creepy
Also just because I'm driving 24/7 doesn't mean I'm always driving
Hey, this is my ready.js file.
My bot don't show the activity status. Plz help!!
module.exports = {
name: 'ready',
once: true,
async execute(client) {
console.log(`✅ Bot is online.`);
client.user.setPresence({ activities: [{ name: `Yo boi`, type: `PLAYING` }], status: 'dnd' });
},
};```
My d.js version- 14.7.0
ur supposed to put that inside ready event, not in a command-like structure
hello so i am using typescript nextjs
and for some reason when i try to link an css element to html i get an issue
={styles.btn-hover}
whenever there is a - it throws an error
Tf you're talking Java dude
It makes much more sense to export your events in modules, too to organize your structure
Instead of putting your stuff into 5000 lines of your index
Show us how you load/import your event files
Just because you love chaos in your Java code doesn't mean we all do

I make bots like that and listen to new messages event and lots of ifs for commands
Oww my brain
js does mot support dashes in property names like that because it also means styles.btn - hover, ie one variable minus another
to use names with dashes you have to use the bracket syntax
styles["btn-hover"]
in djs 14 you have to use flags for presence types, i believe it does not support the string "PLAYING" anymore
ah yes, you create a file for a single-line event, right
It doesn't matter if one event just has 1 line or 2000
It's called consistency
Either you follow your own structure consistently or just code inconsistent crap
Right so fake youre a pretty smart guy right?
sometimes
I have a question
Pay first, please
More of a logical one on how I should tackle this issue I am having
If your information is good enough I will give 2 doll hairs
Now then
I have a class, this class will end up having a decorator that specifies that its a "controller" aka a router. This controller takes in a path so /users -> example.com/users
Now the methods of the class will have decorators as well specified how it should handle the execution e.g a post request to /:id -> POST example.com/users/:id
How should I handle attaching this metadata to the class so I can use it later on.
I know for classes Ican just do smth like class.constructor.path = pathTheyGave
but as for methods of the class I have 0 clue on what I can use to attach to the class method
Oh bet
I can just do the same
nvm problem solved thank you come again
@quartz kindle
const classMethods = Object.getOwnPropertyNames(Object.getPrototypeOf(this))
.filter(n => n !== 'constructor')
.map((key) => this[key])
How does this look 
Why do need to get the classes' methods like that?
Haven't really got what u wanna do but I will still charge you 1 h support
If theres a better way I am all for it
but this is all I could come up with
Don't think so... since methods of a class aren't enumerable you're correctly using getOwnProprttyNames()
But still why is that needed?
Cause the class is a controller that has a router attached to it, and the methods are the router handlers
const {Router} = require('express')
function controller(path){
return function(target) {
target.constructor.prototype.path = path
target.constructor.prototype.router = Router()
}
}
function post(path){
return function(target) {
}
}
@controller('/api')
class OlogyRouter {
constructor() {
const methods = Object.getOwnPropertyNames(Object.getPrototypeOf(this))
.filter(n => n !== 'constructor')
.map((key) => this[key])
console.log(methods[0])
}
@post('/hello')
hello(req, res) {
res.send('Hello')
}
}
module.exports = { OlogyRouter }
This is essentially what i am doing rn
OlogyRouter is a controller with the path /api the hello method is a post router that will corrospond to ``/api/hello`
Right now I am trying to figure out how to register the router with the post decorator but realizing I can't use any class properties from the decorator for some reason
One message removed from a suspended account.
One message removed from a suspended account.
same here
Weirdos
You also need to check the type of the property since not all props are methods
Yea I remembered that after pushing to github
// Include the necessary headers and namespace declarations
#include <iostream>
#include <cstdio>
using namespace std;
// Define a kernel function to compute the square of a number
int square(int x) {
return x * x;
}
int main() {
// Read a number from the user
int n;
cout << "Enter a number: ";
cin >> n;
// Compute the square of the number
int result = square(n);
// Print the result
cout << "The square of " << n << " is " << result << endl;
return 0;
}
provided by ChatGPT
me when you should inline int square(int x)
lol
They giving me some decent ideas 
totally not using it to generate a websocket implementation for a chatting app backend
I literally asked it how to do it in rust
it crashed in the middle
got rate limited
Then be lonely forever
Yes
How to create image
What is the best alternative to fakerjs?
Does anyone know developer for PHP page? but since i need that guild discord i can see.

Why this is not working in v14?
const { Util } = require('discord.js');```
If you look at the attached video you can see a horizontal progress tracker
The progress on this tracker would be the amount scrolled in percentage (halfway thru the page: 50%)
How do I do the math so the tracker is on max width when the page is fully scrolled?
await waitForElm("#progress-tracker");
function update() {
const scrolled = window.scrollY;
const max = document.documentElement.clientWidth;
document.getElementById("progress-tracker").style.width = `${scrolled}px`;
}
update();
window.onscroll = update;```
document.getElementById("progress-tracker").style.width = `${(scrolled / max) * 100}%`;```
possibly?
that should do it yeah
actually no
(max scroll)
function update() {
const scrollAmount = $(window).scrollTop();
const documentHeight = $(document).height();
const windowHeight = $(window).height();
const scrollPercent = (scrollAmount / (documentHeight - windowHeight)) * 100;
document.getElementById("progress-tracker").style.width = `${scrollPercent}%`;
}```
did it, all good now
is youtube music allow on discord again?
it's the other way around
youtube itself doesn't allow their content to be played through non-official players
ok thank
How to replace badge name?? Plz tell! It's currently like this- https://media.discordapp.net/attachments/824411059443204127/1052565188299202610/IMG_20221214_180715.jpg
do you have codes? what library?
Ya
what library are you using?
Discord.js
sorry i cant help i use different library 
Built a music bot using the napster api. Cant see why or how it would go against their terms of use. Haven’t gotten a response from them via email yet but its been working well from the past month. Are there any other known bots which use napster?
Cant see why
it doesn't matter which library you use, if it's from youtube it is against their ToS
youtube itself doesn't allow external players
ah wait, napster is a streaming service
https://www.napster.com/terms/#topic-3 read from here onwards
This Terms of Use Agreement (“Agreement”) is a legally binding and valid agreement between you (“you” and “your”) Napster Music Inc. and either Napster Luxembourg S.à r.l. (if you live in Europe), Napster do Brasil Licenciamento de Música Ltda. (if you live in Brazil), Napster K.K. (if you live in Japan), or Rhapsody International Inc. […]
but since they do have an official api for intergrating their streaming service in third-parties, I think they do allow it
it isnt
i said…napster
oh yea the tos, i am aware, are there any known bots who use (or claim to use) the api tho?
doesn't matter
there were many big bots that used youtube, doesn't make it more "legal" in any way
rely only on the official documentation, if it says "you are allowed" then that's enough approval for usage
the answer to your question is the ToS itself
read it, see what it says "you cant" and what it says "you can"
read the third line
oh wait one of the objects doesnt have a raw attribute
stupid me
@earnest phoenix please fix the ansi color encodings in Node.js stack traces
they dont work in windows
In what terminal exactly?
Not all terminals support ANSI color code highlighting
command prompt
Does it work in Windows Terminal?
Windows Command Prompt doesn't support most of the ANSI escape and control sequences, that's why it doesn't work
Nobody really uses the CMD anymore, only either PowerShell or Windows Terminal
console.log works, but not Node.js' internal exception stack trace for some reason
lots of people still use CMD
PowerShell is slow as fuck
Neither of those are slow whatsoever unless you're using an ancient computer
cap
i use cmd all the time
How i can fix interaction.reply is not a function error?
@lyric mountain are you sure I should just hash passwords? shouldnt I salt them aswell?
const msg = await interaction.reply({
components: rows,
embeds: [{
description: "Results will be displayed here",
color: "BLUE"
}],
fetchReply: true,
});
the code
interaction.Reply is not interaction.reply
no need for
hashes are already irreversible
you literally cannot find out what the original content was except for brute force, and that'd take more time than Earth has left
Show all the relevant code, including when you define interaction
There are server farms dedicated to this that can crack less strong hashing algorithms.
some new amd cpus came out with 96 cpu cores and they are stronk
oh god
can you show where you use interactionRun?
Its in line 17
No... he means where you gonna call it
um line 17

you gonna call interactionRun(...) somewhere within your interactionCreate event
(or event handler/command handler)
If the error says interaction.reply() isn't a function it means the passed parameter interaction probably isn't an interaction (instance)
actually a ChatInputCommandInteraction it seems like
oh
So either show us where you call interactionRun(...) or log the parameter interaction yourself to see what it is
yeah gimme a sec
that's still not the right file
right after async interactionRun(client, interaction) { put console.log(interaction);
And show the result to me
or show this to me
// Slash Commands
if (interaction.isChatInputCommand()) {
await commandHandler.handleSlashCommand(interaction);
}
wait
{
settings: {
data: {
name: 'NoobBot',
region: 'en-US',
owner: '782224893780557854',
joinedAt: 2022-09-20T18:49:08.780Z,
bots: 0
},
stats: { xp: [Object] },
ticket: { limit: 10, categories: [] },
automod: { strikes: 10, action: 'TIMEOUT', wh_channels: [] },
invite: { ranks: [] },
max_warn: { action: 'KICK', limit: 5 },
welcome: { card: true },
suggestions: { staff_roles: [] },
_id: '1018432526798303274',
prefix: '!',
counters: [],
__v: 0
}
}
interaction.isChatInputCommand is not a function
Yes, once again interaction is not an instance of an interaction
module.exports = async (client, interaction) => {
The parameter interaction is not an instance of an interaction
whatever you copy and pasting together isn't doing the job like u think
the parameters don't magically become what you name 'em after
sadly

How would I access the footer as the script in this situation?
scripts have access to the entire document from anywhere
Yeah but access the parent element?
theres no such thing
Ight
js sees the entire document through the document variable
no matter where the script tag is
ight
so i can use anything made of react on next.js
useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format.
any idea why the buttons aren't showing in 1 line
.button {
position: relative;
display: inline-block;
padding: 15px 30px;
text-transform: uppercase;
letter-spacing: 1px;
text-decoration: none;
font-size: 20px;
overflow: hidden;
transition: 0.2s;
margin: 10px;
}
How can i get a 5% from a number?
number * 0,05
not enough space
put a background color in the parent div to see its size
.main {
min-height: 100vh;
padding: 4rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
found the parent div since i was using an already made template (simple) the display: flex i was using ruined it
i removed the flex but i can't seem to center the buttons
maybe cuz they are both using the same class
<a href="" className={`${styles.button} ${styles.one}`} target="_blank">Leo</a>
<a href="" className={`${styles.button} ${styles.three}`} target="_blank">Fire</a>
the class one and three only changes the colors
you could have done flex-direction: row; no?
i want them in one line
not like this
oh
the main div includes more than this
would placing another div over this fix it?
well "row" should put the children in one line
hmm
What's the best way to enforce a downtime page? I've got the code for the downtime page. But if the user disables the site javascript, they can go to any part of the site and bypass the window.location.href = "downtimepage.html"; page. This is all for a website btw
Getting error: no member named 'AccessorSignature' in namespace 'v8' when installing node-canvas on Mac M1. Google hasn't provided much help. How can I fix?
Anything you try to enforce in the frontend can be bypassed by the user
If you include the same (down status) page in your backend no matter which site the user tries to access in the frontend then this is save
Also navigating through your sites by using their file names as part of the url is... well nothing you do nowadays
U usually use query parameters to get the current site as well as using them in your anchor elements (links)
RewriteRule(s) are also a nice way to deal with this
For example a folder like structure redirecting to the source
...org/home/news/latest -> ...org?site=home/news#latest
Depending on the amount of "folders" you could also add more query parameters or whatever
I actually prefer this way nowadays
It's also good to hide your engine
...org/home/news -> ...org/something.php?site=home/news
Or .ejs or whatever it is called
or .apsx
Alr ty
But once again make sure to include your down time file no matter what the location (url) the user browses
In the backend
To ensure there's no possibility of a bypass
Alr
PHP ❤️
How do I get into php
It seems boring asf to use
I also dont know much about it even though I hate on it to annoy you

Most people in here don't have the slightest clue about it
Wdym it seems boring?
Which language is "surprising" and idk the opposite of this?
Now then
tell me how to use php so I can use it and see if I would ever use it again
Only if you gonna pay me
Okay then ima not use php
lol
Go to php.net and read the like 50000 sites long introduction
This will help to get in touch with it

Yea and this just covers the basics right?
Nice
With the base extensions you can do like already anything you need
Can I order dominos pizza ?
can someone optimize this algorithm i wrote yesteday ```js
// array is le array of numbers
function detectSequences(array) {
let curr = null;
let prev = NaN;
const sequences = [];
for (const elem of array) {
if (elem === (prev + 1)) {
if (!sequences.some(x => x.code === curr)) {
curr = prev;
sequences.push({
code: curr,
plus: 0
})
}
for (let i = 0; i < sequences.length; i++) {
if (sequences[i].code === curr) {
sequences[i].plus++;
break;
}
}
} else {
curr = null;
}
prev = elem;
}
return {
sequences,
rest: array.filter(x => sequences.every(y => x < y.code || x > (y.code + y.plus)))
};
}
it's a function that takes inputs in the form of things like [1,3,4,6,8,9,10] and return { sequences: [{ code: 3, plus: 1 }, { code: 8, plus: 2 }], rest: [1, 6] }
@earnest phoenix @quartz kindle your area of expertise 
no
:trollface:
fail
thank you for understanding
I dont even understand this
my brain too smol
code is the start of the sequence, plus is how much the number in the end differs from the start, e.g 1,2,3,4 gives you { code: 1, plus: (4 - 1) }
its hard to explain lol

but i'm sure the code along with my description is clear enough for some people to understand
tf even is a sequence
sequence is a pattern of some sort iirc
from flask import Flask
app = Flask(__name__)
@app.route('/', methods=["POST"])
def stinky():
return 'Null, Stinks'
no
disgusting
no
no need "py" but only is cpanel and active bot run python "py"
but no have run python
and only is "php"
you is correct php?
js
what
Sorry for not responding, there was a major outage which caused all the networks to go down as well
This isn't really a "bug", ANSI color code highlighting may be disabled for you in Windows Command Prompt, you have to enable it manually
@earnest phoenix sorry ping you experience "php" or think only js?
alright, what about the other code i sent
can you optimize that
I don't use PHP so I don't have considerable experience with it, I have experience with stuff that are actually useful and plays a big role in everything unlike PHP
I don’t think fake wants to deal with him anymore
Almost everything FakE says is sarcasm as they said it themselves, so not too fond to deal with them that much
what about this @earnest phoenix
okay.
The example output you showed is a bit obscure, what exactly is the plus property supposed to represent?
if I set tsconfig target to esnext, would it wont be able to support older browsers?
Hello there, I am running into an odd issue, this is unexpected behaviour when calculating a formula, the expected outcome is not the outcome I am recieving, using a handheld calculator, and wolfram alpha and google calculator, all of which show the same expected result, except when implemented in Node JS.
Does anyone have any idea what might be wrong? Thanks in advance.
//1/1+10(^(Rb-Ra)/400)
//1/1+10(^(1500-1500)/400)
console.log(1 / Math.pow(10, (1500 - 1500) / 400));
//expected outcome is 0.5
//outcome is 1
@earnest phoenix
Math.pow(10, 0) is 1 bro
ESNext is basically pointing towards the JavaScript standards beyond the current stable standards, which is a bad target to use but yes, old browsers won't work with this target
Affirm, however;
https://cdn.axodouble.tech/v3/img/9UyZWdjExJ.png
Even newer browsers may not support it because it's for the next unstable JavaScript standards
yes, just confirmed, thanks
I know, the fact remains that if you calculate the same formula anywhere else you get 0.5
Here specifically too https://cdn.axodouble.tech/v3/img/9UyZWdjExJ.png
💀
volt ur aboutta get cancelled
js bad

triggered 99% of the programming community
js is religion
I only use js out of necessity now
Other than that I use c++, now I’m starting to use python as well
js is '0' != []
It’s true
But [] == 0
Ofc
And '0' == 0
Because it’s empty which is false
arrays are objects

Which is why you can query everything with brackets
I didn’t even know I was replying tf
💀
Brackets powaaa
You can query a class by doing this"functionName”

Idk why you’d ever want to but not a lot of people know you can cause they never pay attention to basic js
voltrex prob hates me for making json to js and vice versa
Have you seen how I register express routes?
That’s not bad
All it is just looping over it and using properties
though I imagine doing classes would be a bit hard
im worried about volt
hes gonna explain that 0 == [] lore
and im pretty sure its gonna be longer than the distance of moon to earth

function extractSequences(arr) {
const sequences = [], rest = [];
for (let i = 0, curr = null, ref = null; i < arr.length; i++) {
const n = arr[i], next = arr[i + 1];
if (curr !== null) {
if (next === curr + 1) {
curr++;
sequences[ref].diff++;
continue;
}
curr = null;
ref = null;
continue;
}
if (next === n + 1) {
curr = next;
sequences.push({ num: n, diff: 1 });
ref = sequences.length - 1;
continue;
}
rest.push(n);
}
return { sequences, rest };
}
Benchmarked, 600 milliseconds for 999k iterations, tested between multiple algorithms and this is the fastest one for exactly what you want
fucking damn
thought you were writing lore but nope
I avoided keeping an actual reference because that stops a certain pass we have in V8
The simple explanation is the type casting and coercion of all primitive types and objects, the non-strict equality operators try to coerce both of the left-hand side and right-hand side values to each other's exact type, going by that example, the empty array (right-hand side) being coerced to an integer due to the type mismatch compared to the 0 integer (left-hand side), array-to-integer coercion returns it's length
knew it
There are many many different coercions depending on the type
Nobodies on the internet can't "cancel" me
I cancel you
try me :trollface:



your dedication!!!!
Error problem solution:
async def whois(ctx, *, user: discord.Member = None):```
"ValueError: 'Whois' must be all lower-case"
how is it not clear enough
@earnest phoenix Why oopsGlobal is a global variable?
function fun1() {
oopsGlobal = 5;
}
yes it works without that
yes, how?
I would always dedicate my time for you 
volt getting too many bitches :trollface:
This is by design, it gets assigned to the global scope of the current context
when you dont use var/let/const, you are implicitly telling js that you are editing an existing variable, so js starts looking for it and it goes up the scopes until it reaches the global scope, and when it still doesnt find it, it then assumes you want to create it and creates it there for you
hmmm. But it shouldnt happen.
is this similar to how we can initialise a non existing key to an object?
not exactly
js implicitly creating a global variable when it doesnt find an existing variable, is a remnant of the old js design that aimed to be as dynamic as possible, but today there are things like strict mode for example that fixes those possibly unwanted behaviors
if you run a script in strict mode, the global variable thing will not work
oohk
but objects are different, they are designed to be like dictionaries where keys can be created, deleted and initialized at any point with any value
I thought oopsGlobal = 5, is same as window.oopsGlobal = 5
that is more engine dependent than actual js design
window only exists in browsers, so its up to the browser engine to put it there or not
on node.js there is global
but global variables are not always automatically put there
its better to explicitly put it there using global.myvar = 5 if you want it there
in node, the global object can be accessed from all files, without having to use require/import
ok cool, thanks
I want to make a website to view pdf files.
Basically it will accept a url as a query param.
Then then display it properly.
How can I get started with this?
does anybody know of any react package for this?
technically browsers already support pdf, so you could load the pdf in an iframe or something
I want to make a website to view pdf files.
but...why?
that's the equivalent of left-handed wrench
why am i facing this error while doing npm i?
should i run node-gyp?
Did you even read the first part at all?

lmao
bette-sqlite3 has prebuilt binaries for all node LTS versions (v14, v16, v18), so you could just use that instead of v17 which is not LTS
if you want to keep using v17, then you need to have built tools installed on your system, which include python and visual studio tools, in order to build the sqlite binary yourself
which is the most stable one in v16?
I guess i've completely lost my mind 
18.12.1 is the latest LTS
I'm going up with 16.16.0
16.19.0 is the latest v16 LTS
okay
using v18, my bot's command are not loading only, tho the events are loading
2 days ago it was working fine
but idk what happened today :/
Well then debug your code to see what's causing the error
yeah doing that only, but i dont think so that there's any error in my code, as the same code is hosted on my VPS, with node version of v17.9.0, but when I'm doing it on VSC, it's not loading the cmds
u cant compare two environments with different versions
v18 is the latest lts, so it means you can go farther than v16 without needing to update so soon
Well if you already know which part of the code isn't working as intended then debugging goes way quicker
finally got it fixed
idk why my command loader wasn't working, so I've to make a new one using fs
I don't ask
is this correct?
Because OLAP is analysis and OLTP is about transactions
In all these three we are not performing a transaction (insert, update) but analysis (reading)
id go for the second option
the first and third are actual db queries, the second one is not
there nothing actually happening in the second one, its just a verbal administrative request
does anyone know if its possible to verify a uptime kuma webhook request? I can seeme to find an option to add like Authorization
oh, its last week so not released yet, ig i gotta wait then
its a docker image (atleast thats how im usin it)
Was merged into master branch, you can just build from source
yea
is there any way to know how long a service has been offline with the webhook? is it heartbeat.duration?
well a heartbeat is typically something that gets sent over periodically
in this case its the monitors status
and heartbeat.duration is either the last it sent a heartbeat or the time it takes to send a heartbeat on an interval
and it isnt periodically
then that doesn't make sense, a heartbeat is sent over to keep a connection alive
but ig this isn't websockets so idk
just store the last successful request timestamp and send periodic ping requests
I see. I indeed changed it already. I now tend to see OLTP as small databases, that are not complex (so one single sql query would suffice). OATP more like big databases, that are complex and need multiple queries
Thnaks for the help !!
Is this 5-8% from User money?
const random = Math.floor(perAdd(usereconomy.money, usereconomy.money / utils.randomNum(50, 80)))
can you even divide like that to get a percentage
does anyone know if there is a way to send a custom webhook in gitea?
Gitea supports webhooks for repository events. This can be configured in the settings page
/:username/:reponame/settings/hooksby a repository admin.
yup it is
no not really
no, the formula for percentage is value * percentage / 100
or just value * (0...1)
where 1 is 100%
I wonder what schools are teaching nowadays
nobody ever pays attention to calculus
Yeah I feel like that's right
thanks
fyi, that's also called "rule of three", u can use it for linear interpolation and some other stuff like inversely proportional growth
It's the only rule you need to remember from math class
Hey! Plz help me!.
It's my server info and server icon code. The problem is that when I run these commands on a server with no icon, the bot crashes.
The catch err at the end won't work. Plz help!
and bodmas
show error
also congratulations, that's one of the worst formatting I ever saw
"if this errors, fuckin do it again but with this other embed"
When sending a follow up message failed then you send another follow up message
Without awaiting it anymore or catching if it fails
You should about that again
btw, catch only catches that promise's exceptions, not the whole code's
so if it errors anywhere else in the code, it'll still crash
Ep
Received: 'null'
2 ExpectedConstraintError > s.string.url Invalid URL
Expected: expected to match an URL
Received: | 'null'
at UnionValidator.handle (/home/runner/ Test-bot/node_modules/@sapphire/shapeshift/ dist/index.js:1088:23)
at UnionValidator.parse (/home/runner/T
est-bot/node_modules/@sapphire/shapeshift/d
ist/index.js:201:88) at EmbedBuilder.setImage (/home/runner/
Test-bot/node_modules/@discordjs/builders/d ist/index.js:252:23)
at Object.execute (/home/runner/Test-bo t/Commands/Test/suuuu.js:22:14)
at Object.execute (/home/runner/Test-bo t/Events/interactionCreate.js:17:27)
at Client.<anonymous> (/home/runner/Tes t-bot/Handlers/event_handler.js:14:58)
at Client.emit (node:events:527:28)
at Client.emit (node:domain: 475:12) at InteractionCreateAction.handle (/hom
e/runner/Test-bot/node_modules/discord.js/s rc/client/actions/InteractionCreate.js:97:1 2)|```
But this same code worked in v13
doesn't matter
it doesn't work now, that's the only important thing
so, check if the guild has an icon before setting a thumbnail
Can u plz help me so that the bot replies that the server has no icon.
simply check if the url is null
Plz give example
.

you're expecting me to give u a code u can simply copy aren't you?
let stuff = null
if (stuff) {
// stuff isn't null/undefined/falsey
}
also may I warn you, this will never show the real values
Will this work?
const icon = interaction.guild.iconURL({ dynamic: true, size: 1024 });
if (icon == null ) return interaction.followUp({ content: "The server has no icon!" });```
errr...kinda
if(!icon) is good enough
Could also be undefined
(maybe)
Who knows the consistency of djs
But when I tried, it showed the correct value
small bot?
Ya
there's ur answer
Testing rn
So how the f*ck I can show the real value?
Look the truth is- I am new in discord.js and I created stuff reading the docs.
You would need to fetch all this as it's not guaranteed to be cached (at any time)
Which is just api spam imo
first because api spam, second because memory issues
What about the icon problem?
u already solved it didn't u?
I m not sure this would work
Maybe watch the answers
just a bro tip, halt bot development for a while and study programming in general
like, I know making bots is cool and stuff, but there's no glory in being stuck staring at code you don't know what it does
a small understanding of programming makes bot development way more fun and interesting imo.
copying code online does work but only up to a certain point, after that it starts snowballing hard
if you don't know how to properly glue code together u end up with a frankesntein that works only 5% of the time
ohno
Hihi
don't worry i don't need help 🗿
my main pc broke again this time the cpu failed
👀 what are you doing to your pc for it to keep failing
all i got is a old ahh laptop can't rly do much on it 🥲
it's just old, i had it for 7ish years but i kept upgrading everything with time but it's just too old 😔
i had the i3 for about 4 years , i'm gonna upgrade it soon for an i7 or an i9
wait why does every video i save on my phone on discord gets corrupted
Good time to buy a used 30xx rtx card unless you wanna spend lots of money
my gpu is good, i got a 3090
Not to say that this strongly depends on the rest of the specs
Thats very very rare yk
Unless it was overheating all the time
all i have to upgrade now is my cpu and hopefully my pc will be alive again
most likely
it was overclocked
to the max
from like 2.6ghz to 3.6ghz
Once you upgrade the cpu you also wanna upgrade the ram
I wouldnt overclock a laptop that can barely breath
Oh a laptop
nope it was a pc that broke
Lol
Oh thought this was it
the laptop i'm using now is because my pc is broken
So a pc then everything I said was fine
again
Ah
I honestly don't get why people overclock CPUs, like you don't even get much more out of it, barely a little bit more clock speed but that's it
should be fine
Overclocking is very bad for any kind of hardware
it actually helped immensly
You get a hell lot of fps more
Stock 4.5GHz to 5.4GHz makes an incredible difference in games heavily relying on single core performance
uh i got used to it so i stuck with it
its a pretty good engine
Nobody cares about if it's bad or not
Unless it dies out or damages something
Bullshit
I mod unity games
Must be a bad sample then
It's the reason most people don't overclock, most of them also have no idea how to overclock either even then
Also im not increasing the core voltage
in my case mine died
I'm just trying to push the hz to a stable condition without increasing the voltage
Which won't damage the cpu at all
with the overclocking
i changed the paste maybe twice or thrice the entire time i had that cpu
Man my 9900k is many years older now and still performers like shit
Even on 5.4GHz
I'm mainly talking about the case where increasing the voltage is involved, which is the case with most overclocking strategies
You must be doing something wrong
Which either is heavy overclocking or not enough knowledge
i don't remember what exactly i increased, but the most noticable change came from one singular tick
I mean you can slightly increase it without getting too creepy
called "booster mode" or something similar
does anyone know what i'm talking about?
Things are pretty easy, if you don't know exactly what you're doing then don't do it
But yeah usually a cpu upgrade includes a ram upgrade which also requires a chip set update
If you wanna have something better and newer
Which means quite a lot of money
Thankfully last gen is still a good choice, but even that will be a full system upgrade.
Pff I would still buy a 9900k if the ram limits wouldn't be as sick
Nowadays you also wanna have ddr5
always go for the cheapest possible current gen iteration
Shut up poor guy
:^)

seriously tho, top tier stuff is not worth it, entry and medium stuff is always more cost effective
top tier stuff is overpriced for very little performance advantage
plus it falls off very fast, and upgrades are very expensive too
For the average pc user yeah
If you wanna play games in 4K on high you will need a high end cpu, ram kit and gpu
But such a setup is not required for your guys weird anime booba bling bling games
Yeah who tf wants efficiency cores
We want performance!
No matter it takes 600W
A good product is worth its money
Also I dunno where's that price from but it's not 777
It should be around 400-500
iirc
Tf hexacore
Much more common in the past 4-5 years
Trash
Let's be real what Intel pushes out of their architecture is brutal
AMD can only survive by choosing a much more modern technology
To reach like the same performance
👀 isnt that a good thing?
using more modern tech
Thats how they keep undercutting intel
on pricing
Imagine if Intel would switch to 4nm nowadays with their know how on what they pushed their last architectures
We would probably already have 9GHz cpus then
AMD made a risky bet, and it paid off, got them back on the market, but intel still has the technical advantage, they are just behind schedule because AMD jumped several steps
Yes that's what I mean
intel gen 13 is a beast
They can still beat amd here and there with a much older architecture
And a much older technology
look at this beast
And when you remember how bad amd was like 10-15y ago especially their Java based drivers then you don't wanna switch to amd nowadays
Whatever people have to complain about intel but their consistency is great
that's kind of silly imo.
Judging a tech company from over a decade ago.
Most of the people here didn't know what a cpu was 10-15 years ago. some of them were not even born.
java based????
what
the only thing is that with the smaller chips AMD has extremely good performance-per-watt ratios, so they are much better at low power than intel is, at least for now
which means they are also quieter and colder
Which doesn't matter for me but yes

Only good thing about AMD I see is the fact that they force Intel to move on (again)
Even if Intel is moving forward slowly
also, why the fuck would one pay thousands of bucks for a cpu when you have these
As they best AMD easily anyways
server grade is so overexpensive
for server use you do
how tf is that guy priced $573 in middle of two $3100 cpus?
Remember, those thousand dollar cpu's can have terabytes of ram, and 64-128 pcie lanes
BECAUSE OF THR SERVICR AND THE FACT ITS A PLATINUM SERVER CPU NOT A CONSUMER TRASH CPU
well, if u can afford terabytes of ram it's kinda cheap 
You should read about cpu ratings
if you need 128 pcie lanes, you have to use these cpus.
Especially when it comes to server cpus
at that price it better have gold plated connectors, cables, finishing and thermals
smh
Go get your cheap consumer cpu Tim
ENGLISH BROKEN
5 edits ffs
Which saves energy
Maybe it gives you energy back
Who knows
Core fusion cpus, putting 50W in getting 75W out
chromebook cpu?
lmao
Hmm laptop cpus are usually heavily limited when it comes to their enegery consumption
if i were to build a desktop now, i'd go for a Ryzen 5 4500
But comparing them to desktop cpus isn't really fair
Let's be honest if arm wouldn't have such a bad support it would be great to use it
Like the 84 core ones
Or even larger ones
Damn energy efficient
Funny how the 4y older 9900 still beats it
funny how it costs 10x more to do it
brand new
ultra cheap
You can get a 9900 for the same price
lmao
tbh
cpus are usually pretty solid
unlike ram
used cpus should still work 10 years, used ram usually just bsods
Nah only thing I ever bought used were my gpus
lol my gpus were literally the only things that broke on my old desktop
them and a couple ram slots on the mobo lol
1st had a hardware issue, back to seller, 2nd had the same issue, sent it to Asus, got a new card and sold it

you know whats the saddest thing ever when it comes to building pcs? getting your gpu broken and not having enough money to replace it with a better one, so you have to replace it with a worse one
😔
lmao
So guess I'm lucky
3rd world problems
You should have stayed in the eu
I would have bought you

you would have bought me? oh my ^:)
how do i ghost reply to an interaction?
Like, i don't want any output, nor a fail nor a defer
no not like that
a slash command must be replied to
a button interation or other non-slash interactions can be ignored
Well, I don't know why that's happening, but maybe a good way to get around it is to send an ephemeral message to the user confirming that they clicked the button. Something like, "Button clicked! This is what you did: ..."
use the defer edit for button
Yea you would be mine
living a gooood life

give me a room, food, internet and 23 hours of alone time per day and im yours
No window, right ?
xD
Yeah we better put you outside for at least 1 hour per day to make sure the room doesn't become too smelly
Without very good skills you won't get good money anywhere
ok then make sure to add as much references to your portfolio as possible
defer edit?
never heard of it
i am using v13 btw
You can defer an interaction then delete it
If that's what u wanna know
In order to not respond to it
(It still is a response of course)
so it would be, interaction.deferReply(), interaction.delete()?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
type 6
I don't see while this should be useful
At least send an ephemeral message saying whatever worked
otherwise the user is flooded with those messages
I would highly recommend against music bots but whatever. Read what I sent
it has like 10 buttons or something
this DEFERRED_UPDATE_MESSAGE*?
yes
Int 6, yes
that's defer edit
where's the usage of it stated as i only see the definition?
I assume djs has a method for it too
POST /interactions/:interaction_id/:token/callback
{
type: 6
}
That's the HTTP request you make to respond with a defer edit
Djs has its own deferEdit method
or deferUpdate
whatever it is
👀 why are we giving a direct api response then
oowh is it interaction.update()?
It takes parameters tho, so what should i input there?
No update is type 7
i am searching through the djs guide but can only find this .update() method
Technically without updating the original message the result should be the same
strange taht you can't not reply to an interaction
For example updating an empty content
To an empty content
Will not cause discord to edit the message at all
(edited) will not be shown
What?
wah
You can for button interactions
It's strange that i must reply to a button interaction
Not for other types
You don't have to reply
It will give me the interaction failed message.
You still have to tell the api that you don't wanna reply
ye
how
Well Papi already explained how
I'm just not sure if djs had inbuilt methods for this
hmm thats sad
You can also try what I told you
this?
Using updste() to edit the original message without updating it at all
hmmm
For example updating an empty content
so we could use interaction.update() without any parameters specified?
This is not what api expects but should also work
Not without
But with ({ content: "" }); for example
Unless your original has content
aha i see!
I am basically hosting multiple music bots
they are connected through a simple express server
https://discord.js.org/#/docs/discord.js/main/class/ButtonInteraction?scrollTo=deferUpdate
that was not that hard.
So the main bot that sends them to the other bots just needs to delete the interactions ig
He's on v13
But the method has the same name
As I can see
yes and I added its also available for v13
Since your link goes to the main branch
Aka v14
There we go
@eternal osprey
If you haven't noticed yet
Mr Papi has searched the deepest depths of the docs
Well I can't lookup any given method that could be the right one, head over to GitHub and check if that's the case while driving
But when you sent the link I remembered we had this a while ago already
But I couldn't remember anymore
Also what sort of trolling do you mean?
I wonder
I just said he's using v13 not the main branch
You have actually confused me more than I you I guess

I meant Chitty
lmao
chitty chatty chit chat cheat sheet shit shat
Man Papi is more confusing than me
Didn't know that's possible
(and allowed)

So Tim... meanwhile I found a warm and dark room in my house you can live in
Even has cold water and electricity and internet
oh my
Heating room
In between house and garage, yeah
But I will add some bars instead of the door to prevent Tim from running away make a save place for Tim
xD
Yes I'm hosting my own blockchain, don't worry
Lebron James Sprite cranberry shitpost.
// I have just one
const answer = await db.query("WANT A = $1", ["sprite cranberry"]);
console.log(answer); // clear
This was a super powerful meme when it first came out
lol
If they dont reroll the ads for eternity I'll be pissed
i love dealing with unicode
@radiant kraken you love decancer
btw decancer is used in revanced bot
i told osumatrix about it months ago :teef:
it has 52 stars now 
thanks!!! but please tell him to update to the newer versions soon
im currently working on a rewrite that uses binary search
o
holy
fr
builder isnt hard to maintain but i cant rly maintain it
i can rn cuz i didnt go to school
because i cant 💀
Hecker
@earnest phoenix help my binary search is stuck on an infinite loop nevermind fixed it
hey umm
im wondering is there a way i can set a scope like an id for one specific execution instance which calls other functions
for example, lets say i have a logger configured and i want the logger ID to be same across multiple functions and change when there's a new request
keep in mind im not passing the req obj to all of these functions
id
constructor() {
}
setid(id) {
this.id = id
}
log(text) {
console.log("log id ---", this.id, text)
}
}
const logger = new Logger()
const anotherFunc = () => {
logger.log("something new another")
}
const boot = async (id, time = true) => {
logger.setid(id)
logger.log("before")
if (time) {
setTimeout(() => {
anotherFunc()
}, 3000);
}
}
boot(123)
setTimeout(() => {
boot(555, false)
}, 2000)```
This for example. i want the logger id to be 123 when "anotherFunc" is called after 3 seconds even tho the id was set to 555 after 2 secs by another function call.
im sure this is incorrect, just want to find a way to implement this
or if its possible to do so. im sure there is a way cause google cloud logging does it when your app is running on their cloud run
class Logger {
constructor(id) {
this.id = id
}
log(text) {
console.log("log id ---", this.id, text)
}
}
tried this
if i call new logger inside of boot
how will i be able to access it in anotherFunc?
you create another logger there
but i want the id from boot and func inside boot to have same id
and not new ones
if boot is called once again only then have diff id
you pass the logger instance as a function parameter
yeah thats what i wanted to avoid because then i will have to keep passing it into all of my inner functions
if there are more "anotherFunc"
then put it somewhere you can access
that becomes a global object right?
which when there's a new request the id might be modified
classes are meant to be created multiple times, and each instance will always keep its own id, it wont change
mmm lemme try something ig
what you're trying to do requires creating a context on which all your other functions run
thats usually done using a larger class that contains all your functions
mmm
otherwise you will need to constantly keep passing the values
thats also known as funcional programming vs object oriented programming
i see
can you send an example
functional programming is where everything is standalone functions, but all context needs to be passed as arguments to them
object oriented is usually classes and subclasses, where the context is always stored and accessed in some this
id
constructor(id) {
this.id = id
}
log(text) {
console.log("log id ---", this.id, text)
}
}
export new Logger
This what i do? in a diff file










