#development
1 messages · Page 1527 of 1
And twemoji? Copycats
so its 18-20
i have an id that is 17
What would happen when the time comes
92436985859293184 @proven lantern
345539839393005579 @sudden geyser
491002268401926145 @rose warren
510736807999307786 @solemn elk
Apparently @sudden geyser wins
it would be stuck at the max value
oi
I'm always superior.
!idbattle
😂
Anyone know of any good JS packages/tips for "Decancering" strings? (I.E. zalgo/crazy unicode)
decancering lmao
thats a nice word
idk how to use a database yet 
there's a first time for everything
im smol in the field of programming
grow up
imma learn databases soon for sure
we all did
The More You Learn
then don't ask for support for a method of storing data that's known to be unreliable, not suggested and easily breaks 🤷♂️
it's an id from a random bot user
sad
Using a DB isn't that hard. Look into it :)
mongodb stores data in bson which is just json after being converted from binary
but it's much more than just storing data in json/bson
and probably a ton of things to protect the database from corruption.
The most important thing that a db offers is data safety
Any data written to a db will never be lost under normal cirumstances
Lol
the superior jason.db database
Jason Voorhees
PoggersDB
chill its coded well
tis a json db
DataCorruption™️
i use elasticsearch and firestore for my bot
Bro, GamingDB
i'd very much like to put that on test
PoggersDB
link the cursed thing pls
bork prod server is bork
package
idk npm
well the fact that the snippet doesnt work on js is quite a good thing
Wut
precious
Lol
well it does hold to its "it was made as a joke"
@crimson vapor can you provide an actual working snippet?
check out https://www.npmjs.com/package/true
if anything its more accurate that it instantly doesnt work.
Lmao another one... There are many like that
Bro
npm joke packages are getting out of hand
const { DB } = require('jason.db');
const database = new DB('data.jason', { writeFile: true });
const data = database.collection('data');
data.set('x', 'y');
data.get('x');```
^^
should work
fuck
make the file or pass option 'writeFile': true
cmon million

isThirteen
Erwin did it work?
good
Theres an actual package isThirteen
its basically a map, but with a db
functional programming™️
42
yes
yes
Ever needed a module that literally does nothing? NPM has you covered. From anime text to single liners inflated to an entire module, there's some really ridiculous packages on NPM, all of which can be included through Node.js and the browser.
Hope you enjoyed the video!
Check out this code here:
https://github.com/engineer-man/youtube-co...

Erwin you should try out poggersDB
const { PoggersDB } = require('jason.db');
const database = new PoggersDB('data.poggers', { writeFile: true });
const data = database.collection('data');
data.set('x', 'y');
data.get('x');```
way better than vanilla db
YES
my glorious creation
it's so secure that sometimes the decryptor won't even work
how can i look fon unavaliable guilds on a shard?
Just filter guilds and check if their <Guild>.available property is false?
huh
bruh, gimme a sec
@earnest phoenix is this ok for checking if a guild is available?? js client.guilds.cache.forEach(g => { if(!g.available) console.log(g.name) })
i cannot believe this
whats poggersdb
It should work
what a guy
the best database ever
i remember making a bot that banned everyone that was playing fortnite
es2021 needs to abolish the forEach function

all my code would error 
that sucks

guess I didn't think of that
thats not the only issue
LMAOO
properly coded is an overstatement
nah thats user error
not when you pass it the promise of a get
then you should keep it to yourself, not for public 
its just polluting npm community
took it 5 lines to break it
and yes, that traffic is achieveable
hmm
how come it errors then and not before LOL
presences im getting 22k per minute
good question, you the one who coded it
¯_(ツ)_/¯
fs.renameSync is erroring iirc
blocking shit
this shows you dont have a queue system
you just dumping the operations as they come
good luck trashing your hdd tho lmao
im only being this harsh cuz its a troll package, which im highly against it. Would it have been a proper package, i would've been nicer, but , as mentioned, the fact that this was made under the premise of "troll pakcage" alreayd makes me dislike it, as its just contributing to npm pollution
I would call it an actual package but that leads me to bigger questions like why did I make a shitty db and such
maybe its somewhere in between
Albeit broken kekw
TODO: make queue system
TODO: delete repo
hmm
yea idk about that one
the thing that i dont get is the fact that this doesnt provide much, if any gains over other stuff. Redis would be faster, more optimized, and still be able to keep it after the process shuts down. Then move to any other db, like postgres, and you get the same, though for comparison, i'd like to point out redis, that has the same key/pair system you made, but its far better. What DOES your package provide that others dont?
it doesn't have anything better than most
even at a working state
it fucks rss because of the constant reading and writing JSON
you just proved his point
I do get to say I learned more because of it
then why post it?
honestly as a joke
im not trying to disencourage you from coding, im disencouraging you from posting random libs to an npm workspace
ik and I understand that tbh
to put it bluntly, its not contributing to the community in any way
I know that, I even would suggest not using it as its really inefficient
the same reason as to why is-undefined is a thing, we know its a troll, but theres ACTUAL people out there who use stuff like that as dependancy, its a step towards the wrong direction to be posting those without the intent to actually be usefull, it just dumps gasoline in the community
fair point tbh
I tried to say in my readme not to use it
but many people won't read the readme
if you intend to compete and make your db, go ahead, dont be afraid, but pls dont post it as a troll, put actual commitment into making it useful for someone if you're going to be posting it
do people actually use is-undefined?
does this answer your question?
is-odd to be kinda pog tho /s
ik thats why /s
/s
THIS
I created this in 2014, the year I learned how to program. All of the downloads are from an old version of https://github.com/micromatch/micromatch. I've done a few other things since: http...
this single line is what makes this whole thing
but people actually install this whole thing for that one line
That github username already explains the kekw moment of the package
Wtf
maybe 8k
one would say the same about your troll lib
834k
maybe that would be joke
so, careful with it
idk fuck me if people use my lib
we live in a society
theres ACTUAL people out there who dont know better and use it
so, refrain from posting troll poackages if possible
https://million.is-a.computer/files/pOPmsz0d7ErnwoRN.png how do people even find it?
first 2 are actual results
define Discord
const Discord = require('discord.js')
I think
:(
fixed
:)
JS is a good starter language so there's a lot of dumbasses rolling around but we're not all bad 😔
you kinda took his statement out of context
i know
I started sharding my bot early, is there any issue with that? It's at 60+ servers.
1 shard
why tho
if it's just 1 shard that's basically the same as not sharding so i wouldn't think so
you'll just have less of a headache later, you don't necessarily get any cons
futureproofing i guess
experimental, and I think it would be good to know about it earlier than later.
fair
i'll need to do sharding later, not sure if i'll use d.js's sharder or if i'll make my own
d.js has been failing misreably with me recently
i learned to shard my bot at 25 
how so
Wait, you can make your own sharder?
well, for starters, using about 3gb of ram
use kurasuta, it's pog
i did my own sharder for twitch, yeah
you can make your own anything ✨
yukine made it
thank d.js for this garbage
now im running loops to kill the cache
cuz some of them d.js for some godly retarded reason doesnt expose
jeez how many servers is that in?
not too bad i suppose
nice interface, i still want/need to make an interface someday but uni 
christ
its been quite annoying ngl
pog
where do all those people find your bot lmao
google ads 
google ads 
p2w bot development
dam u stole google ads? wtf
patreon
¯_(ツ)_/¯
that still counts
wowie
what is this first world setup
[developers hate him] use this one single trick for free vps and google ads
what're those tools huh 
spill the beans
yeah that sounds legal 🧐
though i do have some plans to increase interactivity when the bot calms down
it IS legal
thats what id say if it was an illegal secret
its just a laptop running 24/7 somewhere
thats the vps
people here saw me literally abuse twitch api, think i'd be hiding it?
does anyone see a error with that?
['command_handler', 'event_handler'].forEach(handler =>{
require(./handlers/${handler})(client, Discord);
})
it says error - require is not a function or som
require(...) is not a function
awesome
Pog

that helps 0
that doesnt help
yes it does, its google
yeah the first result seems quite helpful

The othet file?
try not using an arrow function
^
Doubt its arrow functions
epic witchery
pog
did you fix the previous issue or did you create a biger issue that is prioritized over the previous one
fixed the last one
i forgot to save all
i was clicking save
not save all
Kek
did you define dirs
like const dirs
?
@opal plank Yo erwin, you there
to put me in context...
im a highschool student
attempting to learn code
and this is how i chose to learn it
hai
don't think age matters
we have middle school devs here quite frequently, we see silly questions all the time, dw.
Would you mind to rate this
https://npmjs.com/package/string-toolkit
yeah, const dirs, or any other definition methods.
the fuck is this
another troll poackage?

no
what should dirs be defined as
bc i dont think i did
i dont know, its your code.
Nope
im just making a command and event handler
in node.js
so, somewhere in your code you have a variable being used called dirs right?
Show some code smh
yes
my main js looks like that
Reset ur token
I uninstalled it and deleted the whole puppeteer file but same issue
ahh shit
Before someone uses it
gotta run some errands soon, cant break it test it
Where does the dir error come from
K take your time if you will
Probs one of the other files

ping me if you know something about that
It's not?
It kinda is tbh
U added that random faketoken poop
tip, enable auto save on vsc
Well yea, idk some users of the package requested that
So i just said fuck it let's add
U should first tead the contents of the events folder
But i dont think u need that
wdym
While commands have categories
U dont need categories for events
Unless u rlly want to
How thou
Well first i guess u gotta use fs to read the events folder
Then u can get dir
ok i fixed that
now last issue
wtf is this
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\Users\Benso\OneDrive\Desktop\JustMe\handlers\event_handler.js',
'C:\Users\Benso\OneDrive\Desktop\JustMe\Main.js'
]
}
fs and discord.js are both installed
You probs are requesting the wrong file somehow
fml
or u mess up the path
you know when you declare a file
const { prefix, color} = require('./config.json');
What module is it not finding
doesnt say
do you know what file that is in
yea
scroll up
C:\Users\Benso\OneDrive\Desktop\JustMe\handlers\event_handler.js',
'C:\Users\Benso\OneDrive\Desktop\JustMe\Main.js'

the main js and event handler
const { prefix, color} = require('./config.json'); --> correct
const { prefix, color} = require('./../../../../../.../config.json'); --> this path is probably incorrect
am I being helpful?
idk
Don't think that is rly related rn
@earnest phoenix how does the events folder look like
I just got the feeling that he is trying to declare a file and have wrong path my bad
wait a min where is main.js
Im not too sure what u changed in the dir code but
It seems to be a typo
Where the parameter is accepting dir
And u are writing dirs
Are the file separators correct?
huh
Like / instead of \ in the path. What OS are you on?
Hm, should be / then
Try swapping to backslash and see if it makes a difference
if you want to use backslash you have to escape it \\
It should be fine though
Same
I'd love to try to help more but I'm awful at js
almost never done anything with it
C:\Users\Benso\OneDrive\Desktop\JustMe\handlers\event_handler.js', if this is where the file is I'm pretty certain you'll need to go up directories first. ../ is how you move up 1 directory
./ references the current directory while ../ would mean the parent directory (or one directory above)
so what do u want me to do
im confused asf
@pale vessel e @lament meteor
this might have helped
Error: Cannot find module '../events/${dirs}/${file}'
good eyes voltrex
huh
you only used it on your event_files
so...
how do i fix it
By using template strings
`
WHERE
I DID ALR
const event_files = fs.readdirSync(./events/${dirs}).filter(file => file.endsWith('.js'));
Line 8
dude
@earnest phoenix
?
u r a fucking legend


how did u get to be a verified bot dev
wtf
By reaching my bot to 75+ guilds and applying for verification
But that's deprecated
did u pay anything for it?
Nope
u dope
You too bro

totally
when i cant even get a symbol right

Well simple mistakes, everyone makes mistakes
not u apparently
also question, the more people that use your bot and run cmds on diff servers, does that need more or less like cpu or anything
I also do make mistakes, since I'm developing everything on mobile
Mostly spelling errors tho
damn
Well more operations === more CPU usage
ohhh so i will need a vps if i want to be public and stuff?
normally i just host for free on repl and ping the server to keep the repl alive
You don't need a VPS to host the bot. But it's definitely recommended
I mean, you would require a VPS if you want your bot to be online all the time and not end up having low amount of ram or something or get memory leaks or stuff like that
shit
wheres the cheapest and easiest place for that
The other option would be to host it yourself if you have a computer that can stay on 24/7
Galaxygate is pretty good, cheapest is $3/month i think
i dont rlly have job rn
If your bot grows up too much, you would also require something more than a VPS
A dedicated server
awww fuck
thats like 100s a month
fml
You can check the pinned messages in this channel for some more info about VPS's
There's also a list with hosts there
- OVH: https://www.ovh.com/us/vps/
Starting at $3.35/mo for 1 core, 2GB RAM, 20GB SSD - DigitalOcean: https://www.digitalocean.com/
Starting at $5/mo for 1 core, 1GB RAM, 25GB SSD - Linode: https://www.linode.com/
Starting at $5/mo for 1 core, 1GB RAM, 25GB SSD - Vultr: https://www.vultr.com/
Starting at $2.50/mo for 1 core, 512MB RAM, 10GB SSD - Amazon(AWS) Lightsail: https://amazonlightsail.com/
Starting at $3.50/mo (first month free) for 1 core, 512MB RAM, 20GB SSD - Time4VPS: https://www.time4vps.eu/
Starting at €3.99/month for 1 core, 2GB RAM, 20GB SSD - VIRMACH: https://virmach.com/
Full Windows and Linux Desktop VPS starting at $7/mo and $1/mo respectively
ℹ This is a list of hosting providers, not a backing/support for them. You will need to make your own decision. All $dollar prices are in USD.
I recommend just starting out with a really cheap one. You'll notice if your bot starts to blow up but to be honest the chances aren't too high unless it's a really unique and useful bot
Okay that's too many embeds lmao
lye node
so how would i go about setting up a donationd cmd
I'd just make a command that shows a link to your paypal.me or whatever
patreon
wherever you wanna get paid
No clue, never used patreon
bc my paypal isnt verified so i cant recieve business payments
bc im not paying taxes on that shit
Patreon has a lot of payment methods redirected to you
bitcoin?
So check it out if you want
I don't think it accepts bitcoin
If you're unsure whether you want to go for a VPS or not I recommend Vultr. They charge per hour rather than taking the entire amount at the start of the month ^^
it says it can go directly to a bank
so i guess that would work
but ill need to setup a bank acc
shit
Well good luck with that i guess
thx ig
one more question
how do i make the bot send a message in a channel every 24 hours
Set an interval
setInterval()
ok f that
It's against the rules of a bot to have unprovoked messages though, no? Or at least you'd need a way to disable them per server
seriously last question and im gone
how do i make the mute cmd remove all roles instead of 1
bc one role doesnt work in every server bc they can be named dif
It's not, it's just not recommended to abuse the API as in making many API calls in a short amount of time
But 24 hours is fine
my mute cmd is a mess and i just want it to remove all roles
If you didn't know, you can set the roles, <GuildMember>.roles.set([])
Removes all the roles
that will remove all the roles for the mentioned user?
Well member cause users don't have roles
but i mean even if they had say admin role or som
will it remove admin, member, vip, like every role
The bot would need to have a higher role than the role it wants to remove
ofc
If the bot's highest role position is higher than the position of the member's highest role
Then yes
welp
now to figure out how to code the mute cmd
fuck me

module.exports = {
name: 'mute',
description: "Mutes Chosen Member",
execute(message, args){
if(!message.member.hasPermission("MUTE_MEMBERS")){
message.channel.send('You dont have those perms!')
}
if(message.member.hasPermission("MUTE_MEMBERS")){
const target = message.mentions.users.first();
if(target){
let mainRole = message.guild.roles.cache.find(role => role.name === 'Member');
let muteRole = message.guild.roles.cache.find(role => role.name === 'Muted');
let memberTarget = message.guild.members.cache.get(target.id);
memberTarget.roles.remove(mainRole.id);
memberTarget.roles.add(muteRole.id);
message.channel.send(`<@${memberTarget.user.id}> Has been muted`);
} else{
message.channel.send('user not found or could not be muted');
Don't hesitate to ask here if you run into any issues you can't google your way out of. But remember, no spoonfeeding
thats how shitty mine is
thats the issue
is there anyway i can tweak that code with urs
<GuildMember>.roles.set([])
So it would remove all the roles?
yea
memberTarget.roles.set([]);
thats it :/

I don't recommend doing that upfront, check if the user exists before proceeding through the code
Wait a minute
Why are you getting the member twice?
wdym
Oh well you're getting a user
If you didn't know
yea...
you need to get the user to check if it exists
There's <Message>.mentions.members.first()
So you don't have to get the member
As that already returns it
so what do i take out?
What do you need help with?
message.mentions.users.first() → message.mentions.members.first()
Remove let memberTarget = message.guild.members.cache.get(user.id);
Rename all memberTarget to target
module.exports = {
name: 'mute',
description: "Mutes Chosen Member",
execute(message, args){
if(!message.member.hasPermission("MUTE_MEMBERS")){
message.channel.send('You dont have those perms!')
}
if(message.member.hasPermission("MUTE_MEMBERS")){
const target = message.mentions.users.first();
if(target){
memberTarget.roles.set([]);
message.channel.send(`<@${memberTarget.user.id}> Has been muted`);
} else{
message.channel.send('user not found or could not be muted');
}
}
}
}
oh its js
better
Man
memberTarget → target
module.exports = {
name: 'mute',
description: "Mutes Chosen Member",
execute(message, args){
if(!message.member.hasPermission("MUTE_MEMBERS")){
message.channel.send('You dont have those perms!')
}
if(message.member.hasPermission("MUTE_MEMBERS")){
const target = message.mentions.members.first();
if(target){
let Target = message.guild.members.cache.get(target.id);
Target.roles.set([]);
message.channel.send(`<@${memberTarget.user.id}> Has been muted`);
} else{
message.channel.send('user not found or could not be muted');
}
}
}
}
there
Why to get the member again?
bru
IM SO CONFUSED
Remove
let Target = message.guild.members.cache.get(target.id);```
bro
Rename Target to target
ffs
here
module.exports = {
name: 'mute',
description: "Mutes Chosen Member",
execute(message, args){
if(!message.member.hasPermission("MUTE_MEMBERS")){
message.channel.send('You dont have those perms!')
}
if(message.member.hasPermission("MUTE_MEMBERS")){
const target = message.mentions.members.first();
if(target){
let target = message.guild.members.cache.get(target.id);
target.roles.set([]);
message.channel.send(`<@${target.user.id}> Has been muted`);
} else{
message.channel.send('user not found or could not be muted');
}
}
}
}
better?

WHAT
IM TRYING
I said remove it
u just said change it
module.exports = {
name: 'mute',
description: "Mutes Chosen Member",
execute(message, args){
if(!message.member.hasPermission("MUTE_MEMBERS")){
message.channel.send('You dont have those perms!')
}
if(message.member.hasPermission("MUTE_MEMBERS")){
const target = message.mentions.members.first();
if(target){
target.roles.set([]);
message.channel.send(`<@${target.user.id}> Has been muted`);
} else{
message.channel.send('user not found or could not be muted');
}
}
}
}
happy?
im triggered
Now that's pog
better be
Also don't use <GuildMember>.hasPermission()
Because it'll be removed
wdym
v13 wont have this method anymore
next discord.js update or others will remove it
They're gonna remove that method, so you gotta use <GuildMember>.permissions.has()
if(!message.member.permisions.has("MUTE_MEMBERS")){
?
Yes
Spelling tho
Missed an s
ik
now
how do i make it add the muted role
and so it isnt my server only that it works in
i need to have the bot create a muted role or check for one?
Make it so if it can't find the Muted role, create one
right
and how do i do that
LMAO
i know im fucking stupid now
ill just copy and paste from google or som
wait @earnest phoenix
would
if(!guild.roles(Muted))
Create guild.role(Muted) or som work
and what do i do with that
how do i make it run that when missing the role
ik its a if but whats the if
if (!mutedRole) mutedRole = /* create role */```
how do i define mutedRole
guild.cache
?
You already did
module.exports = {
name: 'mute',
description: "Mutes Chosen Member",
execute(message, args){
if(!message.member.permissions.has("MUTE_MEMBERS")){
message.channel.send('You dont have those perms!')
}
if(message.member.permissions.has("MUTE_MEMBERS")){
const target = message.mentions.members.first();
if(target){
target.roles.set([]);
message.channel.send(`<@${target.user.id}> Has been muted`);
} else{
message.channel.send('user not found or could not be muted');
}
}
}
}
u made me delete it
I didn't say remove those tho
or someone did
im killing myself
im done
Bro no
im jk
but fr wtf
so const mutedRole = +
or use let mutedRole
let mutedRole = message.guild.roles.cache.find(role => role.name === 'Muted');```
module.exports = {
name: 'mute',
description: "Mutes Chosen Member",
execute(message, args){
if(!message.member.permissions.has("MUTE_MEMBERS")){
message.channel.send('You dont have those perms!')
}
if(message.member.permissions.has("MUTE_MEMBERS")){
const target = message.mentions.members.first();
if(target){
let mutedRole = message.guild.roles.cache.find(role => role.name === 'Muted');
target.roles.set([]);
message.channel.send(`<@${target.user.id}> Has been muted`);
} else{
message.channel.send('user not found or could not be muted');
}
}
}
}
now put if (!mutedRole) mutedRole = /* create role */ below let mutedRole
I would check for non case-sensitive
Yes, but this time you gotta actually create the role
if (!mutedRole){
shit
one sec
Well we'll be creating a role with that exact name if it doesn't exist so
Should be good
if (!mutedRole){
guild.roles.create()
.then(console.log)
.catch(console.error);
}
that works?
You gotta assign the value of the created role to mutedRole
huh
Ah alright. Looks like a long way until you both reach this goal lmao
mutedRole = // Create role here
so what do i put there
LMAO
const mutedRole = Muted
or...
if (!mutedRole) mutedRole =
guild.roles.create()
.then(console.log)
.catch(console.error);
there
mutedRole = await <Message>.guild.roles.create({
data: {
name: 'Muted'
}
});```
where tf do i put that
wtf

below the create thing
I think this is why they want you to learn JS before making a bot in JS lol
yea but my school can fuck off
they do everything so slow

You can learn JS outside of school though
Plenty free tutorials online for free
Don't run before you know how to walk fella
ill just stick to yt and google
well im abt to fuck off anyway
just needed help with mute cmd
mutedRole = await <Message>.guild.roles.create({
data: {
name: 'Muted'
}
});
that goes below when the role got created?
if (!mutedRole){
guild.roles.create()
.then(console.log)
.catch(console.error);
}
mutedRole = await <Message>.guild.roles.create({
data: {
name: 'Muted'
}
});
like that
so no more help?
when you literally moved the creating role out of the if statement
bro i have all my code alr
i just needed help with 1 cmd
i alr have a fully working bot
What's the point of making a cmd if you don't understand the code they're showing you?
Another bot developer that dosent know what they are doing
i thought .catch went at the end
If you don't know where it should be placed, then you don't understand it
can u just tell me where to put it
then ill go read docs
how can i make my site not look like shit with basic html?
not use html
Learn CSS :)
Use style tags 
if (!mutedRole){
guild.roles.create()
.then(console.log)
.catch(console.error);
}
mutedRole = await <Message>.guild.roles.create({
data: {
name: 'Muted'
}
});
Cannot read property of 'help' of undefined
K one last attempt
if (!mutedRole) mutedRole = await <Message>.guild.roles.create({
data: {
name: 'Muted'
}
});```
then assign the value
Aight imma watch this channel's stupidness i guess 
🍿
I'll bring the popco- oh nvm
so thats all i need
Style
You're trying to create an empty role, you're not putting anything in the parentheses
Simply isnt anyway else
yea thats what im trying to say
ur not changing the perms
then go look at how to change perms
No, you're literally not creating anything with guild.roles.create()
I didn't include permission changes because you can't deny them on creation, you can only overwrite permissions on channels
if (!mutedRole) mutedRole = await <Message>.guild.roles.create({
data: {
name: 'Muted'
}
});
your making a blank role with name Muted
wdym
Yeah, at least you've created a role now
no copy paste, 100% not
Read the documentation
wait
This channel isn't meant to help you create entire commands
It takes an array
[mutedRole]
then how does
target.roles.set([]);
work
to remove all roles
That just sets it to empty roles
Pass
[mutedRole] instead of []
so target.roles.set[mutedRole]
🗿
set([mutedRole])

Half brain cells lost so far
module.exports = {
name: 'mute',
description: "Mutes Chosen Member",
execute(message, args){
if(!message.member.permissions.has("MUTE_MEMBERS")){
message.channel.send('You dont have those perms!')
}
if(message.member.permissions.has("MUTE_MEMBERS")){
const target = message.mentions.members.first();
if(target){
let mutedRole = message.guild.roles.cache.find(role => role.name === 'Muted');
target.roles.set([]);
target.roles.set([mutedRole]);
message.channel.send(`<@${target.user.id}> Has been muted`);
if (!mutedRole) mutedRole = await Message.guild.roles.create({
data: {
name: 'Muted'
}
});
} else{
message.channel.send('user not found or could not be muted');
}
}
}
}
You're gonna need a weeks worth of sleep to recover
Probably years
idgaf about the actual roles perms
is that right atleast
You're setting the roles multiple times
🗿
yea
once to clear roles
then to add the role
The one i showed already clears the roles and adds that role
HOW
NO IT DOESNT
It absolutely does
where
all it says if the role is missing to create it
What?
module.exports = {
name: 'mute',
description: "Mutes Chosen Member",
execute(message, args){
if(!message.member.permissions.has("MUTE_MEMBERS")){
message.channel.send('You dont have those perms!')
}
if(message.member.permissions.has("MUTE_MEMBERS")){
const target = message.mentions.members.first();
if(target){
let mutedRole = message.guild.roles.cache.find(role => role.name === 'Muted');
target.roles.set([]);
target.roles.set([mutedRole]);
message.channel.send(<@${target.user.id}> Has been muted);
if (!mutedRole) mutedRole = await Message.guild.roles.create({
data: {
name: 'Muted'
}
});
} else{
message.channel.send('user not found or could not be muted');
}
}
}
}
that says if the role is missing to create it
nothing else
You're also checking if the role exists after you've already tried to assign the role
75% of brain cells lost so far
SOMEONE JUST TELL ME WHERE TO PUT IT SO I CAN MOVE ON
I HAVE 3 MORE BOTS TO CODE
And some JavaScript to learn
im actually going to kill my self in a minute
im not joking
where
the
fuck
do
i
put
it
@earnest phoenix if u just tell me where to put it then i can stop asking you questions
@earnest phoenix What do you want
I literally told you like 5 times now
no
u told me what to put
99% brain cells lost so far
not where to put
JUST TELL ME AGAIN THEN

Sigh
Under
let mutedRole = message.guild.roles.cache.find(role => role.name === 'Muted');```
lemme introduce you to the DBL discord server, where you wont get spoonfed and told to look at js tutorials and docs
if (!mutedRole) mutedRole = await Message.guild.roles.create({
data: {
name: 'Muted'
}
});
under that?
Message?
🗿 101% brain cells lost so far
DUDE
ya know what
im done with life
Dude no wtf
orr look at the docs
The guy literally just told you where to put the thing you were asking about
I FUCKING DID IT
There you go
Message
if i run this and it errors out
i quit
message
bro
wtf
await is only valid in a async function
so do i just put async in front of execute
no bc that fucks it up
so WHAT NOW
Before not after
t
async execute
bro
ur command sucks ass
it doesnt even remove member role
what the fuck
@earnest phoenix
no one even talked about removing the member role 
target.roles.set([]) was supposed to remove all roles
it didnt do shit
It should work if the bot has a higher role than the target's highest role 
I'd sure love to keep helping someone who tells me my help sucks 
has the highest role in the server
And that action can't be done on the server owner
no shit
i have 120 members
not a single one worked
Is there any errors?
when i did it on a higher role all it said was missing perms
which is normal
lower role, no
Where i put that?
so now what, how do i make it remove all roles
<TextChannel>.send('Some string here', {
disabledMentions: 'everyone'
});```
Lets i try it!
oh?
Wait when
I never saw a PR saying it would be removed
so nice
now i have to put all my code back
im done
i quit coding this damn bot
too much time just to redo it all
in v13 it will be like this ```js
channel.send("something", {
allowedMentions: {
parse:["roles","users","everyone"]
}
})
That would only parse it tho
im leaving
So it doesn't disable the mention
gl anyway
ok
if not parsed it should be disabled
so disabled by default?
i think so
i suggested that like last week
@earnest phoenix you get your braincells back now??
2-3 hour recovery time
It'll take 69 << 420 (1104) hours to recover
dam
wtf happened
just a whitename being a whitename
damn
white names are superior
not on this server anyway
why is it not working
btw this is a leveling command
let messagefetch = db.fetch(`messages_${message.guild.id}_${message.author.id}`)
let levelfetch = db.fetch(`level_${message.guild.id}_${message.author.id}`)
it just said 0 message and 0 levels

So if I want like a embed, and a embed without what do I dom.
?
Because it's set to 0?
nah, roles don't mean anything
trust me 99% of whitenames on this server dont know what their doing





