#development
1 messages · Page 1927 of 1

Can someone help me in some css/html?
why not just use .env and https://www.npmjs.com/package/dotenv
its literally
.env
THING=VALUE
index.js
require('dotenv').config()
console.log(process.env.THING) // Returns: VALUE
ye
it gets the .env and parses it
only need to load it once
you dont need to?
it doesnt
just put it at the top of the file
unused variables are yukky
np
you probably don't want to rely on the order of key value pairs in an object
also if you have an object that has numbers as keys, why not just use an array
I solved the problem thanks
why do people delete their questions lol
deleting your own questions makes you look more noob than posting stupid questions :^)
I was wondering what Xetera was referring to
May they just find the answer
but why delete
const { fork } = require("child_process"); is better
why can't i submit my bot again after it has been declined yesterday?
you probably want to ask in #support, this is #development (for coding and stuff)
ok
what language
Do I have a risk of my bot being hacked when I use replit ?
I do use environment variables so yeah imp stuff is saved but I'm worried that replit codes are public so that's why asking.
Ok thanks.
I'm using oauth to authorize the user through a nextjs api endpoint:
// /api/oauth_callback
export default function OAuthCallback({ req, res, query }) {
const { token } = query;
// authorize smh
}
How do I redirect the user after authorizing?
3xx status code?
not sure if next is same but in express I would use
res.status(302).redirect('/path')
MongooseError: Operation `prefixes.findOne()` buffering timed out after 10000ms at Timeout.<anonymous> (C:\Users\Admin\OneDrive\Desktop\Tension Bot\node_modules\mongoose\lib\drivers\node-mongodb-native\collection.js:149:23) at listOnTimeout (node:internal/timers:557:17) at processTimers (node:internal/timers:500:7)
tbh im completely lost here
looks like your db didn't respond within 10 seconds ig
would that be a mongoose issue?
no, a mongodb issue
either your db isn't responding or you did something incorrect in your query
(from what I can tell at least)
await your connection
same issue fixed it
ah yeah that's important
like await mongo.connect(....)
actually mongoose has the mechanism to detect it,but sometimes if the db/internet is slow ,it buffers out,since it couldn't connect at the shorttime
yeah i added the await and it still gave me the same issue, prolly my internet
is your function async and is it executed async?
yes
(async()=>{
...
})();
This would be a approach,if you paste inside your root file(index.js)
ahhh
nah it still doesnt work for me
i dont have my connection in index.js, i have it in ready.js
what
const mongoose = require("mongoose");
const { mongoPass } = require("../../config.json");
module.exports = async (client) => {
setInterval(() => {
client.user.setActivity(`${client.guilds.cache.size} Servers | .help`, {
type: "WATCHING",
});
}, 40000)
let allMembers = new Set();
client.guilds.cache.forEach((guild) => {
guild.members.cache.forEach((member) => {
allMembers.add(member.user.id);
});
});
let allChannels = new Set();
client.guilds.cache.forEach((guild) => {
guild.channels.cache.forEach((channel) => {
allChannels.add(channel.id);
});
});
console.log(
chalk.bgMagentaBright.black(` ${client.guilds.cache.size} servers `),
chalk.bgMagentaBright.black(` ${client.channels.cache.size} channels `),
chalk.bgMagentaBright.black(` ${allMembers.size} members `)
);
await mongoose
.connect(mongoPass, {
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
useFindAndModify: false,
})
.then(
console.log(
chalk.bgGreenBright.black(
` ${client.user.username} connected to Mongo DB `
)
)
)
.catch((err) =>
console.log(
chalk.bgRedBright.black(
` ${client.user.username} could not connect to mongo DB `
)
)
);
};```
this is my ready.js and cant seem to figure out the problem here
apparently you can't access window or document in nextjs
no
file databases are harder to use and more easy to corrupt
If you try to write to the same file with more than one thread you’ll corrupt your data iirc
File databases are not thread safe
I have a user's oauth access token
how do I fetch data about them
the discord docs are super shit and idk which credentials I need to send to /users/@me/guilds to get the user's guilds
I may have underestimated the power of a google search
Just the authorization header?
Yes
ty
Remove the Bearer if you're doing some self-botting stuff
no v9 in the api url?
That would use latest by default
that is always a bad idea
If you're going for prod, specify the ver

I agree
35 reasons to work at discord:
- you got rejected for everything else.
- smol brain
- countn't
whats the command to get the user's name?
ty
Can anyone who knows the right discord tell me how to assign roles but can't message in admin's private chats
just give them manage roles and not admin perms
How to make a role into a manager?
yea ik but doesnt make a difference for me really
is it possible to put nodejs source code to android studio?
This looks pretty cool https://devsnek.notion.site/devsnek/Modal-aka-Form-Interactions-e839b3dd8c214eb08f950764a8328e36
I can already sense somebody complaining about it
i think that would be good for bugreporting or some other type of stuff for bots
do you actually think people care if the feature's useful
Hello, does anyone have another method for stopping a while? Because I have an if that is in a while but with a return it doesn't stop anything
break
do something like ```py
x = True
while x == True:
#do something
x = False
you're not telling me python is so stupid to not even have break
Yes but break doesn't work in this and the technique with true and false either, nothing works in js
depends on your code
if you have an async function, then no, it will not work
because the event loop will never execute pending operations until all the current sync code is done
wait what
well, python is sync by nature
and runtime waits for async stuff to finish so they're virtually useless
well idk about python
but in js for example:
let a = true;
setTimeout(() => a = false, 100);
while(a) {};
console.log("done")
this will cause an infinite loop
because the while loop does not allow the event loop to proceed, so the timers are never executed
the same would happen if it was a promise instead of a timeout
the only way to fix it is to have an await inside the while loop, to break its synchronicity, something to pause it and allow the event loop to run its pending operations
Who knows
are you coding on powershell?
well, you could add a return to the very start of the cmd or thing like that
it'd prevent further execution of the command
that error has nothing to do with your snippet
lmao once again people delete their question
Can you really only have one emoji in slash command string options?
These are my options
{ name: 'Default: 👍 🤣 ❤️ 😮 🔥 🥱', value: 'default' },
{ name: 'test: 👍', value: 'test' }
Only test works and default shows but when I try to select it it says invalid value
Oh weird... When I separate them with a comma it works

let slash_choices = []
for (let i = 0; i < templates.length; i++) {
let emoji = templates[i].emoji.join(', ')
slash_choices[i] = {
name: `${templates[i].name}: ${emoji}`,
value: `${templates[i].value}`
}
}
That works
But spaces doesn't...
let slash_choices = []
for (let i = 0; i < templates.length; i++) {
let emoji = templates[i].emoji.join(' ')
slash_choices[i] = {
name: `${templates[i].name}: ${emoji}`,
value: `${templates[i].value}`
}
}```
I am confusion
looks weird 
Literally you can separate the emoji with , or - (so, with spaces around them), and that will work, but separating the emoji with just a space doesn't work...
Discord moment...
I even tried alternative whitespace characters and they didn't work either
Would be revolutionary for my bot holy
it appears that my bot has been temp rated so i dont know if it can come back by the time the bot reviewers check it
Not sure what temp rated is referring to, but if we can't use the bot then we cannot test it.
Oh it basically means that my bots request exceeded the limit, so my bot is temporarily banned from running
Ah ratelimited? Then we can't test it
buttons no longer are removable from a message now?
every time i refresh the page, the buttons come back, saw someone with same issue in discord server
editing the buttons to something different works however
I think it might be back later
I thought buttons have never been removable, only disableable.
But tbh haven't really used buttons much.
before i just did components="" and it removed them
idk why they would stop that working
i'm in python and tried that, it threw and error
try an empty array/list
oh wait it didn't throw an error, double checked
pretty sure the json api expects an empty array
same behaviour, the buttons reappear on refresh of components=None
components=[] makes the buttons come back on refresh also
Like they go away then come back after refreshing discord?
yeah
Possibly, editing the buttons to be disabled or whatever works though 
In the message dir i've noticed it has this: message.components.remove(), says it takes one argument?
have no idea what argument it wants 
Try the message.components as argument
tried that, got ValueError: list.remove(x): x not in list
also tried pasting the list of components in there and Button
also tried the custom_id

you should really be using push and not an array index
array.map is also a great alternative
const slashChoices = templates.map(template => {
const emoji = template.emoji.join(" ")
return {
name: `${template.name}: ${emoji}`,
value: `${template.value}`
}
})
look at how much cleaner this is
slash commands are confusing
Yeah usually I push I don't know why I did it like that 

Still though. It's weird how it doesn't let you put spaces between emoji...
string choices can have any character in them
Yeah but look at this
Shows as invalid if you have multiple emoji separated by spaces
how do i figure out what argument it wants
But commas, hyphens etc all work
Make sure there are no spaces between choices like
this,is,a,choice
But I want spaces between them. That's the point.
discord sucks. Nothing new
(space)hyphen(space) also works
Basically anything works with a space between the emoji as long as there's another character with it. Separate the emoji with spaces alone and Discord's like "nope"
i need help
H
update your Node.js version
??= is a node 16 operator pretty sure
oh okay i'm in node 14
how to create this by percent example 10/50 = 10% out of 10 single blue emoji
custom emoji's, but just make 1 blue and 1 red square, then 1 red end bit, and 1 blue end bit
then just put them next to each other
10 emotes
let blue = Math.round(current * 10 / max)
let red = 10 - blue
then just "<blue emote>".repeat(blue)
same for red
adjust precision to ur liking
10 emojis?
round((current progress / 100) * 10)
For example:
- current progress 57%
- ((57 / 100) * 10) = 5,7 (6 rounded)
- show 6 emojis
also u don't need parens for that fake 
still easier to read
just because you're crazy doesn't mean, I am, too
formatting is one of the most important things when coding
My bot isn’t displaying their game on their status for some reason.
Code: https://sourceb.in/yl0dmOnQ03
The bot has it’s status set to “idle” sometimes (for some reason it doesn’t show all the time…?), but it doesn’t say, “Listening to Ranked Bridge” for some reason.
let progress = 57 * 10 / 100
vs
let progress = ((57 * 10) / 100)
not even what I wrote
let ((57 / 100) * 10) = 5,7
Unexpected token: "," on index 26
Illegal assignment on left side (idk what console would even output in this case)
ye, that's why I converted the text example to code here
🔫
Mongoose will be the death of me
splash splash
don't use it simple
not using mongodb gang
postgres gang

pogstress sometimes
Using the most appropriate database for the job gang
MySQL best bot db 🥰
woah there, no need to brag abt ur masochism
A
don't think so
thx <3
lambda = () -> { stuff }
arrow = () => { stuff }
I just call it lambda bcuz fuck it
Prisma makes it bareable 💀
mysql has too many self-sabotaging issues to be bearable
maria is basically mysql but useable
Good thing I don't log much
Also since yall are faster and more reliable than d.js server do you know if let's say I set global commands then after a minute turn off the bot if those commands will continue to register or not?
the interactions will still send events to the bot
but the bot will not answer 'em since it'll be off
the commands don't store any action or code, they only tell your bot they were used
For node14 which target should i select in tsconfig.json?
mongoose is a module, mongodb is the db
my english broke there
Yes
btw mongodb module > mongoose
U broke again there
wut
**module ^
uwot
Yeah as long as the commands register im fine
I added a option to the command that if it's not used will basically break the db
how?
My bot does custom commands and I added command permissions that can be set
However in the db permissions is a required thing
So 💀
Example
ic
In reality I can just lock the command until that option pushes
ur using params instead of concatenation right?
Lemme google what that is 💀
SELECT * FROM table WHERE id = :id instead of SELECT * FROM table WHERE id = ${id}
Pretty sure it is like I said I use prisma so it handles the painful sql stuff
ah ok then
const exists = await prisma.cCommands.findUnique({
where: {
id: triggertouse,
},
select: {
guild: true
}
})
Basically
Then I sort the guilds the trigger is in
And yeah
This is gonna make my custom commands wayyy better and user friendly
Can't wait
Codacy is so fucking stupid
99% of my issues are from markdown files
Everything else is the "Expected linebreaks to be 'CRLF' but found 'LF'." error
just use crlf
My bot isn’t displaying their game on their status for some reason.
Code: https://sourceb.in/yl0dmOnQ03
The bot has it’s status set to “idle” sometimes (for some reason it doesn’t show all the time…?), but it doesn’t say, “Listening to Ranked Bridge” for some reason.
v13
Yeah they changed how to do it
client.user.setPresence({
status: '',
activities: [{
name: "",
type: "",
}],
}, time);
@simple stump
Time isn't required my bot uses it to i kept it
Works on my bot 🤷♂️
By the way does anyone use node-canvas? I think I’ve had issues with it in the past. Can you use the latest version with Node v16?
it literally does nothing
Changes the status every few minutes
no?
Does on my bot
are you not confusing it with setInterval?
I know set intverval does that but it works on my bot like this so idk
Can't explain it 🤷♂️
It works I use it to displays what servers the bots in
Thanks! This code works 👍
the time parameter literally doesnt exist
neither in the docs nor in the source code
well it matters that you cant really tell other people to do that, since it doesnt exist
id like to know where you even got that from
does anyone know how to make a say command on a bot on js
Pretty sure I got it from the guide
app.get('/', (req, res) => {
render(res, req, 'stats-index.ejs', {
guilds: client.guilds.cache.size,
users: client.users.cache.size
});
});
The code is SUPPOSED to count how many Users and Servers the bot has. It says 6 Servers, which is true, but only 1 User, which it has 36 i think i seen in my Console. Can someone help me?
don't brag user count, it's unnecessary strain on the bot
you can tho return a rowcount of users saved on db, which is probably the only right way to do so
I am SO Confused lul
other ways are either too imprecise or too heavy
cache never stores all the values
probably, usercount is meaningless anyway
cache is supposed to store only frequently used values
yeah, that's (kinda) close but imprecise
at some point, you're better just doing serverCount * (7500 + 2500 * Math.random()) if bragging does matter for u
noone is gonna count anyway
i forgot what bot perm my bot needs for that 
fetch instead of cache
Thinking about it it could be github not pushing the full code issue because I'm seeing setInterval in my other bots code with a similar set up 🤷♂️, my apologies
Create .gitignore file
and paste node_modules inside the file
An Extra Step is required if ,you pushed node_modules too github
btw ignore your config.json to
which should be gitignored
why would u push a db? you should always re-create if missing
but never push

node_modules/
config.json
*.db
put inside a .gitignore
then clear git cache and git add .
cuz already added files won't get ignored automatically
git rm . && git add . ig
git rm -r --cached .
sweet
gitignore doesnt like ignoring .env files
for me
I'm starting with PHP and I've come across an error
It seems like it cant handle more characters then ~7
Please ping me when you're helping
error is the first 4 words in your first message 
@lyric mountain Can you explain?
just a joke, don't take it seriously
anyway, doesn't .replace accept a regex?
if so, you might need to escape characters such as *
as in make it treat as a literal

* matches 0 or more characters
that in regex
usually replace accepts regex as input
Do i have to use something else for that one
try first with simple chars like a, b, c, d, etc
see if the 7-char error still occurs
if it doesn't it's mostly likely a regex issue
Search string or replace string
(left, right)
ight
Does someone here have experience with ReactTS / Next.js?
I want to make a nav-bar that:
Normally:
- Shows links as text
- Hides the icons
and at 800px Screenwidth:
- Shows links as icons
- Hides the text
(Like a budget way of making it responsive)
Please ping me if you have an idea
idk if there is a specific way for next/react
but you can just use css media queries lol
i'm trying to use useState
I would, but I'm using a .css file and idk how to check if the screen is smaller than 800px in the react code
well, react is js, so you can use js functions to check window size
idk js like that .-.
oh
i am dum
now I just need to make a check
nvm useState would be stupid to use
Okay, I figured it out. I just made the text transparent on 800px+
Anyone have a bot that will change every humans nick name
Sounds like spam
I just want a bot to change everyone’s nick to have a 🎄for Christmas
Well… spam, therefore API abuse
how do i add a required option on slash commands
/p 'messageId'
Ok I will make the role icon then
By adding required: true as property to your slash command when registering it
do u have link to the docs
Sure one second
man these slash commands are weird as hell
idek how to get the input from em
also thx
You’re working with djs?
If so interaction.options provides the user input
You can simply use get() or other methods to get the value (user input) of an option you defined with your slash command
oki thx
ty
For example, you defined an option named "link"
what do types do
interaction.options.get("link").value
gotchya on that part
the one on the docs only displays a slashcommand with choices
If you specify the option as user then use the associated method getMember() or getUser() to get the user/member resolvable
A random ID? That would be a number then
The option would need to be a number (type) to verify the inputs
how do you make these groups?
Assuming it’s just a number
just a number yeah
i just wanna get the number
Role options -> display them in the member list
i define it later on
thank you kind sir
which type stands for strings?
Well string
You don’t need to use the type numbers
The API also accepts the associated names
type: "STRING"
This counts for ANYTHING btw
data: new SlashCommandBuilder()
.setName('p')
.setDescription('Post a message, made just for me!'),
options: [
{
"name": "messageid",
"description": "Message Id",
"type": String,
"required": true,
}
],
this no worki
i mean it doesn't throw any error
it just no worki
Look what I wrote about the type
options: [
{
"name": "messageid",
"description": "Message Id",
"type": "STRING",
"required": true,
}
],
?
Did you register the command right now?
If you define options for a slash command you need to register them
Register the slash command in the first place or if you change options then update it
wym register
Well slash commands need to be registered before you can use them in a Discord server
Idk your library backend and what does register the commands for you
the slash commands work just fine
but it's not showing this option for some reason
If that is a global command it can take up to an hour until it’s registered or updates are pushed to all guilds
it's not
Well I’ve got no clue what lib you are using to create slash commands and register them
d.js
Yeah but you must have registered this command somehow
woops
my bad
A collection of builders that you can use when creating your bot. - builders/Slash Command Builders.md at 580a9555e4ed946bc11e6f95aeb3def30593dbb4 · discordjs/builders
If not it would never magically show up
found this
// Get the final raw data that can be sent to Discord
You have to send (register) that command to the API if that builder isn’t doing it automatically
I doubt it does for you
You might wanna take a look into the docs how they are registered
That’s essentially to use slash commands
The slash command builder just creates the final object for you like the embed builder etc not more
You have to serialize that object and send it to Discord or use an inbuilt method in your lib to do that for you
they are registered
It’s similar to building a command handler for common commands
i think i found the problem
but it's reallly late for me now to think properly
so i am thinking of working tomorrow on it
If you update the options you need to update the registered command as I already said
bruh these slash commands really suck tbh
Not really
no
the issue is i am dumb
and that option would never work there
What no?! Wtf
but tomorrow i gotta find out how to use options inside a command handler
Yes changes will always require you to update the registered command to the API
Wtf is dev mode?!
Commands need to be registered always if a guild should show them
That’s how it works - no exceptions

Discord stores you registered commands, they don’t care if your bot is running or not or you’re able to receive the event or not
If you change something you will have to tell Discord the changes
Or they will still store the previous old version
How do you install Java 16 on replit?
Ping me with answer since I have this server muted xD
If they are registered (stores by Discord) they will be usable in guilds
There’s no dev mode or test mode or whatever
That’s how slash commands work - simplified
Install node events
FIXED
you are missing a comma before the type line
ok
const { Client, CommandInteraction, MessageEmbed } = require("discord.js");
const commands = require('../commads.json')
module.exports = {
name: "help",
description: "Get the help menu",
type: 'CHAT_INPUT',
run: async (client, interaction, args) => {
const help = new MessageEmbed()
.setTitle('**Commands**')
.setDescription('here are the commands' + ${commands})
message.channel.send({ embeds: [help] })
},
};
What errors will i get this if i run this? My IRL friend wants to know xD
Don't do that
Sorry
Can you help with this?
It's a douchebag move to delete/edit your question after being solved
What if someone else hit the same issue as you? They could've read what u did to solve
Try it and see
And ask ur friend to come here and ask himself, it's weird to have a middleman
He does not have a Phone Number
So he can't join...
Lots of stuff is wrong with it 
Rent a random phone number (SMS service) and provide it to Discord
Enter the verification code and Discord stops fucking you up with it
You don’t need the number again
Not only a valid option if you haven’t a phone number also if you don’t wanna share the number to Discord
why not just ask in one of the countless programming servers without phone verification instead of sending someone to ask a question on your behalf in an unrelated server lol
TIL ++i++ is a valid statement
For larger non-indexed strings TEXT is your choice
No matter its length making it a tiny text, long text etc.
Same as ints
makes sense, ++i increments i with a shallow copy (afaik) and i++ returns a brand new copy of the number
I was just about to ask the purpose of ++i
nvm I think I'm wrong
thought i remembered something about shallow and deep copies from somewhere, ig I'm wrong
It's more like "return then increment" and "increment then return"
++i is very rare to be able to exist in any code anyway
it's
copy the number
increment the variable
return the copy
vs
increment the number
return the number
it's normal to use ++i in C++/C loops iirc
I always use ++i in those
that's what I was taught to do
I use i++ in every other lang though
Uh no they both incrememt the variable, i++ just returns the previous number, ++i returns the new number
at least that's how it is in js ^
Use arrays
Arrays have alloc overhead in memory since they're special objects. The alloc size of a long string is much smaller than an Array of chars since strings have an initial alloc size
If you want to format the string, refer to Python formatting methods, such as %, .format(), or f-strings.
What you are doing is pass multiple arguments instead of one formatted string. Python's print function uses all positional arguments to format the string, whereas .send() in d.py does not.
for example: @slender thistle correct me if Im wrong havent done python in a while
f-string format is: f"Hi there my name is {name}"
thats correct
f string 
gotta love it
To elaborate on examples:
%
name = "Jack"
print("My name is %s" % name)
# The variable must be of type `str`
.format()
name = "Sam"
print("My name is {}".format(name))
# Also usable with named arguments
print("My name is {name}", name=name)
Refer to Luke's example for f-strings
They follow different implementations and by far f-strings have also proven to have the best performance compared to the rest. The difference, however, isn't very significant unless you are working with hundreds/thousands of strings
np
Hello guys
how to use require or import in web-based javascript
const {fetchInfo} = require('functions/fetchInfo.js');
const {editDislikes} = require('functions/editDislikes.js');
const {fetch_from_repl} = require('functions/fetch_from_repl.js');
const {put_on_repl} = require('functions/put_on_repl.js');
const {addBar, likePercentage} = require('functions/bar_fns.js');
This is my script.js for a chrome extension
I want to use require
Even if I try to use import it doesn't work
You can
// Require an ESM package
const { default: package } = require('esm-thing')
@delicate shore ^^^
wait what
if we are using ESM
lemme try
what is default: package supposed to be
const { default: fetchInfo } = require('./functions/fetchInfo')
alr
thanks
lemme see
didnt work
weird
oh?
bruh moment
const { default: package } = await import("esm-thing");```
got another error
which language
which wrapper
if its true then it is
if not then not
what language
oh djs
in python its if not ctx.message.channel
so its likely if (!message.channel) or something similar
😩
You mean guild? DMs have channels doe, don't they
Could also check the channel type
<message>.channel.type === 'dm'
Yeah, you can't generalize Python btw 
Fair
message.guild === null would work too
!!(await Boolean(message.guild))
I don't know about you guys but this looks much cleaner
!message.guild
It could be other than null, like undefined but I'm not so sure since Discord.js's structures are quite consistent
"web_accessible_resources": [
{
"resources": ["/functions/*"]
}
],
I tried something and got this error :```
Invalid value for 'web_accessible_resources[0]'. Entry must at least have resources, and one other valid key.
Could not load manifest.
But according to their docs, I am doing it correctly: <https://developer.chrome.com/docs/extensions/mv3/manifest/web_accessible_resources/>
Umm what would be regex for ` which is backtick, I have tried and searched a lot but couldn't find
` is the regex for `
idk what you exactly need, like match all the ` in a string, or replace all ` in a string, cuz your question is so blunt
Well actually I need to match all the code characters in message which are written when enclosed between `
use console.log("works") to find out where the runtime pass
also log what message.guild is returning
it is possible to send a json file using discordjs?
Hello
Hello what is the lignes to see in mode in the bot's bio we see how many members it has in all on all the combined services ?
${client.guilds.cache.size}
cache will never return the full count
and bragging user count is quite dumb if you ask
no, but to see the total of members in my bot mode and on 30 servers and the number of members in all ?
what?
Down the line that we send me not working? its but not what I want
I can't really understand what you're saying, sorry
You speak French ?
nope
To see the exact number of members in all
even if you need to sacrifice your RAM?
Yes
He’s probably speaking about the bots client presence displaying the servers and members
the server I have the line but it is the member efectively.
don't you have the line of code?
Should anyone mention it to me?
you need guild.memberCount
let count = 0;
client.guilds.cache.forEach(guild => {
count += guild.memberCount;
});
I would like to leave it with my already existing line of code?
if you're willing to sacrifice ram to achieve the membercount, just fetch all guilds and fetch all members of each
do note however, that this is effectively a ram nuke
I don't mean a GB or two, I mean ALL or even more than your available ram
memberCount will always be more accurate than counting cached members
even if you fetch them all
I meant fetch both guilds and members
guilds are cached by default
? I would like to leave it with my already existing line of code?
And I’m a basic bitch but that doesn’t stop me 
Possible to explain to me please.
{
// your other code ...
let count = 0;
client.guilds.cache.forEach... etc...
// your other code ...
{ name : `${count} users!`, etc... }
// your other code ...
}
cant u just map it tho?
true
trial by fire
abt to be dad luke?
woah
nice, wish u good luck
yoooO
congrats
character development
Thanks 😄
have you enabled sharding?
if not is your bot in above 2500 guilds?
My bot in 2600 guilds
How I can enable shards?
id suggest reading the whole page
otherwise sharding could become very confusing.
Ok thx
just add
shards:"auto ",
to your client options
Internal sharding is fine till 15-20 shards and it comes up to your bot usage
Can you really internal shard that far? Cool
20 shards is like, 30k servers if my math is right
1 shard max 2.5 guilds
Its comes up to bot usage.I have setted 1 shard for 1000 guilds and didn't have an issue yet.
I thought it would be like 10 max on a good cpu and being pretty lightweight code
Great cpu*
But I'll admit I've never gotten any bot large enough to shard
ah my server has i9-11 gen ,didn't have a lag yet.
The way I would check is just using the date.getDay method to check the day of the week.
Just check if the day is Saturday or Sunday?
if(["Friday", "Saturday", "Sunday"].includes(Date.getDay()))
Get day returns an int doesn't it?
You are trying to use an intent you don't have
Iam trying to create shards
But I get this error
Op I was going to suggest a way less cleaner method of doing it ^_^
6 or 0?
0 is sunday
friday is a weekend too isnt it?
I almost sent
if(!(myDate.getDay() % 6)) alert('Weekend!');
Some people consider friday a weekend
technically sunday is a weekstart 
Was going to do getDay === 6 || getDay === 0
Kek
/s
Once I tried to do
(getDay ===) 6 || 0
lul
I wonder what the error would be, can't remember
which is valid
imagine a compile that'd mock you anytime an error happened
army's instructor compiler
you wizard
I miss the days of not understanding syntax.
stuff was so simple
copy the error into google, bam answer
I miss the days of not understanding syntax.
hop into an esolang
if you want a syntax challenge
nah, uwupp
best lang
its less about the syntax errors and more of just being simple and rewarding.
any issue I have now I am just annoyed finding the fix rather than happy.
the number of times the solution I know, but didn't think of is astounding kek
amonguslang
yes
My bot is on heroku it was fast but now it's laggy and i don't know the reason!
Has it gradually gotten laggier as your bot has grown? Or just suddenly after an update? Or just suddenly without an update?
because its heroku
If it was suddenly without an update probably contact heroku support tbh.
I think after the bot has grown
update for discord?
or the bot
The bot
No i didn't
If I tried to post a review of the bot
If its just growth, it's potentially just heroku(not really meant for bots).
Probably best to move platforms at this point.
on my pc
But the ping was 90 how it reached 3000 with this fast 😂
Well, it's not meant for bots.
Once you start maxing your alloted resources with a bot you can't really easily increase your available resources on heroku(easy for sites, not as easy with bots), making the response time slow.
It's totally possible to stay with heroku, but probably best to move on.
But it's not free lol
still
Hosting a bot costs money.
Even on heroku(even if you are not directly paying for it currently)
no offence to anyone but don't get into bot development expecting to get everything for free. you would rather pay for good service then have 0 users
You can temporarily move to something like Google cloud if you really need free
You can also get a free debit card(assuming you are over 14 years old) if that's a limiting factor.
Many banks offer them for free. I've never actually paid for one tbh
Yep?
Nope kek
The trick I used to use is Skype numbers
Used to be line $1 to get a temp number
Like*
Or use an mvno, like $3-$5 for a temp number
I did read "to get trump number"
wanna trade for bolsonabo number?
salnorabo
how
but i moved rn into rdp still lag
maybe events ?
are making the bot lagging
rdp?
remote desktop protocol
Rdp can lag for a ton of reasons too
yes
why and where are u hosting the bot?
ye
like, why windows?
^
visual studio code in rdp
it's temp
i need to know why is the bot lagging
who is hosting the rdp
you mean you are hosting on your pc and accesing from elsewhere?
I'm still failling to see what rdp has to do with anything of this
yeah
no in rdp
the rdp is 24/7
not a host
then?
it's like saying you're driving a diesel
be more helpful - WHO is hosting the rdp
we don't care abt the fuel, we want to know the car
???
Azure?
oh ye azure XD
○| ̄|_
what else would i need in a databse for blacklisted servers
i mean so it has a reason for being blacklisted, who owns the server etc
members, bots and emojis are unnecessary
so it saves the bot to member ratio
but why emoji?
What is the command?
oh
nodejs, python etc
Idk how lol
node.js
oh
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'C:\Users\WolfWolfy'
←[90m at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)←[39m
←[90m at Function.Module._load (node:internal/modules/cjs/loader:778:27)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)←[39m
←[90m at node:internal/main/run_main_module:17:47←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []
}
shift + right click -> open poweshell here
ok
@spark flint
PS C:\Users\WolfWolfy> cd c:\Downloads\Wolfy-master\Wolfy-master
cd : Cannot find path 'C:\Downloads\Wolfy-master\Wolfy-master' because it does not exist.
At line:1 char:1
- cd c:\Downloads\Wolfy-master\Wolfy-master
-
+ CategoryInfo : ObjectNotFound: (C:\Downloads\Wolfy-master\Wolfy-master:String) [Set-Location], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
do cd..
cdC:\Downloads\Wolfy-master\Wolfy-master : The term 'cdC:\Downloads\Wolfy-master\Wolfy-master' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At line:1 char:1
- cdC:\Downloads\Wolfy-master\Wolfy-master
-
+ CategoryInfo : ObjectNotFound: (cdC:\Downloads\Wolfy-master\Wolfy-master:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
It's worked
The bot is sometimes is fast and sometimes it's slow what may be the reason?
The sources are not used as much as possible in rdp
I know but until i know the problem
It may be from heroku
linux is not known as "the best server environment" for nothing
windows is a resource hog
still linux
looks like we're having a communication issue here
I developed it by my self
right
and you're using rdp to access it
ye
ok, that settles everything
@hollow cairn ask here
I need help.
hello
hi
My bot
I can’t add it to my server.
What
yes
I have cloned it but its against tos
To clone
wdym
help
or I should say to the assigned person to my verification process that i can't make it
and apologize?
"We have to make sure that the data is not stored forever. We recommend that the information is stored for 30 days or less after a user is no longer in a server with your bot." this
when the user leaves the bot completely




