#development
1 messages · Page 129 of 1
this is interesting
whats this
hm?
(he cannot read)
you literally code blindfolded anyway
speech to text?
Idk I’m pretty much convinced you’re illiterate at this point
You can sound out the words but you don’t know what they mean
...
wym by this
but i don't code blindfolded
lol
Server suggestion
I am debating whether i should get an Asic or a server
I dont got that much of a good net for a server
100mbps and 50 uploaf
Uploaf
Uploadddf
Ain't much upload bandwidth
You make a function that can run on something
but I don’t know how to
that’s the thing
like I could do
something(somethingelse)
but how can I do somethingelse.something()
Classes/prototypes
class Thing {
thing() {
console.log('thing logged');
}
}
let t = new Thing();
t.thing();
Problem:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'D:\discord-bots\RevengeNews\src\Handlers\src\Events\messageCreate.js' imported from D:\discord-bots\RevengeNews\src\Handlers\HandleEvents.js
Did you mean to import ../../Events/messageCreate.js?
Code:
-- HandleEvents
import client from "../client.js";
import glob from "glob"
import { promisify } from 'util';
const globPromise = promisify(glob);
import logger from "../logger.js";
export async function handleEvents() {
const eventFiles = await globPromise(`./src/Events/*.js`);
console.log(eventFiles)
eventFiles.forEach(async file => {
const event = import(file);
client.on(event.event, (...args) => event.run(...args, client));
});
logger.success(`${eventFiles.length} events have been loaded.`)
}```
not a solution, but import returns a Promise
as for a solution, you can read the dir and then import with relative paths instead of with absolute paths
Oh hold up. import might require the file:// handle
i fixed that issue by importing path to file url from the url
and
await import(pathToFileURL(file).toString());
doing that
does someone know what could cause the chakra ui menu to be behind the other rows?
seems like a z-index issue
nope, for some reason it doesnt seem to be
the rows dont have it set and the menu has 99
ah, you cant even apply z-index to the menu
because css position is static
main container being relative and menu being absolute
how should I go about fixing that without breaking everything?
hi guys does somebody know why I'm not getting pinged with this command
const Discord = require('discord.js');
const { Permissions } = require("discord.js");
let errEmbed = new Discord.EmbedBuilder()
.setTitle(`Missing permissions: MANAGE_MESSAGES!`)
.setColor("#B468FF")
module.exports = {
name: 'announce',
description: 'announce something in the server',
category: 'general',
options: [
{
name: 'message',
description: 'the message you want to announce',
type: Discord.ApplicationCommandOptionType.String,
required: true,
},
],
run: async (interaction, bot) => {
if (!interaction.member.permissions.has(Discord.PermissionFlagsBits.ManageMessages)) return interaction.reply({ embeds: [errEmbed], ephemeral: true, });
const message = interaction.options.getString('message')
let embed = new Discord.EmbedBuilder()
.setDescription(`${message}`)
.setColor("#B468FF")
interaction.reply({ embeds: [embed], content: `` });
},
};```
at the bottom "in content: `` " i have the everyone ping and it sends the everyone ping but it doesnt ping me
Because it replies on your interaction ig
you cant ping in embeds
i will try to make it just send instead of reply
Make sure the bot as the permissions to tagg everyone
And instead of replying try sending with this interaction.channel.send
Ik
It has admin
Try the interaction.channel.send
And just reply with "done" or something you could make it ephemeral
Oh yh it's working u only need to interaction.reply in ephemeral like "success!" or smth
Yes
I justed wanted to say that lmao
But thanks for helping tho
@somber ridge

@covert gale what happens when you run gpg-connect-agent -v?
Doesn't matter
Try running export GNUPGHOME=$HOME/.gnupg in Git Bash and restart it
*I mean rerun the command
What does gpg --list-secret-keys output after exporting that?
That is weird, try running these in Git Bash:
$ kill -9 gpg-agent
$ source <(gpg-agent --daemon)
Oops I meant pkill
Doing it via Task Manager is not a good idea
Just run those two in order (note pkill instead of kill)
Try running echo "test" | gpg --clearsign
Hey this is code for my bot's clear command, but im having a problem, it clears 1 message less than the provided amount.
For example: it clears 3 messages when I provide amount 4, however display as "I have cleared 4/4 messages." but clears only 3 messages.
pls help me anyone!
Try running gpg --card-status
is there even a size parameter returned?
how about messages?
messages.size
Yes, when I do the same in slash command, it works fine
is it trying to delete its own message too perhaps?
Yes, but after 3 sec, plz see code
cant help then
What is the model of your YubiKey?
What about the message that contains the command itself?

Alright no issues there as that's compatible, does it work if you run echo "test" | gpg --clearsign --default-key contact@ithundxr.dev?
but the key is being detected right?
to be fair, did that several times on my end before signing with a normal certificate worked
so might suggest trying that?
dunno
Did you try gpg-connect-agent updatestartuptty /bye?
You mentioned that command before but didn't run it I think
Then I have no idea
what is it
windows skill issue?
wait
what model did you have again
dont you need to touch it to actually get it to sign?
is that it?
oh
perhaps thats enabled
makes sense why it times out
as its waiting for that confirmation
This is like one of those off-by-one errors where you stare at your code for 6 hours to realize your logic was very slightly wrong
but i mean
you should make sure to actually test that if said product says "supports touch to sign" or something

but yeah
am actually thinking about getting a yubikey too, already got these like javacards for my 2fa on bitwarden
definitely no ads intended, but this
whats the best way to store permissions for for example an api key in postgres?
are you referring to something like scopes?
yeah
probably something like this layout:
key | can_edit | can_read | can_do_something_else | ...
a table
ah
and then can_edit, can_read etc being booleans
is how I would approach that at least
I dont know if I want to do that for 100+ permissions 😅
oh shit true
cant think of another way than grouping up permissions
such as the access group being can_edit, can_read or something
or storing a bitwise for the permissions?
something like discord does
then just calculating a number for the permissions it has
would only need you to have
key | bitwise_permissions
so something like having the following for your permissions:
can_read -> 1
can_write -> 1
can_delete -> 0
can_add_users -> 0
then having 1100 as the bits, just converting that to decimal, getting 12 and storing that as the permissions
yeah bitwise seems reasonable. thanks!
try reducing it, doubt you need to be that granular
with bitwise u can go up to 32 (int) or 64 (bigint) perms
u can technically go higher with postgres' built-in BITFIELD type, but it'll be slower than the native types
or only include relevant permissions
(I think it was called bitfield)
I have no clue what it was called

I just know that it had something to do with bitshifting and storing the decimal from it
and that discord does it for permissions
yeah bitfield
it'll simply allocate another int/bigint when u reach the ceiling
so it has technically no ceiling
so technically its the same speed as int if there are less than 33 permissions?
yeah ill need to check alot anyways
so but generally checking for correct credentials on every request is generally the correct approach for my api though, right? like there are session keys which you get when you login with a captcha and api keys which the user can create at any time
I guess so, you can't really do it in any other way
bitfields are great once u learn how to work with them
it's like a boolean array but 8x smaller
who wants to review my code in ~20 minutes
i get offended very easily so only nice comments
then there's no point in reviewing it
you mean "praising" then
or "constructive criticism"
oh wow, your code is amazing
I never thought about doing it like that
oh wow, your code is thresh :^)

i do
No Access
😦
why sad
Reading this let's me feel people still didn't understand the proper way of registering commands one time, edit or delete em after
this needs to have the bulk api referenced too
https://discord.com/developers/docs/interactions/application-commands#updating-and-deleting-a-command
they will never understand it
It's not specifically about updating and deleting (too) just that people don't understand that the registration is a one time process
People literally just copy and pasting the guides and bulk updating all commands uselessly on any startup
Which still is causing issues of doubled commands and failed interactions due to client caching issues
Not to speak about useless api requests
I dont understand why people still make discord bots
grow up and make actual robots

(or be on discord at all)
Yea soon I'm going to develop Skynet to end all this world madness
You mean something like
try {
} catch(error) {
}
?
i figured out where to put it
i do have to return this tho

am forgor how return catch function
Did you put the try/catch clause on an interaction before?
Once an interaction fails for example a deferred one when deleting the "bot is thinking" state (quickly) then catching the error but still trying to send an interaction reply (to a non existing interaction (webhook)) won't work of course
that is worded weirdly
Ok yeah doesn't matter in your case
It's just too much content in a single sentence 
alr
no they can't
dont lie
my pc is perfectly fine
Send me your address now and I show you they do 
anyone know how I can get the top 1000 artists on Spotify
spotify api which changes every 2 days 
unsure if they even offer the top artists in their api
or wrapper
send link
Retrieve metadata from Spotify content, control playback or get recommendations
if you would rather use a wrapper simply look it up on gh, no idea what language you prefer
Then I guess you can't do it
but I need it
does Spotify have a webpage with it
maybe I can scrape the webpage
so I can get top 1000 artists with it?
it's a little different than the developer API and uses queries
no
yes, you can
huh
how
track the network usage
⁉️
oh dear gl
what
open up the inspector and go to fetch/xhr
what’s the endpoint
do you know
I'm not on my compooper
ok
Hey, this is my bot's messageCreate file, idk why but if i run command like this : + ping or +ping some args
then also bot replies.
please help me fix this , so that bot only respond to command like this only: !ping
How can I compare permissions? I have a command that requires permission bit 8 and user that has a permission bit 0?
What language and library
discord.js javascript
So you wanna check if a user has a specific permission?
<GuildMember>.permissions.has(<PermissionsBitField>.Flags.Permission) is one way
I have a permission but in bits
how can I check that?
ahh ok thank you
to use bitwise I have to always double the enum, right?
export enum Permissions {
/**
* `GET /api/user`
*/ PROFILE_INFO = 1,
/**
* `PATCH /api/user`
* `POST /api/user/avatar`
*/ PROFILE_MODIFY = 2,
/**
* `GET /api/user/keys`
*/ APIKEYS_VIEW = 4,
/**
* `POST /api/user/keys`
* `DELETE /api/user/keys/{id}`
*/ APIKEYS_MODIFY = 8,
}```
pretty much yes
because the numbers in between are a combination of the previous ones
for example, 3 would be 1 + 2
so if you have a 3, it means PROFILE_INFO and PROFILE_MODIFY are both enabled
if you have a 4, then they are both disabled, but APIKEYS_VIEW is enabled
personally i prefer to use base 2 notation for bitwise, makes it easier to understand because its more "visual", for example
PROFILE_INFO = 0b0001
PROFILE_MODIFY = 0b0010
APIKEYS_VIEW = 0b0100
APIKEYS_MODIFY = 0b1000
So there is this unity game that's going offline, and i really want to run it in private servers
Reverse engineer the communication between servers and client
Guys do u get an error anycommand doesnt work
?
My bot got an error I try solve about 2 week but I cant
well
I dont use my any command
Can I send?
what is the error
just send your error
that isn't the full error
Probably your bot takes more than 3 seconds to respond and after 3 seconds the interaction token expires
Of course if you don't use interaction.deferReply()
It's worth reading 
@wheat mesa ok found a new contender for java's swing (in being obnoxious)
c#'s wpf, making static elements is quite easy but holy hell is it annoying to bind values to them
No evenif I use deferReply()
It doesnt work
That full error
In that case, you need to give more context, put your code on pastebin and maybe then something more can be read from it
Ok I will send
Actually pastebin isnt necessery cus command is so basic
const { EmbedBuilder, PermissionsBitField } = require("discord.js");
const { SlashCommandBuilder } = require("@discordjs/builders");
module.exports = {
data: new SlashCommandBuilder()
.setName("ping")
.setDescription("Pong!"),
run: async (client, interaction) => {
console.log(client.ws.ping)
const sent = await interaction.reply({ content: 'Ping ölçülüyor...', fetchReply: true });
sent.edit(`Ping: ${sent.createdTimestamp - interaction.createdTimestamp}ms`);
}
};
Thats my ping command...
that's not the full error, i see the stacktrace which is all the file paths and stuff. there should be more lines above the stacktrace
Full bro I just tried more times
let me take a step back
above all the stacktrace there should be something like Traceback (most recent call last): File "test.py", line 3, in <module> divide(1, 0) ZeroDivisionError: division by zero
Ok Im listening u
Yea I know but wait
Can I send screenshot?
Any problem?
Ok wait
Ill do it
[12-06-2023 08:16:03] Wgo Buddy Aktif Edildi!
145
Uncaught Exception: DiscordAPIError[10062]: Unknown interaction
at handleErrors (C:\Users\Administrator\Desktop\wgobuddydc\node_modules\@discordjs\rest\dist\index.js:640:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (C:\Users\Administrator\Desktop\wgobuddydc\node_modules\@discordjs\rest\dist\index.js:736:23)
at async REST.request (C:\Users\Administrator\Desktop\wgobuddydc\node_modules\@discordjs\rest\dist\index.js:1387:22)
at async ChatInputCommandInteraction.reply (C:\Users\Administrator\Desktop\wgobuddydc\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:111:5)
at async Object.run (C:\Users\Administrator\Desktop\wgobuddydc\src\commands\slash\ping.js:10:20)
I just start bot and try use slash command
And I got this error
and that is my ping command
Not for unk interaction
It happens inside d.js, the only way to find where it happens is to check places where u don't defer
^
Like what?
How can I do that
interaction.deferEdit() or interaction.deferReply()
By rule of thumb, you should not do any processing before answering the interaction
If you must, then defer it
Ok wait Ill try
const { EmbedBuilder, PermissionsBitField } = require("discord.js");
const { SlashCommandBuilder } = require("@discordjs/builders");
module.exports = {
data: new SlashCommandBuilder()
.setName("ping")
.setDescription("Pong!"),
run: async (client, interaction) => {
await interactio.deferReply();
console.log(client.ws.ping)
const sent = await interaction.editReply({ content: 'Ping ölçülüyor...', fetchReply: true });
sent.edit(`Ping: ${sent.createdTimestamp - interaction.createdTimestamp}ms`);
}
};
Is it right?
You can't answer an interaction twice
That said, that command does no processing, you don't need defer on it
Are you 100% sure that's where the error is happening?
In the error said line 10
And Ill check it
The error isn't necessarily happening there
It only means receiving <---> replying is taking more than 3s
Maybe that can be interactionCreate part?
Show what ur doing in it
Ok
const { InteractionType } = require("discord.js");
const { users } = require('../../lib/database.js')
module.exports = {
name: 'interactionCreate',
execute: async(interaction) => {
let client = interaction.client;
if (interaction.type === InteractionType.ApplicationCommand) {
if(interaction.user.bot) return;
const user = users(interaction.user.id)
if(!user) return interaction.reply('Merhaba Dostum! Seninle ilk defa karşılaşıyoruz. O yüzden bu komutu kullanmadan önce sana bir "Merhaba" demek istedim. Umarım seninle çok güzel vakit geçirebiliriz.')
if(user.banned === true) return;
const command = client.slashcommands.get(interaction.commandName)
command.run(client, interaction)
//Hata Ayıklama
process.on('uncaughtException', function (err) {
console.error('Uncaught Exception:', err.stack);
});
}
}}
There is a problem?
Probably, I see a database transaction there
Yep
Put a defer on the start of the function
Just make sure u change your replies, as they can't be of the ack type
interactionCreate part? or just command?
and so I need use .editReply() inside of the command right?
I think so
Ok I will try wait
Don't remember the method name in d.js
Btw, what database are u using?
3s for one boolean query is way too long
Wpf is kinda old tbf, but yeah C# is the better option for making windows graphical apps
Basic local json database
please use a proper database, json is very slow and prone to [object Object]
what's the new alternative?
was trying to make a wpf app and gave up trying to bind an integer to a rectangle dimensions
I believe it’s MAUI or Xamarin forms? I’ll ask the c# server rq
WPF is super fun to use if you learn MVVM with it
Ok according to them, “Avalonia is basically WPF 2.0”
really want to, but I can't figure out how to properly use variables in forms
Yea I know...
“Far as 1st party frameworks go, though, probably MAUI is what Microsoft wants you to use”
“Whether it's a good idea, though, well...”
I did it and try now
lmao the second comment
I’d look up some MVVM tutorials for wpf if that’s what you want to do, it wouldn’t take you long to understand it after you look at the general process
A WPF app was one of my first ever apps
This code is awful though
Never use the visual editor for creating layouts
C:\Users\Administrator\Desktop\wgobuddydc>node index.js
[12-06-2023 09:08:22] Wgo Buddy Aktif Edildi!
DiscordAPIError[10062]: Unknown interaction
at handleErrors (C:\Users\Administrator\Desktop\wgobuddydc\node_modules\@discordjs\rest\dist\index.js:640:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (C:\Users\Administrator\Desktop\wgobuddydc\node_modules\@discordjs\rest\dist\index.js:736:23)
at async REST.request (C:\Users\Administrator\Desktop\wgobuddydc\node_modules\@discordjs\rest\dist\index.js:1387:22)
at async ChatInputCommandInteraction.deferReply (C:\Users\Administrator\Desktop\wgobuddydc\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:69:5)
at async Object.execute (C:\Users\Administrator\Desktop\wgobuddydc\src\events\interactionCreate.js:6:2) {
requestBody: { files: undefined, json: { type: 5, data: [Object] } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1117848354517430332/aW50ZXJhY3Rpb246MTExNzg0ODM1NDUxNzQzMDMzMjpOWnltQUd6N2U3RlRtb0wwMlQwRUdUYTVweWFNZzd3Ym8zR3JGbm90cDhuTkV6a2VYQll6Sk9DdTRQWHhZaWZtV1RNblN6bjdIU0kxWDNDTm9ORnY0Q1hMeDFOUTF2N2Z2Q0NmY0Y5UmlleVg5ZGZvRTdzaHpZWVlVM0JwbHF6Uw/callback'
}
I don't, Rider doesn't have a visual editor, only preview
Ok good
Now error from interactionCreate line 6
what's in line 6?
this looks like you#re trying to like
respond to an interaction at the start of your bot
Yea
🙂
@lyric mountain
I really try fix this problem approximately 2 week and nobody know
Someone say thats about your host service
I change my host service
well, it's virtually impossible to give unknown interaction if it's the first line in the event
But I got still this error
Bots can't use slash commands 
True....
Why
What can I do now
no idea
when u use the command, does it take a while to appear the error in the log?
I wanna cry
Yeeeppp
3 5 sec
sometimes longer
What discord.js version are you using?
I use 14.11.0
then it's doing something before even firing the event
WHAT HE DİD
AĞAĞAĞA
Thats my scream sorry
So bro can u help me
....
a thing u can do, put console.log("here") before the defer
see if it appears in the log instantly or also takes 3-4 seconds
Just that
it appears instantly?
Yep
that'll be hard to debug then
yeah but like, does it appear right after you use the command?
Yeo
Yepp
I use command then bot send message interactionfailed and here is appear console. and then 25 30 sec later error is appear
wait wait, it changes to "interaction failed" right after you use it?
No no it wait 2 3 sec
I can send a video if u want
no need, the way you said I thought it was changing to "interaction failed" instantly
which would mean some issue during handling
but if it's also taking 2-3s then it's something else
No no it takes 2 3 sec
What can be?
trying to think about a reason, but that issue is new to me
Tim might know a possible cause, if he pops here try asking him
boo
@thick path ^
Scary
hohohohoho
Is ur message ephemeral ? Check for any typos? wrong syntax ? Can u send us the code maybe that will help
Unknown interaction actually might also be from not pushing commands correctly
Lmao , autocorrect
the issue is a bit more weird
for context, when he uses the command, the console.log I told him to put at the first line appears, but the very next line (which is a defer) takes 2-3s to complete
leading to the unk interaction
I can't say without seeing the code
Or keep restarting until it works, its JavaScript 
lmao
If you're receiving commands over the gateway, don't
does anyone know why the text isnt breaking into multiple lines?
<div className={'flex flex-col w-full'}>
{permissions.map((permission) => (
<Button mt={2} h={'auto'} p={1.5} className={'flex flex-col box-border justify-center items-center text-center'} colorScheme={selections.includes(permission.value) ? 'green' : 'gray'} onClick={() => setSelections((old) => old.includes(permission.value) ? [ ...old.filter((s) => s !== permission.value) ] : [ ...old.filter((s) => s !== permission.value), permission.value ])}>
<Heading size={'md'}>{permission.name.replace(/_/g, ' ')}</Heading>
<Text size={'sm'} className={'break-words'}>{permission.description}</Text>
</Button>
))}
</div>
is it really break-words?
const { EmbedBuilder, PermissionsBitField } = require("discord.js");
const { SlashCommandBuilder } = require("@discordjs/builders");
module.exports = {
data: new SlashCommandBuilder()
.setName("ping")
.setDescription("Pong!"),
run: async (client, interaction) => {
console.log("here")
await interaction.deferReply()
console.log(client.ws.ping)
const sent = await interaction.editReply({ content: 'Ping ölçülüyor...', fetchReply: true });
sent.edit(`Ping: ${sent.createdTimestamp - interaction.createdTimestamp}ms`);
}
};
devtools should work too
on the text?
hm
perhaps u also need to set overflow property
there's this too
try using it, maybe it works
firefox doesnt even have that 🤷🏾♂️
none
that's how I find css styles 
wrap, text, font, word
type, ctrl space and cycle the options
one has to work
Okay firstly SlashCommandBuilder is no longer from discordjs/builders but from discord.js
Oh
I'll try
Also no need to fetchReply
Just do :
const { EmbedBuilder, PermissionsBitField, SlashCommandBuilder } = require("discord.js");
module.exports = {
data: new SlashCommandBuilder()
.setName("ping")
.setDescription("Pong!"),
run: async (client, interaction) => {
console.log("here")
await interaction.deferReply()
console.log(client.ws.ping)
await interaction.editReply({ content: 'Ping ölçülüyor...', }).then(() => {
await interacion.editReply(`Ping: ${sent.createdTimestamp - interaction.createdTimestamp}ms`);
});
}
};
Ill try like that
can the api be accessed if it's coded to a different bot?
U must be a hero
Really bro
just a fella coding bots nothing else
read docs, docs are important
Almost did a 100% rewrite of the core of my bot. Was such a pain in the ass
Yea I know but I talk with someone inside of the discord.js server
They dont said that to me
https://github.com/AmandaDiscord/Amanda/tree/restart/packages
Tell me. Am I insane
lol
always here if u need me, free to ping me, just dont spam ping me
Okey bro thank u so much
Bro...

Thats can be about websocket hb is -1
?
I got this error still...
@thorny cargo sorry for tag
Technically it's from @discordjs/builders, though discord.js includes @discordjs/builders as a dependency and exports them
Jesus Christ you really went hard on it
It took a month. I for sure went hard on it. I'm surprised it worked first try pretty much
Though what was the reason and/or motivation for you to rewrite it?
well I just read the djs guide , didnt looked at the repo
what did you change
const { EmbedBuilder, PermissionsBitField, SlashCommandBuilder } = require("discord.js");
module.exports = {
data: new SlashCommandBuilder()
.setName("ping")
.setDescription("Pong!"),
run: async (client, interaction) => {
console.log(client.ws.ping)
const sent = await interaction.reply({ content: 'Ping ölçülüyor...', fetchReply: true });
interaction.editReply(`Ping: ${sent.createdTimestamp - interaction.createdTimestamp}ms`);
}
};
Thats my interactionCreate
const { InteractionType } = require("discord.js");
const { users } = require('../../lib/database.js')
module.exports = {
name: 'interactionCreate',
execute: async(interaction) => {
let client = interaction.client;
if (interaction.type == InteractionType.ApplicationCommand) {
if(interaction.user.bot) return;
const user = users(interaction.user.id)
try {
if(!user) return interaction.reply('Merhaba Dostum! Seninle ilk defa karşılaşıyoruz. O yüzden bu komutu kullanmadan önce sana bir "Merhaba" demek istedim. Umarım seninle çok güzel vakit geçirebiliriz.')
if(user.banned === true) return;
const command = client.slashcommands.get(interaction.commandName)
command.run(client, interaction)
} catch (e) {
console.error(e)
interaction.reply({content: "Komut çalıştırılırken bir sorunla karşılaşıldı! Lütfen tekrar deneyin.", ephemeral: true})
}
}
}}
you know what, can u give me the github repo of the template u got this bot from ?
so I can see it and figure what you've done wrong
or feel free to use my template which is a bit more friendly to newcomers
Okey bro I wait
I deleted the original bot because of personal reasons, but realized that was dumb and I'm trying to bring her back. The state she was left in before she died was pretty bug ridden and bad. Decided I might as well do things right this time around
The core still had discord.js references and I got rid of that shit years ago
also decided to use yarn and monorepo packages
npm kinda butt
Hmm what's wrong with it?
Hi, what can be the maximum size of a background image?
Overall feels sluggish during the fetch and build steps
may just be progress indicators
The fetching process is most likely the same, what exactly do you mean by the build steps?
stuff like if the package uses gyp and that needs to be compiled
Sometimes I feel like I have minute long lock ups
That's because npm tells node-gyp to only use 1 core by default while compiling, you can tell it to use as many cores as you like to insanely speed up complication process
For example:
npm_config_jobs=6 npm i
This'll use 6 cores in every compilation process to significantly boost compilation speed
is there persistent config for this
you can set it in the gyp file
:(
you can also use env var
you can also set it in package.json install script
"scripts": {
"install": "node-gyp rebuild -j max"
},
does svelte let you reuse .svelte routes? i want the [rating_type].svelte page to display the same thing as the [versus].svelte page, but i dont want to redirect from
/leaderboard/GUILD_ID/LEADERBOARD/RATING_TYPE/ to /leaderboard/GUILD_ID/LEADERBOARD/RATING_TYPE/VERSUS
i probably need to refactor and put everything in a function
the next version of svelte will support this
replaces the current file-and-directory based routing with something more explicit: directories dictate which routes are created, and route files such as +page.svelte dictate how those routes behave
Hey hi can you help me?
don't ask to ask
@thorny cargo
what
as far as im concerned the text in red is gibberish to me
Yes yes
translate it
it says inorganical growth
your bot joined server too fast, or it joined servers with less than 30 members
you need to contact support@discord.com
inorganic is luckily easier to solve than the other one
Bro are u free now?
import $ from "jquery";
import { useEffect } from "react";
import Image from "next/image";
import Schema from "../db/models/User.js";
export default function login() {
useEffect(() => {
$("#submit").click(async () => {
console.log("lol");
});
}, []);
return () //divs
}
Error: Invalid hook call
No I'm sorry
Why are you using jQuery?
im kinda new react, i dont know a thing
you can attach the onClick attribute with the function to the element directly
jQuery is a legacy thing, used at a time where the JavaScript APIs didn't used to have proper handling for the DOM or any documents or whatever
there's no need to use jquery if you're using react
You no longer need it
Oh oke np
oh thanks!
shout out to those who learned jquery before they learned js
Fr
mootools was better
does somebody know a feature that is "unique" at discord support call it that they will approve for message content intent
dont make up a feature just to get the intent lol
then how they gonna approve it
use slash commands
i do but i have some features like logs or anti spam that require message content intent too
then try and see if they approve them
if they dont approve, then you'll have to remove those features
they didn't they say i need more unique functions for it to approve
then rip
i applied once got declined applied again with the same thing and got accepted it really depends on the staff member
lel
if u need to go out of your way to get that intent, then you don't need it
i did that atleast 4 times now
wym go out of your way
like, needing to make up features just to get it
remember, extra intents = higher performance demand
especially message and presence intents
message content intent doesnt really make a difference tho
presences go brrrrrrr
honestly had to disable it in my bot, being able to check if someone is online or not doesn't justify the huge amount of data influx
@maiden gazelle what do u even need the message content for?
https://no.intents.lol/ moment
@proven lantern cloudflare tunnel is pretty nice. I got it set up under my domain and working just fine. now I can start it without changing the URL on discord developers
before intents were a thing, there was a hidden option in the api called disable_guild_subscriptions, i used to use that to disable presences
oh nice!
i already have some features that use it but if i dont get that intent i have to delete them and i dont want that so im trying to make more "UnIqUe" features so they will approve
what are those features?
he said it was logging and anti spam
tbh you dont need the content intent for anti spam
antispam can be done easily through automod
logging is...somewhat shunned by discord
you can still log most stuff without needing message intent, just not message edits/deletes
can see why they didn't concede the intent
he probably has a snipe command or something
if you want to set it up yourself ^^
https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe
$ cloudflared login
$ cloudflared tunnel create <tunnel name>
$ cloudflared tunnel route dns <tunnel name> <subdomain>
$ cloudflared tunnel run --url localhost:PORT <tunnel name>
you can then use <subdomain>.<the domain you selected after running cloudflared login> on discord developer portal
much message collectors too so features are easy to set up
wdym?
i'll need to setup a cloudflare account first, but it might be worth it
using a slash command for that is argually better user experience tho, since you can set a channel option type
ah, I thought you had one already 
its easier to set up and you can only have 100 slash commands
100 top-level commands
but u can have a fuckton if u use the 3 levels
and doubt it'd be easier than forms/slashes
actually i might, need to recover it
tbh what are form
hmm, do u know when u try to ban someone and the "please write a reason" screen pops up?
ye
oh
I also use message commands, but if u need to choose between switching or being capped to 100 servers, u can't really do much
can i get a free domain from cloudflare?
cloudflare doesn't sell domains (I think)
u put it as a middleman between your server and your domain
ah yea one problem, you need a domain yep
I assumed you had one already but ig not
that's fine, you can change the nameserver to cloudflare's and manage DNS there
eh
maybe i'll get another domain name to play with.
get some .xyz on porkbun/namecheap for like a dollar
google's cheapest domains are like $7. but they come with ssl
so will cloudflare
just don't be like this guy xd
oof
i feel like google is going to improve my domain seo if i use their domain hosting
that's just not true man 
but i can use other ones for testing domains

in Analytics for bot. how does the invite counter work? does it just detect when you push invite button on the website? or does it check for something else?
it snapshots invites
so it can see when the invite url is authorized?
no
afaik it uses the guildMemberAdd event
and then fetches all invites
to see whcih one was used
snapshot means taking a copy of the invites' current states, then using it for comparison later
ah ok
I even posted the code I used for something like this in v12
But with mongodb as database
So not everyone has to like it
if I use a discord invite link and don't use invite button at all on top.gg it will not be able to see that invite or does it still see those invites?
you cant join a server without an invite (normally)
topgg invite button is just a regular discord invite
oh so it will be able to see any invites no matter if you don't use that button or not
yes
as we said, it doesn't "see" the invite
it simply snapshots the numbers when u add the bot
ok make sense now
That would have been huge in my case. I made a hacky addon for Discord.js
Although I would have had to make a hacky addon for djs anyways because Messages take up a lot of memory. If you disabled message caching, message based events like reactions don't work
Discord actually denies applications for message intents?
You need a really good reason to need it
Ah. Major L to all those who don't get it
The message event is just a burden to bandwidth
so I don't regularly use github but just started using it today, question though:
- Do I create a branch V0.0.1, V0.0.2, V0.1, V1, V1.1, V1.2, V2? Otherwise, do I just create a
mainanddevelopmentbranch?
since you're starting to use github today i would start out with creating a main and development branch but when you feel like you can make more complex start using the v(1,2, etc) projects
though what is best practice, versions as branches or main and development branch instead?
main and development is the starting out branch
so i'd suggest main and development
main is default branch and imo development is the branch you use when you have a project you're still developing
personally I use master and nightly
but main and dev are fine too
v1, v2, etc are version tags, not branch names
where is that
Use a main and development branch along with branches for major versions of your project (v1, v2, v3, etc etc)
main for the development of the next stable version/release
development for development of the unstable versions or features
And the specific branches for major versions to be able to backport features, bug fixes, performance improvements, security patches, etc etc (or just for contributors or users to be able to compare commits between major versions to see important changes or find out what major version a bug has been ongoing from, and similar stuff)
^
"master" is not a good name for the default branch as discussed by many, it sure is controversial and not much people cared but it's better to stay up to today's standards
Use a main and development branch along with branches for major versions of your project (v1, v2, v3, etc etc)
main,development,V1,V1.1,V1.2,V2and like that ??
no
only the first 2
Vnumber is NOT a branch name
create a tag instead for numbered versions
ohh he mentioned major versions mb
main, development, v1, v2, v3, etc etc
Making specific branches for major versions can help with the things I mentioned at the bottom, make sure to also create tags or releases for every new version explaining the changes
ah, I didn't see the bottom part
but that's only if you plan on keeping support for previous versions
fair
that's what i originally meant. i knew v1(etc) was not a branch name but technically a subranch of either main or dev
if you think about it
wait im confused, the tags are created when exactly
It was discussed by many because of the "master / slave" thing going back a long time ago, and it was frowned upon, even though many people didn't care they went on with the name change anyway
let me go back, when you start, you start out with main and dev. when you want a version of that branch to be released that's when you use v1(etc) under that branch
And since it's changed, it's better to use the new one to keep up with today's standards
honestly I find the reason for renaming it quite dumb
it's just that media found out that we were calling out main branches "master" and had nothing better to do
so they built pressure on standards to rename it to "main"
wait until they find out we call secondary drives "slaves"
Lots of people also disagreed with the name change but they went on with it anyway, it's funny because "master" has been the default branch name for many many years and they care about it now, "ooo it might hurt people's feelings"
tbh though main does sound better
not that i agree with why they should change it, main for me sounds more useful of a name
Yeah I agree, it does sound better for what it's supposed to represent, the disagreement was mainly because of it being taken care of after so many years
People are also renaming "blacklist" from their projects to "blocklist" because it contains "black" 
nah that can't actually be real

Would I be able to run a bot and a mysql server on one vps?
yes
same, all my newer repos still use master
ok guys
i need some advice
i'm recoding my bot but i wanna add a new feature
but i'm not sure how to do it
so
will need more info than that
what feature are you adding
wait
ah yes
so i wanna make everything in a bulk request with the api i'm using
but with the api there is a maximum of 100 IDs per request
so in my current code each tracker only has 1 ID
but with my new one you'll be able to have mutiple IDs (to for example have all your games player count in a single tracker)
so if I go over 100 IDs it will return error
but i'm not sure how to make it so i don't go over 100 IDs since there can be a dynamic amount in each tracker now instead of one
so it's very technical and confusing
divide the IDs into chunks of 100 and do multiple requests
i slice them now
but
if theres 3 ids in one tracker for example
it will be like
103
and thats over 100 so it will error
😵💫
Hii how do I make my bots top.gg page show that the developer is a team?
In the settings, I cant find the team for some reason
on top.gg/bot/<bot id>/edit
I found the spot but nothing shows up for some reason so im a bit confused
...what
how did u get 103?
now it's 102?
well
as grandson told u, split into chunks of 100
if i slice the trackers at 0, 100
there will be 100
and if one has 3
it will be over 100
and the api will return an error
if one has 3 it'll be 3
yeah
3, not 103
yes 103
how are u transforming 3 into 103?
wait let me show you
one tracker = one row
you see roblox_id? instead of one id it can be like 1,2,3 etc
so if theres 3 in one tracker
and i slice 100 trackers
there will be over 100 ids
and the API will error
I still dont get it
bruh
like, ur supposed to split the payload
what
the split shouldn't care about relationships or ids
let's say u want to split ```json
[
{blahblah1},
{blahblah2},
{blahblah3},
{blahblah4},
{blahblah5},
{blahblah6},
{blahblah7}
]
it should become ```json
[
[ {blahblah1}, {blahblah2}, {blahblah3} ],
[ {blahblah4}, {blahblah5}, {blahblah6} ],
[ {blahblah7} ]
]
treat trackers as individual
it doesn't matter if blahblah1 and blahblah2 are from the same id
?
show an example of payload
the data you're sending to the api
you say you have "trackers" and each tracker has multiple ids, correct? and the api you are using needs ids and not trackers
then just join all the ids from the trackers first, and then slice them in chunks of 100
just show the current code whatsoever
easier than trying to explain what ur doing
it can have mutiple ids
it doesn't need to
...wait
then bye bye
it will go to the next request
are u using substring?
what
how would the id cut off?
🫠
...use an array ffs
would not surprise me if the ids are stored in one row as csv
you have 5 trackers, each tracker has 25 ids, you join all ids and you get 125 ids, you slice them into chunks of 100, then you have 1 chunk with 100, another chunk with 25, and you do 2 requests, one with each chunk
show code
1,2,3,4,5,6,7,8
i slice 4 at a time to send to api
however 1-5 belongs to a single tracker
5 will not get requested from api
its not gone?
it won't be able to get
ur really slicing a string arent ya
because you're saying things will be cut off
it can't happen if ur using an array
thats not what he means with the words cut off
right now i have a 234 array of trackers that look like this
i just slice 100 each time because right now each tracker can only have 1 id
but with muitple
if i slice 100
and a tracker has more than one id
it will exceed
100
and the api will error
what part of "join the ids first" are you not understanding?
what
...
so i get all ids first?
tracker1 = [id1, id2]
tracker2 = [id3, id4]
joinedIds = [...tracker1, ...tracker2]
no shit
thats literally what i said 500 messages ago
.>
i have a question guys will this work
array.filter(game => anothearray.includes(game.id));```
try it
its impossible for us to know if one code snippet will work for your implementation when we dont know the rest of the code
ok
i will test it when i finish code
thanks for help guys
u guys are so nice
🙏
i started working on the change Tim suggested and it's tricky
what did tim suggest?
no, just leaderboard
do u know what bitwise is?
no
go here https://discord.com/developers/applications/YOUR_BOT_ID/bot
ooo
bitwise (in this case bitfield) is the equivalent of a boolean array but compressed into a number
bitwise is any operation done with individual bits
why do they do this?
why not just make people pass an array of permissions
lol
sounds unnessesarily complex
because a bitfield is 8x smaller than a boolean array
and ungodly faster than arrays
np, bitfields are a legacy tech that shouldn't be used in application programming anyways
also guys do u know if putting a donation link on my bot is against discord tos
?????
it isn't
buddy put a /s there cuz u almost made me throw you outta the window
if you are using lambda or any serverless hosting yes
otherwise no
return await interaction.reply(...)
return interaction.reply(...)```
they return different things
with lambda if you return before the promise finishes then lambda just stops executing the code
whats a lambda ?
because you're terminating the scope earlier
classical(ancient) vps hosting doesn't have that issue
it's not exiting the loop, it's exiting the current function with a result value
vps = ancient?
is this inside a map/reduce/forEach function?
oh
for in
but if i don't need the value
can i not await it
?
i just wanna exit loop
no return data
break;
yes u can, but it'll always return a value regardless
you don't need to await it but you should catch it
yes
then ok
because you use too much copypaste
i don't copy paste
i write all my code
why do you think i copy paste



