#development
1 messages ยท Page 1754 of 1
@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.
@umbral zealot
Well... It works now right?
If it works it works
doesn;t
I want a command where it says / fesseln and the bot should answer du fesselst jemanden
slash or prefix
Sounds like your first step is to learn a programming language
lol
No matter
Dude how long have u been coding?
you need to check if support me is in the s.name, not discord.CustomActivity
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
Just wanted to know
if it's a simple prefix, then that's a youtube vid away
if it's slash commands https://discord.com/developers/docs/interactions/slash-commands
Are you discriminating against me because my English is bad?
No, I'm not
ty
That's a good support really๐
Your first step is to learn a programming language
Wtf
like javascript. or python.
Cuz I see u use channel_id in bot.get_channel()
But where did u assigned the channel_id
Stop trying to ping me jesus christ.
Aha
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.
I will reply your message
HAHAHAHA JOO WTF
You can do that without pinging, thanks.


they're saying you need to learn a programming language
programming language != english
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.
No I code in English
English isn't a programming language
I mean... Python = English?
Yeah
y'all need to read the room, and jokes. lol
thats
Xd
I know sarcasm is hard to read but wow, that was obvious as hell
Oke me sorry that was the bad joke
wait which joke are we talking about
Yeah that was old code
But I'm reading the discord channel? not the room?
@umbral zealot best place to learn py or js?
You are to blame why I find the server unsympathetic That's my opinion@umbral zealot
the docs
I code in python and I'm teaching my elder sis to code in c
lmao
@worn sonnet @deep mantle Just want to say thanks for all the help and I got it working!
ok well sue me or pay me, either works.
your welcome!
If it works it works now don't touch it
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.
I know what to do just did not now customactivity and how to check.
Oke
who you talking to here?
pacificlife
oh ok
I don't speak german, kthx.
what is your question
imagine speaking german
still do'nt speak german.
oof
ah that one looks insulting
I say you cool of German @umbral zealot
#general-int for german ig
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
Do you know javascript or python
no you're not rude wtf
I know I'm not, but they think I am ๐
why the hell is this becoming general chat though
ยฏ_(ใ)_/ยฏ
If anyone needs help, please do speak up, we're there to assist, don't worry ๐
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
it's your instagram scrapper
easy money
cool but why here
nice
Wanted to share I guess
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 ^_^
Google IO soon ๐
he insulted your mom.
lmao
Oh thanks Woo. That's what I was thinking.
Lite you're back from school?
but good job with the fat cash.
just a heads up, rule one #rules-and-info
Nah
Yup, that was the rough translation
Where can I complain about a team member?
Still in
Ah
said he'd kiss ur dog if you kept that going
You can say so cuz I override most the functions in library
weird flex
dude, do you know javascript or python?
@earnest phoenix please don't be rude to other people, doesn't matter what language 
next one is definitely a mute
my dog is very friendly and would love it. Alright. Let's go back to support please 
resources here then #development message
highly likely there is
Bye i quit the server
wheres my bot when we need it? i had a tag with all that in it
bye
i think it`s almost the same
Oke cya soon when
he never answered my question :(
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
Yeah just syntax
Ive grid of 10 cols having 100 children. (making 10x10 grid)
How can I select the corner child elems with csss?
but its saying to make main.py
syntax?
make main.js lol
that's just the main module
ok
idk
That's just file name
then search another tutorial
Karen, is that you?
but the basics are tne same
there are a lot of tutorials out there
Google IO in 15 seconds
@wind kayak see https://anidiots.guide/ for help in creating a discord bot in javascript, assuming you already know JS
1st child, length child, length * height child, last-th child
thats the formula you'd have to use
not that need to make 24/7 free
unless you add an id to them, you'd have to iterate
There are also information in that guide about how to do that
for both repl.it and heroku
I'll check this
using uptimerobot in repl.it
gross
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
@umbral zealot can you guide me use uptimerobot in replit in js?
I was thinking to add this same cmd for my bot too, will it cause any prob in bot approval?
did you maybe want to take a look at the page I linked? there are links on the left
wdym
Umm... Just yes or no will be good enough
application_id I suppose
yeah i want look at the page
but how i link it with replit
read the page
k
any language repl supports
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
can I do that with a formula like this nth-child(an-b) ?
I also wanted to select the first and last col except the corners
Just wanted a def answer, but I can always create another commit to try it
its POST /webhook/<application_id>/<interaction_token>
@umbral zealot best paid hosts?
that's highly subjective.
best? id go with a bigger company like digital ocean. might be more expensive, but very reliable.
yes but for starting
I like galaxygate b/c $3
something with a accessible price and good
galaxygate is my recommendation too, but not when saying best.
that is fair
I can only answer that with the host I tried and trust, not with which specific one is "the best"
what is it?
vultr
aight thx
good vps services
not sponsored
Is it possible to trigger a bot command with a Webhook ?
Example webhook message: !check <id>
And the bot response to that
you'd not need to use a webhook for that
Yeah. Check for message.webhookID
an api call would be more fitting
oh wait, what kind of webhooks are we talking about?
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
๐
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?
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
Funny story, no one knows what you mean by "a valid command on behalf of the bot"
and also we won't spoonfeed you an answer.
she`s prolly russian
lemme talk to her
ัะฐะบ ะทะฝะฐั
ok but not in this channel
ัั ััััะบะฐั?
Go to #general-int if you want to go the russian route
-noru
ะั ะผะพะถะตัะต ะณะพะฒะพัะธัั ะฟะพ-ััััะบะธ ะฒ #general-int.
ะัะปะธ ะะฐะผ ะฝัะถะฝะฐ ะฟะพะผะพัั ั top.gg, ะั ะผะพะถะตัะต ะพะฑัะฐัะธัััั ะทะฐ ะฟะพะผะพััั ะฒ #support.
I could substring the first character but it's not really good practice
huh
Continuing conversation from #site-translators xD
standard practice in these cases is that you always have a preceding slash, and never the trailing slash.
Then the path should have the first character removed
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

Basically it works like this
However the path has a beginning slash which should be removed
yeah conventions would have you put the /api inside the path itself on the second line
Yea
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
Or just keep it like that and I put the /api at the beginning of the suffix
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
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
I think we should just change the paths being passed in that case
substring also ruins absolute urls
So change to that
I think this looks cleaner anyways
yeah if you just search for <HTTPHeader you should be able to find all the usages
how about using querystring instead
like user?=userid
No, that's not how APIs should work
That's more for options
APIs can work that way
it's not restful
Yeah get it
I personally think no trailing / is better
All righty
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?
Use create_task or similar APIs, the ratelimit will still hit you though
Why it returns me false and how can I check if json has not any key
check Object.keys(theobject).length
two separate objects do not equal each other in javascript
Good evening, who has a team so that you can write on behalf of the bot, I work with js, I will be grateful
weren't u already told that we don't do spoonfeeding here already?
there is always a kind person who will help
I might have helped had it not been for that, sry
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
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
You can post the full code in a personal, if it does not make it difficult for me
no
If you don't know how to write this yourself, you should consider learning javascript first.
In a personal?
A DM?
Please do not spoonfeed others.
I'm not, I'm just confused
doesn't matter what "a personal" means, tbh
Maybe, but I was just wondering
Just bad translations
Guess so
spoonfeed me a pizza please
in a personal
Great reply :/
It's a very personal reply don't you think? 
Which language?
discordjs
Welp, I'm out again
it is a pity that no one helped; (
Basically, you'd edit the message itself with the new embed data
because she's not there)
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)
Discord.py with async praw
resolve the coroutine by awaiting it
yes
You should've tried it first before asking doe 
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
ok but now i get another problem
language discord.js
for submission in top:
TypeError: 'ListingGenerator' object is not iterable
...
send the error message before checking the cooldown, or, delete the cooldown on error.
I haven't used it, but it looks like an async iterator, try doing async for ... instead
but how?
Ok I didn't even know that exists
if(err){
setTimeout(() => time_stamps.delete(message.author.id), cooldown_ammount);
}
this way?
yes but now with real code
Specifically under what exact circumstance do you want to delete the cooldown
i did a give command
and the syntax is
.give moneyammount @ user
but a lot of people invert user and moneyammount
Now it works but it's very slow and some times a poop will show not the image
and they have to wait
sorry for pinging
lol
you could only do the cooldown on a successful command
I understood completely what the issue was
but then you would need to handle it another way
Try logging the URL, it might be a video. As for it being slow, not sure if it's on your end
pls help me ๐ฆ
I did
evie comes to this channel to practice patience
My bot is hosted on repl.it and also wdym try logging the url?
if u want to kill someone I'm here, I dont want to live anymore
Unfortunately it will very often end like this:
@stiff lynx please read this #development message
I am new to praw
Just print the url, I haven't worked with the Reddit API for a while. So not sure if url will return the image url.
unfortunetly I know all the things that teached me ad university
in a 6 months cours
On javascript?
yes lol
They took 6 months to teach you but didn't bother saying you should use camelCase variable names, or how modules and promises work?
what do you expect from a teacher that for an stupid output make you write a 8 miles long code line
I agree
How much reaction can I fetch at once?
Message reactions?
Yes
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
I am using discord.js
If i have 1234567890, how to replace the 5 last caracters with * ?
I'm pretty sure you have to rely on cache which you can't in this case since the message is a partial
message.fetch() gets you a list of reactions
Ah
Okey but how much?
then reaction.fetch() gets you a list of users
Isn't it has a limit?
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
There's no limit
Someone said you can only reach 100 person who reacted the message with same reaction
yes, max is 100
So you want a list of users for a reaction
Yes
Is the limit 100?
to get more than 100 you need to make multiple requests
I get it thanks
realistically tho, will your bot ever get more than 100 reactions?
in a single message
In giveaways yes
dude have you never seen discord giveaway bots?
i mean sure, its possible, and its good to account for such cases
they have 50k+ reactions
i have not lol
lmao
Are giveaway bots using multiple request?
If i have 1234567890, how to replace the 5 last caracters with * ? (Ping me)
I tried to store users in database when they react but that means a lot of database query
Use the after option (with the latest user ID from the last payload) and keep calling the method until you're done https://discord.js.org/#/docs/main/stable/class/ReactionUserManager?scrollTo=fetch
no, they are using messageReactionAdd event
Is this even recommended
Me?
Nop
K
like my said?
Is the string guaranteed to have over 5 characters?
If so then you can just slice the last 5 characters and add 5 *'s
this
yes
But what if someone spam it
It's better than making multiple requests to discord API
Database calls are fast so you don't need to worry about speed
Use String.prototype.slice() to cut out the last 5 characters with passing 0 as the first parameter and -5 as the second, then you can append 5 *s to the string
listening to reactions is not that hard
The problem is not listening
even in very large servers, you're looking at max like 100 per second
I am just wondering about database queries
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
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.
yes
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.
OH GOD WHY]
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
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.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
not really
why even build your own command handler?
One message removed from a suspended account.
wrong
you can use detritus in js
^^
One message removed from a suspended account.
u meh
One message removed from a suspended account.
dont talk shit bout my lib
plus side is that it has a built in command handler

One message removed from a suspended account.
One message removed from a suspended account.
sounds like wasted effort to me
One message removed from a suspended account.
One message removed from a suspended account.
then dont use it
ig as long as you're havin fun
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.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
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
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.

Software developers are virtual architects
software developers are lazy assholes
yeah that too
Laziness can be a great thing, but there is also bad laziness lol.
in the mind of a master procrastinator
remember, 5 hours of fucking around can save you 5 minutes of reading docs
so five hours and five minutes
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
Sometimes you need the 5 hours of mucking around to wrap your head around the issue though.
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
๐
I would generally go for easy to understand code over speed, until speed is an issue ๐
speed > *
but well
in most cases, high performance code is still very readable
at least mine is lel
Spoken like a true developer lol
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
speaking of which, did u test set() vs array vs map<id, 0>
oh i forgot
there is basically 0 difference on accessing, at least on jsben.ch
let me check bytecode
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.
Map and Set generate the exact same bytecode
For has?
ye
is set a mapped object?
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
atMods spam
So hasownproperty best?
hasOwnProperty generates the exact same bytecode as Map/Set .has()
object [] wins
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
isnt it better to use 'x' in Y rather than Object.hasOwnProperty()?
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
maps and sets have more freedom with what you can use for keys. I guess that limits the optimization strategies.
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
But to be honest, I would still use a Set. The code just looks nicer hah.
whats the point of using a set other than just an array that can't have duplicated values?
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.
a Set is a hash table, an array isnt
also how about a <body> tag pls (even though it's optional)
hmm
ya I have it in my other things
files
just not this one
its just for demostration
well
Just for server.
Looks like Discord is starting to roll out threads
ignore the fact that my logic to handle threads is flawed
What is thunderstorm?
Anyone using kurasuta here rn? 
a lib I made to resemble Discord.js but without any caching
One message removed from a suspended account.
One message removed from a suspended account.
Itโs closed source right?
open
O
gh only
theres a different tree for src
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.)?
in react, how is anonymous function component is different from the regular one?
which should be used when?
What do you mean by a regular one? class based components?
Validating lang?
Like, why?
Anon func is basically arrow function
I want to support multiple languages.
They have no name nor reference
Wouldn't that be code-side?
Like, you're not supposed to do i18n through database
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.
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
I'd prefer to avoid storing translations in JSON.
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
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
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
Yeah ik that
OR ```js
window.onload = function() {
// do things here
};
Then it can be at the top
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
I thought this had an ID?
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 ๐
so..

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.
Colored?
Client mods eh?
https://stormbeatz.extreme-is.me/js/select-pure-forms.js if you wanna see the file yourself
One message removed from a suspended account.
One message removed from a suspended account.
๐ lul
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
so document.myform.submit() ?
okee
you're using javascript you could just straight-up POST this bitch yourself
ยฏ_(ใ)_/ยฏ
true
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)?
Sorry I know I'm throwing a completely different solution your way
but I haven't dealt with native JS in like 3 years
Yeah same
I wrote that script fucking months ago
But I only just now am actually going to release
I've given 3 solutions:
A - Store i18n in a big fat column containing translations
B - Store i18n as individual columns
C - Store i18n in a global lookup table
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
is application bot dashboard down?
Inner join it by table name and retrieve desired localization by locale code
Wrong server to ask
waht server
I'm a bit confused on the solutions, but I'll try it out
Does someone know how to change the cooldown on the Naruto botto?
@bronze vault can u please help?
Wrong server my boy

@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
yeah.sql
yeah
can anyone help with the auto role command on Discord Bot Designer?
One message removed from a suspended account.
discord bot designer is not encouraged lmao
try real coding
I'd rather do it there
your wish, but its still better coding anyhow

how do i make commands so that only i can use it? im new to javascript so sorry if it's easy
if(message.author.id != "YOU_ID"){
return message.channel.send("Hey you're not allowed to use this");
}
aight, thanks
why get the user by cache when you can just compare the ids normally instead
also you don't need brackets for that if statement
whatever you like
it doesn't matter
6663030466
better?
^^
we aren't comparing types are we?
!== is needed only when you're comparing two types
it's good practice to always use !== and ===
yes
It compares the values and the type, not type only.
Its always good to use !== and ===
๐ฆ
lol
why should you compare two strings with !== anyways
I get it its a good practise maybe
if you're sure they're both string whatever
but if one of them is a number, 12 == "12" would be true
well isn't discord ids a string
also consistency
ik that
in some libraries they are
see the topic that was took up
well not in js

yeah so its feasible with any of them 
inb4 message.channel.id === 272764566411149314n
the strict equals and not equals operator compares types and values, when you're sure of the type why compare both
+1
anyhow, it would still yield the wanted bool
yo!
same
So i'm trying invite logging with discord.py
code consistency is also a good thing
How do i make sure bot cache is fully ready before it connects
discord pain
bot.wait_until_ready
shivaco I made my class creator script
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```
What the hell is that lib
O, where
I can send again
Ty Kryp
DM me instead I'm on my phone rn
copy pasted the exact same code
helpful for embed pagination or fetching invites and all
I think member should be a Member not an ID
How do I select a message by its ID?
Embed pagination can be easily done via the paginator package
fetch_message(ID)
the current requirement is invite logging
inviter = await self.tracker.fetch_inviter(member)
I think member should be a Member obj
the problem occurs within the lib function
discordUtils isn't new so I'm honestly kinda surprised it has bugs
oh maybe it is new
and I'm just bad
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
it gives me illegal return statement
ohh ok
you don't need to cache that was my bad
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?
surround with ` x3 plz
before the if statement
what's that dangling else at the end go with?
aight
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);
}
});
thanks
k
no, ig you need to create a function
prolly it's for try block
oh well
you can use that too
doesn't matter does it
it'd still yield as you want it to
but what about all the code in between
the except and else
i tried using this one and this happens when i add the return statement
lol
Your bot is responding to its own messages
yeah ^^
oh lol
how can i fix it
make it look for whether the message is coming from itself
similar to what you already did
how? im on my phone now cause my pc's lagging, should i turn off the bot first? it's flooding me
cause my fps is dropping and it's so hard to turn it off ๐
just ctrl c?
it's running on the server lol
kill pid
so just change the id to the bot id?
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 }
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?
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);
}
});
better than using Bots' ID
I'm not actually trying to write the actual code
ah k
Also I code in python so idk the specifics
ngl u could just do if (message.author.bot) return
I'd use else ifs, but that's just personal preference
aight
would have no difference on the actual code
my code didn't worked lol
it still does the same thing
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
probably b/c you're checking if it's you before if it's the bot
ie it returns before it checks
aight, ill try to switch it up
idk what you mean by try but ok
so check the bot id then mine right?
yep it worked, thanks
np
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?
how do i make it to a command?
nope
you might wanna go do some research
aight
I NEED VERIFY BOT DEVELOPER ROLE
A D V E R T I S I N G
@rustic nova
tried to ping everyone lol (Learn about permissions first)
- advertising
@drifting quartz don't advertise
python ppl, apostrophes or quotation marks?
dont really matters
yeah but what's your preference
" mostly
when do you use '
i need role only verify bot developer
when i have string that has " in it
Use black? https://github.com/psf/black
apostrophes v quotes are purely preference
they're not regulated by PEP8
-nobadge
@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
Still not a reason to advertise
in ts, can I declare an array of unique values?
yes it's called a set
no not set
You might need to explain yourself some more
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
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']
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
Use a set lol
also duplicate css classes shouldn't really be an issue
I'm toggling them one by one, on same element. So...
then yeah set will do exactly what you want
unless you specifically want an error and not deduplication
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.
what you want is possible if you're using a language like idris 
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?
Almost looks like Haskell :)
have you tried stepping through your code in a debugger
nope
you should do that
it's basically haskell with dependent typing tbh
I really wanna spend more time learning but it's not popular so the tooling is pretty bad 
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!"
because it's not a number
I tried to do console.log on the id and it gives out a number
umm...
a array of strings
is there any other way to check if a user has updated their roles
in d.py
other than on_member_update
Not really
can I convert the string to numbers on any way?
I mean, you can dispatch your own event there
why don't you do a explicit type conversion @frosty valve
Number(str)
like here str is id
Thanks for the help! Worked
np
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?
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
it bad bcoz, if array changes, the index also change. And all (not exactly) components get rerenders
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
yeah, sure. Its just about perfomance concerns
but still wants to know, what experts has to say. ๐
it leads to unstable component behaviour thus its bad.
Can anyone suggest me Any reaction gif api?
giphy
@lavish bramble I think you can access the direct URL to the gif file when using the Giphy API: https://developers.giphy.com/docs/api/schema/#image-object
The GIPHY Developer Portal is how you integrate the world's best GIF API into your business, app or project.
message.channel.send("Message").then(msg=> msg.react(":white_check_mark:")).catch(err=>{
console.log(err);
message.channel.send("could not react");
})
ok
what is white check mark
โ
you can also do unicode
i need to add in help
command

and

H
emoji id
what is the problem
huh
wtf




