#development
1 messages ¡ Page 36 of 1

What does this mean?
{
status_code: 418,
status_text: 'JSON Parse Failed. Unable to parse response.'
}
I think you could have access to some if you just open your front door
It means exactly what it says
The response is not a valid Jason object
i literally fed him the literate instructions
i'm sure as the #1 programmer of europe, he can figure that out
xd
it's self-explained
What now. ;-;
You gave it something it couldn't parse
please dont objectify Jason
But why is the response code 418?
Probably invalid json
teapot json
I'm a teapot
You're American Misty
We know
instead of 400
I thought I was lesbian
418 makes more sense tbh
lmfao
no
Who doesnt love tea
no
This is not a valid code
It completely doesn't 
LOL
Discord api trolling on the next level, now with random status codes
@earnest phoenix
Youssef aaaa
looool
Sayuri you're confusing them

I feel like this channel just continues to dumb down
@earnest phoenix Can you read the docs link FakeE sent you?
don't tell me he Ctrl C - Ved
FakeeeeeeE
Every generation
đż
Whoâs this FakeeeeE?
Fakezepe

Fair, so if I'm calling a method that returns a promise, how am I supposed to parse it or whatever?
const a = await callingMethod();
await then parse
Await the response?
@earnest phoenix YO check this out
I think it even has example
you can do the
const data = JSON.parse(await GetJSONData())
Good
the ego is unmatched
I am an Arab
i don't care
Yo brother
at this point
I'm from an Arab country
hire someone to code for you
i'm sick of people asking for literal code snippets to their solutions
We now just need your name and credit card information to verify you being an Arab please
Soon as flaze found out he was Arab he called him brother
Ok
Comradore at it's finest
he's not willing to code
It's hard for me to translate all your messages
Alright, but it returns this error: https://cdn.hamoodihajjiri.com/XNGeSjG9cy .
it has exceptions
Soon I will record the docs as audio and charge 0,99ct to listen to it for anyone being unable or lazy to read
you can wrap it in try catch
But donât my idea please
I will your idea
i will your intelliJ
try {
let lookup = JSON.parse(await myMethod())
console.log(lookup)
} catch (error) {
return console.log(error);
};
{
status_code: 418,
status_text: 'JSON Parse Failed. Unable to parse response.'
}
This is the error it returned, lmao.
that's API error
Oh, fair.
wait it didn't hit the catch
Make sure you're setting the correct headers
I don't know the schema of your API but yeah
Why must we use webhooks for vote events instead of actual events. ;-;
Because youâre not supposed to open a permanent socket connection to the API endpoint but instead the API tells you when something is happening
Dictionary JSON API you mean?
He can just use an offline dictionary or a JSON one.
This dude provides a good dictionary, I suppose.
ooo ok also if i have a json object in the same directory as my main js file and i want to get the lol's property value, how can i do that
Using fs.
quick tip, don't use json for entire dictionaries
dictionaties are BIG (in capital)
you definitely don't want to load it all in memory
100,000+ plus.
then?
use a format that allows reading without loading the entire file
how exactly
like properties, ini, yaml, csv, etc
that way u can stream the file and store only the lines
because those formats don't need to be parsed at all (unlike json)
Basically a .properties file like:
happy=To smile and such, whatever.
then iterate over the lines to find what u want
instead of loading the entire thing to take a single property
How do I write a message in Discord?
you just did
đ
Discord settings > Advanced > Developer mode > Enable
Ok
Then use RMB on your name or others and select "Copy ID"
Thnks
Oh ok
@misty
did he leave? đż
@sharp geyser I've been watching hajime no ippo since yesterday I'm on ep 5 have u seen it? đż
Youll need to handle promise errors
hello, how can I add my bot site on top.gg page ? like mee6
https://media.discordapp.net/attachments/714045415707770900/1014202670233436170/unknown.png?width=1350&height=1290
iframe doesn't work because not enough character
@neat trellis i believe the owner used css to override their avatar on site
do you know how to do that?
apart from also changing the entire background to another color
Oh I just checked their page it wasnt a gif
its css animation
How To fix Promise rejection in Replit
await your promises and catch 'em
Can you Explain Properly
Command Not Found
You can do it, Tim, I believe in you
lmao
hello
I can't set iframe in large description
btw, you're aware heroku is terminating the free dynos option right?
one of my bots had a base64 image in the description and the mods approved it
and had a laugh
yes 
yes but MEE6 bot have an iframe:
because u paid 'em
styling and stuff
also, I believe top.gg requires https, another guy had issues displaying his non-ssl site
and probably a lot of CHARS of CSS to customize the iframe
how ?
which together is more than 200
CSS like I mentioned before
<style>
...
</style>
ocuh
</style>
kuhuwakabanku ... smh
hate html
using ivs?
Where can i get my topgg auth token?
on your bots edit page in the webhook section
Thank you
is the best way of checking for roles and permissions using an and statement?
or separate if statements?
neither, check for permissions only
or are u checking for a specific role?
Im checking to see if user has specific role and if so do they have the correct permissions (Like an upgrades version of another command - E.G: Premium bonus)
Can you send a DM straight after a channel message for warn? and if so how do you DM?
fetch the user, fetch/create their DM channel, and send the message
Be sure to catch all calls relating to DMs, as they can fail for a number of reasons
fr i wouldnât reccomend using dms. use ephemeral messages ;) people are starting to block incoming dms more and more bcs of scams
Ok!
It was for warn just incase they can't see it in chat as it uses embeds so it won't ping unless I add a followup to ping them đ
alrighty!
Would you say it is easier just to ping them?
ye
Thank you! đ
ephemeral messages = literal god send
Thanks!
How would I make it ping them?
like this: <@${member.user.tag}>??? It sends the user tag but doesnt ping have I done something wrong?
hi guys how are you? I have a question for you. How can I pull the total number of voice channels my bot is connected to? My bot is discord.js v14 and I found the client.voice.adapters function for this issue but I couldn't get it to give me a numeric data. Can you send me a sample code?
I use V13 sorry.
np â¤ď¸
Use the id, not the tag
Do you know how for v13?
<@${member.id}>
Thanks!
Thanks!
â¤ď¸
I am having a look on the guide now for you!
uw thanks
Can you add me, i am going to send you the script so you can DM me if it doesnt work (This is one not on the guide as it doesn't have one) as I got to sleep
oki
Would be even better if u could send without interactions
How would the server know which user to send it to and if they consent to receiving such messages
would just be complexity and the solution for such a thing is DMs
Nope! <@${User#id}>
if using js
idk about py or other langs
I mean, u already need the channel to send normal messages
could be just an extra field for user_id
now how about if they consent to viewing such messges
Yeah I feel like that could be abused easily
ik, that's why it requires an interaction currently
but tbh, the user just needs to change channels to remove all eph messages
they could add another button to the eph that's "Ignore messages from this bot" or something
so more of an opt-out
I'll refrain from sharing my input
if u really want to troll someone u can always just spam normal messages
peach
The top on is a hyper link to a route to view the channel they're active in
hm, the font might be too small
this image is of /channels/:channel_id
https://cdn.discordapp.com/attachments/485665973643378698/1012593484433199164/unknown.png
way too small
How do you style form buttons
css?
Oh. You can override images with that?
maybe I'm misunderstanding
I'm kinda new to html and css
search "html buttons with images", there are good examples of it

was what I was gonna do. Just needed feedback telling me to do so otherwise, I'd be content with basic programmer "art"

how so
idk, both have the traybar at the top, so ig it's that
nav bar
nono, traybar
or do you mean the box where it say welcome back
imagine not having centered taskbar icons
I wanna add a giveaway system to my bot tbh
nah, centered taskbar is for people who don't read docs

I read the docs, sometimes
omgomg @lyric mountain hear me out I think I just thought of the best, the most performant and easiest to code giveaway system
instead of storing every person that joins the giveaway
loop over every emoji
omg
like
that's perfect
u can get each person like that
without sacraficing storage at all
that's uh, the default way of doing it?
... it is?
were u really storing them in arrays? lmao
well yeah xd not plain though, having some kinda db like mongo or sql
but yeah now I'm def gonna do a giveaway system
u only pull them into an array when ur done with the giveaway
so u can process and select someone
yeah that's what I was thinking
I do have a question though
how would you tell if the giveaway has ended
database
I know that, but how would I actually tell in code
an interval, timeout?
both would work but they don't seem efficient to me
cron
cron is literally made for periodic tasks
u just make a cron that executes every minute or so to check if any giveaway expired
I'm gonna sound stupid, but what is cron
search
I did
no u didn't
I did, indeed, truly have googled it
gonna have to work out how to use it first cause it's gonna be my first time tho
I mean, it's the best way if u plan on making future periodic checks
the same as setInterval but for linux itself
there are cron libs too
that's why I said I could do it with setInterval
yeah but you dont necessarily need to use linux cron
but setTimeout also works
you can do it in pure js
but prolly not for a long period of time

linux cron is called crontab no?
Yes
crontab is the editor no?
plus cron has the advantage of being adjusted to the clock, not to the time of start
The service itself is just called cron
cron libs use it internally
which is actually a disadvantage for discord because timezones
not if ur running on a per-minute basis
timezones only affect hours
cron is already running, so u can just hop on the scheduler train for ur own tasks
i use node-cron for cronjobs in nodejs 
I probably would 
anyway the standard js way of doing it is to store timestamps in the database, then use an interval to check for "expiring soon" and create a timeout for each expiring soon item found
I wanna do it the lazy way and set up an API payload on some remindme website
could that work? 
/facepalm
I'm not sure about cron
considering it's bae, they'll somehow manage to hang the process using interval/cron
If you wanna start and end giveaways dynamically and not with the same frequency globally you will have to use a database storing the timestamps and timeouts
I'm fine with doing that
just need a way, a simple way to know when it ends
cron doesn't sound simple, doing a task every minute sounds performance intensive kinda
eh, once a minute for your whole bot is very little work.
i have like 100+ tasks running ever 5 mins lol
cron doesnât make any sense at all
Try to think about it before doing things
Starting a giveaway is a one-time job with a fixed ending date
Not interval/repeating frequency thus cron is non sense
Unless you plan to have a static giveaway ending for example once a day or week, using cron wouldnât make sense at all
Even then an interval would make more sense
I'd use a single-global per-minute check to check every single giveaway expiration
instead of many one-time tasks
youâre saving a date time in your database, loading it when the app starts and calculate current time - timestamp to get the interval in seconds (for example) when the giveaway ends
Canât be easier
using cron can be useful if youâve some sort of requirement system in your bot and need to validate requirements every x minutes
I restart my bot once a week?? what if someone sets a giveaway to 1 day that doesn't make sense
This, I recently changed my reminder system to do this instead of thousands of timeouts
even tho i donât use cron cuz dpy moment
plus u don't need to recreate tons of intervals on every restart
Yeah
oh wait I acc already have an interval on startup
it changed the bots status
I could use it I think
I would have to store more than just the date tho
Yeah on a larger scale I would t recommend 100k timeouts for 100k running giveaways, too but for his case itâs enough
unless u change bot status every minute, it'll not be enough
I would have to make a custom ID for the giveaway, store the guild, members and other stuff
every couple hours
...ur not changing bot status every minute are you?
not remember how muchI think 6
that's by far too big for giveaway tracking
then what am I supposed to do đ
well it could be used to load giveaways that are soon to happen, then set an interval.
:[
or just add another interval
but I would have to disable that interval
well i just keep the giveaway inside my config/cache until it has ended so
timeout* not interval mb
timeouts doesn't work either
if u set it to longer than a day god knows if it'll work or not
You see an issue here? I do, too
btw can i know what language youâre using ?
the guy you're replying to was talking to me
lmao
Nope
hella weird convo
oh wait my b đ
Receiving interactions?
It has a locale / guild locale field
*property
nah i was asking what language theyâre supposedly using to code their giveaways bot or and what lib or is it just raw api
lul very bad idea
Yeah Baes code is known to be unique
I think I'll make my own API for this with it's own DB for this
I don't wanna make even more mess in my bots internal DB
lmao
python is the best language for making advanced giveaways cog, prove me wrong
the issue will still be the same
Can only quote Timâs reaction
but I can freely put as much intervals as I want there
/facepalm
I mean, so you can with your bot
if the api gets slow, its responses will also get slow
the api will be a whole new server, with it's very own set of specs so it won't get slow
I think
doesnât makes sense, just adding a couple of intervals wonât make your bot go slow, only blocking or bad code would do that
if its made properly it could handle millions of giveaways at once and not get slow
exactly lol
only blocking or bad code would do that
...it's bae

You mean timeout?!
but
I'm scared the timeout will just stop working like it sometiems does with my mute command
and giveaways are way more important
lol they arenât suddenly stop working
intervals are just timeouts set to call themselves afaik
usually if I set a timeout for longer than a couple hours it just magically disappears and never executes
if you're having reliability issues with timeouts intervals are the same thing
code properly and youâll have a bot which will handle giveaways with that many entrants with a validator running every 3 seconds which is removing reactions from users whoâre blacklisted and giving extra entries to people with multipliers and much more 
emojis gud

I'm also going to use emojis for my bot
because instead of saving all the members who joined I will instead loop over every person who reacted
meh not a fan of buttons or components or any of the new bullshit discord introduced
he's like me
but I actually started using buttons a lil
have it in a couple of my commands
still not gonna use slash commands though
i have buttons in some parts of my bot but not everywhere so
same
Actually those features are the greatest they introduced yet
If they would only compete em
and i honestly think having emojis in giveaways give me more control over it
yeah buttons are okay
just the functionality a bit off, a little bit
I would love the button to not fail for once when I don't reply to the press in 0.5 picoseconds
cuz thatâs the level of customisation i have in my bot so
buttons are lame for me
imagine flexing
I can't even read the screenshot cuz it's too grainy
like bruh đ
my internet isn't that slow
or windows client moment
Fully rendered and sharp for me
discord web and discord pc client shows mobile screenshots as grainy at times
it's actually faster if u get closer to the router, I don't use cables and my room is far away from it so
but tbh you need to see how codeblocks are represented on iOS
Especially on mobile the cdn often seems to have issues delivering content
I wanna see
I was planning buying the iphone 13 soon
just as a flex, ofc I would keep using my samsung
I will never get why thereâs not even syntax highlighting
lmao ikr, and the boxes look shit
swift doesn't have regex and mobile discord uses regex for syntax highlight
discord iOS client is the worst so far
Discord is just not made for people sharing code or using code blocks for their original existence reason
they had a different purpose đŽ
well good thing discord has non-gamers now else you wouldnât like the way it was when discord just started
Not really, compared to android itâs way better
Except syntax highlighting
cough
does ios have modals?

:]
Of course
whatâs not to have modals?
Why shouldnât it have them
idk I just assumed it didn't because of how badly yall were hating on it 
iOS usually is pretty much up to date
thats just directly linked to the discord UI itself
I honestly made only a single ios app in my entire life
nah mate i just hate the codeblocks iOS have
also ios doesnât have the codeblock symbol so
and it was because I jailbroke it because I wanted to intall cydia
makes sense why codeblocks suck on iOS
The are bad on every mobile tbh
I told u why there is no syntax highlight on ios
and It's acc a fact
yup, no ansi support = shit
I hate that
The possibility to open them fullscreen, maybe even scrollable with syntax highlighting would be neat
God save us for people using ansi colors in code blocks
you would cry if u saw how I wrote syntax highlight for my ide
Highlitr or whatever it was exists which has a total of 30+ syntax highlighting languages so itâs just discord being lazy or some other bullshit
I wrote it in java..so u can imagine how it went...
probably
Well looks how frequently discord releases stuff and what it usually is about and you know why that wonât become a thing soon
well tbh i donât expect anything from discord after this happened to me https://github.com/discord/discord-api-docs/issues/5253
no response been 2 whole months, the slash commands still wonât show up tried every repro i could
script
itâs either something fucked up with discordâs backend or some sort of bullshit slash commands restriction discord has that i donât know of
I wanted to show you how it looked but I can't find a screenshot anywhere
I did find a screenshot on some other app I made tho 
I'm not showing it cause it's actually cringe
I mean to mention it like a 100th time, see when the message intent is enforced along with interactions and note that basically nothing has changed the last 6 months except localizations.
No new field times, very basic and limited modal support, an horrible slash command and their options UI, no multi line support for arguments etc etc etc
I wanted to make an app like CPU-Z
Not much to expect from discord
for real tho
even after 2 whole years of development slash commands are still a fail
failure moment
omg.. bro
ur the first person that agrees with me about slash commands
Not really but they at least missing lots of requested features
But since then we got like 100 new nitro features
that should be telling you something
discord just loves to update things about nitro
well thatâs actually the whole discord.py community not only me
oof I found an old screenshot of the main menu from my game
it actually looked pretty decent
specially i hate the 100 global slash commands limit, my bot has like 1.6k commands with more than 131 categories so thereâs no way i could fit them in slash commands even after using sub commands bullshit
I...think I saw a title like that at something hub
Yeah. But with the way discord is pushing interactions. I donât think thatâll change

it was an ambitious project
I worked on it for a whole ass year
i agree ephemerals are the best thing discord introduced so far, but slash commands? hah
slash commands are just a joke to me
the longest project I've ever commited myself to doing
I donât really see disadvantages to common commands especially when it comes to remembering the names or possible options
Yet yes the limits suck atm
And the missing features
Also the fact that an executed interaction can always respond and doesnât have to care about permissions, not to mention ephemeral messages
Im obviously not
iâll shift to slash commands only if they add auto command syncing inside the api, and remove the limit from both global commands and server specific local commands, and also if they change the slash commands responding as webhooks, that shit changes alot of things for me ffs
But Iâm well aware of the missing features and limits as Iâm using them since they exist
like why in the hell are the embeds executed by slash commands considered a webhook???
whaat
yeah and iirc bots canât read webhooks
Responses as webhooks are a lot easier than common messages especially regarding permissions
agreed but that does changes a lot for some developers
For example?
like how dank memer shifted to slash commands? i had some utility cogs related to dank memer which used to read embeds/messages from dank memer to work
so guess what
those wonât work anymore now
and thereâs no other alternative to that cuz bots wonât even read webhooks
Sounds like a very specific edge case for me
yup but thatâs one of the reason for my botâs growth
and tbf my bot was the only one with those functionalities
so fy discord you just changed shit for me
dank memer acc broken asf for me
almost no commands work for me
it just says that the intercation failed
well i donât even play dank memer but those commands were what made my bot get into some large asf guilds
I mean if some other bot which data you scrap doesnât exist anymore or changes how itsoutput is youâre also fucked
Like I said that sounds like a specific design risk you take not a disadvantage of interactions
and there are some other bots with edge cases like mine, like if karuta shifts to slash commands, my karuta utilities wonât work anymore and kequing and a few more karuta utility bots will have to shut down cuz all they do is read data from karuta
not really cuz it was working all fine and perfectly until discord introduced slash commands, and people really liked those commands so
I mean thatâs a risk you take relying on data of others tbh
and then on the same time thereâs not many bots that do that so
gotta give me a plus plus for even having them
iâm just tired with having regular commands so
boring aaaaaa
also bots are not the only thing getting effected by slash commands
I mean itâs also design decision
You can also respond with a message to the channel as interaction response when still being connected to the gateway
But thereâs a reason people arenât doing that, usually
like i personally hate /slash commands so if some bots shift to slash commands ill just stop using them and most likely some other people too
Well thatâs always what new features comes with, some hate it some love it
only if i could mark bots as favourite inside the slash commands menu, i wouldnât have to deal with tons of things showing up
not to mention slash command menu is buggy asf
true but in case of slash commands i donât think many people appreciate it, buttons dropdowns context menus modals are the interactions pretty much everyone loves but slash? idts
You need to see things enveloping into some sort of standardization
To get rid of 50 help command sites you have to remember, different prefixes people choose for bots etc
It actually makes the usage a lot easier for upcoming generations and new users if anything is visible and available in the UI explained with descriptions etc
i mean discord could have kept choices for both slash and prefix instead of explicitly getting the message content intent
well it can actually be nice/easier for new users
Well donât forget that slash commands are just the result or letâs say a requirement for the message intent removal
There are very good reasons to remove general access to any message content
thatâs true as well tho less sussy bots collecting data
I have a complaint about rust
I want to be able to pattern match u8s with fieldless enums that have #[repr(u8)] on them, but I can't because rust doesn't work like that :C
the syntax is just fine
Ok drunk boy
It's a little different without parenthesis but I got used to it
this is my complaint rn
rust is a sexy language and I can already see it being the next big thing
I don't think you're using repr correctly but don't know how to describe it
I am
It would improper to use it if I had fields tied to the enum variants
But since I'm just using it as a numeric representation I can use repr u8 just fine here
To my knowledge, repr is for communicating with C.
I think you can take the enum variant and cast it with as u8
Not always
There's #[repr(C)] for that
I'm using this to represent 1 byte opcodes
Canât get comfortable with that syntax
Had to finish some bash coding yesterday and tbh itâs like the same pain
Maybe itâs just me refusing to get in touch with new things
Idk
But I dislike it
boomer
needing help with astro.build
will send context
its hard to explain lmao
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400">
<span class="font-bold">Evidence:</span> {report.evidence.map(evidence => `<a href="${evidence}">${evidence}</a>`).join(", ")}
</p>```
I have an array of evidence, how can I make each one a href dynamically
making progress
<span class="font-bold">Evidence:</span> {report.evidence.map(evidence => (<a href={evidence}>{evidence}</a>)).join(", ")}```
ok nvm fixed

Guess who's back
back again
Why
Can't you just use as ReprCode
or if you still can't just use good old transmute 
GAMING
transmute 
go for unsafe
stop being a safe supremacist
i use unsafe everywhere in my Rust code
Not being a safe supremacist, the idea of using transmute for such a trivial task is unappealing to me
Think about whatâll happen if I transmute an invalid opcode
Tons of wild shit and/or a segfault
But the byte code file is not user controlled, no?
Unless it is corrupted which is highly unlikely
Not necessarily, but I donât think you should be able to cause the entire compiler to fail if you manually edit the bytecode to fuck around with the VM
And/or cause UB with weird transmutation casting behavior
Why would someone manually edit the bytecode file
To try to confuse the VM
bruh
Iâm just now realizing how the hell am I gonna make a Constant instruction if I donât store the constant in the bytecodeâŚ
then your only way is to use constants, literals, or macros
can Rust macros do like C's #define A B?
I mean sorta but Iâm sure youâd have to make your own macro for that
Macros can be used to edit the syntax of the language to a certain extent
Pretty powerful stuff
Procedural macros?
which one are you referring to
macro_rules!
macros do rule
umm how do we do this this ?
You don't, it's automatically done by Discord for all Discord bots that have slash-commands, currently Discord does not allow the developers to control it yet
Soon:
âwhy bot not working anymoreâ
âno I never received any notification from discordâ
Are you prepared? 
Why does my bot tell me it needs a "message content intent"?
Starting from <t:1662031440:D>, Discord has made the content within messages a privileged intent you ** are required** to apply for if your bot depends on it. You can read more about that change here.
To avoid our channels being flooded with said questions, we would ask you not to ask questions regarding the intent within this server and ask in discord.gg/discord-developers instead. Thank you.
good
and then update the title for each day 
Bot not working anymore but it was <t:1661983140:F>

the only reason we're here
#play friends
My pandez bot no command for verify and another bot too, any idea?
Bots just blank in my account
this isn't the bot's support server, you're probably wrong here
Prepare yourself
anyone know why this returns NaN?
what in the
for one, asin will return NaN if its input is outside [-1,1]
probably that
also fyi https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random
The Math.random() function returns a floating-point,
pseudo-random number in the range 0 to less than 1 (inclusive of 0, but not 1) with
approximately uniform distribution over that range â which you can then scale to your
desired range. The implementation selects the initial seed to the random number
generation algorithm; it cannot be c...
I wanna get something from a seed
nope, still NaN
that is true yeah, doesnt support seed
there are probably others too
check all one by one
just check the ranges supported by all of those functions
Youâre probably hitting an asymptote of one of the functions
Or outside of the range
asymptote should output infinity and not NaN right?
function rand(x) {
const i =
Math.sqrt(x) +
Math.cos(x) +
Math.tanh(x) +
Math.hypot(x) +
Math.trunc(x) +
Math.log10(x) +
Math.log(x) +
Math.cbrt(x) +
Math.log1p(x) +
Math.sin(x) +
Math.clz32(x) +
Math.acosh(x) +
Math.imul(x) +
Math.fround(x) +
Math.log2(x) +
Math.tan(x);
return i - Math.floor(i);
}
```well, if it works, it works
i dont know what you plan to do with this
but you should see if it actually works with the values you might input
it also has an average of 0.500327971121153 xD using: ```console.log(avg(Array.from({ length: 1000000 }, (_, i) => rand(Math.random() *100000000))));
Just so you know this isnât random
discord is kidding me right?
no fckin way they added yet another thing to add notifications marker
tf is that for
yes
I had
to clear my
100 friend requests just so I can do top.gg

plus entirely disable friend requests
i dont get it, wut am I seeing wrongly on that pic?
except the dudes premature name :P
"Message requests"
I don't understand your weird language in that image, that's why I ask
like in skype, the first message requires accepting if the user is not in ur friends list
so now u can be notification-spammed from people sending messages without being in ur list
so... you can yet send a friend request and 1 message (probably as reason to accept)?
nono, they're separate
but they need to send a friend request to you or not?
separate things
it's like requesting permission to talk with u
not necessarily becoming friends
Hello, as seen in the ss, there are two bot category. Normally, what should happen is that there should be a category called both bot and info. Could you help?
My Code:
const categories = readdirSync("./commands/")
embed.setDescription(`Hello! My name is **Voisy**
Welcome to my help menu. I'm here to help you with your server.
My Prefix: **${prefix}**
Total Commands: **${client.commands.size}**`)
categories.forEach(category => {
const dir = client.commands.filter(c => c.command.category === category)
const capitalise = category.slice(0, 1).toUpperCase() + category.slice(1)
try {
embed.addFields(
{ name: `${capitalise} [${dir.size}]:`, value: ` ${dir.map(c => `\`${c.command.name}\``).join(" ")}`},
)
} catch(e) {
console.log(e)
}
})```
categories are supposedly unique
yeah I got that, but still they HAVE TO send a friend request to you BEFORE being able to send the message to you?
no
wtf
how so?
if you have two categories with the same name, they aren't really categories
also, don't use forEach
I have two categories, both with different names.
I'm trying to creating an online flappy bird where other players can see other players. I need a pseudo random number generator to generate the same height of the tunnels on the browser. While I can also use that to figure out which people is on the same map.
What would you suggest I use?
cant u just use a seeded random generator?
for (category of categories) { ... }
Let's try..
I can, but I want to keep my script from other scripts not created by me
wdym? like, it'll basically do the same
a seeded random generator will always generate the same sequence of numbers
I tried and same problem persist
show ur /commands folder
Oww, I entered the name of my slash cmds 
Now it shows the command in the info category in the bot category.
I did
Thanks for help
before continueing, are you aware that the message content will be a privileged intent tomorrow - means you dont recieve the message content anymore?
If you plan to verify your bot (in the future) you should already start try to deal with application commands aka slash commands
The bot supports both message commands and slash commands.
How can I prevent this?
https://cdn.hamoodihajjiri.com/usMkLny7nH
https://cdn.hamoodihajjiri.com/Z8kj1gX7Fg
It gives this huge void which I guess is on purpose from the way I coded it, but what's a better way to do this (if I have like 200 lines of html code).
res.send(`Welcome 123.\nSomething another 321.`)```
oh
mb just read the second bit 
I believe js multiline strings don't work like java's multiline strings
\ apparently works?
actually, I think the issue is that ur string quotation is behing the text
So if I have 200 lines of html codes, I need to keep using \n.
try unindenting the text to see
that's not necessary
o
`` already escapes newline
i've done that as a solution myself before and it worked
try removing this space
I mean it give you exactly what you entered, two new lines and two tabs in front of your lines
if it works like java multilines, the last backtick marks the "zero" coordinate
in your example yeah, but not as he did it
res.send(`
Welcome 123.
Something another 321.
`)
or ```js
res.send( Welcome 123. Something another 321. )
Looks ugly when it comes to organisation, unfortunately.
but does it work?
Yes, it does.
btw, if u want organization u can just make an html file and return that
fs read into a string
a file
no
just the user ID
since you need an application to fetch the user ID to retrieve informations about an user
or by doing an unauthorized request iirc
it hard to fetch cuz lots of user are not available in guild or mutal server of application
then don't fetch, why do u need the tag if the user cant be reached?
if it's for vote storage, just store the id into the database
isn't the user endpoint "public"?
I dont think an user must be in a mutal server your app is in to be fetched
general informations like the name, discrm etc are public
iirc?!
I think u need to be in a mutual server unless u get the oauth2 scope IDENTIFY
so u can fetch the user info
I have my bot checking for a role ID to send on command execute,
E.G: If user === to early supporter role send you are an early supporter.
However it only works in the guild the role is from.
Code for the if statement:
else if (interaction.member.roles.cache.has('1011725327447363605')) { // Early supporter
const badgesEmbed = new EmbedBuilder()
.setColor(0x0099FF)
.setTitle(`${interaction.user.username} Badges:`)
.addFields(
{
name: '__Badges:__',
value: ':trestic: `Bot Supporter:` You have been amazing since the start, you are an `Early Supporter`.',
inline: false
},
{
name: '__Badge Information:__',
value: 'This command will show what badges you have. \n If you are staff you wil be displayed by your highest role (Highest = Mod then dev then support then tester.) \n :trestic: means you have used/supported the bot. \n :botstaff: means you are a member of the staff team for the bot. The highest role will be listed. \n :botowner: means the owner of the bot. (This is actually his profile.)',
inline: false
},
)
.setTimestamp()
.setFooter({ text: 'Š This bot belongs to Trexie. (Run /info bot for accurate tag and User ID.)'});
await interaction.reply({ embeds: [badgesEmbed] });
}```
it skips this in other servers and sends the else statement.
roles in different servers have different ids
So it won't find it from the server they have the role in? If they use it in a different server?
not from the code youve shown cause you've hardcoded the role id
Is there a way to make it do that?
it depends how you want to do it
you could make server admins set the role id through a command and then it sets a value in a database
It isn't like that lol- It's only for roles inside the offical support server, so will i need to rewrite it to check if user is in guild and has that role in the guild and send it?
ohh then yeah that would work
Ok is it interaction.guild.id.cache.has() to check guild ID?
no you should probably look at discord.js docs
I'll have a look, normally only use role ID and user ID .-.
the way i would do it is by fetching the official support server guild by the guilds id
then check through the guilds members for the user youre looking for
then if theyre in the server, check the members roles in the support server
Alright thank you, i could probably call the guilds ID from config.json
I'd instead use a database entry containing the user id
Relying on roles is asking for headache
I don't have a database.
You should
My host runs off 32 bits. Most databases Ive fund is 64 bits. I forgot to select 64 bits when I set it up.
I really need to set one up, just don't know which one to use.
excuse me???
How tf u found a host that still lives in 2004
But well, I'd start switching to x64, there's really no reason not to
Then u need to ask what you'll be storing, if u don't need high concurrency simply go sqlite
I selected wrong download size lmao. Imma update it soon, just need to backup the scripts to recover it.
Aren't u using git?
No.
Then start there
Just copy the files, reinstall the system, paste em back into the system?!
Raspberry pi.
It's 2022 fake, diskettes are no longer used as main storage method
Ok whatâs the issue then?
Use rsync for example to move your files over to your Pc
I'm copying files into my USB pen now, and uploaded them to github and i'll reinstall when I can.
Reinstall it, paste em and done
Don't upload using github, make a repo locally then push
Tf you donât need GitHub or git or any bullshit
Backup the files to your Pc or usb stick and move em back later
That's what people say moments before a catastrophic failure
Did people forget about thatâs a thing nowadays?
Yeah the common known cases of exploding usb sticks
You joke but many times I watched people panic as their "local backup" is no longer reachable
i'm storing it on github so i can get them easier if anything goes wrong.
Iâm not using any online service im sharing my files to for the past 15y and havenât lost anything yet
Make a local repo then push to github, its not only faster but also makes sure your gitignore is right
I donât know when people being stupid you canât do anything about it
If somebody deletes their GitHub files theyâre gone too
They can't really delete gh files without legal backlash
And well, it's Microsoft so gh won't go anywhere anytime soon
If I hit delete on something uploaded itâs gone
Idk anything about it
Umm ok
You gotta keep in mind not everything works with Microsoft products or products being linked to GitHub or whatever
So backing up files like 20y ago still is a thing
Which doesnât really make a difference anyways
How do you backup any file not being code?
Youâre one of that dudes storing everything only in some third party cloud service?
...u can use git to store common files too
And it doesn't even need to be pushed to remote, use a local git repo
Oof this is the next generationâŚ
Doesnât even know how to backup files without using cloud services etc
Canât write one sentence without using git or GitHub to share or upload code
My gosh
Hi
I backuped to the memory pen, but I use a private repo on github to store for worse comes to worse scenarios, to ensure I can still use the old scripts.
Calm @boreal iron soon the pain ends, when you reach your mobile traffic limit
Yes, I know!
Does anyone know which raspberry pi OS is better đ
Wut? Just download in install Raspien or RaspOS
Was is called like that?!
Idk anymore
You can also install Debian and start the pihole bash downloaded and installer to turn the device into a pihole
fake is literally
I got told Raspien is bad.
did they say why its bad?
If you wanna have a pihole then you will have to use piOS
Not sure what else you wanna archive
If not just install any other server OS
For example debian or Ubuntu or whatever
Lol
Soon im offline without internet, youâre free to recommend anything then without me criticizing it

If my isp continues to act like an asshole that will last a while then
we probably have the same isp
đł
I also have the same error, how can I solve it with the .set definition
show line 35 of loadSlashCommands.js
34> if(slashCommand.name) {
35> client.slashCommands.set(slashCommand.name, slashCommand)
36> table.addRow(file.split('.js')[0], 'â
')
37> } else {
38> table.addRow(file.split('.js')[0], 'â')
39> }
I don't know much about d.js, but I'm pretty sure that's not how u add slashes
is there a way to automatically enter a choice into a slash command string option? sort of like a default option
Make the option optional?
I submitted a bot and I want to add some images in bot description.Is there any html code I could use?
JustâŚuse html? You essentially have the solution in your answer :p
I mean html example code
Ok thx
I'd use markdown images instead of html tho
easier to type
unless u need additional styling

I will try both, thx for helping
well, hopefully you read dot error notation
Getting npm ERR! notsup Unsupported platform for esbuild-windows-64@0.14.54: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"}) 21:07:14.840 on both CF pages and Vercel 
not sup đ
idk why vercel doesn't tell the error message on the dashboard lmao
Hey! I'm wondering how to convert a number that has been send from a array into a string, so instead of 5 it will send wht 5 is E.G: yes
so you want the number 5 to turn into yes?
Kinda yeah, I'll send my script.
const { SlashCommandBuilder, GuildMember} = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('8ball')
.setDescription('Ask a question and 8ball descides your answer.')
.addStringOption(option => option.setName('input').setDescription('The question for 8ball.').setRequired(true)),
async execute(interaction) {
let answers = [
'As I see it, yes.', //0
'Ask again later.', //1
'Better not tell you now.', //2
`Don't count on it.`, //3
`It is certain.`, //4
`Most likely.`, //5
`My sources say no.`, //6
`Outlook not so good.`, //7
`Outlook good.`, //8
`Reply hazy, try again.`, //9
`Signs point to yes.`, //10
`Very doubtful.`, //11
`Without a doubt.`, //12
`Yes.`, //13
`You may rely on it.`, //14
`Learn to trust yourself /faceplam` //15
]
const BallNumber = Math.floor(Math.random() * answers.length);
const value = interaction.options.getString('input');
if (value) return interaction.followUp(`Your answer to: ${value} is... "\`${BallNumber}"\``);
//return interaction.followUp(`${BallNumber}`);
//return interaction.reply('No option was provided!');
},
};```
Yes.
PascalCase đ
How would I do all of them to convert to strings.
I agree!
đ¤ what do you mean convert?
Theyâre all strings already
A miracle, teach em your magic.
I mean like the number into what it is.
this
You defined an array, youâre just indexing a random element in that array with the random number you generated
Exactly what woo said
Oh ok!!!
Hey!
It worked!
referring to discord requiring message content intent
Aight. Oh, do you know how to call choices?
I can't find the bit on the guide for it.
answer = answers[Math.random()something]
likely
math.random is what you'd need to figure out
There's several ways of getting a random value the size of the array with your answers
I got thaat I mean for displaying it with the option being category
you just need to in the end use that random value as the index from answers and then you'd have your answer
wdym category
I'll send code
const { SlashCommandBuilder} = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('gif')
.setDescription('Get a gif of the options.')
.addStringOption(option => option.setName('category').setDescription('Choose an option.').setRequired(true).addChoices(
{ name: 'Cat', value: 'gif_cat' },
{ name: 'Dog', value: 'gif_dog' },
)),
async execute(interaction) {
const cat = ['tenor.com/Fr1Rd7pazC8AAAAS/nice-cat.gif',
'https://c.tenor.com/2v1aDCelTJgAAAAM/cat-cats.gif']
const dog = ['https://c.tenor.com/oqV4uQja1z4AAAAM/puppytalesphotos-puppytales.gif',
'https://c.tenor.com/rGqEYtuMNF4AAAAM/dog-armadillo.gif']
const image_cat = cat[Math.floor(Math.random() * cat.length)];
const image_dog = dog[Math.floor(Math.random() * dog.length)];
const value = interaction.options.getString('category');
if (value = option.gif_dog) return interaction.reply(`${image_dog}`);
//return interaction.reply('No option was provided!');
},
};```
That type of thing.
so essentially:
get the users choice
use the array from that
done?
and whats the issue?
Thats what I'm asking about, how to I get the uses choice?
Ive never used choices and the guide tells you how to add them but I can't find anything else on it.
interaction.choices.getString('category')?
interaction should provide that property
to then .getString as far as I'm seeing

