#development
1 messages · Page 1966 of 1
brings me back to the time i trolled a server by making a selfbot
was fun
the good old days
ef bee ai
oh it does actually work
(my real token lmao)
i'll try not to accidentally paste it
Hit enter just for fun 
I mean you can get most of the token anyways
i dont like how these tokens are partially predictable
they should be completely cryptographically random
its as if a discord developer wanted to make a cool token just for fun
It is really good actually
At some point discord just forces you to idk why
That’s how they are able to detect token leaks in GitHub and automatically block the key etc
Once a beautiful day discord showed the message something is strange here, please verify your account without any reason
like a string encoded in b64
No, they just want to provide useful information in the token.
i know all about signatures
the BIOS makes the operating system scan the whole ram for structures containing specific string signatures
no idea why they chose to base64 the string value of the id, instead of the numeric value of it
bc the locations for these structures are not standardised
the devs were bored
then again, a lot of discord is very inefficient
i noticed
ie guild flags as an array of strings instead of bitfield
as an os dev this hurts
as a performance nerd this hurts
but then they would be limited to only 32 flags
nah
51 flags
without the need for a "bigint" implementation
You never know what the drunk monkeys in the background decide to do
huh?
JS supports upto 52 bit signed ints
they already use string flags for roles
string flags >>>>> array of string names
well no other language has just 32 bits
because js uses double precision
the max sized int you can contain in a f64 without floating point error
53 for matissa 11 for exponent
This is what Lua does as well
why are we talking about floats
make optimising JITS much easier
all numbers in js are floats
No I mean't The Vibe
ohh the inefficiency
its more of an optmisation tbh
its simpler to work with, having all numeric values as a single primitive type
but i mean discord can also just make another bitfield like flags_part_2 if they need more flags
also
How do I make it add a reaction to my embed?
const Discord = require("discord.js");
const { MessageEmbed } = require("discord.js");
const { Color } = require("../../config.js");
module.exports = {
name: "server",
aliases: ["sr"],
description: "```Use this command to find out how to join the FiveM server```",
usage: "server",
run: async (client, message, args) => {
//Start
message.react(":blurpleverified:887569285537480744");
const embed = new MessageEmbed()
.setTitle('FiveM server')
.setColor(Color)
.setThumbnail('https://cdn.discordapp.com/attachments/919675664406315028/934924145655959592/FiveM-Logo.png')
.setDescription(` The Server is not out yet sadly but it will be out soon! `)
.setFooter(`Command Requested By ${message.author.username}`)
.setTimestamp();
message.channel.send(embed);
//End
}
};
whoops
sounds painful
that goes a lil beyond what would be considered reasonable
floats are a lot slower than ints
now you need to be aware of what flags part 1 and part 2 support
just do what they already do with permissions
depends on the runtime and optimisations tbh
its a bitfield as a string
in fact the cpu also has a dedicated float processing unit just for floats
In JS land the JIT is insanely optimised for Floating-point arithmetic
also, v8 does convert floats do ints internally depending on the situation
and yes it does depend on the language
for example when doing bitwise
my gosh be open for new stuff speedicus
but an api has to think on the behalf of all languages really
yes
and generally its the case of "does this work with JS"
because 99.99999% of the time JS is the special one with the number limitations
but does it blend? that is the question
nah, they can suffer
and i am very open to new stuff
but i'd like to think the new stuff works well
with no big caveats
(first time using that word)
I mean, JS having everything being a float isnt a massive caveat / limitation as many think
99% of the time your integers are bellow the bounds of a u32
99.999% of the time your integers are bellow 52 bits
and 100% of the time its easier to implement a fast runtime assuming one type for something than several types which could be interoperated
do be a yikes
and ive never heard bitfields with floats
50 times
first time hearing about them
I mean, if you've every used Excel then you have
everything numeric is a float in excel unless it explicitly goes beyond the bounds where it becomes a string.
but also you're thinking about it as if you're dealing with the floating-point rather than just some whole numbers which internally you can convert to a i64 but not expose that to the user.
You always notice if accidentally formatting the cell to be text only and wonder about the float which was a date, time etc. before 
lmao
my terminal just froze
probably gone beyond the range that a array can hold within memory
yeah uh bigints are a little slow
wouldnt that produce a 1gb long number?
lol
32 bit max number is only like 2 million or something
you also want to implement parts of your OS in assembly for what ever reason
doesnt mean you should
the only reason im making it is to have fun and make things
even if theres no use in them
2.3 billion signed
bigints are basically just a multi-part number in a big buffer
yeah what i thought
they are always good to have
its usually broken down in parts
you dont do it natively on the CPU
well yeah i know split into parts
you maintain an array of unsigned 32 bit integers (or signed sometimes)
and then apply a cascading arithmetic to the array
ah its easier to think of them in terms of integers
you also accidentally and ironically said the name of a 16 bit cpu register
thats pretty weird
or well part of one
ah?
lmao
i have no idea what those assembly instructions mean
yeah no idea why they named them words
You never know what the drunk monkeys in the background decide to do
Damn that fits on many cases
also guys when do you think 32 bit machines will be forgotten
just like 16 bit machines
I mean technically they already are starting to
when 64bit becomes faster than 32bit
there are still a few situations where 32bit native instructions are faster, afaik
its not completely obsolete yet
Wait until the timestamp exceeds the limit in a few years and all machines explode 
technically 32 bit apps also use less memory
that as well
if it's perticularly pointer heavy
embedded devices should be faster and more efficient as 32bit
apparently referencing numbers in the biggest chunks (e.g. 64 bit numbers for 64 bit processors) it is faster than if you were to store and process 2-4 byte numbers in memory and in registers
I mean they already
yes, for a large thing like bigints, the bigger the chunks the less operations, so its faster
my binary serializer also processes bigints in chunks of 64
well that depends more on memory alignment
then rip the device
i still dont understand how wrong memory alignment can completely fuck up cpu performance
what if you push a 1 byte entry to the stack
thats surely gonna fuck up the alignment
because every single operation in the chain would need to realign it?
but i dont get the need for alignment
whats so low level technical about them that makes them so crucial
assuming we both have the same understanding of alignment being aligned to a 16x memory address or something
the fastest cpu instructions work in chunks of X bytes right? like SSE AVX etc
so you need those chunks to fit the registers perfectly
with the graphics
so if you have arbitrary data like strings
its faster for the string to be padded/aligned so it better fits the size of those registers
yeah but i heard that if for example a memory address of a location is not divisible by 16 it will screw up performance
thats probably waffle now that i think about it
if you want to be additionally confused this is why alot of the time compilers allocate 1 Bytes for booleans instead of 1 bit
v8 for example aligns everything to 64 bits (or 32 bits for node x86)
well thats pretty much expected because i dont think you can make memory transfers less than a byte?
if you have a string of 18 characters, like a discord id
technically that takes 18 bytes
in v8 it takes 24 bytes
because its aligned to the next multiple of 8 bytes
everything in v8 works like that
because if you have fixed block sizes like that, you can easily calculate exact memory sizes and memory bounds
yeah its the classic "use more memory to get more performance"
but then going by that shouldnt c++ store booleans as ints rather than bytes
Tim have you observed anything like Rkyv in Rust which are true zero-copy serialization and deserialization framework?
nope
missing out 
looks interesting, but its something that is only possible in low level langs
js cant do that
instead im focused on how to utilize js in the most efficient ways possible
i managed to outperform msgpackr, the self-proclaimed fastest messagepack serializer for js
im also experimenting with storing strings as a pseudo utf6 i came up with
its slow af for large strings because there is no native api to help, but makes strings about 25% smaller most times
couldn't you take the brotli approach to compressing json where you store a local lookup table of the most common occurances like "} or ":"
that's specifically crafted for json? but I guess most content isn't repetitive enough for that to make a big difference unlike html or css
actually json as a format is highly compressible already
zlib often achieves reductions of 60-70% on typical json strings
a streamed zlib with shared context, like what discord uses, manages to reduce up to 90%
but zlib isn't aware of context right? Like the reason why brotli beats gzip for web stuff is its specifically for web assets
both are aware, they just work differently
I don't know a whole lot about compression so I'm just throwing stuff out there
brotli manages to achieve better results by using more memory and having a bigger context to work with, but its slightly slower than deflate at similar levels
for static assets, its recommended to pre-compress them
My understanding of brotli was that it comes with its own local lookup table for web specific things to compress without having to attach it to the message itself
could be wrong tho
it does have a few premade profiles yes, i believe
not sure what these profiles actually contain
I tried to implement LZW decompression a while back while making a gif reader but it didn't go too well. I should give it another go sometime
sure, data efficiency is an interesting subject
im not much into compression per-se, i think deflate does a pretty good job for my needs
im more into json replacement, ie how data is represented before compression comes in
yeah I don't think I'm going to invent a revolutionary algorithm people 800x smarter than me haven't already thought of
im working on a binary serializer that is basically a competitor to messagepack
which is also a json replacement
messagepack is already very efficient, idk why not more people use it as a standard
if the entire web got rid of json and started using messagepack instead, everything would be much more efficient
someone knows how works passportjs, express-session, cookieParser?
discord should add messagepack as a format alongside json and etf
\o/ Synonym support hath been added
I want to program a "redirect to previous page", but I have no idea how it works
All lib/authRoutes.js
var express = require('express')
, session = require('express-session')
, app = express()
, router = express.Router()
, passport = require('passport')
, Strategy = require('passport-discord').Strategy
, refresh = require('passport-oauth2-refresh');
router.get("/login",passport.authenticate('discord'), function(req, res) {
});
router.get('/callback',
passport.authenticate('discord', {}), function(req, res) {
console.log(req.session.redirectTo)
// req.login();
res.redirect("/");
} // auth success
);
router.get('/logout', function(req, res) {
req.logout();
res.redirect('/');
});
module.exports = router;```
you can use a referrer header or something
like when you click the login button, add a header containing the url of the current page
then redirect to that url
you could even do that in the url itself, plenty of websites do that
can you give an example?
hummmmm
i implement that in every login system i make
Probably means remove it.
how to permanently install a pip in replit
there is no "permanently" in replit cuz replit uses containers and it may resets every some time but you could use poetry add [package] to add it to poetry
ok
like this
poetry add discord_componenets
also help me with this please
because of buttons in py-cord
you dont need that if you use pycord alpha
using third-party components like that is not recommended
cuz it will get outdated
please help me with this
fake already shows you the problem
every interaction must provide a response
Watching his code again it looks like he placed it in the messageCreate event, regarding the defined trigger

Doesn’t make any sense at all
how do i make it so my bot dms the server owner
By fetching the guild owner, then sending a message to him
i really didn't get it
^^ on_message in py
when using discord.py
Ew
i recommend not using @client.event as that stops @client.command()
@client.listen("on_message")
async def idk_anything_here(message):```
better not use py at all 
true
discord.js 
or just get good
just use js
i have been converted
discord.js v13 
i can't really add slash commands tho because no one using my bot has application.commands setup
Tell them to reinvite the bot in the help command
Like a little section with a link in it
or just anytime they use a command say "we are moving to slash commands!"
but the users will ask why?
i have message intents
If u want to verify a discord bot u need to give a terms of service for the bot, does anyone know what to put in there?
Same
When nobody told me that and I kicked my bot off >100 guilds 
i should make a discord bot tos generator
Terms of service
ctrl c + ctrl v
heh?
Yes please
every existing one assumes that you want to make a tos for some website or mobile app
yeah
Lorem ipsum ipsum…
LMAO
and they have pay walls
Just write your bot's rules and what you aren't accountable for, even if it doesn't sound like a ToS.
Find some template and edit that with ur own info
Nah better use a template
allr
search in google
Just writing rules is not enough
and modify
I mean it’s not required to put your own tos in place
i tried nothing foond
lmao
None of us are lawyers and most templates include a lot of irrelevant info
bruh
just tos not discord bot tos lmao
i'm working on a templat enow
You are not? Pff uneducated bitch 
omg swearing
what then

Don’t choose Klay for it
pretty sure discord wont care anyway
yeah but you can't just write a tos and say "don't do shit and then I wont to do shit"
since when did everyone in this chat become a lawyer
you know what I mean?
what have I done with my 17 years
XXX ("us" or "we" or "our") owns and operates the XXX Discord Bot ("Bot"). The following Terms of Use (“TOU”) govern your use of the Bot.
Using XXX is at-will and can be terminated at any time by either us or you for any reason. By using XXX, you agree to be bound by the bot's TOS. If you do not agree to be so bound, you are not authorized to use the Bot. This TOS is a legal contract between you and XXX and govern your access to and use of the bot together with any services offered through the bot.
XXX is not affiliated with Discord in any way.
# Usage
The purpose of XXX is to XXXXXXXXXXXXXXXX.
The information supplied by XXX is provided for entertainment and informational purposes only. You agree that you will only use XXX, or data/information provided by it, for its intended purposes, and not for other commercial ventures without first seeking approval from XXX.```
there
Using XXX is at-will and can be terminated at any time by either us or you for any reason.
Yeah that won't stand any legal procedure
or copy paste the site aswell

That clause will just get you laughed at in court
is that everything it needs?
You may should read discords tos
yes
where
sure
No ads, no!
I am not a lawyer and I do not take legal responsibility for any bot using this TOS
naaah its "development"
ty
ik
looks cool tho
ever seen a short tos on a legit product before
Imagine looking at your wall asking yourself where your led panels are gone, looking at the floor and yay there they are

@marble juniper you wrote the privacy policy by yourself?
Not like that’s a big deal
yeah
This is mine.
# Privacy Policy
Assistant does not collect data or personal information.
well my bot aint a website
damn the tos and privacy policy is like 50% of the website
*our
Nope. Just Assistant.
I doubt.
you will need to state any data you collect
that includes if you store user settings for your bot in your database for example
Actually you don’t need to as long as nobody gets access to it
bruh
Yeah, and I don't so far.
Well that’s the true reality
What you should do and what you’re actually doing are two different things
Technically you also store any cached data as it’s written down in your memory
hey, on node.js it exist pm2, what for python?? to host a bot 24/7 on ubuntu 20.04
anyone knows?
Instead of relying on packages, setting the app up as service is the easiest solution
pm is a package you can install
nothing that exist for python?
Why shouldn't it work for py?
Define pipenv as interpreter in your config
?
Instead of stopping to read after reading the title, go on reading the documentation
should i install on the vps node.js and python right?
It also allows you to pass the interpreter as start parameter as I can see right now
--interpreter python
Any idea why this fails mid way?
Try python3
I made it and it works
Just gotta add other option fields and make an export feature
Gonna make a click to copy feature and export to url feature
I did this horribly, how can I summarize this?
if (sServer.id === interaction.guild.id) {
embed.addField(`${roles} Roles`, sRoles.map((x, i) => {
if (i > 10) return;
i++
return x
}).join(" "));
};
hi
what are you incrementing i for
array.slice()?
it changes on every loop
why are you using that
yeah you can use array slice too
.slice(0, 9)?
So i've noticed some bots display a 'loading...' like status when they are first booting. What is the best way to calculate that? Like, what events are fired in between the client logging in, and the client 'ready' event being emitted? (discord.js)
Try
Well, that's the method of the day.
I appreciate it!
Did I do something wrong here?
.addField(`${emoji_guardian} Emojis`, emojis.slice(0, 9).join(" "))
RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.
const emojis = sServer.emojis.cache.sort((a, b) => b.position - a.position).map(role => role.toString());
you can always just
[
array[0],
array[1],
array[2],
...
]
What do you mean?
idk
😂
let user = message.mentions.members.first() || await bot.users.fetch(args[0]);
if (!user) {
embedError.setDescription("❌ Please specify a user you are wishing to pay!");
return await message.channel.send({ embeds: [embedError] });
};
I have a quick question, when it comes to like these, how can I handle them? The !user is for the .mentions part, although what about the .fetch(), do I add a .catch()?
.catch(() => {});
What about something like this?
let user = message.mentions.members.first() || await bot.users.fetch(args[0]).catch(() => return message.channel.send("Invalid User"));
if (!user) {
embedError.setDescription("❌ Please specify a user you are wishing to pay!");
return await message.channel.send({ embeds: [embedError] });
};
You got a dark soul
no point
That would silent the error?
.catch(() => {}); will make user undefined
so then the code inside the if statement will be executed
I have dockerized my React App and I'm serving the static files from the build with NGINX. But the problem is it gives me a 502 (Bad Gateway) error... I don't know why. I have my docker containers behind a NGINX too but I think it's because of the one in the container
@boreal iron I gave myself motivation for a job interview
no job = cant touch os for a week
Finally I’m not the only one paying taxes anymore 
I paid taxes but my job was only temp
Yes give that OS a break
this time it's a permanent
bruh
that sounds more like a reward lmao
a vacation from the dev hell
lmao
thing is im addicted
it's like a heroin addiction
Once you pop it you can't stop it
Wtf thirst time ever I was trying to be serious 
until I die
Well in this case run out of things to add
I always knew you’re on crack
nice
now we know for sure
I have dockerized my React App and I'm serving the static files from the build with NGINX. But the problem is it gives me a 502 (Bad Gateway) error... I don't know why. I have my docker containers behind a NGINX too but I think it's because of the one in the container
just to confirm you've exposed the listening port in your docker?
don't use docker really
what port is docker running on?
real men use pm2
^
the container is on Port 100 and the nginx is exposed to 3000
so the main nginx is doing a reverse proxy to port 100?
yes
and the inner nginx is running on port 3000 and doing a reverse proxy to your react app's port?
I run "npm run build" in the react app so the nginx just serves the static files from the react build
oh my god
I'm stupid
lmao
I had nginx configs in the container pointing to Port 80... xD 
hi
is there a way that users can use /vote and then it votes on the website?
nope
ok thx
How can i generate the tsconfig.json file?
https://sourceb.in/JJ3mCucRyI
anyone know what can i put on .reply cause all cmds dont work cause of that
i tried interaction.channel.send but it runs the premium cmd too
and replies you cant use that
defer / followUp dont work either
how would I solve this :((
thats cringe ngl
i couldnt figure it out either, i had to google it =/
fail
Hint: the fastest people have to cross last
it is impossible :((
It’s not though
i would fail that interview as well
Same
yeah lol
well its those types of questions to see if you can think outside the box and come up with weird solutions to impossible problems
but its not like you're being hired to develop complex algorithms lol
some company just ask those question, but after all my work is just pasting code from stackoverflow 
algorithms and data structures
not the truth
goes back to writing if else
just a joke
did you really got declined?
yeah
“We judge your abilities by an obscure problem that will never have a real world use and if you cannot solve it, you’re unqualified and useless”
Ngl if they declined you for just that then you probably dodged a bullet
why is this true 
im never getting a job at a company anyway
Just work for Tim 😉
tim startup :D
do you freelance instead?
just be a sindre sorhus
basically yeah
and work on a few long term projects
that will hopefully make money one day
lmao
ask fake, he knows about my api
that is forever delayed and procrastinated
I wonder with what kind of key word u google tho
but during the process,its hard to concentrate ,since you are stressed
im a google master
i can find anything in seconds

tim has its own search engine
Pretty stupid interview question if you ask me
all interview questions are dumb but that one was especially dumb
they applied an actual brain teaser to a job interview
This is the shit my 8th grade algebra teacher would put on the board every Friday I stg
and the problem is
they work for the joker, who hired the riddler to make the questions
what were the other 3 questions?
Was it something you had to code a solution to, or was it just “solve the problem”?
No doubt the only people who pass that question already know the answer
Since it's very common
just solve the problem
no code
Lmfao
and the job was for programming/dev?
data struct, but for juniour
“You spent 4 years studying data structures in college? Here’s 4 brain teasers we got from Google in 30 seconds. Have fun!”
You spent 4 years studying data structures in college?
That's just torture.
I never felt more dumb than today
Personally I’d love to study data structures in college
me 2
I think algorithms/data structures are really interesting
I personally wouldn't want to do it as my driving force
In most apps you only use a few basic data types
Do the dirty work other people don’t wanna do 😈
and those special linked list deque etc is just once or twice or because some sleep deprived library dev thought it would be fun to return an immutable set
Lmao
I guess, I will go back with web backend dev
I don't belong to a big brain position
Don’t let an interview bring you down, those are stupid questions anyways
You’ll find something else somewhere
yeah
x to doubt
I hope so
you find those dumb algorithm and data structure questions everywhere
Yeah but I don’t think I’ve seen something quite as dumb as that though lol
i dont know exactly what they mean when they say "data structures", but figuring out how to store dynamic data in a buffer is quite interesting, been doing a lot of that lately
robin hood hash tables are really smart
I can’t wait until I’m done with high school 
but I don't think in dev process, there will be a problem like that
or stupid like that
Apparently my high school offers a data structures course, which I will gladly be taking
pray it's not in java
It’s in Java

All the classes here are in Java
your poor soul
Java is kinda good, but old
High level programming languages are trendy
Oh yeah they always use outdated Java
and a lot of the recommendations are terrible like using Math.random instead of the Random class
I hate writing out the full types
And not just using var
Since it doesn’t exist in this version
Lmao
lol
js best lang
Memory management is something I’m also interested in but neither of those languages really goes too into depth with that
:^)
-XX:+UseZGC. and see the magic
Yes but I meant managing memory manually without a garbage collector
ah
just use Rust 
Rust is cool but it’s still fairly young
Pain.
I mean it's only really going to get bigger
I think it’ll grow in popularity more and more
then it'll become stainless
It's stapled itself pretty well into the ecosystem despite stable being only being 6 years old
pov you use rust
can't find a suitable image
pov you say typescript is the best and you're not a good developer if you don't use typescript
happened btw
REST APIs are just operating systems in disguise
this is the only safe channel
heck #site-translators is even less reliable
Rust is amazing 
rust is rusty
how would i replace all new lines (from a textarea) with <br> with js?
- Set channel ID's when the "set-channel" command is run
- Logs server IDs on join and leave``` turns into ```- User ID's when blacklisted - Set channel ID's when the "set-channel" command is run - Logs server IDs on join and leave
so i need to replace with <br> because html go brrrrr
i'm pretty sure you can do this with just css
can't find it
right now
but i remember there being a way
but with js it's just using replace()
Replace \n?
Or just replace - with <br>-
found the css way, white-space: pre-line;
?
lmfao my CS teacher wrote some code to mess around with us
public boolean equals(Object other)
{
if(other instanceof BankAccount) {
return ((BankAccount) other).getAccountNumber() == this.accountNumber;
}
throw new WhatAreYouDoingException("What are you even doing???");
}
}
class WhatAreYouDoingException extends RuntimeException {
public WhatAreYouDoingException(String message) {
super(message);
}
}
Looks perfect
I see no issues here
Replit for java?
Btw misty, how's it doing?
Can't imagine how shitty it is to run a java program there
Hello, so I am trying to set the font for my site's header to Consolas, and it works on desktop, but when I visit the site on mobile it shows Times New Roman, does anyone know how to fix this?
(Site for reference: https://runs-on.tech/)
^
Or add consolas as a site asset
I tried looking for a cdn that has it but I couldn't find any.
Hm, that sorta seems to fix it.
Setting font family to monospace will pick the first available monospaced font
If u want it to use specifically consolas u need to add it as an asset
Okay, thanks!
Yw
I'm doing ight hbu
What maven issue?
@lyric mountain Instead of a discord bot i decided ima just make an api 
so, if your bot is sharded. do you call client.user.setPresence from each shard, or does your shard manager handle that?
tbh, i really should just shard a bot and tinker lol
You call it for each shard afaik
yea seems to be that way from my basic tinkering 🙂

if i use client.channels.fetch(some_id), would this return a channel object from a channel handled by another shard? it seems like it does, but i figured i'd ask incase anyone knows for sure 🙂
like, it'd make sense that it does, and i feel dumb for asking... but yea...
why are u ternary'ing a boolean?
also couldn't u pass the message id as a function argument?
it fetches the channel from the api
the api doesnt care about shards
any shard can fetch anything
read this
well i still didnt get to know how do I add tags 💀
i got it
finally
thank you
hi how much is the message delete limit?
If you mean bulk delete it's 100
$2/message
:cringe:
how much time do i have to wait between deletions?
or just so many stipulations that I can’t delete more than 100 at a time
Why is next.js middleware so weird? Why are they ran in a different runtime? questions that will never be answered
yea this is why i felt dumb for even asking lol
figured it doesnt hurt to double check though 😄
hi um. is absolute import not supported anymore in typescript?
like short imports. something like
import x from "../abc" -> import x from "abc"
I even set the baseUrl in my tsconfig file and this seems to be working on windows but not on mac
this my tsconfig file
How to check if bot on the server by ID? I using D.JS
Probably by fetching the guild member object using the user ID
Your bot needs to be in the guild, too
no, I have a guild ID and I need to find out if the bot is present on this server
I solved it by fetching all guilds
(await bot.guilds.fetch()).has(req.query.id)
Guilds are usually cached even if they’re unavailable
no idea, but even if it worked its not a good practice, because in node for example, "abc" would mean a library in node_modules, not a file in your root dir
Fetching with a no access error will tell you your bot isn’t in the guild
i see
its better to always use relative paths if you're looking for local files and not modules installed by some packager
it gets messy tho when you have deep imports tho right?
Are you using react>
I mean typescript
nodejs ts app
use the paths option
yeah tried that, doesnt work on mac/ubuntu
it works on windows for some odd reason
Fetch will check your cache in the first place.
Either you just fetch that server ID as single request or rely on the cache as I said above.
uuuh I highly doubt such a feature wouldn't work on macos
there's nothing platform dependent about it
try restarting VSCode
I think web3 is kinda usefull for user auth
let channel = client.misc.get(message.guild.id, "t2channel");
channel.send({
embeds: [
new MessageEmbed()
.setColor(client.settings.embed_color)
.setDescription(`Team \`${args[1]}\` has been accepted For : ${Reason}`),
],
});
channel.send is not a function

what is client.mics
it is isn't a thing
enamp data map
how u store it?
let channel =
message.guild.channels.cache.find((c) => c.id === args[0])
client.misc.set(message.guild.id, channel.id,"t2channel");```
misc ig here is a custom predefined property
that isn't the map syntax
and you can use client.channels.find(a => a.name === "t2channel")
if i will do console. log to channel then i can see id too
but you store it like map.set(key, object)
that api is deprecated iirc
channels.cache
it is not
<misc.set(string guild, string channel, string name)>
i t has cache and fetch
you can't access the collection directly
oh really?
that's v12 way
dude
i already mentioned them lol
nvm
moment
but I don't it will work
<Misc> ....
set(guildId: string, channelId: string, channelName: string) {
// ... some custom
<map>.set(`${guildId}-${channelId}`, channelName);
}
man you don't know what a preprocessor is do you
@compact pier look at this code
it comes from js
you can't pass 3 var in .set() function
in fact i can make it take 12 parameters and it still takes the thing
skill issue
bác xàm vl
i just said that it was "custom code"
well I didn't read that
dude did you even read
you do once
not every time that works
remember, when you pass an object like that, it has to create new instances of Object in heap
so it's not very efficient
hmm
there are many turnarounds
but in case of inheritance you can just extend it with new methods
and what is with 1002020?
to test data duh
yeah
wait u can't store undefined?
the question is, why do you even bother to do that
undefined is not a valid key
so is null
yeah

how can i verify the bot?
Heading to the discord developer portal, select your app and there you go.
It has to be in at least 75 guilds before a verification is possible
idk if this counts as development, but i need ideas for my economy bot
I'd recommend you read <#development message>.
You haven't given us much info about your bot as well
is there a way to refresh an interaction? I want to edit something past 15min and I still want to use the webhook part of interactions, otherwise I'd have to check permissions
I don’t think so
How about a button interaction after 15 min to have a new interaction?
Or isn’t that a thing for u?
That's not a thing
the user has to trigger an interaction
even buttons expire after 15min
the old way used to be looking for the channel with the system messages flag
There's no clear way to get the default channel in a server
Of course, you can try and match names, but it's unreliable.
It would involve looking in a guild's channels.cache and .findind channels that equal the name (e.g. chan => ["chit-chat", "main", "core", ...].some((c) => c.includes(chan.name)))
on new guilds, the default channel has the system messages flag
but names are probably better because permissions
Yes yes, I meant after 15 min editing your message adding a component, e.g. refresh
I mean I don’t actually know what’s your purpose
So I can just assume wildly
I think the real question is why are you still using v12 
Nostalgia
The whole interaction the buttons are attached to gets refreshed?
as in, I reply to a command interaction
Oh you wanna reply with a webhook after 15 min
Nope without a button interaction on your already existing response you can’t edit it
Only an user can trigger it after 15 min once again
son of a bitch
Yes you need to send a message to the channel or update your already sent webhook
(that should at least work iirc)
I'm a little bit lost trying to put your words into logic
so, say 14min after the user interacts, I send a followUp message and then just edit that?
the followup message routes in that instance would still take the interaction token which would be expired
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Yeah it needs to be a normal message to the channel after 15 min, it can’t be a followup message anymore
Yes the webhook token is expired
Then that would mean I'd have to check perms if I want to send embeds indiscriminately
Im not aware of a way to keep it active for longer
Hold on… what can you send an embed in as webhook without msg embed permissions?
Yeah. Webhooks are totally exempt from message related permissions
Oh how stupid am I…
I thought at least things like embeds would still require the associated permission
Nope. The point of application commands is to be as stateless as possible
nah, webhooks are basically the, "Look at me... I am the captin now." of the message world
My database has so many reads and writes related to roles and permissions, I'm surprised it hasn't exploded
lol
It would be nice if you could send pings to the API to expand that 15 min expiration then
ikr
What I can do is just stop editing and then just say that a new interaction needs to be sent and then assign that to the queue
The better question is why do you even need to edit the followup msg after 15 min

Why do you need to be different!!?
I edit it every 5 seconds to show a progess bar
you and your special use cases
Guess you gotta switch to common message handling then

Without webhooks
is this something any user can do?
wont that contribute to global ratelimits rather quickly?
Well. I have to do something to stand out otherwise
embed
NOW PLAYING: WHO ASKED FT (NOBODY)
NaN min NaN sec
is just generic. It's easy, but generic
whats the max time of a gif?
60 secs?
Aha I see API abuse, you devil
5 seconds was what I calculated to be very easy on the api and require an excessive amount of queues to be rate limited
I dont think gifs have a max length do they? 👀
No but probably a max size the uploaded has to accept
patch message requests are per channel anyways
50 webhook messages sent per second per ip right?
500 to hit the global ratelimit even if you do nothing else
since you could just use a gif to animate a progressbar
instead of editing like hell
I tried to do gif encoding, but that would be WAY too slow
?
I do gif encoding a lot on my bot, didn't see any slowness on response
I mean, as long as u optimize the gif
why don't use links from gifs,which are pregenrated like
2:00 gif
3:00 gif
Well you’re basically fucked and cant use webhooks here if you it takes longer than 15 min
That’s how it is
Each of these images are samples of encoding I tried. Each image is small in terms of dimensions, but encoding took over 30 sec upwards of 5 min in one case because I have to quantize because of > 256 colors
https://cdn.discordapp.com/attachments/599427914479566867/724897088483229696/profile.gif
https://cdn.discordapp.com/attachments/599427914479566867/724905879878500362/profile.gif
https://cdn.discordapp.com/attachments/599427914479566867/724903790700003358/profile.gif

