#development
1 messages · Page 1898 of 1
rapsberry pi
LOL
lol
anyways
anyone?
console.log(user_money.toLocaleString())
Oops I was busy with something else!
please do typeof user_money
help
try SERVER_MANAGE
string
its working in some servers and some not 🥲
v13
u can't toLocaleString a string
so that it why
I mean, u can but it won't work as expected
solution?
convert to int first
!message.member.permissions.has(Permissions.FLAGS.)
after the FLAG.
type the type of perms
any solution?
^
but its working in some servers?
how?
idk
...you don't know how to parse to int?
i do know, i told Prince
oh ok
how do i disable eslint in a file
because it thinks useEsbuildLoader is a hook in next.config.js
its MANAGE_GUILD not MANAGE_SERVER
do you want to disable a specific rule or all rules?
can i get the list of all bitFields
all
Create an .eslintignore file
copied nextjs config cannot be wrong
yup
help
thnx
my bot is stucked on Ready Its is not turning on? it is offline
That's very little information to work with
internal/modules/cjs/loader.js:613
throw err;
^
Error: Cannot find module 'discord.js'
Require stack:
- /app/bot.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
at Function.Module._load (internal/modules/cjs/loader.js:526:27)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/app/bot.js:1:17)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:826:10)
Although "Discord.js" is defined in the main file of my bot, it gives this error, I deleted and reinstalled it and it still remained the same. It Says "Discord.js" Not Found But It Is In The Main File, Can You Help?
npm i discord.js
Doesn't Work Unfortunately
where is your bot hosted?
I was using Glitch to try something short term
install it using glitch's add package button
My Bot version v12.5.3 Currently. I haven't installed v13 yet. I Upgraded To V13 Maybe That's The Problem But The Result Was Still The Same
Can anyone tell me where that $17 went actually?
I never added payment options
credits aren't dollars
it doesnt really matter, its not real money
i use v12.0
Yes. But how can I use it then? And where is it actually 😆
you cant use discord.js v13 with node.js v12
u use on auctions, although it doesn't seem it was u who redeemed it
normally there was no such problem, it happened to me today
Yes. I did. But it says unknows user
show your package.json
then auctions
{
"main": "bot.js",
"license": "MIT",
"scripts": {
"start": "node bot.js"
},
"dependencies": {
"captcha-plus": "^2.5.2",
"chalk": "^4.1.2",
"db": "^3.3.1",
"discord-buttons": "^4.0.0",
"discord.js": "^12.5.3",
"express": "^4.17.1",
"ffmpeg-static": "^4.4.0",
"fs": "^0.0.2",
"humanize-duration": "^3.27.0",
"moment": "^2.29.1",
"moment-duration-format": "^2.3.2",
"node-fetch": "^3.0.0",
"opusscript": "^0.0.8",
"orio.db": "^2.1.4",
"quick.db": "^7.1.3",
"wio.db": "^4.0.21",
"common-tags": "^1.8.0",
"node-superfetch": "^0.2.3",
"snekfetch": "^4.0.4",
"ytdl-core": "^4.9.1",
"discord-xp": "^1.1.16",
"discord-canvas": "^1.3.2",
"discord-backup": "^3.0.1",
"twemoji-parser": "^13.1.0",
"weather-js": "^2.0.0",
"croxydb": "^0.0.7",
"ms": "^2.1.3",
"discord-button-pages": "^1.1.9",
"dblapi.js": "^2.4.1",
"node.js": "^0.0.0"
},
"engines": {
"node": "12.x"
},
"name": "app",
"version": "1.0.0",
"devDependencies": {},
"keywords": [],
"author": "",
"description": ""
}
its not actually gone
its just broken and says its been claimed
oh my package dependency hell
go to the terminal and type enable-pnpm
also, uninstall node.js and fs
they are not real packages
node as dependency lul
also, uninstall anything you're not using. you have a bunch of stuff that does the same thing for some reason, like croxydb wio.db quick.db orio.db and db
ok. I can't access my dash at the moment. I'll check on it later on. Thx for the info guys
I am using quick.db and orio.db I will try to remove the others now
fs isnt a package?!?!1
it is
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'discord.js'
Require stack:
- /app/bot.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at Object.<anonymous> (/app/bot.js:1:17)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/app/bot.js' ]
}
Now It's Giving This Error, I Think It's Still Not Solved

did you run enable-pnpm?
yes
I mean, node would not even be able to read package.json if fs was a lib
For a Discord.js Message Collector what would be a proper way of checking if any user is not a bot. I'm being a smoothbrain right now.
const filter = m => whatever check here
m.user.bot
ty
hi miyu
also hi ku
try running pnpm install discord.js in the console

appreantly bot is undifined. 
const filter = m => {}
const collector = new Discord.MessageCollector(message.channel, filter, { time: 86400000 });
Anyone can just type message and it throws it into a message. Everything works, except I just want it to ignore bot messages and let everyone respond who isn't a bot. Also ignore the long time, its a full day in ms 
weird, it used to be like that before
Originally I did this m.author.id === message.author.id && !m.bot
But that only allowed the user who typed the command to input and it ignores everyone else
I only want it to ignore boots
ah
there is no message.bot
facts
Makes sense I'm a smoothbrain ty tim and ku
What about Brazil?
tf it came as png
I wonder if the node.js Version is not compatible with the discord.js version I'm using? if so what node version would you recommend for 12.5.3?
there
I’m using node v14.17.3 for discord.js v12.5.3
i've asked before and I still can't work out how but
is there a feature in express.js which works like render_template in flask?
i use 13.x

incompatible node versions will not cause the module to not be found
discord.js v12 requires node.js v12+
so you're fine
discord.js v13 requires node.js v16.6+
internal/modules/cjs/loader.js:613
throw err;
^
Error: Cannot find module 'orio.db'
Require stack:
- /app/bot.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
at Function.Module._load (internal/modules/cjs/loader.js:526:27)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/app/bot.js:5:12)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:826:10)
Now it cannot find module "orio.db". but it is present in my "package.json" file and main file, still same as discord.js error just before.
npm i orio.db
not work
this time it's back to the beginning, it gives discord.js error, although it's still defined.
defining it has nothing to do with your error, it's failing to find the npm package named discord.js
aren't you supposed to do npm install discordjs@12.5.3?
show the output of running enable-pnpm
run pnpm i
dose anyone have a heartbeat code for buttons?
what?
@rustic nova scam deleted
one of your packages is likely breaking pnpm
I think there was a problem in the project I was using, I renewed it and opened it in another project and it's working now, thank you for your help 🙂
👍
he wants to style the top.gg page's buttons so they look like a heart basically
dose anyone have a heartbeat code for buttons?
what does that even mean
a animation for a button that make it beat
ty
"I don't code in css"
<style>
@keyframes blinking {
0% {
background-color: #06c3d1;
}
50% {
background-color: #ff0000;
}
100% {
background-color: #270da6;
}
}
#blink {
width: 200px;
height: 200px;
animation: blinking 0.33s infinite;
}
</style>
<div id="blink"></div>
ty
that's not a heartbeat, that's a cancer
Hi! I've some interactions that end up with DiscordAPIError: Unknown interaction.
By taking a deeper look into it, I found out that the time between the creation of these interactions and the time that they arrive to my bot client is over 3 seconds. So when they arrive, they're already invalid and I can't do anything with them.
That's really strange because 91.2% of the interactions are less than 250ms old when they arrive. But a small 3.6% of them are about 3 seconds and up to 7 seconds old!
Did you experienced something similar?
errrr
HOW is the interaction arriving over 3 seconds after u create it?
like, it's 3s after if reaches discord
where is your bot hosted?
its still amazing
ty❤️
at home, Yeah that's not the best, but still...
it could be network issues
That seems like to be it indeed. I just wanted to check if it was a known issue
If it sometimes takes a few second, use deferReply()
Your bot will show up Bot is thinking... and then send the message
yes but the interactions are older than 3s before they arrive to my bot client so I can't even do a deferred reply
you can try monitoring your network ping at the same time and see if there are any fluctiations
oh lol
that's a good idea
dam this seems like a bad api. I'd expect
await interaction.deferReply()
await thing()
await interaction.editReply(response)
to be something like
interaction.replyWith(async () => {
await thing()
return response
})
@boreal iron in ur code how can i make like a cooldown before it starts
How can I stop this? https://i.callumdev.xyz/8835c.png
So I am in the process of making a platform that allows people to upload stuff to the site and display it on their profiles and such. Regarding the storage how should I go about storing the peoples images/videos or whatever properly or does it not matter how I store it as long as I save the info of that post in the db? (With that info I would have a link to the specified image of that post)
make sure that you can ensure that there are no data leaks
i wouldn't personally want to upload files to a site where you can't ensure that databreaches or malware could be
Well ofc not
I haven't told em how much I wanna use as of right now
But he owns a good bit of em
Yea
and is it in a datacenter or in his house etc
No idea where its located
I just know he made a deal with a hosting service and split the bill with them when they were buying storage racks
so he owns like half of em
ideally you would want it in a datacenter
Yea fair point
I am honestly not too experienced with content delivery so this is an entire new relm to me
if you need help, i'm more than happy to try
Well, I have a fair idea how to actually serve the images its just storing them properly
So it isn't just a jumble of mess
yah
somehing like that
i have a spare vps so i'm gonna try install that now and see if it works
the tutorial walks you through it
Alrighty
If I am making commands for a later update on my bot, How do i keep the file on the bot but make it hidden so no one can use it?
Like on github?
don't test in prod
On my Code
oh well just split your bot into prod and dev versions
make a backup version of the bot and run it as a beta version
keep your prod alive on the host and test your development code on your machine
I am trying to make not useable Lyrics, so people cannot use the command since that is next update
Oh, OK
normally the thing you're asking for is done with feature flags but I don't think you're quite there yet
I am probably just going to say fuck this for now
I am not even at the point of needing to handle posts yet
I just wanted to do some research beforehand
alr
Now the bot is not working :c
uh.. dumb question i know.. uuuh... how can i get the folder where the index.js is executed?
I need to scan a directory in that Script path but i constantly get "no such file or directory"
process.cwd() should give you the current working directory
which is where package.json is 99% of the time
unless you're doing some monorepo stuff
urgh.
Not really.. but cwd seems to be the Folder where i call the script from
Like /root
so relative to the file you are in?
ah yeah that's relative to the directory of the file you're running. Didn't think that's what you wanted
Okay.. another noobie question from me.. uuh..
I get this error... (Yeah i know)
https://i.imgur.com/9Mzhp63.png
Checked all credentials.. and yes, they are correct
is the port open?
Locally?
I guess the ports are open, another port "8080" is reachable externally.. but i try to connect to the localhost.. so normally that shouldnt matter
econnrefused errors are normally linked to firewall
I enabled ufw just to allow the port. Nothing changed
Just saying. The connection never leaves the server
we'll need tim
Thats the Output
https://i.imgur.com/dfsGBSG.png
2333 is not there
did u start the server process?
Yes
8080 is something different
what do you have in your application.yml?
application.yml
I used this Password as a test
Configfile of the Bot:
https://i.imgur.com/WolHVw7.png
you keep changing ports lol, so now its port 30333?
Its still the port
So.. i managed to connect to it..
I changed in the application.yml the address to localhost (127.0.0.1)
again
And then Sudo opened a screen for the lavalink-server
If i use my Start script i get this error
screen -dmS musicbot sudo node musicbot/newBot/bot/index.js
screen -dmS lavalink-server sudo java -jar musicbot/newBot/server/Lavalink.jar
what error
The connection thingy
this is your start script?
Yes.
you might want to add a delay as well, if those commands are too fast
not sure how long lavalink needs to become online
So the server is almost 2 Minutes online
Still cant connect to it if i manually start the script
remove lavalink from the start script
run it manually
then run only the bot with the script
Okay.. started it manually...
screen sudo java -jar musicbot/newBot/server/Lavalink.jar
After i confirmed that i was fully started i ran the script... you know.. this thingy.. sudo node musicbot/newBot/bot/index.js
Still no connection
i think it has something to do where i start it
lol
If i start the Lavalink Server inside of its folder.. the script connects
What is a good Color Scheme for Blue? (i asked here since it is for my Discord Bot...)
message.guild.users.cache.get()
``` is a valid function?
nope, cache is an array.
Imho, that green is heckin disgusting and hard to match with anything else
So much that discord itself doesn't use that tone for switches in settings screens
i am the only one using it
too bright yet lacks any meaningful combo
it reminds me of christmas
perhaps
i give up. i do:
client.on('messageCreate', message => {
console.log(message);
});
and then nothing will happen the bot refuses to work when I send a message.
Yes and yes
client.on(‘messageCreate’, async (message) => {
console.log(message);
});
What will that do?
It’ll fix your issue
Would only make sense if you run asynchronous methods inside
No it doesn’t fix your issue
yes
Try log the ready event please to see if your bot gets ready.
Yeah it does
And make sure it has the permissions to read messages (and the message history)
I just tested it and no it does not
I am testing with DMs
Ah ok
I've even tried logging something else in there to see if the action is ever triggered and it's not
I've also tried running it on Linux
Cuz I'm using Windows
Do you share at least one guild with the bot?
Wdym?
OS doesn’t matter
After trying really hard to set up on it I realize that
And yes I'm on a nodejs 16
I mean do you share at least one guild with your bot?
I just use 36393F
Are you and your bot are in the same guild at least one?
A guild is?
This whole server is a guild
Oh yes
I've tried messaging in a server for the bot
?
And the bot has the required permissions in the server?
It is admin
On which OS are you atm?
Windows
Hmm I’m out of ideas then
36393F is Discord's dark theme background color
Should I regenerate the token?
You can test creating a new app
That might help
As well as TEMPORARILY disabling your server firewall to make sure incoming requests aren’t blocked
But i don’t think that’s the case
Oh I forgot one thing
You never bothered to ask if the bot has the GUILD_MESSAGES intent enabled
Did you set the right intent?
Yes yes
There we go…
Always forget you need to specify them yourself in v13
@dapper jasper
Yes I did
But completely remaking the application is what fixed it
Hmm weird but okay
Thank you very much for suggesting that I've just been trying for an hour to get it to work
i read somewhere that i should run openssl speed to test which ciphers are faster on my machine
this thing's been running for 40+ minutes now
@_@
plot twist: you're actually mining ethereum for the fat guy that lives next to u
lmao
is there a way to know where the request is coming from using the req params in express?
nvm
but how do i make it secure that my website can only request from the backend?
preventing any outside connection from accessing the server on that port
also the thing is the browser is requesting from the backend so the user can just see the code and see the authentication code

you cant hide authentication from the client
so dont put it there
what are you using this authentication for?
🤔 I dont think giving users access to your database is a good way to do things.
no like updating things from the backend
like when a user click a button the js code request something to the backend and the backend updates ir
it*
the only problem is idk how to make the request secure for other ppl to just make some request
button sends a request without authentication to the backend, then backend completes the requiest with authentication
I think we need more context, what is this for?
like a bot dashboard?
ye its a bot dashboard
example:
// browser
fetch("website.com/backend", { method: POST, body: "something" })
// backend
app.post("/backend", (req, res) => {
if(req.body === "something") {
database.set("a", "b");
res.send("done")
}
})
(pseudo-code)
but how do i hide it from the user checking out the browser's code 
just to clarify, you are talking about trying to authorize users and are unsure about that?
or the database
or are you trying to prevent the user from sending a request outside of the browser?
^
there is no 100% reliable way of doing that
the closest you can get is using session cookies
sad
thx for the suggestion tho 
no matter what you do, anyone can see exactly what the browser is sending to your server if they dig hard enough
and nothing stops them from sending the exact same thing outside of the browser
one more thing is it possible to delete a cookie in native js
client.on("messageReactionAdd", function(messageReaction) {
let data = JSON.parse(fs.readFileSync("./config/reactions.json", "utf8"));
var good = parseInt(data.good)
var bad = parseInt(data.bad)
if (messageReaction == '✅') {
good++
} else if (messageReaction == '❌') {
bad++
}
var newData = {
good: good,
bad: bad,
}
fs.writeFile("./config/reactions.json", JSON.stringify(newData), err => {
if (err) console.log("Error writing file:", err);
});
});
my issue is that it just shows in the json file as null
only if its not marked as server-only
show the actual error
hello
is there any way we can check if the a indivual user has voted for the server with the same method how we can check for bot
excpet of webhooks
like via the get method
Ye, the only way to actually check for a specific user is by using the GET method
Webhooks are one-way
but i am asking for the server vote check not for bot
pls anyone?
youll have to use webhooks
servers dont have api
ho ok thx
im using oauth2 for this
how do i filter a user's joined servers which the user has manage server perms and the bot is in that server?
How do I put emojies in my code (I am on laptop)
search up emoji
and then paste it
bruh
💩
haha
bruh
just search up poo emoji
copy paste
\💩
So I am trying to figure out which would be easier, making a table relation between users and posts or just making them separate but having posts store the user id.
I am unsure which would be easier in practicality since I have never actually tried making a table relation without using an orm of any sort.
I mean it doesn't matter all that much its just with sql relations you get extra features such as joining tables and updating relating rows automatically without another query
you should make a relationship between post user id and user id since it also acts like a bug catching mechanism if you're not going to be joining much
hi
nah
win+. works on italian layout, idk on other layouts
how do I check for permissions in v13?
Doesn't work it zooms in
wait did u do win + or win .
Windows +
user.guilds.filter(g => g.members.find(m => m.id === user.id)?.hasPermission("MANAGE_SERVER"));
¯_(ツ)_/¯
did you upload it both to the guild and global
you can have a guild and a global command with the same name
what about user agent checking
How can I Import commands from file to another in python ??ping me and reply :))
its not a djs guild class
its this
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
https://www.youtube.com/watch?v=PRcMPwaWj1Y why does anyone use a dev environment like this man
Having some fun, writing a compiler in C
it's so painful watching him I can't. It's a good video but my god
Why would you want to write header guards manually... why would you want to have to try to compile your program, then realize you forgot to import stdlib.h and import it manually when an IDE could do it for you automatically as you type calloc 🙄 just use an IDE dawg ugh
"i'm an indie dev" starter pack:
because re-implementing features of an IDE instead of using one in the first place
serves as a distraction from doing your actual project

Based and bigoted pure text editor programmers
me spending 4 days on a hella simple css transition that breaks on mobile: sweats
css hard
witchery
i just use https://animista.net/ to generate out of the box animations because i want to keep the little sanity i have
the discord logo is 27px wider than tall
so I end up with a wide putin discord logo because the img is 64 x 64
why tf is uncalled function being executed
its never called
its not even same directory
nvm i got it
Im getting this error at one of my image attachment in an embed and the image isnt loading. But when i run the exact same command again, everything works fine
what could be the cause for that?
@Override
public void execute(SlashCommandEvent event, DBUser user) {
try {
final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
ImageIO.write(createImage(user), "png", bytes);
final EmbedBuilder embed = new EmbedBuilder();
embed.setTitle(user.getAlpaca().getNickname())
.setDescription("_Have a llamazing day!_")
.addField("Work", checkCooldown(user.getCooldown().getWork()), true)
.addField("Sleep", checkCooldown(user.getCooldown().getSleep()), true)
.setThumbnail(event.getUser().getAvatarUrl())
.setFooter("Created by SirTimme", "https://cdn.discordapp.com/avatars/483012399893577729/ba3996b7728a950565a79bd4b550b8dd.png")
.setTimestamp(Instant.now())
.setImage("attachment://alpagotchi.png");
event.replyEmbeds(embed.build())
.addFile(bytes.toByteArray(), "alpagotchi.png")
.queue();
} catch (IOException error) {
LOGGER.error(error.getMessage());
}
}
thats the command
SAME
@boreal iron remeber the code that u gave me? yeah how do i make a cooldown before it starts
let user = message.mentions.users.first() || message.author
let coin = await db.get(`coin_${user.id}`)
``` coin = 0
the coin is 5000 for me and 500 for my friend
it gives 5000 for me but for my friend gives 0
maybe he lost them
How do you make "premium" commands? Where only paied people can use....
have a database of users, with something in it that says if the user is premium or not
when the command is run, check if the user has premium
you can add a delay if that’s what you’re looking for
animation-delay: 3s
To the element you need
hi, i'm trying to send a text message to whoever visits the ip:port of my vps
this is my code:
const port = 3000
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.listen(port, () => {
console.log(`App startred on ${port} port`)
})```
when i start this on my local machine it works just fine, but when i start it on my VPS using the public IP and the port 3000 it does not work, any advice?
in case that matters, the VPS is on a linux machine
does your vps have its 3000 port open
Does the port 3000 accept TCP requests?
well didnt think of those two
as you can see i'm new to express lol, also, how could i check those options?
OS?
Show me your input policy please
sudo iptables - -list -v
Yeah my phone doesn’t allow two - behind each other
Great
No space between - and -list
i got this:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination```
That’s not your issue then since the input policy is on ACCEPT by default
Hey, I'm trying to deploy next js to vercel but I keep getting this error
"Eslint has unmet dependencies"
It works fine on my local machine tho..
This is my build log
Does your VPS may have a preconfigured firewall in your server control panel somewhere
If so you would need to allow port 3000 INBOUND TCP
How can we get that result from a json on Node.js?
(like json.items() in python)
json = {"a": 1, "b": 2}
Expected Result:
[["a", 1], ["b", 2]]
Object.entries?
Object.entries(json)
Thanks
how do i make this show as a block```css
<style>
body{
margin: 0;
padding: 0;
background: #262626;
}
.center{
display: flex;
align-items: center;
justify-content: center;
right: 5;
height: 3vh;
}
.center a{
position: relative;
display: block;
text-decoration: none;
color: red;
overflow: hidden;
font-size: 10xp;
padding: 10px 10px;
transition: .2s;
font-family: 'Lexend Peta';
}
.center a:hover{
color: yellow;
background: red;
box-shadow: 0 0 10px red,
0 0 10px red,
0 0 10px red,
0 0 10px red;
transition-delay: 1s;
}
a span{
position: absolute;
display: block;
}
a span:nth-child(1){
top: 0;
left: -100%;
width: 100%;
height: 2px;
background: linear-gradient(90deg,transparent,red);
}
a:hover span:nth-child(1){
left: 100%;
transition: 1s;
}
a span:nth-child(3){
bottom: 0;
right: -100%;
width: 100%;
height: 2px;
background: linear-gradient(270deg,transparent,red);
}
a:hover span:nth-child(3){
right: 100%;
transition: 1s;
transition-delay: .5s;
}
a span:nth-child(2){
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg,transparent,red);
}
a:hover span:nth-child(2){
top: 100%;
transition: 1s;
transition-delay: .25s;
}
a span:nth-child(4){
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg,transparent,red);
}
a:hover span:nth-child(4){
bottom: 100%;
transition: 1s;
transition-delay: .75s;
}
</style>```
ok yeah ty
Can’t help you on mobile, sorry what element needs to be a block and what do understand as block 
a button it show as a line
what's better for...of or array.forEach
From what I was told by js master Tim, it depends on the use case
I generally use for...of
I think it’s faster in most cases but that’s pretty much speculation on my end from what I’ve been told when learning js
forEach can give you the array it was called on which makes it good for one liners
Not sure then if I understood you well but display: block; or display: inline-block; will do the job depending on what you need
are you using replit
na
windows
bruh fucking javascript
now it works
ok so when i do this
it works in directory where .env is
but not in child directory
you can set path, now it works
is there a way to check if the target has a role above the user trying to mute?
check role position
assuming you are using discord.js there is this method
yeah, ty
^^
and there's the method .highest right?
yea for the member role manager
Does anyone have a good knowledge on How to deploy next/react using vercel?
that's because dotenv will look for the .env in the folder you ran it in unless you specify the folder yourself
const guilds = _.chunk(client.guilds.cache.map(g => {
console.log(g.name)
return `**__Guild: ${g.name}\nId: ${g.id}\nOwner: ${client.users.cache.get(g.ownerId).name}#${client.users.cache.get(g.ownerId).discriminator}\nMembers: ${g.memberCount}`
}), 5)```
err: cannot read property "name" of undefined
client.users.cache.get(g.ownerId).name is the owner cached
any solution?
check if the user is cached
ok so, sorry if im bothering with this issue but i cant find a solution
im trying to send a response on a VPS, so who visits ip:port sees that
i had an issue doing this earlier, i fixed that but i got another issue, this is the error im getting:
Error: listen EACCES: permission denied 0.0.0.0:80
[...]
Emitted 'error' event on Server instance at:
at emitErrorNT (node:net:1346:8)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
code: 'EACCES',
errno: -13,
syscall: 'listen',
address: '0.0.0.0',
port: 80
}```
i checked on the aws instance panel, i already changed the permissions and the ip should be accessible by http
1 more question
how can i fetch all members from all servers?
idk how but you probably need the guild members privileged intent for that
you mean make it bold?
i have it but still its showing
1 members
but my bot is in 3 servers
<b>text</b>
members are not cached
oki thnx
ig fetching the guild again might give you the updated data
html question: how do I smoothly scroll the page to a heading?
setting the hash to #heading directly jumps to the heading
Does anyone experience problems with Discords CDN regarding AccessDenied errors? i randomly get these
transition: padding 0.25s, transform 0.25s, height 0.25s, width 0.25s;
in scss how do I avoid repeating the 0.25s
i puted display: block; but didn't work
Make sure the url is correct and you might have to supply a User-Agent header
any one knows how can i make a custom stocks graph that i can change how it looks
idk how to explain
can i add an user agent directly via url param?
but thats weird, i never needed to do that
not a url param
im just adding my profile picture via cdn link in the embed
never needed an user agent header for that
Well. There was a bug with Discord where that was required a while ago, but that apparently got fixed, but idk if that thing resurfaced
yeah it was in august
Doesn't hurt to try it and see
to add the user agent?
Yeah
yea lemme see, thanks for the input
Using python "official" top.gg package:
The return info at the vote event is super poor, any way to get the voter details ect?
Fetch data from the Discord API
All Top.gg gives is a user ID
Also not sure why you put the official on quotes
:3
There's not really much more detail they can give if not the current
Well, maybe last vote date, but that's stretching
`import random
test_seed = int(input("Type your seed\n"))
random.seed(test_seed)
random_side = random.randint(0, 1)
if random_side == 0:
print("Heads")
else:
print("Tails")`
did i code right?
any simplicity?
does random.seed do anything?
it helps to get random num
idk then
my button is not showing as a block it is showing as a line-block and i have display: block;
stacks overflow it once
how?
just go to stacks overflow and type your problem you are facin
my code: ```css
<style>
body{
margin: 0;
padding: 0;
background: #262626;
}
.center{
display: flex;
align-items: center;
justify-content: center;
right: 5;
height: 3vh;
}
.center a{
position: relative;
display: block;
text-decoration: none;
color: red;
overflow: hidden;
font-size: 10xp;
padding: 10px 10px;
transition: .2s;
font-family: 'Lexend Peta';
}
.center a:hover{
color: yellow;
background: red;
box-shadow: 0 0 10px red,
0 0 10px red,
0 0 10px red,
0 0 10px red;
transition-delay: 1s;
}
a span{
position: absolute;
display: block;
}
a span:nth-child(1){
top: 0;
left: -100%;
width: 100%;
height: 2px;
background: linear-gradient(90deg,transparent,red);
}
a:hover span:nth-child(1){
left: 100%;
transition: 1s;
}
a span:nth-child(3){
bottom: 0;
right: -100%;
width: 100%;
height: 2px;
background: linear-gradient(270deg,transparent,red);
}
a:hover span:nth-child(3){
right: 100%;
transition: 1s;
transition-delay: .5s;
}
a span:nth-child(2){
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg,transparent,red);
}
a:hover span:nth-child(2){
top: 100%;
transition: 1s;
transition-delay: .25s;
}
a span:nth-child(4){
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg,transparent,red);
}
a:hover span:nth-child(4){
bottom: 100%;
transition: 1s;
transition-delay: .75s;
}
</style>```
embed ahm?
idk then
ok ty
like...?
@earnest phoenixask some one in general chat to look up
ok ty
How do I make this a Premium Command?
check from db that this person has premium or not
^
I believe Tim already answered you about this earlier today...
Amazing that you got exactly the same response from this person 👆
how can i create collector for my bot vote
my button is not showing as a block it is showing as a line-block and i have display: block;
my code:
<style>
body{
margin: 0;
padding: 0;
background: #262626;
}
.center{
display: flex;
align-items: center;
justify-content: center;
right: 5;
height: 3vh;
}
.center a{
position: relative;
display: block;
text-decoration: none;
color: red;
overflow: hidden;
font-size: 10xp;
padding: 10px 10px;
transition: .2s;
font-family: 'Lexend Peta';
}
.center a:hover{
color: yellow;
background: red;
box-shadow: 0 0 10px red,
0 0 10px red,
0 0 10px red,
0 0 10px red;
transition-delay: 1s;
}
a span{
position: absolute;
display: block;
}
a span:nth-child(1){
top: 0;
left: -100%;
width: 100%;
height: 2px;
background: linear-gradient(90deg,transparent,red);
}
a:hover span:nth-child(1){
left: 100%;
transition: 1s;
}
a span:nth-child(3){
bottom: 0;
right: -100%;
width: 100%;
height: 2px;
background: linear-gradient(270deg,transparent,red);
}
a:hover span:nth-child(3){
right: 100%;
transition: 1s;
transition-delay: .5s;
}
a span:nth-child(2){
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg,transparent,red);
}
a:hover span:nth-child(2){
top: 100%;
transition: 1s;
transition-delay: .25s;
}
a span:nth-child(4){
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg,transparent,red);
}
a:hover span:nth-child(4){
bottom: 100%;
transition: 1s;
transition-delay: .75s;
}
</style>```
is there a way to ask a follow up question with interactions?
interaction.followUp({ [content: message]
i think
How about making a codepen instead?
^^
yeah but how would you let the user respond with input
idk in css soooooo
wdym?
??
i dont code css
like /add
What would you like to add?
"text"
I am saying put your code in https://codepen.io so that it'll be easier for others to read and understand.
ok one sec
how do i put it
result = "Heads" if random_side == 0 else "Tails"
Implicit:
result = "Heads" if not random_side else "Tails"
ok then?
Then put your code there and share the link
ok.
:)
Ternary operators ❤️
they dont even give that
they provide bot id and if weekend
if im not mistaken
You are mistaken
topggpy types represent such data within type annotations and documented fields
https://github.com/top-gg/python-sdk over here there is nothing else than bot id and is weekend
A simple API wrapper for top.gg written in Python. Contribute to top-gg/python-sdk development by creating an account on GitHub.
just plonk it in
i tried html <div class="aside"> {{longdesc}} </div>
i tried that
What is this
No what framework
HTML
Just html?
the {{}} is from Quart in Python
.replace(/\[(.*?)\]/g, '<a href="$2">$1</a>')
How can I get the '$2'? I've so far gotten the $1 which is the text and not the link, I want to get the value that is in between brackets after the []
That's what it looks like right now
You only have 1 capture group in your regex. Therefor, only 1 template will be provided.
Here's a regex for text text.
/\[(.+?)\]\((https?:\/\/.+?)\)/gs
I used /\[(.*?)\]\((.*?)\)/g and it worked for me. Thanks, though!
Class BotVoteData contains fields bot and is_weekend as well as the ones in VoteDataDict, as it inherits that class.
anyone wanna help me configuring nginx? lmao
i hate configuring nginx lmao
a simple hello world node.js app is giving me 17k reqs per 10 seconds
the same app with ssl drops down to 3k per 10 seconds
both of those are without nginx
with nginx it gets even worse
3k in 10 seconds without ssl, 1.5k with ssl
at this point i dont even know why im bothering with nginx
might as well just run node directly
var activeWord = await wordsDiv.$eval(".active", (word) => word.innerText);
hi, how can i handle this, let's say the element ".active" isn't a thing i don't want the entire app to crash cuz of it
i want to console log it and continue running the app
using puppeteer btw
So I have been trying to figure out the messages.read intent, But when I am trying to invite a bot with it I need to have a redirect URI, Why precisely is this and what do I need to do? Trying to make a automod for 1 channel specifically but can't access message.content.
How does OAUTH2 even work?
Can someone tell/give me a name for my bot please ? 😭
My bot kinda can do anything possible
call it Infinity or something cringe
That works
Bruh
Bruh
Bruh
Bruh
Bruh
you need to template that as html nodes not as text. Jinja has a pipe for that just Google it or look through the docs
select bot scope, the rest u don't need to worry abt
well, unless u want slash cmds, in which case u should get application.interactions too
oauth2 is a two-step authorization basically
u ask the user for a token, then u use that token to exchange for the actual info
With node.js, you use npm start, what do you use for Bash?
My code is crazy
That is SMALL replit
No Its zoomed out to show the code
Let me see the issue
add an anchor url
you need an element with an id
for example <div id="myid"></div>
then give the button a link to that id
@covert gale is there a Broken command?
<a href="#myid">
and also how do i add this big img?
it didnt send the img for some reason
there is not error it just shows null in the json
how do i add this big img for my site embedding
I've got no experience with this, but if you look at the meta tags for discord.com you can see it has this for that image: <meta data-react-helmet="true" property="og:image" content="https://discord.com/assets/652f40427e1f5186ad54836074898279.png">
discord embeds use opengraph meta
tried to change width and height and the outcome was this
for the img im using this (the src value)
You can't use an svg with the og protocol
Svg isn't really an image format, it's html code.
You have to use a raster image
raster what
Like jpg or png
so how do i use topgg stats thing with a .jpeg/.png file?
You can't
You could look at https://dblstatistics.com. They have widgets in png format iirc...
change .svg to .png
Widgets are so 90s anyway
I wonder if they'll get a design upgrade with the new site 👀
doesnt say that in the docs tho
Do you guys know how to fix pm2 when the error will automatically restart, help me
npm i pm2-discord
hey ive requested something to dblstatistics.com abt getting like a png thing it responds with this
what do i do to like convert it to an image
when you open an image in notepad 
^
helpp
I thought V13 doesn't allow you to read message.content without the intent to read messages?
Or am I stupid?
npm i pm2
it's not v13 who decides whether you can or not read message.content, it's the Discord API
v13 is just prepared for that upcoming change, coming in April iirc
that's why there is already the Intents option for that
Why would the messages.read intent require OAUTH2 Though?
does it?
Yeah it does for some weird reason
the flag is GUILD_MESSAGES
right now you don't need anything other than this
I think that's another subject besides the one I as trying to answer
I was talking about bot Intents, idk anything about OAuth2
btw, messages.read is not the same as message.content
What would messages.read do then?
messages.read I think it's for another thing other than bots
you just need the bot scope
as @lyric mountain said, select the bot scope and ignore the rest
that's just for you to build the invite link
for the code, just get GUILD_MESSAGES as an intent early if you want
later you'll need to apply for that privileged intent
or, you can make your bot act through slash commands with the interactions feature
Convert it to buffer?
whats buffer
Thank you my guy!
why discord webhooks are too slow
they are lazy
ig its sending msg after 10 or 15 min
its working on some servers and on some not why?
idk, just tested it, works fine
discord bug?
how are you sending them
by bot?
code maybe
async function sendWeb(name, av, message, Channel, msg){
let channel = message.guild.channels.cache.get(Channel)
if(!channel.permissionsFor(message.client.user.id)
.has('MANAGE_WEBHOOKS')
)
return message.channel.send({
embeds: [{
title: 'Invalid Permission',
description: `**I dont have permission to Manage Webhooks**! ${
channel.name
}`,
color: 'RANDOM'
}]
});
let webhook = await message.guild.channels.cache.get(Channel).fetchWebhooks();
webhook = webhook.find(x => x.name === 'DEMON-CHAT-BOT');
if (!webhook) {
webhook = await message.guild.channels.cache
.get(Channel)
.createWebhook(`DEMON-CHAT-BOT`, {
avatar: av
})
}
await webhook.edit({
name: name,
avatar: av
});
webhook.send(msg).catch(err => {});
await webhook.edit({
name: `DEMON-CHAT-BOT`,
avatar: message.client.user.displayAvatarURL({ dynamic: true })
})
}```
if you are not getting errors
nope
its probably host
?
where are you hosting
unfortunate, they try to steal your steam account lol
@rose warren
dlscord lol
lol
?av 289473498114555906
thats what you wanted anyways
@spark flint lol thanks
HumanError: Could not resist eliminating 455 users.
How to fix? 😂
Wot, why do I have a star.
In a situation where I just need a reverse proxy, should I opt for nginx or traefik
Upon further research I’m gonna go with traefik as it suits my needs and use case better
how do i add a text in my top.gg bot page?
like above a button
@boreal iron any idea
wdym?
but would mean a lot of fiddling with position: absolute and left/top
like, u cant add new elements to the page, only change their styles
ouf
but u can move text around by positioning
but that also means you'll be stuck to a single platform (anywhere else and it'll look out of place)
like get a thing that i dont want and move it with positions?
like that would work?
yeah shit
or @lyric mountain is there a code that i can change the invite button name then reset after like 5 sec
change the invite in the button then reset it back to invite?
can i?
will it work?
u cant, css cannot change elements' content
but can i reset after 5sec?
css is style/animations only
options: [{
name: x,
description: x,
type: 10,
required: true}]
I'm gonna guess that the number's too big
just use the user option type?
that or string
I need message id
It’s not too big. It is supposed to be 18 digits
should be a logical error
What you mean?
Like wrong number or so probably
Its all number as you can see
I mean the id could probably not exist.
I just required if it is number
use the string option
An option but not a solving i think
try with a smaller number to see what happens, ex 12345
Oh yeah
@earnest phoenix I am not sure but usually ids are in string format
options.number is crashed i think
Just input a string and parse it
Ids are long for ints or numbers
Oh true. I totally forgot that
My skill issue
Go with strings
Discord isn't too good at taking large numbers in slash commands
Instead of an int take a str
in ts, I want to make a Magic Utility Type that adds a type to each of the properties, like this. Whats the best way to achieve this?
type Magic<S, A> = {}
type Result = Magic<
{
a: string
b: number
},
null
>
/*
Result should be of following type
{
a: string | null,
b: number | null
}
*/
Generating types by re-using an existing type.
You are not authorized to perform this action on this application
Why i get this error on slashcommands
add application.interactions scope to invite
now ask to re-authorize the bot on that server
Still same
İts global and bot online on just 1 server
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const rest = new REST({ version: '9' }).setToken(process.env.token);
(async () => {
try {
console.log('Started refreshing application (/) commands.');
await rest.put(
Routes.applicationCommands(client.conf.clientId),
{ body: client.slashCommands },
);
console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})();
DiscordAPIError[20012]: You are not authorized to perform this action on this application
at SequentialHandler.runRequest (/rbd/pnpm-volume/9378658a-fa99-401c-9690-215512043a17/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.js:197:23)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (/rbd/pnpm-volume/9378658a-fa99-401c-9690-215512043a17/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.js:99:20)
at async /app/bot.js:122:3 {
rawError: {
message: 'You are not authorized to perform this action on this application',
code: 20012
},
code: 20012,
status: 403,
method: 'put',
url: 'https://discord.com/api/v9/applications/843505868275449866/commands'
}
hmmm...aren't slashes officially supported by d.js?
Actually no
It makes really big problems
When my bot relog most command not working
If i dont invite bot again
are u reloading slashes on every start?
idk, for that matter we'll need tim
updates to slash commands take 2 hours to propagate
?
discord isn't going to fix the issue
Then why they will force to use their shit?
standards are a good thing
getting all the messages and checking to see if it's a commands is poopy
then parsing out the parameters
oof
never had issues with the old way tbh
I mean, client side param checking is cool and nice
But its better than wait 5 min for check a command
Just think you got a big bot and it crashed
Your users will have to wait 2 hours for using command
Is it good ?
you dont need to wait 2 hours if the endpoint goes down
just bring it back online and its fixed
then dont update your global commands every time you start your bot
Even 10 minutes are ugly
it's instant
What you suggest?
the ONLY thing holding me back atm is slashes not allowing multiple command signatures
unless you add a new command or update a command
console.log("Slash Commands");
fs.readdirSync("./commands/").forEach(async dir => {
const commands = fs.readdirSync(`./commands/${dir}/`).filter(file => file.endsWith(".js"));
commands.map(async cmd => {
let file = require(`./commands/${dir}/${cmd}`);
let name = file.name || "No command name.";
let description = file.description || "No Description";
let options = file.options || [];
const data = { name, description, options };
let option = name == "No command name." ? "❌" : "✅";
if (option == "✅") {
await wait(500);
client.slashCommands.set(name, { ...data, run: file.run });
await client.application.commands.create(data)
.then(console.log(`Global Slash Command: ${name} Loaded ✅`))
.catch(console.error) };
});
});


