#development
1 messages · Page 1523 of 1
built for dual screen
that they finnaly integrated the Linux Kernel into Windows is already nice
i have tested all windows
WSL2 is a major improvement from WSL1
So have I bud, I've worked with all of them too.
yea
cough
@open falcon stop spamming dotposts, thanks.
so ?
Linux copied windows ?
finnaly you can run Redis in a easy way without having to use a Docker Container
no it's a different system
tested windows ( i have windows 10 on my local computer)
"came out after" doe snot mean "copied"
cough cough!!
if i make socks, and another person decides on making socks, does that mean they're copying me
Mongodb?
yup
is prefix your model?
you just became John Cena for a second
findOne its not a function
yes ik what to do
latest i think
windows was a commercial operating system, it cost money to have
linux was one of the initial open source movements
if you hover in VSC over prefix does it show your Model?
it doesnt update auto
its open source now windows
it has media creation tool
v14.15.0
to create an iso
what are you talking about lol
its ok
that doesnt mean its open source lmao
windows never was and never will be open src
No, windows isn't open source and probably never will be 😂
i heard windows xp's source code leaked
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
so i post a link https://img.pgamerx.com/23123bufsf something
Sharex with a server
I made my own 😂
it will embed it
how?
get ShareX (its free on steam) and google a ShareX server you can run
nice but how
then run the Server on your server and configure ShareX to use it
oh alright
Ima try and tell ya
in javascript with a simple web server. not that hard actually
receive POST requests, return a JSON with a URL
¯_(ツ)_/¯
Many distros are not open source
well its one distro based on the Linux Kernel
requiring money doesnt mean its not open source
you can have both
there are many commercial open source projects
@lusty quest (sharex)but that's not available with linux
you pay for support and web features
sharex or the server?
sharex
use mono
there are some alrernatives iirc
mono?
i love liniux terminal
isn't mono a framework
it has great commands
its a wrapper for Windows executables
if anything you'd be looking into wine
u can create folders with name "con"
umm
u cant make a a folder with name con
or compile Sharex yourself to Linux
like mongodb enterprise?
Mono is also a .net framework
PyroCDN
using win+shift+s for screenshot
Set your A record for a subdomain to the IP and you can upload files to it
its better and fast
or use snipping tool
ye
why? i prefer to send the actual website
so whats my fix?
idk
show us how prefix is defined
like more code basically
hmm i think i could try and compile ShareX to a Linux Binary
but idk how it will run
https://github.com/ShareX/ShareX like the entire code is open source
what is prefix
coustom prefix if there is no custom prefix then defuat prefix
rip
show us how the FIRST prefix is defined
the one where you have an error
im talking about prefix.findOne
this is the error. we need to see how THIS variable called prefix is defined
now after. we need before
higher
you have prefix defined twice lol
finally
yeah I see that as a potential issue tbh, re-using the variable prefix more than once
in Rust its valid syntax but in JS it can cause issues
But in this case it shouldn't even matter
Now that this is done, show us ./models/prefix , that file
see what it exports.
i am seeing this and doing https://github.com/DashCruft/Discord.JS-custom-prefix/blob/master/index.js dont worry changed little code and it
how did you register the model to Mongodb or Mongoose=
@pale vessel it won't work
you're not exporting anything 
you should import prefixes not prefix
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
const MessageModel = module.exports
wtf
so now what?
remove the first part and do just module.exports = mongoose.model('prefixes', PrefixSchema);
import in your message handler prefixes not prefix
that doesn't matter it's just a variable name
otherwise you just create a new empty variable
the default exports can be named whatever you want when you import it
yea but he has to tell Mongoose to use the model
Did you add the A record
done
@delicate shore and you need to add the actual subdomain on the right
The IP is 163.172.209.65
I am in their server
is it because of the handler?
Bruh someone ghost pinged me
i wanna make my bot send custom prefixes too bro
1st lemme fix mine then will help u
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
wow. my discord API locked magically cleared after like 8 hours of waiting.
this is how it usually work
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()
}```
you can export a function
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) {```
was this an answer to my ques or angi's
the api guy
k
wdym? isnt what im doing already doing that?
module.exports = async function reminderFunction(bot, data) { is also valid
isnt that the same thing as what im doing though?
says its not a function
you cant call the function in a different file?
you try to use an export in the same file?
Hi
yes
why?
i want to also call that function in the same file
Does anyone know how to code with bdscript?
because core.js stores multiple functions that build off of each other
Does anyone know how to code with bdscript?
async function reminderFunction(bot, data) {
//your stuff
}
await reminderFunction()
module.exports = reminderFunction
meant to send #memes-and-media

TypeError: core.messageReminderAdd is not a function
at Object.<anonymous> (C:\Users\Sam\Desktop\RemindMe\index.js:86:6)```
@lusty quest
where did you attach it to core?
its this js const core = require('./core.js');
where did you attach the function to core?
wdym
core.function is only valid if you attach the function somewhere to core
so its no wonder that is doesnt work
one of the functions works on it
so you export functions with core that you import into function?
if you do it there is a more elegant way i guess
yes i want to use functions I keep in core.js in index.js
i take this back
what is the code of core.js?
did you know how to have mutiple exports in a single file?
no
would suggest to read about this
got anywhere good to look?
@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
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
what would you say is the easiest way to use these functions in my index file then?
make a index.js file inside your functions folder and reference them inthere
No one here uses it because it sucks
Only the noobs
:( its free tho and i dont wanna spend money
so is google cloud
module.exports={
Function1:require("./function1.js"),
Function2:require("./function2.js")
}
or AWS Free Tier
true
There are so many free hosts
then you can just deconstruct the functions from the one import
okay
like ```js
const {Function1,Function2} = require("./functions/index")
can I call other functions inside those?
?
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?
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
@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
core.function1= require("function1")
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
i set favourite programming language to null for a reason
yeah
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
i set it to ts no regret
how can I make a dbd.js command
he/she when used command
then use bot commands
its possible on dbd.js?
literally just:
var fs = require("fs");
for (var filename of fs.readdirSync("./").filter(x => x != "name of core file.js")) {
var fileData = require(`./${filename}`);
module.exports[filename.replace(".js", "")] = fileData
}
i used var to give everyone reading that a nosebleed
wdym
unless you need one for all types of shit
first of all,
never heard of that thing
[After spending some time reading their documentation]
I have no idea what I'm looking at
Go to their official server
dude I write worng
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???
module
this guy is literally me 3 minutes ago
@earnest phoenix don't worry noone has ever heard of it either
it's not BDFD I found it on npm library
npm i dbd.js
#stillusesvarevenafterbeingberatedfordoingso
#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
what is dbd.js?
no idea
oh lol
people mention it quite a lot recently
looks like its for people who dont really want to do js https://www.npmjs.com/package/dbd.js
lmao? ```js
bot.variables({
Name: "Value",
Name2: "Value2"
})
looks like the goal is to remove most the features of js or even programming languages to simplify it.
hmm
but why just make a bot maker then
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
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.
this does not seem simple for me
the thing about code is how much you can change
this is like
everything is well scripted
well, it appears to still be in early stages.
people are gonna use this and call themselves programmers
I could not get behind using this
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
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
can you show your index.js line 84?
//Start core functions
setInterval(dbCheck.dbCheck(bot), 60000)
} catch(err) {
catchError()
}
messageReminderAdd.messageReminderAdd(bot);```
show line 3 of dbCheck.js
const reminderFunction = require("./Functions/reminderFunction");```
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
ohh
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
@umbral zealot what would I do insteads
what you should do instead is not do ./Functions/ because that's going to the functions folder
smh
all caches have a sweep function
why the requests module
Why not aiohttp
Is there some sorcery behind that decision in the first place?
no aiohttp works
ok i should rephrase that, do I need the dot at all or can I just do reminderFunction in the dbCheck
can you not literally just remove Functions/
What are you trying to do?
yes thats what I did
./reminderFunction is fine
so its a internal api for my dashboard to talk to my bot
basically asking if 2 users have a mutual server
Is there a document on how to use it ? I was using const client = new Discord.Client({ fetchAllMembers: false, fetchAllInvites: false, fetchAllAuditLogs: false });
so making dashboard send a thing to db, and bot sends a thing to dashboard thru a url
you can use executor, but pain. Better use aiohttp
I'm gonna cry in advance, give me a sec
wdym
Yeah what norizon said
ill use aiohttp
fetchAllMembers is false by default already, the other two dont exist
i just havent looked into it
Any specific part you need an explanation for?
how can i prevent cache accumulation then is there a sample or document ?
not really
3.5gb ram is
a serious number
i just didnt know how it worked, but now that i know itll work for this purpose ill look into it
ty
i use it for my reddit thing but one of my devs did that
i never understood it lmfao
it's not that different with requests though
AND i need to understand how aiohttp works too for my ksoft access
discord.js does not have a way to prevent caches, but you can delete stuff from the cache with a setInterval.
if you want to look further, i have a library that provides anti-caching to discord.js
basically just additional async/await syntax
Of course, everything that can be an example will work for me. can u send the library?
wha-
check discord.js-light on npm
like i dont know py syntax well
most of my code is copy pasted from other pieces of my code lol
ok thank u mate ❤️
oh well, you can easily get used to it by rewriting it instead of copying.
reminderFunction.reminderFunction(data)```
```js
//reminder function
let id = data.user```
keeps saying that data is undefined
any soulutions?
define data
show more code
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);
}
}```
const reminderFunction = require("./reminderFunction");```
and 1 sec
{
_id: 600079f56292dd25acd22dd1,
user: '140535726797225985',
messageLink: '[#575425241166249993 message](/guild/498548588318556210/channel/575425241166249993/)',
time: '1610644256730',
__v: 0
}```
show the reminderfunction file
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);
}
}```
bot, data
bot, data
pass in your bot
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
const dbCheck = require("./Functions/dbCheck.js");```
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
its a function in the exports of that
you cant compare like that
then how?
but you are calling dbCheck
setInterval accepts a function as the first parameter, right now you are passing whatever gets returned by dbCheck
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
pretty sure the value is a function
like in #development message
oh never mind
huh
so its not calling the function?
you are calling it yourself
you are calling the function once yourself
setInterval only receives the returned value by that function
something(somethingElse()) // execute and give result of somethingElse to something
something(somethingElse) // give somethingElse function to something without executing it
would making a var at the beginning of the file with the path to the function and passing that fix it?
no, you need to understand how setInterval works - the first parameter of setInterval must be a function, not any other value.
() => is an anonymous function that calls your function
that function will get executed every N milliseconds
Whatcha guys doin
taking a dump
so js setInterval(() => dbCheck.dbCheck(), 60000)
I'm listening to React30 while doing my homework
yes
Nice podcast ngl
im procrastinating by being here, as usual
And react is an BigInt(excitement level) awesome library
I have a math test tomorrow and I'm here
still having the same issue
svelte > react
its only running when someone runs a command
wrong
unwrong
where are you putting that set interval
//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
wat
waot
why double intervals
i do not know
@_@
but where exactly? In the message event? In a command? in my bed?
under your bed
rsrsrsr
that shoulda went to nodemon
i smell br
inb4 it doesnt
annnnd bot is undefined
async function reminderFunction(bot, data) {
reminderFunction.reminderFunction(bot, data)```
sometimes i really just dont
like why
it worked
Why is this not working?
i got 25 dms
Any MariaDB experts here?
mariadb.InterfaceError: MySQL server has gone away
This keeps happening after the bot has been running for a while
Huh..
hey guys
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?
Wouldn't it be better to paste the code rather than a blurry screenshot?
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()
}
}```
code that long should be uploaded to hastebin.
also yes
"Discord" should be undefined
just do const Discord = require('discord.js');
and leave the rest as it is
Alr let’s try
well
Sorry I’m kinda lazy
const { MessageEmbed } = require('discord.js');remove this ofc
and put the thing i wrote above
Ye Ik, but the reply would be embed so wouldn’t that make sense?
btw you recently asked in the djs server couldnt they help you?

My man knows where I am
Well, they just said do console.log
I didnt even searched your messages
Didnt output an error
I was joking no worries lol
anyways
Let’s try!
nope just import whole discord lib and then it should work
The mysql server said fuck you
Why did my bot bot just die wtf and it’s saying it’s working
Noticed, but I wanna know why it's being so mean to me :(
Like my bot 
hello i am development a comand for my bot and i development a comand for translate you can help me?
ok
xd
repl always is
Gay
But
you get what you pay for
WHAT CAN I DO WHEN IM MOBILE
you paid nothing so you get 🚮


@zenith terrace nah its just their ui is fucked on mobile
@zenith terrace ye or it just hates me
when you dont use react
True

I looked at repl on mobile and its not too bad but could probably be reworked a little
True it’s fine but sometimes it’s annoying
It dies if there is a lot of commands
And that makes me sometime pissed
AND I HAVE TO DELETE MY DAMN COMMANDS

How many commands u got?
Can someone help me? please! I turn on my bot but it doesn’t stay online on discord, it just lacks offline
Any error codes?
When I had like 30-40 it just died and was like fuck you pay for hacker plan
Oof

glitch should not be used for bots
True, for websites I think that’s fine
tf you mean not too bad just try using the shell or trying to click on the end of a line without pressing the shitty box thing
Is any UI ever good on mobile though?
No
its also against tos on their free plan.
Yea the box thing sometime can be a pain
React Native
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
what do i do? he doesn't go online, i call him but he doesn't go online
@dawn acorn wrongserver
Personal preference
@oak cliff mommy this is a wrong server
Same
No need to ping a mod for that.

Its his
Hewo
then it goes to #development not wrongserver
This is development Xiuh
bro chill
Lol
nah for real
yeah
u were telling us for 10 mins now

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
Unless you can tell us the code problem you have
There’s no errors, why is it not working?
It’s not the code I think
It just died
-moreinfo
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.
It's most definitely the code, what else could it be?
Alr thanks can you send the invite in DM’s?
Google it, I'm on mobile I don't have it
Can confirm its not repl
Im in their discord, no announcement
Does it log anything at all?
Think this could be the problem?
Is that the command you are running?
Nope
Then it's not booting up at all
Mhm right when I used it, it died now it’s not booting up
Your ban command isn't gonna help.
Right when I added the command than it stopped working
thankfully my bot came back alone, I was already scared to death of something that happened
Add logs to your index file, stop and restart it, see if it logs anything.
console.log?
If it was a code issue you would get a console error on the right.
@earnest phoenix does it ban the user then shut down before it reaches the embed?
If you think it's the ban command, try commenting it out or remove it temporarily to see if it works.
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
Yep it’s prob something with repl.it
Ima be honest I’ve been trying all day different types of ban command
ran out of storage maybe
How about a try catch statement around the entire command and print any errors caught?
I’ve tried everything man...
True :/
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
Missing closing quote
I showed like 5 different commands that were fully coded and could work but they didn’t work with me
Hm, where?
))?
'
No I don’t think so it’s that
...
Or someone else would have noted
@earnest phoenix i found the same error somewhere else too
Huh where?
In the next line after async run (...)
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

It's not
Your command handler failed to require the file
See anything wrong with this?
Yeah
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
no I think he fixed them
Hmmmmm
Ima try to see in the repl.it sever if someone has the same problem
YO WAT YOU SENT DIFFERENT CODE LAST TIME
I sent 5 different codes

This is completely different

This guy just copies code from everywhere and expects it to work.
nothing new under the sun
It’s not copied?
It’s not tho
Every time I’m here you say I copy???
If it was copied it would work 
Not really lol
sure thing. If it's not copied then he begged someone to give him the code
The thing is he copies different lines from different sources
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
What’s that?
and by modify you mean cut and paste
No, bruh
well, for example, this is very clearly two different sources copied from different locations mashed together. thats fine, but its pretty silly.
https://i.imgur.com/x4HX2DM.png
Never copy and paste code you can't understand
It might work, but you won't know why
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
therefore you won't know why it breaks either
I got a bit help it wasn’t really copy n pasted I asked for help before and got suggestions I tried them
Did you understand the suggestions or just blindly type what they told you to?
No, I tried to understand them
but did you
but... you still ignored and said it's an issue with repl
this
Huh?
This
But, I think it really is a problem with repl.it and might be the storage is full
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
I assume it would tell you if it was full too right?
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
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.
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
No, I swear this time I tried my self
Imagine coming here to ask for help and insisting that it's an issue with repl
But..
All day here
I see
Yea...
found a solution?
Lmao I just realised I am in multiplayer on your repl and i can see the env
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
Remove me quick lmao
What how!
Lol
Oh yeah I invited you
Because you sent me the repl join link instead of the actual repl link earlier
Yep my bad
Go to multiplayer tab and remove me
I did
Also generate a new url
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
@dusky sundial youtube tutorials are almost always outdated
just google javascript tutorial
boom
Hm, but I don’t know which videos since most of them are also beginners and it’s hard to find some
honestly, if a tutor helps you, hire one.
you have 69 billion results
But they'll get you into the language pretty easily, especially if you don't like reading
@solemn latch my parents would never hire a tutor for me just to learn coding
Yes I hate reading omg reading is the worst
My favourite is https://javascript.info
wrong
This isn't the first time you say this... I really hope you mean it this time.
I learnt programming by myself with no outside help
You'll always need to read something, can't escape it
even with a tutor you will be reading a ton.
audiobooks exist
Any advice on having a bot read from Google Sheet?
Oh god, imagine an audio book for programming
Use google's API ig
pepoo reminds me of you but before you learnt how to code
ikr
imagine an audio book for docs 
whitename with no coding experience trying to make a bot
Lol i just download react30 episodes using ytdl then convert them to mp3 and listen while doing my homework to learn react
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.
Anyways gtg go to sleep bois
and the crazy thing is, taking even just a week to learn js and you will make a bot a lot better
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

Good luck 
Can someone help me
doing?
Me?
how can she do that?
Well sure, but it was directed at the guy who typed before me
Lol thanks, all good
show code
you can use Set or Map
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
The Set object lets you store unique values of any type, whether primitive values or object references.
The Map object holds key-value
pairs and remembers the original insertion order of the keys.
wtf
it always reply "This Channel Is Not Deleteable"
delete the channel and then remake it
like clear cmd
but for all messages in one channel
it is allowed
why did you call it a nuke command
it is deletable not deleteable
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
fully my bad
you should really make the you need more perms message say admin if you are requesting admin
oh
This is my 2nd day in discord.js 😂
but is that the proper way for approaching cooldowns?
no
i mean you can try it if you want
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
that might be the djs guide solution actually, just with really weird formatting? 🤷♂️
yeah you names your message message
so msg wont work
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.```
yep, gotta do all of them
What doesi t mean by msg not defined when I didn't use msg?
msg.author
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
NaN users
did you save your file?
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
(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
does this only happen on a command run?
yes
what command
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
checking
they all contain content
do some contain variables which are potentially empty?
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?
looks like you might be missing a return
no idea. not a py dev
it returns the content/variable you put to the right from the function
and stops executing the function
ik that
but I mean how is it written
in python I'd simply do return or return None or var
return "thing you want to return;
or just
return;
return is the same in 99% of languages lol
js you should use the ;
so ; in js is just proper?
but its good practice to have them
there are cases in which it matters.
for exaple
// 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)
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')
I think the ; looks better
i agree
less messy
its always good practice
helps me in php whilst coding js 😄
in php the semi colon is like the #1 thing to forget
What about me?
damn u code in tablet
and if you forgert php screams at you
Mhm
I’m uh ipad not tablet LOL
oh

no keyboard?
ipad = tablet?
Nope
No
a tablet is a ipad
they are the same thing lol
While just a bit different
an ipad is a tablet
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')?
Typically devs prefer android
@quartz kindle
at least I do but this is off-topic
i already told you what the problem is
Discord is not defined
idk where you're looking for your errors, you should definitely see an error in the console
That’s an old picture
^
why are you showing an old picture then
lol
Thanks to @solemn latch my cooldown is working ever so ugly.. but hey, it's working 😉
Waste of gb LOL
waste of time for us too
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?
we will give you solutions for the problem that the picture shows
?
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.
???.?.?.
why should you replace it
It’s better I guess
the library will handle rate limits for you, but its good practice to use promises and make the requests sequentially and not concurrently
What do you think?

