#development
1 messages · Page 170 of 1
why do you count them
Activity report
do brs have to report them to mods?
Nope this is my personal report
Just like to note last month activety compare to like the next month
So I know if I am lazy or not
There is more thou then that
oh alright
How do we show the number of servers like this?
with the Top.gg API https://docs.top.gg
is this?
yup
Bump
mh yes
@real rose hmm
You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.
I wonder what this error is, it appears when trying to use the button?
What discord.js version are you using?
"discord.js": "^14.0.2",
Update to the latest stable version, that's a bug
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
❤️
You aren't supposed to use that component directly, it's meant as a representation for text input component data, if you want to make a text input component you should use https://discordjs.dev/docs/packages/builders/main/TextInputBuilder:Class
Well, I have the id of a person in the guild and how can I change his nickname?
interaction.guild.users.cache.get("ID") example
You get the member from the guild using the interaction.guild.members.cache.get() method (use interaction.guild.members.fetch() preferably as not every member is cached), and use the https://old.discordjs.dev/#/docs/discord.js/14.13.0/class/GuildMember?scrollTo=setNickname method
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
❤️
<GuildMemberManager>.fetch() returns a promise, resolve it
let member = ?
JavaScript has the ability to carry out asynchronous (or async) instructions. These instructions run in the background until they have finished processing. Asynchronous instructions do not stop the JavaScript engine from actively accepting and processing more instructions. This is why JavaScript is non-blocking in nature. There are a few
You must use either await before or .then() after
You can only use await in async functions, so keep that in mind
Whatever I write where there is a question mark, the problem will be solved.
(Please don’t use .then() without a good reason)
let member = await ?
no
i dont understand
That's why you need to understand
You are currently doing let member = interaction.guild.members.fetch(id)
However that function makes a request that is not completed immediately, and therefore to get the actual intended data, you need to await that function call
If we write out the solution for you, you won't understand why that fixes your issue, it's quite fundamental to understand how promises work in JavaScript
okay thanks
There's also https://www.nearform.com/blog/javascript-promises-the-definitive-guide/ if you don't understand the one by freeCodeCamp
As far as I know, the modal only has text field options
But you can probably check it with the code whether the user entered a number or not and reject his modal if the field does not have a number
is there a way to disable typing status in a channel?
maybe with some css tricks
anyone know golang?
What lang
im learning the language
yeah
one sec
ty
this is what I used to use
gotcha
when I used go
anyway i have another issue
whats that
with interfaces, im trying to extend the responsewriter by adding a custom method to it, basically this
import (
"encoding/json"
"net/http"
)
type HttpResponseWriter interface {
http.ResponseWriter
success(data interface{}, status int)
error(message string, status int)
forbidden()
unauthorized()
notFound()
}
type HttpResponseWriterImpl struct {
http.ResponseWriter
}
func (rw HttpResponseWriterImpl) success(data interface{}, status int) {
rw.Header().Set("Content-Type", "application/json")
rw.WriteHeader(status)
response := map[string]interface{}{
"success": true,
"data": data,
}
json.NewEncoder(rw).Encode(response)
}
func (rw HttpResponseWriterImpl) error(message string, status int) {
rw.Header().Set("Content-Type", "application/json")
rw.WriteHeader(status)
response := map[string]interface{}{
"error": true,
"message": message,
}
json.NewEncoder(rw).Encode(response)
}
func (rw HttpResponseWriterImpl) forbidden() {
rw.error("Forbidden", http.StatusForbidden)
}
func (rw HttpResponseWriterImpl) unauthorized() {
rw.error("Unauthorized", http.StatusUnauthorized)
}
func (rw HttpResponseWriterImpl) notFound() {
rw.error("Not Found", http.StatusNotFound)
}
func RegisterResponses(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
rw := &HttpResponseWriterImpl{w}
next.ServeHTTP(rw, r)
})
}
This is my interface
import (
"cloudview/app/src/api/middleware"
"net/http"
"github.com/gorilla/mux"
)
func RegisterRoutes() *mux.Router {
router := mux.NewRouter()
subrouter := router.PathPrefix("/v1").Subrouter()
subrouter.Use(middleware.RegisterResponses)
subrouter.HandleFunc("", func(w middleware.HttpResponseWriter, r *http.Request) {
w.success() // not working throws error
// i want to access w.success("message")
}).Methods("GET")
homeRouter(subrouter)
return subrouter
}
And this the middleware. how can i fix the issue or how do i go about it
but im not able to access it in the handlefunc
i tried using rw.success in the middleware directly and itseems to work
but outside i get type errors
What errors do you encounter (I may or may not be able to help as I haven't used go in years)
its basically saying i cant use my custom interface type in the handleFunc
mux router btw
Hm
yknow how you have *http.Request try using an astrisk in front of your HttpResponseWriter, iirc you can't just directly pass it like you are now as w middleware.HttpResponseWriter
hm
same error
yea sorry, I haven't used go in a while so I am not as knowledgable at it anymore
I've looked at it a few times and even looked at some docs but I don't see what is going wrong here
the problem is there seems like there's no way to modify the interface
some said i need to create my own interface but thats what i did here
the other solution is to create that interface for every single route, but then whats the point of middleware
you definitely should be able to do it
the other solution is to write it very ugly like its own standalone function and call success with data without using interface but i dont wanna do that
it looks like i have to modify the Write method
but its restricted usage
might work if i use http.Handle instead of http.handleFuncworth the shot
ig not, cause that gets ugly as well
Now I have an automod id and I want to delete automod using this id, how do I do it?
I tried this but it didn't work
if youre using discord.js then just put the id
.delete(id)
first money made from my bot
https://fs.rjns.de/v/tDYmViERVNGozrSIXr
Holy shit
nice
(72 cents disappeared because fees)
time to get something better to process payments than paypal taking half
somewhat half*
how do I fix this in my ci
currently I just retry the ci until it works lmao
Package pangocairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `pangocairo.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pangocairo', required by 'virtual:world', not found
I mean it worked for like 3 months before without issue
havent changed dependencies in like 1 month
I mean it still works but its a lottery
Follow the official wiki to install the required dependencies
https://github.com/Automattic/node-canvas/wiki
thanks
Anyone know any payment service that offers like a wallet system which you can load money into and then make payments ? And if they have sdk or apis
Like an integration
stripe i think
Hmm, anything else?
I don’t mean something like services that accept Apple Pay etc
I mean like a proper wallet management like how vultr has a way to load some $$ into wallet first
From which they charge the amount
Paypal?
Does plaid have something like this?
I have a problem, probably a small one, with my bot on top.gg, I can't see the main photo
const hello = ["w", "o", "r", "l", "d"]
const world = ["h", "e", "l", "l", "o"]
console.log(`${world[1]}${world[2]}${world[3]}${world[4]}${world[5]} ${hello[1]}${hello[2]}${hello[3]}${hello[4]}${hello[5]}`)
I might just be the best js developer
it's average
console.log((['c', 'h', 'e']).slice(1).join('').concat('llo', ' '.repeat(1), 'world'))
Real ones put hexadecimal into an array, convert it to a char in an array, then append each char into an array again, then print it out
My name is Profesyonel, so is my programming
anyone familiar with google search console? pages from my sitemap arent being indexed unless i manually request indexing through the url inspection thing
https://fs.rjns.de/v/xjisIOlpNKHtHPfZNh finally got this working efficiently 🙏
Good job
you dont need the external select btw
wdym
you can simply return the row number without external select like ```sql
SELECT row_number() OVER (ORDER BY xp DESC) AS row_number
FROM serverUsers
WHERE serverId = ${ctx.metadata.serverId}
AND userId = ${id}
ah, fair point, I actually forgot it'll exclude all other values
catch 'n throw again 👍 https://fs.rjns.de/v/SkJYPYdeJVLawsTrsR
try {
try {
try {
try {
try {
} catch (err) {
} catch (err) {
} catch (err) {
} catch (err) {
}}}}}
probably wrong but idc
page.catch(x => throw x).catch(x => throw x).catch(x => throw x).catch(x => throw x)
throw early catch late
what about finally
H
I
I need the return to return an open page sir
i see sir
Alright, so when you click a button it edits the message and you get a select menu. Once you select an item in the menu a modal appears. But for some reason when you first click the button you can't select anything in the menu for like the first 3-5 seconds and it sais "the interaction failed". Also if you don't select anything after 3-5 seconds it also sais "the interaction failed". But after you can select anything and the modal will pop up. Anyone knows why this could be?
Maybe it's an interaction with the button itself?
It seems to me that if you don't use .deferUpdate() on the button you will get "interaction failed" even if you send the embed
Bump 😝
yeah but I can't deferUpdate tho
Give código
since I'm showing a modal
so if I deferUpdate it'll give me an already acknowledged error
You need to show the modal within about 3 seconds otherwise the interaction will fail
yeah I noticed that
I just fixed it
So if you’re doing any longish requests it would affect it
one button would instantly open the modal and another one would first ask you to select an item from the menu
so for the ones that shows a menu I deferred it
thanks!
zang, dbm got hands
DBM - discord bot maker
what is this magic language
because it is
imagine having to code and host all of that in your phone
Coding on the phone is terrible
i did
but not this level of nightmare
even assembly seems more tolerable than this
Replit
at this point just use javascript on god
doesn't change anything
Oh hey 
at this point just use rust on god
Hey why the css is not working in bot description?
It should work normally
See compiler vs top.gg
you have to explicitly set your own style otherwise it'll use top.gg's own css
use an iframe if you're lazy
they are migrating discord from webpack to rspack
for that speed
What is a Acceptable way to use the a DM command?
Only for mods or admin or remove fully?
my vote thing runs before my shard manager does anything. all it does is send the vote to a function to find the user in the database and increase their vote streak and stuff like that. I've had some issues now that there's multiple shards, that because I moved where the vote listener is (used to be in the login function) due to sharding the function doesn't seem to be able to access the database. where am I supposed to put the vote listener?
i can provide code as needed im just not really sure what IS needed ._.
I put it in the manager code
like in the manager.spawn()?
Well you only want the vote listener to receive it once
right, that only runs once
The entry point (where your manager is) is only running once but the actual bot code is running for however many shards or clusters there is
yeah
that's why i moved it into the code with the manger. but having it before the manager spawns or creates shards isn't working
What happens
the vote goes through but it can't connect to the database
Any error?
MongooseError: Operation document.findOne() buffering timed out after 10000ms
Is there a way to set a limit of connections on your database?
I’m not familiar with mongo
that error generally means it didn't connect I think
not that there's too many connections, but it can't find the connection at all
I was thinking that it’s waiting for a connection to open and one didn’t within 10 seconds
So if you’ve got the connections limit set at something low it might not be able to connect
hmm I guess it might be that. ill look more into what the error means. I didn't see it as trying to make a new connection and not having space
but I have to go to breakfast so I'll try later
Could be this
I'll try doing the vote listener after the shards connect, thx
Bump😝
How can I add stuff to next/head in _document.jsx?
I want to add meta tags and have them be on all pages
import Document, { Html, Head, Main, NextScript } from 'next/document';
class MyDocument extends Document {
render() {
return (
<Html>
<Head>
{/* Add your meta tags here */}
<meta name="description" content="Your page description" />
{/* Add other meta tags as needed */}
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}
export default MyDocument;
It would be something like that
Np
is it possible to extract a single file from a file that is a zip file but doesn't have the headers
the 'zip' is 100gb+ so no extracting it entirely
i needa get Data/Localization/english/global.ini from it
preferably in node
cmd/ps acceptable
I’m not entirely sure how zip algorithms work, but you’re definitely going to need to stream the data
cant you like, grab every entry one by one and see if it matches the 'target path'?
or is a step to it
node-stream-zip js errors
afaik zip stores file data at the end of the file
so it needs to read the last chunks first to figure out where the files are
but there should be a lib that does that
what error does node stream zip throw?
// Edit the name localizations of this command
command.setLocalizedNames({
'en-GB': 'test',
'pt-BR': 'teste',
})
.then(console.log)
.catch(console.error)
this is how the djs guide shows it
i think ru is not the correct tag
Is it capitalized?
it's exactly like that
i copied it
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
I'm using slashcommandbuilder
ohh gotcha
yeah then it looks right, then I assume one of the values in the ru name is a character it doesn't like? which would be silly because why would it not accept russian (?) characters in a localization field
If that's the case then there really is no workaround unless I use a romanized version of it
is discord.js still cursed
i havent used it in years
ijust know they wrapped a shit ton of shit around builders that make the code annoying if anything
but it might be easier for beginners so 🤷♂️
then that's why they did it
Done 
Apparently the localization was capitalized
Guys I’ve just come back from coding and I have forgotten everything, I need to know why my bot is not working without it showing errors
It is showing but I don’t get it
Depends on what you mean by "doesn't work"
You provided invalid token
I don’t think so, I just changed it
you need to change it in your code too
I just changed again brother
well your client.login has an invalid token in your code
It may be the hosting website I’m not sure
Let’s check
I just formatted it same response
Also remember that the token must be a string so client.login("token") and not client.login(token)
mind showing your code? Blur out your token of course
dont worry
I always code on and off
last time I was on the guys were extremely toxic lol
And your client.login?
I can’t seem to find a client login let me try
oh
I made it in a secure way
process.env.token is for environment files
You have a JSON string which looks like a config.json file
whats the name of this file?
Index.js
no the one with your token and default_prefix in it
config.json
Yeah so process.env would be for env files. Either you can change that to client.login(config.token) or move your token to another file called .env and have
token=TOKEN_HERE
Alright I’ll change thanks let’s see
Should work then 😄
Same response
I removed the env
and changed it to?
Config.token
and did you define config earlier yea?
Sorry I don’t get what you mean
Hm
obvi the ./ is different depending on where your config is located
What about I use the old code but what do I have to change with the config.json file
Because my code is a bit old and messed up
I mean before you
Yeah so process.env would be for env files. Either you can change that to client.login(config.token) or move your token to another file called .env and have
token=TOKEN_HERE
That sounds good?
Can’t I just change the old files name to .env
no
Alright let me try that
moment.locale("tr")
let member = newMember;
console.log(newMember)
let formattedDate = moment().format('DD/MM/YYYY HH:mm');
await db2.set(newMember.userId+formattedDate, `${member.activities.type} ${member.activities.name} ${member.activities.details} ${member.activities.state}`)
console.log(`${newMember.userId} Adlı Kişiden Şunlar Kaydedildi: ${member.activities.type} ${member.activities.name} ${member.activities.details} ${member.activities.state}`)
});
1118823722267181119 Adlı Kişiden Şunlar Kaydedildi: undefined undefined undefined undefined
How do I fix it?
${member.activities.type} ${member.activities.name} ${member.activities.details} ${member.activities.state} are all undefined
I believe activies is a list of activites so you need to index which one you want
[0] [1] [2] etc
member.activities[0].type
If I want it to write all of them, should I put 0?
No, 0 mean first
If you want to list all of them you need to use some sort of loop
forEach or for let
bana bir örnek gösteririmisiniz ?
write index.js 112
Alright
Also from what I see in the documentation it should be member.presence.activities
https://old.discordjs.dev/#/docs/discord.js/main/class/GuildMember?scrollTo=presence
Nope no change
I’m confused
What do I have to change
I have a file called config.json
Why is it not working
One message removed from a suspended account.
What’s that
My bad I just came back to coding
console.log(config.token)
In the index file?
Yes
Yes, just put it and run the code
Still the same error
What do you have in your console?
It should print out your token
The original code was process.env.token
I get this then
Sorry bro it’s hard I’ve forgotten everything
I asked you to check if config.token gonna print your token in console

Didn’t
because you're not defining it correctly
feel free to send your index.js file in a https://pastebin.com/ link
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
if(!oldPresence){
if (oldPresence.user.id !== client.user.id) {
const oldStatus = oldPresence.status;
const newStatus = newPresence.status;
if (oldStatus !== newStatus) {
switch (newStatus) {
case 'online':
console.log(`${newPresence.user.tag} artık Çevrimiçi.`);
await db.set(oldPresence.user.id+"+"+moment().format('DD/MM/YYYY HH:mm'), "Çevrimiçi")
break;
case 'idle':
console.log(`${newPresence.user.tag} artık Boşta.`);
await db.set(oldPresence.user.id+"+"+moment().format('DD/MM/YYYY HH:mm'), "Çevrimiçi")
break;
case 'dnd':
console.log(`${newPresence.user.tag} artık Rahatsız Etmeyin.`);
await db.set(oldPresence.user.id+"+"+moment().format('DD/MM/YYYY HH:mm'), "Çevrimiçi")
break;
case 'offline':
console.log(`${newPresence.user.tag} artık Çevrimdışı.`);
await db.set(oldPresence.user.id+"+"+moment().format('DD/MM/YYYY HH:mm'), "Çevrimdışı")
break;
}
}
}
}
});```
```node:events:495
throw er; // Unhandled 'error' event
^
TypeError: Cannot read properties of null (reading 'user')
at Client.<anonymous> (C:\Users\Emir\Desktop\Unity\bot.js:30:21)
at Client.emit (node:events:529:35)
at PresenceUpdateAction.handle (C:\Users\Emir\Desktop\Unity\node_modules\discord.js\src\client\actions\PresenceUpdate.js:37:19)
at module.exports [as PRESENCE_UPDATE] (C:\Users\Emir\Desktop\Unity\node_modules\discord.js\src\client\websocket\handlers\PRESENCE_UPDATE.js:4:33)
at WebSocketManager.handlePacket (C:\Users\Emir\Desktop\Unity\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (C:\Users\Emir\Desktop\Unity\node_modules\discord.js\src\client\websocket\WebSocketManager.js:239:12)
at WebSocketManager.emit (C:\Users\Emir\Desktop\Unity\node_modules\@vladfrangu\async_event_emitter\dist\index.js:282:31)
at WebSocketShard.<anonymous> (C:\Users\Emir\Desktop\Unity\node_modules\@discordjs\ws\dist\index.js:1173:51)
at WebSocketShard.emit (C:\Users\Emir\Desktop\Unity\node_modules\@vladfrangu\async_event_emitter\dist\index.js:282:31)
at WebSocketShard.onMessage (C:\Users\Emir\Desktop\Unity\node_modules\@discordjs\ws\dist\index.js:988:14)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:398:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)
Node.js v18.18.0```
can you help me
I don't know why you need a user.tag when 99% of people don't have a tag anymore 
i have
yeah
if oldPresence is null
it runs the code
I think you want if(oldPresence)
without the !
Then the two most popular reasons: lack of intent or you need to change client.on("message") to client.on("messageCreate")
No change just changed
In that case, it's the intent fault i guess
What’s that
What version of discord.js is it?
package.json located at your bot's project root directory
check inside dependencies field
12.5.1
This version still works at all?
update your discord.js and read the new tutorials
How do I update it
npm i discord.js@latest
Yeah bots running not responding tho
I’m an old fellow 👴
And then from v13 to v14 
oh i forgot were 14 now
💀
13 to 14 
your cli?
some optimisations
client.on('presenceUpdate', (oldPresence, newPresence) => {
if (oldPresence)
return;
if (oldPresence.user.id === client.user.id)
return;
const newStatus = newPresence.status;
if (oldPresence.status === newStatus)
return;
let responses = {
online: 'Çevrimiçi',
idle: 'Boşta',
dnd: 'Rahatsız Etmeyin',
offline: 'Çevrimdışı'
}
console.log(`${newPresence.user.tag} artık ${responses[newStatus]}.`);
const key = `${oldPresence.user.id}+${moment().format('DD/MM/YYYY HH:mm')}`;
db.set(key, newStatus === 'offline' ? "Çevrimdışı" : "Çevrimiçi");
});
What do you mean cli
Oh alright so I make a command file and it to there
nah
something like command prompt
Sorry it’s confusing on mobile
ever heard of it
where do you type your node index.js
This is why people should do some learning with basic js before trying to code a bot 
?
I told you I just came back from coding brother
Your right I should’ve done some research tho
Should look into the details before jumping right into the deep end 
It would be a better use of your time to start from scratch, pull up the d.js 14 docs and a youtube tutorial and go from there
There is no point in trying to fix an old bot when none of your memory is refreshed
❤️🔥
Is there a video you would reccomend
Anson the Developer on yt
Alright thanks
client.on(
'presenceUpdate',
(oldPresence, { status: newStatus, user: { tag, id } }) => {
if (
oldPresence
|| oldPresence.user.id === client.user.id
|| oldPresence.status === newStatus
)
return;
let responses = {
online: 'Çevrimiçi',
idle: 'Boşta',
dnd: 'Rahatsız Etmeyin',
offline: 'Çevrimdışı'
};
console.log(`${tag} artık ${responses[newStatus]}.`)
let key = `${id}+${moment().format('DD/MM/YYYY HH:mm')}`
db.set(key, newStatus === 'offline' ? "Çevrimdışı" : "Çevrimiçi")
}
);
an even more optimised version of this
before that i'd recommend you familiarize yourself with js again
Is there a specific video you recommend
Is there a website you’ll recommend
I didn't
I went right into coding the most complicated thing in the world right off the bat
Armed with nothing more than documentation and lots and lots of youtube tutorials
a true developer would only need documentations1!1!1!1
and chatgpt
Public channel 
good answer
chatgpt is surprisingly bad at giving any useful code seeing as how it's several versions out of date with pretty much everything
Okay then
It’s not terrible for “examples” of a poorly documented library or framework
Why is it giving me this
I'm sending a message through a webhook
With an embed and a plain text file (formdata)
And the file is going before the embed
Is it possible to switch it up so the embed's first?
payload_json is up first
Replit is trash. Best of luck
average inbox when working on ci
i think i messed up
win11 is good dawg
good to slow ur pc
shitpc
I have 4 year old laptop it can't get any slower than it is already 🥲
use a linux distro
always good with old laptops
Win 11 gang
¯_(ツ)_/¯
At least you got one
I code on movile
yeah you'll most likely find some good gaming laptops sold by boomers that don't know their actual value
or weird parents that are selling their kids gaming pc for misbehaving for 50% the price
just tell em, uh that component looks faulty, gonna have to cut 200€ off that or sum
99% chance it works
Wrong channel to ask but try to click "refresh servers" and then logout and login again
Should work

One message removed from a suspended account.
One message removed from a suspended account.
Speedrun of ending up in the retirement home
lmfao
Do you guys know when using the ShardManager, if no specific amount of guilds is specified, does it automatically spawn new shards as the bot continues to grow in new servers? (Without having to restart the bot).
If you're talking about the d.js shard manager it'll automatically create and balance new shards without having to restart
Yes, the discord one. Thank you!
my laptop is 7 years old, works pretty good for uni work
And back then it was considered an “entry level” gaming laptop
Aka less than 800 bucks
So I see our bot in 10k servers right now, but it still has not spawned a new shard, it is still at 4, but shouldn't it be 5 now? Not sure how the auto spawning works...
hello
it'll auto spawn as it needs; no restart needed
Are we allowed to ask non bot development related coding questions here
as long as its development related its good, doesnt have to necessarily be bot
I've seen topics about websites, games and animations here
bot is just most popular topic since topgg is a place to list your bot 
but any development convo is welcome here iirc
And the famous Steam API from which one guy wanted to download information about every game on Steam

Gotcha thanks
no problemo !
bump😝
Using the message partial doesn't require the message content intent correct?
Discord.js v14 by the way
not required afaik
Thank god
I would rather beat myself with a bat than enable the message content intent
So, I have a question about compiling electron applications. I created these two programs using electron. Got them working exactly how I wanted them by running the electron . command in my src directory. The apps are both frameless and can be fullscreened when I double click on them. One of them is just a blank black form that I use to make my OLED display go completely black when I press a button, and the other one is a transparent video player that is supposed to only show the video and nothing else.
The issue I'm running into, as seen in the video below, is that the compiled version of the electron app has a title bar above the video for some reason. It's still a frameless application, and that title bar doesn't show up when I'm running the app via electron ., so I'm very confused about what exactly is going on here. Another thing you see in the video is that I can double click on the app to fullscreen it, but that functionality doesn't work in the compiled versions of the apps either. Anybody know why this might be happening and what I can do to fix it?
https://github.com/TannerReynolds/Shigure-Dance code for one of the programs, the other one is almost identical
That is quite bizarre, I think it's best that you ask in https://discord.com/invite/electronjs instead
please help
How do I fix it?
No matter what I do it will be fixed
Not if you want to make more than 25 fields. Set some limit or split it into two or more embeds
I don't know what this command is for, but choose the method that better suits what you expect from the bot
Or do pagination using buttons
There are several ways to solve this problem
Guys how do I make my node.js v16 on replit
Hey, i added a little faq to my website.
I know it;s a lot of text but i mean, it's a faq so i think its alright. However, do you guys think that the different questions (denoted by a bolder header) should be toned down a bit by size? And any other tips on the design?
Yeah the text size your using for the text use it for title 2 times bigger
Like 11 and then 13
Your text let’s say is 12 then make the title 2 times bigger so 14
wouldn't that make it 24
but yeah i get what you mean
i just wanted a clear difference between the different headers
got it toned down to this
Looks nice
I used this https://github.com/EruptionGuy/video-stuff to install node.js 16 through terminal but now I’m getting this error
And it’s still stayed 12
what is the location of your bot's main file?
whats the main file of your bot?
Here
You can make multiple embeds or put some of the information in the description field
type "node -v" in shell once
replace that with ```json
"scripts": {
"start": "node index.js"
}
also, the repls are already updated to the latest version of node iirc
This is the error I’m getting after this
use npm install in shell
Alright but I’ve already tried
in shell?
btw, show the full error
Alright
"MODULE_NOT_FOUND” sounds like you don’t have everything installed yet
But the code is supposed to do it
Sure it is, but you’re missing a package.
There it is
What is it
Run npm install express
You’re missing the package called express
Or terminal
Terminal
What’s this supposed to mean
You’re missing a file
If you don’t know what any of it means I suggest you take a JavaScript course
I’m missing no files
The error says otherwise
It cannot find index.js in the folder strangeNormalUnits-1
I renamed it because it said it wanted me to name it node index.js
Well now it can’t find it anymore
Why is throwing me back and forth? It wants me to change things and bring it back and then automatically removes them
Once again, what is name of the index file right now?
Goodluck trying to solve it xD 
This is outdated node error

App or platform because replit is a platform where you can also host the bot, so it is not just an app but also hosting
So writing the code is one thing, hosting it is another
How do I update it then what do I do
I have no idea, I've never used replit
change "start": "index.js" to "start": "node index.js" in package.json
my hands hurt already

is there a way for me to choose what github sees as the readme file in a sub-folder?
how can I make sure it will choose my readme file?
it can only read that one readme.md on the main folder
having readmes in different folders will display these readmes when navigating that folder

I did that and then it couldn’t identify index.js
whats your current error
hi ok so
im trying to regex \d+\.\d+ and not \d+\.\d+\.\d+
(enforcing x.xx.x)
I am struggling
basically x.xx cannot have another dot after
try 3.21.0
match \d+\.\d+, there may not be any dots infront or behind in a global search
that indeed works thank u
(autoregex ai thingie made the exact same thing as you when you sent it)

Ty idk why my dumbass didnt register that maybe electron had a discord of their own lmao
const makes it so that you cant change the type on it right?
as js const object = {}; object.foo = "bar"; object.foo; // "bar" this works
same for arrays
but not numbers

because it's 'loosely typed'?
no quotes, nothing surrounding
no real type
you can't reassign, that's all
you can still change its shape via delete and other object manipulation shnenanigans
direct property assignments for any other primitives would not work because method / property accessing is instanciated with a temporary instance of the primitive class while doing so (in this case, Number class)
(doing so on null or undefined would raise a TypeError runtime error instead)
however, mutating the very class that was used to create said temporary instances would work
in this example, all other numbers would have a property called unreal with a value of true
(since a number class is Number)
extra notes: you can make an object trully immutable by calling Object.freeze
you can check whether an object is frozen by calling Object.isFrozen
even as such it would not be immune from prototype mutation
why direct property assignments would not work for primitives other than
object,null,undefined
https://javascript.info/native-prototypes#primitives
voltrex is that you

👀
@earnest phoenix your replacement is here 
That's my gf, I taught her 
can you teach me too
Sure
I mean, most of the AI and math libraries that are available for Python aren't even written in Python, they're written in C/C++ that have Python bindings, if you really want the most optimal one and the best performance then you know which one to choose 
Hi I need help!
I want to drop Candy if 50 messages sent in last 5 minutes but as you can see in my code its little different and I don't know what should I do
this is my current code
const hallowstreatCooldown = new Set();
let hallowstreatCounter = 50;
module.exports = async (client, message) => {
if (message.channelId === '1168435757397053440') {
if (!hallowstreatCooldown.has(message.author.id)) {
hallowstreatCooldown.add(message.author.id);
setTimeout(() => {
hallowstreatCooldown.delete(message.author.id);
}, 10 * 1000);
if (!hallowstreatCounter) {
hallowstreatCounter = 50
setTimeout(() => {
hallowstreatCounter = 0;
}, 5 * 60 * 1000);
};
if (--hallowstreatCounter === 0) {
// Drop Candy
};
};
};
};
for example if we need only 2 more messages to drop and the timer reach 0 it will reset everything -_-
I don't get it, what exactly is the problem?
Reads to me like it works as intended
nvm I found the correct way
drop table candy
if you really want the most optimal one and the best performance then choose Rust 
const {
SlashCommandBuilder,
EmbedBuilder,
PermissionFlagsBits,
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
} = require("discord.js");```
Instead change the require of index.js in /Users/apple/Desktop/s/responder/commands/adopt/adopt.js to a dynamic import() which is available in all CommonJS modules.
why tf is it saying this?
file is called adopt.js, i didn't do shit differently than usual
show adopt.js
i already discovered what the problem was ffs. I used an import only package
idek
bro thought breaking it open would help let the wifi out more
let the wifi escape
lol i love breaking AI
cloudflare workers down
😵
its on life support
its always "how does workers work" but never "how is workers"
"Excuse me sir, you're my therapist"
yes
I love writing commits for wrong repos ❤️ https://github.com/0x7d8/rjweb-utils/commit/7bb646ac85ccd797a7b48a6cd9bbdc40da0e70eb
I slipped in lines
and suddenly commit names were switched
Ok buddy
hey I have a little question if somebody can help me im a beginner on this, I want to do reward for vote Ive done a lot of step the only problem right now I had is this :
(im on python)
Its when I do a test vote
Show some code related to your endpoint
just as a tip, put those errors at DEBUG level, not WARN
else your console will be filled with invalid requests from the bots on the net
i go for it thx
For example, I have a voice channel id called 1234 and I want to kick everyone in this channel from voice, how can I do it with Nodejs?
Get the voice channel by its ID by calling <Guild>.channels.cache.get(<ID>), and iterate through the <VoiceChannel>.members collection to disconnect each member from the said voice channel by calling the <GuildMember>.voice.disconnect() method
please help
The <Collection>.array() method was removed, call <Collection>.values() for the values of the collection and iterate through it using a for loop
Can you write an example? I don't quite understand.
Why do you add .user after members
Are you sure channel is in cache? Also just console.log(members) to find out what it really is
values() returns an iterator, use a for loop instead of forEach()
give me a example please
The for...of statement executes a loop that operates on a sequence of values sourced from an iterable object. Iterable objects include instances of built-ins such as Array, String, TypedArray, Map, Set, NodeList (and other DOM collections), as well as the arguments object, generators produced by generator functions, and user-defined iterables.
What should I fix now?
its under member, not user
check the docs
https://old.discordjs.dev/#/docs/discord.js/main/class/GuildMember?scrollTo=voice
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
theres no need to use player.user since player is a guild member
- Use an ordinary
forloop, not afor awaitloop playerhere is a guild member, no need foruser
i dont know how to fix it if someone can help me
It seems to be doing a POST request or something? I'm not sure but why not just use https://docs.top.gg/libraries/python ?
Oh Idk I dont see this thx
How to become bot?
Click on any suspicious link on discord or scan the qr code
Within a few days, your account will turn into a bot sending invitations to nsfw servers or a nitro scam
And if you mean selfbot, you won't get that answer here, Discord's ToS applies on this channel
how can i check if a user is voted to my bot or not?
python topggpy
could I in theory have 75 people invite my support server's helper bot, get it verified, and then have it leave the servers (or do nothing in any server that's not the support one I guess)?
i just kinda want it verified lol
Discord has something that if a bot is added to too many servers at the same time, they will not verify it and you will get a time block for a certain period of time when it comes to verification
I don't remember what it's called exactly
i just mean 75 overall
inorganic growth
but like it can be slow. it just has to be 75
Exactly, although I have no idea if it's possible to set the bot to private, for example
After verification
but does having it be in those 75 servers just to get verified and then leaving them violate any verification terms? will the bot or i get banned/ in trouble?
I can do on guildCreate => guild.leave()
Probably not, it is possible for people to add a bot and then kick it
I don't think Discord cares about checking it
kk! Ill try it when i know i can find 75 people to add it haha. just people in the support server who wanna help
Just remember that if your bot uses the message content intent, you will have difficulty verifying it
hmm though i guess when it's verified ill have to apply for the privilege intents 
How to become a bot?
/becomebot
iARTIFICAL INTELLIGENCE
return 1;
} else {
return 0;
}ARTIFICIAL INTELLIGENCE
Hello, how may I assist you today?
Can you cure depression?
I'm sorry to hear you're struggling with depressions, but due to my content policy, I am unable to help you and you should rather consult a professional for help

e
why does it not line break
Show code
How can i change the permissions here using code?
#support and also try not to ping every staff member, usually you don’t need to ping anyone
Pings every 180k+ Google employees why doesn't my site get indexed!??
regex problemos 🔥
i need to remove the spaces out of a capturing group for subsitution
e.g Test 1 > Test1
Are you ok?
No, i can't
Ñ
ñ
Spanish or english
UK supports e.g. SHIFT + " + (e.g. E) = Ë
US doesn't
🎉
on mobile you can say all of that easy
just hold the character and a list of variations appears lul
some shitty keyboard dont allow
gboard on top.
pings @earnest phoenix 180 thousand times 
when i think of google
i think of voltrex
when i think of shitty code
i also think of voltrex
🥰
/j
anyways
more regex help needed
I have a capturing group and I want to negative lookbehind that capturing group
Basically the same thing cannot be infront
the usual (?<!\1)(blehhh) doesnt work
What you want to achieve is impossible, no regex engine allows that
hey guys
i have a data mining project coming up soon
does anyone know a good project to do that involves classificaation using a decision tree?
of course you have disease classification etc but idk i rather would love to do something creative but i am not a creative person lmao
Is it okay if I open a virus on my PC? I was told if I throw it in the river after I do this, then retrieve it it should have no virus on it.
hey i know im pinging u like a billion years late but this is the only info i found after searching online/ a few discord servers.
so i run a funciton with the vote event, to give the user coins. So it needs to access the database. But it doesn't seem to be able to use the schemas and everything from other filepaths.
I even tried defining the three functions/ things it needs outside of the function and then passing them in, but with no luck. do you happen to know how to use external filepath functions inside a function ran
app.post("/dblwebhook", webhook.listener(async (vote) => {
try{
await manager.broadcastEval(userVote, { context:
{ vote: vote } });
} catch (err) {
console.log(err);
}
}));
and the imported userVote function is:
const { EmbedBuilder } = require('discord.js');
const globals = require("../General functions/globals.js");
const UserProfile = require('../models/UserProfile');
const chestDrop = require('../General functions/chestDrop.js');
const updateBalance = require('../User functions/updateBalance');
async function userVote(vote) {
console.log("trying vote");
const clientsUser = client.users.fetch(vote.user);
if(!clientsUser){ return; } // check if the users on this shard
console.log("found user", clientsUser.username);
const user = await UserProfile.findOne({ userID: vote.user });
if(!user){ return; };
console.log("user profile was found");
.
.
.
continued
it doesn't seem to like me using other functions, and I get errors about using them. Unfortunately I don't have the exact error but it was about being unable to find the location of the imported functions. I can dig through the logs if it helps
Do you happen to know how to use other external functions and things inside the vote event function call when using sharding?
my issue is so niche that i can't find any answers anywhere online but im hoping someone here knows how to do this with the vote event 
i forgot to add the reply but @quartz kindle regarding #development message this message!
the userVote function is imported by the manager, so the manager is the one that is importing the UserProfile
but the voteFunction is passed to broadcasteval and executed by the shards
but when it gets there, its inside the shards ecosystem, not in the managers
and the imported files are in the manager, not in the shards
you have to put the requires inside the userVote function
all of them
and also, the require paths are relative to the location where the function will be executed
which is somewhere inside the DJS code most likely
so you have to replace those relative paths with absolute paths
or resolve them beforehand
ahah thats what I suspected, I tried passsing it all into uservote but I did't do it as described. Ill do that. thank you!
What databases are up to the following requirements?:
- Large collection with over a million of items
- ↑ Fast searching and filtering
- Some sort of support in Node.js
- Preferably a graphical display for debugging
Pretty much any mainstream database is built with performance in mind
Can’t go wrong with postgres
I’ve heard good things about MariaDB but I can’t speak to the validity of that myself as I haven’t used it
In my experience with PG I'm able to search an IP in a list of 4million subnets in 3ms
find mine :)
Why
Do I really need a refreshable access token for a mobile device? Or just a token that never expires, only if user logout
depends on your safety standards
all oauth2s will expire after some time, as that's standardized
but if ur making your own authorization flow then it's up to you to define this
is it a good idea to create a token with device ip in it? so check, if the connection not from that ip address, will require a token refresh?
it ends up being annoying for people that have dynamic addresses
and share a single ip
also annoying if you connect from mobile data and then have to log in
ahhh
return "[Name: " + info[0] + " " + info[1] +
", Email: " + info[2] +
", Subject: " + info[3] +
", Teacher: " + info[4] +
", Day: " + info[5] +
", Start Time: " + info[6] +
", End Time: " + info[7] + "]";
This is more of a javascript question but whenever I call this
in a console.log() the return doesn't return anything yet if I put a console.log before the return it actually logs so I know its not anything before the return.
yeah I have no idea
does async mess with it?
i tried that
var text = "[Name: " + info[0] + " " + info[1] +
", Email: " + info[2] +
", Subject: " + info[3] +
", Teacher: " + info[4] +
", Day: " + info[5] +
", Start Time: " + info[6] +
", End Time: " + info[7] + "]"
return text;
Also what do you want to do because it looks like an array but also it is string and look like object
ok so im trying to grab info from a row in google sheets and then return it, i honestly dont know why I made the array but i kinda did,
its supposed to return a text form
i just thought it looked nicer than rows[rowIndex].get('<whatever goes here>')
for every place where info is
never use var
show the rest of the code please
the console.log part I mean
also, js has interpolated strings, you don't need to append like that
yeah
alr
ill send
const api = require('./Student.js');
//Ignore this, part of another test
const dotenv = require('dotenv');
dotenv.config();
console.log(api.getStudentAt(0, 1));
and getStudentAt too
k
async function getStudentAt(sheetIndex, rowIndex) {
const dotenv = require('dotenv');
dotenv.config();
const { GoogleSpreadsheet } = require('google-spreadsheet');
const { JWT } = require('google-auth-library');
const serviceAccountAuth = new JWT({
// env var values here are copied from service account credentials generated by google
// see "Authentication" section in docs for more info
email: process.env.CLIENT_EMAIL,
key: process.env.SHEETS_PRIVATE_KEY,
scopes: [
'https://www.googleapis.com/auth/spreadsheets',
],
});
const doc = new GoogleSpreadsheet(process.env.SHEETS_ID, serviceAccountAuth);
await doc.loadInfo(); // loads document properties and worksheets
var sheet = doc.sheetsByIndex[sheetIndex]
const rows = await sheet.getRows();
const info = [
rows[rowIndex].get('Student_First_Name'),
rows[rowIndex].get('Student_Last_Name'),
rows[rowIndex].get('Email'),
rows[rowIndex].get('Subject'),
rows[rowIndex].get('Teacher'),
rows[rowIndex].get('Day'),
rows[rowIndex].get('Start_Time'),
rows[rowIndex].get('End_Time')
];
return "[Name: " + info[0] + " " + info[1] +
", Email: " + info[2] +
", Subject: " + info[3] +
", Teacher: " + info[4] +
", Day: " + info[5] +
", Start Time: " + info[6] +
", End Time: " + info[7] + "]";
wait
it kinda big
use hatebin or smth
haste? alr
also it looks like it's an async function, should probably await while calling it
no, hate
alr
thats a thing?
it's like the former hastebin, but better
never liked what they did to haste after it was sold to toptal
it's missing closing bracket
well, a possible cause is that it's async
so you're required to do console.log(await api.getStudentAt(0, 1));
it sucks tho that it'll also require that scope to become async
alr
given async is contagious
alternatively u can do api.getStudentAt(0, 1).then(console.log)
if u dont care then api.getStudentAt(0, 1).then(console.log)
honestly its just a testing file
so i dont rlly
im rn developing this for a bot
imma have to look more into async and stuff
you could also make a model for student info, to reduce on those array accesses
oh true
but yeah, async is annoying to deal with
never liked that approach to parallel computing
oh, not what I mean
class Student {
let name, email, subject, teacher, day, startTime, endTime;
constructor(rows) {
name = rows.get("Student_First_Name") + " " + rows.get("Student_Last_Name");
email = rows.get("Email");
subject = rows.get("Subject");
teacher = rows.get("Teacher");
day = rows.get("Day");
startTime = rows.get("Start_Time");
endTime = rows.get("End_Time");
}
toString() {
return `[Name: ${name}, Email: ${email}, Subject: ${subject}, Teacher: ${teacher}, Day: ${day}, Start Time: ${startTime}, End Time: ${endTime}]`;
}
}
this
is that how ipv4 works? lmao
if length = 2, its first and last, if length = 3, its first, second and last
whats the logic behind it?
behind my code or generally?
in general, like why does ipv4 work like that
idfk
lmao
ok well my 1 should be 0.0.0.1 technically


