#development
1 messages ยท Page 1289 of 1
is it linux mac or windows?
win
you need to install build tools
npm i -g windows-build-tools from an admin powershell
but it has to be administrator mode
dont worl
work
gg
oh
how i do that
haha
@quartz kindle like
run as
admin?
now its work i think
im so dumb
@opal plank what program did you use to generate the SLAVE thing text
wdym? thats just hard ascii text
ascii is hard to generate
also why the fuck do people use the word ascii to denote super fancy text it's still outputting Unicode
Hey guys,
I'm using discord.js and I tried to make an awaiting messages and reacting system.
but I got an issue
I'm trying to make it with embed but I dont know how do I react on an embed message
That's what I tried
check #265156322012561408
Where?
talking to @earnest phoenix
oh ok
@balmy anchor send is a promise and returns your message
ok
either await it and store the return value in a variable or use the promise.then pattern
hey
how am i supposed to store it?
take a guess
should I use message.embeds.find()?
no
So how do I get it?
store it in a variable
@boreal iron @quartz kindle AND THANKS TO EVRYONE HELPED LOL
wassup
Should I do it like this?
np
whatever I did lel
boys, how do i save text in a json file.
๐
hmm
i know json files are a risk, but it's just one line of text and only server forone guild.
@eternal osprey wym "save" it?
i have a !append (message) command

the message gets saved in the actual json file
but it's saved strange:
and when i try to work with it later i get: Unexpected token w in JSON at position 1
{}
instead of []?
jsons are always {}
then i believe [] is the dictionary
{} this is for arrays
SyntaxError: await is only valid in async function
execute( message, args ) {
how i fix
@boreal iron
SyntaxError: await is only valid in async function
execute( message, args ) {
how i fix
Anย async functionย is a function declared with theย async keyword. Async functions are instances of the AsyncFunction constructor, andย the await keyword is permitted within them.ย The async and await keywordsย enableย asynchronous, promise-based behavior to be written in a cleanerย ...
this will help you out
try to do research before asking.
@quartz kindle help?
help me pls
You can only use await in an async function
but without custom domain works normal
@low shard did you install windows-build-tools? did it install successfully? did you wait until it said "All Done"?
help meh :((
@violet haven can't help without your code.
OMG IT WORKS
we can't help off a ss only.
jsconst Discord = require("discord.js");
module.exports.config = {
name: "setnickname",
aliases: []
}
module.exports.run = async (client, message, args) => {
if (!message.member.hasPermission(["MANAGE_GUILD", "ADMINISTRATOR"])) {
return message.channel.send({embed: {color: "RED", description: "You can't use this command!"}})
}
let user = message.mentions.users.first();
if (!user) return message.channel.send({embed: {color: "RED", description: "You need to mention the user!"}});
let nick = args.slice(1).join(" ");
if (!nick) return message.channel.send({embed: {color: "RED", description: "You need to input the nickname!"}});
let member = message.guild.members.cache.get(user.id);
await member.setNickname(nick).catch(err => message.channel.send({embed: {color: "RED", description: `Error: ${err}`}});
return message.channel.send({embed: {color: "GREEN", description: `Successfully changed **${user.tag}** nickname to **${nick}**`}});
}
Whats wrong with this command?
i just had to wait
@quartz kindle yep after all this its do a restart to my pc
my code is good it worked
@autumn aspen what error does it give?
@autumn aspen what error does it give?
@eternal osprey unexpected token ;
@eternal osprey
what line?
also I have a module.json
@quartz kindle you have more ways ?
do i need to upgrade something? it uses lavalink
what line?
@eternal osprey at the end also the return at the end is not purple?
wait i will check this code in vsc
wait i will check this code in vsc
@eternal osprey thx
@low shard now try intalling quick.db again
@quartz kindle dont work
@autumn aspen fixed.
show logs
you missed a )
@eternal osprey
also I have a module.json
@eternal osprey
await member.setNickname(nick).catch(err => message.channel.send({embed: {color: "RED", description: `Error: ${err}`}}));``` this would work
np.
you had:
${err}`}});
@quartz kindle look dm
and i saw that there was a ) missing.
@violet haven send your code here. Don't ss.
the bot joins and search for the music but doesn't play it
the last v
Do u know guys how to I make this with an embed?
Do u know guys how to I make this with an embed?
@balmy anchor Does anyone knows?
@low shard what is your better-sqlite3 version in your package.json?
@balmy anchor wdym
oh ye
@balmy anchor have you looked at the discord.js docs?
they have good examples on how to use embeds.
7.1.1
I checked but I didnt understand anything
@quartz kindle
@low shard try npm rebuild quick.db
@quartz kindle nope
how would i save a text line into a json file, but they will be saved in " "
@low shard delete better-sqlite3 and quick.db from your package.json, save your package.json and try installing quick.db again
ok wait
@balmy anchor jew?
@low shard lol wdym
@eternal osprey wdym saved in ""
@balmy anchor ืืืืื?
no cuz i didnt understand how did u knew
!append welcome back will save the message @quartz kindle
lol
@balmy anchor lol
but i cannot use this as text is not json formatted.
how would i still be able to use the text within this json
if its just text you dont need to make it a json
you can put it in a .txt file lol
@quartz kindle ?
fsWrite
fsRead then on returned value, append/modify what you want, then fsWrite
dunno what the issue is

-bots @quartz kindle
i am trying to save plain text with a command to my json file
but apparently i can't.
why not?
@low shard is it still the same error, about integer 3.0.1?
so what i need to do?

@quartz kindle wdym about integer 3.0.1?
and later on i am trying to get and use this message again and it would return: SyntaxError: Unexpected token w in JSON at position 1
not a txt file
either save it on a .txt or .json
of course its gonna error
what you are trying to write ISNT json syntax
?
{
text: "wellcome back!"
}
??
{}
you need to use JSON.parse(data) on read and JSON.Stringify(data) on write iirc
already said all that
yes but he didnt see it
@eternal osprey bro
@low shard bro
you want to do it more easy?
go ahead
cringe
haha
@low shard show your full package.json
funny.
also show your bot's folder
yes
you need my passport id
@low shard what are you talking about, please.
@eternal osprey botghost?
anyone know how i'd go about fully locking the commands when the user is blacklisted?
check if they are blacklisted before executing the commands?
lets go get all night programing/reprograming react website ๐ i'm gonna cry
before you execute a command (in the command handler) return if they are blacklisted
ye i know
you cant do that in an event
is that javascript?
no
py
python
on_command is fired before the command is invoked.
But it doesn't control if it'll be invoked.
py
Consider using a check.
is there not a way to add a check Decorator to it ?
events are independent, one event listener cannot stop another event listener
Yes, you should use a check decorator.
fml,
They're not too hard to grasp, see the guide here: https://discordpy.readthedocs.io/en/latest/ext/commands/commands.html#checks
im js
1% py
@quartz kindle dm
but many things in programming are the same across many langs
i have that open lol, i'm just trying to think about how i'd go about this @sudden geyser ๐
@low shard wait... is your bot in your computer or in glitch? you sent me a package.json from glitch?
wow in this server has so people who are JS
im still noob in js
if i have any stupid question,dont be toxic
:((
and my english bad
there is no other way to fix it
@quartz kindle so
what is the package.json in your bot's folder?
technically on topic but also offtopic, can someone explain wtf this is doing? https://cdn.discordapp.com/attachments/385837258768515083/761625884171436092/0e925yetmoq51.png
but nvm i just
why doesnt it have shit from glitch in it?
rand() == Math.random() ??
cause in my first time that i try to code bot
i assume so
i use glitch
that is a different language
haha
but are you gonna run your bot in glitch or in your pc?
pc
maybe
then delete your package.json and delete your node_modules folder
and then run npm init
and package-lock.json
^
:)) im verry happy that im helping ppl :))
wait what happened?
so?
@eternal osprey ```js
message.channel.send("Wait...").then(m => {
m.edit(embed).then(m => {(
timout: 2000
})
})
}
can u check this pb it has 2 problems
I wanna fix it
wrongly placed )
wrongly placed )
@boreal iron where
message.channel.send("**Wait...**").then(m => { m.delete({
m.edit(embed)
})
} ```
I want it like this
you have 4 possibilities
@autumn aspen wtf is that code
1 is wrong - 25% chance
m.delete({m.edit(embed)})
@autumn aspen wtf is that code
@lethal sonnet lmao I want it to delete the Wait...
when i run this my code just freezes idk why
do you ever stop the loop lmao
I solved it thx
i thought that what the currentPrice<user.balance is for
@swift umbra no but the code
for (i = 0; someVal<otherVal; i++) {
}
i still don't understand it
if current price is smaller than user.balance, increase i then increase total then check again
current price will still be smaller than user.balance because neither was changed, so it will repeat infinitely
Ignoring exception in command ping:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 892, in invoke
await ctx.command.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 790, in invoke
await self.prepare(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 744, in prepare
raise CheckFailure('The check functions for command {0.qualified_name} failed.'.format(self))
discord.ext.commands.errors.CheckFailure: The check functions for command ping failed.```
anyone has inv link for djs server ?
message.channel.send("**Wait...**").then(m => {
m.edit(embed)
})
}
I want it to delete the Wait... not the embed :/
https://discord.com/invite/bRCvFy9 @lethal sonnet
thx
message.channel.send("**Wait...**").then(m => { m.edit(embed) }) }I want it to delete the Wait... not the embed :/
anyone help?
@autumn aspen why are u copy pasting it x2
idk
he quoted himself
lol
...send("bla").then(sent => sent.delete())
thx
message.channel.send("**Wait...**").then(m => {
m.edit(embed)
m.edit(" ")
m.react("โ")
})
}
How am I able to make the embed delete when Im reacting with x?
Ignoring exception in command ping:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 892, in invoke
await ctx.command.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 790, in invoke
await self.prepare(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 744, in prepare
raise CheckFailure('The check functions for command {0.qualified_name} failed.'.format(self))
discord.ext.commands.errors.CheckFailure: The check functions for command ping failed.```
I hate this
```py
#check
def on_command(ctx):
if ctx.author.id == bot.blacklisted_users:
return
@bot.event
async def on_command(ctx):
if ctx.author.id in bot.blacklisted_users:
embed = discord.Embed(title="", description="", colour=discord.Color.red())
embed.set_author(name="BlackListed!")
embed.add_field(name="Sorry", value=f"{ctx.author} It looks like you've been Blacklisted!", inline=True)
await ctx.send(embed=embed)
return
#goes in the commands under bot.command()
@commands.check(on_command)```
message.channel.send("**Wait...**").then(m => {
m.edit(embed)
m.edit(" ")
m.react("โ")
})
}
How am I able to make the embed delete when Im reacting with x?
anyone help?
stop posting ur shit 2-3x all the time
why are you editing twice?
lol
why are you editing twice?
@quartz kindle bc ur was wrong it edites from Wait... to empty
what
I solved it with that
you said you wanted to delete, i told you how to delete
bruh Tim can I show u in my test server?
you said you wanted to delete, i told you how to delete
@quartz kindle yes the wait.. thingy
you want to delete or edit?
yeah me too because your code doesn't make much sense but I'm a bit too sleepy to be able to actually help
so let me just go over the top
i am Pro Confuser
you want to delete or edit?
@quartz kindle just edit it to empty again but I fixed it now bot how can I delete the embed by reacting to x

i think there is a on react event
how would i make sure that [] doesn;t get deleted with my !messageremove command?
em could someone help me with something
}else if (message.content.startsWith(prefix + "removeappend")){
fs.writeFileSync("./append.json", [args7.replace(args7, "") ])```
!removeappend removes the whole line from json
how would i let the [] intact.
Remove your on_command event, rename the check function to whatever else like allowed_to_use
in that function, just do return ctx.author.id in bot.blacklisted_users
to catch the check error, you use the on_command_error (see docs please)
em so i am trying to get my bot online with the command prompt
with the node . command
im not a pro so r u talking about what im using?
discord.js, eris, ...?
good, now show me your folder that you have the bot on
u mean i take a screenshot?
yup
ok
@quartz kindle just edit it to empty again but I fixed it now bot how can I delete the embed by reacting to x
@autumn aspen uhm make an on reaction event, then check if the reaction is an x, and delete the message :p
do node main.js
pretty much, thats how you run the code
you still gotta code the bot though
which is the code inside main.js
ye ik but i need it to go online first
hey guys how do i make sure my !removeappend doesn't remove the [] from my json file?
like i said, its code not an app
you need to put code inside the main.js for it to connect to discord
no-one that knows the answer?
have you coded anything into main.js yet?
no
oh
thats why
i dont think so
well u gkt ur answer now
im a noob
guys need help
@grand pawn do you have your app made in the dev portal?
@earnest phoenix Suggestion: make intents accept a list for intents instead of having to assign True to each intent we want :p
how can i prevent raids or nukes for my server
https://www.youtube.com/watch?v=j_sD9udZnCk here on 13:50
Code your own Discord bot! Coding a discord bot isn't hard at all! with a couple of simple lines you can get a bot up and running on your server. Make sure to stay tuned for upcoming discord coding tutorials. Discord.js makes it very easy to code your own bot without having to...
๐ wtf
no youtube
check 13:50
oh
i was told to start there
you aint gonna get anywhere watching outdated/bad videos
its not outdated
@slender thistle I guess I could do that, sure 
its 2020 may
if anything watch videos for v12
please help me
^^^^^^^^
you need a bit of knownledge of js beforehand
check the second link FIRST
btw im 13 so i might struggle
learn at least a little bit of the basics
cover these :
Objects, Variables, Functions, Arrays, Maps, Switches and if's, that should be enough base for you
I'm thinking of writing my own little list-dict-function_args converter lol
should i scrap what i have done
I'm that lazy to write guilds=True instead of "guilds"
nah, just follow what i said
can you show the code?
here
Noooo
message.channel.send("**Wait...**").then(m => {
m.edit(embed)
m.edit(" ")
m.react("โ")
})
}
I cant find an message event how delete the embed when u react on the x. Can someone send link or help me. Plese.
remove that
first here https://www.w3schools.com/js/
then learn Objects, Variables, Functions, Arrays, Maps, Switches and if's from that site
then go here https://discordjs.guide/ and follow the guide @grand pawn
ur token
ok
remember, you are responsible for tokens
remove the token whenever ur sjaring ur code
do NOT share them
i deleted it
ok
i deleted it
@grand pawn lmao re new ur token
ok
^
i regenerated it
good, now go read that
and i think its
new Discord.Client(), not new Discord.client()
that was an issue as well
ok
I'm that lazy to write
guilds=Trueinstead of"guilds"
@slender thistle I could just make it simply likediscord.Intents.from_list(["guilds", "members", etc])
i will study it
please save the hassle for someone lmao
how long do u think it will take for me to start coding
That's what my whole fork is about 

depends how much time you put into it
lmao
ok thx
I'm half-asleep, it's 0329 and I haven't slept yet so excuse me
to get a good grasp of a programming language? 3 months, maybe. to get started? prob a couple days
gn shivaco!
night shiv


ok thx
@grand pawn press "Ctrl + L"
could i friend u so i can dm u incase i get stuck?
keep support to this channel only
LMFAO
even if im not around theres a lot of people here who can help you
ok
Yes
thx

Now time to get more food and anime
i was told by someone a few days ago that youtube was the best way to start coding
i was told by someone a few days ago that youtube was the best way to start coding
@grand pawn not always
well its not true ;)
^^
oh ok
oh ok
@grand pawn learn docs is better ๐
ok
Like I fkn finally did lol
and what about the program i should be using
stack overflow is my best friend. he understands my problems and tries to help me fix them. he is like a brother to me.
Videos get outdated
They are hard to keep up with every small change
the person doesnt explain things right
their code is shit
half truth's
and the list goes on
tl;dr, read the docs, dont watch videos
and what about the program i should be using
@grand pawn for javascript, i suggest VS Code
oh ok that is what i am using
@grand pawn join my test server for my bot I can teach u stuff
ye
but vsc better
@opal plank yup
remember what i just said about watching youtube n stuff?
that also applies to endph

should have a good idea of what you are talking about before trying to coach someone endph
oh right why am i here lol
i was stuck trying to see why my bot only did stuff when another bot sent a msh
until i realies
realised* thaz i put ! in front of the statement ;-;
Here i am
hello
So then you have to get the message with the id
How do I become a bot developer
Then you are able to read out the content
I have made a bot
Is it approved?
Keep waiting
I wish this shity coronavirus go away
uhh ma,be wrong channel for a talkk?
I've waited 7 weeks
@sturdy osprey you added your bot on september 18th, that's nowhere near 7 weeks my dude
the good of being own of a website who nobody acess is you can test in production
@sturdy osprey you added your bot on september 18th, that's nowhere near 7 weeks my dude
@copper cradle ladies and gentlemen, we got em.
let nick = args.slice(1).join(" ");
if (!nick) return message.channel.send("You need to input the nickname!");
let member = message.guild.members.cache.get(user.id);
if (!member.setNickname()) return message.channel.send({embed: {color: "RED", description: `${member}'s has changed to ${nick}!`}});
await member.setNickname(nick).catch(err => message.channel.send({embed: {color: "RED", description: `Error: ${err}`}}));
}
WHy does it not members new nickname-+
?
v
imagne trying lmao
@copper cradle can u help me with my code
@autumn aspen that wasn't for you
@autumn aspen that wasn't for you
@copper cradle ik but can u help?
@modern sable @frail canopy spammed ADs here. Just saying
@frail canopy ad jail 
lmao
let nick = args.slice(1).join(" ");
if (!nick) return message.channel.send("You need to input the nickname!");
let member = message.guild.members.cache.get(user.id);
if (!member.setNickname()) return message.channel.send({embed: {color: "RED", description: `${member}'s has changed to ${nick}!`}});
await member.setNickname(nick).catch(err => message.channel.send({embed: {color: "RED", description: `Error: ${err}`}}));
}
Why does it not send the members new nickname?
@modern sable sorry for ping but can u help me?
Stop being impatient lol
or enyone help?
can you like, stop being impatient and pinging people
member.displayName
!member.setNickname() makes no sense
!member.setNickname() makes no sense
@quartz kindle yeah I understand but what should be there instead?
Remove that if altogether lol
Everything inside the if
Everything inside the if
@quartz kindle I did it, but what statement am I going to use for the bot to send that info look
const Discord = require("discord.js");
module.exports.config = {
name: "setnickname",
aliases: [],
cooldown: 5
}
module.exports.run = async (client, message, args) => {
if (!message.member.hasPermission(["MANAGE_GUILD", "ADMINISTRATOR"])) {
return message.channel.send(":x: **You don\'t have permission to run this command!** :x:")
}
let user = message.mentions.users.first();
if (!user) return message.channel.send("Please specify a User you want to setnickname on.");
let nick = args.slice(1).join(" ");
if (!nick) return message.channel.send("You need to input the nickname!");
let member = message.guild.members.cache.get(user.id);
return message.channel.send({embed: {color: "RED", description: `${member}'s has changed to ${member.displayName}!`}});
await member.setNickname(nick).catch(err => message.channel.send({embed: {color: "RED", description: `Error: ${err}`}}));
}
there
scope blocked
@opal plank ah thx
last line wont run
you really need to learn scopes and function returns
cuz this ahsnt been the first time i seen you asking the same thing
im amazed your ide isnt telling you about it
you really need to learn scopes and function returns
@opal plank but how do I make it sends that info
at the end
you really need to learn scopes and function returns
slave
im amazed your ide isnt telling you about it
@opal plank I fixed it
Watch out for snowflakes, I heard winter is coming closer
How to get token revoked in a couple simple steps
step 1, run that shit
step 2, profit
winter is coming?
Hey peeps i need some help here
yo
hey are you a js dev?
no, but i do write in js :p
oh
uh could you help with something im trying to do in js
pretty much i need a way to send to channels listed in my db
When I try n run pip install dblpy I keep getting โpip is not recognizedโ -.- idk if my cmd is derpy or Iโm missing something I have python installed so idk why itโs not picking it up
sending mass messages is generally considered api abuse @rotund yarrow
is your plan to loop every channel you have in the db?
if thats your plan you should use a community server
any more than needed
man i has two months stuck in a error, the problem is react doesnt go good with javascript comments ;-;
if (message.flags[0] === "off") {
channel.setRateLimitPerUser(0);
return message.channel.send(`<#${channel.id}> slowmode has been deactivated.`);
}
Ehm I have little problem with turn off the slowmode how do I do hehe
message.flags (?)
@thick gull wdym ?
@autumn aspen what even is your error
@autumn aspen what even is your error
@thick gull no I dont have any errors I just wonder how to turn off the slowmode
look
const Discord = require("discord.js");
const ms = require("ms");
module.exports.config = {
name: "slowmode",
aliases: []
}
module.exports.run = async (client, message, args) => {
if (!message.member.permissions.any(["ADMINISTRATOR", "MANAGE_CHANNELS"])) {
return message.channel.send(":x: **You don\'t have permission to run this command!** :x:");
}
let channel = message.mentions.channels.first(),
time = args.slice(1).join(" ");
if (!channel) time = args.join(" "), channel = message.channel;
if (message.flags[0] === "off") {
channel.setRateLimitPerUser(0);
return message.channel.send(`<#${channel.id}> slowmode has been deactivated.`);
}
if (!time) return message.channel.send({embed: {color: "RED", description: "Please includes the time format."}});
let convert = ms(time);
let toSecond = Math.floor(convert / 1000);
if (!toSecond || toSecond == undefined) return message.channel.send("Please insert the valid time format!");
if (toSecond > 21600) return message.channel.send("Timer should be less than or equal to 6 hours.");
else if (toSecond < 1) return message.channel.send("Timer should be more than or equal to 1 second.");
await channel.setRateLimitPerUser(toSecond);
return message.channel.send({embed: {color: "RED", description: `<#${channel.id}> has been slowing down for **${ms(ms(time), {long: true})}**.`}});
}
jeez I dont even know how to turn it off and thats my command
@thick gull
how do I turn it off?
works for me
how to check if a string has a specific character in js
how do i get my bot to grab the last image link or attachment send in chat
and also: can canvas edit gifs?
this all worked for me https://recolour.is-inside.me/xrevktvo.png @autumn aspen
canvas only grabs the first frame of the gif

canvas is not capable of editing gifs
you would need gifencoder(2) for that
it supports canvas contexts
any recommendations for a good gif editing tool
(best performance)
ive heard imagemagick is good
editing like, development
or editing as in just an image editor that supports gifs
iirc, photoshop has some good gif plugins
^
gifencoder2 for encoding, canvas for editing maybe
ah, I think you might need to separate the gif into individual images then use something like canvas to modify each one and put them together again.
gifencoder2 can modify images?
ye
looks like you may just need canvas and gifencoder2 to go that route
is there really no single package or tool that can do gif editing?
๐คทโโ๏ธ not that I know of
not that those would be any easier than just canvas and gifencoder2
since gifencoder works directly with canvas frames
oh thats cool thanks for letting me know
uhhh....how do u put a support invite for the bot cuase im making a bot my first bot
just paste a link to your support server
how?
uh are you new-new to development or have some programming experience
so add a command to your bot that replies with the link to your support server
I've got the api working and I can see who voted but I had to provide an ID. Is there a way I can check who voted without ID or webhooks?
is there a java equivalent to this in js
console.log(`String ${variable} String`)
doing java cause cs class but i absolutely despise doing this:
System.out.println("String " + variable + " String");
probably something like String.format()
pain .
yes, bread
how can i make this work? Disregards lenght and a demonstration
message.guild.premiumTier.length = 1 ? `level 1` : message.guild.premiumTier = 2 ? `level 2` : message.guild.premiumTier = 3 ? `level 3` : ''
@earnest phoenix Did you mean to use === instead of =
Also I'd recommend not using multiple ternary expressions in a single statement as they're hard to read.
oh ok
big brain
I'm trying to do to have the emblem when it reaches each level
i put
message.guild.premiumTier.size === 1
so i can leave only message.guild.premiumTier === 1
since it's an object, you can use Object.keys(message.guild.premiumTier)[0] to get the tier as a number
it's a number apparently
this would be correct https://discordapp.com/channels/264445053596991498/272764566411149314/761779018822713345
thanks thanks
you can use https://discordapp.com/channels/264445053596991498/272764566411149314/761776789381972088 if you just want to add "level 0" for example
instead of chained ternary
\๐ณ
anyone, know how i can make my help cmd way better
I made a ping command, with msg.edit, but there is one flaw, The first message, when edited, stays, and just added an embed at the bottom
How can I make the Pinging... message disappear?
you can use message.edit({ embed: yourEmbed, content: null })
my first message is not an embed
then when i edit it, it just added the embed at the bottom
yes thatโs what he said
nvm, im just gonna delete the message then send a new one
don't
hmm
my embed is a function lol
that returns what?
async function embed(title, desc) {
const embed = new Discord.MessageEmbed().setColor('#860000').setTitle(title).setDescription(desc)
return embed
}
then you can use message.channel.send("Pinging...").then(sent => sent.edit({ embed: embedFunction(), content: null }));
show your code
if (command == 'ping') {
let one = Date.now()
let msg = await message.channel.send('Pinging...')
let two = Date.now()
let old = Date.now()
await axios.get(`https://api.hypixel.net/skyblock/news?key=${process.env.SKYBLOCK}`)
let oldd = Date.now()
let uptime = convert(client.uptime)
const promises = [
client.shard.fetchClientValues('guilds.cache.size'),
client.shard.broadcastEval('this.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)'),
];
Promise.all(promises).then(async results => {
const totalGuilds = results[0].reduce((acc, guildCount) => acc + guildCount, 0);
const totalMembers = results[1].reduce((acc, memberCount) => acc + memberCount, 0);
msg.edit(await embed('๐ Pong!', `**Discord latency: ${Date.now() - message.createdTimestamp}ms\nAPI Latency: ${two - one}\nHypixel latency: ${oldd-old}ms\nServer count: ${totalGuilds}\nMember count: ${totalMembers}\nUptime: ${uptime}**`))
}).catch(console.error);
}
my embed is a functionnnnn
my godddddddddd
dude what the fuck
Why the brackets and the , content?
that adds an embed, which is the generated embed from your embed() function while setting the message content to null (or empty)
edit accepts a string (that would overwrite the previous message content) or an object with options
embed and content is one of the options
now
I was expecting it like in 20's
why is your embed() function async
it doesn't need to be async
you should remove async and await
kewl
Not sure if this is a discord.net related. I have used an open-source setup it works fine but funny enough on the command feature.
When I request it via command (and not its side alias names) it works fine the scope to my function and calculates as expected but when the alias call is made to the exact command it works but any timing function is messed up.
[Command("qview")]
[Alias("queueview", "view", "queue", "q")]
[Summary("Lets users know who is currently on the island!")]
public async Task RequestQueueViewAsync() {
await Globals.Bot.ViewQueue().ConfigureAwait(false);
}
qview works 100% then when I call its queueview it works but times all janked.
calling with the alias shouldn't have any difference
message.channel.send("Pinging...").then(sent => sent.edit({ embed: embedFunction(), content: null }));
how do i fix TypeError: client.Embed is not a constructor
@earnest phoenix usually its Discord.MessageEmbed(), put it depends on how you imported/declared discord-js
what you'd want is a listener on 'vote'
its unrelated to which platform you use
if you got a bot running you are good to go
just need a port opened
code is code
i see
so yeah, it will work
will
just dont copy that
i dont
make sure you understand what you are doing
i can ask a friend to help
blindly copying snippets wont get you anywhere
but idk if he gonna do it
to put it VERY simply
like, REALLLLYYY simply
rather than logging it on console. just send it on a channel
how
thats literally it
i am new
you'd need to know how your library works
i am in this
which lib you using?
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
i am in that
you dont need that
im new to it
aight, so let me grab the docs rq
first here https://www.w3schools.com/js/
then learn Objects, Variables, Functions, Arrays, Maps, Switches and if's from that site
then go here https://discordjs.guide/ and follow the guide @earnest phoenix
im trying to do here
download node.js -> download visual studio code (or preffered editor) -> start coding.
just read what i sent
alright
@earnest phoenix learn at least those
thats like, the BARE BARE BARE BARE BARE and i cannot emphasise this enough BARE minimum you can start from
fun
you need 4 things. Learn the basic of the language. Download/install node. Download/use Visual Studio Code. Read the guide i sent you
thats it
you need 4 things. Learn the basic of the language. Download/install node. Download/use Visual Studio Code. Read the guide i sent you
@opal plank how tho
where at
Bruh
now im off to watch my anime
ooo
plastic memories
hmm
Sorted my issue I accidentally called two instances with a hotkey press.
I doubted it but I really did.
TY studios for this copy/paste line hotkey
not even sure outside array why someone ever need that, no one should repeat line like that or need to. ๐ Fun fix.
Do I need to know React before hopping into Nextjs?
at parseError (/var/www/bot/node_modules/redis-parser/lib/parser.js:179:12)
at parseType (/var/www/bot/node_modules/redis-parser/lib/parser.js:302:14) {
command: { name: 'hmset', args: [ 'bans' ] }
}``` anyone know I can fixed this?
how do i get my bot to grab the last image link or attachment sent in chat
what library are you using?
Is there any way to reboot my bot using a command??
learn at least those
@opal plank Why no For loop
for() is the most inportain thing
Never used it ngl
but it is importain to understand loops
Not sure if somebody knows but how can I use JSON in MySQL? Should I use blob as the datatype or JSON? I'm so confused and would like to see if there's a tutorial on that stuff or not
Is there any way to reboot my bot using a command??
@carmine summit yes if u use pm2 then use this:
process.env.exit()
Not sure if somebody knows but how can I use JSON in MySQL? Should I use blob as the datatype or JSON? I'm so confused and would like to see if there's a tutorial on that stuff or not
@gentle lynx u know what(just a suggestion) Dont use MYSQL cuz it is verry verry old, it is like for ur Grandpa. Use some new Database :))
lol what
example MongoDB, quick.db and bla bla
it's ok-
@opal plank look ```js
if (message.flags[0] === "off") {
channel.setRateLimitPerUser(0);
return message.channel.send(<#${channel.id}> slowmode has been deactivated.);
}
How do I chancel the slowmode?
so you use it?
/slowmode off?
i use
let embed = new MessageEmbed()
message.channel.send(embed)
@autumn aspen wow rly
then im 100% not taking a word about what your opinion is about performance
that
embed builder is TWENTY times slower than other methods
@opal plank uh then why u use it
forEach() falls just as close, its way less performant
embed builder is TWENTY times slower than other methods
@opal plank noooooo
who said i use it?
@carmine summit yes if u use pm2 then use this:
process.env.exit()
@lethal sonnet whats pm2

@opal plank ecplain what is pm2
uh no ForEach() is goof
good
forEach is ๐
forEach is trash
^^
forEach is trash
yea
smh ok ok
uh norhing
especially for async stuff
i will use for
hence why im showing you legit using embed builders which are absurdely waste of resource power
@autumn aspen setRateLimitPerUser can be set to zero to disable slowmode
while claiming that forEach is good
process.env.exit()? 
no harm in not knowing, just dont say something is good/bad until you use it
@autumn aspen setRateLimitPerUser can be set to zero to disable slowmode
@earnest phoenix yes but is it /slowmode 0 or /slowmode channel 0 idk??
smh my 1month codes gone, i have to fix all of then
Can u check
giving false/bad feedback is a horrible idea
@earnest phoenix can u check my code real quick
1 month when we say "forEach is bad" 
next thing you see, you taught a new dev to use basically forEach() and unoptimized code all throughout their stuff
@compact oriole well i dont care alots about my performance, cuz my ping is alway less then 120
lying
it doesn't take a month for for-loops
@lethal sonnet whats pm2
@carmine summit PM2 is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.
you can read more about it here - https://www.npmjs.com/package/pm2
now i have change all od them
pm2 op
i dont like pm2












