#development
1 messages · Page 1243 of 1
wait, is that js?
I'm blind and thought I saw a number, mb.
Wew.
@uneven lagoon JS
Ah.
If you dont want to worry about type
offline is string[] ,and the d.user_id is also id
Ise TS
it IS typescript
I was seeing these e_c shit and got confused.
YOOOOOOOO
try adding a return
though because this is debugger its debugging in javascript
yeah u need a return
JS gang.
{} doesnt auto return
Why don't you use find instead of filter anyway?

i want all valuesOTHER than that one
aight
@glad charm qt dw we are stupid sometime
dont judge the man 
@uneven lagoon @earnest phoenix learn real coding if you want to do voting stuff and webhook stuff
You could just have it do e_c => e_c !== d.id
Because you need to make a webseever to recieve requests
@uneven lagoon @earnest phoenix learn real coding if you want to do voting stuff and webhook stuff
@earnest phoenix wait, real coding is a language?
cant
Unless your linter wants that styling
try typing that in TS
bruh
Huh.
I mean language that isnt BDFD or domeshit
I mean language that isnt BDFD or domeshit
@earnest phoenix Oh I use js.
oh nvm
js or py
im retarded
Instead Java, TS, C++, C#
i forgot to remove;
@opal plank it is your turn to have the stupid
is py hard?
@earnest phoenix JS for simpifly, PY for hella lot of stuff u can do
is py hard?
@earnest phoenix Not really.
PY dont have bracket
But I find it easier to use JS.
So ye if you are bracket type, then fuck

js is a language that can do pretty much everything rlly fast
py is more like a utility lang imo
using py for production is like using linux on ur pc; it works, but its kinda dumb, but like it works lmao
im proficient in js and py and js is much better for production applications
its packs simplicity into an also easily expandable package which can be used for super advanced shit
good and bad
using py for production is like using linux on ur pc; it works, but its kinda dumb, but like it works lmao
@slim heart I disagree with both of those opinions
good as it provides tools for people
good for you
i got python
bad cuz it oversaturates the community with shitty poorly written packages and scripts
is there any package manager for java
yeah
why write your own code when you can just yank pre-made packages that do shit for you for 0 effort?
its more copy paste than developing at this point
thats the dumbest thing ive ever heard tbh
same shit happens to python
not a language thing
thats a developer thing
the only thing i know about js is
const Discord = require 'discord.js' and i think i got it wrong
interesting
is there any package manager for java
@sonic lodge Maven or gradle
thats just cuz js attracts simple users
but thats not to say its something that has to be simple
people moment you look for a packacge that would take 5 minutes to write,you doing it wrong
thats not a language criticism
I'd miss the class structure if I used JS heavily
to put it lightly i've never seen a good production level application built in python, and stay in python for its lifetime. simple as that lol
mhm
I'd miss the class structure if I used JS heavily
@faint prism u can turn js into an oop
with TS ik
there's literally classes lol
@slim heart Functions can be used to somewhat simulate classes, but it's not classes
n0o
bruh
are u
u cant even fucking google shit before u criticize lmao
there's
literally classes in js
It's a prototype-based lang
classes are "syntactical sugar"
educate urself hun
@slim heart educate urself hun
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
it's still literally classes
I'd miss the class structure if I used JS heavily
"structure" not backbone
the entirety of discord.js and most production level bots/apps use classes
dont act like u care what it actually turns into at run-time, its all abt syntax
<html>
<head>
</head>
<a href="https://top.gg/bot/id_here" >
<img src="https://top.gg/api/widget/id_here.svg" alt="Spark ++" />
</a>
<body>
<style>
*{
color: lightgray !important;
}
body {
background-image: url("https://i.imgur.com/nwV0SBe.jpg");
color: gray !important;
}
span {
color: white !important;
}
code {
color: white !important;
background: #420000c8 !important;
}
.btn-orange {
background: #420000c8 !important;
}
.botpagebutton {
color: white !important;
background: #420000c8 !important;
}
.atag {
color: white !important;
background: #420000c8 !important;
}
.content {
color: white !important;
background: #420000c8 !important;
}
</style>
</body>
</html>``` to use the top.gg svg thing should it look like this
Where the <a href...is
hopefully this should work now

its so annoying having to test this shit on production
yes
people who use the production stuff doesnt use it as intended so u never know what happens
Ah.
i cant test it on my local rig, the traffic is just too big
oof
Ping on reply
it literally freezes my computer if i try loading 30% of total load
dont act like u care what it actually turns into at run-time, its all abt syntax
@slim heart not gonna lie, I don't know JS at all.
I do care about runtime, but only for compiled languages.
From preliminary research, Mozilla docs seemed to suggest that classes were an afterthought that extend the prototyping-based inheritance.
But I agree with what your point about "all abt syntax". If it's the same functionally, then I'd be happy just to have classes accommodated by the language
so im having to push shit to the production server and test it there without a debugger
which is super annoying
Wew.
bruh...
it is and aftert-thought yeah, but functionality and looks wise its pretty much the same as any other oop
js can turn fully oop if you want it to be which is why i praise it so much, it can be so simple but it can also be very advanced
what are u running Erwin?
wew....
indeed
i tried with a smaller amount
but that brought my rig to the brink
i think i tried 120 streams on my pc
cpu running 90-99% at all times
oof
<html>
<head>
</head>
<a href="https://top.gg/bot/id_here" >
<img src="https://top.gg/api/widget/id_here.svg" alt="Spark ++" />
</a>
<body>
<style>
*{....
}
</style>
</body>
</html>``` to use the top.gg svg thing should it look like this
Where the `<a href...`is
try it
hi tim
the man, the myth
lol hi
Bruh no it isnt
the stackoverflow
yeah no shit if the description is 140 charac only
no need to get rude buddy
@quartz kindle Will become my personal Astrologer?
you're the one coming here for useless help chillax
That's a cool website ngl

yes
it is scientific
this makes me think it's tarot stuff though
astrology and tarot are nothing alike
astrology is constellations, yeah?
tarot relies on the randomness of the card shuffle, astrology relies on accurate and predictable positions of planets
but it's pseudoscience though, isn't it?
so you could say tarot is random, astrology is not
Your API made it seem like it was Astronomy-focused
planets are fake
pluto is a hoax
I don't mean to critique, you're awesome imo
astrology and astronomy go hand in hand, they both use the same base
actually, does pluto go into astrology?
the only reason why astrology is pseudoscience is that there is no physical evidence of planets affecting us
yes it does
i mean it is the 8th and 9th planet

||What about planet x nibiru
||
there are some imaginary/hypothetical planets in astrology, most people dont use them though lul
there are many planet Xs
very development
basically if one comes up with a set of orbital elements to describe a planet's orbit, and writes a book about it, many people will try to use it in astrology, even if it doesnt actually exist, just to see if it has any meaning

thats how everything starts
if it wasnt illegal i'd connect to their client and go send a message on every single stream saying 'ignore me, im a bad dev at twitchtracker.come'

"lets cut a stone into a circular shape and roll it around because why not"
Twitch Developer Services Agreement This is an agreement between Twitch Interactive, Inc. and its affiliates (“Twitch”) and you (if registering a...
or spam their api till twitch revokes their key
to answer such stupid question
'why not?'
@faint prism you should probably main them that
- what i said about spamming the twitch api with their token /secret
which would lead to its revokation
"why not?" => some hobbyist who doesnt really care
well-
I dont even know anymore.
lets make a discord-backed shared network drive
D. fuck you too
Sure
Oh wew.
bunch of geniuses at tracker
fr lmaooo
ignore the shitstar, thats my personal starboard
lol alright
its not an uncommon practice tho
To break TOS and publicly post a API secret?
placing user credentials in the page source
are those not the user's own credentials?
this is why i hate testing in production
350 stream in an hour
it takes so long to startup

Ahh databases... What are useful class to have right now, developing a bot and all
y'know what'd be fun?
being the creator of something like Typescript and then attending a JS class/course so you can get a diploma
How can I center all of this text and everything? https://mystb.in/GradDistinctDressed.xml
text-align:center?
Idk where to put that
css
yeah Im using css
So use that css
Like this? https://mystb.in/FrederickBumperNeon.xml
In here
ima just try it
Still didnt work
The docs
ok so it makes sense that I'm getting this error with this code but I can't figure out how to get the username and stuff just by having the user's id...They aren't in any mutual servers with the bot so idk how to get the info...
codejs const member = args[0]; const memberUsername = member.username console.log(client.members.cache.find(m => m.id === member)); const blacklisted = await StateManager.connection.query(`SELECT * FROM blacklisted WHERE memberId = ${member}`); try { message.delete(); if (message.author.id === '473034033496850452') { if (blacklisted[0][0] === undefined) { message.channel.send(`Member has been blacklisted.`); await StateManager.connection.query(`INSERT INTO blacklisted (memberId, memberDiscriminator) VALUES ('${member}', '<@${member}>')`); } else { message.channel.send(`Member is already blacklisted.`); } } else { message.channel.send(`This command can only be used by the bot developer.`) } } catch (e) { console.log(e) }errorjs (node:54700) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cache' of undefined
can someone help
Tryna align all my text to make it centered, idk how to center it all though
https://mystb.in/FrederickBumperNeon.xml thats my code
body { text-align: center; }
is that text wraped in <body>
no
it need to be your other stuff <body> <p> bllahs </p> <p> ect </p> </body>
sorry I dont get it
Wasnt it fine the way it was before? https://mystb.in/FrederickBumperNeon.xml
i think so
if it looks like this ```<html>
<head>
</head>
<a href="https://top.gg/bot/721397896704163965" >
<img src="https://top.gg/api/widget/721397896704163965.svg" alt="Spark ++" />
</a>
<body>
<style>
*{
color: lightgray !important;
}
body {
text-align: center;
background-image: url("https://i.imgur.com/nwV0SBe.jpg");
color: gray !important;
}
span {
color: white !important;
}
code {
color: white !important;
background: #420000c8 !important;
}
.btn-orange {
background: #420000c8 !important;
}
.botpagebutton {
color: white !important;
background: #420000c8 !important;
}
.atag {
color: white !important;
background: #420000c8 !important;
}
.content {
color: white !important;
background: #420000c8 !important;
}
</style>
<p> absdsdfsdfsdfasdas </p>
</body>
</html>
but where <p> absdsdfsdfsdfasdas </p> is your stuff
whats “stuff”
the "100+ commands" and all that stuff
Hi, I have a command that worked before and doesn't work anymore
const { MessageAttachment, MessageEmbed } = require("discord.js")
const canvacord = require("canvacord");
const db = require("quick.db")
module.exports = {
name: 'rank',
description: "rank command",
run: async(bot, message, args) => {
let user = message.mentions.users.first() ||
message.guild.members.cache.get(args[0]) || message.author
let level = message.bot.db.get(`level_${user.id}`) || 0
level = level.toString()
let exp = (bot.db.get(`xp_${user.id}`) || 1).toString()
let neededXP = Math.floor(Math.pow(level / 0.1, 2)).toString()
let every = bot.db
.all()
.filter(i => i.ID.startsWith("xp_"))
.sort((a, b) => b.data - a.data)
let rank = every.map(x => x.ID).indexOf(`xp_${user.id}`) + 1
rank = rank.toString()
const card = await canvacord.rank({
username: user.username,
discrim: user.discriminator,
level: level,
rank: rank,
neededXP: neededXP.toString(),
currentXP: exp.toString(),
avatarURL: user.displayAvatarURL({ format: "jpg" }),
background: 'https://images.pexels.com/photos/370799/pexels-photo-370799.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
//background: await client.canvas.color("#07A2E7"),
//color: 'White'
})
const attachment = new MessageAttachment(card, "rank.png")
return message.channel.send(attachment)
}
}
And i have this error which says TypeError: Cannot read property 'get' of undefined
define your discord alone dont do the { MessageEmbed, Ect } = require('discord.js') do Discord = require('discord.js') then just do Discord.MessageEmbed or whatever
okay
Now i have this error
TypeError: Cannot read property 'db' of undefined
I just get rid of the require discord thingy
cuz i have it in index
oh you cant
wdym
can you define them sperately like const MessageEmbed = require("discord.js") and const MessageAttachment = require("discord.js")
I wanna recode a v11 is not to v12 can someone help me please I don't know even a single thing about v11


@indigo burrow don’t use v11!
@restive notch can we just re write the code in v12
This may interest you: https://discordjs.guide/additional-info/changes-in-v12.html
ohh
wait is he saying v12 > v11
they want to make v11 to v12
@thick gull ik that is why I am asking peeps to help me
And glitch isn't supporting v11 anymore
See the guide I linked above.
what
@restive notch so basically like this then -> https://mystb.in/InteractionBasesQuotes.markdown
Im getting the same error
@earnest phoenix bot is undefined
@steep shale yeah
Anyone down to recode invitemanager?
what language?
I tried to make my bot modular
Now, if I want to import, say, User, I have to select from 4 options in the auto-import screen
@indigo burrow
what language?
they want to code discordjs v11 to v12
Nm I lied
I only have to select from 3 options
half eren?
never heard of that
It cant be like this https://mystb.in/InteractionBasesQuotes.markdown
And glitch isn't supporting v11 anymore
@indigo burrow what
it keeps auto moving <html> and everything to above the text
@summer torrent yea dosent works for me
it is not related with glitch
Now i have this error TypeError: Cannot read property 'get' of undefined
@steep shale yeah it should be like that
apparently not
if I try to copy paste that into my description it just moves the last 3 lines surrounded with the <> to above the text
``Discord.RichEmbed()```
was removed right?
yes, many years ago
its Discord.MessageEmbed()
Tf happened to me
I did this: MessageEmbed = require("discord.js")?
makesure to do Const
@indigo burrow here, I didnt code for a while
I do not even know how to console log now
Vo the autocorrect first
FUC**K THE AUTOCORRECT FOR FFS
FOR 3RD TIME
why must it?
@midnight blaze coz me noob

why do i feel like java is javascript but with different words
java and javascript are very different lol
^^^
can someone link me an actual good guide on javascript dates pls
@earnest phoenix, is this useful? https://javascript.info/date
yeah ty
let code = args.slice(0).join(" ")
console.log(code)
try {
message.channel.send(eval(code))
} catch (err) {
console.log(err)
message.channel.send(err);
}
}```
How to make work?
What about it is broken
There could be a lot of improvements, such as converting the evaluated code to a string with util.inspect. The same with err since .send takes a string, but having the issue would be more helpful.
how can i convert this command client.on("message", message => { if (message.content === "e!ping") { const embed = new MessageEmbed() .setTitle("Ping") .setColor(0xff0000) .setDescription(`My Latency is ${Math.round(client.ws.ping)}ms`); message.channel.send(embed); } }); into a command that can be used in a command handler command
You store the commands in some type of collection so you can look it up by name (the name being the user input). If it's found, you run the command.
Explaining command handlers is a bit lengthy, so you should refer to this guide: https://discordjs.guide/command-handling/
thats the guid i used to make the command handler work
and i need to make an embed for the command handler
Confused. Just make the embed in the run/execute function and send it then?
You never know until you try.
It's a function. Of course you can
hmm it still leaves pong in the line but that might be glitch not refreshing although i think it refreshed
i had a terminal with the example on it and it was running thats why it said pong. but now it doesnt say anything
welp there goes another few hours on command handler
try again tomorro
because spagheti code is no good for bots with a lot of commands
hey
What is a good permission to require for a warn command?
manage messages, but what would be better is if someone in power could configure it via roles or users
I think they mean what the user should have
MANAGE_MESSAGES is my lowest perm
if you have the ability to delete messages you likely at least a mod
submit a bot and get it approved via https://top.gg/bot/new
Well, my bot is sadly not close to being finished yet.... I only have 27/64 commands done...
while i dont recommend submitting unfinished bots, remmebr that it usually takes 3-5 weeks to get approved
I know
I read all about it
I still have a good couple days at least until i finish my bot
A few days to finish 37 commands?
I have them all planned out on a 'drawing board' of sorts
Unless a second to you is a minute, I don't see how that'll happen.
A few days to finish 37 commands?
@sudden geyser It was an extreme exaggeration lol
Also, if I am going to release it to the public, it must be propperly planned
cough cough ctrl c ctrl v cough cough
NO!

You must pour your heart and sole into everything you code
a whitename who dislikes copy paste and enjoys coding!
we found em!
its no legend, they exist! im crying
Lol
Or he is actin
Nope, I only copy and paste when making kick and ban, because they are literally identical
nothing wrong with that
my honest praise, properly planned bot and good dev practices
Anyway, not only do I have to make all of these commands, but I have to go through the long process of adding each one and a description to the config.json file
Because I don't know how to use command handlers
"commands": {
"help": "**help {command/module}** Display the help embed",
"ping": "**ping** Show the bot latency",
"bot": "**bot** Show info on the bot",
"user": "**user {user/userID}** Show stats on a user",
"server": "**server** Show info on the guild",
"uptime": "**uptime** Show the time since the last update(ms)",
"invite": "**invite** Displays the bot invite link and the invite to the official discord server",
"role": "**role <role/roleID>** Show info on a role",
"set-reminder": "**reminder <time> <content>** Set yourself a reminder",
"suggest": "**suggest <suggestion>** Make a suggestion on the bot(only available in the official server)",
"support": "**support** Show the link to become a patreon to the bot team",
"color": "**color {color}** Set or view the color used for all server embeds\n**REQUIRES `MANAGE_SERVER` PERMISSION**",
"kick": "**kick <member> {reason}** Kick a member from the guild\n**REQUIRES `KICK_MEMBERS` PERMISSION**",
"ban": "**ban <member> {reason}** Ban a member from the guild\n**REQUIRES `BAN_MEMBERS` PERMISSION**",
"mute": "**mute <member> {reason}** Mute a member in the guild\n**REQUIRES `MANAGE_ROLES` PERMISSION**",
"warn": "**warn <member> {reason}** Warn a member of the guild\n**REQUIRES `MANAGE_MESSAGES` PERMISSION**"
},
its like refusing to use VSC cuz you dont know how to use it,and then use notepad instead to code
Wouldnt it be better to just put the description into the export
take a look at this
indeed, but they mentioned they dont know how to do a command handler
I don't use exports
How I do commands:
//PING
if(cmd === 'ping'){
message.channel.send('Pinging...').then(mess => {
let ping = mess.createdAt - Date.now();
let embed = new MessageEmbed()
.setTitle(`${ping}ms is the bot latency`)
.setColor(color)
mess.edit('Done!', embed)
mess.react('🏓');
})
}
//BOT
if(cmd === 'bot'){
let u = message.guild.members.cache.get(bot.user.id)
let embed = new MessageEmbed()
.setTitle(`${bot.user.tag}`)
.setThumbnail(bot.user.avatarURL())
.setColor(config.defaults.color)
.setDescription(`
**ID:** ${bot.user.id}
**Invite Link:** ${config.invite}
**Highest Role:** ${u.roles.cache.first()}
**Creation Date:** ${new Date(u.user.createdAt).toUTCString()}
**Server Join:** ${new Date(u.joinedAt).toUTCString()}
`)
message.channel.send(embed);
}

lol
Atleast if you do that use switch
use command handler
Or make a proper command gandler
for your own sake
Its not like index.js is already 866 lines of code or anything 👀
should i call an ambulance?


go fix
i dont wanna see index's with more than 250 lines
But then I have to rewrite the commands I have
not at all
the code runs the same,you just providing what it needs dynamically
imagine modules as big json's
they are objects
Hmmmm.... I think I will start command handlers next project
trust me
start now
to put it very shitty
module.exports = {
name:,
description,
function(parameters here that your code needs like Discord) {
// your code here
}
}```
thats it
on //your code here thats where you put it.Like, not joking, its the same code you've been doing so far
you'll just copy paste it
/*
*/
you're simply objectifying your code per command
you dont pass it then, or pass and ignore it
const {
Client,
MessageEmbed,
WebhookClient,
} = require('discord.js');
bad
do const Discord= require('discord-js');
Discord.Client
Discord.MessageEmbed
Discord.Webhook.... etc...
BUT
Then I have to go through and change every instance of MessageEmbed to discord.MessageEmbed
I use the set because it is easier lol
Why use Discord.x over const { x } = require("discord.js")
exactly
I don't need anything new tho
You'll just have to add one additon/line to it.
its better to just send over Discord over as parameter or require it right away
It's very small and more bound by the programmer's prefernce.
Also, what is the point of command handlers?
Like how I could say I don't have to keep the Discord top variable since I don't use it afterall
They don't make it easier
dynamically adding commands without having to restart the bot?
being able to re-require chache?
organization?
good practice?
modularity?
idk, i can think of nothing tbh

~~that was massive sarcasm if it didnt go thru ~~
having to restart your bot every addition is
fidelity with uptime
you'll lose everything you have on memory stored when you restart it
intervals,loops,cronjobs
I dont store on memory
its bad to be restarting your bot on every addition/error
And I dont use intervals
look dude, your bot, not mine, im giving you advice on good pratices, you can choose to ignore if you so wish

What bot's have you made?
Command handlers are great to use if you have many commands.
@earnest phoenix
Leviathan.... what does it do?
How do you make a bot dashboard?
@opal plank why...
by coding it in html
I know that
cuz being able to talk in your stream chat/discord in one place is handy,specially with people without multiplemonitors?
also cross currency between platforms?
minigames carry their value over twitch/discord/youtube
no matter where you go
thats cool
What coding language?
Typescript
What is typescript?
javascript but safer
javascript wbut ++++++
its strong typed
meaning you have to declare your variables types
let count = args[0] * 100
shit like this would be caught on TS
Js just runs it,even though string cant be multiplied by number
thats a bug right there that JS doesnt catch
String can be multiplied in python though...
its type guarding
it isnt a bug lol... its a feature but its buggy as fuck
Imagine maging a command to mutiply stucf send output
Expection 1000
Reality 10101010101010101010101010x1000
i heard typescript
tbf erwin... i hate how people meme js cuz 1 + "1" = 11 or smthn
like... why are u adding a string to a number? there isnt any real usecase of that
typescript is an unvaluable tool in my book
lol
just like vsc
its another tool ontop to prevent oopsies
but its quite a bit more of work
as the name suggest,TYPE script,expect to be typing a lot
tbf erwin... i hate how people meme js cuz
1 + "1" = 11or smthn
@lament meteor 1 + "1" = "11"
Why does false = 0 tho... dont you think it should equal -1?
I know
its due to how its stored
binary
0 + 0 = false + false

!0 = true, and !true = false
!0 is 1 if u consider factorials
does anyone know a course on how to code a bot from scratch so im a beginner i know nothing about coding
But in js it's just true
but if it is just considering not then yea
0, empty string, null,undefined all return falsy
empty array
what else/
there are more things that return falsey
Hello i want to ask if i submit a verify request now i wont get a badge right?
i forgot what though
parseInt(false) = NaN
o
NaN returns falsey too iirc
my love towards erwin returns false ngl
Let them choose their own coding language smh
But if false is 0 dont you think it should return 0 if you want the integer value?


Hello i want to ask if i submit a verify request now i wont get a badge right?
nope
You mean more kids flexing their copied evals
sad
dont badge huntin...
Nah hes trying to flex
You mean more kids flexing their copied evals
@twilit rapids wdym copied evals?

like
Ohhh
copied evals has to be some of the most copied shit in discord
i submit my verify request the day before the badge is gone lol
Makes sense lol
and i got my badge
today
copied ping cmd 
A ping commands isn't hard to make
indeed its quite simple
even though my first ping command gave me a negative number lol
here
my friend said she want a badge lol
education purposes only @earnest phoenix
go to discord's door and ask them for it
tbf erwin how optimized is ur bot?
quite a bit
specially cuz im webscaling it
so every small thing that i can optimize im doing
i need to handle traffic from discord twitch and youtube altogether
i have a suggestion
shit code will clog in no time
dont use js 
wut is tuples?
to put it very bluntly, an array
whats the diff?
yeah
typescript can accomplish that too
let array:[string, number, string] = ['a', 2, 'b'];
let array:['a' | 'b', number, string] = ['a', 2, 'b'];
not necessariy
tuples are usually used with indexes
if you want them to be ordered like 3,2,1 you can
o
or 3,1,2
hmm might look into it in the future but gonna keep that in mind
imagine a table
|name|adress |city |
erwin | somewhere | san diego
telk | usa | san domingos
those 2 rows are tuples
they retain the order name => adress => city on each row
for arrays
yeah
Why would you cache 100m messages
stress testing
How many servers is the bot in
wdym all
well there are the ones that are on rn and the ones that are off
All I guess

You said it was in Discord as well no? How many Discord servers is it in
I see
hey so im trying to make a bot that whenever i type the command ^makecache (pinged user) it will first check if there is a pinged member, then make a role and assign it to the pinged member then send a MessageEmbed() when its finished saying its done but its not getting past the point where its checking for a pinged user even tho im pinging my test account
client.on('message', msg => {
if(msg.author.id === '388931035607597057')
{
if(msg.content.startsWith(`${prefix}makecache`))
{
console.log(msg.mentions)
const member = msg.mentions.members.first()
if(!member) return msg.channel.send("No member specified")
else{
const cacheRole = msg.guild.roles.create({
data: {
name: 'CacheRole',
color: '#ff0000',
},
})
.catch(console.error)
if(!member.roles.cache.get(cacheRole))
{
member.roles.add(cacheRole)
}
const embedSuccess = new Discord.MessageEmbed()
//Set the title of the Embed
.setTitle("Cache created!")
//Set the color of the Embed
.setColor("#ff0000")
//Set the description of the Embed
.setDescription(`Sunglasses successfully made a meme cache for ${member.user.username}`)
msg.channel.send(embedSuccess)
}
}
}
else{
}```
but its giving me the error
Launched!
MessageMentions {
everyone: false,
users: Collection [Map] {},
roles: Collection [Map] {},
_members: null,
_channels: null,
crosspostedChannels: Collection [Map] {} }
im not sure why its doing that tho
it just says in the channel "No member specified"
idk why the heck you creating a role before even checking
its going to be creating private channels for each role and it'll give tat channel access only,
you creating a role everytime someone uses that command
each user will get a private channel
just need to assign
then assigning it
you do know there are limits right?
there are?
didnt know that, also cant i just assign the user to then channel then?
allow that user to access channel rather than that messy role thing you going for
theres going to be multiple channels
you can assign permissions specifically for a user in that channel
ok
rather than needing a role
so i could just remove most of those lines and change it with creatinga channel and assigning perms to the user?
either that or once the channel is not needed anymore, repurpose it
mkay
My bot co-owner made an awesome AF command handler and i understand nothing of it 
@earnest phoenix want to be teach'd?
hey so im trying to call a database query (mongodb) in rust using the mongodb driver and i get this incredibly confusing error: error[E0277]: the trait bound std::option::Option<mongodb::options::FindOneAndUpdateOptions>: std::convert::From<mongodb::options::TypedBuilder_BuilderFor_FindOneAndUpdateOptions<(), (), (), (), (std::option::Option<mongodb::options::ReturnDocument>,), (), (std::option::Option<bool>,), (), (), ()>> s not satisfied
and it says the error occurs in the following line (image attached)
he problem is that im using an extremely basic query but it gives an unhelpful error, ive referenced the doc for e0277 but it doesn't make sense in this context
also this hasnt happened to be before ever so im curious if anyone else running the mongo driver has the same issue
Don't Just Say "Hello" in Chat.
@misty sigil when you become verified?
when I became verified
yep
like 4 days ago or something
damn that was f a s t
-bots @earnest phoenix
k
well...
i just thought. "Hey, its source is a message. Why not include message.content"
a property*
elem.textContent = elem.textContent.split('').map((v) =>
Math.round(Math.random()) ? v.toUpperCase() : v.toLowerCase()
).join('');```
uhh
this not working?
uh
i got it to wrk
but i dont know why it says that discord cannot send it
what's the point of that split
async function random(elem) {
var eh = elem.split('').map((v) => Math.round(Math.random()) ? v.toUpperCase() : v.toLowerCase()).join('');
console.log(eh)
return eh
}
if (command == 'test'){
message.channel.send(random(message.content))
}
what in the literal fuck are you doing
uh
sOmEthIng lIke thIs
oh mock command
exactly
you're sending a promise
because you made your function async for whatever reason
i dont even know what a promise is
why make it async in the first place
if you make a function async, it returns a promise so you need to resolve it but you don't need it
how do i resolve it
you don't need it, you're not using any promise inside the function
but what if there is a case that i actually need it
i know that.. but what do you mean by
you need to resolve
that's exactly what it means
if you want to learn about promises and asynchronous programming
use sharp then
Image manipulation is slow in general
not if you do it properly 
node isn't the best if you're targeting speed in general
yeah
smh my gay command which literally just adds a transparent image on top the user avatar is WAY SLOWER than my profile command which has a hell lot of things going on
take a lower res avatar
x128 or x256
i use x512 and it's pretty fast
512 is large enough tbh
kool
Oop, I meant to put enough
xD
im reading asynchronous shit on MDN
@pale vessel is it a good idea to make a profile command with > 35 lines of code
can you change font? @earnest phoenix
why
oh nvm I think you are writing onto an image
comic sans is cool
HAIL COMIC SANS THE MOST HATED FONT
oh nvm I think you are writing onto an image
@earnest phoenix yes i am
I hate cursive
there is a background
everything is drawn on top of it
oh alright
one second imma change font
@earnest phoenix what about this: https://www.wfonts.com/font/retroica
looks great
@earnest phoenix the license is not suitable for a botum
what about https://www.wfonts.com/font/impact
it literally has no license
I'd only use this for titles, it looks too cramped to me
ok
I'll use the Impact one for the username and comic sans for the user info
@earnest phoenix https://hasteb.in/lunudubi.js
gtg
use fonts from fonts.google.com
What would an optimal image manipulation package be for C#?
native - magick.net
completely c# - imagesharp
i prefer working with magick.net though
Any significant cons in either for a beginner?
Splendid, thanks
how can i make a command in which the bot will edit the embed message
that's like asking "how to make a car that goes vroom 200km/h"
provide context with your question
what else he can say
it's simple
library, language, what is your goal (and what have you tried so far)
ok what's the lib @weak rain
i m using js
I dunno about discord.js
hm ohk
discordjs
@earnest phoenix Less Lines !== Better
More Lines !== Better
Just a quick question
Can't access docs rn
Is it vote.user.id
Or vote.user.id()
for webhooks, it's vote.user to get the ID








