#development

1 messages · Page 1527 of 1

earnest phoenix
#

(discord uses twitter snowflake system)

rose warren
#

And twemoji? Copycats

solemn elk
#

so its 18-20

proven lantern
#

i have an id that is 17

sudden geyser
#

What would happen when the time comes

solemn elk
#

92436985859293184 @proven lantern
345539839393005579 @sudden geyser
491002268401926145 @rose warren
510736807999307786 @solemn elk

Apparently @sudden geyser wins

earnest phoenix
solemn latch
#

oi

sudden geyser
#

I'm always superior.

solemn latch
#

136583532972605440

#

???

#

ignored pandasad

solemn elk
#

xD

earnest phoenix
#

don't store data in json

#

🤷‍♂️

buoyant aspen
#

Anyone know of any good JS packages/tips for "Decancering" strings? (I.E. zalgo/crazy unicode)

quartz kindle
#

decancering lmao

earnest phoenix
quartz kindle
#

thats a nice word

solemn elk
earnest phoenix
#

there's a first time for everything

solemn elk
#

im smol in the field of programming

quartz kindle
#

grow up

solemn elk
quartz kindle
#

we all did

solemn elk
quartz kindle
#

yup

#

:3

earnest phoenix
#

then don't ask for support for a method of storing data that's known to be unreliable, not suggested and easily breaks 🤷‍♂️

proven lantern
#

it's an id from a random bot user

rose warren
#

Using a DB isn't that hard. Look into it :)

proven lantern
#

mongodb stores data in bson which is just json after being converted from binary

earnest phoenix
#

but it's much more than just storing data in json/bson

proven lantern
#

yeah, indexes can be added to improve performance

#

but they can be added after

solemn latch
#

and probably a ton of things to protect the database from corruption.

proven lantern
#

replica sets and sharding

#

arbiter nodes

quartz kindle
#

The most important thing that a db offers is data safety

#

Any data written to a db will never be lost under normal cirumstances

opal plank
#

except json dbs

#

looking at you, cuck @crimson vapor

quartz kindle
#

Lol

mellow kelp
#

the superior jason.db database

quartz kindle
#

Jason Voorhees

pale vessel
#

PoggersDB

crimson vapor
opal plank
#

tis a json db

crimson vapor
#

no corruptions

#

™️

mellow kelp
#

DataCorruption™️

crimson vapor
#

none

#

because good

proven lantern
#

i use elasticsearch and firestore for my bot

earnest phoenix
#

Bro, GamingDB

opal plank
#

i'd very much like to put that on test

mellow kelp
#

PoggersDB

crimson vapor
#

I tried hard

opal plank
#

let see if i break your db by pulling it on my prod server

crimson vapor
#

idc what you do

#

just make sure its reproducable

opal plank
#

link the cursed thing pls

proven lantern
#

bork prod server is bork

crimson vapor
#

fuck

earnest phoenix
#

package

opal plank
#

imagine not knowing your own url

pale vessel
crimson vapor
#

idk npm

earnest phoenix
#

despite that big warning you put there

#

people are still going to use it

opal plank
#

well the fact that the snippet doesnt work on js is quite a good thing

quartz kindle
#

Wut

opal plank
#

10/10 lib

mellow kelp
#

precious

quartz kindle
#

Lol

opal plank
#

well it does hold to its "it was made as a joke"

#

@crimson vapor can you provide an actual working snippet?

mellow kelp
solemn latch
#

if anything its more accurate that it instantly doesnt work.

crimson vapor
#

fuckin

#

sec

quartz kindle
earnest phoenix
#

Bro

mellow kelp
#

npm joke packages are getting out of hand

crimson vapor
#
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');```
opal plank
#

^^

crimson vapor
#

should work

earnest phoenix
#

KEKW 9 million downloads

opal plank
crimson vapor
#

fuck

opal plank
#

i didnt even have to break it

#

lmao

crimson vapor
#

make the file or pass option 'writeFile': true

opal plank
#

cmon million

crimson vapor
#

smh

#

I fixed it

mellow kelp
quartz kindle
opal plank
#

isThousand

#

isHundread

#

isTenThousand

crimson vapor
#

Erwin did it work?

opal plank
#

npm should get rid of those troll packages tbh

#

yes

crimson vapor
#

good

quartz kindle
#

Theres an actual package isThirteen

mellow kelp
opal plank
#

its basically a map, but with a db

earnest phoenix
#

functional programming™️

quartz kindle
#

42

crimson vapor
#

yes

mellow kelp
#

yes

earnest phoenix
crimson vapor
#

Erwin you should try out poggersDB

mellow kelp
#

a function that returns 42

#

^^

crimson vapor
#
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

mellow kelp
#

YES

earnest phoenix
#

He finally did it

#

PoggersDB

mellow kelp
#

my glorious creation

crimson vapor
#

its existed for a while

#

idk how but it works

mellow kelp
#

it's so secure that sometimes the decryptor won't even work

crimson vapor
#

nah it always works

#

hello ender

jovial nexus
#

how can i look fon unavaliable guilds on a shard?

earnest phoenix
#

Just filter guilds and check if their <Guild>.available property is false?

opal plank
#

bruh what

#

what you mean properly coded my dude

crimson vapor
#

huh

opal plank
#

bruh, gimme a sec

jovial nexus
#

@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) })

opal plank
#

i cannot believe this

jovial nexus
#

whats poggersdb

earnest phoenix
#

It should work

crimson vapor
#

well

#

@mellow kelp

#

he did

jovial nexus
#

what a guy

mellow kelp
#

the best database ever

jovial nexus
#

i remember making a bot that banned everyone that was playing fortnite

earnest phoenix
#

es2021 needs to abolish the forEach function

mellow kelp
crimson vapor
opal plank
crimson vapor
opal plank
crimson vapor
#

guess I didn't think of that

opal plank
#

thats not the only issue

crimson vapor
#

oh

#

there are more?

opal plank
mellow kelp
#

LMAOO

opal plank
#

properly coded is an overstatement

crimson vapor
#

nah thats user error

opal plank
#

not when you pass it the promise of a get

crimson vapor
#

hmm

#

maybe not then

#

idk it works for me ¯_(ツ)_/¯

opal plank
#

then you should keep it to yourself, not for public mmulu

crimson vapor
#

well

#

yea

#

I should

opal plank
#

its just polluting npm community

#

and yes, that traffic is achieveable

crimson vapor
#

hmm

opal plank
crimson vapor
#

how come it errors then and not before LOL

opal plank
#

presences im getting 22k per minute

opal plank
#

¯_(ツ)_/¯

crimson vapor
#

fs.renameSync is erroring iirc

pale vessel
#

blocking shit

opal plank
#

this shows you dont have a queue system

#

you just dumping the operations as they come

crimson vapor
#

you're right

#

I didn't think to make a queue system

opal plank
#

well, thats it for that then

#

didnt take more than 5 minutes to break it

crimson vapor
#

thanks for breaking it tho ngl

#

now I know what to fix

#

kinda

quartz kindle
#

good luck trashing your hdd tho lmao

crimson vapor
#

lol

#

I always tested on an SSD

#

before you yell

#

I didn't have an hdd

opal plank
#

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

crimson vapor
#

I would call it an actual package but that leads me to bigger questions like why did I make a shitty db and such

pale vessel
#

I wouldn't call it a troll package

#

It actually has a "purpose"

crimson vapor
#

maybe its somewhere in between

pale vessel
#

Albeit broken kekw

crimson vapor
#

TODO: make queue system

pale vessel
#

TODO: delete repo

crimson vapor
#

hmm

pale vessel
#

yea idk about that one

opal plank
#

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?

crimson vapor
#

it doesn't have anything better than most

#

even at a working state

#

it fucks rss because of the constant reading and writing JSON

pale vessel
#

you just proved his point

crimson vapor
#

I do get to say I learned more because of it

opal plank
#

then why post it?

crimson vapor
#

honestly as a joke

opal plank
#

im not trying to disencourage you from coding, im disencouraging you from posting random libs to an npm workspace

crimson vapor
#

ik and I understand that tbh

opal plank
#

to put it bluntly, its not contributing to the community in any way

crimson vapor
#

I know that, I even would suggest not using it as its really inefficient

opal plank
#

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

crimson vapor
#

fair point tbh

#

I tried to say in my readme not to use it

#

but many people won't read the readme

opal plank
#

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

crimson vapor
#

do people actually use is-undefined?

opal plank
earnest phoenix
#

They even request "funding"

#

Bruh

crimson vapor
#

kinda but not really

#

is it on gh?

#

if so send the link

opal plank
#

or this

crimson vapor
#

is-odd to be kinda pog tho /s

opal plank
#

pog?

#

its trash dude

#

its one line of code

crimson vapor
#

ik thats why /s

earnest phoenix
#

/s

opal plank
#

THIS

#

this single line is what makes this whole thing

earnest phoenix
#

That github username already explains the kekw moment of the package

crimson vapor
#

OH SHIT

#

FUCK noob js devs

#

learn math

earnest phoenix
#

Wtf

crimson vapor
#

maybe 8k

opal plank
#

one would say the same about your troll lib

earnest phoenix
#

834k

crimson vapor
#

maybe that would be joke

opal plank
#

so, careful with it

crimson vapor
#

idk fuck me if people use my lib

lament rock
#

we live in a society

opal plank
#

theres ACTUAL people out there who dont know better and use it

#

so, refrain from posting troll poackages if possible

crimson vapor
#

first 2 are actual results

#

define Discord

#

const Discord = require('discord.js')

#

I think

mint wing
crimson vapor
#

fixed

mint wing
#

:)

#

JS is a good starter language so there's a lot of dumbasses rolling around but we're not all bad 😔

pale vessel
#

you kinda took his statement out of context

mint wing
#

i know

wicked sapphire
#

I started sharding my bot early, is there any issue with that? It's at 60+ servers.

#

1 shard

opal plank
#

why tho

mint wing
#

if it's just 1 shard that's basically the same as not sharding so i wouldn't think so

earnest phoenix
#

you'll just have less of a headache later, you don't necessarily get any cons

mint wing
opal plank
#

the recommendation is to not even bother until 1.5k servers

#

iirc

wicked sapphire
opal plank
#

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

mint wing
#

i learned to shard my bot at 25 lul

wicked sapphire
opal plank
#

well, for starters, using about 3gb of ram

pale vessel
#

use kurasuta, it's pog

opal plank
mint wing
#

you can make your own anything

pale vessel
#

yukine made it

opal plank
#

now im running loops to kill the cache

#

cuz some of them d.js for some godly retarded reason doesnt expose

mint wing
opal plank
#

its growing about 35-40 servers a day

#

i'll need to do sharding VERY soon

mint wing
#

not too bad i suppose
nice interface, i still want/need to make an interface someday but uni notLikeCat

opal plank
#

100 servers every 3 days basically

mint wing
#

christ

opal plank
#

its been quite annoying ngl

solemn latch
#

pog

mint wing
#

where do all those people find your bot lmao

opal plank
#

recommendations

#

and google ads

mint wing
#

google ads notlikegarde

solemn latch
#

google ads pogey

pale vessel
#

epicx

mint wing
#

p2w bot development

opal plank
#

i never sunk a single penny into this bot

#

i'll have you know that

#

thank you

mint wing
#

dam u stole google ads? wtf

solemn latch
#

patreon

opal plank
#

not like i had free credit to use on google ads

mint wing
#

like

opal plank
#

¯_(ツ)_/¯

mint wing
#

that still counts

opal plank
#

nope, the bot is completely free

#

nor do i have donations setup

mint wing
#

wowie

opal plank
#

nor did i spent a single penny

#

even the vps its hosted on

mint wing
#

what is this first world setup

opal plank
#

its called using the tools you have on hand

mint wing
#

[developers hate him] use this one single trick for free vps and google ads

#

what're those tools huh winkwonk

#

spill the beans

opal plank
#

secret

#

¯_(ツ)_/¯

mint wing
#

yeah that sounds legal 🧐

opal plank
#

though i do have some plans to increase interactivity when the bot calms down

#

it IS legal

mint wing
#

thats what id say if it was an illegal secret

craggy pine
#

its just a laptop running 24/7 somewhere LUL thats the vps

opal plank
#

people here saw me literally abuse twitch api, think i'd be hiding it?

earnest phoenix
#

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

pale vessel
#

Pog

mint wing
earnest phoenix
#

that helps 0

mint wing
#

there you go, help yourself

earnest phoenix
#

that doesnt help

mint wing
#

yes it does, its google

solemn latch
#

i mean the first result is this

#

which is probably your solution

mint wing
#

yeah the first result seems quite helpful

earnest phoenix
#

wtf is wrong with that

#

i dont need function

mint wing
lament meteor
#

The othet file?

earnest phoenix
#

try not using an arrow function

solemn latch
#

^

lament meteor
#

Doubt its arrow functions

earnest phoenix
#

me too

#

but 🤷‍♂️

#

node is witchery

mint wing
#

epic witchery

earnest phoenix
#

i fixed issue

#

but wtf is this issue

solemn latch
#

pog

earnest phoenix
#

dirs is not defined

#

im just gonna kms

mint wing
#

did you fix the previous issue or did you create a biger issue that is prioritized over the previous one

earnest phoenix
#

i forgot to save all

#

i was clicking save

#

not save all

lament meteor
#

Kek

earnest phoenix
#

anyway

#

why is dirs not defined

solemn latch
#

did you define dirs

earnest phoenix
#

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

earnest phoenix
#

so if i ask som stupid

#

thats why

pale vessel
#

don't think age matters

solemn latch
#

we have middle school devs here quite frequently, we see silly questions all the time, dw.

earnest phoenix
solemn latch
#

yeah, const dirs, or any other definition methods.

opal plank
#

another troll poackage?

pale vessel
#

no

earnest phoenix
#

bc i dont think i did

solemn latch
#

i dont know, its your code.

earnest phoenix
#

im just making a command and event handler

#

in node.js

solemn latch
#

so, somewhere in your code you have a variable being used called dirs right?

stark abyss
lament meteor
#

Show some code smh

lament meteor
#

Reset ur token

stark abyss
#

I uninstalled it and deleted the whole puppeteer file but same issue

earnest phoenix
#

ahh shit

lament meteor
#

Before someone uses it

opal plank
earnest phoenix
#

Hmm

lament meteor
#

Where does the dir error come from

earnest phoenix
#

K take your time if you will

lament meteor
#

Probs one of the other files

earnest phoenix
stark abyss
#

ping me if you know something about that

earnest phoenix
lament meteor
#

@earnest phoenix why u make a meme package

#

Its in event handler

#

What's in there

earnest phoenix
lament meteor
#

It kinda is tbh

earnest phoenix
#

H o w

lament meteor
#

U added that random faketoken poop

earnest phoenix
#

Well yea, idk some users of the package requested that

#

So i just said fuck it let's add

lament meteor
#

But i dont think u need that

earnest phoenix
#

wdym

lament meteor
#

While commands have categories

#

U dont need categories for events

#

Unless u rlly want to

earnest phoenix
#

it just makes it neater

#

idk

lament meteor
#

How thou

#

Well first i guess u gotta use fs to read the events folder

#

Then u can get dir

earnest phoenix
#

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

lament meteor
#

You probs are requesting the wrong file somehow

earnest phoenix
#

fml

stark abyss
#

or u mess up the path

#

you know when you declare a file

#

const { prefix, color} = require('./config.json');

lament meteor
#

What module is it not finding

earnest phoenix
#

doesnt say

stark abyss
#

do you know what file that is in

earnest phoenix
#

yea

stark abyss
#

scroll up

earnest phoenix
#

C:\Users\Benso\OneDrive\Desktop\JustMe\handlers\event_handler.js',
'C:\Users\Benso\OneDrive\Desktop\JustMe\Main.js'

stark abyss
earnest phoenix
#

the main js and event handler

lament meteor
#

Hmm

#

Oh i think it cant find the event file

#

In the dir

stark abyss
#

const { prefix, color} = require('./config.json'); --> correct
const { prefix, color} = require('./../../../../../.../config.json'); --> this path is probably incorrect

#

am I being helpful?

earnest phoenix
#

idk

lament meteor
#

Don't think that is rly related rn

#

@earnest phoenix how does the events folder look like

stark abyss
#

I just got the feeling that he is trying to declare a file and have wrong path my bad

earnest phoenix
lament meteor
#

Hmm

#

Oh

stark abyss
#

wait a min where is main.js

lament meteor
#

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

earnest phoenix
#

its supposed to be dirs

#

not dir

dusky sundial
#

Are the file separators correct?

earnest phoenix
#

huh

dusky sundial
#

Like / instead of \ in the path. What OS are you on?

earnest phoenix
#

windows 10

#

home

dusky sundial
#

Hm, should be / then

earnest phoenix
#

yea thats how it is

dusky sundial
#

Try swapping to backslash and see if it makes a difference

lament meteor
#

Wont

#

Will give more errors

#

I forgot how .. stuff works

pale vessel
#

if you want to use backslash you have to escape it \\

dusky sundial
#

It should be fine though

earnest phoenix
#

fml

#

:/

pale vessel
#

Same

earnest phoenix
#

so pretty much

#

no one knows how to fix it

dusky sundial
#

I'd love to try to help more but I'm awful at js

#

almost never done anything with it

craggy pine
# earnest phoenix no one knows how to fix 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

earnest phoenix
#

wdym

#

add another . ?

pale vessel
#

./ references the current directory while ../ would mean the parent directory (or one directory above)

earnest phoenix
#

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}'

pale vessel
#

e

#

idk your structure

earnest phoenix
#

?????

#

😦

#

You're using '

#

`

#

is what im using

solemn latch
#

good eyes voltrex

earnest phoenix
#

huh

pale vessel
#

you only used it on your event_files

earnest phoenix
#

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

earnest phoenix
#

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

dusky sundial
#

You don't need a VPS to host the bot. But it's definitely recommended

earnest phoenix
#

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

dusky sundial
#

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

earnest phoenix
#

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

dusky sundial
#

You can check the pinned messages in this channel for some more info about VPS's

#

There's also a list with hosts there

earnest phoenix
# earnest phoenix wheres the cheapest and easiest place for that

ℹ 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.

dusky sundial
#

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

earnest phoenix
#

Okay that's too many embeds lmao

misty sigil
#

lye node

earnest phoenix
#

so how would i go about setting up a donationd cmd

dusky sundial
#

I'd just make a command that shows a link to your paypal.me or whatever

#

patreon

#

wherever you wanna get paid

earnest phoenix
#

good point

#

does patreon send to paypal as buisiness payment?

dusky sundial
#

No clue, never used patreon

earnest phoenix
#

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

earnest phoenix
#

So check it out if you want

#

I don't think it accepts bitcoin

dusky sundial
#

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 ^^

earnest phoenix
#

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

earnest phoenix
#

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

dusky sundial
#

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

earnest phoenix
#

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

earnest phoenix
#

But 24 hours is fine

#

my mute cmd is a mess and i just want it to remove all roles

earnest phoenix
#

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

dusky sundial
#

The bot would need to have a higher role than the role it wants to remove

earnest phoenix
#

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');
dusky sundial
#

Don't hesitate to ask here if you run into any issues you can't google your way out of. But remember, no spoonfeeding

earnest phoenix
#

thats how shitty mine is

#

let mainRole = message.guild.roles.cache.find(role => role.name === 'Member');
let muteRole = message.guild.roles.cache.find(role => role.name === 'Muted');

#

thats the issue

#

is there anyway i can tweak that code with urs

<GuildMember>.roles.set([])

#

So it would remove all the roles?

#

yea

dusky sundial
#

memberTarget.roles.set([]);

earnest phoenix
#

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

#

memberTargettarget

solemn latch
#

also i think you want .mentions.members

#

not users

earnest phoenix
#

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

lament ravine
#

v13 wont have this method anymore

earnest phoenix
#

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

boreal iron
earnest phoenix
#

Yes, but this time you gotta actually create the role

#

if (!mutedRole){

#

shit

#

one sec

earnest phoenix
#

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

boreal iron
earnest phoenix
#

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

dusky sundial
#

I think this is why they want you to learn JS before making a bot in JS lol

earnest phoenix
#

they do everything so slow

gilded olive
dusky sundial
#

You can learn JS outside of school though

earnest phoenix
#

hows that

#

i aint paying

dusky sundial
#

Tutorials, docs, youtube videos

#

you name it

gilded olive
#

Plenty free tutorials online for free

earnest phoenix
#

There's literally millions of free guides on how to learn it

#

fuck my life

dusky sundial
#

Don't run before you know how to walk fella

earnest phoenix
#

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?

zenith terrace
earnest phoenix
#

You should learn it before attempting to make that tho

#

HOW

gilded olive
#

He just sent you like 5 links

#

Maybe take some time and read?

earnest phoenix
#

bro i have all my code alr

#

i just needed help with 1 cmd

#

i alr have a fully working bot

dusky sundial
#

What's the point of making a cmd if you don't understand the code they're showing you?

earnest phoenix
#

i do, i just dont know where to place it

#

bc of the way the code works,

gilded olive
#

Another bot developer that dosent know what they are doing

earnest phoenix
#

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

pure lion
#

how can i make my site not look like shit with basic html?

earnest phoenix
#

not use html

dusky sundial
#

Learn CSS :)

earnest phoenix
#

Use style tags KEKW

#

if (!mutedRole){
guild.roles.create()
.then(console.log)
.catch(console.error);
}

mutedRole = await <Message>.guild.roles.create({
data: {
name: 'Muted'
}
});

zenith terrace
#

Cannot read property of 'help' of undefined

earnest phoenix
#

the creation is not outside

#

that says if missing mutedRole than to create it

earnest phoenix
#

then assign the value

#

Aight imma watch this channel's stupidness i guess KEKW

#

🍿

zenith terrace
dusky sundial
#

You're trying to create an empty role, you're not putting anything in the parentheses

gilded olive
#

Simply isnt anyway else

earnest phoenix
#

ur not changing the perms

zenith terrace
#

then go look at how to change perms

dusky sundial
#

No, you're literally not creating anything with guild.roles.create()

earnest phoenix
#

I didn't include permission changes because you can't deny them on creation, you can only overwrite permissions on channels

earnest phoenix
#

your making a blank role with name Muted

#

wdym

dusky sundial
#

Yeah, at least you've created a role now

earnest phoenix
#

yea

#

Copy paste moment

earnest phoenix
#

But that was just an example

zenith terrace
earnest phoenix
#

Read the documentation

#

wait

dusky sundial
#

This channel isn't meant to help you create entire commands

earnest phoenix
#

target.roles.set(mutedRole)

#

thats fine right?

#

No

zenith terrace
earnest phoenix
#

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])

dusky sundial
earnest phoenix
#

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');
    }
}
}

}

dusky sundial
#

You're gonna need a weeks worth of sleep to recover

earnest phoenix
#

done

#

right..?

earnest phoenix
#

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

#

bruh 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

dusky sundial
#

You're also checking if the role exists after you've already tried to assign the role

earnest phoenix
#

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

dusky sundial
#

And some JavaScript to learn

earnest phoenix
#

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

silver vector
#

@earnest phoenix What do you want

earnest phoenix
#

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

dusky sundial
earnest phoenix
#

Sigh

#

Under

let mutedRole = message.guild.roles.cache.find(role => role.name === 'Muted');```
zenith terrace
#

lemme introduce you to the DBL discord server, where you wont get spoonfed and told to look at js tutorials and docs

earnest phoenix
#

if (!mutedRole) mutedRole = await Message.guild.roles.create({
data: {
name: 'Muted'
}
});

under that?

pale vessel
#

Message?

earnest phoenix
#

🗿 101% brain cells lost so far

#

DUDE

#

ya know what

#

im done with life

#

Dude no wtf

zenith terrace
#

orr look at the docs

earnest phoenix
#

SEE

dusky sundial
#

The guy literally just told you where to put the thing you were asking about

earnest phoenix
#

I FUCKING DID IT

dusky sundial
#

There you go

earnest phoenix
#

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

zenith terrace
#

no one even talked about removing the member role KEKW

earnest phoenix
#

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 KEKW

dusky sundial
#

I'd sure love to keep helping someone who tells me my help sucks pepothumb

earnest phoenix
#

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

trim spear
#

Hey bro, i want to ask.
How to disable @everyone & @here in say command?

#

The mention

earnest phoenix
#

Use allowedMentions option in MessageOptions

#

Or just disabledMentions

trim spear
#

Where i put that?

earnest phoenix
#

so now what, how do i make it remove all roles

#
<TextChannel>.send('Some string here', {
   disabledMentions: 'everyone'
});```
trim spear
#

Lets i try it!

quartz kindle
#

disableMentions will be removed in v13

#

but should work for now

solemn latch
#

oh?

earnest phoenix
#

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

quartz kindle
#

in v13 it will be like this ```js
channel.send("something", {
allowedMentions: {
parse:["roles","users","everyone"]
}
})

earnest phoenix
#

That would only parse it tho

#

im leaving

#

So it doesn't disable the mention

#

gl anyway

mortal quiver
#

ok

quartz kindle
#

if not parsed it should be disabled

solemn latch
#

so disabled by default?

quartz kindle
#

i think so

solemn latch
#

i suggested that like last week

zenith terrace
#

@earnest phoenix you get your braincells back now??

solemn latch
#

2-3 hour recovery time

earnest phoenix
zenith terrace
#

dam

mortal quiver
#

wtf happened

zenith terrace
#

just a whitename being a whitename

earnest phoenix
#

What happened is, me trying to convince a whitename to learn JS

#

But as usual

mortal quiver
#

damn

sudden geyser
#

white names are superior

earnest phoenix
#

🗿

#

Hm guys

#

Hey!

#

Hey there

zenith terrace
lucid prawn
#

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

earnest phoenix
#

So if I want like a embed, and a embed without what do I dom.

#

?

earnest phoenix
sudden geyser
lucid prawn
zenith terrace
#

trust me 99% of whitenames on this server dont know what their doing