#development
1 messages · Page 1968 of 1
Ffs he said he’s getting horny from c++ and I responded if that’s the reason he’s using Java
no need to be in denial my guy 😘
if you want to use java, i for one am not judging you 🙂
Careful… or I’m gonna throw a nuke into this channel
I was in a college meeting on teams last night, and the lecturer literally said 'at home i use google chrome, but at work i use internet edge'. I legit died.
i should mention, this is my 'web dev' lecturer 😂
I lost all respect for that man last night...
It’s even more embarrassing installing teams on your pc
pretty sure he mistakenly called js java like 6-7 times as well, but i had put music on by that point so not entirely sure.
i used it through 'internet edge'. you think im letting that thing touch my hard drive? bad enough edge forces its way on there 😄

TopGGAPIError: 524 undefined
at Api._request (/home/nodejs/noah-bot/bot/node_modules/@top-gg/sdk/dist/structs/Api.js:76:19)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Api.postStats (/home/nodejs/noah-bot/bot/node_modules/@top-gg/sdk/dist/structs/Api.js:99:9) {
response: Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
[Symbol(Response internals)]: {
url: 'https://top.gg/api/bots/stats',
status: 524,
statusText: undefined,
headers: [Headers],
counter: 0
}
}
}
Auto poster is causing this
my bot is not reponding at real time
its in 800 server but
its not responding at real time but in same code my test bot responding at real time
anyone can help?
Does anyone know how I can do a perms check with the database, I have a command to add a person in the premium category and I would like her to use only those commands. I use mongodb
Literally just coded it for myself.
let check = await client.db.collection("premium").find({ userid: <user object>.id }).toArray()
if (!check.length > 0) { return <object>.reply("You must be a premium user to use this command!") }```
so it is in my database
@bot_mods_only() @commands.command(help="Remove a premium to a user.") @commands.cooldown(3, 120, commands.BucketType.user) async def remp(self, ctx: commands.Context, user: discord.User = None): prefix = ctx.clean_prefix if user is None: ctx.command.reset_cooldown(ctx) return await ctx.reply(embed=error_embed( f"{EMOJIS['tick_no']} Invalid Usage!", f"Mention who you wanna remove premium next time.\nExample:{prefix}removepremium @egirl" )) for e in self.client.premium_cache: if e['_id'] == user.id: await self.client.premium.delete_one({ "_id": user.id }) await self.client.get_premium_users() return await ctx.message.reply(embed=success_embed( f"{EMOJIS['tick_yes']} User removed from premium list!", f"Done! I have removed the premium access from **{escape_markdown(str(user))}**.\n```yaml\nReason: {e['reason']}\n```" )) ctx.command.reset_cooldown(ctx) return await ctx.message.reply(embed=error_embed( f"{EMOJIS['tick_yes']} User Not Found!", f"Looks like **{escape_markdown(str(user))}** is not a premium user, please try again." ))
and this is the code
Yea
teams is a memory eater like discord
Initiate a client and store it somewhere, then get a database and collection name either via keys or attributes (both work with pymongo, should also work with Motor), then use the returned Collection object's find method
The argument you will use will be the ID of the user
how can i make it horizantal
my bot is having problems on some servers
the bot literally stops working on voice channels unless you run the command again
and this is very boring to do
bonk bad girl
wtf
who can help me please ?
I add my bot to repl.it and this error i dont know how can fix it
That’s related to your node version
I'm trying to make a skilling system with MongoDB, but the AddEXP function doesn't pull the "Strength" object, when I run a command.
It returns the attached image (it creates another "Strength"-Object with the EXP inside)
Function: https://srcb.in/n0O91I5nFw
Schema: https://srcb.in/LSX5zWlGut
How would I fix that?
I call that a...
**Skill issue
**
puns aside, show how you're saving that
wdym, like how I get all the elements in there?
or the command where I am triggering the function?
@lyric mountain
the function where u save to the db
that's in the AddEXP function
i mean i am updating it there, but like
.-.
How I save the data: https://srcb.in/YrmA5yqJxt
nvm
You're passing an array to the $pull operator, which is rather incorrect
That did work on another project tho, which is why it's weird
{ $pull: { skills: { name } } }
This will remove the objects in the skills array that have a name property that matches the given value
that didn't work either
oh wait nvm it did
it's just not at the top of the list
now i just gotta figure out how to move it to the first slot
You can do that by removing it from the array using the $pull operator and pushing it back to a certain position in the array using the $position operator
yo voltrex
const req = await axios("https://discord.com/api/v8/oauth2/token", {
data: {
client_id: this._clientID,
client_secret: this._clientSecret,
grant_type: 'authorization_code',
redirect_uri: this._redirectUri,
scope: 'identify',
code: code
},
headers: {
'Content-Type': 'application/x-www-form-urlencode'
}
})
Why discord giving me a 400 :c
For example:
{
$pull: { skills: { name: 'Strength' } }
}
then
{
$push: {
skills: {
$each: [/* The object goes here */],
$position: 1
}
}
}
Try removing the API version from the URL, and you're missing the d at the end of the Content-Type
Already tried the version thing
both work but both send 400
Oh you said 400, I mistakenly read that as 404
omg thank u volt, it finally works
Also you seem to be doing a GET request, not a POST request
Solved the issue
yea
I was making a get instead of post
now it says unsupported grant type tho
isn't authorization_code the correct one?
I don't think you're supposed to provide scopes when performing an access token exchange
And also taking this to account
These are a list of all the OAuth2 scopes that Discord supports. Some scopes require approval from Discord to use. Requesting them from a user without approval from Discord may cause errors or undocumented behavior in the OAuth2 flow.
What exactly am I doing that needs approval
The identify scope probably requires approval
yea the user's approval
data: {
error: 'unsupported_grant_type',
error_description: 'Grant type None is not supported'
}
but i get this back from axios
Is it not sending the request data?
Yea its not sending the request data for some reason
this shows you how to update:
https://github.com/FlameQuard/DiscordJSv13-Tutorial
hmmm
You're probably sending the data the wrong way using Axios, because it's obviously not the same way as node-fetch
I've followed the documentation o nit
let bool = false
if(message.member.hasPermission("ADMINISTRATOR")){
} else{return message.channel.send(":x: **You don't have the perms to start this event!**")}
message.channel.send(":white_check_mark: **Event has been started!**")
let re;
if(bool === false){
async function startLunar(){
//something here
ps = setTimeout(startLunar, re);
}
startLunar();
} else {clearTimeout(ps) };```Why is this not correctly closing the function?
eventhouh i have used the end event: js if(message.content === '!endlunar'){ if(message.member.hasPermission("ADMINISTRATOR")){ } else{return message.channel.send(":x: **You don't have the perms to start this event!**")} bool = true console.log(bool) message.channel.send(":white_check_mark: **Your Lunar event has been cleared!**") }
No i had to, as i removed big chunks of code
i formatted it earlier with prettier
What do you mean by "not correctly closing the function"?
It is sill performin that //something here function
Eventhough the bool is set to true.
Because you're not modifying the bool variable before it reaches that if statement that checks if it's false
Oowh okay.
show full code
Sure
so we can see where exactly each part is relative to the other
Any idea what data https://discord.com/api/oauth2/token/revoke takes if it takes any?
@quartz kindle
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.
i've changed bits up. By not using bool variables, but just plain json files
because it is still not stopping the timeout
that code is extremely inneficient, you are basically destroying your I/O with multiple fs operations on every single reaction, plus you have an infinite recursion if i understand it correctly, that creates infinite reaction listeners so your code is gradually duplicated until your bot blows up all your cpu and ram
Unless you're benchmarking your cpu/ram, in which case it'd be very efficient at seeing how long can it run
also why database.json
this definitely needs reworked
for one it seems like you arent using a command handler
two, i would definitely move away from a json database (which isnt a database tbh)
race condition go brr
"oh no why is all my data corrupted!"
this is what hackers look at
you may not realize it but they're actually in the fbi's database
No, this is actually a Dwarf Fortress gameplay
It might be the matrix code, colorized of course
Well, there’s gotta be a reason for it!
damn sad 
lol final denial
the nail in the coffin as they say
bruh
I thought luca or watcher filtered those
or does it not
the nitro scams
@ripe prairie
zerotwo does
my bot does
actually now that I think about it I should make my bot kick those people if possible
How can you get the history of a document on MongoDB?
How the data was 10 hours ago, etc.
Probably via the MongoDB object ID.
don't know if mongodb even has that
Oh, man.
No I don't think mongodb has it natively
but there are open source solutions that can implement it
maybe this works for you
but I didn't try it so I can't give a garuantee it is gonna work
maybe just search online for a solution
or check the mongodb docs if they have it
ive heard about this aswell
dont know how tho
should i worry about level INFO exceptions happen internally an app im using? im getting these logged but not sure how to prevent them. i mean my app still works
Didn't find, though. :/
beware though such a feature can quickly cause your database to fill up with enough edits and not enough deletions or thresholds
I recommend saving a history manually
only save what you need
the object id is there by default tho
any1 know any good rank card API's?
(pls ping answers)
that's something u do yourself
I'm not in the mood for making my own rankcard api
no not an api... just use canvas or another library
so umm, apparently non relative module imports are not working on mac m1
but works on ubuntu
i tried googling, found nothing
anyone know any fix?
seems like its not reading the tsconfig file at all
during run time
but its able to detect during compile time
wtf
I meant any1 know any libraries (api library kinda same thing idc)
skem
already am

have been since I booted my laptop
¯_(ツ)_/¯
welp, guess imma google
thanks for the help
🙃
It says module not found
Tsc throws no error
well there you go. So VSCode is using another configuration
how is it able to find the modules when i compile?
Check which config it points to
you're using vs code right
ye
Go to any typescript file inside your project, it should be in the bottom right corner
yeah, but i dont see some config
or typescript version
it opens a drop down on top when i click on typescript
and shows "auto detecT"
you have to hover over the {}
its pointing to tsconfig. the correct tsconfig file in my project
but when i start the app it says it cannot find module
;-;
well, when i start coding and import stuff vscode says the path is correct
but when i try to start the app i keep running into module not found aaaa whyyy
Do you have @types/node installed as a dependency
Also make sure that moduleResolution in ur ts config is set to node
still no luck with it
still the same error.
couldn't find anything on google related to it
weird part is vscode is able to load the module while coding and importing... and also works on ubuntu
its just failing for some reason on mac m1
just tried on mac intel didnt work. sad
mac's trash
yes
like i wanted to do auctions but im scared that discord will flagged my bot as inorganic growth like bruh
Do auctions after it's verified
About inorganic growth how long does it take to get fixed?!?!
oof
but im not interested to do anything with my bot after it is verfied
May have been a bad idea to ask a buddy to spam it lol
im bored easily so i need to do another unique things
may have been but idk maybe you wont get flagged who knows
I was flagged :(
is the decision final?
I like how your name has Natural in it, which is ironic
ok flaze thats a good one
Does anyone know how I can do a perms check with the database, I have a command to add a person in the premium category and I would like her to use only those commands. I use mongodb (python)
use motor
and do perms check
its complicated to explain but there is a video on youtube explaining saving and retrieving data from mongodb to python
This is my code,i want to add a string to a string but why doesn't it work? it prints nothing
r = ""
def add(string:str):
r+=string
print(r)
wdym
the users in my database can use some private commands
And want to make a check in the database
To see if the user id is in the database or not in order to use the command
if collection.find_one({"id":user.id}):
do your work...
@earnest phoenix
did you call the function
yes
I have multiple collections that have "_id"
it'll search all of them
Where?
in my db
I need you to search only in the "premium" collection
the code search
only in this collection
then its the same
you can then change the _id to premiumid or something
userid.premium
no you cant
_id is there by default
isn't that the user id?
oh nvm
yea but there must be an _id since its a object id
and making custom _id is a bad practice anyway you should leave that by default
yeah
help
or add premium:true to premium users in a regular user database etc
because you haven't called the function
and you don't return anything
i have called
I took the blacklist system and changed it so I can add a person as a premium in another collection
you made add a function
le error there
If you want I can give you the code to add / remove a person in the database
i mean i want to use it outside a function
i want to use it in a if statement
like
r = ""
if i == 1:
r+="string"
isnt it the same?
it says local variable 'r' defined in enclosing scope
and this if statement is in a command dpy
def add(string:str):
r = ""
r+=string
return r
@bot.command()
async def idkbro(ctx,x:str):
print(add(x))
or do you not know how function works
that basically just returns the string
true
this make "r" inaccessible in other functions
well, it makes a local variable
then make it global if you want
i did this , it says local variable'r' defined in enclosing scope on line 1 referenced before assignment
r = ""
def add(string:str):
r+=string
return r
i do not that's the problem
i read it in Google
while you want to access r without getting the variable r
you can google it
aren't those only static pages
no backend
I guess static pages can also mean no js, but in this context it means no backend
static pages are html + css + js only and mainly are used to give information only. You can download them and use them offline
dynamic pages are pages which show you different things based on different factors, for example if you're logged in or not, etc. To do most of the things they communicate with an API
If viewed offline, no
It's very broad
yes
how can I set that an interaction.followUp can be seen only by the interaction.user? [discord.js]
Pretty sure followUps can't be ephemeral since the endpoint always returns a Message object, but that wouldn't make sense in the case of ephemerals
You just have to reply with ephemeral only
Messages can have multiple message embeds, so you can fake multiple messages to an extent by editing your reply
Traceback (most recent call last):
File "main.py", line 1, in <module>
import discord
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/__init__.py", line 25, in <module>
from .client import Client
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 53, in <module>
from .webhook import Webhook
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/webhook/__init__.py", line 12, in <module>
from .async_ import *
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/webhook/async_.py", line 46, in <module>
from ..channel import PartialMessageable
ImportError: cannot import name 'PartialMessageable' from 'discord.channel' (/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/channel.py)
what this error is all about
please kill me... I've been trying to make custom marked extensions work for an hour now 😭
nothing is wrong in the code since i try running it with just on_ready function but the error is still there in replit
you didnt install pycord or discord correctly
also replit sucks
auto install dependancies cringe
it was working fine before i made some small changes
Man someone help
i have no clue either
if only python had a keyword for assigning variables
my bad there are no comments
you can avoid it but you have to type every single dependency you import:
# .replit file
[packager]
ignoredPackages=["dependency1", "dependency2", ...]
did you try, yk, passing r as an argument and returning the result?
some magic: str => r + str
oh right this aint js
Does python even have lambda expressions?
Or anything akin
Actually, I don't even see the reason for that function
litterally just called lambda
you cant assign / mutate global variables without explicitly declaring global foo
+= is an implicit mutation
some magic: r + str
this might not work but here you go: +[r, str]

you're lucky you don't use js
get help.
Python
Rust
JS
TS
Java
C#
Lua (sort of)
Ruby
Go
C
Because Big react JS projects without TS are pain?
why c when rust
Because diffrent clients have diffrent requirements
some magic: flowjs
and interfacing with C with Rust still helps to have knowledge of C
some magic: assembly
Who assembled assembly?
The assemblers
me
the assembler is actually partially written in machine code (depends on compiler) and then the rest compiles itself
;_; still no luck with this non relative imports shit
man
i've used them in my entire project aaaa
does he even know how to merge prs
i am seriously offended by the last line at the bottom of the page
gigachad using raw html for a website without a framework
@hoary hill OH MY GOD I TRIED CHECKING OUT THE SITE BEFORE YOU COMMITED
IT USES <font> TAGS
HOW MANY <br> ARE IN THAT FILE
USE A FRICKING <pre> TAG PLEASE
what does pre do?
AAAAAAAAAA
<div align="center">
<div align="center">
<div align="center">
typing <p>a lot of SPACE</p> does nothing but <pre> preserves spacing and line breaks
oh
however if your code is indented...
so with pre you're forced to write it right at the left border?
yes
same happens for template strings in js
or for any programming language that supports multi line string literals
in java we don't have such weakness
let's talk about the other weaknesses
{
{
{
String s = """
This will be written
exactly as you'd expect
""";
}
}
}
groovy also doesn't have indentation issues with multiline literal strings
actually none of the jvm langs have either
what about intentional indentation
Like intentionally writing your code as it should be?
You must be crazy…
he's talking abt intentional indentation in multiline strings
not in the code

i am planning to change my entire website to a terrible hacker linux terminal
intentionally deteriorating ux :)
make the site generate a new random bug every 10 minutes of session

the longer you stay in it, the more uncanny it'll become
Sounds like what topgg does
or 10 seconds
maybe i'll make smth like aperturescience.com
🔫
f
I miss joke websites trend
like google gravity https://mrdoob.com/projects/chromeexperiments/google-gravity/
nowadays it doesn't even work anymore damn
yeah because how else would the language know whether you're trying to add spaces or trying to add an identation
multiline strings are never pretty
either write with no identation or write a very long string with \ns separating the lines
FaKe has pfp 
a sign he's losing it
getting too old
java? never heard of it
it supports indentation within strings, doesn't get rekt with code indentation nor use long strings with \n separating
...you can
prove it
how?
idk print something
When I use .permissionOverwrites, it overwrites the permissions and adds new ones. But how would I update existing permissions to a channel? Ex. If I deny send message permissions to user1, if I use .permissionOverwrites to deny send message permissions to user2, user1 can now send messages. I would like to deny send permissions to user1, but ALSO deny send permissions to user2 as well.
Yeah... unfortunately it's way to small to see what it actually is
iirc, it's upsert
upsert?
wait, that's porn!
You and your dirty mind... They obivously do sports...
either upsert or overwrite
depends on the lib
just search in the docs
@boreal iron nice pfp
sus

aight thx
What's the best way to go about making a lock channel command? I'm thinking something like looping over all roles without the MANAGE_CHANNELS permission, but that seems inefficient
Can't you just filter all roles who do not have the MANAGE_CHANNELS perms and then make it so those roles can't speak in the channel?
no one help waffle he called me stupid
Hes not using java?
unlucky really
Suffer the consequences - feel the hate!
yeah
by the way have you guys heard of the new hit game?
it's called among us
have you played it?
Not yet but isn't it already "old"?
bruh you are cringe
in fact my os is evolving
instead of studying at school i spent my time fixing a bug i had with an iterator i made
@boreal ironive reached a point to where I avoid if statements because i consider them slow and risky
though i make some exceptions because a linear operating system that cant do anything other than one thing isnt all that fun
if statements are costly
can cost 20-30 clock cycles if the cpu predicts the outcome of the if statement wrong
thats a lot
@quartz kindle ops on the iterator i made?
cant think of a better implementation
cant use indexes to iterate because it is a linked list so i made an iterator that moves up the links
actually i can go a step above and avoid the "creating a struct and iterator" overhead by placing it in a static variable and calling the reset method i made on the iterator to start over
win win
its all about the optimisation
It pretty much is, yeah
For people who know what they do
For anyone else it’s just, how tf can I get it working
Can’t find anything to copy&paste on Google

the inefficiency i see in modern code
it makes me sick
it already hurts enough adding a single if statement to a very performance sensitive function
while fuckers here make whole unity games that run at about 5fps on older computers
I've figured out how to hack js to get the best performance ever 😎
Don’t using JS?
but on another node, I can't believe how outdated the marked typings are
note*
nothing ever goes right for me when I'm using marked.js 😩
js is fast
but think of the overhead associated with interpreting the language in real time with objects serving as a type basis for the language 😭 🤮
WITH UNKNOWN TYPE SIZES AND NAMES TOO
😭 😭 😭 😭 😭 😭
i need therapy
V8 performs a TON of clever optimizations
for example...
Objects actually store indexed properties separately from named properties
and every object has hidden "class" which describes how it looks, so similar objects get stored more efficiently in the future
that is sexy
What's also cool is that functions created by the Function constructor also get optimized after they're first called
the power that gives you is insane
the same way your code gets optimized
which means you can write JS code in your JS code, which will be almost as fast as your JS code
Obviously creating the function itself is going to be slow, BUT, if you're calling that function 1000 times it's totally worth it
create it once, call it a lot
welcome to a JIT compiler
use deno
or pure v8
yep thats why the number of native func is sinking
since js is much more optimized
How could I limit a command to people with a specific role in discord V13?
check if the member.roles has the role ID
i know this method thats why it sucked
hint: to access global variable use keyword global
How can i make my bot delete all the messages in DMs?
replit uses containers so if it changes, your dependancies can get fked up too hence the error
imagine an AIT compiler
Almost In Time
like, it almost compiles ur code
Guys, i tested my bot with multiple of people (about 20) and no one said it gives interaction failed. Myself i also never got interaction failed but some people have shitty internet and they are blaming me that my bot doesnt work, so i got free three 1 star reviews, reviewers offline for months and reviews are in guidelines
Top.gg support sayin that its my bot problem
But when internet is bad then it wont even get back to user in 3 sec, even when interaction defered then it fails for these people (tested on slowest internet possible)
i know that might happen usually comes in ephemeral message, but now that i think abt it my connection is fine and i still cant use the slash command on my test bot so eh
it is an edge cases you just gotta deal with it i guess
Well i never got interaction failed on normal internet
as i said its an edge cases
So because someone tries to use discord with free internet then he gives me 1 star review that bot doesnt work
Instead of having 5 star i have 4.48
You could give users a backup option I guess for users with slow internet
After message intents will become enforced, the bot will still be able to see messages if the bot is tagged
So as an example mirror “/help” to also be accessible via “@mention help”
So guess you can keep that as a option? Guess it would only work if you have a bot user linked tho
Haha, users would still give 1 star
not if you implement it
Ye… I guess open a GitHub discussion on the docs reporting it as a annoying issue, or upvote a existing one if there is
Some people aint clever enough to use normal commands instead of slash ones when slash ones fail. They would still give 1 star
Had the same issues with slash command list not even loading on android on slow connection, and as you said, the 3 sec timeout is client side not server side… they should really have the client wait forever until backend then comes back saying it times out lol
yea discord made it like idot
For normal slash commands its client side?
How does that work?
timeout is client side
I'll try and replicate that by artificially increasing my ping I guess. But I've never heard of that
Unless they changed it, it’s what I had issues with last year
I ran my /command in my slow android phone internet showed as timed out
this is true
They could change it but reviews are from few months ago
Wish I had the ability to reproduce quickly as well. Got no access to a computer atm
Where is it hosted
Actually does not seem like that’s a thing anymore? 🤔 Yeah the bot is offline, but it waited until I came back online
idk if i can say name but i have around 50ms ping and everything is fast
Cool, but cant do anything about reviews...
Cuz they were probably before this update
The more reviews you get, the less the bad reviews will matter luckily
@solemn latch do you know if Top.gg use a drawing review system? So the total stars of a bot is only based on X amount of the latest reviews?
I have no idea tbh
I cannot replicate it either
If not, you could suggest it at the https://feedback.top.gg site. So old bugs, issues or missing features won’t affect total score
Let us know how we can improve. Vote on existing ideas or suggest new ones. If you require support or would like to report a bug, please go to our Support Page · Make a suggestion · Top.gg
Pretty sure Uber does a draining review system too
Your driver rating is an average of the last 500 ratings from your riders.
I have a feeling that if we implemented that in that way it wouldnt apply to 95% of bots/servers
like in their lifetime it still would be under the minimum review count to matter
I mean, 500 reviews would probably not be a good limit xD
well, it would have to be quite high, as larger bots and servers exist
Could segment bots into buckets. Small bots have reviews rotated after every 20 reviews, larger bots rotate every 100 etc
Or even put it at a percentage, where only the most recent 40% of reviews are counted after X amount of reviews.
But again, complicated. Probably worth putting on feedback, but implementation and user research would definitely need to be heavily discussed
const overridepermissions = new Permissions(message.guild.me.permissionsIn(message.channel));
if (overridepermissions.has(Permissions.FLAGS.VIEW_CHANNEL) == false || overridepermissions.has(Permissions.FLAGS.READ_MESSAGE_HISTORY) == false || overridepermissions.has(Permissions.FLAGS.SEND_MESSAGES) == false && !message.member.guild.me.hasPermission("ADMINISTRATOR")) return;``` what am I doing wrong? :C
overridepermissions.has(Permissions.FLAGS.VIEW_CHANNEL) == false just use !
your issue is having a not OR not OR not AND not
not OR not alone won't work
you took it to a whole new level
lets go pycord v2, now i gotta fkin rewrite all of my commands
Is it any better than nextcord
its better because i dont need to change anything in the import
and i dont really know nextcord features so yea
Owoooo
Heeey
Do u know how i would reset all the slash commands my bot have?
Like completely remove them
client.application.commands.set([]);
Which will update all global commands to nothing - represented by the empty array
Aka. it removes all commands
Tfw my bot migrated to slash commands and I managed to lose 1000 guilds in a few days
📉
stonks
reverse stonks
except you won't be working at mcdonalds to repay it
people are actually livid I couldn't migrate all of my existing commands because of 50 command limit and no custom prefix support. And everyone thinks bot doesnt work because not the same prefix
not in this case
Yeah thats a problem with users who are new to discord or dont know the new discord updates
Isnt the global slash limit 100?
I've been told its 50 and I tried loading all commands and got shit on
ended up deleting all of the modules unrelated to main bot focus
nope. No unique features that actually depend on it
They denied even though I had message collector prompts
Oof
this is just my suggestion tho, but you could have made the transition a bit slower... Like move to slash commands but also have the normal commands with the prefix being the bot's ping 👀
Bots get message content of messages which has them mentioned, so
I could have, but I was also starting to reach an upper limit for what my db could handle because I had to cache perms and everything
Ahh
Well how many servers do you have in total
6500
oo yikes
now? or before losing 1000?
Now
The image src needs to be a remote url. If it starts with a / like you have there, it will look for the image on the top,gg domain, but the image is not there
I don't get how to fix it
does not helping my mood since I took a long time rewriting and moving to TypeScript which was very painful. Debated on tossing in the towel a few times and possibly stopping Discord related dev work in general, but I maintain some relatively popular libs, so decided against it
do i use the image as a link?
Man you'll gain those guilds back, chill out
the image needs to be hosted in an existing website, and needs a full url, for example http://websitehere.com/image.jpg
i fixed it already
it's fine rn
if its for a Discord bot, using Discord's cdn will be fine because both would go offline at the same time if Discord decided to kick the can
Alr
ah true
Discord is probably the best storage in that context
Since top.gg doesn't offer it
unless you want to run your own service, but have fun if top.gg decides to enforce any origin restrictions
That’s why I started to replace my commands very early but still let any common command online as well, slowly moved to a warning when a common command was send and later only send a warning without executing the command
Over weeks and months…
@round cove i don't really hate on firefox too much im glad there is more than chrome out there and obvs it being broken is not ideal
its on the list though
also moving here since isnt auctions im just babbling about browser
It's my continued thing as I was giving veld shit about it a year ago lmao
ohhhh makes sense makes sense
It has api secrets in it and shit just in the js*
so I think it's funny it's still there

This is like oily era code
😭
:3 lots of stuff changin
good !
I can't wait til Top.gg is a PWA and I can keep it pinned forever
Okay Cassie
Now help me create EF lambda's so I can talk to AWS' RDS shit all for my shitty site
:^)

I need help
Aaa why is this dumb thing not working on mac
Non relative imports aaaa typescript
mac suck
i cant even use speechrecognition library due to vscode not asking perms on mac
cant you manually give it permissions
📈
sounds like a great time to be alive
How you fix it is; fork it and fix it.
Or make it yourself.
Or fuck it
or sell your mac
sad to see so many browsers actually just being chromium just with a new coat of paint lol
like it makes no sense at all
My turn around time for features in my bot has been a lot quicker ever since I migrated to first party software almost entirely. I remade LavaLink in TypeScript. I made a cacheless version of Discord.js
I now maintain modular Discord interfaces for rest and gateway
I made my own orm.
My existence has been painful, but everything is my fault if there's issues and I can fix it at my own leisure.
vscode can detect the tsconfig basurl but when i execute ts-node
it keeps trying to look in the node modules for non relative imports
imagine coding in ur own linux distro with ur own code editor with only ur own libs in that programming language
Software devs in the early days of their language
welp, hope i get there one day hahaha coding my own compiler
nah even better
code ur own kernel
and ditch linux entirely
make ur own custom kernel and os based on it
using your own device
ofc
Source your own silicon
with ur own hardware and chip
potato chip indeed
give me 10 years
I'll make the chip operate on NaN and Infinity only instead of 0 and 1
its either exists or not
the message I was trying to get across though is that there's no shame in making your own software. It only becomes an issue when you make it public domain and people use it in ways that weren't intended and start to discover bugs and then you have to develop your software in such a way where it's idiot proof until someone who's a bigger idiot comes along until you end up with your own plain english high level language
I think I'm on the part where bigger idiots are coming along to find my software and expect things to be higher level even though the purpose of my stuff is supposed to be low level abstraction layers that make use of modern language features
known issue
when the turkish person asking for help adding a role posts their code:
Is it a good idea to use Redis as an economy?
It's a general-purpose database, so it'll be fine
Unless you have a lot of activity, then maybe not.
Redis is used as a cache, but many people just use it as a generic database.
Less powerful than SQL, but drastically simpler to use.
I’m just trying to make my bot as simple as possible for my developers to understand what i’m trying to do. Since we are a team of 3, and one of them is unexperienced.
could tell that was Klay without even looking at the pfp/name
redis has caused so many issues for us that I would never trust it as a reliable db
define issues
Document it then
No need to sacrifice features for simplicity
never had any issues with redis
So far Redis is working fine for me. I’m using the Local Database on my Debian system and not Redis Cloud.
I had tried to use redis as a cache for data returned by Discord, but I somehow managed to bottleneck it
not sure, we've had problems with persistence failing and corrupting the db and forcing a full reset on redis multiple times in the past which is totally fine with redis as a cache but completely unacceptable for a persistent storage
Hi
if I had to guess it's related to persistence intervals like how many keys need to update before it does an async save to disk and high traffic
redis isnt no
only on weekends
but also, you shouldn't be using redis and relying on it's persistent store
it fundamentally cannot handle large snapshots well
Looks like I encountered my first official error with Redis I guess.
I doubt it
i mean
most people never need redis
they just choose to use it because "OMG cache! must have! my database knows nothing and they've never thought about caching!"
If people use Redis for caching why not use node-cache if you use Node.js?
nooo materialized views are scary
unless there is some awfully janky shit on the backend (which wouldn't suprise me)
It lets you flex to people of equal incompetence in places where they dont need it
to anyone else you just look like a clown
the caching definitely comes in handy but it's definitely abused in many places
I mean even then, its very specific cases
I think we could throw away like 80% of all our redis uses and not feel any difference
at a large scale even becomes negative point relying on redis because you just fuck up your database's buffer pool system
"Oh we dedicate like 4TB of memory to our cluster backed by our 4TB memory redis cluster"
we're probably gonna yeet redis completely once everything is inside the same vpc
I think redis should only be introduced once there's a tangible problem otherwise it becomes the problem itself 🧍♀️
well it becomes the problem regardless
Database systems: Invest hundreds millions of dollars of work into smart caching systems for the database
Developers: puts redis infront of it
Database: 🤡
yes
you would be, amazed at how much it can handle
if you actually configure it correctly
I am amazed at how much it can handle. I've tossed a ton of shit at it. Although a super volume of requests seriously hurt it, so I had to make a system to buffer insert statements together
People complain about postgres performance at high loads when they're using the default config which pretends that it's been ran on your mom's phone from 10 years ago
@boreal iron wanna have a word?
anyone know how I can find out why my bot is randomly going offline, with no errors at all
pray you find it
without any errors or indications? good luck
try setting up logs
or if your host logs info
;-;
if you want to feel better when writing an operating system and if something goes wrong you wont know until you notice somethings off
theres no errors
its all just guess work
that's what c is all about
<style>
h1 {
font-size: 20px;
}
</style>
``` im trying to change my font style for heading on my bots top.gg page but its not changing it. any idea why?
nvm
yeah you're right
compiled languages stink
tho rust apparently forces you to write safe code
Yeah
Pretty much if your program compiles without warnings, you already did something good
very rough, but true
Rust's about the only language where passing the type checker actually means your program will work
except when it doesn't
but those are rare
I'd like to use Rust some time in the future again
only thing i dont like about rust is the syntax
other than that I think its a great concept
Huh?
i wanna use a proof assistant where passing the typechecker is a near guarantee that your program works
What's the max channel name length?
32 chars?
oh crap apparently it looks like 100 chars
65535
One message removed from a suspended account.

Does anyone know how to set a timeout for sharding in discord.js?
timeout for sharding?
a word is a 16 bit number
and the biggest 16 bit unmber is 65535
manager.spawn(-1); I did this and its still default to 30 seconds
completely unrelated but I once got u16::MAX as my 2fa code I still can't believe it
Does anyone know how to set a timeout for sharding in discord.js?
timeout in what way? like setting the connection timeout?
Yes because my bot takes a little longer to ready
const manager = new ShardingManager('./index.js', { token: process.env["TOKEN"] });
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
manager.spawn([90000]);```
This the code I have
?
You can't really change that, that's the amount of time it takes for the specified (or the recommend if not specified) amount of shards to be spawned
if anything changing the shard spawn cooldown would be a BAD idea
not really
Shard 0's Client took too long to become ready.
check if ur nameservers aren't faliling to connect to discord.com
Thats the error I get
They arent its just taking a long time to boot up
This could be due to a code error or the server's internet connection
Thats what I am saying so how do I change its timeout so the error or the server's internet connection wouldnt matter?
nvm found how
Wtf a word is just a number?
You opened my eyes, Sir!
My shards are all dead
SHARDING_IN_PROCESS ???
First time running into this issue. Any thoughts?
you're trying to do something before they finish starting
I haven't changed anything in awhile. The bot doesn't load anything.
As in fetching from Discord.
idk then
Using the token with different code that isn't sharded
It looks like the bot takes a long time to connect via discord.
And once it tries to connect again this is thrown.
u said it's been a long time since u modified the code
could it be library being outdated?
little bit late but it’s pretty obvious what a and b are, there’s not really a better way to describe them
It's still an interesting question.
Another solution would be to have functions explain what it's for.
function ascend(x, y) {
return x - y;
}
function descend(x, y) {
return y - x;
}
// Now any place you see the two used, the intent is clear and declarative.
data.sort(ascend).sort(descend);
Ya
did amazon mess up their typescript or is intellij confused. this code works
just a little
I have an idea about an command but idk if it's possible.
Can I search in the chat for the last message sent by the bot and delete it, then send a new message?
Yes.
Assuming it's a regular message (not an interaction response), you'd listen for message create events and record the last instance of your bot sending a message (e.g. store message ID in a database).
You could make an HTTP request for messages and try searching, but there's no guarantee the last message will be included, so you may end up making multiple requests or give up halfway
After that, delete your message by ID and post your new message.
The nice thing about the HTTP solution is the data won't go stale, as opposed to the ID in the database pointing to a potentially deleted message.
Anyone know why my bot can't use this custom emoji in its embeds?
<a:Nine :937089466986819625>
There is no space between the Nine and the : just had to put that so you can see what I put
nvm fixed it 
I wasn't meant to put an A because its not animated
Hey how do i download an attachment in v12?
With the bot ofc
I can already reach the attachment link, but got no clue on how to write the attachment contents (it's text) to a different file (as i am trying to obfuscate the contents).
You can do a GET request to the attachment's URL with an HTTP client such as node-fetch to read it's contents and write it to a different file if desired
voltrex you are always helping! I appreciate you!
...still using v12!

Thank you for your appreciation, I like to help as much as I can
migrating takes 20 years and discordjs has many of these migrations
imagine using a lib that announces deprecation many versions earlier
and still tries to preserve methods to cause minimum havok during update
can't be d.js of course
Impossible to see on mobile but it looks like a base64 buffer
Decode the base64, then you get your image buffer
I don’t remember what it was in JS
toString() or toString(“base64”)
in node it should be Buffer.from("iVBORw0KGgoAAAANSUhEUgA...", "base64")
you have to remove the first part
not really. the breaking changes really weren't much from v12 to v13
plus at some point v12 will no longer work afaik
might as well just update to v13, that way when they eventually update to v14 and get rid of v12, there's less changes to go through
what I mean is, with d.js you have basically no means to stay in-between versions
like, with it something either works or doesn't
while the correct way would be support legacy methods and delete them ONLY several versions later
that's why "deprecation" exists after all
yeah
staying on v12 is more work than moving to v13 imo
no new features unless you want to use scuffed methods, etc
hey so im making a http request to bloxlink and im getting some errors with the parsing-- any body know what to do?
Error:
undefined:1
[object Object]
^
SyntaxError: Unexpected token o in JSON at position 1
Code:
var data JSON.parse(body)
Body is what was returned in the body of the http request.
looks like body is already an object, no need to parse it
undefined:1
<!DOCTYPE html>
^
SyntaxError: Unexpected token < in JSON at position 0
I just got this error.
oh
that is returning the html document from what it looks like
does this endpoint you're hitting have documentation?
wait
when i rewrote my code i made a typo in my link
ill see what it returns this time
that's probably the issue
the first time the link was alright
so idk
hm
it seems to be working now
idk what was up with the original code
when you send a GET request to a static site, it'll return the html document associated with said site afaik
you were trying to parse a string
or something similar
that wasn't in JSON format
yeah
if message.content.startswith("$help" or ".help" or "?help" or "!help" or "@help" or "#help" or "%help" or "help" or "^^help" or "&help" or "*help" or "/help" or "\help"):
well it works but only in first case how can i make it work in all cases
Is there any way to obfuscate lua code using node.js
use a command handler with aliases
instead of 30 logical ORs
No, it doesn't work in ANY scenario nor is it supposed to
that is so aggressive
and greedy
Just adopt a single prefix or let the user customize it.
Don't be so greedy and try to make sure it almost never fails.
Since there are other bots.
God forbid if u repeated that for every single command
bruh yeah
lmao dudes tryna use every char on the keyboard as prefix
is the dude gonna do that for every other command lmao
hey
Looking for help setting up a discord for a gaming type community?
any idea
fr lol
Just need hands to be fair
no idea i dont socialize
Someone Help me
Error:
TypeError: Cannot read properties of undefined (reading 'cache')[object Promise]
And the Code
let servidor = message.guild.id;
let evento = client.guilds.cache.get(servidor).roles.cache.get('931640452954853376');
if(!message.author.roles.cache.has(evento)) return message.reply(`${user} **Pelo vistos você não esta participando do evento!**`);```
because time is a bitch
and so are our planets
they suck at keeping time
leap days and leap seconds
ye fuck the earth right?
lmao
leap days and leap seconds are the least of the problems
new Date() lol haha so easy
precession, nutation, mean equinox, true equinox, mean time, apparent/solar time
@_@
julian / gregorian calendar
we should just base time off a universal constant and remove years and months and weeks
we could live on the sun but we choose to live on this green and blue rock
that'll probably disappear in the next millennium
thank god i dont have to deal with other cultures' calendars like chinese/hindu etc
do people even deal with time using those calendars or are they just for traditional stuff
yes
mostly for traditional and historical stuff
yes is not a valid answer to an "or" question
yes



