#development
1 messages Β· Page 1236 of 1
Sometimes hardcoding is the best option
or making your own library, so you can know what's going on
hardcoding would be the fastest
however a small api request doesn't hurt
make a GET request to that endpoint on your application boot
then store the response somewhere
okay
the object is nicely laid out and you can use whatever you want;
even gives you the actual flag image url
actually
you don't even need to make a request
just save the json
lol
here
if you hardcode your locations, you might as well hardcode the flags too
```js
const locations = [
":flag_de: Berlin",
":flag_tr: Turkey",
":flag_eg: Egypt"
];
async function get_location_by_skytext(text) {
const result = await get_data(locations.map(x => x.split(": ")[1])); // Remove flags
// Contuue your function...
}
const locations_found = await get_location_by_skytext(skytext);
const embed = new Discord.MessageEmbed()
locations_found.slice(0, 10).map(location, i) => {
const flag = locations[i].split(": ")[0];
embed.addField(${flag} ${location.current.observationpoint}, **${location.location.lat}**+**, ${location.location.long}**);
embed.addField('map:' , http://www.google.com/maps/@${location.location.lat},${location.location.long},6z, true)
});```
i know
that's effort
but ffs that takes too long
too bad
you can just use the json from restcountries and be done with it
it returns alpha2 and alpha3
welp
that's not database
now i am going to figure out how to use this json database.
https://canary.discordapp.com/channels/264445053596991498/272764566411149314/752260260672176221
naah, better make a library yourself
he meant something else jeremy
CountryName : CountryAbbreviation
and then use a simple method:
SetCountryFlag(countryName)
{
// Get the country abbreviation by it's name
// Create a string with ":flag_{countryAbbreviation}"
// return the flag
}
Ez Pez
@eternal osprey Just

Showcasing only 5, find them by the one you like
π¦π·
for production use you're better off using the json file though
less expensive than an api request
π©πͺ
voltrex
i have no clue what you have done there
all the tips
i still can't figure my mess out
π©πͺ
i do have the all.json
yes, now require it in your code
okay
the variable the require is in is now the json array
a parsed one
treat it like any normal array
to get the name of the countries, .map() by the name property
to get the ISOs map by the alpha2Code property
how do i convert the name of a country to a discord emoji flag
owh okay
it returns alpha2 and alpha3
@earnest phoenix where? can't find it in the api (the weather-js module)
i am just going to hardcode it.
oh nm you meant the restcountries api, ohterwise he could've just used the code
his locations are inconsistent, sometimes he uses a country and sometimes a capital
yeah i will give up on this concept
π€ it's like 5 minutes of work
π€ it's like 5 minutes of work
@earnest phoenix its a whitename
thats not the first time they've given up upon facing a bump
@opal plank perseverance 0
i remember first time i tried my bot
dumbass put the token inside the client login without quotation marks and got furious cuz it wasnt working




I am reading the InfluxDB docs, but I don't get what the tags property is when constructing the client and writing data. In the docs, they use host when constructing the client and put in a example url when writing. Like
tags: [
'host'
]
// ...
tags: { host: 'box1.example.com' }
What is the tags property for
Thats what fun about coding. Its the journey that matters. I fully enjoy all the memorable moments from when i've encounted bumps and overcame them, including
The 13 broken keyboards
The $383.95 bill of headache/painkiller meds
The 2 shattered monitors
The 2 splatted mouses
The countless headaches and fist pain from punching everything
Coding is fun 
yes
also yes
how
there isnt saving grace when it comes to bugs
you fix one, 3 other appears
its like fighting a necromancer. The more you kill,the more ammo your enemy has
erwin
please do not take conclusions too fast
i have been at thisflag problem for 2 hours now
and you call it a littl 'bumb'
maybe for you
but for me it is a big deal.
even if you find a dead end,step back and take a different approach
i know
but at some point
(when you have been trying to solve this fucking shit for like 2+ hours)
you are just tired and sick of it.
even if you find a dead end,step back and take a different approach
2+ hours is nothing
take a break
ive spent 5 days looking at how to do pagination when i started
how old are you
and i've known people who spent far more time looking into issues much more complicated than that
im 22 iirc
oki
basically
i have tried everything by now
the all.json file
and treating it like an array
well it did result in nothing as i didn;t know how to proceed further
what exactly are you doing? gimme a quiick tldr
i also tried hardcoding it.
well i gave up as it was giving errors like hell
i am trying to get a country flag before a country name
let me get a ss
wait
aight
im 22 iirc
@opal plank what the fuck
how can you forget
@eternal osprey do you know all the possible countries returned by that query?
he hardcoded them
i do have made a list of countries, yes
they're sometimes capitals
then make a json
or places.
(which i assume you already has(
i spoonfed you the code though
yeah but i tried doing it myself
lets just say it didn't work, and i want to learn from it.
not just copy and pasting.
const locations = [
":flag_de: Berlin",
":flag_tr: Turkey",
":flag_eg: Egypt"
];
async function get_location_by_skytext(text) {
const result = await get_data(locations.map(x => x.split(": ")[1])); // Remove flags
// Contuue your function...
}
const locations_found = await get_location_by_skytext(skytext);
const embed = new Discord.MessageEmbed()
locations_found.slice(0, 10).map(location, i) => {
const flag = locations[i].split(": ")[0];
embed.addField(`${flag} ${location.current.observationpoint}`, `**${location.location.lat}**`+`**, ${location.location.long}**`);
embed.addField('map:' , `http://www.google.com/maps/@${location.location.lat},${location.location.long},6z`, true)
});``` this was the ciode right?
the one i gave you works assuming the promise.all does everything in order
which it should, it's async
brazil: :flag_br: ,
united_states: :flag_us:,
//etc
}```
embed => name + flags['name']
thats literally it
yeah
but i am using an weather-js package
unrelated
or map them by what you search
and earching/
if you searching by brazil map it brazil
if you searching for BR, use BR
use the same name on the property as what you're querrying
should i create a new list?
nah
or just add the flags onto my already exsting
yes
instead of array use an object(json)
you know all the values
object should be better for this case
rather than checking with include() orsomething
you can simply do if(flags['country']) => run code
{
brazil: :flag_br: ,
united_states: :flag_us:,
//etc
}``` this is already tested by me
if you really need to check
it did nothing
it does
it does not
im literally doing that for mytimeout
you clearly doing something wrong
π¦π«
why not just arrays
lmao
unless its enum it makes it hard to get specific values in order
oh
but i have a list of like 300 places or so
wait
how the fuck am i going to do that
explain to me why it's an object
that will take decades
so why not only map the ones that has flags and not add the oters
thats what im sugggesting cry
you don't have to manually map it at all
if he didnt know the shape of the results i'd recommend him to use fuzzy match
it's all in the json from restcountries
erwin why is that countdown.json an object
ive told you, i need it enum
Conclusion: speedy is not very speedy
cri
objects are better for this
also json when imported is an object in js
if that was your question
OFF TOPIC SMH
smh my head
π
nah i meant that i would have make it an array and access it by index
unless its hardcoded, like i said, it would be annoying without enum
ye
and enumerating it would be more painful
generating this is somewhat easy
making the gifs on the other hand tho....
prob bad to be testing here dude
i am deleteing the messages
either way
so i don't think it bothers anyone
Is scheduling a good solution for cooldown problem?
what scheduling?
Settimeout
cooldown for what exactly?
This is the amount of time player has to wait to get command again
Sr my bad English
then map it and run with timestamps
if (now < timestamp) return 'cooldown active'
ads

Any one need vypr vpn dm me
@earnest phoenix we dont want ur bloody vpn (is this considered ads @split hazel?)
hot bot name
been reading so much re:zero, i read his name as Subaru
bue bue
I read in some places, settimeout didn't affect performance
every single thing you do affects performance
lemme explain a bit better
some on a larger scale, some on a smaller scale
that ^^
the amount of iterations you need to be doing to affect something needs to be really large
even though its unlikely that you can achieve that much in discord,its still good practice to optimize your code
take a look at this for example, me making my point that embed builders are bad
235 ms. thats 1 million times ran, and that was under 235 ms.You need large scale to make dents
doesnt necessarily excuse bad code/unoptimized code
var embed so good, it's not fastest but it's easy for maintenance
π
Is getting ratelimited often an issue?
yes
π
can you help
yes
@pale vessel i will be banned?
Because of hitting rate limit
A lot of times
yes, your bot will be detected by the spam detection and you'll have to appeal
have you tried googling the error?
I'm looking at using auth2 with my bot but I'm wondering if I need a file or use a variable to store my client secret? (auth.json file) or maybe something like
"client_id": "client id",
"client_secret": "client secret",
" grant_type": "authorization_code",
"redirect_uri": "redirect uri",
" scope": "scopes"```
@still merlin need? no.shoud? absolutely
hardcoding sensitive info on your bot always leads to issues
How can i do a command for restarting all the shards of my bot?
if you have a process manager, just kill the process
im pretty new to all of this but i created a music bot with discord.js and i have no idea how to add a custom status
ohk
client.user.setStatus({activity: {name: "some status", type: "PLAYING/STREAMING/LISTENING/WATCHING", url: "someTwitchURL"},afk:false,status:"online/idle/invisible/dnd"}) @earnest phoenix
thank you :)
that is the most data you can provide to a normal presence
yeah im having a look right now
ok so im not the smartest person but like i added the code in and everything and i just added const client = new Discord.Client(); and its saying discord is not defined
you need to
i need to
define discord
wow
let me see your code
put it in a bin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Ok, it's just Client, not Discord.Client
ohh
How can i do a command for disconecting only one of my bot shards?
create not use
is there anything like visual studio live share but less laggy?
message.guild.emojis.create("url", "name") iirc
and buggy
thr login don't bother
Ok thanks
oh you readed my mind and know the code so u can help me?
Ima see
-dotpost @supple oriole
Is everything installed?@jolly wave
yes
oof

var data = "token=aaaaaac";
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://currencyapi.heppcat.cf/apiendpoint");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(data);``` this only works for post when I change the method on server and in this code to get it does not work
@drowsy skiff what do you mean by βdoes not workβ?
hmm thats aws error?..i dont know that
did u read my script?
@drowsy skiff what do you mean by βdoes not workβ?
@digital ibex when I change it togetits like the token does not go through but onpostit works fine
yea looked good...unless for some reason you need to move login to top of file?..but doubt it
or...discord.js wasnt installed on aws?
idk much about ajax, but its used for sending data to the backend, so why are you even trying to use the get method?
i really dont know..looks good
youβll need to have a backend for that, if u dont already
idk much about ajax, but its used for sending data to the backend, so why are you even trying to use the get method?
@digital ibex I am making an api and I would rather use get to get the data then post
thats frontend
why did you use xhr
@pale vessel I use express for the server
then why use xhr
You can use the fetch function
the stuff u r doing there, do that in the backend
It's 10 times simpler
the stuff u r doing there, do that in the backend
@digital ibex I need to pass a token from the req to the server
then u need to use post, not get
@jovial nexus you can use process.exit() on that specific shard, and the manager will restart it automatically
Hey so im trying to buy a vps for my bot but i donβt know how to configure it like uh do i need a domain?
ok thx
no you dont need a domain
So like i could just spam
@jovial nexus use broadcastEval to find the right shard
I am available for any questions in dm....node, discord.js, discord.ts
discord.ts?
yup
thats what i use maibly
Wtf is that
Huh
how can i get the shartReconecting event?
does that mean no one would use it or have a question
is discord.ts even a thing?
yes its awesome
Hey all
link?
uh
i love it
ah so its basically just discord.js
yes
Discord Deno API library wrapper (Officially vetted library by Discord team) https://discordeno.netlify.app - Skillz4Killz/Discordeno
its much much lighter
oh well i was thinking of a different one
deno lmao
3.5gb?
wait
nice lol
ah you're showing deno using 350mb ram
is that 3.69gb ram?
use d.js-light if you can
but thats not using node
Test Description
~2 million members were fetched and stored with 7k guilds and tons of channels. Same bot/Same token. Minimal ping command example on using both libs.
Using the most popular Node.JS lib (Discord.JS):
After 10 minutes it was at around 900+MB. SS below for exact details. https://media.discordapp.net/attachments/381870553235193857/733469128639250562/unknown.png
Using my Deno Discord Lib (Discordeno):
Fit in 150MB after 10 minutes. I showed it to some people and they could not believe that this was even possible for JS to be this small so i ran it again as per their instructions to rule out any flukes. The second attempt was at 356MB(note this was going down even more later), but the SS shows the massive difference already.
First: https://media.discordapp.net/attachments/704351191538335896/733435402207100978/unknown.png
Second: https://media.discordapp.net/attachments/381870553235193857/733473380208214057/unknown.png (It was dropping more at the time i shut the bot off it was under 250MB. I'm sure if i left it on more it would decreased further)
At first people thought I was somehow abusing Swap but as you can see in the SS the Swp on the deno lib was even lower than the Node.js lib. And tbh IDK what Swap is let alone how to abuse it.
ill just post it all
i dont know what swap is either..i used it on $5 droplet to install angularcli though and it worked
does deno not have process.memoryUsage()?
a bot with like 11k servers and 2m+ members, storing all uses like 500mb ram
with eris
so blame that on discord.js
d.js-light can take lower than eris tho
it does (depending on cache settings)
at this point is there a good reason to make my own music bot...besides to learn
no
true, but yano, i dont own it or anything
https://github.com/Skillz4Killz/Discordeno is better
@honest perch discordjs is BEST https://discord.js.org/
discord.js-light better
lmfao
discord.js is shit
^ it is
its not fair to compare cache vs non-cache tho
yea
i think im gonna change my bot prefix...im afraid it will get denied
it wont be denied over a prefix
is discord deno can do that with all the regular caching, its quite impressive
ok cool
unless its something terribly offensive
but being able to disable caches is very important for bigger bots
nah just common
whats a better js option
because the community is huge
it's just the caching
i think eris, but
the code style (in my opinion) is the bad thing about it
you cant really change it if u want
ur just like
stuck with it
discord.js and eris are popular because they are built for general purpose, they have to support everything and anything
if you want to scale, you need to start being more purpose-specific
which discord.js and eris dont really support, therefore they feel bloated
there are quite a few options to chose from, djs-light, kalsa core, detritus
if a bot i make somehow blows up, iβll just fork eris to suit my needs
and possibly more
what does eris do better than discord.js ive never used it
depends on what u need it for
eris is a bit dumbed down, it has less features, and dont use collections everywhere
arrays and objects are more memory efficient than collections
ahh
i like to think of it as u actually do stuff urself but thats just me
yes
but like djs, it lacks support for disabling caches
so it has most of the same problems djs has at scale
eris-light when
xD
seriously, that doesn't sound like a bad idea
eris-light 
i'd use it
i was gonna shard but my bot is pretty niche...the site the bot is related to only has 250 users at a time on a good day...so maybe 3 of them will use it
i just use internal sharding
i thought about it...but traditional sharding is only a few more lines
very nice, i have to update node-fetch https://www.npmjs.com/advisories/1556
if i remember terms correctly
a few more lines, an extra file, requires using ipc and broadcastEval and other complications xD
but its good if you have multiple cpu cores
discord.js-light is really nice though, here's a comparison:
eris (less than ~60 servers): https://discordapp.com/channels/264445053596991498/265156286406983680/730929789086597203
discord.js-light (100+ servers): https://discordapp.com/channels/264445053596991498/265156286406983680/754338031020015627
thank you tim
it's even better since i edited the PresenceUpdate event under client.actions to only cache required presence (which is spotify and osu activities only)
thats still a lot, do you cache channels?
yeah
ah ok, pretty cool tho :3
i don't cache members though
i cache channels guilds overwrites and roles (iirc)
146MB rss
if i were to use d.js it'd be around 300 i'd bet
~135 here
d.js light is cool
indeed
i would if i could π
is there any quick way to allow both with '!' prefix and without to work? e.g.
b!command and bcommand should both work but of course if you set the prefix as b, it reads the command as !command
@pale vessel we just need the first 16 digits of your credit card, the expiry date and the last 3 digits at the back of your card
@cloud pebble use if statement?

is that the april i know
I don't know how you check the prefix
Is there a way to shut your bot down without manually doing it? I'm making a rateLimit event, and I'm not sure how id turn it off. here's what im using, I'd test it but if it doesn't work I don't want a ip ban-
client.on('rateLimit' () => {
client.destroy();
})
but you could just compare and see if its one of the either
i use a function to return the prefix
nope it's not π
@still merlin it's not uncommon to hit the rate limit.
you've given me an idea though π€
Using .destroy() is how you destroy the client, but for the most part it's unnecessary
@cloud pebble if you want to use a function, the function should tell whether it is a command or not by checking the prefix
instead of returning the prefix
Alright thanks
it's not uncommon to hit the rate limit.
@sudden geyser if thats the case your bot has bigger problems
I did not mean it like that, but the rateLimit event is not what they should be listening for to destroy the client.
What should I listen for then?
is that djs?
I accidently tabbed across rateLimit five minutes ago making a ready event, No clue what the rateLimit event does, I just guessed π€·ββοΈ
djs handles ratelimits itself generally
Turn it off on request or something, like a command you can only run. Like Methuew said Discord.js handles rate limits for you.
bot = commands.Bot(command_prefix=determine_prefix)
with determine_prefix being:
def determine_prefix(discord_bot, message):
guild = message.guild
# Only allow custom prefixes in guild
if guild:
guild_id = str(message.guild.id)
try:
prefixes = DB_GUILD_DATA.find_one({'_id': guild_id})["prefixes"]
except TypeError:
prefixes = default_prefixes
else:
return default_prefixes
return commands.when_mentioned_or(*prefixes)(discord_bot, message)```
are you sure it's not returning the prefix?
ok it's a dirty workaround but here's how i got it to work 
@bot.event
async def on_message(message):
content = message.content
if message.content.lower().startswith('b!'):
message.content = content.replace('!', '', 1)
await bot.process_commands(message)
discord.ext.commands.errors.MissingRequiredArgument: member is a required argument that is missing.```
wut doesthis mean
i knoe member is missing
but basicly i want to make a thing where member id is the mentioned user, and if no user is mentioned, go to message author id
python
bot.on("ready", async () => {
console.log(`${bot.user.username} online lett ${bot.guilds.cache.size} szerveren!`);
var interval = setInterval (function () {
let fasz = 0;
if (fasz === 0) {
bot.user.setActivity(`${bot.guilds.cache.size} szerver | ${prefix}help`, {type: "PLAYING"});
fasz = 1;
}
if (fasz === 1) {
bot.user.setActivity(`${bot.users.cache.size} felhasznΓ‘lΓ³ | ${prefix}help`);
fasz = 0;
}
}, 1 * 1000);
});
@modern sable you can help me? Here is the code
setting the interval to 5000 should be enough
but basicly i want to make a thing where member id is the mentioned user, and if no user is mentioned, go to message author id
@drifting wedge da bo doo
ba do beep
member=None
in the command, do if member is None: member = ctx.author
Hey guys, its it possible to make message links work in embeds title?
EG: setting this as the embed url will open the link in a browser on desktop Discord, but not on mobile where it will work as intended
in the command, do
if member is None: member = ctx.author
@slender thistle yep im getting help in the py disocrd
ty
Yeah, the inconsistencies in embeds between desktop and mobile are killing me lol
What is match's default value, and can you show us the un-censored part.
and the logs are above the if statement
and i want to be able to select the channel for the logs
how can i do that?
i have the thing that writes the channel i want to mongo db
but im having diffiulty reading it
and displaying it
ping me
I dont fully understand
Anyone know how to fix "AbortError: The user aborted a request." when uploading videos?
more context?
When I use this is comes back as positive even if itβs got the wrong caps is there something Iβm doing wrong?
I want it to be case sensitive
Zerls are you sure the if condition is actually returning true.
whats the problem, zerls?
r u sure its false? console.log it
but thats not what is wrong, i assuming
is the issue on line 27 or have i got that wrong?
what is better, function keyword or arrow functions?
what is better, function keyword or arrow functions?
@earnest phoenix Depends on how you want it to look
hmm
function keyword looks uglier than the arrow function
function gay() {
return "Gay";
}```
```js
let gay = () => "Gay";```
agreed
its not just about how it looks, there are differences in them too. i just read this: https://medium.com/javascript-in-plain-english/javascript-arrow-functions-vs-functions-3f6ce860f8b5
for callbacks, function arguments and anonymous/lambda functions, arrows are better
for classes, prototypes, inheritance and functional programming, use function
you can't use this in arrow functions right?
i mean, depends on what you're doing inside the class, and ^
idk, this is the first time i realised they were different
i'll have to use the normal one instead
tbh the differences between arrow functions and normal functions don't really apply to my code
i never use this or
// this
class
or even
// this
new smth();
you can't use
thisin arrow functions right?
@pale vessel In which part of it? As the parameters or body of the arrow function
Music Bot error when i want to play something:
[VOICE_CONNECTION_TIMEOUT]: Connection not established within 15 seconds
im very bad in codng ._.
joins, and leaves directly
will message.mentions.users return undefined if there are no pinged users? discord.js btw
Can random-puppy get the title of a post ?
Can random-puppy get the title of a post ?
@hazy sparrow why are you using a package like that anyways
Because why not
using the reddit API straight is more flexible and better
will
message.mentions.usersreturn undefined if there are no pinged users? discord.js btw
@earnest phoenix It just returns an empty collection
uhh k
using the reddit API straight is more flexible and better
@earnest phoenix how do i download that?
@pale vessel In which part of it? As the parameters or body of the arrow function
@earnest phoenix body
so message.mentions.users.first() won't rthrow an error right?
nope
Can random-puppy get the title of a post ?
oof, what about get?
@earnest phoenix body
@pale vessel
The classes this or the global this
Every class has this for itself yea
use the reddit api
@pale vessel is there a "latest version" of it? My hosting thingy doesesnt require me to download it just put it in the package.json
an arrow function bypasses this, so it looks for the parent this, defaulting to the global scope/window if not found
can i add a link to an embed that would be treated as a reply to bot? like if i gave a list of options...
can i add a link to an embed that would be treated as a reply to bot? like if i gave a list of options...
@earnest phoenix what are you trying to say?
i like flexing mah nitro
can i add a link to an embed that would be treated as a reply to bot? like if i gave a list of options...
@xsfg5#2269 explain please
Nitro is a bruh moment
Bruh did he leave
Paying to use emojis 
wait no nvm
maybe
Paying to use emojis
@earnest phoenix only way discord can get revenue without fuckign bitches aka users complaining about ads
Discord themselves hate ads @earnest phoenix
like say a user types -search terms here....i reply with a list of options...they click an option and it triggers a command to bot
What do you mean "click option"? Do you mean reactions?
if reaction means responding to bot yes
@earnest phoenix what
It sounds like you're looking for a message/reaction collector.
one sec
that's the wrong link
And when we say reaction we mean reacting to a message with an emote
@earnest phoenix grab the guide link aswell
i dont understand how none of you understand what i mean
@faint prism how would u go about doing it? theres just gonna be 1 ELO check and if it doesnt find someone in a certain amount of time it just picks 2 people randomly
@earnest phoenix I'd make a while loop with an int for the range that expands if no matches are found
Are you trying to say reactions
Tf
im a better dev than most of you im sure i dont need doc links
im a better dev than most of you im sure i dont need doc links
@earnest phoenix fuck off
Yea then why are you asking us go ask someone better than you smh
im a better dev than most of you im sure i dont need doc links
@earnest phoenix Then why are you asking here if you're better
yeah
Keep it civil y'all
;-;
||at least ;-; isn't a dotpost||

its cool my question was obviously too advanced for you hobbyist

discord doesnt not have a user interface to interact with bots, nor clickable elements. the only possible interaction with bots at the moment is through message reactions
@earnest phoenix when you say "reactions" and such, I think of reacting to a message with an emote. Plus, you say "click".
Hence, a reaction collector is probably what you're looking for (https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=awaitReactions)
its cool my question was obviously too advanced for you hobbyist
@earnest phoenix yea dont ask us then
@sudden geyser stop giving him help he indirectly said no i don't need help bitches
I said keep it civil
That's what this channel is for?
lol you guys are silly
however, discord plans to implement such advanced bot features in the future
nice
however, discord plans to implement such advanced bot features in the future
@quartz kindle
Telegram v2 inb4 π
why don't i read news
@earnest phoenix you got your answer then just go why are you still bothering us
yeah
lets compare bot code @earnest phoenix
why are you disturbing us if we're worse than you
well see whos a newb
bro you just posted cringe in #development, please stop
well see whos a newb
@earnest phoenix sure, lets compare tokens, you go first
If anyone keeps this shit up, I'll start handing out mutes
^
I first knew what he was trying to say, clickable links to interact with bots, but as i knew its not a possible thing, reaction collectors come to mind
i ask a question and get thrown docs like im an idiot
Please stop now
yeah
you could've asked your question more thoroughly, like "i've read the docs but i don't understand how i can do x"
You didnt specify that you weren't an idiot the time you asked for help
we're not minimodding we're literally triggered
for example, this was a proof of concept released earlier this year about the future of discord bots, however there hasnt been any news since. but it gives you an idea of what discord is possibly planning
ok now let's seriously stop to be safe from mutes 
Honestly, custom buttons on Discord would be nice, imo. π€
youre the ones that keep going...
I wonder what the ratelimits will be for them
That would really make my bots so much better, I can't wait
but it would have lots of weird shit
@earnest phoenix honestly if you think about it if you'd just stop replying to us we'd stop too
The dropdown button will be of good use
How about I just
or you could stop replying to me
Can't wait to see how broken those button interaction with bots would be
Or just op
The dropdown button will be of good use
@cinder patio yeah cool
it will make my awesome reaction menu obsolete tho lmao
WE NEED OPTIMIZED EMBEDS ON MOBILE MORE THAN CLICKABLE BUTTONS
REACT WITH
IF YOU AGREE
^
i came to ask a question and got shit on
Mobile embeds are retarded
whatever
huge UI changes are coming soon
how soon?

69 years later
bots will be able to hook into slash commands, create interactive elements (polls) etc.
discord gave no ETA but it's been confirmed that they're working on it
still nothing new then
this may or may not be exclusive to verified bots
bots will be able to hook into slash commands, create interactive elements (polls) etc.
discord gave no ETA but it's been confirmed that they're working on it
@earnest phoenix you know discord is a big lie right?
Heyπ€ I don't know English so I'll just say hello π€
Do you need help with bot development? Cuz this is the channel for that
Casual chatting goes to #development
you edited that so fast i wanted to take a screenshot for a meme
bots will be able to hook into slash commands, create interactive elements (polls) etc.
discord gave no ETA but it's been confirmed that they're working on it
@earnest phoenix Discord says like they ever gonna implement that, man if they do that, can't wait to see how broken they will be on mobile
Everything is still broken in mobile 
They might just abandon discord mobile
lol most muted users here are on mobile and have to live with terrible embeds and they can't confess their problem because they're muted 
VBA is such a pain in the ass
Visual Basic for Applications
Tf is VBA
@earnest phoenix vhen biscuits attac
ah yes
star if you noob (this is a strategy to tell people not to star your stuff so they intentionally star it)
development, more like general-3
I do love how the VBA editor straight up formats my code if the syntax is correct
it's also a strategy at not getting on starboard
it's also a strategy at not getting on starboard
@sudden geyser you won't get psychology cuz ya nub
||this is a joke please don't kill me||
Imagine trying to get on starboard
Keep this channel on topic
ok
Then time to wait for another person to ask a question, imma move channels

can you blur images on the canvas? I want to add a background in my profile command but it blends with the text too much
[Rust] I have this module: ```rust
mod tests {
use crate::search;
#[test]
fn one_result() { /* ... */ }
}```
The compiler complains I'm not using crate::search (I do use it in one_result, but excluded it here to make the code shorter). When I remove the line, it throws a compiler error (obviously). This is obviously only run in tests, so does anyone know why it wouldn't work // how to fix it.
Edit: I found my mistake: I didn't mark the module with the attribute #[cfg(test)]
throw the docs at me i don't care
You can use the shadowBlur on the 2d rendering context of canvas
link docs plz browser is too slow and
s up on google.com
then i'll draw the image and blur the current canvas 
there's ctx.filter in newer browsers but it's not supported in node-canvas

how would i send a message with a webhook from a bot?
when i do hook.send("asgdiasghd") i get an error
What's the error?
hook.send is not a function
anyone know how to fix this?
or how to send a message with a webhook?
const hook = msg.channel.createWebhook(userToCopy.name, userToCopy.avatarURL())
@earnest phoenix
const hook = await msg.channel.createWebhook(userToCopy.name, userToCopy.avatarURL());```
you just got told how
that
thx
now im getting DiscordAPIError: Invalid Form Body
name: this field is required
Trace: unhandledRejection at: DiscordAPIError: Invalid Form Body
name: This field is required
at RequestHandler.execute (/home/runner/Infinite-Bot/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at process.<anonymous> (/home/runner/Infinite-Bot/levelling.js:611:13)
at process.emit (events.js:327:22)
at process.EventEmitter.emit (domain.js:483:12)
at processPromiseRejections (internal/process/promises.js:209:33)
at processTicksAndRejections (internal/process/task_queues.js:98:32)```
async function sendWebhook(user, msg){
const hook = await msg.channel.createWebhook(user.name, user.avatarURL())
hook.send("a")
hook.delete();
}```
How do I set the robot and it becomes like this
Lib?
wdym
now im getting this:
Trace: unhandledRejection at: DiscordAPIError: Unknown Webhook
at RequestHandler.execute (/home/runner/Infinite-Bot/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at process.<anonymous> (/home/runner/Infinite-Bot/levelling.js:611:13)
at process.emit (events.js:327:22)
at process.EventEmitter.emit (domain.js:483:12)
at processPromiseRejections (internal/process/promises.js:209:33)
at processTicksAndRejections (internal/process/task_queues.js:98:32)```
I want my bot to be in its state the number of servers it is in and the number of members Do you understand me?
async function sendWebhook(user, msg){
const hook = await msg.channel.createWebhook(user.username, user.avatarURL());
await hook.send("a");
hook.delete();
}```
@sterile lodge Here fixed it
great thx
let guilds = <Client>.guilds.cache.size
and just change the status with
${guilds}
@spare mirage Is this my response?
works except for the avatar
Then
async function sendWebhook(user, msg){
const hook = await msg.channel.createWebhook(user.username, user.displayAvatarURL({
size: 2048,
format: 'png'
}));
await hook.send("a");
hook.delete();
}```
@sterile lodge Try
you're amazing thx
Anyone fluent in Arabic? To help me
still doesn't work
How would i relay how many guilds my bot is in to my website?
I want my bot to be in its state the number of servers it is in and the number of members Do you understand me?
@digital seal
Server count =><client>.guilds.cache.size
User count =><client>.users.cache.size
Do I put them in my code? @earnest phoenix
How would i relay how many guilds my bot is in to my website?
@dense nest Construct an api that redirects to your website and do a post request to that api and use it
Oh god
I put this to what do I change it?
client.user.setActivity('-tax , -help', { type: 'PLAYING' })
})
@earnest phoenix
@digital seal just
<client>.user.setActivity(`Watching ${<client>.guilds.cache.size.toLocaleString()} servers with ${<client>.users.cache.size.toLocaleString()} users`, {
type: "WATCHING"
});```
So if it's 1000, it would be cast to 1,000
Hey anyone wanna help me on how to use custom emojis
on discord.js?
i thought just sending  would work
oh can you link it please
Just remove <>
thanks for helping me with webhooks, i can now do this
Error says otherwise
alright ty
@earnest phoenix ?
@spare mirage lock
whats the error
client.user.setActivity(`Watching ${client.guilds.size.toLocaleString()} servers with ${client.users.size.toLocaleString()} users`, {
type: "WATCHING"
});```
lol watching watching x servers
@digital seal That's a syntax error, you might want to show your entire code for us to fix
Is he gonna throw on the token
client.user.setActivity(`Watching ${client.guilds.size.toLocaleString()} servers with ${client.users.size.toLocaleString()} users`, {
type: "WATCHING"
})```
@earnest phoenix
entire code moment
this code
entire code moment
@pale vessel I'm dying
client.user.setActivity(`Watching ${client.guilds.size.toLocaleString()} servers with ${client.users.size.toLocaleString()} users`, {
type: "WATCHING"
})```
@earnest phoenix
@digital seal .
Entire code moment
Here's the code that you put in
Can you come privet what I send you? @earnest phoenix
@earnest phoenix
did he leak it?
Did you just send the token with it
did he? i need to know
console.log returns the correct field from my mongodb doc but return doesnt. I think it has to do with async and callbacks?
ah nice
@digital seal I don't see whatever i told you to put in the code you sent
@digital seal
I will not send the code
What is ur problem?
I want my bot to be in its state the number of servers it is in and the number of members Do you understand me?
Didn't i just spoon feed you the whole thing
${bot.users.cache.size}, ${bot.channels.cache.size} use it @digital seal
@digital seal just
<client>.user.setActivity(`Watching ${<client>.guilds.cache.size.toLocaleString()} servers with ${<client>.users.cache.size.toLocaleString()} users`, { type: "WATCHING" });```
Am i a joke you

guild.createEmoji('IMAGEurl', 'NAME') .then(emoji => console.log(`Created new emoji with name ${emoji.name}`)) .catch(console.error);@worn badge couldnt find it so
@spare mirage oh i meant how to use already made emojis, or is that not an option?
@worn badge Just get them or use their identifier
When the bot came lit a mistake
ohhh i'm dumb, it wasn't working because the bot was trying to send an emoji from a server that he's not in 
Man do you code on a notepad
The hell is rdp
remote desktop protocol
i need a package.json
like npm init -y?
ok
I'm working on a forum, and I'm thinking about how all the data should be stored. I'm using mongoDB as the database, and right now I am considering two options (the example is of a category object - a category contains threads.)
{
id: "...",
...some other data,
threads: []
}
In the first one all the threads in the category are stored in one array. In the second option, all threads are in a different collection and have a categoryId property, so threads can be eaily found via a category id.
The second option sounds better to me because it's more organised, BUT it means making more requests to the database. I also feel like the second option allows for better caching
@earnest phoenix means how can he relay how many servers his bot is in to his website
Ukrainian?
Russian
Ah
Okay how fix this
Thats js
yes
Trying yo figure out the dame thing
-servercount @earnest phoenix
@earnest phoenix
To have your bot's server count displayed on DBL, please read the documentation on server/shard posting. Click here to see the docs.. You may also find #312614469819826177 useful; however it is strongly discouraged as most of the examples are extremely outdated.
thx
Oh
I seee
How do i do it on my own website
O.o
.py?
Orrrrr do i need a database
How get around youtube search ratelimits
?
I make 1 request and get ratelimited >:((
by scraping
@misty sigil how doe
ytdl
How i can get full info about error in catch()
cuz i have to do error.toString()
do you mean the error stack ?
and it display only this
consoleTypeError: message.member.presence.find is not a function
error.stack
In discord.js, how do I pass an image buffer to .setImage on a MessageEmbed?
Im not the smartest of people.
Like, when you buffer canvas.
like this, ```js
const buffer = canvas.toBuffer("image/png");
to send it as a file I would do this ```js
await message.author.send('', { files: [buffer] })
Trying to find out the equlivant for .setImage()
@final stone you need to attach it iirc
Buffering anything in general Β―_(γ)_/Β―
@final stone you need to attach it iirc
@misty sigil So it cannot be set as a image in the embed?
it can.
Could i get some pointers?
Im stumped.
.attachFiles(new Discord.MessageAttachment(ctx.toBuffer(), "image.png"))
.setImage("attachment://image.png") iirc
OOOh
In general, is it a good idea to use the youtube api?
Thanks π
aye no problem!
@final stone int *pointer1; int *pointer2;
@final stone
int *pointer1; int *pointer2;
@proven lantern what?
a joke, if i'm not mistaken
you're right, those are dereferenced pointers
never mind
yeah, but i messed it up
Don't think I've had to directly handle pointers in my code yet, fortunately.
??????????
x is an integer, but apparently I can't use x^(1/2) on it regardless of its type?
for further context if necessary, this is my code up until the compilation error (last line)
Option Explicit
Sub ΓΓèãà 1()
Dim a As Single, x As Integer, pi As Single, i As Integer, arr(0 To 4) As Single
pi = 3.14159265358979
x = CInt(Val(Cells(5, 2)))
arr(0) = (1 + 2.5 * x) / (Sqr(x) * (1 - x))
arr(1) = (x^(1 / 2)) * (Abs(1 - x) ^ (1 / 2)) * ((Sqr(x) + 1) ^ (1 / 3)) * (Abs(Sin(x)) ^ (1 / 4))
Visual basic π€’
What for my axo
Why doesn't ts await message.guild!.members.kick(user); kick the GuildMember
xis an integer, but apparently I can't usex^(1/2)on it regardless of its type?
@slender thistle wouldn't that just beSqr(x)? Assuming that means square root
Math.sqrt
and there's no sqrt
because you can't get a real number from sqrt-ing a negative






||





