#development

1 messages · Page 1523 of 1

lethal trout
earnest phoenix
#

built for dual screen

umbral zealot
lusty quest
#

that they finnaly integrated the Linux Kernel into Windows is already nice

glad violet
#

i have tested all windows

earnest phoenix
#

WSL2 is a major improvement from WSL1

umbral zealot
#

So have I bud, I've worked with all of them too.

lusty quest
#

yea

lethal trout
oak cliff
#

@open falcon stop spamming dotposts, thanks.

near stratus
lusty quest
#

finnaly you can run Redis in a easy way without having to use a Docker Container

umbral zealot
#

no it's a different system

glad violet
umbral zealot
#

"came out after" doe snot mean "copied"

lethal trout
earnest phoenix
#

if i make socks, and another person decides on making socks, does that mean they're copying me

lusty quest
lethal trout
lusty quest
#

is prefix your model?

near stratus
glad violet
lethal trout
#

yes ik what to do

glad violet
#

also what version of node do u have

#

type node -v to see in cmd / terminal

lethal trout
quartz kindle
#

windows was a commercial operating system, it cost money to have
linux was one of the initial open source movements

lusty quest
#

if you hover in VSC over prefix does it show your Model?

glad violet
glad violet
#

it has media creation tool

lethal trout
#

v14.15.0

glad violet
#

to create an iso

earnest phoenix
#

what are you talking about lol

glad violet
quartz kindle
#

that doesnt mean its open source lmao

earnest phoenix
#

windows never was and never will be open src

umbral zealot
lusty quest
#

Windows is now more or less free to use

#

just without some of the nice features

summer torrent
#

i heard windows xp's source code leaked

delicate shore
#

I wanna make it easy for me to share images
What's the best service I can use to turn my sub-domain into an image cloud thingy

lusty quest
#

Sharex with a server

umbral zealot
#

I made my own 😂

delicate shore
#

it will embed it

delicate shore
lusty quest
#

get ShareX (its free on steam) and google a ShareX server you can run

delicate shore
lusty quest
#

then run the Server on your server and configure ShareX to use it

delicate shore
umbral zealot
#

in javascript with a simple web server. not that hard actually

#

receive POST requests, return a JSON with a URL

#

¯_(ツ)_/¯

glad violet
#

redhat linux isnt an open source

#

it requires money i think

#

red hat icon

#

RedHat

solemn latch
#

Many distros are not open source

lusty quest
#

well its one distro based on the Linux Kernel

quartz kindle
#

requiring money doesnt mean its not open source

#

you can have both

#

there are many commercial open source projects

delicate shore
#

@lusty quest (sharex)but that's not available with linux

quartz kindle
#

you pay for support and web features

lusty quest
delicate shore
#

sharex

lusty quest
#

use mono

earnest phoenix
#

there are some alrernatives iirc

delicate shore
#

mono?

glad violet
#

i love liniux terminal

earnest phoenix
#

isn't mono a framework

glad violet
#

it has great commands

lusty quest
#

its a wrapper for Windows executables

earnest phoenix
#

if anything you'd be looking into wine

lusty quest
glad violet
#

u can create folders with name "con"

delicate shore
glad violet
#

u cant make a a folder with name con

lusty quest
#

or compile Sharex yourself to Linux

summer torrent
delicate shore
#

Mono is also a .net framework

glad violet
pale vessel
#

Set your A record for a subdomain to the IP and you can upload files to it

glad violet
#

its better and fast

earnest phoenix
glad violet
#

or use snipping tool

quartz kindle
lusty quest
lethal trout
#

so whats my fix?

glad violet
umbral zealot
#

like more code basically

lusty quest
#

hmm i think i could try and compile ShareX to a Linux Binary

#

but idk how it will run

glad violet
#

but prefix.FindOne Isnt a function

#

findOne isnt a function

lusty quest
#

https://github.com/ShareX/ShareX like the entire code is open source

GitHub

ShareX is a free and open source program that lets you capture or record any area of your screen and share it with a single press of a key. It also allows uploading images, text or other types of f...

summer torrent
umbral zealot
#

yes, whos us how prefix is defined

#

Before this error

earnest phoenix
#

you can't run sharex on linux

#

because of the sheer fact that it's winforms

lethal trout
lusty quest
#

rip

umbral zealot
#

the one where you have an error

summer torrent
#

im talking about prefix.findOne

umbral zealot
#

this is the error. we need to see how THIS variable called prefix is defined

#

now after. we need before

#

higher

lethal trout
#

here

lusty quest
#

you have prefix defined twice lol

summer torrent
#

finally

umbral zealot
#

yeah I see that as a potential issue tbh, re-using the variable prefix more than once

lusty quest
#

in Rust its valid syntax but in JS it can cause issues

umbral zealot
#

But in this case it shouldn't even matter

#

Now that this is done, show us ./models/prefix , that file

#

see what it exports.

lethal trout
lusty quest
#

how did you register the model to Mongodb or Mongoose=

delicate shore
#

@pale vessel it won't work

umbral zealot
#

you're not exporting anything MarioFP

lusty quest
#

you should import prefixes not prefix

umbral zealot
#

I'm pretty sure const MessageModel = module.exports = isn't valid

#

I might be wrong but..

#

that's a really odd way of doing this

summer torrent
#

const MessageModel = module.exports
wtf

lethal trout
#

so now what?

umbral zealot
#

remove the first part and do just module.exports = mongoose.model('prefixes', PrefixSchema);

lusty quest
#

import in your message handler prefixes not prefix

umbral zealot
#

that doesn't matter it's just a variable name

lusty quest
#

otherwise you just create a new empty variable

umbral zealot
#

the default exports can be named whatever you want when you import it

lusty quest
#

yea but he has to tell Mongoose to use the model

pale vessel
lethal trout
#

done

pale vessel
#

@delicate shore and you need to add the actual subdomain on the right

#

The IP is 163.172.209.65

delicate shore
#

I am in their server

lethal trout
modest smelt
#

Bruh someone ghost pinged me

glad violet
lethal trout
glad violet
#

ok

#

u will help me in dm

#

i wanna make my music bot using custom prefixes

delicate shore
#

Is there any service where I can use my domain as image hoster
like img.pgamerx.com
But I don't need to make a /post request and just need to drag and drop or upload at
img.pgamerx.com/upload

earnest phoenix
#

wow. my discord API locked magically cleared after like 8 hours of waiting.

lusty quest
#

this is how it usually work

gritty bolt
#

I'm trying to run items in my module.exports in another file called core.js but only the messageReminderAdd function is working. Any ideas as to how to fix it?

const core = require('./core.js');
//Start core functions
core.messageReminderAdd(bot);
setInterval(core.dbCheck(bot), 60000)
} catch(err) {
    catchError()
}```
lusty quest
#

you can export a function

gritty bolt
#
module.exports.remindUser(data)``` is being listed as not a function also
```js
module.exports = {
//The actual function to execute the reminder
reminderFunction: async function reminderFunction(bot, data) {```
delicate shore
lusty quest
#

the api guy

delicate shore
#

k

gritty bolt
lusty quest
gritty bolt
#

isnt that the same thing as what im doing though?

lusty quest
#

yea pretty much

#

but idk what your issue is then?

gritty bolt
#

says its not a function

lusty quest
#

you cant call the function in a different file?

gritty bolt
#

in the actual thing

#

i cant in the same file

lusty quest
#

you try to use an export in the same file?

late spade
#

Hi

gritty bolt
#

yes

lusty quest
#

why?

gritty bolt
#

i want to also call that function in the same file

late spade
#

Does anyone know how to code with bdscript?

gritty bolt
#

because core.js stores multiple functions that build off of each other

lusty quest
#

ok

#

then do the export differently i guess

late spade
#

Does anyone know how to code with bdscript?

lusty quest
#
async function reminderFunction(bot, data) {
//your stuff
}

await reminderFunction()


module.exports = reminderFunction
late spade
#

E

#

Xd

#

Pls snipe

#

Ooh you is lucky

blissful bridge
earnest phoenix
gritty bolt
#
TypeError: core.messageReminderAdd is not a function
    at Object.<anonymous> (C:\Users\Sam\Desktop\RemindMe\index.js:86:6)```
#

@lusty quest

lusty quest
#

where did you attach it to core?

gritty bolt
#

wdym?

#

@lusty quest

lusty quest
#

you attach the function somewhere to the value core

#

or why is core a thing?

gritty bolt
lusty quest
#

where did you attach the function to core?

gritty bolt
#

wdym

lusty quest
#

core.function is only valid if you attach the function somewhere to core

gritty bolt
#

how do I do that

#

im requiring the file

#

thats what core is

lusty quest
#

so its no wonder that is doesnt work

gritty bolt
#

one of the functions works on it

lusty quest
#

so you export functions with core that you import into function?

#

if you do it there is a more elegant way i guess

gritty bolt
#

yes i want to use functions I keep in core.js in index.js

gritty bolt
lusty quest
#

what is the code of core.js?

gritty bolt
#

all my functions

#
async function dbCheck(bot) {...
module.exports = dbCheck```
lusty quest
#

did you know how to have mutiple exports in a single file?

gritty bolt
#

no

lusty quest
#

would suggest to read about this

gritty bolt
#

got anywhere good to look?

lusty quest
#

w3 schools

#

as example

#

Mozzila Docs

earnest phoenix
#

@gritty bolt module.exports can be anything and its value will be assigned to a variable when you require it
So you can make it an object and export multiple stuff at once

#

Heck if you dont wanna use commonjs you could even use ES6 imports and exports

knotty flint
#

anyone here use heroku for bot hosting (and is familiar about how it works)? ping me if u do i just need to ask a question

gritty bolt
#

what would you say is the easiest way to use these functions in my index file then?

lusty quest
#

make a index.js file inside your functions folder and reference them inthere

gritty gale
earnest phoenix
#

Only the noobs

knotty flint
gritty bolt
#

so is google cloud

lusty quest
#
module.exports={
Function1:require("./function1.js"),
Function2:require("./function2.js")
}
gritty bolt
#

or AWS Free Tier

knotty flint
#

true

earnest phoenix
#

There are so many free hosts

lusty quest
#

then you can just deconstruct the functions from the one import

earnest phoenix
lusty quest
#

like ```js
const {Function1,Function2} = require("./functions/index")

gritty bolt
#

can I call other functions inside those?

lusty quest
#

?

gritty bolt
#

like can I use functions form other files in those files?

#

or can I require a functions folder and use each file as 1 function?

lusty quest
#

you have a folder with all your functions right? inside the folder you make a index file where you reference all functions

#

then you just import this one index file to use all the functions that are referenced in the index

#

or attach your functions to core

earnest phoenix
#

@gritty bolt

// favourites.js
module.exports = {
  fruit: "Mango",
  programmingLanguage: null
  // you can add ANYTHING else here
}

// index.js
const favourites = require("path/to/favourites.js");
// you can now acceds the properties exported by the file
lusty quest
#

core.function1= require("function1")

gritty bolt
#

ahh okay

#

so if I wanted to give each function its own file, i'd just have one thing in there and import them all as consts?

#

and the same for the other files

earnest phoenix
#

i set favourite programming language to null for a reason

gritty bolt
#

yeah

lusty quest
#

make a folder for all your functions. have all the single function files inside this folder. then make like i said the index file inside the functions folder

gritty bolt
#

alright thanks

#

i get it all now

near stratus
earnest phoenix
#

how can I make a dbd.js command
he/she when used command
then use bot commands
its possible on dbd.js?

earnest phoenix
#

i used var to give everyone reading that a nosebleed

lusty quest
#

why?

#

you propably only get like 6 functions

earnest phoenix
#

wdym

lusty quest
#

unless you need one for all types of shit

near stratus
earnest phoenix
#

lemme edit

#

how can I make a dbd.js command
he/she when use vote
then use bot commands
its possible on dbd.js?

#

he/she need use vote

#

What the fuck is dbd.js

#

for use commands

#

Discord bot developer???

earnest phoenix
near stratus
earnest phoenix
#

Huh?

#

I know djs but wats dbd.js

#

do we have a bdfd kid among us

near stratus
#

@earnest phoenix don't worry noone has ever heard of it either

#

it's not BDFD I found it on npm library

zenith terrace
#

npm i dbd.js

earnest phoenix
#

But only 44 results about it in this server

near stratus
#

it actually exists
first I thought that he misspelled DBL for DBD

twilit geode
analog imp
#

#development message
still looking for a point in the right direction lol. i came up with a solution that will work, but that's going to cause a lot of requests

crimson vapor
#

what is dbd.js?

solemn latch
#

no idea

crimson vapor
#

oh lol

solemn latch
#

people mention it quite a lot recently

#

lmao? ```js
bot.variables({
Name: "Value",
Name2: "Value2"
})

crimson vapor
#

but it is js

#

but without fucking indents

solemn latch
#

looks like the goal is to remove most the features of js or even programming languages to simplify it.

crimson vapor
#

hmm

cinder patio
#

but why just make a bot maker then

crimson vapor
#

thats the point I think

#

I think its supposed to be a bot maker

#

but more with code and less drag and drop

#

this is pain to read the docs

solemn latch
#

yeah, it could be good to be honest. I could see this taking over djs over time due to its simplicity while still having customizability.

#

just maybe not yet.

crimson vapor
#

this does not seem simple for me

#

the thing about code is how much you can change

#

this is like

#

everything is well scripted

solemn latch
#

well, it appears to still be in early stages.

cinder patio
#

people are gonna use this and call themselves programmers

crimson vapor
#

they suggest replit and glitch for hosting tho

#

yikes

solemn latch
#

lol

#

I wonder what the help stuff looks like

crimson vapor
#

I could not get behind using this

cinder patio
#

Waaait

#

it's from the makers of bot designer for discord I think

solemn latch
#

it doesnt seem to have a help command built in.

#

i would really think it would.

odd stratus
#

Although it may seem cool, it can be considered bad practice especially looking at how easy that really is using that package

#

No idea what features it actually has though besides the command feature

gritty bolt
#
Require stack:
- C:\Users\Sam\Desktop\RemindMe\Functions\dbCheck.js
- C:\Users\Sam\Desktop\RemindMe\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Module.Hook._require.Module.require (C:\Users\Sam\Desktop\RemindMe\node_modules\require-in-the-middle\index.js:61:29)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.dbCheck (C:\Users\Sam\Desktop\RemindMe\Functions\dbCheck.js:3:30)
    at Object.<anonymous> (C:\Users\Sam\Desktop\RemindMe\index.js:84:21)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\Sam\\Desktop\\RemindMe\\Functions\\dbCheck.js',
    'C:\\Users\\Sam\\Desktop\\RemindMe\\index.js'
  ]
}```
I keep getting this even though the directories exist and are correct
umbral zealot
#

can you show your index.js line 84?

gritty bolt
#
//Start core functions
setInterval(dbCheck.dbCheck(bot), 60000)
} catch(err) {
    catchError()
}
messageReminderAdd.messageReminderAdd(bot);```
crimson vapor
#

show line 3 of dbCheck.js

umbral zealot
#

hmm

#

yeah I dunno which module it's saying is missing honestly

gritty bolt
#
    const reminderFunction = require("./Functions/reminderFunction");```
umbral zealot
#

Oh!

#

require() is relative to the current file

#

you're already in the Functions folder

#

so you're trying to get /RemindMe/Functions/Functions/reminderFuncion

gritty bolt
#

ohh

quick ridge
#

I wonder what I need to do to clear the cache in the discord bot, because the cache accumulates ram usage goes up to 3.5 gb.

#

what can i do

gritty bolt
#

@umbral zealot what would I do insteads

drifting wedge
#

how do i use the requests module async?

#

py*

umbral zealot
#

what you should do instead is not do ./Functions/ because that's going to the functions folder

#

smh

quartz kindle
slender thistle
#

why the requests module

#

Why not aiohttp

#

Is there some sorcery behind that decision in the first place?

drifting wedge
#

no aiohttp works

gritty bolt
drifting wedge
#

i dont understand it lol so thats why

#

ill look into it

umbral zealot
#

can you not literally just remove Functions/

slender thistle
#

What are you trying to do?

gritty bolt
#

yes thats what I did

umbral zealot
#

./reminderFunction is fine

drifting wedge
#

so its a internal api for my dashboard to talk to my bot

#

basically asking if 2 users have a mutual server

quick ridge
drifting wedge
#

so making dashboard send a thing to db, and bot sends a thing to dashboard thru a url

earnest phoenix
#

you can use executor, but pain. Better use aiohttp

slender thistle
#

I'm gonna cry in advance, give me a sec

drifting wedge
slender thistle
#

Yeah what norizon said

drifting wedge
#

ill use aiohttp

quartz kindle
drifting wedge
#

i just havent looked into it

slender thistle
#

Any specific part you need an explanation for?

zenith terrace
#

as we now see tim return to his natural habitat and away from #general

quick ridge
drifting wedge
quick ridge
#

3.5gb ram is
a serious number

drifting wedge
#

i just didnt know how it worked, but now that i know itll work for this purpose ill look into it

#

ty

slender thistle
#

You just haven't bothered with aiohttp?

#

Ah

#

Yeah good luck

drifting wedge
#

i use it for my reddit thing but one of my devs did that

#

i never understood it lmfao

earnest phoenix
#

it's not that different with requests though

drifting wedge
#

AND i need to understand how aiohttp works too for my ksoft access

quartz kindle
earnest phoenix
#

basically just additional async/await syntax

quick ridge
drifting wedge
#

dude i hate syntax lmfao\

#

i also dont know syntax lol

earnest phoenix
#

wha-

quartz kindle
drifting wedge
#

like i dont know py syntax well

#

most of my code is copy pasted from other pieces of my code lol

quick ridge
earnest phoenix
#

oh well, you can easily get used to it by rewriting it instead of copying.

gritty bolt
#
reminderFunction.reminderFunction(data)```
```js
//reminder function
        let id = data.user```
keeps saying that data is undefined
#

any soulutions?

pale vessel
#

define data

gritty bolt
#

it is

#

two seperate files though

quartz kindle
#

show more code

gritty bolt
#
try {
        (await messageReminderModel.find({})).forEach(data => {
                console.log(data);
                let currentUnix = Date.now()
                if(data.time <= currentUnix) reminderFunction.reminderFunction(data)
        console.log("The dbCheck function is up and running!");
        });
    } catch (err) {
        console.log(err);
    }
}```
quartz kindle
#

what does console.log(data) show?

#

how did you define reminderFunction?

gritty bolt
#
    const reminderFunction = require("./reminderFunction");```
#

and 1 sec

#
{
  _id: 600079f56292dd25acd22dd1,
  user: '140535726797225985',
  messageLink: '[#575425241166249993 message](/guild/498548588318556210/channel/575425241166249993/)',
  time: '1610644256730',
  __v: 0
}```
quartz kindle
#

show the reminderfunction file

gritty bolt
#
async function reminderFunction(bot, data) {
    const discord = require('discord.js');
    const mongoose = require('mongoose');
    let variables = require("./variables.js");
const messageReminderModel = variables.messageReminderModel
    try {
        let id = data.user
        let user = await bot.users.fetch(id)
        let reminderEmbed = new discord.MessageEmbed()
        .setTitle(data.messageLink)
        .setDescription("long")
        .setColor("#FF0000");
        await user.send(reminderEmbed)
    } catch (err) {
    console.log(err);
    }
}```
pale vessel
#

bot, data

quartz kindle
#

bot, data

pale vessel
#

pass in your bot

gritty bolt
#

oh

#

whoops

#

ok im still having another issue, my dbCheck isn't running unless a command is run

#

i need it to run and keep intervaling at start

#
//Start core functions
setInterval(dbCheck.dbCheck(bot), 60000)
} catch(err) {
    catchError()
}
reminderAdd.messageReminderAdd(bot);```
#

this is where they are started

cinder patio
#

what does dbCheck return?

#

because you need to pass a function to setInterval

gritty bolt
#
const dbCheck = require("./Functions/dbCheck.js");```
tardy hornet
#
 if(`${message.mentions.users.first().id}` === "798498750502928407" || "723081690792067143") return message.reply("you cant rob me or my creator")

it dose it for eveyone someone mention
whyy
i dont see what is wrong

gritty bolt
#

its a function in the exports of that

quartz kindle
#

you cant compare like that

tardy hornet
#

then how?

cinder patio
#

but you are calling dbCheck

gritty bolt
#

yes

#

the function name is also dbCheck

#

same as the file name

cinder patio
#

setInterval accepts a function as the first parameter, right now you are passing whatever gets returned by dbCheck

quartz kindle
# tardy hornet then how?
a === b || c
means
a === b || true
if a is not equal to b, it falls back to true, so it always works
you have to do
a === b || a === c
pale vessel
#

oh never mind

#

huh

gritty bolt
quartz kindle
#

you are calling it yourself

cinder patio
#

you are calling the function once yourself

#

setInterval only receives the returned value by that function

quartz kindle
#
something(somethingElse()) // execute and give result of somethingElse to something
something(somethingElse) // give somethingElse function to something without executing it
gritty bolt
#

would making a var at the beginning of the file with the path to the function and passing that fix it?

quartz kindle
#

wat

#

just do

#
setInterval(() => yourfunction(), 2000)
cinder patio
#

no, you need to understand how setInterval works - the first parameter of setInterval must be a function, not any other value.

quartz kindle
#

() => is an anonymous function that calls your function

cinder patio
#

that function will get executed every N milliseconds

earnest phoenix
#

Whatcha guys doin

quartz kindle
#

taking a dump

gritty bolt
#

so js setInterval(() => dbCheck.dbCheck(), 60000)

earnest phoenix
#

I'm listening to React30 while doing my homework

quartz kindle
#

yes

earnest phoenix
#

Nice podcast ngl

quartz kindle
#

im procrastinating by being here, as usual

earnest phoenix
#

And react is an BigInt(excitement level) awesome library

cinder patio
#

I have a math test tomorrow and I'm here

gritty bolt
#

still having the same issue

quartz kindle
#

svelte > react

gritty bolt
#

its only running when someone runs a command

cinder patio
quartz kindle
#

unwrong

cinder patio
gritty bolt
#
//Start core functions
setInterval(dbCheck.dbCheck(bot), 60000)
} catch(err) {
    catchError()
}
setInterval(() => dbCheck.dbCheck(), 60000)
reminderAdd.messageReminderAdd(bot);``` right here
#

the reminderAdd works

#

oh

#

waoit

quartz kindle
#

wat

gritty bolt
#

waot

quartz kindle
#

why double intervals

gritty bolt
#

i do not know

quartz kindle
#

@_@

gritty bolt
#

i had two and removed one

#

guess I accidentally undid it

cinder patio
#

but where exactly? In the message event? In a command? in my bed?

quartz kindle
#

under your bed

gritty bolt
#

on top of your bed

#

rs

#

oops

quartz kindle
#

rsrsrsr

gritty bolt
#

that shoulda went to nodemon

quartz kindle
#

i smell br

gritty bolt
#

okay time to wait and see if it works

#

please work

quartz kindle
#

inb4 it doesnt

gritty bolt
#

annnnd bot is undefined

#
async function reminderFunction(bot, data) {
reminderFunction.reminderFunction(bot, data)```
#

sometimes i really just dont

#

like why

earnest phoenix
gritty bolt
#

it worked

earnest phoenix
#

Why is this not working?

gritty bolt
#

i got 25 dms

earnest phoenix
#

No it’s not showing erros btw

#

Errors

dusky sundial
#

Any MariaDB experts here?

earnest phoenix
#

I don’t think so

#

Maybe some but nit many

dusky sundial
#

mariadb.InterfaceError: MySQL server has gone away
This keeps happening after the bot has been running for a while

earnest phoenix
#

Huh..

eternal osprey
#

hey guys

earnest phoenix
#

Hey

#

Can someone help? I’ve tried console.log every place doesn’t output an error and the code looks about right

#

Should I try removing asyn?

quartz kindle
#

i doubt it doesnt output any error

#

it should show Discord is not defined

dusky sundial
#

Wouldn't it be better to paste the code rather than a blurry screenshot?

earnest phoenix
#

It isn’t blurry but Alr

#

Ima paste it

#



module.exports = {
    name: "ban",
    description: "bans a member from the server",

    async run (client, message, args) {

        if(!message.member.hasPermission("BAN_MEMBERS")) return message.channel.send('You can\'t use that!')

        const member = message.mentions.members.first() || message.guild.members.cache.get(args[0]);

        if(!args[0]) return message.channel.send('Please specify a user');

        if(!member) return message.channel.send('Can\'t seem to find this user);
        if(!member.bannable) return message.channel.send('This user can\'t be banned');
        if(member.id === message.author.id) return message.channel.send(' you can\'t ban yourself!');

        let reason = args.slice(1).join(" ");

        if(!reason) reason = 'Unspecified';

        member.ban(`${reason}`).catch(err => { 
          message.channel.send('Something went wrong')
            console.log(err)
        })

        const banembed = new Discord.MessageEmbed()
        .setTitle('Member Banned')
        .addField('User Banned', member)
        .addField('banned by', message.author)
        .addField('Reason', reason)
        .setFooter('Time kicked', client.user.displayAvatarURL())
        .setTimestamp()

        message.reply()


    }
}```
solemn latch
#

code that long should be uploaded to hastebin.

old latch
#

also yes

#

"Discord" should be undefined

#

just do const Discord = require('discord.js');

#

and leave the rest as it is

earnest phoenix
#

Alr let’s try

old latch
#

well

earnest phoenix
old latch
#

const { MessageEmbed } = require('discord.js');remove this ofc

#

and put the thing i wrote above

earnest phoenix
#

Ye Ik, but the reply would be embed so wouldn’t that make sense?

old latch
#

btw you recently asked in the djs server couldnt they help you?

earnest phoenix
#

My man knows where I am

old latch
#

well that wasn't a joke but okay

#

lol

earnest phoenix
#

Well, they just said do console.log

old latch
#

I didnt even searched your messages

earnest phoenix
#

Didnt output an error

old latch
#

I just got into a channel

#

and saw your name

#

lol

earnest phoenix
#

I was joking no worries lol

old latch
#

anyways

earnest phoenix
#

Let’s try!

old latch
earnest phoenix
#

Why did my bot bot just die wtf and it’s saying it’s working

dusky sundial
earnest phoenix
#

Lol

#

Server go BRRRRRR

earnest phoenix
uncut swallow
#

hello i am development a comand for my bot and i development a comand for translate you can help me?

earnest phoenix
#

Meanwhile I'm using React to go BRRRRRR

#

WTF HAPPENED TO MY BOT

uncut swallow
#

ok

earnest phoenix
#

Lol

#

Why did my bot suddenly die

uncut swallow
#

xd

earnest phoenix
#

And it’s saying it’s online lol

#

Wtf

old latch
#

well this is discord

#

it always needs some time

#

to appear offline

earnest phoenix
solemn latch
#

repl always is

earnest phoenix
#

Gay

#

But

#

you get what you pay for

#

WHAT CAN I DO WHEN IM MOBILE

#

you paid nothing so you get 🚮

zenith terrace
#

Nah repl just hates mobile coders KEKW

#

Repl is fine for me

earnest phoenix
#

@zenith terrace nah its just their ui is fucked on mobile

#

@zenith terrace ye or it just hates me

#

when you dont use react

zenith terrace
#

I looked at repl on mobile and its not too bad but could probably be reworked a little

earnest phoenix
#

Repl.it is good but sometimes it acts like my ass

earnest phoenix
#

It dies if there is a lot of commands

#

And that makes me sometime pissed

#

AND I HAVE TO DELETE MY DAMN COMMANDS

zenith terrace
#

How many commands u got?

dawn acorn
#

Can someone help me? please! I turn on my bot but it doesn’t stay online on discord, it just lacks offline

dusky sundial
#

Any error codes?

earnest phoenix
zenith terrace
#

Oof

earnest phoenix
earnest phoenix
solemn latch
#

glitch should not be used for bots

earnest phoenix
earnest phoenix
dusky sundial
#

Is any UI ever good on mobile though?

earnest phoenix
solemn latch
#

its also against tos on their free plan.

earnest phoenix
earnest phoenix
#

Well, I gtg

#

With a bit of css

#

And there you go

#

AND FIGURE OUT WHY MY BOT IS DEAD

#

YOUR BOT IS DEAD GO TO THE GRAVEYARD AND PUT FLOWERS

dawn acorn
earnest phoenix
#

@dawn acorn wrongserver

earnest phoenix
#

@oak cliff mommy this is a wrong server

umbral zealot
#

No need to ping a mod for that.

old latch
oak cliff
#

is that your bot

#

or someone elses bot

zenith terrace
#

Its his

earnest phoenix
oak cliff
earnest phoenix
#

WHY IS MY BIT DEAD

#

BOT*

#

It’s showing it’s online in the website but it’s dead

zenith terrace
#

This is development Xiuh

old latch
#

bro chill

earnest phoenix
old latch
#

nah for real

oak cliff
#

yeah

earnest phoenix
#

Alr man

#

Lol

oak cliff
#

idk why i was pinged for wrongserver

#

is what im saying

old latch
#

u were telling us for 10 mins now

earnest phoenix
dusky sundial
#

There's a hundred different possible reasons as to why your bot might be offline. No one's really gonna be able to help you

earnest phoenix
umbral zealot
#

Unless you can tell us the code problem you have

earnest phoenix
#

There’s no errors, why is it not working?

#

It’s not the code I think

#

It just died

oak cliff
#

-moreinfo

gilded plankBOT
#

If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.

dusky sundial
#

It's most definitely the code, what else could it be?

umbral zealot
#

If you think the problem is repl.it itself, then go to their server?

earnest phoenix
umbral zealot
#

Google it, I'm on mobile I don't have it

zenith terrace
#

Can confirm its not repl

earnest phoenix
#

All good

#

What’s the problem?

zenith terrace
#

Im in their discord, no announcement

earnest phoenix
#

I think it’s the ban command @zenith terrace

umbral zealot
#

Does it log anything at all?

earnest phoenix
#

Think this could be the problem?

zenith terrace
#

Is that the command you are running?

earnest phoenix
umbral zealot
#

Then it's not booting up at all

earnest phoenix
umbral zealot
#

Your ban command isn't gonna help.

earnest phoenix
#

Right when I added the command than it stopped working

dawn acorn
#

thankfully my bot came back alone, I was already scared to death of something that happened

umbral zealot
#

Add logs to your index file, stop and restart it, see if it logs anything.

umbral zealot
#

If it was a code issue you would get a console error on the right.

zenith terrace
#

@earnest phoenix does it ban the user then shut down before it reaches the embed?

dusky sundial
#

If you think it's the ban command, try commenting it out or remove it temporarily to see if it works.

earnest phoenix
#

Ima try all the suggestions

#

Wait tf

#

When I removed ban it worked

#


module.exports = {
    name: "ban",
    description: "bans a member from the server",

    async run (client, message, args) {

        if(!message.member.hasPermission("BAN_MEMBERS")) return message.channel.send('You can\'t use that!')

        const member = message.mentions.members.first() || message.guild.members.cache.get(args[0]);

        if(!args[0]) return message.channel.send('Please specify a user');

        if(!member) return message.channel.send('Can\'t seem to find this user);
        if(!member.bannable) return message.channel.send('This user can\'t be banned');
        if(member.id === message.author.id) return message.channel.send(' you can\'t ban yourself!');

        let reason = args.slice(1).join(" ");

        if(!reason) reason = 'Unspecified';

        member.ban(`${reason}`).catch(err => { 
          message.channel.send('Something went wrong')
            console.log(err)
        })

        const banembed = new Discord.MessageEmbed()
        .setTitle('Member Banned')
        .addField('User Banned', member)
        .addField('banned by', message.author)
        .addField('Reason', reason)
        .setFooter('Time kicked', client.user.displayAvatarURL())
        .setTimestamp()

        message.reply()


    }
}```
#

Is the code

#

Is there any probs with it?

#

It’s looks fine to me

umbral zealot
#

Do you even know how to look at the console output in repl.it?

earnest phoenix
#

Yes...

#

I’m not that dumb..

#

Well a bit but not that much lol

old latch
#

how can a command prevent your bot from working

#

strange

earnest phoenix
old latch
#

well maybe go debug mode

#

maybe u get something

earnest phoenix
#

Ima be honest I’ve been trying all day different types of ban command

fading cliff
#

ran out of storage maybe

dusky sundial
#

How about a try catch statement around the entire command and print any errors caught?

earnest phoenix
#

I’ve tried everything man...

earnest phoenix
#

Ima see if I delete some commands it might work...

#

Try self hosting for just a few minutes

#

If it works then it's repl

#

It’s self hosting rn

#

Does the ban command work

#

const Discord = require('discord.js');

module.exports = {
name: "ban",
description: "bans a member from the server",

async run (client, message, args) {

    if(!message.member.hasPermission("BAN_MEMBERS")) return message.channel.send('You can\'t use that!')

    const member = message.mentions.members.first() || message.guild.members.cache.get(args[0]);

    if(!args[0]) return message.channel.send('Please specify a user');

    if(!member) return message.channel.send('Can\'t seem to find this user);
    if(!member.bannable) return message.channel.send('This user can\'t be banned');
    if(member.id === message.author.id) return message.channel.send(' you can\'t ban yourself!');

    let reason = args.slice(1).join(" ");

    if(!reason) reason = 'Unspecified';

    member.ban(`${reason}`).catch(err => { 
      message.channel.send('Something went wrong')
        console.log(err)
    })

    const banembed = new Discord.MessageEmbed()
    .setTitle('Member Banned')
    .addField('User Banned', member)
    .addField('banned by', message.author)
    .addField('Reason', reason)
    .setFooter('Time kicked', client.user.displayAvatarURL())
    .setTimestamp()

    message.reply()


}

}

#

You can try

#

I’ve been trying all types of ban commands they’re not working @earnest phoenix

cinder patio
#

Missing closing quote

earnest phoenix
#

I showed like 5 different commands that were fully coded and could work but they didn’t work with me

earnest phoenix
cinder patio
earnest phoenix
#

))?

cinder patio
#

'

earnest phoenix
#

No I don’t think so it’s that

cinder patio
#

...

earnest phoenix
#

Or someone else would have noted

#

@earnest phoenix i found the same error somewhere else too

earnest phoenix
#

if('member.banneble')?

#

You're using single quotes inside the string made with single quotes

#

Hm, yea may be that

#

But if ima be honest I think it’s an error with repl.it

#

Either use double quotes to make the string or put a \ before every single quote you use in the string except the ones to open and close the string

cinder patio
earnest phoenix
#

Your command handler failed to require the file

#

See anything wrong with this?

earnest phoenix
#

The issues we've already told you

#

Ima try @earnest phoenix

#

You cant use the same character inside a string which you used to create it

cinder patio
#

no I think he fixed them

earnest phoenix
#

Hmmmmm

#

Ima try to see in the repl.it sever if someone has the same problem

#

YO WAT YOU SENT DIFFERENT CODE LAST TIME

earnest phoenix
earnest phoenix
cinder patio
#

This guy just copies code from everywhere and expects it to work.

#

nothing new under the sun

earnest phoenix
#

It’s not tho

#

Every time I’m here you say I copy???

#

If it was copied it would work KEKW

earnest phoenix
cinder patio
#

sure thing. If it's not copied then he begged someone to give him the code

earnest phoenix
#

Yeah

#

I didn’t

cinder patio
#

The thing is he copies different lines from different sources

earnest phoenix
#

You know, you should just, LEARN how to do basic stuff in javascript before trying to make a bot

#

I saw the discord.Js document and copied the ban command from there and modified it

#

I miss erwin's leviathan bot

earnest phoenix
cinder patio
#

and by modify you mean cut and paste

earnest phoenix
solemn latch
dusky sundial
#

Never copy and paste code you can't understand

#

It might work, but you won't know why

earnest phoenix
#

I could type n.tag learn first in #commands and get a huge block of text to copy paste here begging the user to learn first

dusky sundial
#

therefore you won't know why it breaks either

earnest phoenix
dusky sundial
#

Did you understand the suggestions or just blindly type what they told you to?

earnest phoenix
#

No, I tried to understand them

cinder patio
#

but did you

earnest phoenix
#

but... you still ignored and said it's an issue with repl

earnest phoenix
#

Huh?

#

This

earnest phoenix
#

how is a single js file taking up 512 mb of free storage

#

discord.js is only 13 kb

#

Uh

#

the cache on a smol bot is less than 50 mb

dusky sundial
#

I assume it would tell you if it was full too right?

earnest phoenix
#

Yeah

#

It will

#

Hm, maybe it would output it in the box

#

Ye probably

#

Try going to repl.it/repls and seeing the storage size of your repl

#

It 100% wont be near 512 mb

#

Alr ima see

#

Okie

cinder patio
#

just accept it. You copied the code, the only thing you know is that is it's supposed to ban a member, if you knew the basics of javascript you wouldn't be trying to make a ban command for a whole day. Learn javascript. Read the documents because it will save you a lot of time in the future. Don't be a help vampire. adios.

earnest phoenix
#

52.mb

#

And the limit is 512mb

dusky sundial
#

You need to understand that people don't get annoyed because you're asking for help, they get annoyed because you're asking for help with things that could easily be fixed by just knowing some basic JS

earnest phoenix
#

Imagine coming here to ask for help and insisting that it's an issue with repl

#

But..

old latch
#

hey u are still here

#

👀

earnest phoenix
old latch
#

I see

earnest phoenix
#

Yea...

old latch
#

found a solution?

earnest phoenix
#

Lmao I just realised I am in multiplayer on your repl and i can see the env

earnest phoenix
#

Remove me quick lmao

earnest phoenix
#

Lol

#

Oh yeah I invited you

earnest phoenix
#

Yep my bad

#

Go to multiplayer tab and remove me

#

I did

#

Also generate a new url

dusky sundial
#

Ima be honest when I read documents I do learn but not much I learn more from a tutor but if you can send me all the important documents I’ll really read them throughly
Watch some youtube videos, it's how I learned my first programming language

earnest phoenix
#

@dusky sundial youtube tutorials are almost always outdated

#

just google javascript tutorial

#

boom

earnest phoenix
solemn latch
#

honestly, if a tutor helps you, hire one.

earnest phoenix
#

you have 69 billion results

dusky sundial
#

But they'll get you into the language pretty easily, especially if you don't like reading

earnest phoenix
#

@solemn latch my parents would never hire a tutor for me just to learn coding

earnest phoenix
solemn latch
#

most of programming is reading documentation

#

even years into it.

cinder patio
earnest phoenix
#

I learnt programming by myself with no outside help

dusky sundial
#

You'll always need to read something, can't escape it

solemn latch
#

even with a tutor you will be reading a ton.

earnest phoenix
outer lodge
#

Any advice on having a bot read from Google Sheet?

dusky sundial
#

Oh god, imagine an audio book for programming

earnest phoenix
cinder patio
earnest phoenix
#

ikr

solemn latch
#

imagine an audio book for docs KEKW

earnest phoenix
#

whitename with no coding experience trying to make a bot

earnest phoenix
dusky sundial
#

I remember trying to make a bot way back with almost no experience in programming, the feeling of blindly copying code and not understanding what the fuck is going on but still trying for some reason.

earnest phoenix
#

Anyways gtg go to sleep bois

solemn latch
#

and the crazy thing is, taking even just a week to learn js and you will make a bot a lot better

earnest phoenix
#

Is anyone able to help me host it on cPanel

#

Have two school projects to do tomorrow and one react app to meddle with

#

Bye

dusky sundial
#

Good luck aStaffMMWave

earnest phoenix
#

Can someone help me

solemn latch
#

doing?

earnest phoenix
dusky sundial
#

Well sure, but it was directed at the guy who typed before me

earnest phoenix
summer torrent
earnest phoenix
slim void
#

How to do a discord.js cooldown?

#

It's easy in python, idk how in js.

summer torrent
#

you can use Set or Map

cobalt spruce
#

trying to make nuke command

#

but

slim void
#

wtf

cobalt spruce
#

it always reply "This Channel Is Not Deleteable"

slim void
#

nuke cmd?

#

that's not allowed

cobalt spruce
#

like clear cmd

#

but for all messages in one channel

cobalt spruce
bright crag
#

why did you call it a nuke command

cobalt spruce
#

bruh

summer torrent
slim void
#
exports.run = async (client, message, args) => {

    // If the member doesn't have enough permissions
    if(!message.member.hasPermission('ADMINISTRATOR')){
        return message.channel.send(':x: You need to have the manage messages permissions to create a backup in this server.');
    }

    const backupID = args.join(' ');

   if (talkedRecently.has(message.author.id)) {
            message.channel.send("Wait 1 minute before getting typing this again. - " + msg.author);
    } else {

           // the user can type the command ... your command code goes here :)

        // Adds the user to the set so that they can't talk for a minute
        talkedRecently.add(message.author.id);
        setTimeout(() => {
          // Removes the user from the set after a minute
          talkedRecently.delete(message.author.id);
        }, 60000);
    }

    backup.fetch(backupID).then(() => {```
#

would this work for a cooldown? discord.js

cobalt spruce
solemn latch
slim void
#

This is my 2nd day in discord.js 😂

#

but is that the proper way for approaching cooldowns?

solemn latch
#

no

slim void
#

would that at least work?

#

@solemn latch

solemn latch
#

i mean you can try it if you want

slim void
#

gonna see if it works

#
(node:11) UnhandledPromiseRejectionWarning: ReferenceError: msg is not defined
at Object.exports.run (/home/container/commands/load-backup.js:20:28)
at module.exports (/home/container/events/message.js:21:9)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
#

error hmm

solemn latch
#

that might be the djs guide solution actually, just with really weird formatting? 🤷‍♂️

#

yeah you names your message message

#

so msg wont work

slim void
#

wdum

#

I didn't use msg

#

wait nvm

#

I did -_-

#
(node:11) UnhandledPromiseRejectionWarning: ReferenceError: msg is not defined
at Object.exports.run (/home/container/commands/load-backup.js:20:28)
at module.exports (/home/container/events/message.js:21:9)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
solemn latch
#

yep, gotta do all of them

slim void
solemn latch
#

msg.author

slim void
#

I didn't use msg.author

#
const backup = require('discord-backup');
const talkedRecently = new Set();

exports.run = async (client, message, args) => {

    // If the member doesn't have enough permissions
    if(!message.member.hasPermission('ADMINISTRATOR')){
        return message.channel.send(':x: You need to have the manage messages permissions to create a backup in this server.');
    }

    const backupID = args.join(' ');

   if (talkedRecently.has(message.author.id)) {
            message.channel.send("Wait 1 minute before getting typing this again. - " + message.author);
    } else {

           // the user can type the command ... your command code goes here :)

        // Adds the user to the set so that they can't talk for a minute
        talkedRecently.add(message.author.id);
        setTimeout(() => {
          // Removes the user from the set after a minute
          talkedRecently.delete(message.author.id);
        }, 60000);
    }```
#

see

earnest phoenix
slim void
#

yeah

#

I didn't use msg anywhere

solemn latch
#

did you save your file?

slim void
#

let me retry 😄

#

ok wait I got farther

#
(node:11) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send messages to this user
at RequestHandler.execute (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async RequestHandler.push (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
#

what?

#

I don't get js error messages

solemn latch
#

what dont you understand.

#

"DiscordAPIError: Cannot send messages to this user"

slim void
#
(node:11) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message
at RequestHandler.execute (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async RequestHandler.push (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
#

ok I got that one

#

but this

#

I don't even have an empty msg

solemn latch
#

does this only happen on a command run?

slim void
#

yes

solemn latch
#

what command

slim void
#

it says, "Cannot send an empty message"

#

can I send u the hastebin?

#

or put it here

#

it's on my b!load-backup cmd

solemn latch
#

check all .sends

#

in that command

slim void
#

checking

slim void
solemn latch
#

do some contain variables which are potentially empty?

slim void
#

i'm checking

#
   if (talkedRecently.has(message.author.id)) {
            message.channel.send("Wait 1 minute before getting typing this again. - " + message.author);
    } else {

           // the user can type the command ... your command code goes here :)

        // Adds the user to the set so that they can't talk for a minute
        talkedRecently.add(message.author.id);
        setTimeout(() => {
          // Removes the user from the set after a minute
          talkedRecently.delete(message.author.id);
        }, 60000);
    }```
#

this is the only code that is having issues

#

if I remove it, no issues.

#

const talkedRecently = new Set();

#

also imported this

#

wait

#

I got it to work however, one minor issue.

#

The cooldown works as it should for every minute..

#

it still allows them to use the cmd?

solemn latch
#

looks like you might be missing a return

slim void
#

return works the same in python?

#

in js?

solemn latch
#

no idea. not a py dev

slim void
#

how does js return work?

#

is it return None?

solemn latch
#

it returns the content/variable you put to the right from the function

#

and stops executing the function

slim void
#

ik that

#

but I mean how is it written

#

in python I'd simply do return or return None or var

solemn latch
#

return "thing you want to return;
or just
return;

slim void
#

ok

#

I'm not use to the ;

#

like php?

#

hm

quartz kindle
#

return is the same in 99% of languages lol

solemn latch
#

js you should use the ;

slim void
#

it's like php then

#

it feels similar tbh

quartz kindle
#

not exactly

#

in php ; is required

#

in js is not

slim void
#

so ; in js is just proper?

quartz kindle
#

but its good practice to have them

solemn latch
#

there are cases in which it matters.

quartz kindle
#

for exaple

slim void
#

I'm making good js progress for day 2

#

It's a lot harder than python

quartz kindle
#
// this is fine
let a = 10
let b = 20

// this is not fine, you're converting abc to a function
let a = abc
(10)

// this is fine
let a = abc;
(10)
earnest phoenix
#

Line: 11 should I replace with const user = await message.guild.members.fetch(message.author.id)
if (!user.hasPermission("BAN_MEMBERS")) return
message.channel.send('you don’t have permission to use this command')

slim void
#

I think the ; looks better

quartz kindle
#

i agree

slim void
#

less messy

quartz kindle
#

its always good practice

slim void
#

helps me in php whilst coding js 😄

#

in php the semi colon is like the #1 thing to forget

cobalt spruce
quartz kindle
#

and if you forgert php screams at you

earnest phoenix
#

Mhm

slim void
#

tablet coder?

#

seems hard

earnest phoenix
#

Ye

#

Not really

slim void
#

I mean maybe not hard

#

but def longer

earnest phoenix
#

I’m uh ipad not tablet LOL

slim void
#

oh

earnest phoenix
slim void
#

no keyboard?

quartz kindle
#

ipad = tablet?

earnest phoenix
#

Nope

earnest phoenix
slim void
#

a tablet is a ipad

quartz kindle
#

they are the same thing lol

earnest phoenix
#

While just a bit different

quartz kindle
#

an ipad is a tablet

slim void
#

tablet = good

#

ipad = over priced

#

😉

earnest phoenix
#

Yes lol

#

😂

#

Line: 19 should change with const user = await message.guild.members.fetch(message.author.id)
if (!user.hasPermission("BAN_MEMBERS")) return
message.channel.send('you don’t have permission to use this command')?

slim void
#

Typically devs prefer android

earnest phoenix
#

@quartz kindle

slim void
#

at least I do but this is off-topic

earnest phoenix
#

Mhm yea

#

Btw can someone uh help me?

quartz kindle
#

Discord is not defined

#

idk where you're looking for your errors, you should definitely see an error in the console

earnest phoenix
#

That’s an old picture

earnest phoenix
quartz kindle
#

why are you showing an old picture then

solemn latch
#

lol

slim void
#

Thanks to @solemn latch my cooldown is working ever so ugly.. but hey, it's working 😉

earnest phoenix
#

Waste of gb LOL

quartz kindle
#

waste of time for us too

earnest phoenix
#

Why?

#

Btw should I replace const user = await message.guild.members.fetch(message.author.id)
if (!user.hasPermission("BAN_MEMBERS")) return
message.channel.send('you don’t have permission to use this command') in line 19?

quartz kindle
#

we will give you solutions for the problem that the picture shows

slim void
#

Hey tim I have a question.

#

If I attempt to make my private backup-bot public, would I also have to rate limit the speed in which the bot creates the channels, roles, etc. Or is it fine to let it do it rlly fast, and have a cooldown.

solemn latch
#

why should you replace it

earnest phoenix
#

It’s better I guess

quartz kindle