#development
1 messages · Page 1185 of 1
show the code...
im just gonna.. let someone else help with this.. its 7am and i have no slept and that is just.. a mess 
SPAGHETTI 
ehh
what is a good place host
check pinnnsss
thank
yes
oh thx
i dont know javascript
so I will make a python bot
I know almost full python
just the problem of embeds
I will face later
But it will be easy
@real nacelle you hsould learn a bit of lua then go to js
lua?
Official web site of the Lua language
@real nacelle you hsould learn a bit of lua then go to js
@solemn leaf nah
you can start whatever you want
but dont ask here idiotic questions, if you don't know the language (talking to UchihaAaryan)
guys imma try to make a meme command wish me luck
@misty sigil sorry man but the code above is from my json db private npm package
😩
Pls dm me If Anyone Can Help Me With My Error (Disocrd.js) I guess It Is Very Simple One
Pls
whinch one is Best dashboard npm ?
@umbral pollen just ask here
@earnest phoenix dashboards arent done via a package
you need a web server, some oauth knowledge
then what are you asking?
is it possible to type a command and say what you want in dms
like a selection
for example: .ban
and it sends you a message saying "who do you want to ban"
@earnest phoenix You do know, I can literally yoink your entire database in like a few minutes
You would need to note the guild the command was used in
Then dm the user and they would reply with the person
Then get the user id from the guild you noted earlier and ban it
@misty sigil what did he do
i can just yoink the json.sqlite
ok
how are banner making bots made??
with canvas
https://discordjs-fork.readthedocs.io/en/latest/docs_voiceconnection.html
how do I do this now?
how do i do the equivalent of an else statement after a while loop in js
Wdym
so in python u can run a condition while true and then when it is false it will run the else once
uh i think i have a better question, how do u wait till one statement is true before executing another statement
im trying to make hangman and i need to wait for the user to choose a word before doing anything else
If you are using discord.js, you should use awaitMessages to wait for the user to send a message with the letter/word
Or you could use a message collector, that actually sounds better in your case
@pale vessel
@pale vessel ooh when you will be free
in like 5 hours after i watch two movies
im using .fetch should i change it to a message collector
!help
@pale vessel ok I have set alarm of 5hr
how exactly are you using fetch? Fetch is used to get already sent messages from a channel
yeah, you should definitely use a message collector here
after getting the message how do i use that in a different channel
what do you mean?
so someone calls the command in a main channel and then i dm them and get a word using a collector now i want to use the word back in the main channel
Wrong channel*
const { MessageEmbed } = require('discord.js');
const randomPuppy = require ('random-puppy');
module.exports = {
name: 'meme',
description: "this is a meme command!",
async execute(message){
const subReddits = ["meme", "me_irl"]
const meme = subReddits[Math.floor(Math.random() * subReddits.length)];
const image = async(randomPuppy(meme));
const embed = new MessageEmbed();
embed.setImage(image)
console.log(image) }
}
no image in console aswell
Nice
Same
tell us the error
No specific error
It justs says
ERROR npm
ERROR npm
v
ERROR npm
Like that
50 times
use another db i guess
Im trying to make a welcome channel...
a set welcome channel
and quick.db doesnt work, so how am I supposed to make it with normal json database
npm i quick.dbdoes not work
@feral aspen whats your host
What do you mean?:
bruh
I use node.js v12
@feral aspen then variables are your only solution if you cant use database
how do you host your bot

I host my bot online?
i mean
hosting place
heroku, vps, self host...
He use vsc
Discord bot Hosting
b r u h
BRO
Proudly Independent Hosting Services at Affordable prices. That's FreshStart.
or less
This is what I use
do you have sudo access
if yes, try installing i with sudo
even if its not recommended

sudo npm install quick.db i think
Help me hosting on vps :( @tight plinth pls
:(
try doing it urself
O k
@feral aspen which plan do u use
The medium plan
hmm
I dont need more than that
idk then
@misty sigil well that json.sqlite is old now I'm updating to mongoose in a few days
or
I'll just
use a JSON db
🧠
hey @slender thistle are we allowed to do literally anything here (development related obviously)
Define anything
sure ig
what's the difference between a method and a function
i don't see any difference
besides methods only being defined inside classes
google fixed it
guys imma try to make a meme command wish me luck
update: I sucessfully made a meme command
Hello,
I'm trying to make a system where a bot will edit a specific embed it has sent in a specific channel, im wondering if anyone knows how to:
1 : get the embeds id automatically
2 : edit that specific embed multiple times every 5 seconds
Ive searched for 2 days now on google and have found nothing
Hello,
I'm trying to make a system where a bot will edit a specific embed it has sent in a specific channel, im wondering if anyone knows how to:
1 : get the embeds id automatically
2 : edit that specific embed multiple times every 5 secondsIve searched for 2 days now on google and have found nothing
@forest drift make it yourself bruh
super easy
Im not asking for someone to make it, im asking how would i make it?
fetch the channel from cache/discord
send the embed
when yoi send a message discord.js returns a promise
What can i add
you can use .then and the first argument is the message
mkay... would i be able to use a .then multiple times in for example a setinterval?
mkay... would i be able to use a .then multiple times in for example a setinterval?
@forest drift yep
k thanks
but it will bbe better to save once
and save it in a file
so an embeded object?
@slender thistle isn't @dull badger advertising
and pinging random people
so an embeded object?
@forest drift no discord.js returns the message object
that doesn't mena you don't read the rules
-ideas
Find something that you would like in a bot, and has also not been done before. Try and come up with a list of things you are interested in, and think up ways you could make the task easier with a discord bot. Eg. I like fishing -> I'm in a fishing discord group -> I'll make a bot that has fishing data and gives fishing advice. or I like a certain cartoon/anime/tv show. -> Why not make a bot that reminds me when new episodes are released and their watch dates? Once you have a fair amount of concepts down, try and look for those bots on bot listing sites like this one. If you cant find a bot that does what you laid out before as a bot concept, then feel free to write it! Who knows? Maybe a lot of people would like what you create...
you can stringify that object and save it in json then parse it every five minutes and edit the message
@forest drift no discord.js returns the message object
@earnest phoenix ok.... so i just need to setup a system that sends the message once, then gets the catched data from it, then edits it, but then how would i reedit it with a .then?
example:
const Discord = require("discord.js");
const fs = require("fs");
module.exports.run = async (bot, message, args) => {
let color = '#' + ("000000" + Math.random().toString(16).slice(2, 8).toUpperCase()).slice(-6)
if (!args[0] || args[0 == "help"]) {
return;
}
let prefixes = JSON.parse(fs.readFileSync("./prefixes.json", "utf-8"));
prefixes[message.guild.id] = {
prefixes: args[0]
};
fs.writeFile(".prefixes.json", JSON.stringify(prefixes), (err) => {
if (err) {
console.log(err)
}
});
const Embed = new Discord.MessageEmbed()
.setColor(color)
.setTitle('Prefix:')
.setAuthor('Moderation Command')
.setDescription(`Is now ${args[0]}`)
message.channel.send(Embed);
}
module.exports.help = {
name: "prefix"
}
can someone help me with my prefix chnage command
let prefixes = JSON.parse(fs.readFileSync("./prefixes.json", "utf-8"))
if (!prefixes[message.guild.id]) {
prefixes[message.guild.id] = {
prefixes: config.prefix
};
}
let prefix = prefixes[message.guild.id].prefixes;
the prefix works but it doesnt change if I run the command
C:\Users\User\Desktop\V4Viktory Modmail>node .
Missing required configuration value: token
What does this error means?
I have added my token
Required settings
-----------------
token = MY TOKEN
mainGuildId = 703974750682218508
mailGuildId = 703974750682218508
logChannelId = 747746637476003921
categoryAutomation.newThread = 747746546543755264
Add new options below this line:
----------------------------------
responseMessage = Thanks for contacting V4Viktory Modmail! Our Staff Team will be with you shotrly
closeMessage = Your ticket was closed! If you want an help again dont hesitate to DM us again
mentionRole = 747747125378678854
I am making a modmail bot
ye
@pale vessel tell me now
what's the problem?
@pale vessel code for styling
like <style>css</style>?
how to fix
<css>script.js</css>
@dull badger dont use glitch please
Yeah don't use glitch
a year ago, glitch was "cool" to create discord bots bc you could use ping services, but now its as useless as a flower in your bedroom
just help me -_-
give error first
at down.
I see his error, it is very simple
just check out why help.name is not defined.. it says it very clearly. console.log(props.help) and then look how you can access name
i dont understand u bro
Well, I can not speak turkish. Sry
why ppl start making a bot without even knowing what is variable and how to declare one
why ppl start making a bot without knowing how to program
hey guys
i do have a problem
with pushing my python telegram bot to heroku
it is giving me the error: failed to push to heroku master
pre-receive hook declined
dont use heroku
dont use free hosts in general
you can get real vps for less than 5$ a month
self host it then
thank you for your concerns and your advicee
but my question was why my heroku push failed
I got searcher duh
@dull badger nicee
you haven't showed the full error
also your project is private no need to hide the project name
Okey
I will try now
can someone help me with my prefix command
@tight plinth what do u use to host ur bot
i use RDP
@split hazel
const Discord = require("discord.js");
const fs = require("fs");
module.exports.run = async (bot, message, args) => {
let color = '#' + ("000000" + Math.random().toString(16).slice(2, 8).toUpperCase()).slice(-6)
if (!args[0] || args[0 == "help"]) {
return;
}
let prefixes = JSON.parse(fs.readFileSync("./prefixes.json", "utf-8"));
prefixes[message.guild.id] = {
prefixes: args[0]
};
if(!prefixes[message.guild.id].prefixes == "ch-") {
fs.
}
fs.appendFile("./prefixes.json", JSON.stringify(prefixes), (err) => {
if (err) {
console.log(err)
}
});
const Embed = new Discord.MessageEmbed()
.setColor(color)
.setTitle('Prefix:')
.setAuthor('Moderation Command')
.setDescription(`Is now ${prefixes[message.guild.id].prefixes}`)
message.channel.send(Embed);
}
module.exports.help = {
name: "prefix"
}
It makes dupes of the prefix for the same server and formats in a way that it tries to end the json script every prefix
@marsh surge did you run the command in the console?
ı have'nt done yet
glitch is a bit broken so on that error I saw running that fixes package problems
can soemone help me
How do i disable a specific feature on a specific server?
it happened! thank you so much @split hazel
Hi, for some reason my second item won't store in my inv after running my buy command.
Here's my code: https://hasteb.in/ucixoqis.js
when i try to change the channel details of a webhook it gives me this error
@finite bough your bot doesn't have perms
does the we hook exists
yes
can someone hep eee
@solemn leaf you shouldnt useappendFilefor this, try usingwriteFile
@split hazel gimme some command ideas
@finite bough does your bot have the MANAGE_WEBHOOKS permission?
admin
Typically 401 means you aren't authenticated while a 403 would mean you don't have permission to do something
how to do ping ms command
CTRL+R -> cmd -> ping website.com
could someone please help me with pushing my telegram bot to heroku
i am trying to do it but it keeps giving me errors all the time
Doesn't it use ssh or sftp?
I am currently making my bot multi language, should I do it or not?
if you mean human language, go right ahead
if its programming language, i'll go to your funeral
thanks for the mentionable name
to the admin/mod xD
I still can not ping him tho
@Nükleer
or find them in list and right click
idk, but two people come here with a screenshot of their bot on glitch and both are from turkey. It seems like gltich has a hype now in turkey
hi
i am trying to change the background of my bots page
do i just
<style>
body {
background-image: url('image.png');
}
</style>
@opal plank yes, I did 👀
or is there anything else
i never used css before
what's different in glitch?
when i take my project to host it in my windows vps and do node server i get
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module 'discord.js'
Require stack:
- C:\Users\Administrator\Desktop\saysoon\New folder\app\server.js
?[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965
:15)?[39m
?[90m at Function.Module._load (internal/modules/cjs/loader.js:841:27)?[39m
?[90m at Module.require (internal/modules/cjs/loader.js:1025:19)?[39m
?[90m at require (internal/modules/cjs/helpers.js:72:18)?[39m
at Object.<anonymous> (C:\Users\Administrator\Desktop\saysoon\New folder\app
\server.js:1:31)
?[90m at Module._compile (internal/modules/cjs/loader.js:1137:30)?[39m
?[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:1
0)?[39m
?[90m at Module.load (internal/modules/cjs/loader.js:985:32)?[39m
?[90m at Function.Module._load (internal/modules/cjs/loader.js:878:14)?[39m
?[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_ma
in.js:71:12)?[39m {
code: ?[32m'MODULE_NOT_FOUND'?[39m,
requireStack: [
?[32m'C:\\Users\\Administrator\\Desktop\\saysoon\\New folder\\app\\server.js
'?[39m
]
}
no
i never used css before
@earnest elm look up "css w3schools" and you'll learn everything you need to know
how would i test to see if a given channel id is working? and same thing with a role?
@earnest elm I download discord.js then do node server?
could anyone please help me with pushing my telegram bot to heroku
could anyone please help me with pushing my telegram bot to heroku
@eternal osprey use sftp
when i downloaded discord.js , then did node server i got this
@eternal osprey did u add the ignore files? ect?
did u add the ignore file?
the error begins here:
what should i do the make the bot work?
like an actual file called .gitignore?
hmmmm lemme send u a video link, i used the same video to leanr how to use heroku
yeah... i remember when i first tried lol
Love the video or need more help...or maybe both?
💬Join us on Discord: http://discord.gg/invite/fw5cKM3
Thank you for tuning in to this episode of TheSourceCode! ❤️
If you enjoyed this video make sure to show your support by liking , commenting your thoughts, and sharing for...
thats the one
he expalins a method for each upload option type
what package is that, Awsome
i just used the Heroku Git upload method
hey i am here
the problems occurs when it is trying to download numphy
for some reason
Send full output
yeah im useless here lol, i use fedora software
i find sometimes ive messed up a step when uploading and then the push doesnt work
i normally just then go to the files, click show hidden files, and delete the .git folder and restart the upload process
Shivaco where can i find a list or doc on the basic requirements for a bot to be accepted?
"Just one working feature that will be helpful to servers" is the requirement
ah ok
Well, not necessarily helpful, but it can't be a bot that leaves servers for sure
And if a bot is purposely meant to be able to react to other bots sending messages?
It will probably be muted in this server but I don't think it will be declined for that
k... cause one of my friends challenged me to make a disboard bump reminder bot, so it only responds to the disboard bot and normal players
ah ok
fucking heroku makes me wanna eat my own fucking dog
geez
if i add python as buildpack
Interesting
it wont detect
have u got ur package? ur requirements setup? ect?
Why not use a vps instead, Awsome?
wait i will try one more think
its always extremely annoying the first and sometimes second time, after that it becomes kinda relaxing to upload to heroku...
i have uploaded like 3-4 apps to heroku
just my first time uploading python to heroku
especially if ur like me and are extremely impatient, stuborn and dont understand 90% of the errors the terminal gives
just my first time uploading python to heroku
@eternal osprey ah... yeah after hearing that imma stick to discord.js...
why does it error out when installing numphy
like
i already installed it
it is in the requirements
"no module named 'six'"
should i delete it from the requirements.txt
there seems to be a reacurence of the error with some sort of python file/system
Why are you installing numphy
i already have done pip install six
does heroku python need numphy? huh
Just don't use heroku
should i remove numphy from the requirements.txt?
I mean heroku is better than glitch sooooooooo
should i remove numphy from the requirements.txt?
@eternal osprey give it a shot?
and a VPS is better than these weird project platforms every discord bot dev seems to love using
yeah... definately sticking to discord.js
and a VPS is better than these weird project platforms every discord bot dev seems to love using
@faint prism i just stick to the classic Geany... never had an issue with it...
and a VPS is better than these weird project platforms every discord bot dev seems to love using
^
and a VPS is better than these weird project platforms every discord bot dev seems to love using
@faint prism it's loved because it's easy
i want to smash my fucking pc
@eternal osprey 8yr fortnite xbox rager... minecraft 4 life
@faint prism i just stick to the classic Geany... never had an issue with it...
@forest drift That's just an IDE?
i have zero clue what an IDE is but Geany used to be the top coding client.... 79+ languages..
@faint prism it's loved because it's easy
@sudden geyser "Easy"
I see so many questions on how to use it and errors related to it
IDE - Integrated Development Environment
ie, a "coding client" like you just said
still dont know...
fingers crossed
Eh, I'd debate on Heroku being "easy" compared to VPS for beginners
removed that fucking numphy lets see what happens
Shiv gets me ❤️
i gve up
Geany is a small and lightweight Integrated Development Environment. It was developed to provide a small and fast IDE. Another goal was to be as independent as possible from a KDE or GNOME - Geany only requires the GTK3 runtime libraries.
yeah i think its an IDE
It is an IDE lmao
numphy is removed from my requiremets
anyone knows a free vps that can be hosted on a 32bit computer?
err
anyone knows a free vps that can be hosted on a 32bit computer?
@hazy sparrow do you mean OS?
lol, Geany has a higher rating than VPS XD
a vps that can host discord bots
lol, Geany has a higher rating than VPS XD
@forest drift Apples to Oranges. You can't compare those two things
wait im using the wrong term
You are lol
a thing that can host discord bots and can be activated on 32bit computers unlike github
Is it in your requirements.txt
@forest drift Apples to Oranges. You can't compare those two things
@faint prism very fair point.... VPS is better if u need more help... more error messages... more tools to help, while Geany is old, robust, and simple while being powerful
@faint prism very fair point.... VPS is better if u need more help... more error messages... more tools to help, while Geany is old, robust, and simple while being powerful
@forest drift I feel like you're misunderstanding the definition
i can only think of .gitignore lol
probs
im just pointing my experience with them so far
Geany is basically a fancy notepad that can compile code. That's what an IDE is essentially. Notepad with features including compiling a language
heroku makes everything look so easy
but in reality it gives 1k errors every commitment
d!weather
A VPS is a Virtual Private Server. ie a sandboxed instance of a virtual desktop
Geany is basically a fancy notepad that can compile code. That's what an IDE is essentially. Notepad with features including compiling a language
@faint prism ah... learn smt new every day... still love it tho
bro what are you doing
;-; my friends are lying scumbags.... they cant even tell me the right definition for vps...
so anyone ans my question? ;-;
help please
i dont have any numphy or six in my fucking dfucking requirements
@faint prism I know
Well stop then
so anyone ans my question? ;-;
@hazy sparrow just use smt designed for Rasberry PI 3? idk
free?
what i'm figuring out now is how to define my bot token
@faint prism u understand something about this?
idc if it is limited time
i am crying right now
@faint prism u understand something about this?
@dusty tulip Look on google how to use variables in your language (probably JS)
not even kidding
Ok
@dusty tulip Look on google how to use variables in your language (probably JS)
@faint prism and its not me, im helping my friends ._.
imagine not knowing simple aljebruh terms
anyone knows how to get the first 15 roles of a user?
okay cool kiddo
anyone knows how to get the first 15 roles of a user?
@lusty spade hmm not sure
you can search up the docs of discord.js
i know how to get roles just need to figure how to find the first 15
anyone knows how to get the first 15 roles of a user?
@lusty spade The roles will be in an array. Just attempt to grab the index from [0-14]
oh ok ty
Be careful you don't go past the maximum item in the array, or it'll error probably
if roles.count = 8 for instance, and you try to get roles[14] it'll error
So be wary of that
ok 👍
anyone knows how to get the first 15 roles of a user?
@lusty spade id suggest with most questions, just type in googlediscord.js(or other depend on ur language) (question)and then just look for the Stack Overflow answer, also if ur gonna do this make sure u read and try uderstand whats being said on Stack Overflow...
UBUNTU
is there a select all in Nano?
Does the usual Ctrl+A happen to not work?
nope
ctrl K deletes a line so thats something
but we talking about an index with 12k lines
could delete and remake it
https://superuser.com/a/234836 🤔 (Why is a SO answer on superuser.com, wtf?)
yeah ctrl k
fuck imagine not having a ctrl a keybind

i'll just rm it and create a new one
fuck that

boys
my heroku app is deplyoed
deployed
but lets have a look if it gets the wrker
sexist
cringe
ah nvm appologised so ok
And how can someone determine that the person is actually a boy or girl?
is it working now?
ok 👍
@lusty spade So for instance in another language how I might attempt to get a specific index is by doing something like this:
int safeIndex = collection.Count >= 15 ? 15 : collection.Count;
@opal plank not possible
Error: Cannot find module ./huser-info.js
@forest drift wait, how is that sexist xD
hey
how do you guys/girls think about people identifying as attack helicopters etc.
the server just shutdowned for a bit
@opal plank btw, we have a gg girl dev here :p
what happened
@solid marsh O:
yup it got shutdown for like 2 secs
i got even kicked
is my telegram app deployed now?
i rejoined
turn on worker
wut
Interfaces and types :NotLikeMiya:
@opal plank I use interfaces and factories in my source 🙂
bruh dynamic shit is giving me a nightmare
bruh dynamic shit is giving me a nightmare
@opal plank What are you talking about? Are you trying to implement a design pattern like DI?
i need to find a tutorial on putting commands in different files with variables that link to the index.js file... imma have a mental breakdown scrolling through the code and then losing my place in it...
if there are errors now
deconstructing and dyanmic keys
no joke
those 2 alone is giving me a nightmare
cuz a lib used it and now im struggling to get since it doesnt know its types
have you guys noticed that most of the people here have any weeb profile pics
console.log(typeof(obj)) ? idk if that works in your lang
its not even that
i get compiler errors if type is undefined
or if its not declared
deconstructing and dyanmic keys
@opal plank Let me tell you about INTERFACES lmao
Ayy
Do you use a factory to supply it's implementation though?
wdym?
assuming no cuz i have no idea what tha means
Using the factory or another form of DI, you can literally swap out logic and not rewrite everything. It'll just werk
For instance @opal plank
It's an example
okay
yes that means your Flask script is working, Awsome
no idea, try it
literally
@opal plank I don't have a sqlite class, but if I did that is where I would change it and my code would use it.
Wouldn't have to rewrite anything else since the dependencies are inverted
i love you guys so fucking much
would guild.members.cache.get(User) work on v12? I can't test it rn
module.exports = {
name: 'reload',
description: 'Reloads a command',
execute(message) {
const prefix = "bow"
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).trim().split(/ +/);
if (message.author.id === '542278740537769985'){
if (!args.length) return message.channel.send(`You didn't pass any command to reload, ${message.author}!`);
const commandName = args[1].toLowerCase();
const command = message.client.commands.get(commandName)
|| message.client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
delete require.cache[require.resolve(`./${command.name}.js`)];
try {
const newCommand = require(`./${command.name}.js`);
message.client.commands.set(newCommand.name, newCommand);
} catch (error) {
console.log(error);
message.channel.send(`There was an error while reloading a command \`${commandName}\`:\n\`${error.message}\``);
}
message.channel.send(`Command \`${command.name}\` was reloaded!`);
if (!command) return message.channel.send(`There is no command with name or alias \`${commandName}\`, ${message.author}!`);
}
else return;
},
};
it doesesnt send the message when the file doesesnt exists, it just errors the console
i would hug you guys for the fucking support i received (no homo tho)
the whole reason you'd write this is so you can dynamically import it
[key] just indicates the property
@hazy sparrow you misspelled the file's name
basically :any but not quite
I saw your message on discord api server too
What in the API discord.js gives you your bots ID?
it doesesnt send the message when the file doesesnt exists, it just errors the console
i found it after 2 months of using his command
any key/property in this interface => some value
(assuming ready was emitted)
@hazy sparrow what's the error
basically :any but not quite
@opal plank I understand the datatypeanybut not the syntax around it.
Why wouldn't you use a dictionary if you want to persist an index or key with it?
@grand finch ClientUser#id
@grand finch ClientUser#id
@wheat jolt ClientUser is from Client#user
Error: Cannot find module ./<insert non existent file here> i have another error sort of related to this
Is that the error?
yup
interface config {
a string
b string
}
with that it imports any keys inside
its basically a dynamic import
@rare mist yea, well in jsdoc syntax: {ClientUser} Client.user
but the problem arises when i try a property from that, it doesnt know if it exists sometimes
its a pain
Hm
using :any is quite a hassle too
Is that the error?
@wheat jolt yup
uhm can you show me the code where you require that file?
And also, where can I expose the constructor for DiscordjsError from?
Well for C# at least, interfaces act like a contract that any class implementing the interface can be used since it will guarantee it has those properties/functions.
thats the whole reload.js code
well yeah, but then i require config somewhere and ts be like , erm, idk what i need Huh Duh
this way i dynamically import it
without ts screeching at my eardrums
thats the whole reload.js code
@hazy sparrow no, i need the code where you require reload.js
uhh sorry require reload.js?
do you know js?
yup
no
but i never made it to require reload.js
if you don't know what requiring a file is you don't know js
i knoww that, i havent made any code that requires reload.js
assuming you using a command handler, you did
you probably copied the handler without understanding it though
likely your handler is requiring each file that ends with 'js'
im willing to bet on this one

^^
yup it does
it searches for files ending with .js
Frankenstein's code
@hazy sparrow please show the code where you require reload.js (asking for the last time, i hope)
Eck, this probably isn't the place to say this but in discord.js, ./src/errors/index.js requires ./src/errors/DJSError.js which exposes DiscordjsError which is a Function which returns a class DiscordjsError extends Base which is a yikes from me 🤢
huh?
ill just pastebin my whole index.js hold on
I sure hope it isn't in the index.js lol
yup ik
last 4 times i said that exact sentence the following code had a token in it
const Discord = require("discord.js");
const client = new Discord.Client();
const fs = require('fs');
const prefix = ("bow ");
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync(`./Commands/`)
for(const file of commandFiles){
const command = require(`./Commands/${file}`);
const name = file.split('.')[0];
client.commands.set(name, command);
}
const cooldowns = new Discord.Collection();
client.on("ready", () => {
console.log("bow bot is online!!");
client.user.setActivity(`${client.guilds.cache.size} servers!`, { type: 'WATCHING' });
});
client.on("message", (message) => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(client.commands.has(command)) {
client.commands.get(command).execute(message)
}
}
)
client.login('')
seems like i didnt need any pastebin

i deleted it from the message i sended -_-
lol
oh you mean that
im too lazy to create another file
¯_(ツ)_/¯
ur
index.js
fu*king index
you'll 100% forget this one time and paste ur index here next time you look for help
or post it on github
i dont use github
Use github
and i regenerate my token every 3 days or so
@hazy sparrow lmao
you'll 100% forget this one time and paste ur index here next time you look for help
@opal plank i can just regenerate then :/
you arent filtering ur files?
theres no need
.

dotpost?

the moment a different file somehow ends in there you'll get errors
its part of development
@hazy sparrow
@wheat jolt i open my index for the first time in a month ;-;
bug proof ur stuff
but what about my problem reeeee
lol
srsly
srsly
yes srsly
then i would have to ignore my command
send your error code again
but don't modify anything
welcome to bug proofing your code
:/
its supposed to send in the channel that

"this file doesesnt exist"
does it?
AHHAHAHAHAHAA
that
then exist-ify it
IM DEAD 💀
Reading errors in plain text is sometimes really difficult
Do you mean stacktraces?
reading is difficult, indeed
then exist-ify it
@faint prism wot
💀
Do you mean stacktraces?
@faint prism No the error itself, like "File not found"
where it originated
And it was sarcastic if your didn't catch that
It says: './huser-inf.js' is missing
./ means current directory
wanna see magic?
oh thats what's called requiring a file i see\
gm
try '../'
@opal plank i had just done huser-inf.js
:/
@hazy sparrow what OS are you
windows obv
You might as well print out the directory tree
is it on the same folder?
It says: './huser-inf.js' is missing
./means current directory
@faint prism yup its supposed to search in the current directory
is it on the same folder?
@opal plank yes
open cmd in the project folder. and type tree and send output
reload
bruh
open cmd in the project folder. and type
treeand send output
@faint prism ???
ls, tree anything that shows current directory files
i mean fuck it, just screenshot the folder
you're literally misspelling the name of the command you want to reload
we were about to check that lol
you're literally misspelling the name of the command you want to reload
@wheat jolt thats the POINT
no
its supposed to send a message that that file doeseent exist
i mean fuck it, just screenshot the folder
@opal plank this is the command folder which is in MyBot folder
its supposed to send a message that that file doeseent exist
use try-catch or fs.existsSync
^
@opal plank https://alex.is-bad.com/7eo9gun.png
why?
info NOT ifo
@opal plank i purposefully typed the wrong one to check if this works
filter your 'js'
use try-catch or fs.existsSync
@hazy sparrow ffs
yeah try/catch is what you want
why you trying commands that dont work?
especially if you're intentionally writing code that will error
I think because he doesn't want any errors
I think because he doesn't want any errors
@wheat jolt exactly

client.commands is alreayd mapped
just checked if has()
dont read file every time
that works too
and because when i try to reload huser-info it tries to reload huser-ifo which is non-existent for god knows why
delete cache and require it again
hmm ok lemme try that
alexander, i understood early on what he was trying to do
my whole point was, why do it to begin with
he already had his command mapped
ah
and he was reading the file dir every time he called that command
I get you now
Ok?
sure
What is your problem?
hmm yeah
if(!client.commands.has(/* cmd name?? */)) return;
@wheat jolt same error and theres another error when i tried that which popped out of no where
what does / / mean
It's a comment
it doesn't seem to be working at all
Because it has the *
you have to add that line before the require line bud
But if you didn't mean that
Then it's a regex
/ /
/*
This is a multiline comment
*/
/ / //This is a regex
what is the difference between
// this
String.split("/ /");
and
// this
String.split(" ");
anyone know how to use json deserializeation in c#
anyone know how to use json deserializeation in c#
@thin tapir with newtonsoft.json
^
@thin tapir with newtonsoft.json
@faint prism well yea that
im still struggleing with my stocks command
Make a class with the attribute [JsonProperty] above the property that matches the json object
what is the difference between
// this String.split("/ /");and
// this String.split(" ");
@earnest phoenix that splits it at / / not a space
Because you put the regex in a string
just fuck it,i'll try not to misspelling stuff when i try to reload my command
lol
just fuck it,i'll try not to misspelling stuff when i try to reload my command
@hazy sparrow off to a great start from that sentence
is it safe to store discord OAuth tokens in a public file since I still need my client secret to use them
or
Not at all
i can use fs to write to my env
That would be stupid
^^^
accidental message send
np
^^^
@wheat jolt dude 🔼 exists
i like ^^^ more
is it safe to store discord OAuth tokens in a public file since I still need my client secret to use them
That's an awful idea, do not do this
That would be stupid
@golden condor so should I just go nuts with fs and my env file so I am safe
That's an awful idea, do not do this
@golden condor just curious
erm
i don't even know how to use discord oauth
'safe' is hard word for it
i don't even know how to use discord oauth
@earnest phoenix oauth2.0?
Why are you storing them anyway?
I think you should use a database for it
@golden condor that's exactly what i asked should i store in a databade
If you want to store tokens, you'd better do so with a database or something locked down bro
Why are you storing them anyway?
@golden condor bruh
don't you need tokens to do stuff
Yes
With APIs
But you can cache the info?
yooow dafuq
everyone concerned about tokens but i 100$ bet you all have your bot tokens in a config json or env file
and caching it on the user's pc is ... why the fuck don't i just see a tutorial for caching

everyone concerned about tokens but i 100$ bet you all have your bot tokens in a config json or env file
@opal plank he uses repl.it so......
you kniw
Like his only option is .env
i was watching top 10 worst olympic fails and saw a pole-vaulter getting his pole in his ass
dang
or await your database
lemme guess .gitignore
add encryption
cd into the parent directory and use fs there
hey guys wanna see all my user data from oauth2? yeah sure here you go!
quick.db 

lol
you know you're at the end of the food chain when you make those kinds of jokes
Hey guys I write my file like 100 times an hour and now all the data is messed up please help?
i made like 100 polls about mongo vs. quick.db and people said "we want to be able to just boot up chrome and search through the json.sqlite file" 









