#development

1 messages ยท Page 1754 of 1

sudden knoll
#

but he wants the /

earnest phoenix
#
  @commands.command(name=f"check-status", aliases=['cs', 'check-s'])
  async def check_users_status(self, ctx):
    for s in ctx.author.activities:
        if isinstance(s, discord.CustomActivity):
          if "support me" in discord.CustomActivity:
            channel = bot.get_channel(channel_id)
            await channel.send("{user} has added the staus!")
          else:
               return``` I was after something like this.
sudden knoll
#

unless it is prefix in which case ez

#

staus

earnest phoenix
#

@umbral zealot

worn sonnet
#

If it works it works

earnest phoenix
#

doesn;t

#

I want a command where it says / fesseln and the bot should answer du fesselst jemanden

umbral zealot
#

Sounds like your first step is to learn a programming language

sudden knoll
#

lol

earnest phoenix
worn sonnet
deep mantle
umbral zealot
#

I don't want to say "first learn english" because that's ableist, but like, you need to start by making a bot

#

and to do that you need to know some programming

worn sonnet
#

Just wanted to know

sudden knoll
earnest phoenix
#

Are you discriminating against me because my English is bad?

umbral zealot
#

No, I'm not

earnest phoenix
#

That's a good support really๐Ÿ‘Ž

umbral zealot
#

Your first step is to learn a programming language

earnest phoenix
umbral zealot
#

like javascript. or python.

worn sonnet
umbral zealot
#

Stop trying to ping me jesus christ.

earnest phoenix
#

Aha

umbral zealot
#

I'm saying you need to learn a programming language. But certainly the language barrier and your inability to answer questions makes this harder to help you.

earnest phoenix
#

HAHAHAHA JOO WTF

umbral zealot
#

You can do that without pinging, thanks.

earnest phoenix
#

You say my English is not good learn that and command

#

Best sup

umbral zealot
worn sonnet
sudden knoll
#

programming language != english

umbral zealot
#

I also said it's hard someone that has problems communicating in english because that's the communication language we can help in .

#

So like, both are a problem.

worn sonnet
#

No I code in English

hollow anvil
#

English isn't a programming language

sudden knoll
#

I mean... Python = English?

worn sonnet
#

Yeah

umbral zealot
#

y'all need to read the room, and jokes. lol

hollow anvil
#

thats

worn sonnet
#

Xd

umbral zealot
#

I know sarcasm is hard to read but wow, that was obvious as hell

worn sonnet
#

Oke me sorry that was the bad joke

sudden knoll
#

wait which joke are we talking about

toxic forum
wispy glen
#

@umbral zealot best place to learn py or js?

earnest phoenix
#

You are to blame why I find the server unsympathetic That's my opinion@umbral zealot

umbral zealot
worn sonnet
#

I code in python and I'm teaching my elder sis to code in c

sudden knoll
#

lmao

earnest phoenix
#

@worn sonnet @deep mantle Just want to say thanks for all the help and I got it working!

umbral zealot
deep mantle
#

your welcome!

worn sonnet
umbral zealot
#

Now can you stop being triggered for a hot second, and please go choose and learn a programming language?

#

There's no point in keeping up the complaining.

earnest phoenix
worn sonnet
#

Oke

sudden knoll
earnest phoenix
#

oh ok

umbral zealot
#

I don't speak german, kthx.

sudden knoll
#

what is your question

clear marlin
#

imagine speaking german

umbral zealot
#

still do'nt speak german.

earnest phoenix
#

oof

sudden knoll
#

ah that one looks insulting

earnest phoenix
#

I say you cool of German @umbral zealot

clear marlin
umbral zealot
#

I honestly don't care, they're spending more time arguing with me about why they think I'm rude than they are actually listening to what to do now

sudden knoll
umbral zealot
#

I know I'm not, but they think I am ๐Ÿ˜„

clear marlin
#

why the hell is this becoming general chat though

umbral zealot
#

ยฏ_(ใƒ„)_/ยฏ

#

If anyone needs help, please do speak up, we're there to assist, don't worry ๐Ÿ˜„

worn sonnet
#

So I made this simple command for someone on upwork and got 50 bucks.
And Maybe this was the first time I coded in python to get paid

sudden knoll
#

it's your instagram scrapper

lament rock
#

easy money

clear marlin
#

cool but why here

sudden knoll
#

nice

worn sonnet
umbral zealot
#

Also, @rustic nova could you please check the deleted logs? I'm relatively certain I was called very bad things in German but didn't have time to copy/paste to check. Thank you ^_^

sudden geyser
#

Google IO soon ๐Ÿ‘€

sudden knoll
#

lmao

umbral zealot
#

Oh thanks Woo. That's what I was thinking.

pale vessel
#

Lite you're back from school?

clear marlin
solemn latch
sudden geyser
#

Nah

toxic forum
earnest phoenix
#

Where can I complain about a team member?

sudden geyser
#

Still in

pale vessel
#

Ah

opal plank
worn sonnet
lament rock
#

weird flex

sudden knoll
rustic nova
#

@earnest phoenix please don't be rude to other people, doesn't matter what language hmmm

next one is definitely a mute

umbral zealot
#

my dog is very friendly and would love it. Alright. Let's go back to support please iara_hug

wind kayak
#

its on py i am coding in js

#

is there any js one?

umbral zealot
sudden knoll
earnest phoenix
#

Bye i quit the server

opal plank
#

wheres my bot when we need it? i had a tag with all that in it

clear marlin
thin quarry
worn sonnet
sudden knoll
#

he never answered my question :(

lament rock
#

Does anyone know if you're supposed to use the Interaction.application_id or Interaction.id in the routes for webhook methods for slash commands

worn sonnet
rocky hearth
#

Ive grid of 10 cols having 100 children. (making 10x10 grid)
How can I select the corner child elems with csss?

wind kayak
wind kayak
thin quarry
#

make main.js lol

sudden knoll
#

that's just the main module

wind kayak
#

ok

thin quarry
#

idk

worn sonnet
thin quarry
#

then search another tutorial

mellow cairn
worn sonnet
thin quarry
#

but the basics are tne same

sudden knoll
#

there are a lot of tutorials out there

sudden geyser
#

Google IO in 15 seconds

umbral zealot
#

@wind kayak see https://anidiots.guide/ for help in creating a discord bot in javascript, assuming you already know JS

opal plank
#

thats the formula you'd have to use

opal plank
#

unless you add an id to them, you'd have to iterate

umbral zealot
#

There are also information in that guide about how to do that

wind kayak
sudden knoll
#

gross

umbral zealot
#

yes. I'm aware.

#

it's on the page

#

Sorry, I got a bit confused on the conversation. To re-iterate: there are no good free hosts.

#

repl and heroku both have their downsides

wind kayak
#

@umbral zealot can you guide me use uptimerobot in replit in js?

worn sonnet
umbral zealot
umbral zealot
worn sonnet
wind kayak
#

yeah i want look at the page

umbral zealot
#

so... click on it?

wind kayak
#

but how i link it with replit

umbral zealot
#

read the page

wind kayak
#

k

#

its for js?

umbral zealot
#

it doesn't even matter

#

but yes

#

read the page

wind kayak
#

k

solemn latch
#

any language repl supports

clear marlin
rocky hearth
lament rock
#

Just wanted a def answer, but I can always create another commit to try it

clear marlin
#

its POST /webhook/<application_id>/<interaction_token>

lament rock
wispy glen
#

@umbral zealot best paid hosts?

umbral zealot
#

that's highly subjective.

solemn latch
#

best? id go with a bigger company like digital ocean. might be more expensive, but very reliable.

wispy glen
#

yes but for starting

sudden knoll
#

I like galaxygate b/c $3

wispy glen
#

something with a accessible price and good

solemn latch
#

galaxygate is my recommendation too, but not when saying best.

sudden knoll
#

that is fair

umbral zealot
#

I can only answer that with the host I tried and trust, not with which specific one is "the best"

wispy glen
#

what is it?

umbral zealot
clear marlin
#

vultr

wispy glen
#

aight thx

clear marlin
#

good vps services winking not sponsored

brave tendon
#

Is it possible to trigger a bot command with a Webhook ?
Example webhook message: !check <id>

And the bot response to that

lyric mountain
#

you'd not need to use a webhook for that

lament rock
#

Yeah. Check for message.webhookID

lyric mountain
#

an api call would be more fitting

#

oh wait, what kind of webhooks are we talking about?

lament rock
#

webhooks as a message author have bot: true, so if you wanna incorporate it into existing logic by denying bots from interacting with your bot, you'd do if (msg.author.bot && !msg.webhookID) return

#

their question seemed to be allowing webhooks to interact with their bot

#

that's just how I interpreted it

pale vessel
lyric mountain
#

I was thinking on a webhook triggering a command as in some website send data (like top.gg) and interacts somehow with a command

#

also, msg.author.bot already returns true if it's a wh doesn't it?

earnest phoenix
#

Hello everyone, you can please drop the code so that I can write a valid command on behalf of the bot, say, if I work on node.js

clear marlin
#

why don't you try one for yourself

#

rather than spoonfeed

umbral zealot
#

and also we won't spoonfeed you an answer.

thin quarry
#

lemme talk to her

thin quarry
umbral zealot
#

ok but not in this channel

thin quarry
#

ั‚ั‹ ั€ัƒััะบะฐั?

umbral zealot
solemn latch
#

-noru

gilded plankBOT
#

ะ’ั‹ ะผะพะถะตั‚ะต ะณะพะฒะพั€ะธั‚ัŒ ะฟะพ-ั€ัƒััะบะธ ะฒ #general-int.
ะ•ัะปะธ ะ’ะฐะผ ะฝัƒะถะฝะฐ ะฟะพะผะพั‰ัŒ ั top.gg, ะ’ั‹ ะผะพะถะตั‚ะต ะพะฑั€ะฐั‚ะธั‚ัŒัั ะทะฐ ะฟะพะผะพั‰ัŒัŽ ะฒ #support.

earnest phoenix
#

I could substring the first character but it's not really good practice

clear marlin
#

huh

earnest phoenix
clear marlin
#

oh okay

#

I was cofused

umbral zealot
#

standard practice in these cases is that you always have a preceding slash, and never the trailing slash.

earnest phoenix
#

Then the path should have the first character removed

umbral zealot
#

I'm a bit confused by that screenshot though, where's the extra /api in there? it's like... trimmed?

#

oooooh I get it

#

I get the entire context, sorry

earnest phoenix
#

Basically it works like this

#

However the path has a beginning slash which should be removed

umbral zealot
#

yeah conventions would have you put the /api inside the path itself on the second line

earnest phoenix
#

Yea

woeful pike
#

I think then it would make more sense if we url locations to

<HTTPHeader path="bots/:bot_id/stats" />

without the leading slash

#

and add it only when displaying

#

or maybe not even when displaying, dunno

earnest phoenix
#

Or just keep it like that and I put the /api at the beginning of the suffix

woeful pike
#

that could also work

#

but then we wouldn't be able to override with absolute urls

#

which is the point of doing the url constructor

earnest phoenix
#

Yea, but all APIs documentation use /bots/:bot_id/stats and not bots/:bot_id/stats

#

I could just substring the first character of the path tho

woeful pike
#

I think we should just change the paths being passed in that case

#

substring also ruins absolute urls

woeful pike
#

I think this looks cleaner anyways

earnest phoenix
#

Not wrong.

#

I can go with that

woeful pike
#

yeah if you just search for <HTTPHeader you should be able to find all the usages

clear marlin
#

like user?=userid

earnest phoenix
#

No, that's not how APIs should work

sudden geyser
#

That's more for options

woeful pike
#

I mean we can't change the api lol

#

this is just the documentation

sudden geyser
#

APIs can work that way

woeful pike
#

it's not restful

clear marlin
#

Yeah get it

sudden geyser
#

I personally think no trailing / is better

earnest phoenix
#

All righty

deep mantle
#

hey i use discord.py, and I need to add about 4 reactions to a message. It takes about 2 seconds to add them, its not a lot of time, but it would be nice to speed it up. Is there a way to add the reactions all out once

#

also will adding 4 reactions trigger any rate-limit or something?

earnest phoenix
#

Use create_task or similar APIs, the ratelimit will still hit you though

deep mantle
#

ok

#

thanks

fair axle
#

Why it returns me false and how can I check if json has not any key

umbral zealot
#

check Object.keys(theobject).length

#

two separate objects do not equal each other in javascript

earnest phoenix
#

Good evening, who has a team so that you can write on behalf of the bot, I work with js, I will be grateful

lyric mountain
#

weren't u already told that we don't do spoonfeeding here already?

earnest phoenix
#

there is always a kind person who will help

lyric mountain
#

that kind person would be on the losing end tho

mellow cairn
#

I might have helped had it not been for that, sry

earnest phoenix
#

I just wanted someone to help me or throw off the code by type of writing on behalf of the bot, you write a valid hello and in response, hello

cinder patio
#

just send the message content back

#

<TextChannel>.send(<Message>.content)

#

you'll have to edit the content beforehand though, to remove the prefix and the command name

#

if you have a command handler you can use the join function to create a single string from all the args

earnest phoenix
cinder patio
#

no

umbral zealot
#

If you don't know how to write this yourself, you should consider learning javascript first.

umbral zealot
#

Please do not spoonfeed others.

mellow cairn
#

I'm not, I'm just confused

umbral zealot
#

doesn't matter what "a personal" means, tbh

mellow cairn
#

Maybe, but I was just wondering

umbral zealot
#

Just bad translations

mellow cairn
#

Guess so

earnest phoenix
#

spoonfeed me a pizza please

earnest phoenix
mellow cairn
#

Great reply :/

umbral zealot
#

It's a very personal reply don't you think? lul

pastel violet
#

is there a way to edit a message into an embed

#

like if the bot sent Fetching

mellow cairn
#

Which language?

pastel violet
#

discordjs

mellow cairn
#

Welp, I'm out again

earnest phoenix
#

it is a pity that no one helped; (

cinder patio
#

I wouldn't call that helping

#

but oke

umbral zealot
earnest phoenix
slender thistle
#

Do you speak Russian

#

Well, I'm not late at all

mental raven
#
    top = subreddit.top(limit=100)
AttributeError: 'coroutine' object has no attribute 'top'

why does this error print?
Command:

@client.command()
async def meme(ctx):
  async with ctx.typing():
      time.sleep(0.1)
      subs = ['kidsarestupid', 'dankmemes', 'memes']
      randSub = random.choice(subs)
      subreddit = reddit.subreddit(f'{randSub}')
      top = subreddit.top(limit=100)
      sub_list = []


      for submission in top:
        sub_list.append(submission)

      subChosen = random.choice(sub_list)

      subTitle = subChosen.title
      subUrl = subChosen.url

      embedVar = discord.Embed(title=subTitle, color=0xffa300)
      embedVar.set_image(url=subUrl)
      embedVar.set_footer(text=f"Result from r/{subreddit} || By {subChosen.author} || {subChosen.score}โ–ฒ || {subChosen.num_comments}๐Ÿ’ฌ")
      await ctx.send(embed=embedVar)
earnest phoenix
#

resolve the coroutine by awaiting it

mental raven
#

ok

#
subreddit = await reddit.subreddit(f'{randSub}')

Like this?

earnest phoenix
#

yes

mental raven
#

ok

#

let me see

earnest phoenix
#

You should've tried it first before asking doe mmulu

stiff lynx
#

This is the code for my cooldown, anyone that can help me for reset if the command fail.
Because with this metod when you write the command name but for example you dont tag the user you have to wait all the cooldown time
https://srcb.in/G3jDOUBL72

mental raven
#

ok but now i get another problem

mental raven
#
    for submission in top:
TypeError: 'ListingGenerator' object is not iterable

...

umbral zealot
earnest phoenix
#

I haven't used it, but it looks like an async iterator, try doing async for ... instead

mental raven
#

Ok I didn't even know that exists

umbral zealot
#

what do you mean how

#

by using the delete code you have already on that last line

stiff lynx
#

this way?

umbral zealot
#

yes but now with real code

#

Specifically under what exact circumstance do you want to delete the cooldown

stiff lynx
#

i did a give command

#

and the syntax is

#

.give moneyammount @ user

#

but a lot of people invert user and moneyammount

mental raven
stiff lynx
#

and they have to wait

stiff lynx
quartz kindle
#

lol

crimson vapor
#

you could only do the cooldown on a successful command

umbral zealot
#

I understood completely what the issue was

crimson vapor
#

but then you would need to handle it another way

umbral zealot
#

I'm trying to explain the solution

#

sigh

earnest phoenix
stiff lynx
umbral zealot
#

I did

quartz kindle
#

evie comes to this channel to practice patience

stiff lynx
#

rip

#

sorry evie

umbral zealot
#

Unfortunately I fail many times a day

#

so I keep practicing

mental raven
stiff lynx
umbral zealot
mental raven
earnest phoenix
stiff lynx
#

in a 6 months cours

umbral zealot
#

On javascript?

stiff lynx
#

yes lol

umbral zealot
#

They took 6 months to teach you but didn't bother saying you should use camelCase variable names, or how modules and promises work?

stiff lynx
#

what do you expect from a teacher that for an stupid output make you write a 8 miles long code line

umbral zealot
#

Right so you had a shit course.

#

The ones I link are good ones.

stiff lynx
fair axle
#

How much reaction can I fetch at once?

pale vessel
#

Message reactions?

fair axle
#

Yes

pale vessel
#

Don't you cache reactions?

#

Are you fetching reactions from a newly fetched message?

fair axle
#

No

#

From a partial message

pale vessel
#

I'm not sure if there's an endpoint for fetching reaction list

#

There's only an endpoint for getting a list of users for a reaction emoji

fair axle
#

I am using discord.js

earnest phoenix
#

If i have 1234567890, how to replace the 5 last caracters with * ?

pale vessel
#

I'm pretty sure you have to rely on cache which you can't in this case since the message is a partial

quartz kindle
#

message.fetch() gets you a list of reactions

pale vessel
#

Ah

fair axle
#

Okey but how much?

quartz kindle
#

then reaction.fetch() gets you a list of users

fair axle
#

Isn't it has a limit?

quartz kindle
#

so you need to fetch the message to get the list of emojis, then for each emoji you need to fetch it to get the list of users

pale vessel
#

There's no limit

fair axle
#

Someone said you can only reach 100 person who reacted the message with same reaction

opal plank
#

hence why u cache it

quartz kindle
#

yes, max is 100

pale vessel
#

So you want a list of users for a reaction

fair axle
#

Yes

fair axle
quartz kindle
#

to get more than 100 you need to make multiple requests

fair axle
#

I get it thanks

opal plank
#

realistically tho, will your bot ever get more than 100 reactions?

#

in a single message

fair axle
#

In giveaways yes

quartz kindle
#

dude have you never seen discord giveaway bots?

opal plank
#

i mean sure, its possible, and its good to account for such cases

quartz kindle
#

they have 50k+ reactions

opal plank
#

i have not lol

quartz kindle
#

lmao

opal plank
#

wtf

fair axle
earnest phoenix
#

If i have 1234567890, how to replace the 5 last caracters with * ? (Ping me)

fair axle
#

I tried to store users in database when they react but that means a lot of database query

pale vessel
quartz kindle
pale vessel
#

Is this even recommended

pale vessel
earnest phoenix
#

K

fair axle
pale vessel
#

Is the string guaranteed to have over 5 characters?

#

If so then you can just slice the last 5 characters and add 5 *'s

quartz kindle
#

yes

fair axle
#

But what if someone spam it

pale vessel
#

It's better than making multiple requests to discord API

#

Database calls are fast so you don't need to worry about speed

earnest phoenix
quartz kindle
#

listening to reactions is not that hard

fair axle
#

The problem is not listening

quartz kindle
#

even in very large servers, you're looking at max like 100 per second

fair axle
#

I am just wondering about database queries

quartz kindle
#

databases can easily handle thousands of queries per second

#

if configured correctly

#

plus you can always use transactions and group queries together

#

and use caching

fair axle
#

It makes more sense

#

Thanks for your help

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

yes

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

opal plank
crimson vapor
#

use detritus

#

I mean discord-rose

opal plank
#
    if (message.author.bot) return
    if (message.author === client.user) return
    if (blacklistedUsers.includes(message.author.id)) return
    if (blacklistedChannels.includes(message.channel.id)) return
    if (!message.guild) return
// to this
    if (message.author.bot || blacklistedUsers.includes(message.author.id) || blacklistedChannels.includes(message.channel.id) || !message.guild) return
#

@sage bobcat

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

opal plank
#

noooo

sage bobcat
#

One message removed from a suspended account.

opal plank
#

then do it

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

opal plank
#

just use detritus then

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

opal plank
#

not really

crimson vapor
#

why even build your own command handler?

sage bobcat
#

One message removed from a suspended account.

opal plank
#

wrong

crimson vapor
#

you can use detritus in js

opal plank
#

^^

sage bobcat
#

One message removed from a suspended account.

opal plank
#

u meh

sage bobcat
#

One message removed from a suspended account.

opal plank
#

dont talk shit bout my lib

crimson vapor
#

plus side is that it has a built in command handler

opal plank
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

crimson vapor
#

which makes everything easier for everyone

#

ok

opal plank
#

sounds like wasted effort to me

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

opal plank
#

then dont use it

crimson vapor
#

ig as long as you're havin fun

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

but is c# top 2 in the techempower benchmark?

#

no, c# is top 8 :^)

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

my api v2 is delayed for over a year

#

i was supposed to do it a year ago and never did

#

its in a weird state when it works perfectly fine for my private usage but not good enough for a public release

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

so i just let it sit in permanent alpha stage for a year

#

lmao

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

ye i know, i totally understand

#

im in the same boat

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

opal plank
sudden geyser
#

Software developers are virtual architects

quartz kindle
#

software developers are lazy assholes

sudden geyser
#

yeah that too

prime mist
#

Laziness can be a great thing, but there is also bad laziness lol.

sudden geyser
#

in the mind of a master procrastinator

crimson vapor
#

remember, 5 hours of fucking around can save you 5 minutes of reading docs

sudden geyser
#

so five hours and five minutes

quartz kindle
#

5 hours of reading docs can also get you nowhere, while 5 minutes of fucking around will actually get the job done

#

because reading docs can be fun

prime mist
quartz kindle
#

also 5 hours of running microbenchmarks you already ran before just to confirm that the results are still the same, and whatever shit you're using is still the fastest

solemn latch
#

๐Ÿ‘€

prime mist
#

I would generally go for easy to understand code over speed, until speed is an issue ๐Ÿ™‚

quartz kindle
#

speed > *

#

but well

#

in most cases, high performance code is still very readable

#

at least mine is lel

prime mist
#

Spoken like a true developer lol

quartz kindle
#

if you ever need a high performance npm lib

#

install the one that has "slow" in the name

#

and never the one that has "fast" in the name

opal plank
quartz kindle
#

oh i forgot

opal plank
#

vs object

#

good luck

crimson vapor
#

arrays and sets are stinky

#

maps are pog

#

objects are decent

quartz kindle
#

there is basically 0 difference on accessing, at least on jsben.ch

#

let me check bytecode

prime mist
#

The v8 engine has hyper optimized objects over the years, as every application uses them.

Over time, maps and sets will likely match their performance.

quartz kindle
#

Map and Set generate the exact same bytecode

prime mist
#

For has?

quartz kindle
#

ye

crimson vapor
#

is set a mapped object?

quartz kindle
#

Map/Set .has() ```js
45 S> 000000CBF41AE6C6 @ 0 : 1a 02 LdaCurrentContextSlot [2]
000000CBF41AE6C8 @ 2 : ac 00 ThrowReferenceErrorIfHole [0]
000000CBF41AE6CA @ 4 : c5 Star1
49 E> 000000CBF41AE6CB @ 5 : 28 f9 01 00 LdaNamedProperty r1, [1], [0]
000000CBF41AE6CF @ 9 : c6 Star0
000000CBF41AE6D0 @ 10 : 12 02 LdaConstant [2]
000000CBF41AE6D2 @ 12 : c4 Star2
49 E> 000000CBF41AE6D3 @ 13 : 5a fa f9 f8 02 CallProperty1 r0, r1, r2, [2]
000000CBF41AE6D8 @ 18 : 0d LdaUndefined
58 S> 000000CBF41AE6D9 @ 19 : ab Return

#

object [] ```js
38 S> 000002A734AAE6A6 @ 0 : 1a 02 LdaCurrentContextSlot [2]
000002A734AAE6A8 @ 2 : ac 00 ThrowReferenceErrorIfHole [0]
000002A734AAE6AA @ 4 : c6 Star0
000002A734AAE6AB @ 5 : 12 01 LdaConstant [1]
41 E> 000002A734AAE6AD @ 7 : 2b fa 00 LdaKeyedProperty r0, [0]
000002A734AAE6B0 @ 10 : 0d LdaUndefined
47 S> 000002A734AAE6B1 @ 11 : ab Return

#

object .hasOwnProperty() ```js
38 S> 0000033AB222E6AE @ 0 : 1a 02 LdaCurrentContextSlot [2]
0000033AB222E6B0 @ 2 : ac 00 ThrowReferenceErrorIfHole [0]
0000033AB222E6B2 @ 4 : c5 Star1
42 E> 0000033AB222E6B3 @ 5 : 28 f9 01 00 LdaNamedProperty r1, [1], [0]
0000033AB222E6B7 @ 9 : c6 Star0
0000033AB222E6B8 @ 10 : 12 02 LdaConstant [2]
0000033AB222E6BA @ 12 : c4 Star2
42 E> 0000033AB222E6BB @ 13 : 5a fa f9 f8 02 CallProperty1 r0, r1, r2, [2]
0000033AB222E6C0 @ 18 : 0d LdaUndefined
62 S> 0000033AB222E6C1 @ 19 : ab Return

zenith terrace
#

atMods spam

opal plank
#

So hasownproperty best?

quartz kindle
#

hasOwnProperty generates the exact same bytecode as Map/Set .has()

prime mist
#

object [] wins

quartz kindle
#

because in v8, all js objects are an instance of a v8 class

#

so all js methods are a cpp class instance method

#

obj.hasOwnProperty(), map.has() and set.has() are all the same method in cpp

#

in the same class instance, with slightly different properties

crimson vapor
#

isnt it better to use 'x' in Y rather than Object.hasOwnProperty()?

quartz kindle
#

x in y ```js
38 S> 0000023570D2E6A6 @ 0 : 12 00 LdaConstant [0]
0000023570D2E6A8 @ 2 : c6 Star0
0000023570D2E6A9 @ 3 : 1a 02 LdaCurrentContextSlot [2]
45 E> 0000023570D2E6AB @ 5 : ac 01 ThrowReferenceErrorIfHole [1]
42 E> 0000023570D2E6AD @ 7 : 70 fa 00 TestIn r0, [0]
0000023570D2E6B0 @ 10 : 0d LdaUndefined
49 S> 0000023570D2E6B1 @ 11 : ab Return

prime mist
#

maps and sets have more freedom with what you can use for keys. I guess that limits the optimization strategies.

quartz kindle
#

yes

#

Maps and Sets are miles better if you use numbers as keys for example

#

or bigints, or any other thing

#

if your keys are strictly strings, objects are better

prime mist
#

But to be honest, I would still use a Set. The code just looks nicer hah.

crimson vapor
#

whats the point of using a set other than just an array that can't have duplicated values?

prime mist
#

An array is quite different from a Set. A Set can only have unique values, and provides convenience methods for adding and deleteing values.

#

With arrays, to remove items, you have to do a bit of extra work.

quartz kindle
#

a Set is a hash table, an array isnt

quaint wasp
#

Why?

quartz kindle
#

because yes

#

you have 2 script tags

#

one of them is too much

quaint wasp
#

o right

#

I didnt see that lol

#

thanks

sudden geyser
#

also how about a <body> tag pls (even though it's optional)

quaint wasp
#

hmm

#

ya I have it in my other things

#

files

#

just not this one

#

its just for demostration

#

well

#

Just for server.

lament rock
#

Looks like Discord is starting to roll out threads

#

ignore the fact that my logic to handle threads is flawed

prime mist
#

What is thunderstorm?

blissful coral
#

Anyone using kurasuta here rn? UwU

lament rock
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

crimson vapor
lament rock
#

open

crimson vapor
#

O

lament rock
#

gh only

crimson vapor
#

Bruh

#

No src kekw

lament rock
#

theres a different tree for src

sudden geyser
#

Does Postgres have a built-in type for all language tags or some standardized way of validating a language code (en-US, en-BZ, zh-HK, etc.)?

rocky hearth
#

in react, how is anonymous function component is different from the regular one?

#

which should be used when?

prime mist
#

What do you mean by a regular one? class based components?

lyric mountain
sudden geyser
#

I want to support multiple languages.

lyric mountain
#

They have no name nor reference

lyric mountain
#

Like, you're not supposed to do i18n through database

sudden geyser
#

I thought so too, but given the structure of my platform, it doesn't look feasible to not store multilingual content. Let's illustrate like so:

CREATE TABLE articles (
    id uuid DEFAULT gen_random_uuid() NOT NULL
        CONSTRAINT articles_pkey
            PRIMARY KEY
);

An article can also have a title and body column. If I want this article to be viewable by users with different languages, there are many methods, but one method that's come to my mind is having a base translations table and a middle man table between articles and translations for the columns (there may be better ways to accomplish this).

Hence, I may have a translations table with an id, language, and content column. I want to verify the language input so it isn't nonsensical. If there are better ways to handle multilingual content, I'm open to suggestions.

lyric mountain
#

Just remember that this will result in 1 call for every time it needs said localization

#

You can create multiple columns, one for each lang or have a big column and store a json in it

#

The json method also has the advantage of caching

sudden geyser
#

I'd prefer to avoid storing translations in JSON.

lyric mountain
#

Then use any other data format

#

Property structure is also a good option

#

You could also use a global i18n table

#

And use table names as a column

#

That way you could inner join them

#

While keeping flexibility to add any amount of locales to any table just by adding a new row

blissful coral
#

@umbral zealot do you know HTML

#

Need some help with something

umbral zealot
#

I mean... yeah sure

#

I can try

blissful coral
#

ok

#

so

#

document.getElementById("button_id").submit()

#

This works in the console of inspect

#

but when I run it through a script tag

#

it doesn't work

#

no error or anything

umbral zealot
#

so, script tags put at the top of your body or in the header will not work on elements inside the body. Scripts tags at the end will be able to read those elements. Because the page is read top to bottom, sort of like javascript is yeah?

#

So you have 2 choices

#

move the script tags to the bottom

blissful coral
#

Yeah ik that

umbral zealot
#

OR ```js
window.onload = function() {
// do things here
};

Then it can be at the top
blissful coral
#

All of the script imports from my external js files are at the bottom

#

I have already confirmed the file exists and it can see it

umbral zealot
#

Alright ok

#

did you make sure this code was running in the first place?

blissful coral
umbral zealot
#

I thought this had an ID?

blissful coral
#

its a get by class name

#

sorry

umbral zealot
#

Oh Extreme. You know how this works! Fake code gives you fake answers, pseudo code gives you pseudo answers. Real code gives you real answers ๐Ÿ˜‰

quaint wasp
#

so..

blissful coral
quaint wasp
#

This is my avatar command: ```js
module.exports = {
name: 'avatar',
description: 'Shows you your avatar, or someone elses avatar!',
usage: '(@user)',
execute(client, message, args) {

    if (!message.mentions.users.size) {
        return message.channel.send(`Your avatar: ${message.author.displayAvatarURL}`);
    }

    const avatarList = message.mentions.users.map(user => {
        
        return (`${user.username}'s avatar: ${user.displayAvatarURL}`);
    });

    message.channel.send(avatarList);

}

}

#

And it sends shit.

blissful coral
#

ah

#
document.getElementById('button_form').click()
#

This is at the end

lyric mountain
#

Colored?

blissful coral
#

Don't mind my shitty formatting and stuffs

lyric mountain
#

Client mods eh?

blissful coral
sage bobcat
blissful coral
sage bobcat
#

One message removed from a suspended account.

blissful coral
umbral zealot
#

sooooo

#

where's button_form exactly?

umbral zealot
#

OH it's right under

#

sorry

blissful coral
#

๐Ÿ‘ lul

umbral zealot
#

Ok here's a good question

#

why not just do a form.submit() directly?

blissful coral
#

Its with the select pure forms I am using I gotta convert them into a select thing

#

.submit() instead of .click()

#

I tried that and got the same problem

umbral zealot
#

so document.myform.submit() ?

blissful coral
#

here we go

#

document.forms.dashboard.submit()

umbral zealot
#

if you had like <form id="myform"> you could use the above

#

then again

blissful coral
#

okee

umbral zealot
#

you're using javascript you could just straight-up POST this bitch yourself

#

ยฏ_(ใƒ„)_/ยฏ

blissful coral
#

true

sudden geyser
#

You could also use a global i18n table
And use table names as a column
That way you could inner join them
While keeping flexibility to add any amount of locales to any table just by adding a new row
@lyric mountain is the i18n table a solution to validating the language? For example, to store the language code then to require a foreign key on another table? Or is this still incorporated with storing it with a format like JSON (I'd like to only store it in SQL in general)?

umbral zealot
#

Sorry I know I'm throwing a completely different solution your way

#

but I haven't dealt with native JS in like 3 years

blissful coral
#

Yeah same

#

I wrote that script fucking months ago

#

But I only just now am actually going to release

lyric mountain
#

B is the worst

#

C is probably the best solution

#

Create a table with 4 columns: id, table, locale and value

#

Have id as auto increment, table being the referred table's name, locale being lang code (like en-US) and value being the text itself

slim jasper
#

is application bot dashboard down?

lyric mountain
#

Inner join it by table name and retrieve desired localization by locale code

lyric mountain
slim jasper
#

waht server

lyric mountain
#

Not its listed bots

sudden geyser
#

I'm a bit confused on the solutions, but I'll try it out

idle spruce
#

Does someone know how to change the cooldown on the Naruto botto?

#

@bronze vault can u please help?

lyric mountain
#

Wrong server my boy

idle spruce
#

I'm new sorry

#

But can u help?

lyric mountain
#

Nope

#

Ask in their support server

idle spruce
bronze vault
#

o twas resolved

sudden geyser
#

@lyric mountain, regarding my question on storing multiple languages in databases, I ended up with a solution where I have a languages, articles, and articles_translations table. Although I'm unsure of which category the implementation falls under (maybe A or B?), I've learned a lot and come closer to solving my problem. Thanks for the help

clear marlin
#

yeah.sql

sudden geyser
#

yeah

earnest phoenix
#

can anyone help with the auto role command on Discord Bot Designer?

sage bobcat
#

One message removed from a suspended account.

clear marlin
#

try real coding

earnest phoenix
#

I'd rather do it there

clear marlin
#

your wish, but its still better coding anyhow

earnest phoenix
#

how do i make commands so that only i can use it? im new to javascript so sorry if it's easy

clear marlin
marble juniper
#

also you don't need brackets for that if statement

clear marlin
#

whatever you like

clear marlin
storm moat
#

6663030466

marble juniper
#

no

#

!==

#

lol

clear marlin
#

we aren't comparing types are we?

#

!== is needed only when you're comparing two types

pale vessel
#

it's good practice to always use !== and ===

marble juniper
#

yes

earnest phoenix
#

It compares the values and the type, not type only.

marble juniper
#

Its always good to use !== and ===

earnest phoenix
#

๐Ÿฆœ

marble juniper
#

lol

clear marlin
#

why should you compare two strings with !== anyways

marble juniper
#

just always use !==

#

or ===

clear marlin
#

I get it its a good practise maybe

marble juniper
#

no reason not to

#

I never use == in my code even once

pale vessel
#

if you're sure they're both string whatever

#

but if one of them is a number, 12 == "12" would be true

clear marlin
#

well isn't discord ids a string

marble juniper
#

also consistency

pale vessel
clear marlin
#

see the topic that was took up

pale vessel
#

well not in js

marble juniper
#

in discord.js ids are strings

#

lol

earnest phoenix
clear marlin
pale vessel
#

inb4 message.channel.id === 272764566411149314n

clear marlin
#

the strict equals and not equals operator compares types and values, when you're sure of the type why compare both

earnest phoenix
#

+1

pale vessel
#

fair

#

for me I would like to have my code consistent

clear marlin
#

anyhow, it would still yield the wanted bool

worn sonnet
#

yo!

marble juniper
worn sonnet
marble juniper
#

code consistency is also a good thing

worn sonnet
earnest phoenix
#

discord pain

slender thistle
#

bot.wait_until_ready

sudden knoll
#

shivaco I made my class creator script

worn sonnet
#

I'm using some additional lib DiscordUtils

Traceback (most recent call last):
  File "C:\Users\arfatha\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "D:\FreakoAnime(Git)\FreakoAnimeBot\lib\cogs\invite.py", line 69, in on_member_join
    inviter = await self.tracker.fetch_inviter(member)
  File "D:\FreakoAnime(Git)\FreakoAnimeBot\lib\cogs\invite.py", line 25, in fetch_inviter
    for cached_invite_key in self._cache[member.guild.id]:
KeyError: 756170101010464881```
slender thistle
#

What the hell is that lib

earnest phoenix
slender thistle
sudden knoll
#

I can send again

slender thistle
#

Ty Kryp

sudden knoll
#

doesn't do parent classes or anything

#

but good for lazy me

slender thistle
#

DM me instead I'm on my phone rn

worn sonnet
worn sonnet
sudden knoll
fresh verge
#

How do I select a message by its ID?

slender thistle
#

Embed pagination can be easily done via the paginator package

sudden knoll
worn sonnet
#

inviter = await self.tracker.fetch_inviter(member)

sudden knoll
#

I think member should be a Member obj

worn sonnet
#

yeah it's a member object

#

i passed the member obj

sudden knoll
#

oh, I thought you were sending an id

#

b/c the KeyError was just an id

worn sonnet
#

the problem occurs within the lib function

sudden knoll
#

discordUtils isn't new so I'm honestly kinda surprised it has bugs

#

oh maybe it is new

#

and I'm just bad

worn sonnet
#
    async def fetch_inviter(self, member):
        invited_by = None
        invs = {}
        try:
            new_invites = await member.guild.invites()
        except discord.errors.Forbidden:
            return
        for invite in new_invites:
            if not invite.inviter in invs.keys():
                invs[invite.inviter] = []
            invs[invite.inviter].append(invite)
        for new_invite_key in invs:
            for cached_invite_key in self._cache[member.guild.id]:
                if new_invite_key == cached_invite_key:
                    new_invite_list = invs[new_invite_key]
                    cached_invite_list = self._cache[member.guild.id][cached_invite_key]
                    for new_invite in new_invite_list:
                        for old_invite in cached_invite_list:
                            if new_invite.code == old_invite.code and new_invite.uses-old_invite.uses >= 1:
                                cached_invite_list.remove(old_invite)
                                cached_invite_list.append(new_invite)
                                return new_invite_key
                                break
        else:
            return None
#

this is the function

#

for cached_invite_key in self._cache[member.guild.id]:
at this point it gives me the key error

earnest phoenix
clear marlin
#

see

earnest phoenix
clear marlin
#

you don't need to cache that was my bad

earnest phoenix
#

still didn't work, here's my code :

 if (message.content.startsWith('invite')) {
  let invite = message.channel
   .createInvite({
    maxAge: 0,
    maxUses: 0,
   })
   .catch(console.error);
  message.channel.send(invite);
 }
});```
#

where should i place it?

clear marlin
sudden knoll
earnest phoenix
clear marlin
#
client.on('message', async (message) => {
if(message.author.id != "YOUR_ID")
return;
 if (message.content.startsWith('invite')) {
  let invite = message.channel
   .createInvite({
    maxAge: 0,
    maxUses: 0,
   })
   .catch(console.error);
  message.channel.send(invite);
 }
});
earnest phoenix
#

thanks

clear marlin
#

and remember to add Your user id to "YOUR_ID"

#

as a string ofc as I did

earnest phoenix
#

k

sudden knoll
#

is there an isOwner param for the command constructor?

#

idk b/c I don't do js

clear marlin
#

no, ig you need to create a function

worn sonnet
sudden knoll
#

I just saw this

clear marlin
#

oh well

#

you can use that too

#

doesn't matter does it

#

it'd still yield as you want it to

sudden knoll
#

the except and else

earnest phoenix
#

lol

sudden knoll
#

lmao

#

recursive calls baby

#

your bot is reading its own messages

wheat mesa
clear marlin
#

yeah ^^

earnest phoenix
#

oh lol

worn sonnet
#

on_message ?

#

my bad, my bad...

#

I fcking didn't cached invites on the go

earnest phoenix
sudden knoll
#

similar to what you already did

earnest phoenix
#

how? im on my phone now cause my pc's lagging, should i turn off the bot first? it's flooding me

sudden knoll
#

lmao yes

#

why is it still running

earnest phoenix
sudden knoll
#

just ctrl c?

earnest phoenix
sudden knoll
#

kill pid

earnest phoenix
#

okay done

#

finally no more spams

#

so how can i fix it?

sudden knoll
#

same thing as what you did with verifying that you're the owner

#

just the opposite

earnest phoenix
sudden knoll
#

well you can't just change it otherwise you'll remove the functionality that you just put in

#

you need to add another check

#

if id === botID { don't send the message }

earnest phoenix
#

aight

#
return message.channel.send("Hey you're not allowed to use this!");
if(message.author.id != "Bot's ID")
return;
 if (message.content.startsWith('invite')) {
  let invite = message.channel
   .createInvite({
    maxAge: 0,
    maxUses: 0,
   })
   .catch(console.error);
  message.channel.send(invite);
 }
});```
#

@sudden knoll like that?

sudden knoll
#
if(message.author.id != "My ID")
  return message.channel.send("Hey you're not allowed to use this!");
if(message.author.id != "Bot's ID")
  return;
if (message.content.startsWith('invite')) {
  let invite = message.channel
  .createInvite({
    maxAge: 0,
    maxUses: 0,
  })
    .catch(console.error);
  message.channel.send(invite);
 }
});
sudden knoll
clear marlin
#

ah k

sudden knoll
#

Also I code in python so idk the specifics

restive furnace
#

ngl u could just do if (message.author.bot) return

sudden knoll
sudden knoll
#

would have no difference on the actual code

earnest phoenix
#

it still does the same thing

sudden knoll
#

well it should be === bot id

#

not != bot id

earnest phoenix
#

k

#
if(message.author.id != "myid")
  return message.channel.send("Hey you're not allowed to use this!");
if(message.author.id === "botid")
  return;
if (message.content.startsWith('invite')) {
  let invite = message.channel
  .createInvite({
    maxAge: 0,
    maxUses: 0,
  })
    .catch(console.error);
  message.channel.send(invite);
 }
});```
#

@sudden knoll i tried doing this it still didn't work

sudden knoll
#

probably b/c you're checking if it's you before if it's the bot

#

ie it returns before it checks

earnest phoenix
#

aight, ill try to switch it up

sudden knoll
#

idk what you mean by try but ok

earnest phoenix
#

so check the bot id then mine right?

earnest phoenix
sudden knoll
#

np

earnest phoenix
#
if(message.author.id === "myid")
  return;
if(message.author.id != "botsid")
  return message.channel.send("Only moderators can use this!");
if (message.content.startsWith(prefix + "invite")) {
  let invite = message.channel
  .createInvite({
    maxAge: 0,
    maxUses: 0,
 })```
#

@sudden knoll now whenever someone (except for me) typed smth, it will reply only moderators, what's wrong?

sudden knoll
#

probably b/c you're not tying this to a command

#

this is just on message

earnest phoenix
sudden knoll
#

uh

#

have you made a bot before?

earnest phoenix
sudden knoll
#

you might wanna go do some research

earnest phoenix
#

aight

drifting quartz
#

I NEED VERIFY BOT DEVELOPER ROLE

near stratus
#

A D V E R T I S I N G

#

@rustic nova

#

tried to ping everyone lol (Learn about permissions first)

#
  • advertising
rustic nova
#

@drifting quartz don't advertise

sudden knoll
#

python ppl, apostrophes or quotation marks?

earnest phoenix
#

dont really matters

sudden knoll
#

yeah but what's your preference

earnest phoenix
#

" mostly

sudden knoll
#

when do you use '

drifting quartz
earnest phoenix
prime mist
sudden knoll
#

they're not regulated by PEP8

rustic nova
gilded plankBOT
#

@drifting quartz

Due to a large amount of people submitting bots or creating bots in hopes to get the badge, Discord decided to remove the badge grant for users submitting bot after August 19, 2020. The badge was hence renamed from Verified Bot Developer โžœ Early Verified Bot Developer. Hence, devs who were whitelisted early were still given the badge, but if you submit a bot now, you won't get the badge. If you have questions, please go to Discord's Developer Server

rustic nova
#

Still not a reason to advertise

rocky hearth
#

in ts, can I declare an array of unique values?

woeful pike
#

yes it's called a set

spare badger
#

Use the 'any' type

#

Oh

rocky hearth
#

no not set

prime mist
#

You might need to explain yourself some more

woeful pike
#

uniqueness is a property of a value, not a type. You can't represent something like that using types unless you're using dependent types which typescript doesn't support

#

and never will

rocky hearth
#

actually, I wanted to store some css classes in an array. And was hoping if it could give error if I try to do
const cssClasses = ['class-a', 'class-b', 'class-a']

woeful pike
#

yeah that's just not possible. Your best bet is to create a new data type that validates the input when you construct it where you can assume every value in that object will be unique

woeful pike
#

also duplicate css classes shouldn't really be an issue

rocky hearth
#

I'm toggling them one by one, on same element. So...

woeful pike
#

then yeah set will do exactly what you want

#

unless you specifically want an error and not deduplication

prime mist
#

Yeah if you want an error, then you will need to wrap the set with some logic.

#

Do it at runtime

#

Which isn't what you are after so ignore that.

woeful pike
#

what you want is possible if you're using a language like idris mmLol

earnest phoenix
#
const discord = require('discord.js');

exports.run = async (client, message, args) => {

    const notCeo = ":x: - **You cannot partner with other servers!**"

    var ceos = [
        831843196023210005, //me
        502842980051320833, //jerry
        763694034375802910 //erim
    ]

    if(message.author.id.includes(ceos)){

    const server_name = args[0]
    if(!server_name){ return message.channel.send(":x: - Please enter the **server name**!") }

    const description = args.slice(server_name.length).join(" ")
    if(!description){ return message.channel.send(":x: - Please enter a **server description!**") }
    if(!description.includes("discord.gg")){ return message.channel.send(":x: - The description must includes an **invite link**!") }

    const partnerChannel = message.guild.channels.cache.get(844144155110146069)
    if(!partnerChannel){ return }

    const embed = new discord.MessageEmbed()
    .setTitle(server_name)
    .setColor(client.config.embedColor)
    .setDescription(description)
    .setFooter(server_name)
    .setTimestamp()
    partnerChannel.send(embed)

    message.channel.send("**Nice**, a new partner \:)!")

    } else {
        return message.channel.send(notCeo)
    }

}

my bot still says that i cannot partner. does anyone know wheres a fault?

sudden knoll
earnest phoenix
#

nope

sudden knoll
#

you should do that

woeful pike
#

I really wanna spend more time learning but it's not popular so the tooling is pretty bad pensiveee

sudden knoll
#

have your prefix be "" lol

#

nah just do it in the on_message event

frosty valve
#

what makes so this code doesnt work?

 let id = args.slice(0).join(" ");
    if (!id) return message.channel.send("I need an ID to give you info on this anime >:(!");

    Anilist.media.anime(id).then(data =>``` it gives right id. But the error it gives is "Error: Term provided is not a number!"
woeful pike
#

because it's not a number

frosty valve
#

I tried to do console.log on the id and it gives out a number

clear marlin
#

isn't the id supposed to be a string?

#

because the args is a string

worn sonnet
#

umm...

clear marlin
#

a array of strings

worn sonnet
#

is there any other way to check if a user has updated their roles

#

other than on_member_update

earnest phoenix
#

Not really

frosty valve
#

can I convert the string to numbers on any way?

earnest phoenix
#

I mean, you can dispatch your own event there

clear marlin
#

why don't you do a explicit type conversion @frosty valve

#
Number(str)
#

like here str is id

frosty valve
#

Thanks for the help! Worked

clear marlin
#

np

rocky hearth
#

I ve heard that, using array index as key for a react component is a bad.
But it isnt bad, if the number of these components won't change, right?

split hazel
#

who told you that's bad

#

pretty sure that's the documented way of indexing components

#

I've always used the index as the key for components and never had any issues so you'll probably be fine

#

@rocky hearth

rocky hearth
#

it bad bcoz, if array changes, the index also change. And all (not exactly) components get rerenders

split hazel
#

but then react will reiterate and apply new keys upon rerendering (i think)

#

though doesn't sound that efficient so not sure

#

but you should stick to the index i don't use react much but if you start running into issues you can use something else

rocky hearth
#

yeah, sure. Its just about perfomance concerns
but still wants to know, what experts has to say. ๐Ÿ˜

clear marlin
lavish bramble
#

Can anyone suggest me Any reaction gif api?

clear marlin
#

giphy

lavish bramble
#

But its not work in embed

#

Bcz its not direct URL to the gif

spare badger
earnest phoenix
#

any one say how add react in embed like this type pls

#

node.js

clear marlin
#
message.channel.send("Message").then(msg=> msg.react(":white_check_mark:")).catch(err=>{
console.log(err);
message.channel.send("could not react");
})
clear marlin
#

โœ…

earnest phoenix
#

for me

sudden knoll
#

you can also do unicode

earnest phoenix
#

bro

#

๐Ÿ‘€

earnest phoenix
#

command

#

and

austere delta
#

H

earnest phoenix
#

bhie

#

pls see up

sudden knoll
#

emoji id

earnest phoenix
#

how i want

austere delta
#

what is the problem

sudden knoll
#

huh

old latch
#

wtf