#development
1 messages · Page 74 of 1
Yeah
I like writing chunks of code in classes a lot, just stuff that encapsulates other stuff to make life easier
More and more abstractions and stuff are always nicer, makes developers' lives much easier and better
I like writing that stuff from a low level
But if the abstractions are costly then it's probably not worth it, abstractions should be of almost zero cost in case of the performance at the end result
That has been a big deal in a lot of programming languages' development for example, such as Rust
part of the reason I liked writing discord bots is because there was so much I could throw into a bundle of data in classes
I could make everything super modular
I haven't been able to find as many projects where I can do that as easily now
how do i host my bot 24/7? im using visual studio
doesn't matter what IDE you're using, you're going to need a VPS
i need help here.
Cancelled; he decided to contribute rewriting Linux in Rust instead 
You essentially need a computer running 24/7. A VPS is the best option (like Waffle said), but if you just need something simple (albeit worse) there are alternatives. You could host it on a raspberry pi, or even repl.it if you're brave.
ive done replit and its been rebooting all the time so i stopped using it
Yeah, well all other options are going to cost you real money.
Time to work at Microsoft to rewrite Windows in Rust, and work at Linux Foundation to rewrite Linux in Rust 💪 🚀🔥
If it's free, YOU are the product 😉
I am gladly an Oracle product
They own me anyways
(python) initialising an instance of topgg.DBLclient (with the required params) raises an error due to the breaking asyncio initialisation with discord.py 2.0, any fix?
There's a free hosting service just for discord bots called discloud
just pay up/selfhost/oracle
Yes paid options are always the better ones.
oracle 💀 x100
How do I get the bot developer role?
@neon leaf got another question that might be related to nginx, should I use it when routing something like a game server to a domain? My rust server is listening in on port 28015 and using my vps ip but I have no idea what I am doing
or should I look into something else?
any clue
Why the fuck would yyou ask me
Elaborate, just "not working" is not enough
Message content might be null if you don’t have message content intents
That has nothing to do with nginx
You wanna make sure to add a valid A record to your zone which has the server IP as target
(or AAAA in case of IPv6)
Using the default rust port will allow you to just use the domain to connect to your server
Not using the default port will require to add the port to the domain, like misty-girl.com:27905
What you wanna use ideally are Service resource records (SRV records) which aren't supported by most of the games unfortunately
They would allow you to specify the protocol and port as target
Like UDP, port 27905
But yeah idk why most games and services don't support em
So wait make a what now
I am fucking tired as hell
buy domain
go into domain settings
look for dns records
set an A and/or AAAA record to your vps' IP address
the hostname however can be anything you like
Since your domain itself most likely has your webserver as target you simply create a "sub domain record"
Like rust.misty-girl.com IN A 12.34.56.78
SelectMenuBuilder() is removed ?
It's deprecated and will be removed later, use https://discord.js.org/#/docs/discord.js/14.7.0/class/StringSelectMenuBuilder instead
instead of using SelectMenuBuilder() can i use new discord.BuildersSelectMenu() ?
That doesn't even exist
It's not like FakE called it already like a hundred times
.
Just write the select menu object yourself and you won't suffer from nonsense on any update of djs
new discord.StringSelectinteractionBuilder()
.setCustomId("search")
.setPlaceholder("Nothing selected")
.addOptions()
StringSelectMenu
hey so i am trying the getCookie() function
to get 2 certain cookies
but it only logs one of them
What is your code to get the cookies ?
how can I use Path / Headers / Body in post using axios?
Do you use the axios API or axios functions (.get, .post, ...)?
I'd recommend against axios
node-fetch does everything u need with less boilerplate
@boreal iron I have an A record that points to my IP but it doesn't work in game
bypass mode?
proxy?
not proxied
When you disable proxy it might take awhile for DNS to update
the orange icon that says "proxied" should be gray and disabled
My only concern is, if I end up pointing another domain to the ip, will it interrupt my aarondye.dev domain making both of them possible to be used?
both can be used
are you using something like nginx/apache?
cause aarondye.dev is meant to actually be used for my portfolio but I dont feel like buying another domain to test this
Itll make it much easier
I am using nginx to reverse proxy my site
Nginx is one of the best web servers in the market. Follow this guide to learn how to create and manage Nginx virtual hosts in your server.
I'm not sure if that guide is any good, but virtual hosts is what youll probably want.
Well I’m not actually serving anything no?
I’m just wanting to make my other domain (when I end up buying it) be the only one that can be used for connecting to my game server
Virtualhosts can point to files, or to other webservers, or anything really.
Yea but I don’t want aarondye.dev to be able to be used to connect to my rust game server, but both need to be pointing to my vps which will cause that
then you need a router like nginx or haproxy, or even iptables
what youre looking for is a reverse proxy
Im not gonna go into too much detail but it might help understanding
when you make a dns record it just tells computers that are accessing your url which ip your server requires, so anything ends up as the same ip in most cases, if you have a gameserver and a website it wont interfere since rust is running on a different port, http: 80, https: 443, rust: 28104 or sum, they wont interfere and people can only connect to the rust server through your direct ip (since the orange cloud means it goes though cloudflare) or your record where its deactivated
Indeed you are right
you install php
you cry
yes
configure some webserver to run it
but I wanna make it so only certain domains actually points to the rust server, and only those get used. I don't want my portfolio domain being used it just makes no sense.
and if you can do that with nginx I have no idea how so any pointers in the right direction would be nice
step 1: install nginx
what you are doing isnt really something you should do
why not?
limiting ips to connect is kinda unnessesary since it can make the servers connection immensly slower, with my minecraft server I used to test it was about 400ms higher ping
alright well I will just proxy my portfolio domain and not proxy the rust server's domain
that should not happen
its perfectly fine to do some basic routing with nginx
never seen any ping increase because of it
🤷🏾♂️
Create a hostname with an A record
Aka sub domain
And add the game server Ip as target
you should probably ask the author of your site, almost every php site varies
Once it's installed and enabled you gonna let the virtual host know to read php files
By default the server is listening to html files
Index.html
Add the following line to your vhost config
server
{
index index.php index.html;
}
php 
that would just cause it to display the php file as text
you need to setup cgi
That's what you usually enable in your global config
And not separately for any vhost over and over again
But up to anybody...
@placid crane could you help me with something
you mean instead of axios use node fetch ?
there isn't any different for me each one that possible to post
yep
well which one faster?
well...I believe node-fetch since it has the least preprocessing, but it's not something you can really measure
global.fetch
use undici over node-fetch
if using node 17 or higher, undici is built into node as global.fetch
ok well with node fetch how can I post Path / Auth / Body ?
can you show an example of what you want? path is just the url of the website you want to access, auth can be put in the headers but there are many different types of auth
there are also many types of body, like json and form data
all of those should be easily found in the documentation of whatever lib you decide to use
path is the url
the rest usually goes in the options of the library youre using
for example ```js
somefetchinglibrary.post(https://website.com/${id}, {
headers: {
Authorization: ...
},
body: ...
});
you have to check the documentation for the library you want to use
also what do you think? node-fetch or axios or something else ?
i prefer using node http or undici request, but it doesnt really matter, there are lots of other options too like got, bent, petitio, ky, and god knows what else
writing your own http agent using raw net sockets
yes
if you don't care about responses or want to stream all of the data it gives you somewhere, use that
audio
someone was complaining about a memory leak in their bot recently
turns out the culprit was undici fetch
@static summit
Hy Alex
Ich bin schon ein zeidel dabei auf Patreon und da ist mir aufgefallen, dass du öfters von deiner Gruppe redest.
Jetzt wollt ich dich fragen ob du einen Server auf Discord hast und ob ich dem beitreten darf?
what level of wrong server is this ?
was this ever fixed? I'm not experiencing such issues
every 10min, I'm posting stats and no issues
possibly, not sure
they were running undici 5.8.0
fetching multiple times per second

Try a gradient at 135° instead of horizontal/vertical
Got these two emails, after the error I couldn’t access my cluster but it seems to have resolved on its own. What’s the reason behind it?
can someone explain what this is?
looks like a debug page
it’s on my discord though
oh wtf
If you're using client mods, stop. It's where developers upload their client version others can use temporarily until the override link expires
https://scs.twilightgamez.net/JO1lW.png these are interesting buttons in that ss
i’m not!
That page is for discord employees, if you have that I'd suggest restarting your discord client which should in theory make it disappear
ok thx
it’s gone
To get your bot verified can I use a permit instead of a drivers licenses?
Valid documents to verify your Discord bot are: ID, driver's license, or a passport
Oh ok well sucks to be me already sent it
does it work like that in any country?
Yes
¯_(ツ)_/¯
From the error it seems like you need to add a terms of service URL
Should be located under the General information tab
How am I able to send a message via webhook on a Thread again? I've done it before, I just forgot how.
Any good resource for tos and privacy policy creation?
copy other people's and change it up a little
One message removed from a suspended account.
One message removed from a suspended account.
my bot
errr...you know that's just the account, not the bot itself right?
Lmao
even happier
They are asking me to make a better privacy policy but my bot doesn’t even store any data
lmao my privacy policy didn't even work like if they would open the link the page would just throw a 404
Bro they emailed me saying they needed one
Anyone here have any experience with the Discord OAUTH2 Applications? As I am running into some issues but cannot seem to wrap my head around them
what issues?
I just copy pasted a privacy policy from google
And changed names
Lol
And they accepted it
Do anyone know answer to this situation:
i have one global object this.client.someCollection
This is array of objects like this:
[{
_ID: 3,
charges: 10,
code: 'G-3',
color: '#b47756',
name: 'Apricot Mix',
owner_id: '271726440641331200',
radius: 15,
}, {...}]
when i am changing charges in one certain object during command to 7 for example and then i use another command to view this object, charges remain 10
that's called "race condition"
you need to mind thread safety even in langs that don't have threads (cuz they still have some form of parallelism)
for example:
A | 10 charges >--- 1s -> 7 charges |
B | 10 charges >----------- 2s -----------> 10 charges |
both started at the same time, but since A took less time to complete, B completely overrides the final value
a common solution would be to synchronize accesses to that collection, to prevent two tasks from using it at the same time
But i am starting it like in queue
not in same time
after second 6, i used another command
can you show your code
to view object
First command
with simple change
That what i am doing in another command and getting not that result that i expected
console.logs u can see upper
is that an array of normal objects or an array of mongo/mongoose objects?
not sure if u can use unary decrement in objects directly
it worked for me in some other commands, now i cant image what is wrong here
mongo
you can
thats probably the issue
mongo objects have a bunch of weird properties and behaviors that change based on your schemas
also they are not meant to be directly edited
you should be using mongo update functions
like for example this works perfectly
this is also mongo obj
changed names of prop
does that actually save the value in the database? afaik thats only editing the object locally
yeah but once you access mongo, the real values will overwrite your local edits
i that certain situation i need only local edits
well i think mongo is interfering with that
so put your local edits in a different place
I feel like that's the correct way to do it anyway.
If you're making edits not to the database it shouldn't be in the same place as your database.
Just so its easier to know what's going on.
not even sure why mongo has "local" and "persisted" storages to begin with, but perhaps I'm just spoiled with sql transactions
get -> update -> commit, no changes wandering around uncommited
most meme is this
1st log prints 7
2nd prints unchanged 9 in one func now
i found even bigger meme
that shit happens only when object is in array

do you mean they have
🤏👓
a botghost?
Hi, I am looking to add a function that does a mini interview upon joining my server.
Basically; Are you here for A) or B)
Selecting one of the options prompts next set of questions. etc.
What bot would suit me best?
Thanks in advance
I dont think there are any bots that do these, however you can replicate this by creating a custom bot
Have to listen to the guildMemberAdd event and start the survey
Thanks for your response.
I have submitted tickets that say:
"Are you wanting X" after selecting.
"Should we submit Y"
You know what I mean?
Or you could have the whole server locked by a role, and only having one channel visible to new-joiners. And only after they complete the survey they can enter the server (aka get the member role kinda thing and get perms to view all other channels)
nope 👀 wdym by "submitted tickets"?
Oh, okay! Let me explain myself a little bit more clear. I think I've messed up my explanation
Basically when you join the server I want it to ask the reason you are here.
If you are wanting Package #1 or Package #2
Selecting the option you want will redirect you to the channel that offers that package. Perhaps redirect you to a URL.
Basically like a directory.
It will redirect you based on the selection you choose.
Oh okay, well the best case screnario can be having a bot to ping them in a certain channel (possibly the introduction channel) upon join and send a message saying that.
Could be done in two ways, just use any bot that has welcome messages and send a message when someone joins with the links. Something like
Welcome, Select the below link to go to the respective Package
Package #1: <link>
Package #2: <link>
Or you could just have a bot send the message with buttons that let them select it
But that also does the same thing just with a bit more complexity
This is exactly what I am looking for.
You're a saint.
What the process to achieving this?
I basically want the code to send me alerts each time someone trades something (someone == configured user) , the alerts will be sent to a configured discord channel . I get this error
const leaderboards = await Promise.all(users.map(userId => binance.futures.getLeaderboard(userId)));
^
TypeError: Cannot read properties of undefined (reading 'getLeaderboard')
I also added comments to the code so yall know what I am trying to do.
here is the code :
// Specify the users to track
const users = [
'0932D2B47499C2E940AE805D3D2D9B72',
'D8C8D5F58F1D6BEA7C2D8A83C974F8BA',
'B952767C0F1B876D47D50F2F70BC68E9',
];
// Create a Binance client
const binance = Binance({
apiKey: binanceApiKey,
secret: binanceSecret,
});
// Get the Discord channel to send the message to
const channel = client.channels.cache.get(channelId);
// Call the code to retrieve the user's trade information and send the embed message
// every second
setInterval(async () => {
// Get the leaderboard data for each user
const leaderboards = await Promise.all(users.map(userId => binance.futures.getLeaderboard(userId)));
// Get the user's trades
const trades = await Promise.all(users.map(userId => binance.futures.getTrades(userId)));
// Create an embed message with the user's trade information
const embed = new Discord.RichEmbed()
.setColor('GREEN');
// Add the user's trade information to the embed message
users.forEach((userId, index) => {
const leaderboard = leaderboards[index];
const userTrades = trades[index];
// Add a title to the embed message with the user's name and trade count
embed.setTitle(`Trader ${leaderboard.userName} has made ${leaderboard.trades} trades!`);
// Add the user's current balance and total profit to the embed message
embed.addField('Current balance', leaderboard.currentBalance, true);
embed.addField('Total profit', leaderboard.totalProfit, true);
// Add each trade to the embed message
userTrades.forEach(trade => {
embed.addField(
`Trade ${trade.orderId}`,
`${trade.side} ${trade.price} ${trade.symbol} at ${trade.timestamp}`,
true,
);
});
});
// Send the embed message to the Discord channel
channel.send(embed);
}, 1000);
I am using the binance-api-node npm
any help is appreaciated
i got role pickers working in a sorta intuitive way
you use </roles create:0> to create a role picker and then use </roles add:0> with the ID and role you want to add to the picker
There's a lot of bots on top.gg, unless it's a commonly used bot, it would be hard to tell you exactly which one that is.
suggestions on one that does this?

CREATE TABLE IF NOT EXISTS user(
id BIGSERIAL,
user_id VARCHAR(1000) NOT NULL UNIQUE,
balance BIGINT DEFAULT 1000 NOT NULL,
class_id SMALLINT
);
So how is this invalid syntax? It tells me that there is an error at or neat user but this looks correct based on the numerous examples I have seen
rip lol
this is what I get for not touching raw sql
orms have babied me too much
I didn't even know sql had reserved keywords like that
There are built in tables and queries you can do to show backend info. It's actually really cool
This is what I have so far:
@commands.command(name='edit-specific', hidden=True)
@commands.is_owner()
async def _edit_specific(self, ctx, type = None):
if type == 'role-request':
message = await ctx.fetch_message(1038828402536349736)
embed = message.embeds[0].fields[0].value = '''
The following roles can be requested:
- <@&762321175900454933>
- <@&763478824641495040>
- <@&959865461846204436>
- <@&853817144243650561>
- <@&1024429857104478228>
- <@&1045827799967088840>
'''
embed = message.embeds[0].footer.text = f'Developed by {self.bot.owner}'
await message.edit(embed=embed)
what do u want to edit
It's in the command
oh then im clueless as well
try ```py
message.embeds[0].fields[0].value = '''...'''
message.embeds[0].footer.text = ...
await message.edit(embed=message.embeds)
AttributeError: 'list' object has no attribute 'to_dict'
try ```py
embed = discord.Embed.from_dict(message.embeds[0])
then edit and send as normal
AttributeError: 'Embed" object has no attribute 'get'
/roles create
Can someone tell me how do I know how many members have a role? Discord.js V14`
<role>.members
Fetch all members and their roles then store it and using intervals to update it after a period. I think it is good enough to use
Discordjs already caches members & roles
not all tho
true
if (guild.memberCount != message.guild.members.cache.size) {
await guild.members.fetch()
}
role.members
magic
How can the snow giving bot add emojis to one person for a discord server with out giving it to the whole server or is that what it does?
Uncaught exception in main thread: OutOfMemoryError - Could not allocate 14626634 bytes
thats java
it is
What do you mean by "add emojis to one person"?
The snow giving has this: 🎣 Amazing! You fished the :PhibiSled: PhibiSled emoji! You can use it in this server, and if you have Nitro you can use it across servers
I don't get it, that's the exact same case with all custom emojis
It creates the emoji in the server it's run in, so everyone can use it, and if you have Nitro you can use it in all servers
Although you can limit the users that can use a specific emoji by roles, Discord has an endpoint for that
Note the roles field
https://discord.com/developers/docs/resources/emoji#emoji-object
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Never knew that my bad
<script> type="text/javascript"
window.onload = function(){
alert("Website Made by James | Coded On ");
}
</script>```
the >
this one?
it causes this
and doesnt work
FOUND IT
i missed a </script> above the <script>
im dumb ok
not an excuse
im bored
Dose anyone have a clue?
i is undefined
what did you define i as
yh i is fine
if it's fine it would work
that's what I mean but its not
just send the line of code where you defined i
not quite sure if i is a actual thing, have you tried just interaction?
also this might help u https://discord.js.org/#/docs/discord.js/main/class/CommandInteraction?scrollTo=reply if you want to reply to a command
or the beginners guide https://discordjs.guide/slash-commands/response-methods.html#follow-ups
the name they put there doesn't matter, it's a function param
what command lib are you using?
thats the problem
function parameters are passed by order, not by name
if you do execute(interaction, client)
then on the other code thats what the order will be
so where you wrote client, thats not client, thats interaction
where you wrote message, thats not message, thats client
and i does no exist
"I" sounds like python code
for i in range()
Yeah, Im just using chance for recall whenever I can, since I have a test on CS next week
...you have python in your tests?
Yeah!!! There is a whole paper on it
💀
you better put a ruler in your backpack
cant miss those indents
Stuff like:
Fix the errors
Unscramble the code
Write your own code to a specific function
and turtle ect
I have the tab button, we do it on Computer
I think I just made my dream Discord library. Command type safety ❤️

That's just TS with extra steps
It looks somewhat similar to my command handler
Perhaps one day I'll release a lib of it, too lazy to document
Make your own discord lib 
Nice, good job
i regret making my discord library
I really dislike the jquery syntax you went for, but the basic concept is pretty cool. I feel like I can implement this in my own raw api wrapper
That is part of the effect frameworks
. It is for unwrapping the "super promises" like async / await.
"super promises"?
Hi good morning
They are like lazily executed promises, with dependency management and way better error handling.
Yes they support interruption.
function Car() {
this.make = "hi";
return { make: "by" };
}
const car = new Car();
console.log(car.make);
Can someone explain this? What's happing here?
Classes are functions with additional abstraction, what's happening here is that when you assign the property make to the this context of the Car() function, and then return a value to the function, the properties assigned to the function's this context will be cleaned because classes can't return their own values in their constructors, so the object you're returning will be it's value
If you don't return a value, and call the function with the new keyword, the properties assigned to the this context of the function will remain, in this case make property's value will be hi if you don't return a value
Ooh I see. 👍
Thanks for taking this time to explain.
So If I don't return anything, the this will be the default return value, right?
Yes
hi
ChatGPT is replacing stackoverflow slowly 🥶
Personal coding assistant then
Anyways it's hella crazy
here!
there example sp , pt and en
no cant click no solution
if (language === "sp") {
if (language === "pt") {
Can you go to your browser console and see if there is any errors?
okay no problem ya found search google think said script and other script
no problem.
have done solution.
@tired panther look check https://sk.benzitczostudio.com/ is okay solution
I enjoy my sanity, thanks
How can I report bot rain?
Already replied in general
@wheat mesa Rust's Deref trait is basically acts like inheritance, right?
like String, also including functions from str https://doc.rust-lang.org/std/string/struct.String.html#deref-methods-str
A UTF-8–encoded, growable string.
It takes more than just sanity to make one
can confirm
Maintaining an already existing one is painful

Only real upside is that one of Vexera's devs sometimes opens issues and PRs
Discord API wrappers are definitely one of the hardest wrappers to properly maintain
So many moving parts and so many changes to be done almost every day
Stuff like snowtransfer and cloudstorm are already basically libless and the real maintenance is just whenever routes/gateway changes or maintaining a types package which I also do
Twitch/Patreon wrappers tho...
Well yeah those as well because Twitch and Patreon have terrible APIs
Patreon: what if we add all the data in every payload? Oh oh, and add it inside every inner bracket too!
It's so fucking bad 
patreon v1 having the data you need but not having a sane format
patreon v2 having a sane format without any useful data 🥲
best way to encrypt things: make your own encryption methods with 0 knowledge on mathematics

yeah no it justs starts working with aes cbc
One message removed from a suspended account.
One message removed from a suspended account.
lmao yeah
One message removed from a suspended account.
maths 
One message removed from a suspended account.
One message removed from a suspended account.
crazy
"accidently"
Wtf
Help me pls

Here’s a picture of a frog
head to #auctions-tickets
or you can just ping xiuh or mac in #auctions-support and ask them to remove
anyone know the cause of this? want to prevent it from happening in the future
u probably forgot to define your primary atlas
take that with a grain of salt, I never used it, I'm judging by the content of the message
how does one do that
My commands are duplicated and I'm assuming it is related to slash command registering
Can anyone help?
You are aware that a registration is a one time process?
Also The code you showed doesn't show the registration at all
Do you know what the duplication could be
i would suggest to set an empty array as application command, then re-register the slash commands
Depends on where and when you register the commands
empty array will delete all the slash cmds i hope so
yeah, it automatically gets updated i guess
That won't fix his issue if he executes the registration multiple times
this is an event vro
Still not the right part of code
this isn't the registration part
It's not
client.commands is a temporary instance, slash commands are stored on client.application.commands
You may ask him then where he puts the command registration part
He's loading his command files, those have nothing to do with prefix commands
worst guide you can read
lol what a question
@limber siren can you show the folders which has all the files
I am ready I guide you right now but I am also studying the code he gave me
Your structure is most likely copied anyways...
So search for "Route" in your files
well I didn't ask
And show the result
it would be better if you show your folders which has the files in it. it would be easy to find, where you have registered
😂
yes thats how you learn
it's okay thunder, chill
Man show the results of the search...
my uncull was on call with me while making it
lol
It's not twice, it registers them as guild commands once then as global ones, too
yh so thats why
btw, which version of d.js are you using?
Also make sure not to execute the registration on any startup but only if you register a command
Multiple registration cause commands to show up multiple times too as discords caching behavior is trash
after deleting it they are still two unless I have to wait an hour
Also Clients executing a slash command while registering it will receive an error
Clear your client's cache then
dk how too
Should be somewhere in the settings if that's the same across all clients
Just to make sure... how did you delete em?
I guess he used my way 😂
I havent yet got no clue what to do
I checked dev portal
Well you said:
after deleting it they are still two unless I have to wait an hour
Makes me think you deleted them
oh I meant deleting the code that I didn't need cuz I did it twice
You can patch the existing registered commands by calling client.application.commands.set([]);
Which posts an empty array clearing your current command set
can you call so you can help me
don't use rest to register slash commands i would suggest, do directly with client.application.commands.set(arrayOfSlashCommands)
it's a better way, and an easier way too
Make sure not to call the registration again and put what I wrote above into your ready event and start the bot once
Easier yes, better is not really the case as the methods are just an alias for the rest methods
But it's relatively nonsense to import the rest handler as there are already existing methods you can access through your client
Anyways let's see if he does what he got told to do

Hm
any clues on bot just closes during commands without any exeptions, logs, etc
memory usage is also stable
Me using VScode
Generally speaking you should have some sort of error if it just “closes”
What library are you using?
Thats why i am asking
node.js v16.13.0
rest dependencies is:
No, but that is not the topic atm
You should update to v14 discord.js
it's still a considerable suggestion
no need to be rude when people spot issues
i am not rude btw
ty for suggestion
but as i said
it wasn't the topic in that moment
if it closes without any error, that means you're swallowing the errors
check your catch blocks and make sure they are logged and not ignored
for example dont use stuff like .catch(() => {}) unless you're sure the error is safe to ignore
test all your commands and try to find which one is causing the crash
average rust user just being mad_
shut up fake

const existing = channel.messages.cache.get(data.id);
^
TypeError: Cannot read properties of undefined (reading 'cache')
at MessageCreateAction.handle (C:\Users\Iker\Desktop\RAILBANG\node_modules\discord.js\src\client\actions\MessageCreate.js:11:41)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\Iker\Desktop\RAILBANG\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\Iker\Desktop\RAILBANG\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\Iker\Desktop\RAILBANG\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\Iker\Desktop\RAILBANG\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\Iker\Desktop\RAILBANG\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (node:events:513:28)
at Receiver.receiverOnMessage (C:\Users\Iker\Desktop\RAILBANG\node_modules\ws\lib\websocket.js:1008:20)
at Receiver.emit (node:events:513:28)
at Receiver.dataMessage (C:\Users\Iker\Desktop\RAILBANG\node_modules\ws\lib\receiver.js:517:14)
?
I am trying to make this more efficient. As it stands users some times get spammed multiple messages or get nothing at all. Any ideas?
setInterval(async function () {
let reminders = await Reminder.find();
var toRemind = []
for (let i = 0; i < reminders.length; i++) {
var commands = reminders[i].commands;
for (let v = 0; v < commands.length; v++) {
var cd = await client.cd.checkCoolDown(reminders[i].id, commands[v]);
if (!cd.reminded && cd.ready) toRemind.push(commands[v]);
await client.cd.setReminded(reminders[i].id, commands[v]);
}
let embed = new EmbedBuilder()
.setColor(client.bot.color)
.setAuthor({ name: `Reminder`, iconURL: client.user.displayAvatarURL({ dynamic: true }) })
.setDescription(`The following commands are ready for use:\n**${toRemind.join("\n")}**`);
let user = await client.users.fetch(reminders[i].id).catch(err => {});
if(user&& toRemind.length>0) await user.send({embeds: [embed]}).catch(err => {});
console.log(reminders[i])
}
}, 130000)
"mysql.connector.errors.DatabaseError: 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (111)"
hmm error 
Try using 127.0.0.1 instead
And please, move away from mysql or at least use maria
but have my hosting phpyadmin.
Phpmyadmin is a dbm, not a host
@lyric mountain
Hmmm how is..
because I have no idea how is this for phpmyadmin for mysql to work? how is this solution?
really?

php mysql administrator
yes yes but
show how ur doing it
is mysql running?
I see, what's the idea?
there's no idea, simply follow a mysql setup tutorial
I have no idea what you're trying to say
yeah okay
Use an interval and edit your target message passing your (edited) array of embed(s) to it
180 ping is ok for a bot?
Ping on a bot is kinda irrelevant unless you're playing music or if your ping is so bad it's making slash commands fail 
music
How can I check if my internet connection is running through a proxy?
💀
I still wonder why people even attempt to make a music feature when there're so many good music bots around
is melonJS good for making browser games? or should I literally use react since im prob not gonna make like a platformer
webgl with unity
id prefer javascript
They do not understand the horrible implications of owning a music bot
Sure but you should have a look at all these
https://github.com/collections/javascript-game-engines
javascript game engine doesn't sound very...performant
Unity webgl is a better option
To be fair i designed my own music system because there are specific things i want or more or less want full control over. I get why but ya a lot of bot tutorials are usually music bots 😂
What html framework is used like this?
html
head
body
div
or similar
saw it in a code report once (yes that one)
?
That’s just html
Lots of frameworks use base HTML, they just provide extra stuff on top of it to make your life easier
Exactly like this
Uses indentation like python and no </(class)>
may I warn you tho, html structure is a feature, not a burden
using a yaml-like structure will make your code unreadable at best
for sure
whats the best way to make alot of movable divs in react? (all directions, like desktop windows)
I settled on using react-draggable
"yuml"
yo
can someone tell me how auctions work? on topgg
i got 94$ in vote credit, do i put 94 in both the input boxeS?
Auctions work like auctions
The highest bet gets it
yeah i got the first part
but what is the second pe?
the 20 @ 100
is 100 the amount i pay? from vote credit
or 20$?
wew i see, adding "$" makes it confusing
Credits is a currency too, just exclusive to topgg
so after the bid ends i would need to pay 20
yea
i got that
so if i did 90$ @ 100$ i would need to pay 90 at the end right?
mmm, alr thanks
no need to ask if anyone can, just ask the question directly
with
this
just ask bro, don't ask to ask question
how did you fetch it?
can you show me the code
damm, didn't even notice
Man... stop creating unnecessary event listeners
That's the first issue you should solve
Do not add multiple event listeners for the same event
In your case message event
(messageCreate I assume)
Errr the better question is which lines you should definitely remove
what even is that no-api-key
Well obviously a lost domain
I think convert user pfp to snow theme or smth
I think, you can't trust your friend :DD
aaaand they delete all messages
im so confused
Indeed
I mean anybody knows you just need to add a (c) into your code and it's save
_entirely save _
Imagine not generating the year in your backend
Eww JavaScript
lul
like 1000+ lines or something
I want to change the color of my Bots Page like this bot and got told that I should use css. Can I get a small example how to inject css please? ^^
@granite remnant Here is the code from the page you linked
<style>
#menu {
background: #6596f9 !important;
}
.llbETX {
height: auto;
}
.code,
b,
.entity-header__name,
.entity-announcement__title,
.entity-header__button-icon,
.star {
color: #e4ecfd !important;
}
.entity-header__image,
.logo img {
animation-name: SpinAnimation;
animation-iteration-count: infinite;
animation-duration: 1s;
animation-timing-function: linear;
}
@keyframes SpinAnimation {
from {
transform: rotate(-180deg);
}
to {
transform: rotate(180deg);
}
}
.body {
background-color: #fff !important;
}
:root {
--background-dark: #fff !important;
}
.ml-3::after {
content: " from our awesome community! ";
}
.entity-sidebar__title::before {
content: "The Tempy ";
}
.user-name:nth-child(1)::after {
content: " (Founder)";
}
.entity-sidebar__website::before {
content: "Visit the Tempy ";
}
.entity-button {
background: #3254b3 !important;
}
.entity-header__button-text {
background: #3254b3 !important;
}
.entity-header__button-icon {
background: #3254b3 !important;
}
.pill {
background: #3254b3 !important;
}
.entity-header__button {
color: #ffffff !important;
}
.entity-table__cell {
color: #ffffff !important;
background: #3254b3 !important;
}
code {
color: #ffffff !important;
background: #3254b3 !important;
font-family: "Inter", BlinkMacSystemFont, -apple-system, Segoe UI, Roboto,
Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, Helvetica,
Arial, sans-serif !important;
}
.entity-table__cell:nth-child(odd) {
color: #ffffff !important;
}
.entity-tag {
background: #3254b3 !important;
color: #ffffff !important;
}
.entity-owner {
background: #3254b3 !important;
color: #ffffff !important;
}
.entity-content__description {
background: #6596f9 !important;
}
.review__action-button {
background: #3254b3 !important;
}
.review__action-button.active.positive {
background: #cc00ff !important;
}
.entity-announcement {
background: #3254b3 !important;
color: #ffffff !important;
}
.entity-announcement__date-wrapper {
color: #ffffff !important;
}
.entity-announcement__date {
color: #ffffff !important;
}
.entity-content__section entity-reviews {
background: #3254b3 !important;
}
.entity-announcement__header {
background: #3254b3 !important;
color: #ffffff !important;
}
body {
background: #6596f9 !important;
}
.entity-header__star.star.icon {
background: #6596f9 !important;
}
.entity-content__description {
background: #3254b3 !important;
}
.nav__NavbarParent-sc-1r2v9d7-0 llRurQ is-widescreen is-mobile site-nav {
background: #6596f9 !important;
}
.StarRating__StarGrid-sc-14c4h6v-1 kiLlqk comment-stars-parent {
color: #6596f9 !important;
}
</style>
You can inspect element on any page to see the code :)
Thank you this will help me! :)
It says undefined, how can I delete that text?
This time don't delete the question, please
okey
okey
.addField("title", "content")
oh
You're currently only defining the title
Is there anything else he should do?
Nope, it's appearing undefined cuz u didn't set anything for the content
Do note, it'll still have a blank space in that line, fields always occupy at least 2 lines
hey guys
would this be a valid sql code to create an assertion?
CREATE ASSERTION MaximumGrams
CHECK( 1000000000>=(
SELECT SUM(weight) FROM Copy
)
)```
I basically want to check whether the total weights in the copy table don't surpass a billion
what in the fuck
cant u just use a trigger?
nah we must use assertions
yessir
given how weird it is, is it sql server?
quite an odd hole you got yourself into eh?
but well, I think that's something exclusive to duckdb, perhaps you can find good answers if u specify it on google
no duckdb doesn't even have this implemented
it was recommended to us to use it
while we cannot even have all the needed features lmao
that ain't standard compliant sql, that's for sure
oh wait, just noticed
it's you!
I'm starting to question what kind of school is that
Me too
hello I have a problem where my bot is keep thinking
https://pastebin.com/CD8reWz8
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.
bruh 💀
but well, ignoring the insane amount of newlines, ur not completing the interaction
except both variables will have the exact same value
and interaction must be either replied/edited after u defer
if u just defer it'll maintain the "Bot is thinking..." message
Tf is the author property there
Theres no interaction author
Never
Messages have authors, interactions not
buddy, the whole code is a mess
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.
Hello, I'm using discord.js and when my discord bot starts up, it spawns multiple shards.
I am in servers that are in various different shards.
My code currently seeks out users in shards and then sends a message to them.
However, because i'm in multiple shards, it's sent me the message multiple times.
How can I resolve this?
show code
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.
So it's pretty much running every time the bots shard becomes ready.
If it finds the user on that shard, it sends them the message.
I just need it to send them it once, despite finding them on multiple shards.
do you have guild information about those members/users?
or you only have their user information, without any relationship to guilds?
no relationship to guild
It pulls all users from my database, goes through them all and checks if they have auto posting enabled.
If so, it will then prepare to send the user a message.
then its not possible to split users across shards
you have to run that code outside of the shards
either in the shard manager, or in a separate process
users are not bound to shards like guilds are
What if i had the guild info?
So I go through each guild, and find each user in my database instead?
if you have the guild info then yes you can separate them based on their guild
With discord.js' createMessageCollector what would be an appropriate way to have a character limit. Like I would rather it not collect a bunch of things if someone decides to spam. Is there a way to "Empty" the collected messages apon a character limit hit.
if(collected.content.length > 1999) {
//throw error msg and clear collected messages
}
I'm not using slash commands for now as I'm finishing up a to-do list I made a while ago but eventually I'll migrate over when I'm not lazy.
I guess I could just "Stop" the collector and have them re-click on the emoji to fire up the collector again. 
set a limit
Well yes I can do max: #
Now if you mean individual characters the best way is to compare string length
What I'm referring too is, I know how to check character limit and all that fun stuff but the collector will still "collect" it.
The collector exposes the collection via <Collector>.collected, so you can clear it on-demand
No way to prevent it from collecting it
so what like <Collector>.collected = "" ? lol
collected is actually a collection of everything collected
there's prob a .clear() method on it
yea
Waffle saved the day
So true bestie

Voltrex always copies people
oh
He steals all my unicorn company ideas
Once a beautiful day I have some time to spend on it again
What about sum good ol' league of legos
Move on
Go write an simulator in PHP that simulates the Linux terminal perfectly, that is your punishment for today
honestly I have a fool proof plan of making money quick
just sell oxygen in a bottle
idiots will buy it like hot cakes
Php cli is already perfect
Can't improve it sorry
In this scene from MOST EXPENSIVEST, 2 Chainz meets Moses Lam, co-founder of Vitality Air, a company that is literally selling air by the can.
Watch the season premiere of MOST EXPENSIVEST here: https://vice.video/2iWI9JY
Subscribe Now: http://bit.ly/SUBSCRIBE-TO-VICELAND
Follow VICELAND:
VICELAND.com | https://www.viceland.com
VICE Video | ...
Damn how could nobody think of that, this will break the economy!
yea this shit dumb asf
right lmao
probably could
I have decent specs
"But ours is from the Icelandic mountains"
You guys making fun of it now...
Wait a few more years until governments decide to add taxes to people for breathing TO SAVE THE WORLD CLIMATE
The IRS is getting there
I'm sure they will
Breathing to much? Can't pay your taxes?
Fuck you, you're not allowed to breath anymore
one issue less
Its gonna turn out like those stupid tik toks
TikTok is just a cesspool of absolutely the stupidest shit that exists out there
They fucking dance on people's graves for the "trend"
Imagine wasting your life time watching bullshit like that
Yeah, TikTok is just making people even more stupid every day
So just to confirm because I must be stupid or something.
collector.on('collect', async (collected) => {
//I can't do collected.clear() as it says it's not a function
})
Can I only clear it on collector.on('end', async (collected, reason) => {})
I mean yes, it it's Intension is just to publish even more private informations the Chinese government can use against u
You can clear it anytime you want
It's just a collection of values
Sad shit is they making millions as well
The collected parameter is the message collected, not the collection, collector.collected.clear() is what you're supposed to call
Mfs out here with their own mansions
It's honestly just horrendous
Instead of clearing the entire collection
ong
Whats even more sad is the OF stuff 
Its horrendous the amount of money people make for just posting a normal pic of themselves
OF?
OnlyFans
Oh
Wanna know whats funny
markiplier
Im pretty sure OF tried banning NSFW content and they saw a drop in their income and reneged it
Yeah that was over a year ago, extremely stupid decision
Totally understandable, selling nudes seems to be a good way of earning money
Lmao
Especially for younger people
Why pay when you can get it for free


ikr, your mom sends great ones
I wish I had a comeback to this, but im too busy with your mom to think about one
bc i want a complete bot
@opaque acorn
?
<@&817055174613794826>
-m @alpine lichen spam pinging people and roles for no reason
Member "<@1046916070977572904>" not found
Yeah good. Come back when you actually want to ask a question.
how can i put the commands side by side
Use inline fields, but you can only have 3 max on pc per row depending on field title/desc length and mobile cannot do inline fields. They display as normal embeds or as if you had inline set to false
is this the way
?
Is it possible to get the server count of bots I don’t own?
I can get stuff like their username and pfp but not their server count.
by scraping yes
What’s the use case?
It’s highly discouraged to scrape
On my website, I’m trying to display some of the top bots I’ve used in my server.
Yeah but it keeps changing all the time 😅
Why does it need to be accurate
But is there no way to do it at all? How does top.gg do it, npm module?
No need for me to make an npm module for something so simple lol
And scraping is a lot
Bruh just don’t scrape
Makes sense
There’s no legitimate way of doing this
if you really wanna make it "accurate", youll have to scrape
Can’t users just theoretically send random counts like 100000000?
Yes you can
thats api abuse
You could get the server count from the Top.gg API (if the bot owner posts server count) but then you risk rate limits
As they’re pretty low for top.gg
How would you guys find out from all the bots on the site lol
@spark flint omw to reverse engineer how it works :trollface:
Hmm
We do, no worries 
if someone reports it
Top bots page lol
And yeah mods can find it
Yeah
But I just don’t see a neeed to show server count? It’s not like it needs to be either accurate or there at all
^
Yeah I’ll just put the current count
Still can’t believe it’s not part of the API though
You see the count when you invite the bot so yeah, not really that needed
why would it be lol
We just don't feel like scraping Discord's invite page for every single bot in a cronjob
Maybe that will enlighten you about why 
thats also against tos iirc
or just not something good to do
Almost every website doesn't like it
Yup
dont mind me scraping apkmirror
🎁
How to get more server use my bot?
make it better
@earnest phoenix hello there is?
oh thanks a lot for this
i will try it right now
it isnt anything more than you already had but its cleaned up and looks better
Is k8 too complicated for 1 core server
avatarURL
ty so much although I did figure it out yet
If someone is willing to;
Explain or link something for mongodb access control
Had no data on it but in the future it will 😅
Don’t leak your db password
Never was
Definitely did at some point or another whether you meant to or not

iirc doesn't mongodb allow a whitelist only system
Just make it so only your IP is allowed to connect
as for how to do this google, cause I can't be asked
chatgpt
(blurred out value is my public ip)
Would this work out?
got it setup
whitelisted ips only + required authorization
it's impossible to make a truly complete bot
music is a thing that's best done as a separate bot
because the resource usage is H U G E
add another param to addField("title", "body", true)









