#development
1 messages · Page 182 of 1
Which is it? Kevin? Day?
I have a discord channel in the support server where a message gets sent if someone votes
Another way may be to send a "vote reminder" each time a command is used in a row. I've seen a lot of bots do something like this
It's probably not that pushy because they use commands anyway
What a strange name 
nagbar next to the navbar
brilliant
cant find the VC i dont know why
else if (DevCode === "hooligang") {
const VCID = "1185235397266116611";
const Song = path.join(__dirname, "../../assets/dev/hooligang.mp3");
console.log("Attempting to join voice channel and play audio...");
try {
const guild = await client.guilds.fetch(interaction.guildId);
const channel = guild.channels.cache.find(ch => ch.id === VCID && ch.type === 'GUILD_VOICE');
if (channel) {
console.log("Voice channel found:", channel.name);
await interaction.reply("Joining voice channel and playing audio...");
const connection = await channel.join();
console.log("Connected to voice channel.");
connection.play(Song, { volume: 1.0 });
console.log("Audio played successfully.");
} else {
console.log("Voice channel not found.");
}
} catch (error) {
console.error("Error:", error);
}
}
ok now its saying this but the channel is valid
You don’t need to use .find here
Just use .get('ID')
Channels are not always cached as well iirc
Fetch the channel
When in doubt, fetch it out
thanks @wheat mesa
i updated it to use @discordjs/voice
new bug:
Bot joins VC but doesn't play audio
const { SlashCommandBuilder, Client } = require("discord.js");
const { joinVoiceChannel, createAudioPlayer, createAudioResource, VoiceConnectionStatus, entersState, StreamType } = require("@discordjs/voice");
const path = require("path");
const { createReadStream } = require("fs");
module.exports = {
data: new SlashCommandBuilder()
.setName("devcode")
.setDescription("[RoSearcher Developer Command]")
.addStringOption(option =>
option
.setName("code")
.setDescription("Dev Code")
),
/**
* @param {Client} client
*/
async execute(interaction, client) {
const DevCode = interaction.options.getString("code");
if (interaction.user.id === "919674489581731842") {
if (DevCode === "dancing") {
interaction.reply("https://cdn.discordapp.com/attachments/1191594940103413843/1201633679559106601/738440555e611e49c51b3c2bebed6edb.mp4?ex=65ca8792&is=65b81292&hm=14e0f702b249d5b9c4f444ab6044e7ff66e1dd926b56dfe008c41569a2ee4745&");
} else if (DevCode === "boo") {
interaction.reply("https://cdn.discordapp.com/avatars/972502840247484527/6cc277505fcd2b642936883acceccdce.png?size=1024");
} else if (DevCode === "hooligang") {
const VCID = "1185235397266116611";
const audioFilePath = path.join(__dirname, "../../assets/dev/hooligang.mp3");
console.log("Attempting to join voice channel and play audio...");
try {
const channel = interaction.member.voice.channel;
if (channel) {
console.log("Voice channel found:", channel.name);
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: interaction.guildId,
adapterCreator: interaction.guild.voiceAdapterCreator,
});
connection.on(VoiceConnectionStatus.Ready, async () => {
console.log("Connected to voice channel.");
const player = createAudioPlayer();
const resource = createAudioResource(createReadStream(audioFilePath), {
inputType: StreamType.Arbitrary,
});
player.play(resource);
connection.subscribe(player);
try {
await entersState(player, VoiceConnectionStatus.Playing, 5000);
console.log("Audio played successfully.");
interaction.reply("Joining voice channel and playing audio...");
} catch (error) {
console.error("Error playing audio:", error);
}
});
connection.on(VoiceConnectionStatus.Disconnected, (err) => {
console.error("Disconnected from voice channel:", err);
});
} else {
console.log("User is not in a voice channel.");
await interaction.reply("You need to be in a voice channel to use this command.");
}
} catch (error) {
console.error("Error:", error);
}
}
} else {
await interaction.reply("You do not have permission to use this command.");
}
}
};
Bruh
WHERE DO I GET HELP FOR A RCE KILLFEED BOT
“Oh their discord is great they’re always lending a helping hand” IVE BEEN HERE FOR HOURS AND THIS ENTIRE DISCORD DOESNT EVEN MENTION RUST WTF
It is probably recommended for a thousand servers. At two thousand your bot will not connect without sharding, but the sooner you prepare for it, the better, depending on the sharding you want to use
Depends on what type of bot you have and your architecture.
If you're running into issues where 1 thread isn't able to process ws messages then either your gateway wrapper sucks or you have expensive logic and that's when you should shard. Benchmark it
Having to process MESSAGE_CREATE is a huge performance hit and if you can avoid it, do.
If they don't want to help you on their support server, you won't find anyone like that here either
discord.js (just using it as an example) is also a pretty bad architecture because they make use of the ws module. Thanks to good ol Tim, the gateway wrapper I maintain has a slimmed down ws implementation with its own fast etf encoder and decoder. Not plugging, just saying that your libraries play a big part of your performance and it's good to take heapdumps and run timings
I used djs before and ran into horrible event loop lag because of processing a ton of message creates. This was at around 7k+ guilds 3 shards
Now I can put all of my shards on a cluster on the same thread and things are a-o-good
Though I also dont have to process message creates
Not having any problems atm with interactions
My only concern is events honestly
What libraries are you using?
I am using djs💀
CloudStorm for ws and SnowTransfer for HTTP
CloudStorm is just a better sharding manager right?
no. It is the gateway connection
@wheat mesa me when my rust struct is not CoreWrapper<CtVariableCoreWrapper<Sha256VarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, _>, _>, _>, _>, _>, OidSha256>> 😔
What in the actual fuck

I mean they are the wrong types xd
Uint<Uint<Uint<Uint<Uint<Uint<>, _>, _>, _>, _>, _> lmao
what even is the reason for such deep nesting?
Anyone knows how vote reminders logic work?
There are probably several ways to do this
can you tell me 1
The most logical way is to take the date from the webhook when the user voted for your bot and then add 12 hours to this date and, for example, check the database every few minutes for timestamps that have already passed, i.e. 12 hours have passed since the vote
check every hour, then schedule all reminders within that hour as setTimeouts
this way u access the db only once

I'm thinking about just setTimeout when the user votes
and schedule all reminders again If I restarted the bot
does this work or will consume more resources?
all right will apply that thx
can somebody help, I implemented this code so I can ush emojis into my db, but I am frasturated, any way I can add a check for default emojis ? :
await Promise.all(
emojis.map(async (emoji) => {
const match = emoji.match(/(?:<a?:)?(\w+):(\d+)>?/);
if (match) {
const emojiName = match[1];
console.log("Emoji Name:", emojiName);
const emojiValid = interaction.guild.emojis.cache.find(
(emoji) => emoji.name === emojiName
);
if (emojiValid) {
await abot.db.push(`autoreact_${interaction.guild.id}`, {
emojis: emoji,
});
interaction.editReply({ content: `Added ${emoji}` });
} else {
interaction.followUp({
content: `emoji ${emoji} is not a valid emoji, I cant find it!`,
});
return;
}
}
})
);
cant find anything in the docs
Please don’t use an async function inside of a map
beware, if you're using mysql the maximum length for VARCHAR is 191, if you use the default length of 255 it'll cause errors when saving and/or potentially corrupt other rows
that is, if you're saving unicode emojis on the db
I am not, I am using mongo db, but that is not the issue here
async map combined with promise.all is a totally valid use case, nothing wrong with it
Really?
I was under the assumption you never combined an async function inside of map
using async inside of a map will essentially convert all items into promises
there are many use cases for that
Perhaps I was thinking of people doing await something.map(async x => …)
yeah that doesnt really do anything
Since that await wouldn’t stop anything
Random question, can you link commands, in an embed?
yes, you can
cheers mate
Just one Promise.all from making the magic happen
One of the devs I worked with on my bot sent this
They do know rust, but :)
Thats probably how I'd do it
also thats just jsdoc not ts directly. Ik jsdoc is backed by ts but
sounds like excessive typing
They avert ts because they want to skip the build step. It also complicates the file tree sometimes when there is a build step involved since we also wrote our own hot reloader and make use of it heavily so something like minification isn't an option
Ive also had it happen where ctor names are changed between builds
getting people inviting and kicking my bot repeatedly, this happened on a previous bot too, they invite it keep it for 30 or so seconds without doing any commands or anything then kick it,.then they repeat maybe ten times, sometimes it ends with the bot staying other times not.
I don't think they just didn't like the features as they didn't try any,.I'm thinking something like wick is fighting the inviter.
has anyone else seen this, I've seen it on several bots now and it's annoying from a retention standpoint.
It probably happens in a lot of cases, but no one pays much attention to it
I don't know what could be the reason for this, but let's just say that I wasn't even that interested in it
Situations like this are an everyday occurrence and it doesn't surprise me after a year
wick kicks instantly
hey can i force a user to be in specific color in my bot page? from this.
i asked that in the support channel so i know that i can do that using css but like how can i do that?
didnt see this channel so maybe someone here knows
yo, is it not allowed to save recently deleted message in temporary cache
according to discord, no
lemme guess, you were making a snipe command
you can output it to a log channel
Quick question anyone know a good service to accept payment for a premium system?
chargebee+ Stripe
so do you want people to trust you to enter their details into your site and take money from them
or do you want to stay anonymous? there are no legit anonymous real businesses
i mean like i dont know my own SSN
well you'll need it
i can ask
for a great many things
also you need to be an adult
I assume you are, right?
you can't sign the contract and get merchant accounts and stuff <18
he’s like 14
no go then unless you get a parent or legal guardian to administrate the business side for you
this is one of many reasons you don't meet many 14 year old business owners
that and if your bot takes off running the business side takes a fair bit of free time
Beautiful flags on the website :3
I get that I'm probably missing noto-fonts-emoji package or whatever it's called
no wait it's installed
intereseting
thx
that appears to be the screenreader caption, and besides, flags are supported in most default fonts anyway
try seeing if there's any error in F12 menu
#topgg-api too
im 16..
Could’ve sworn I remember you saying you were 14 like not too long ago
Either way still too young for a stripe account
It was almost a year ago 
does anyone know any good wake word engines out there? i attempted using Picovoice but when using it with Discord audio it’s not very accurate although on the browser it is.
i’ve also attempted to use Snowboy but it’s too outdated, couldn’t even get it to work due to a billion deprecated things and i don’t think it would be very practical
Yeah you wont be able to legally charge money from people I had to wait to turn 18 before being able to use those services
Stripe needs you to be 18
Discord aswell
You need to be of legal age to sign conttacts, since you essentially are
So you’ll have to get a guardian to do that for you

I think the python version is cleaner, on the right is the old JS one and on the left is new Python version which is part of a rewrite
they'll both end the same tbh
the extra lines are the fields TS side has that py doesnt yet
pythons syntax was made so that 5 year olds can understand it
is there any guide of how to make html for long description
my html code just don't show right when i review the page!
any html tutorial in general
dont use <body> or <head> tags tho
they'll prevent the inner code from working
I got this working :3
even then they still couldn't get over the indentation tho 
The only reason it's cleaner is partly because you aren't making use of modern JS syntax like optional chaining and you are unnecessarily repeating some variable names when accessors can be chained
and those replaces could be swapped for map + loop
and as FaKe always said, just use the embed constructor instead of method chaining
👀 also a typed language vs a non typed language.
While those checks all happening inside TS are not entirely strictly necessary here they in theory make the code safer and less likely to error.
Since the post is about clean code, I personally would suggest making a getMemberJoinSettings function.
You'll need to get those settings at other points in your code anyway, and adding a function to handle getting them all will make it easier to add other potential settings later on.
But that suggestion is a personal preference. Not everyone likes going that route.
Valid
I don't think it's just a Java thing. Having it be in a function would mean JIT can happen faster for that code
hi
does anyone know any good wake word engines out there? i attempted using Picovoice but when using it with Discord audio it’s not very accurate although on the browser it is. i’ve also attempted to use Snowboy but it’s too outdated, couldn’t even get it to work due to a billion deprecated things and i don’t think it would be very practical
👀
With the price of picovoice I assume this is a one off single server bot, or a public bot which will be paid and will likely be intended for large communities. would requiring a high bitrate voice channel be a viable solution instead?
You may also want to just play around with the wake word you choose, could be more reliable
Ayo nah 500/month is crazy
I mean I get it
but no way should someone be using that in a bot
unless they for sure know its going to succeed
Hello, I have a cache DB and a Data Base in MongoDB now data is what I save in my cache and data[db[subCommandGroup] could be feature_auto_thread_channels or feature_auto_publish_channels now I know how to update it in cache but don't how to update it in DB and what should I write instead of AAAAA the only way I know is updating both of them like the second code
data[db[subCommandGroup]].splice(index, 1); // Update in Cache
await guildsModel.updateOne( // Update in DB
{ guild_id: interaction.guild.id },
{ AAAAA: data[db[subCommandGroup]] }
);
data[db[subCommandGroup]].splice(index, 1); // Update in Cache
await guildsModel.updateOne( // Update in DB
{ guild_id: interaction.guild.id },
{
feature_auto_thread_channels: data.feature_auto_thread_channels,
feature_auto_publish_channels: data.feature_auto_publish_channels
}
);
Running into an odd issue, simply put:
vc.permissionOverwrites.edit(interaction.guild.id, {Connect: null,});
This ignores setting the connect value to not have a specific override anymore, is there any other way to fix this?
Discord JS v14 btw.
should it be connect not Connect?
Nope, not sure why it does need to be Connect however, but that isn't the issue, it is that it accepts both true and false statements for the appropriate permission, so to allow or deny it specifically, however assigning it null will not set it to neutral in-between.
I wonder how long it would take to program a bot in assembly
would that even be possible since you would have to write everything down to various messaging protocolls
also this was supposed to be a responce to another message but discord did the thing where it didnt scroll to the bottom
oh well still an interesting thought
not really, you could use something like concord and not have to reinvent the wheel for the interaction with the api
lmao I hate when that happens
it's a C discord api lib
theres a discord api in C????
the api is language agnostic, you just need to interact with it however you want
damn that means I could program an esp32 to host a discord bot
it's just a bunch of web requests, wanna write a bot in common lisp? Then use the API directly or find a library that does most of the heavy lifting for you or abstracts everything into a nice layer
sounds fun
I kinda want to give the assembly discord bot a try
yk what I'll do it out of sheer boredom
@wooden ember bot's online
the bot does nothing
it just connects to the gateway
but hey
it's written in assembly at least
I'm gonna make it respond to a ping command
congrats
sounds pretty simple enough
I mean I don't plan on turning this into my next project
just listen to a message event -> check if the message content is !ping -> respond with pong
yeah it's pretty simple
cursed
Gateway and rest is pretty challenging if you follow the guidelines to the T even for something like JS
he just used a C library and use it from assembly
ah ok
Not as impressive but still
make the bot in C and then compile that C source into an assembly file 

it's done
can anyone help?
Does anyone have recommendations or best practices on how to test new features of a verified bot? I am trying to test the discord premium app features, and I need to keep the stable version running, but also run another version for testing. Should I implement a testing mode where the testing version does not handle any interactions besides those of testing users?
i am using bootstrap. On pc it's awesome but on here it isn't quite what i am looking for:
<section
class=" mt-5 container-fluid d-flex align-items-center flex-column">
<p class="text-dark fs-1 fw-bold text-shadow text-center mt-5 mb-0">Maak kennis met Sivas</p>
<div class="container-fluid w-50" style="height: 3px; background-color: rgb(219, 172, 52);"></div>
<p class="text-light fs-md-6 fs-lg-5 fs-xl-4 w-50 text-center m-5">
Sfeerhaard Sivas brengt warmte en gezelligheid in elke ruimte. Met zijn moderne design en realistische vlammen creëert
deze haard een sfeervol en ontspannen ambiance. De gebruiksvriendelijke bediening en energiezuinige technologie maken
Sivas de perfecte aanvulling voor een comfortabele en stijlvolle atmosfeer.
</p>```
hell yeah!
verry cool
even uses / commands
I expect they are easyer to code for these dayse since they have their own endpoint and dont have to scan every message but either way it works.
how much ram does it use?
does anyone know an efficient way or storing and retreiving user guilds using next auth? my current attempt is to:
fetch them from discord api upon login ->
store them in mongodb
then when a user goes to /manage for example, i would make a request to my nextjs backend to get the users guilds rom the db.
it works but i feel as though it's nowhere near the most efficient or good practice way of doing it
i'd advise you not to store guilds
Or any discord entity whatsoever
imma store your mom
make an API request to Discord whenever you need the data and then cache it temporarily on your frontend
if you store the guilds you'll also have to ensure that guild data is not stale (i.e. update the database if the user joined more guilds or left some)
I can check but it probably uses a few KBs
the entire thing is using 182.076MB, so still quite a lot
but yeah, the main process itself uses just a few KBs
the rest are from the external libraries
One message removed from a suspended account.
One message removed from a suspended account.
damn thats worse than If I just used js
fun
huh, pmap is reporting odd numbers, I might need to use a different tool
found the culprit
~35.9MB For the "assembly" bot
~113.9MB For the js bot <- run using node
ayo tim how are you do you have time I am confused af and need professional help 
One message removed from a suspended account.
I want to create a command to refresh my commands so that way I dont need to restart bot to update a file so basicly I set command files in client.commands collection again but there is a problem!
my bot is sharded so if I use the command it will only refresh the commands for the shard I use the command on it
soooo I should use broadcastEval to run it in all shards
this is my code
await client.shard.broadcastEval(cli => {
const fs = require('node:fs');
fs.readdirSync('./commands/messages/').forEach(dirs => {
const commands = fs.readdirSync(`./commands/messages/${dirs}`).filter(files => files.endsWith('.js'));
for (const file of commands) {
const command = require(`../../../commands/messages/${dirs}/${file}`); // Ignore this one
cli.messageCommands.set(command.name.toLowerCase(), command);
delete require.cache[require.resolve(`../../../commands/messages/${dirs}/${file}`)];
};
});
});
and I tried all of these:
const command = require(`../../../commands/messages/${dirs}/${file}`)
const command = require(`./commands/messages/${dirs}/${file}`)
const command = require(`../${dirs}/${file}`)
const command = require(`${__dirname}/commands/messages/${dirs}/${file}`);
const command = require(path.join(__dirname, 'commands', 'messages', dirs, file));
and for all of them I get errors like these:
Cannot find module '../../../commands/messages/admin/eval.js'
Require stack:
/root/VOID/node_modules/discord.js/src/client/Client.js
/root/VOID/node_modules/discord.js/src/index.js
/root/VOID/bot.js
Cannot find module './commands/messages/admin/eval.js'
Require stack:
/root/VOID/node_modules/discord.js/src/client/Client.js
/root/VOID/node_modules/discord.js/src/index.js
/root/VOID/bot.js
Cannot find module '/root/VOID/node_modules/discord.js/src/client/commands/messages/admin/eval.js'
Require stack:
/root/VOID/node_modules/discord.js/src/client/Client.js
/root/VOID/node_modules/discord.js/src/index.js
/root/VOID/bot.js
I asked in djs server and they told me this:
That‘ll not gonna work. that code will be evaluated inside the Client class. Which is somewhere deep in your node_modules folder.
so now I wanna know how can I refresh my commands without restart the bot 
try ```js
const command = require(${process.cwd()}/commands/messages/${dirs}/${file})
Gonna need a few PB for that
lol im at the devils number 
☠️ I’ve had that before
luckily there was literally no data
yeah
rip
I installed latest Node JS Version on the VPS but when I use node --version it shows me
root@iTzLinux:~# node --version
v16.20.0
then I try to install it again and shows me this
root@iTzLinux:~# nvm install v21.6.1
v21.6.1 is already installed.
Now using node v21.6.1 (npm v10.2.4)
how can I delete all node js versions from my VPS and install latest one
Tnx a lot it worked 
1 more question with this command I can refresh my commands and events
But there is a problem after this part all events will run twice how can I stop old eventns and start new ones? 
if (context.needToUpdate.includes('events')) {
fs.readdirSync('events/').forEach(dirs => {
const events = fs.readdirSync(`./events/${dirs}`).filter(file => file.endsWith('.js'));
for (const file of events) {
const event = require(`${process.cwd()}/events/${dirs}/${file}`);
cli.on(file.split('.')[0], event.bind(null, cli));
delete require.cache[require.resolve(`${process.cwd()}/events/${dirs}/${file}`)];
};
});
};
u have to store ur events inside an array to remove them and then re-add them
how to remove them?
cli.removeListener()
cli.removeEventListener()
ah they renamed it
they never did
wasn't it removeListener?
nvm ls, and then nvm uninstall vX.X.X
its removeListener for node js
there are both lmao
removeListener
removeEventListener
lol tf
which one is deprecated?
ok just a question what should I pass as a call back?
the function u provided
that's why u store them. im not sure if it'd work if u remove the listener using the new function
i doubt, they're different functions
delete -> load events -> register
well I load them like this
// Bot.js
client.events = new Discord.Collection(); // Add this line just now!
fs.readdirSync('events/').forEach(dirs => {
const events = fs.readdirSync(`./events/${dirs}`).filter(file => file.endsWith('.js'));
for (const file of events) {
const event = require(`./events/${dirs}/${file}`);
client.on(file.split('.')[0], event.bind(null, client));
client.events.set(file.split('.')[0], event.bind(null, client)); // Add this line just now!
delete require.cache[require.resolve(`./events/${dirs}/${file}`)];
};
});
then in refresh command I will do it like
// Refresh Command
fs.readdirSync('events/').forEach(dirs => {
const events = fs.readdirSync(`./events/${dirs}`).filter(file => file.endsWith('.js'));
for (const file of events) {
const event = require(`${process.cwd()}/events/${dirs}/${file}`);
const callback = cli.events.get(file.split('.')[0]);
cli.removeEventListener(file.split('.')[0], callback); // Add this line just now!
cli.on(file.split('.')[0], event.bind(null, cli));
delete require.cache[require.resolve(`${process.cwd()}/events/${dirs}/${file}`)];
};
});
is it right?
make sure the event exists before attempting to remove the listener
i think that would crash during first time no?
well if they didnt exists they wouldnt add in the events collection
@pale vessel was that correct?
only one way to find out
Bot.js
client.events = new Discord.Collection();
fs.readdirSync('events/').forEach(dirs => {
const events = fs.readdirSync(`./events/${dirs}`).filter(file => file.endsWith('.js'));
for (const file of events) {
const event = require(`./events/${dirs}/${file}`);
const eventName = file.split('.')[0];
const callBack = event.bind(null, client);
client.on(eventName, callBack);
client.events.set(eventName, callBack);
delete require.cache[require.resolve(`./events/${dirs}/${file}`)];
};
});
Command
const keys = [...cli.events.keys()];
for (const key of keys) {
const callback = cli.events.get(key);
cli.removeEventListener(key, callback);
};
fs.readdirSync('events/').forEach(dirs => {
const events = fs.readdirSync(`./events/${dirs}`).filter(file => file.endsWith('.js'));
for (const file of events) {
const event = require(`${process.cwd()}/events/${dirs}/${file}`);
cli.on(file.split('.')[0], event.bind(null, cli));
delete require.cache[require.resolve(`${process.cwd()}/events/${dirs}/${file}`)];
};
});
okay Ig it gonna work
cli.removeEventListener is not a function

fixed
kms
Perfect plug to move to biome 
https://biomejs.dev be cool live on the edge
(Has its ups and downs tho. Not a perfect replacement)
{ "rules": {
"prettier/prettier": "warn",
"consistent-return": "off",
"react/jsx-props-no-spreading": "off",
"react/no-array-index-key": "off",
"no-param-reassign": "off",
"line-comment-position": [
"warn",
{
"position": "above"
}
],
"import/prefer-default-export": "off",
"no-await-in-loop": "off",
"no-continue": "off",
"no-restricted-syntax": "off",
"no-console": "off",
"import/no-extraneous-dependencies": "off",
"import/extensions": "off",
"@typescript-eslint/no-unused-vars": "warn",
"import/order": [
"warn",
{
"groups": [
"builtin",
"external",
["internal", "parent", "sibling", "index"],
"type"
],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"@typescript-eslint/array-type": [
"warn",
{
"default": "array-simple"
}
],
"default-case": "off",
"no-nested-ternary": "off",
"no-duplicate-imports": "off",
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports",
"fixStyle": "separate-type-imports"
}
],
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/consistent-indexed-object-style": "error",
"@typescript-eslint/consistent-generic-constructors": "warn",
"@typescript-eslint/consistent-type-assertions": [
"error",
{
"assertionStyle": "as",
"objectLiteralTypeAssertions": "allow"
}
],
"@typescript-eslint/method-signature-style": ["error", "property"],
"react/jsx-filename-extension": "off"
}}```
if these rules can be carried over then sure
🫠
- airbnb
What was the reason for the eslint server crashing? Any outputs
it just doesnt wanna be anymore
it's written in Rust?!?!?!!! 🚀
First message after lockdown 
first message after first message after lockdown
first Message after the First Message after the Second Message
fourth message
💀
i got through some stuffs
Finally retroactively going through my code and removing alot of Array based logic where I either need indexing and/or dont need an ordered list
bad stuff?
Should give a decent performance uplift at scale as I was using an array for storing websocket sessions and had to filter a lot to send events to subscribers to a guild
yep
it was bittersweet though
@lyric mountain soo i am still new to Java (and especially Gradle) and i've recently been working on adding a Java binding to my Rust project as my first attempt at a Java library
How do you go about publishing and later importing a Java library? So far now i can build a jar file from it, i've scoured around github and they all have different approaches into installing and/or exporting their libraries
https://github.com/null8626/decancer/tree/main/bindings/java
real
decancer givecancer
funny
Look up “how to publish a java library” I think gradle actually has a decent example
Surprisingly
well, it's a bit bureaucratic (is this the word?)
but once ur done setting up your credentials it's pretty easy
just note that mavencentral doesn't allow ovewriting versions
so once u publish, it's final
tbh, the more advanced you get in coding, the more configuration related shit you spend time on 😭
well advanced is advanced
take it or leave it
most of the time the config doesn't even relate to the project
😔
e.g. react-native
like what the fuck
using expo now because the setup is way easier
but wtf
its for my phone
sounds like the same for every other package manager like Cargo and npm
first expo app thing, gps tracker
Planefly
wha
yeah, permanent versions are a norm in any trustable repository
car go
plane fly
okay?
bro.
since, yk, you wouldn't want someone to break your version
alright
read it slowly, dont rush cuz there are some details that are annoying to find if you miss them
it'll build an artifact during deployment
u dont need to manually send anything
oh also
remember to javadoc everything
oh right
helps building a reputation, since there's a score
there's also tests right with @Test
idk, I never write tests 
i see them everywhere
I believe all javadoc features are supported
oh btw @lyric mountain what is pom.xml for? how does it differ from build.gradle?
pom is for maven, build is for gradle
they're the equivalent of pubspec.yaml or package.json
bruh
so which one should i use
i am using gradle to publish something to maven central
build
gradle is built over maven
mavencentral is just the name of the main repo
so ive been busy while this place was locked down
same
the language i built to represent game locations got some bigger muscles.
there used to be jcenter, but it closed last year
u can put ur library in as many repos u want, tho mavencentral is the "de facto" repository
ew why do you use html-style syntax
because its a markup, for displaying text content
lol
tough, theres thousands of locations of pre-existing content
i guess i could make a migration that changes them all to </endif>
but <else> will still throw out parsers
do if and fi like bash
OH GOD NO
^
lol
or </if>
bash is not a shining example 😄
why not while and elihw while we're at it
case esac
foreach and hcaerof
how about at the top of the program we have to put tixe
backwards exit

yes
someone should make a palindrome language
write rotcurtsed for constructors
where the code can be read both ways and still compile the same
so in real world, outside of test scripts, this is what the language does
its called paragraph, and its about 18 years old, give or take
so its to format embed messages
ive used it in other iterations of the same game, outside of discord
but the premium areas i want to make, would be an absolute ballache to do with paragraph alone, so i integrated duktape for js script tags... they run server side of course
which is safe because nobody but devs would add location content
its the same parser as Sporks, but with the restrictions removed on max memory and runtime
yes, sorta
its to form the entire content of a game location, which is conditional based on state
Just trying to be able to use it in my project, there seems to be an entire subreddit dedicated to just trying to compile this shit for CMake lmao
and also to form the links of where the player can go next
managed to pass in complex objects 🙂
so the idea of adding this is so that i can add self-contained minigames to locations
i need to add some functions that let js call tags
which should be easy enough
but for now, time for a break 🙂
Interesting, custom language?
yes
a custom language for game content in my RPG
I have 86,000 words of text content written in it
damnn
I'm quite proud of the bot
you included i18n right?
...right?
no
there's no need
I have no intention of translating an 86000 word interactive novel
does nextjs like support databases and shit in the api routes
come to flutter
fairly similar to react but u dont need to deal with expo bullshit
it's jsx?
not exactly

but it does use a tree-like structure like react
oh changes and differences im going to go crazy with this autism
also it supports multiplatform out of the box
sounds like expo
yeah, but vanilla
and it compiles locally, not on a remote server like expo
so no queues
Flutter is awesome
10/10
It hasn’t been the smoothest experience since my frontend knowledge was already shaky but I gotta say that it’s super easy to set up compared to anything else, and it’s pretty damn fast
Hot reloading is a nice plus
my first shitty expo app
2 hour wait for something that would’ve taken you 10 minutes in flutter
Sounds like a workflow issue
expo is too much dowtime indeed
idk why they made it like that, offloading compilation to a central server
well i guess kinda with the same idea as docker
it always works
environment etc
but gh actions etc is way faster
hey cuties
would anyone know something i could fill this site up with?
it's a bit too empty, what can i do with the sides to make it look a bit better?
add a faded-out stock photo of someone laughing at a computer screen
now being serious, I cant say anything as I dont know what the site is about
Image being from north belgium 💀
we call that the netherlands
as soon as i am done with school i am getting the fuck out of this country.
I need a warm place man
say less! On it
Is Discord doing alright? 
I basically uploaded an image through their handler and it says "Not a valid value" 
the image is either probably > the max size you can upload or something else. Alternatively, more than one attachment isnt supported for app commands which would suck
I guess it was just a hiccup, pretty annoying though
haha, this is insane
so a paragraph script can have embedded js inside a script tag.... and the embedded js inside the script tag can have.... paragraph evaulated in its tag() function 😄
its like inception, just with programming languages 
and all this runs inside a bot written in C++ 
trying to get opengl running with clion/cmake and linux... this is an actual nightmare
cannot for the life of me figure out how to link it, keep getting "undefined reference to ..."
Anyone know how to properly do this? I have built glfw myself and run sudo make install
It's in /usr/local/lib/
And yet for some reason trying to link with -lglfw still cannot apparently find it
jesus finally got it to work
cmake_minimum_required(VERSION 3.26)
project(GameEngine)
set(CMAKE_CXX_STANDARD 20)
set(GLFW_LIBRARIES glfw3 dl m GL GLU X11)
find_package(glfw3 REQUIRED)
add_executable(GameEngine main.cpp
glad.c)
target_link_libraries(GameEngine ${GLFW_LIBRARIES})
target_include_directories(GameEngine PUBLIC include)
``` much more difficult than it should've been
pog
why does using third party Java libraries feel like linking C/C++ libraries
it's sooo hard
😭
@dense flame 
these are always funny
why they join here out of all places to promote dropshipping will always suprise me
A better question is why "dopshipping" is not added as a forbidden word in the automod
hm?
wdym hard?
if you're using gradle all you need to do is add a line in dependencies
if not, just open project settings and add it there
on gradle?
lul, are u using intellij?
NO LMAO
i use Notepad++
😭
my computer would die if i were ever to use intellij
...wait ur talking seriously?
doing java without a proper ide is very difficult, that explains it
if you have a remove server, you can do server-side programming
to alleviate the burden on your pc
i'm genuinely being serious
feels like i'm coding in C again with how long it takes to do things correctly 😭
oh btw do you know how to run javadoc on things cuz as u can see in the terminal... well
yeah you're doing it the hardcore way
wdym run javadoc?
is there a way for gradle to document things for me
because if i just use javadoc it doesn't recognise third-party dependencies
and errors
not really, the gradle javadoc command just compiles the docs
ooo
like, it doesn't generate anything
sorry i meant compiling the javadoc comments
you can do a mock deploy to check if you missed any doc
the docs will be compiled automatically when you run gradle deploy
lemme just check which command was it
nvm, I used maven on my libs
yeah it's the javadoc command to compile indeed
on maven it was another name
thanks
apparently you need to set a classpath for your javadocs
found it weird because on maven I just run the task and it sets the classpath automatically
quite odd they changed the behaviour for gradle
nah gradle javadoc worked just fine

what were u running?
ah, only javadoc
yeah anything you need to run must be done through gradle, since everything is linked by it
@lyric mountain do you know how to make gradle display the full error message? because there's obviously no way that's possible here in a GitHub workflow
fyi the command i was running is ./gradlew test -i
the error was dumped in the file below
but I think you can also make it show on screen
lemme check
test {
testLogging {
events "PASSED", "SKIPPED", "FAILED", "STANDARD_OUT", "STANDARD_ERROR"
}
}
also found this if u like fancy https://plugins.gradle.org/plugin/com.adarshr.test-logger
fixed it, but thanks
@lyric mountain dunno if this is your expertise but found another problem here related to Java and GitHub actions
i'm trying to run ./gradlew inside a docker container
do i just install Java and Gradle manually from there?
i've already done ```yml
- uses: actions/setup-java@v3
with:
java-version: 21
distribution: oracle
- uses: gradle/actions/setup-gradle@v3
i guess i can add JAVA_HOME as a -v option here somewhere... but how so?
idk much about gh actions
nooo sadge
cant you, instead of running gradlew directly, make it run a bash script?
#!/bin/bash
export JAVA_HOME="path/to/java";
./gradlew test -i;
what difference does it make?
nvm i fixed it by adding -v /opt/hostedtoolcache/Java_Oracle_jdk/21:/opt/hostedtoolcache/Java_Oracle_jdk/21 to docker options

ah
@lyric mountain do you know about java.library.path? it doesnt seem to work here
i'm trying to add the bin subdirectory to java.library.path, but doesnt seem to work
i've added this to the gradlew script too ```
Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m" "-Djava.library.path=$(pwd)/bin"'
Hi, when designing the long description in your bot's page with html, do you need to make sure that the design is responsive on mobile + PC?
or does the webpage do it automatically?
regarding gradlew, it's best if you configure on build.gradle instead
like this
never had any luck doing it on gradlew
you might need plugin id "application"
also I believe application args (-D) only work there in fact
@lyric mountain this is fine
There's some success in those errors
what the fuck 😭
./gradlew build
mv ./build/libs/java.jar ./decancer.jar
javac -cp .:decancer.jar Test.java
java -cp .:decancer.jar Test
``` how
it works perfectly in my machine™️
why are u using javac?
you need to use only gradle for everything, it's what binds everything together
btw @radiant kraken
u can try https://www.jetbrains.com/fleet/ to see if there's an improvement over suffering with np++
ik it's supposed to be a lightweight editor at least
might as well use intellij though?
i'm pretty sure all jetbrains IDEs use the same base
which isn't lightweight already
fleet is built differently, it's not a fork of intellij like the others
at least that's what they advertised it to be - lightweight
didnt use it yet as I have no use-case for it
Pretty sure that they gave up on that one. Last time I saw a post about fleet it was using 3gb of ram lol
I think it’s just meant to feel like a lightweight editor, not necessarily actually be a lightweight editor
bruh
?
this is mine
im so confused what is the point of showing off the app data folder
I mean depends on what he has downloaded there
Some apps just put their files into the AppData 
Lemme install entire neural networks into AppData
I found Discord assets I wasnt supposed to
use atlas os 11 instead
Once you clean install windows 10 or 11, you run a program that debloats it and allows you to do some cool stuff like disable windows defender and cpu mitigations for older cpus for spectre and meltdown since those can hit cpu performance A LOT
optional
Also removes a lot of ms spyware
downside is that some built in apps are spyware
it removes the media player and photo viewer
good news is is that there's alternatives
I dont think i've once used the media player or photo viewer on my pc
This is what I found on a build of the iOS app once. My profile
So Atlas doesn't require an entire other install iso?
It just debloats the current windows install?
distributing windows isos is against ms tos
fair
So what if you want to remove atlas later?
I assume they have a tool for that
ye idk using something like atlas or tiny 11 seem pointless
Then if there is no problem, dont fix it
I have an i7-12700kf its bad at some games but still performs pretty well due to my gpu helping on graphically intensive stuff
I see the appeal on old hardware tho
It looks perfect for something that is much lower spec
once I installed atlas, I tried to go hard and add rebar support to my motherboard with a modded bios
asus bios flash util says invalid bios
I need a hardware bios flasher
my mobo doesnt have flashback
Hey guys, any sql expert?
I'm having trouble with two models, so let me explain. My previous version has a Player table with ~200 columns, but I think it's pretty bad to have this amount of columns and I know it's going to grow quickly. So I wanted to switch to a model with two tables, the first named PlayerInventoryKey which contains all the game keys and PlayerInventory which is actually user_id, key, amount. But at this point, I've run into a huge problem: I've learned that mysql stores bigint with 8 bytes, no matter what you put in it. So I don't know what to do, because sometimes I have a huge number that really needs a bigint and sometimes I just need a Tyint for a Boolean.
So my question is which model is better in the end, the one with the right types or the one where I won't have 500 columns in 2 years?
The generic one is more extensible so is more desirable
Having 500 columns also means having to transfer all of that data every query
unless you select a specific one
Basically i only make one select and then cache manage the profile
good question i guess
Also, the way I would actually do things is have one table which is pkey'd by the user ID and links to an ID for inventory. I'd then have a second table which b trees' off that inventory ID and the table is structured like this
item ID, amount
if order is necessary, can also have a third table which is p keyed by user ID and b trees off of item ID and has another column of slot ID
This was what I was working on, but the problem I was seeing was that even for a simple boolean, I'm obliged to have a bigint because my column amount is a bigint.
and to be honest I haven't found a way to get the right type and not lose storage for nothing.
Yep
Or timestamp
I think I should change it to int and it will be 4 byte lost and not 8
So it doesn't change the problem
But I also think there's no real issues
hey finest cutie patooties:
registerFont("./mont.ttf", { family: "Montserrat" });
registerFont("./armad.ttf", { family: "Armad" });```
on linux the fonts look way different
mainly because each os has their own way of handling fonts bla die bla but how can i fix it?
Like how can i ensure the font looks good again because compared to the original font it looks shit
this is canvasjs btw
are there any good templates for using cloudfare workers w javascript (discord one is pretty bare bones)? i tried looking but most of these are outdated
gradlew test refuses to work
You need to type narrow the union. You can usually do this with shared properties that are unique to each union member or if all else fails, you have to use the
if ("prop" in object) ...
syntax and that will type narrow to any union members it applies to within the block
so basically
if ("attachments" in message.data.resolved)
or well even if resolved in message.data
I think it's safe to try on undefined, but I haven't used the syntax enough to know for sure
nvm
> if ("test" in undefined) "lmao"
Uncaught TypeError: Cannot use 'in' operator to search for 'test' in undefined
still get same error
does anyone know how to fix this on react?
Error:
- csvcreator.js:115 Error connecting to MongoDB: TypeError: mongoose__WEBPACK_IMPORTED_MODULE_1___default(...).connect is not a function
React code:
import React, { useState, useEffect } from 'react';
import mongoose from 'mongoose';
import csvtojson from 'csvtojson';
import Settings from '../../../../src/backend/json/database/settings.json';
import '../../css/csvcreator.css';
const CsvEditor = () => {
const [isConnected, setIsConnected] = useState(false);
const [tableData, setTableData] = useState([]);
useEffect(() => {
checkMongoDBConnection();
}, []);
const checkMongoDBConnection = async () => {
try {
await mongoose.connect(Settings.MongoDBUri, {
useNewUrlParser: true,
useUnifiedTopology: true,
});
setIsConnected(true);
} catch (error) {
setIsConnected(false);
console.error('Error connecting to MongoDB:', error);
}
};
You dont need to ?? if "resolved" is definitely in message.data
No
you already box it as RawInteractionData
attachments is just an optional property
you can ! if you know it's there
attachments is required for the slash cmd
Then you can just message.data.resolved.attachments!
If you know it's there. The Object is possibly undefined error is remedied by !
but the answer to this is the "prop" in object
?
omg
Gotta love the ts typechecker not being able to recognize the in check
Object is possibly undefined is fixed with the ! at the end of the property access.
This error specifically is fixed with if ("prop" in object)
It cannot get more simpler than that
instead of large if else if else blocks, use switches
if attachments is this, how come [0] is null
the message stuff is just cloudfare, the actual stuff that prints is starting with { "num": {
can ts errors please get more readable
given a dns database like this, how can we now what the fqdn of printer is?
The bottom line is literally the main thing it's complaining about
the property did exist
it's just that the value doesn't match up with other properties
you dont understand the error. The type you were trying to read from was a union of multiple types and one or more union members dont have that property. You can type narrow with if ("component" in object) {…}
Why do I need this?
This is a token for using the top.gg api
Thanks to it, you can send the number of servers and/or the number of shards that will be displayed on your bot's page
sigh
your first mistake was only getting 500gb
ok
and unfortunately, wsl doesn't run on those

windows subsystem for linux
I mean so long as you have your boot loader on one of them you can run wsl on any drive
I guess ill just send a screenshot as Discord seems to be entirely unawaree of what a link is....
Bots base perms come from the everyone role, just like a user.
its possible the other issue was a bug, I'm not sure.
I know permissions can be a bit weird in cases.
Yeah, so the bot had a role with perms to External Emojis, but it still couldn't use External Emojis.
I asked here when that happened, and someone said "giving roles to an Application is useless, it only takes permissions from the everyone role and nothing else.
How do you detect a raid using a bot? Is it just on mass join/bans/channel deletes/etc?
there's nothing u can do against mass ban/channel delete
and mass join will be blocked by discord
say i have three arrays:
let userRoles = ['Admin', 'Security Moderator']
let roles2 = ['Admin', 'Moderator']
let roles3 = ['Security Moderator', 'Security Admin']
how would i check if any role of userRoles is in either array, and then return that role name? i know some() exists (js) but i want it to return the role name that matches
you coud use .find
userRoles.find(role => roles2.includes(role) || roles3.includes(role))``` for example
no worries
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm install 20.9.0
nvm use 20.9.0```
nodejs comes with npm

are you sure this is ubuntu 22
yes
so do whatever you were trying to do before
i dont even know what im doing
👀 people zip before uploading?
Have I been doing it wrong this whole time?
crazy tech
do i need to zip?
I'd follow the guide you're using.
ok
i probably did something wrong
like 10 minutes ago
when installing stuff
but ok
👀 this is an ubuntu vps right?
It looks like you put a windows path instead of a linux style path.
im trying to send a webhook with an action row, i provided type 1 but i get this error
this is what components is btw
but that's an action row inside an action row
there's no need for that array in the first image, just provide components
JSON.stringify({ content: message, components })
Sureee @clear plinth what’s my wallet address again
@fervent shale also
Why there’s random email on your pfp
@solemn latch thank you for giving my wallet address 
how exactly do i send an attachment alongside the webhook
i changed the content type to multipart/form-data
use formdata
as in the js thing
const formData = new FormData();
formData.append("content", `Message Content`);
formData.append("file-anythinghere", new Blob([`message i want to send`], { type: "text/plain" }), "filename.js");```
this works for me
what if its an object from discord
like its a file that is uplaoded from a slash cmd
and i just wanna have that img send to a webhook
the interaction should contain the file url which you could embed
but tbh im not sure how long empheral-response objects stay on the CDN for 
and i pass this in the payload right
yep
fetch("webhook", {
method: "POST",
body: formData
});```
you can remove the content part
i could append components to the formData right
yeah
for file-anythinghere shouldnt it be attachments
file-<anything> works for me atm
i upload 3 different files at once so assigning them a unique id after file- worked for me
i get Cannot send empty message
weird cuz it should at least send the msg
u need to give attachments filenames
formData.append("files[0]", blob, "image.png"); for example
u want to send a text file that contains the URL?
if u want to send an actual image, fetch the image and grab the response as a blob
or if u already have an image buffer, use new Blob([buffer])
or consider the following library:
https://github.com/DasWolke/SnowTransfer/blob/master/src/methods/Webhooks.ts#L190
If not. That's cool. I have code here people can use: https://github.com/DasWolke/SnowTransfer/blob/master/src/Constants.ts#L17
now das woke af
real shit
const express = require("express");
const app = express();
app.listen(3000, () => {
console.log("Atlas Network Started");
});
app.get("/", (req, res) => {
res.send("Hello World");
});
const Discord= require("discord.js");
const client = new Discord.Client({intents: ["GUILDS", "GUILD_MESSAGES"]})
client.on("messageCreate", (message) => {
if (message && message.content === "ping" && message.channel) {
message.channel.send("pong");
}
});
client.login(process.env.token);
why doesnt' this work
What djs version are you on?
i use replit, how do i see this?
i just chose the latest one
discord.js@14.14.1
const client = new Discord.Client({
intents:[
Discord.GatewayIntentBits.Guilds,
Discord.GatewayIntentBits.GuildEmojisAndStickers,
Discord.GatewayIntentBits.GuildIntegrations,
Discord.GatewayIntentBits.DirectMessages,
Discord.GatewayIntentBits.GuildMessages,
],
})
wow they changed alot
the last time i made a bot was in 2021
if you need any help check this https://discordjs.guide/#before-you-begin
They basically renamed everything for shits and giggles
And added cache on everything
client.on("messageCreate", (message) => {
if (message && message.content === "ping" && message.channel) {
message.channel.send("pong");
}
});
not even this works now lol
why
would they do that
Because djs devs
back in the good old days of discord bot development this was simple
It still kinda is, if you adapt to the new workflow
client.on("messageCreate", (message) => {
if (message && message.content === "ping" && message.channel) {
message.channel.send("pong");
}
});
why doesn't this work though?
That said, I don't code in js anyway, so can't say from experience
Is your bot verified?
By discord, I mean
nope
Did you enable message intent in dev panel?
And include it at client intents
Also if you're returning from 2021, I believe they renamed messageCreate event
Yes
oh hell nah
what is it now?
nah i think it was message -> messageCreate so you're good
Ah
From the docs, they also have Events.someEvent constant, might be a good idea to use it instead of strings
client.on("messageCreate", (message) => {
if (message.content === "ping") {
message.reply("pong");
}
if (message.content === "!connect") {
let embed = new Discord.MessageEmbed()
.setTitle("Connect to our server")
.setDescription(
"To connect to our server make sure you're on the latest version of Minecraft and that you're using the Java edition of Minecraft.\n IP: `atlassmp.online`"
)
.setFooter("Atlas Network");
message.channel.send({ embeds: [embed] });
}
});
what is wrong with my code?
did they change embeds too
It depends on what version you are using
discord.js@14.14.1
In the latest? Yes, from now on it's called embed builder
Discordjs has really really good version upgrade guides. I'd reccomend using that if you can
Tysm, the last time I made a bot was in 2021
🤣
client.on("interactionCreate", (interaction) => {
if (!interaction.isChatInputCommand()) return;
if (interaction.commandName === "!connect") {
const embed = new EmbedBuilder()
.setTitle("Connect to Atlas SMP")
.setDescription(
"To connect to our server make sure you're on the latest version of Minecraft and that you're using the Java edition of Minecraft.\nIP: `atlassmp.online`",
)
.setFooter("Atlas Network");
}
interaction.reply({ embeds: [embed] });
});
I read the discord.js guide, followed it and got this
it doesn't work
any ideas?
what doesn't work?
The embed is meant to reply and it doesn't
no errors?
this dont use messages
i'm surprised it didn't error
Maybe it's a replit thing
because the promise isn't being awaited
this for slash commands
also i'm pretty sure that's not the syntax for replying to interactions
like this
yh
i don't think ! is a valid character for a slash command though
and if u look here, it's still wrong since you're declaring embed inside the if statement but replying outside it
I removed the !
did u register the command?
Wdym
might want to have a read here https://discordjs.guide/creating-your-bot/slash-commands.html
use new SlashCommandBuilder() to create a slash command and register them like this
What is a global command?
The commands that are available in dms and on all servers are the same
You can also create "per server" commands
or is it extra
text commands are far superior
Not if you want discord to verify your bot
You must have a very good reason to be able to read user messages
I've done everything in the documentation and my embed still doesn't work, at this point are there any youtube tutorials on this
this is so much harder than it used to be
There are probably some, but I haven't seen any for a long time because it's much easier to write using documentation and stackoverflow
I follow everything in the documentation I've double checked it
and it doesnt work
const { REST, Routes } = require("discord.js")
const botID = "1206221292580372510"
const serverID = "1190694042409914398"
const botToken = process.env.token
const rest = new REST().setToken(botToken)
const slashRegister = async () =>{
try{
await rest.put(Routes.applicationGuildCommands(botID, serverID){
body: [
{
name: "ping",
description: "just a simple command"
}
]
})
} catch (error){
console.error(error)
}
}
slashRegister()
youtube told me to do this, and to no surprise it doesnt work
what did I do wrong
bruh somebody help please.
What doesnt work? in what way?
Ok so basically
I've registered my slash commands, and they work the only thing that needs fixing is the reply
client.on("interactionCreate", async (interaction) => {
if (interaction.isChatInputCommand() && interaction.commandName === "ping") {
const embed = new MessageEmbed()
.setTitle("Connect to Atlas SMP")
.setDescription(
"To connect to our server make sure you're on the latest version of Minecraft and that you're using the Java edition of Minecraft.\nIP: `atlassmp.online`"
)
.setFooter("Atlas Network");
interaction.reply({ embeds: [embed] });
}
});
this is the only thing which doesn't work
the slash commands are registered, but when you use it the bot crashes
and throws an error message
whats the error message?
node:events:491
throw er; // Unhandled 'error' event
^
TypeError: MessageEmbed is not a constructor
at Client.<anonymous> (/home/runner/atlasbackend/index.js:26:19)
What discordjs version are you using?
Yea, it was a thing in v12 and v13
yeah so the youtube guide you're following isnt for the discordjs version you're using. @earnest phoenix
It’d be easier if they never did it to begin with cause it’s just more overhead
Same for command builders I guess 
Is there documentation on this? I haven't done anything like this in years
Itd be a lot simpler if they just stuck to using raw json data over builders
That’s one thing I disagreed with












