#development

1 messages ¡ Page 36 of 1

pale vessel
#

If they're kind enough

boreal iron
feral aspen
#

What does this mean?

{
  status_code: 418,
  status_text: 'JSON Parse Failed. Unable to parse response.'
}
pale vessel
#

I think you could have access to some if you just open your front door

surreal sage
pale vessel
civic scroll
#

i literally fed him the literate instructions
i'm sure as the #1 programmer of europe, he can figure that out

surreal sage
#

xd

feral aspen
sharp geyser
#

You gave it something it couldn't parse

solemn latch
pale vessel
#

But why is the response code 418?

sharp geyser
#

Probably invalid json

civic scroll
#

teapot json

sharp geyser
pale vessel
#

You're American Misty

boreal iron
#

We know

surreal sage
civic scroll
#

instead of 400

sharp geyser
#

I thought I was lesbian

civic scroll
#

it threw 418

#

💀

sharp geyser
#

418 makes more sense tbh

surreal sage
#

lmfao

civic scroll
#

no

sharp geyser
#

Who doesnt love tea

civic scroll
#

no

earnest phoenix
#

This is not a valid code

surreal sage
pale vessel
#

LOL

boreal iron
#

Discord api trolling on the next level, now with random status codes

civic scroll
#

@earnest phoenix

pale vessel
#

Youssef aaaa

surreal sage
pale vessel
#

Sayuri you're confusing them

surreal sage
sharp geyser
#

I feel like this channel just continues to dumb down

pale vessel
#

@earnest phoenix Can you read the docs link FakeE sent you?

civic scroll
#

don't tell me he Ctrl C - Ved

pale vessel
#

FakeeeeeeE

surreal sage
civic scroll
#

🗿

boreal iron
#

Who’s this FakeeeeE?

pale vessel
#

Fakezepe

boreal iron
feral aspen
pale vessel
#

Await the response?

#

@earnest phoenix YO check this out

#

I think it even has example

civic scroll
earnest phoenix
civic scroll
#

the ego is unmatched

earnest phoenix
#

I am an Arab

civic scroll
#

i don't care

pale vessel
#

Yo brother

civic scroll
#

at this point

earnest phoenix
#

I'm from an Arab country

civic scroll
#

hire someone to code for you

#

i'm sick of people asking for literal code snippets to their solutions

pale vessel
#

Everything is inside that one link brother

#

All you have to do is click and read

boreal iron
#

We now just need your name and credit card information to verify you being an Arab please

pale vessel
#

Nothing else will help you here bro

#

Youssef listen to me

sharp geyser
#

Soon as flaze found out he was Arab he called him brother

earnest phoenix
sharp geyser
#

Comradore at it's finest

civic scroll
#

he's not willing to code

earnest phoenix
#

It's hard for me to translate all your messages

feral aspen
boreal iron
civic scroll
#

you can wrap it in try catch

boreal iron
#

But don’t my idea please

pale vessel
#

I will your idea

civic scroll
#

i will your intelliJ

boreal iron
#

lmao

#

Gotta pay one word as tax I guess

feral aspen
# civic scroll it has exceptions
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.

feral aspen
#

Oh, fair.

civic scroll
#

wait it didn't hit the catch

pale vessel
#

Make sure you're setting the correct headers

#

I don't know the schema of your API but yeah

civic scroll
#

if it's really inevitable

#

check the status code

fresh verge
#

Why must we use webhooks for vote events instead of actual events. ;-;

solemn latch
#

webhooks are an actual event

#

its just a different type.

boreal iron
#

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

last tapir
#

whats a good dictionary JSON website

#

or something

pale vessel
#

Dictionary JSON API you mean?

feral aspen
#

This dude provides a good dictionary, I suppose.

last tapir
#

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

feral aspen
#

Using fs.

lyric mountain
#

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

feral aspen
#

100,000+ plus.

lyric mountain
#

100k? that's a low kick

#

I'd say somewhere around 200k to 300k

lyric mountain
last tapir
#

how exactly

lyric mountain
#

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)

feral aspen
lyric mountain
#

then iterate over the lines to find what u want

#

instead of loading the entire thing to take a single property

earnest phoenix
#

How do I write a message in Discord?

spark flint
solemn latch
#

you just did

earnest phoenix
#

😂

sudden olive
#

Hello

#

How can I Check My User id

boreal iron
#

what do u mean by "check"-ing it?

#

just getting it?

sudden olive
#

Hmm

#

How to get

sudden olive
#

It

boreal iron
#

Discord settings > Advanced > Developer mode > Enable

sudden olive
#

Ok

boreal iron
#

Then use RMB on your name or others and select "Copy ID"

sudden olive
#

Thnks

boreal iron
#

it somehow gets disabled on every client update

#

for some reason

sudden olive
ancient nova
#

@misty

#

did he leave? 🗿

#

@sharp geyser I've been watching hajime no ippo since yesterday I'm on ep 5 have u seen it? 🗿

sudden olive
#

Help command not working

solemn latch
#

Youll need to handle promise errors

sudden olive
solemn tulip
#

iframe doesn't work because not enough character

boreal iron
#

you gotta manipulate the iframe using CSS

#

to make it fit like u want it

dense flame
#

@neat trellis i believe the owner used css to override their avatar on site

sudden olive
#

Can anyone help?

neat trellis
#

apart from also changing the entire background to another color

dense flame
#

its all css

#

not sure how they did it

dense flame
#

its css animation

sudden olive
boreal iron
#

await your promises and catch 'em

sudden olive
quartz kindle
#

use await

#

and try catch or .catch

sudden olive
quartz kindle
#

?

#

lol

boreal iron
#

You can do it, Tim, I believe in you

quartz kindle
#

lmao

queen solstice
#

hello

solemn tulip
#

I can't set iframe in large description

boreal iron
#

Read the red text man

#

You still have to insert those chars as minimum

lyric mountain
quartz kindle
#

one of my bots had a base64 image in the description and the mods approved it

#

and had a laugh

solemn tulip
lyric mountain
#

also, I believe top.gg requires https, another guy had issues displaying his non-ssl site

boreal iron
#

and probably a lot of CHARS of CSS to customize the iframe

solemn tulip
boreal iron
#

which together is more than 200

boreal iron
lyric mountain
boreal iron
#

ocuh

quartz kindle
#

</style>

boreal iron
#

kuhuwakabanku ... smh

lyric mountain
#

hate html

boreal iron
#

we saw, yeah

#

stick to your weird java trash, boy

lyric mountain
#

at least I can use sql without injections

quartz kindle
#

using ivs?

boreal iron
#

tf... that's why god invented prepared statements

#

so... I can, too

tight cypress
#

Where can i get my topgg auth token?

solemn latch
tight cypress
#

Thank you

knotty quartz
#

is the best way of checking for roles and permissions using an and statement?

#

or separate if statements?

lyric mountain
#

or are u checking for a specific role?

knotty quartz
knotty quartz
#

Can you send a DM straight after a channel message for warn? and if so how do you DM?

wheat mesa
#

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

proven escarp
knotty quartz
#

Ok!

knotty quartz
knotty quartz
knotty quartz
#

Thank you! 😄

earnest phoenix
#

ephemeral messages = literal god send

knotty quartz
knotty quartz
# proven escarp ye

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?

prisma locust
#

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?

prisma locust
prisma locust
knotty quartz
knotty quartz
prisma locust
#

❤️

knotty quartz
prisma locust
knotty quartz
# prisma locust 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

prisma locust
#

oki

lyric mountain
lament rock
#

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

proven escarp
#

if using js

#

idk about py or other langs

lyric mountain
#

could be just an extra field for user_id

lament rock
#

now how about if they consent to viewing such messges

wheat mesa
#

Yeah I feel like that could be abused easily

lyric mountain
#

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

lament rock
#

I'll refrain from sharing my input

lyric mountain
#

if u really want to troll someone u can always just spam normal messages

lament rock
#

I need help on dashboard design

lyric mountain
#

peach

lyric mountain
#

what changed?

#

ah the text

lament rock
#

The top on is a hyper link to a route to view the channel they're active in

lyric mountain
#

hm, the font might be too small

lament rock
proven escarp
#

way too small

lyric mountain
#

and logout could be the I/O button or the infamous door

#

aligned to the right

lament rock
#

How do you style form buttons

lyric mountain
#

css?

lament rock
#

Oh. You can override images with that?

#

maybe I'm misunderstanding

#

I'm kinda new to html and css

lyric mountain
#

search "html buttons with images", there are good examples of it

lament rock
#

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

lyric mountain
#

but yeah, ur dashboard kinda reminds me of linux or ios

#

the menu I mean

boreal iron
lament rock
#

how so

lyric mountain
#

idk, both have the traybar at the top, so ig it's that

lament rock
#

nav bar

lyric mountain
#

nono, traybar

lament rock
#

or do you mean the box where it say welcome back

lyric mountain
#

I mean the bar at the bottom

#

navbar is for browsers no?

lament rock
#

what bottom bar

#

for the buttons?

lyric mountain
#

for both linux and macos, it's on the top

boreal iron
#

Ok.. windows 11 and Java

#

That’s too much for me

ancient nova
#

I wanna add a giveaway system to my bot tbh

lyric mountain
#

nah, centered taskbar is for people who don't read docs

ancient nova
#

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

lyric mountain
#

that's uh, the default way of doing it?

ancient nova
#

... it is?

lyric mountain
#

were u really storing them in arrays? lmao

ancient nova
#

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

lyric mountain
#

u only pull them into an array when ur done with the giveaway

#

so u can process and select someone

ancient nova
#

yeah that's what I was thinking

#

I do have a question though

#

how would you tell if the giveaway has ended

lyric mountain
#

database

ancient nova
#

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

lyric mountain
#

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

ancient nova
#

I'm gonna sound stupid, but what is cron

lyric mountain
#

search

ancient nova
#

I did

lyric mountain
#

no u didn't

ancient nova
#

I did, indeed, truly have googled it

lyric mountain
ancient nova
#

gonna have to work out how to use it first cause it's gonna be my first time tho

quartz kindle
#

you dont really need to use cron

#

cron is basically a linux interval script

lyric mountain
#

I mean, it's the best way if u plan on making future periodic checks

quartz kindle
#

the same as setInterval but for linux itself

lyric mountain
ancient nova
quartz kindle
#

yeah but you dont necessarily need to use linux cron

ancient nova
#

but setTimeout also works

quartz kindle
#

you can do it in pure js

ancient nova
#

but prolly not for a long period of time

ancient nova
lyric mountain
boreal iron
#

Yes

quartz kindle
#

crontab is the editor no?

lyric mountain
#

plus cron has the advantage of being adjusted to the clock, not to the time of start

boreal iron
#

The service itself is just called cron

lyric mountain
#

cron libs use it internally

quartz kindle
lyric mountain
#

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

ancient nova
#

I need something light

#

hmm

lyric mountain
#

both are light

#

unless u make it heavy somehow

spark flint
#

i use node-cron for cronjobs in nodejs stare

ancient nova
#

I probably would kek

quartz kindle
#

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

ancient nova
#

I wanna do it the lazy way and set up an API payload on some remindme website

#

could that work? kek

quartz kindle
#

/facepalm

ancient nova
#

I'm not sure about cron

lyric mountain
#

considering it's bae, they'll somehow manage to hang the process using interval/cron

boreal iron
#

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

ancient nova
#

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

solemn latch
#

eh, once a minute for your whole bot is very little work.

worldly yoke
#

i have like 100+ tasks running ever 5 mins lol

boreal iron
#

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

lyric mountain
#

instead of many one-time tasks

boreal iron
#

Can’t be easier

worldly yoke
#

using cron can be useful if you’ve some sort of requirement system in your bot and need to validate requirements every x minutes

ancient nova
#

I restart my bot once a week?? what if someone sets a giveaway to 1 day that doesn't make sense

pale vessel
worldly yoke
#

even tho i don’t use cron cuz dpy moment

lyric mountain
#

plus u don't need to recreate tons of intervals on every restart

pale vessel
#

Yeah

ancient nova
#

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

boreal iron
lyric mountain
#

unless u change bot status every minute, it'll not be enough

ancient nova
#

I would have to make a custom ID for the giveaway, store the guild, members and other stuff

ancient nova
lyric mountain
#

...ur not changing bot status every minute are you?

ancient nova
#

not remember how muchI think 6

lyric mountain
ancient nova
#

then what am I supposed to do 😭

solemn latch
#

well it could be used to load giveaways that are soon to happen, then set an interval.

ancient nova
#

:[

solemn latch
#

or just add another interval

ancient nova
#

but I would have to disable that interval

worldly yoke
#

well i just keep the giveaway inside my config/cache until it has ended so

ancient nova
#

when giveaway ends

#

which means

solemn latch
#

timeout* not interval mb

ancient nova
#

timeouts doesn't work either

#

if u set it to longer than a day god knows if it'll work or not

boreal iron
worldly yoke
#

btw can i know what language you’re using ?

ancient nova
#

:[

boreal iron
#

Im obviously not talking to you

#

But to the guy I’m replying to

ancient nova
#

the guy you're replying to was talking to me

lyric mountain
#

lmao

boreal iron
#

Nope

worldly yoke
#

hella weird convo

ancient nova
#

oh wait my b 💀

boreal iron
#

It has a locale / guild locale field

#

*property

worldly yoke
#

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

boreal iron
#

It’s raw chaos utilizing djs

worldly yoke
#

lul very bad idea

boreal iron
#

Yeah Baes code is known to be unique

ancient nova
#

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

lyric mountain
#

lmao

worldly yoke
#

python is the best language for making advanced giveaways cog, prove me wrong

lyric mountain
#

the issue will still be the same

boreal iron
#

Can only quote Tim’s reaction

ancient nova
#

but I can freely put as much intervals as I want there

boreal iron
#

/facepalm

lyric mountain
#

if the api gets slow, its responses will also get slow

ancient nova
#

the api will be a whole new server, with it's very own set of specs so it won't get slow

#

I think

worldly yoke
#

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

solemn latch
#

if its made properly it could handle millions of giveaways at once and not get slow

worldly yoke
#

exactly lol

lyric mountain
boreal iron
ancient nova
#

bruh my code isn't that bad

#

relax

#

I'll do it

#

with the interval then

boreal iron
#

You mean timeout?!

ancient nova
#

but

#

I'm scared the timeout will just stop working like it sometiems does with my mute command

#

and giveaways are way more important

boreal iron
#

lol they aren’t suddenly stop working

solemn latch
#

intervals are just timeouts set to call themselves afaik

ancient nova
#

usually if I set a timeout for longer than a couple hours it just magically disappears and never executes

solemn latch
#

if you're having reliability issues with timeouts intervals are the same thing

ancient nova
#

well my interval never broke yet

#

and it's been ages since I added it

#

quite weird

worldly yoke
#

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 pikaLUL

ancient nova
#

imagine having multipliers

#

it's like cheating

boreal iron
#

Imagine not using message components

#

But emojis

#

People like me have disabled

ancient nova
#

emojis gud

boreal iron
ancient nova
#

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

worldly yoke
#

meh not a fan of buttons or components or any of the new bullshit discord introduced

ancient nova
#

but I actually started using buttons a lil

#

have it in a couple of my commands

#

still not gonna use slash commands though

worldly yoke
#

i have buttons in some parts of my bot but not everywhere so

boreal iron
#

Actually those features are the greatest they introduced yet

#

If they would only compete em

worldly yoke
#

and i honestly think having emojis in giveaways give me more control over it

ancient nova
#

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

worldly yoke
#

pikaLUL buttons are lame for me

ancient nova
worldly yoke
#

imagine being the only bot with that much customisation

ancient nova
#

I can't even read the screenshot cuz it's too grainy

worldly yoke
#

iOS moment

#

blame apple

ancient nova
#

like bruh 😭

boreal iron
#

That’s your internet

#

Or the cdn

ancient nova
#

my internet isn't that slow

worldly yoke
#

or windows client moment

boreal iron
#

Fully rendered and sharp for me

ancient nova
#

I recently upgraded it

#

I'm playing 25 a month for 2mb/s

worldly yoke
#

discord web and discord pc client shows mobile screenshots as grainy at times

ancient nova
#

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

worldly yoke
#

but tbh you need to see how codeblocks are represented on iOS

boreal iron
ancient nova
#

I wanna see

#

I was planning buying the iphone 13 soon

#

just as a flex, ofc I would keep using my samsung

boreal iron
worldly yoke
#

lmao ikr, and the boxes look shit

ancient nova
worldly yoke
#

discord iOS client is the worst so far

boreal iron
#

Discord is just not made for people sharing code or using code blocks for their original existence reason

ancient nova
worldly yoke
#

well good thing discord has non-gamers now else you wouldn’t like the way it was when discord just started

boreal iron
#

Not really, compared to android it’s way better

#

Except syntax highlighting

#

cough

ancient nova
worldly yoke
#

atleast has context menus on iOS

#

from a while now

ancient nova
#

does ios have modals?

worldly yoke
ancient nova
#

:]

boreal iron
#

Of course

worldly yoke
#

what’s not to have modals?

boreal iron
#

Why shouldn’t it have them

ancient nova
#

idk I just assumed it didn't because of how badly yall were hating on it kek

boreal iron
#

iOS usually is pretty much up to date

worldly yoke
#

thats just directly linked to the discord UI itself

ancient nova
#

I honestly made only a single ios app in my entire life

worldly yoke
#

also ios doesn’t have the codeblock symbol so

ancient nova
#

and it was because I jailbroke it because I wanted to intall cydia

worldly yoke
#

makes sense why codeblocks suck on iOS

boreal iron
#

The are bad on every mobile tbh

ancient nova
#

and It's acc a fact

worldly yoke
#

yup, no ansi support = shit

ancient nova
#

I hate that

boreal iron
#

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

ancient nova
#

you would cry if u saw how I wrote syntax highlight for my ide

worldly yoke
ancient nova
#

I wrote it in java..so u can imagine how it went...

boreal iron
#

Well looks how frequently discord releases stuff and what it usually is about and you know why that won’t become a thing soon

worldly yoke
#

no response been 2 whole months, the slash commands still won’t show up tried every repro i could

lyric mountain
worldly yoke
#

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

ancient nova
#

I did find a screenshot on some other app I made tho lmao

#

I'm not showing it cause it's actually cringe

boreal iron
#

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

ancient nova
#

I wanted to make an app like CPU-Z

boreal iron
#

Not much to expect from discord

worldly yoke
#

even after 2 whole years of development slash commands are still a fail

#

failure moment

ancient nova
#

ur the first person that agrees with me about slash commands

boreal iron
#

Not really but they at least missing lots of requested features

#

But since then we got like 100 new nitro features

wheat mesa
worldly yoke
#

discord just loves to update things about nitro

worldly yoke
ancient nova
#

oof I found an old screenshot of the main menu from my game

#

it actually looked pretty decent

worldly yoke
#

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

lyric mountain
earnest phoenix
ancient nova
#

it was an ambitious project

#

I worked on it for a whole ass year

worldly yoke
#

i agree ephemerals are the best thing discord introduced so far, but slash commands? hah

#

slash commands are just a joke to me

ancient nova
#

the longest project I've ever commited myself to doing

worldly yoke
#

ngl

#

i don’t like interactions at all

#

modals are nice tho

boreal iron
#

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

ancient nova
#

I can't believe I'm seeing this

#

FakE actually agreeing that intercations are bad

boreal iron
#

Also the fact that an executed interaction can always respond and doesn’t have to care about permissions, not to mention ephemeral messages

boreal iron
worldly yoke
#

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

boreal iron
#

But I’m well aware of the missing features and limits as I’m using them since they exist

worldly yoke
#

like why in the hell are the embeds executed by slash commands considered a webhook???

worldly yoke
#

yeah and iirc bots can’t read webhooks

boreal iron
#

Responses as webhooks are a lot easier than common messages especially regarding permissions

worldly yoke
#

agreed but that does changes a lot for some developers

boreal iron
#

For example?

worldly yoke
#

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

boreal iron
#

Sounds like a very specific edge case for me

worldly yoke
#

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

ancient nova
#

dank memer acc broken asf for me

#

almost no commands work for me

#

it just says that the intercation failed

worldly yoke
#

well i don’t even play dank memer but those commands were what made my bot get into some large asf guilds

boreal iron
#

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

worldly yoke
#

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

worldly yoke
boreal iron
#

I mean that’s a risk you take relying on data of others tbh

worldly yoke
#

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

boreal iron
#

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

worldly yoke
#

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

boreal iron
#

Well that’s always what new features comes with, some hate it some love it

worldly yoke
#

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

worldly yoke
boreal iron
#

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

worldly yoke
#

i mean discord could have kept choices for both slash and prefix instead of explicitly getting the message content intent

worldly yoke
boreal iron
#

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

worldly yoke
#

that’s true as well tho less sussy bots collecting data

wheat mesa
#

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

boreal iron
#

Maybe it’s ugly syntax?

wheat mesa
#

the syntax is just fine

boreal iron
#

Ok drunk boy

wheat mesa
#

It's a little different without parenthesis but I got used to it

#

this is my complaint rn

worldly yoke
#

rust is a sexy language and I can already see it being the next big thing

wheat mesa
#

I'm gonna write my own macro for this shit

#

fuck it

sudden geyser
#

I don't think you're using repr correctly but don't know how to describe it

wheat mesa
#

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

sudden geyser
#

To my knowledge, repr is for communicating with C.

#

I think you can take the enum variant and cast it with as u8

wheat mesa
#

There's #[repr(C)] for that

#

I'm using this to represent 1 byte opcodes

boreal iron
#

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

wheat mesa
#

boomer

boreal iron
#

My gosh

#

That’s the right moment to slap you hard

spark flint
#

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

still stone
#

Guess who's back

sudden geyser
#

back again

radiant kraken
#

Can't you just use as ReprCode

#

or if you still can't just use good old transmute mmulu

wheat mesa
#

can't cast prim to non prim

civic scroll
#

GAMING

radiant kraken
wheat mesa
#

no unsafe por favor

#

Just ended up using a crate with a macro for it

radiant kraken
#

stop being a safe supremacist

#

i use unsafe everywhere in my Rust code

wheat mesa
#

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

radiant kraken
#

Unless it is corrupted which is highly unlikely

wheat mesa
#

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

radiant kraken
#

Why would someone manually edit the bytecode file

wheat mesa
#

To try to confuse the VM

radiant kraken
#

bruh

wheat mesa
#

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…

radiant kraken
#

then your only way is to use constants, literals, or macros

#

can Rust macros do like C's #define A B?

wheat mesa
#

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

radiant kraken
#

Procedural macros?

wheat mesa
#

Idk, never written one myself

#

Saw the syntax for it and decided “fuck that”

radiant kraken
#

which one are you referring to

wheat mesa
#

macro_rules!

radiant kraken
#

#[this] or this!()?

#

oh

cinder patio
#

macros do rule

proven cloak
#

umm how do we do this this ?

earnest phoenix
proven cloak
#

ooh..

#

ok

#

then

boreal iron
#

Soon:
”why bot not working anymore“
“no I never received any notification from discord“

#

Are you prepared? topggDoge

rustic nova
#

oh shit it is tomorrow isnt it

#

time to make a tag for it

#

-intents

gilded plankBOT
#

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.

rustic nova
#

good

boreal iron
#

Title “bot not working anymore but it was yesterday” would fit better

small tangle
rustic nova
#

Bot not working anymore but it was <t:1661983140:F>

small tangle
quartz kindle
#

lmao

#

its sure gonna be entertaining

boreal iron
#

the only reason we're here

twilit night
#

#play friends

timber marlin
#

My pandez bot no command for verify and another bot too, any idea?

#

Bots just blank in my account

boreal iron
#

this isn't the bot's support server, you're probably wrong here

wheat mesa
carmine summit
#

anyone know why this returns NaN?

small prairie
#

what in the

small prairie
#

probably that

rustic nova
carmine summit
carmine summit
rustic nova
#

that is true yeah, doesnt support seed

small prairie
#

there are probably others too

#

check all one by one

#

just check the ranges supported by all of those functions

wheat mesa
#

You’re probably hitting an asymptote of one of the functions

#

Or outside of the range

small prairie
carmine summit
#
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
small prairie
#

i dont know what you plan to do with this

#

but you should see if it actually works with the values you might input

carmine summit
#

this is easily the most stupidest thing I've done in js

small prairie
#

thats

#

lovely

carmine summit
#

it also has an average of 0.500327971121153 xD using: ```console.log(avg(Array.from({ length: 1000000 }, (_, i) => rand(Math.random() *100000000))));

wheat mesa
lyric mountain
#

discord is kidding me right?

#

no fckin way they added yet another thing to add notifications marker

lyric mountain
rustic nova
#

I had

#

to clear my

#

100 friend requests just so I can do top.gg

#

plus entirely disable friend requests

boreal iron
#

except the dudes premature name :P

lyric mountain
boreal iron
#

I don't understand your weird language in that image, that's why I ask

lyric mountain
#

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

boreal iron
#

so... you can yet send a friend request and 1 message (probably as reason to accept)?

lyric mountain
#

nono, they're separate

boreal iron
lyric mountain
#

it's like requesting permission to talk with u

#

not necessarily becoming friends

earnest phoenix
#

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)
                }
            })```
lyric mountain
boreal iron
boreal iron
#

wtf

earnest phoenix
lyric mountain
#

also, don't use forEach

earnest phoenix
carmine summit
# lyric mountain tf is that for

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.

earnest phoenix
lyric mountain
lyric mountain
earnest phoenix
#

Let's try..

carmine summit
lyric mountain
#

a seeded random generator will always generate the same sequence of numbers

earnest phoenix
lyric mountain
earnest phoenix
#

Oww, I entered the name of my slash cmds KEKW

#

Now it shows the command in the info category in the bot category.

#

I did

#

Thanks for help

boreal iron
#

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

earnest phoenix
boreal iron
#

well then, good for you

feral aspen
#

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).

spark flint
#
res.send(`Welcome 123.\nSomething another 321.`)```
#

oh

#

mb just read the second bit sobby

lyric mountain
spark flint
#

\ apparently works?

lyric mountain
#

actually, I think the issue is that ur string quotation is behing the text

feral aspen
#

So if I have 200 lines of html codes, I need to keep using \n.

lyric mountain
#

try unindenting the text to see

spark flint
#
res.send(`\
  Welcome 123. \
  Something another 321.
`)```
#

try that

lyric mountain
#

that's not necessary

spark flint
#

o

lyric mountain
#

`` already escapes newline

spark flint
#

i've done that as a solution myself before and it worked

lyric mountain
#

try removing this space

boreal iron
#

I mean it give you exactly what you entered, two new lines and two tabs in front of your lines

lyric mountain
#

if it works like java multilines, the last backtick marks the "zero" coordinate

boreal iron
#

in your example yeah, but not as he did it

lyric mountain
#
res.send(`
Welcome 123.
Something another 321.
`)
#

or ```js
res.send( Welcome 123. Something another 321. )

feral aspen
lyric mountain
#

but does it work?

feral aspen
lyric mountain
#

btw, if u want organization u can just make an html file and return that

#

fs read into a string

feral aspen
#

Which is better, however.

#

Or when is better in each scenario.

lyric mountain
#

a file

earnest phoenix
#

can we get user tag in top.gg sdk package?

boreal iron
#

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

earnest phoenix
lyric mountain
#

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

boreal iron
#

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?!

lyric mountain
#

I think u need to be in a mutual server unless u get the oauth2 scope IDENTIFY

#

so u can fetch the user info

knotty quartz
#

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.
digital swan
knotty quartz
digital swan
#

not from the code youve shown cause you've hardcoded the role id

knotty quartz
digital swan
#

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

knotty quartz
digital swan
#

ohh then yeah that would work

knotty quartz
digital swan
#

no you should probably look at discord.js docs

knotty quartz
digital swan
#

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

knotty quartz
lyric mountain
#

Relying on roles is asking for headache

knotty quartz
lyric mountain
#

You should

knotty quartz
#

My host runs off 32 bits. Most databases Ive fund is 64 bits. I forgot to select 64 bits when I set it up.

knotty quartz
lyric mountain
#

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

knotty quartz
lyric mountain
#

Aren't u using git?

knotty quartz
lyric mountain
#

Then start there

knotty quartz
#

for now, I'll just use user.id till this backup finishes

boreal iron
#

Just copy the files, reinstall the system, paste em back into the system?!

lyric mountain
boreal iron
#

Use rsync for example to move your files over to your Pc

knotty quartz
#

I'm copying files into my USB pen now, and uploaded them to github and i'll reinstall when I can.

boreal iron
#

Reinstall it, paste em and done

lyric mountain
#

Don't upload using github, make a repo locally then push

boreal iron
#

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

lyric mountain
#

That's what people say moments before a catastrophic failure

boreal iron
#

Did people forget about that’s a thing nowadays?

boreal iron
lyric mountain
#

You joke but many times I watched people panic as their "local backup" is no longer reachable

knotty quartz
boreal iron
#

I’m not using any online service im sharing my files to for the past 15y and haven’t lost anything yet

lyric mountain
boreal iron
#

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

lyric mountain
#

They can't really delete gh files without legal backlash

#

And well, it's Microsoft so gh won't go anywhere anytime soon

boreal iron
#

If I hit delete on something uploaded it’s gone

lyric mountain
#

...no it's not

#

History exists for a reason

boreal iron
#

Idk anything about it

boreal iron
#

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

lyric mountain
#

Like?

#

And gh isn't a ms product, they just own it now

boreal iron
#

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?

lyric mountain
#

...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

boreal iron
#

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

soft ore
#

Hi

knotty quartz
boreal iron
#

Calm @boreal iron soon the pain ends, when you reach your mobile traffic limit

#

Yes, I know!

knotty quartz
#

Does anyone know which raspberry pi OS is better 😭

boreal iron
#

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

lyric mountain
#

fake is literally

knotty quartz
solemn latch
#

did they say why its bad?

boreal iron
#

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

boreal iron
#

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

ancient nova
#

😳

sour oar
#

I also have the same error, how can I solve it with the .set definition

lyric mountain
sour oar
lyric mountain
#

I don't know much about d.js, but I'm pretty sure that's not how u add slashes

digital swan
#

is there a way to automatically enter a choice into a slash command string option? sort of like a default option

pale vessel
#

Make the option optional?

frigid moth
#

I submitted a bot and I want to add some images in bot description.Is there any html code I could use?

wheat mesa
#

Just…use html? You essentially have the solution in your answer :p

frigid moth
#

I mean html example code

wheat mesa
#
frigid moth
#

Ok thx

lyric mountain
#

easier to type

#

unless u need additional styling

#

![image name](https://puturl.here)

frigid moth
#

I will try both, thx for helping

quartz kindle
#

its tomorrow bois

#

anyone knows if its utc?

#

or are they gonna go for pst

solemn latch
#

I'm scared 👀

#

I think we have awhile

spark flint
#

vercel moment

#

error message is .

solemn latch
#

well, hopefully you read dot error notation

spark flint
#

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 mimu_sob_cry

solemn latch
#

not sup 😔

spark flint
#

idk why vercel doesn't tell the error message on the dashboard lmao

knotty quartz
#

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

solemn latch
#

so you want the number 5 to turn into yes?

knotty quartz
#
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!');
},

        };```
solemn latch
#

so 0 = As I see it, yes.

#

answers[theNumberHere]

knotty quartz
wheat mesa
#

PascalCase 😭

knotty quartz
#

Welcome back home XD

wheat mesa
#

I’m at school yet I’m at home at the same time

knotty quartz
knotty quartz
solemn latch
#

🤔 what do you mean convert?

wheat mesa
#

They’re all strings already

knotty quartz
knotty quartz
solemn latch
wheat mesa
#

You defined an array, you’re just indexing a random element in that array with the random number you generated

#

Exactly what woo said

knotty quartz
rustic nova
#

1 hour until it happens

#

floosh

#

at least 1 hour in gmt+1

knotty quartz
#

Hey!

knotty quartz
rustic nova
#

referring to discord requiring message content intent

knotty quartz
#

I can't find the bit on the guide for it.

rustic nova
#

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

knotty quartz
#

I got thaat I mean for displaying it with the option being category

rustic nova
#

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

knotty quartz
#

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.

rustic nova
#

so essentially:

get the users choice

use the array from that

done?

#

and whats the issue?

knotty quartz
rustic nova
#

interaction.option isnt it?

#

since you're executing using the interaction variable

knotty quartz
rustic nova
#

interaction should provide that property

#

to then .getString as far as I'm seeing