#development
1 messages ยท Page 1320 of 1
"how do I get a substring from a string in javascript"
But tbh there is probably a trim or slice or something
what's the diffrence between evaluate() and eval()
if you read what i linked, it would tell you
make math functions is one, another is use a lib
maybe mathjs
idk what you js guys do
@cinder sandal regex math 
i feel like someone said dont use eval, so you googled eval and evaluate came up as another suggestion.
no idea why youd presume evaluate would be better than eval
๐ค
in djs is there a way to broadcastEval or something similar inside the sharding manager or something so that not every single shard posts to dbl?
setup a seperate project to do the posting
get guild count for each, post the guild count and shard count into the api inside of the shardingmanager, not the shard
Heya, I'm trying to check if user's id is in my json file. I would like to check if my user is admin or subuser.
if(message.author.id !== serverData.admin)return message.channel.send(WelcomeToDemo);
That's my line to check if user is admin
will```js
if(message.author.id !== serverData.admin)||(message.author.id !== serverData.subuser)return message.channel.send(WelcomeToDemo);
oh okayyy
if(message.author.id !== serverData.admin||message.author.id !== serverData.subuser)return message.channel.send(WelcomeToDemo);```like that ?
Yes
okay, thanks !
Need some help here discord.js v12
I need help on links
The link I get - https://radiostationusa.fm/assets/image/radio/180/100.3 Kiss FM.png
I want to make sure its an view able image so it has to be like this https://radiostationusa.fm/assets/image/radio/180/100.3 Kiss FM.png
Fetch the link and turn convert it into buffer
If available it's a viewable image
hello! in my html I am trying to create a contact form the the input value isnt showing up
this is my content code
@heavy marsh
@earnest phoenix https://www.w3schools.com/html/html_forms.asp
I get the link as https://radiostationusa.fm/assets/image/radio/180/100.3 Kiss FM.png from the package I use
so I have to label it?
so I have to label it?
@earnest phoenix https://www.w3schools.com/html/html_form_elements.asp
label for the text and input for the input forms
What should I use to cound how many users my bot has. I use len(client.users) and it returns 1
In python
math.floor(random())
Huh
Its in a over 900 member server
@dense nest might need to make sure your cache is up to date then. Try downloading all the users
How can I do it (8ball command in discord.js)
var x = getRandomIn(0, 20);
@sand dune why don't you check if x is greater than 10 and give a good thing, and if less than return a bad thing
Or just randomly choose a response 
@sand dune Kinda like I did here
https://discordapp.com/channels/264445053596991498/265156286406983680/752949715162759312
@sand dune mine has 12 lol
then randomly pick between 6... instead of 20
You can't anymore
because people made stupid bots just for the badge, and ruined it for everyone
I'm not joking
Yeah
Why, are you trying to do the same thing?
You can ask them at the official discord server
https://discord.gg/discord-developers
They discontinued the badge
That's all I know
np
How the hell do you get verified bot dev
@earnest phoenix wait are you talking about the badge or the role in DBL?
are you calling looper()?
@faint prism how do i call looper()?
this is the code, you may have forgot:
import asyncio
import schedule
import time
def new_day():
print('new day')
schedule.every().day.at("10:04").do(new_day)
async def looper():
while 1:
schedule.run_pending()
print('yo')
await asyncio.sleep(1)
looper()
how can i get like each letter from a string? python
in a list? wanna simply iterate over the string characters?
So you want a list of every character in the string
input a string, and it returns each letter as a var
for char in โstringโ:
print(char)
xy problem?
its for a command what makes the input ๐บ ๐พ
When you say you want it to become a variable, it sounds like you want a = "a", b = "b"
Which is not possible.
yeah, xy problem indeed
so like i put in hi and it gives back ๐ญ ๐ฎ
Can i make a bot called โralphs roblox island giveawaysโ
google would probably tell you
@drifting wedge use a dictionary
wdym
kinda like a look up table.
I have the letter X whats the right emoji
{'a': ':regional_indicator_a:', 'b': ':regional_indicator_b:', 'c': ':regional_indicator_c:', 'd': ':regional_indicator_d:', 'e': ':regional_indicator_e:', 'f': ':regional_indicator_f:', 'h': ':regional_indicator_h:', 'i': ':regional_indicator_i:', 'j': ':regional_indicator_j:', 'k': ':regional_indicator_k:', 'l': ':regional_indicator_l:', 'm': ':regional_indicator_m:', 'n': ':regional_indicator_n:', 'o': ':regional_indicator_o:', 'p': ':regional_indicator_p:', 'q': ':regional_indicator_q:', 'r': ':regional_indicator_r:', 's': ':regional_indicator_s:', 't': ':regional_indicator_t:', 'u': ':regional_indicator_u:', 'v': ':regional_indicator_v:', 'w': ':regional_indicator_w:', 'x': ':regional_indicator_x:', 'y': ':regional_indicator_y:', 'z': ':regional_indicator_z:'}
``` just have this stored in a dictionary
that's a bad way to do it imo
and for each character in the string, get the character as the dictionary's key
whats a better way ๐ค
Feel free to suggest other ways, this is one I use because I cba to think of another solution 
I personally would make a dictionary of special characters, but for the letters loop over them and add "regional_indicator_" and ": " and then add those those to a string
less code
essentially what I did to get that dict in the first place
l = "abcdefhijklmnopqrstuvwxyz"
d = {}
for i in l:
d[i] = f":regional_indicator_{i}:"
d
I hate Discord's copy-pasting
ahh, ok
I mean, both work and are performant enough 
yeah
You could take it a step further and: ```py
import string
for letter in string.ascii_lowercase:
...```
True
Why ask for admin
Why ask for admin
@slender thistle just ask for all others?
import string
indicators = { key: f":regional_indicator_{key}:" for key in string.ascii_lowercase }
I keep forgetting dict comprehensions are a thing
it's the only good thing about python 
list comps are life
elixir comprehensions are still better tho 
indicators = for key <- ?a..?z, into: %{}, do: {key, ":regional_indicator_#{key}"}
dabby
oh wait no you have to cast the key from a codepoint to string
sadge
Oh my
whats the manage_guild permission?
The same as Manage Server
the id
You can do some more with the permission, such as adding integrations
manage_server?
You'll refer to it as manage_guild
ty
i made my domain host point to cloudflare
but how do i make sure that my website gets pointed to from cloudflare?
its a subdomain hosted by my friend, so it has the same ip as his website
let militime = setMilliseconds(Date.now()) + 1000```
```ReferenceError: setMilliseconds is not defined```
anyone know how to fix this
u sure?
yea
Date.now() returns ms anyways
it does?
Date.setMilliseconds() then
then how do I turn it into a regular epoch?
Just divide it by 1000?
ok issue here
it doesnt seem like node scheduler is actually running functions
core.nodeSchedule(bot);```
is how I run it
//Reminder Function
async function remindUser(data, bot) {
try {
console.log(data.user);
const userId = data.user.replace(/\D/g,"")
const dmChannel = await bot.users.fetch(userId)
console.log(dmChannel);
let reminderEmbed = new discord.MessageEmbed()
.setTitle(data.messageLink)
.setDescription("text")
.setColor("#FF0000");
await dmChannel.send(reminderEmbed)
data.remove();
} catch (err) {
console.log(err);
}}
nodeSchedule: async function scheduler(bot) {
try {
(await messageReminderModel.find({})).forEach(data => {
let currentUnix = Date.now()
if(data.time <= currentUnix) remindUser(data, bot)
schedule.scheduleJob(data.time, remindUser(data, bot));
console.log("Scheduled a reminder.");
});
} catch (err) {
console.log(err);
}
},``` is the code
can anyone help?
Use asyncio.run
@slender thistle wait so do i do asyncio.run(looper())
nvm i figured it out
I'm kind of confused
is your function
nodeSchedule or scheduler
I've seen
nodeSchedule: () = {}
as the syntax and
function remindUser(){}
but not both combined
uh
ones for my index file
wait no
nodeSchedule is supposed to schedule the remindUser task
@solemn latch
i mean the syntax
you named the function two things
nodeSchedule and scheduler
and im not sure how that works
I need help with actually everything with my bot lol
nodeSchedule and scheduler
@solemn latch one is for my index
im not sure why they're different actually
ok lemme change that
and see what happens
Quack explain the issue, preferably the one that matters.
When I try to submit my bot it says
Can you paste the client ID here
765730158203895828
You sure that account exists, because I couldn't find it either. You may want to double-check.
click the bot tab
Is the ID the same on both tabs.
Hm let me check
ReferenceError: scheduleCheck is not defined
at Object.<anonymous> (C:\Users\Samst\Desktop\RemindMe\index.js:97:1)```
```js
async function scheduleCheck(bot) {
try {
(await messageReminderModel.find({})).forEach(data => {
let currentUnix = Date.now()
if(data.time <= currentUnix) remindUser(data, bot)
console.log("Reminded a user.");
});
} catch (err) {
console.log(err);
}
}} catch(err) {
catchError()
}
setInterval(scheduleCheck(bot), 60000);```
ii dont get it
Mobile struggles
The error is 99% likely the result of your scoping.
Like that }} at the end. The first one closes the scheduleCheck body, but another scope as there's a second one..
All you need to do is click on the bot tab then check if the two IDs are the same.
Also you shouldn't start by submitting your bot to DBL, as I assume your bot is not complete.
What scope is the scheduleCheck under @gritty bolt
wdym
nope\
ima be totally honest
im tired rn
so i might just be being dumb
but could you explain it to me
Ok, first thing, learn what scopes are. They are really important to know. Second scopes is referring to the curly braces. At the end you have a brace that leads to something that isn't shown. The }} what I am referring to.
ohh
I am going to guess a function or a class
yes
Which one
function
Your problem is that your function is not reachable
so how do I fix that
Move the function outside that function
oh wait
are you talking about my js try{?
i have that
cause its not inside a function
Hold on let me get my food first and sit down
how can i toggle a css property with a switch with flask?
A what
Hey Bro How to Get a Role This Servers
like darkmode
with a switch
using flask
like how can i make a switch do shit in flask
Ok I am back
Either frontend JS or a redirect with different setting in local storage or cookies
Either frontend JS or a redirect with different setting in local storage or cookies
@slender thistle alr the page is html so i can use js?
So is the scheduleCheck function in a try catch or a function?
HTML does support the script tag, but it's interpreted by your browser, so yeah
HTML does support the script tag, but it's interpreted by your browser, so yeah
@slender thistle alr rty
I'll give you my non-b.s. assessment on the thing once the image has loaded for me
@gritty bolt
yet anyways
please tell me your joking
ok
im not gonna do that
thats a stupid idea
so the try catch goes over the whole file
Why?
its catching errors in the whole thing
can i slap you?
yes
But your invoking a try catch that doesn't need to be there. If your call is in a try catch, then it will be in a try catch. But any ways. Your problem is still the same. Your referencing something that doesn't exist in the current scope. You have to move the function out of the try catch and put it in the scope you need to call it from
what even IS the issue here?
Scope problems
did i really
wow i guess that slap worked
im such an idiot
that shouldn't have been an issue
it works now
jesus
yea
1 try and 2 catches to match
then show an updated snippet
im fixing it all up
It's a big problem. Not knowing scopes makes it harder

well i know scopes now
im honestly dead rn
maybe its not the best idea to be doing this
So it's a watch you do it, and don't try thing
Ok, then
can unix times have decimals
ex: 1602638814.658
or is that gonna be really bad
im using really exact times
Honestly at this point I don't even know what is does half the time. It's all over the place
J's*
What world uses decimal as measure of time?
the decimal time place
Oh wait are you talking about where the function is located matters, or some other shit?
do you know hoisting in js?
At this point I am just small brain, educate us
well, to put it simply, when your compiler runs, it hoists functions and variables before the code is even run, so they are the first things that run on your script
though declaration and assignment are two different steps
the variables are declared, as well as the functions, but variables dont have a value until they are assigned
i swear i dont think node-schedule is actually scheduling anything
that follows the code syncronously
I mean I would assume so if declaration comes first, then initialization would follow
though when you declare a variable, its declared, but its value isnt assigned yet, though functions get hoisted
it's not
??
does anyone know why node-schedule wouldn't be scheduling my tasks?
so by logic, function variables declarations would run in sync
and not hoisted
though i dont have a phisable way of testing this
therefore im asking
A(?)
I smell C#
anyway, hoisting in js is messy and complicated

if anyone know the answer, please do tell me
Dude c# is great
I agree 100%
hi can someone help me please? I won nitro as a gift in a good draw, then he disappeared and didn't pay, please reactivate my account so I can show the evidence if possible
wat
@frail birch not the server for that
Finally someone agrees with me
report that to discord or whatever
this Discord server isn't related to Discord company at all
I reported
This is just a 3rd party bot listing website
then wait for their response, this server has nothing to do with that,much less this channel
ok thanks
Shame on u, Erwin just because u donโt handle Discordโs issues..
I mean I am just blind so it is poory crop either way
||Erwin works for Discord, don't listen to him||
||dont expose me
||
Aye heโs undercover.
What's your opinion on programming in cpp?
Too low-ish level (for my taste), light weight, good for high performance, bad for security (manual memory mangement)
That actually describes it pretty well tbh
Doesn't net.core have a faster run step than cpp?
Good batman, how is the bat?
do you peak espanish
@earnest phoenix #general-int for other non-english
@vernal rivet I watched the benchmark comparisons for a lot of the fundamental functions. And core 5 is insane
When it actually doesn't ping but you see it
Yea Net.core is a great framework
even compares asm output
Those that say c# is trash, should feel the wrath of the NET.core 5.0
Cross-platform af too
Mhm
people say py is superior, but HAHA, glass is cooler than snakes
I mean hey numbers aren't wrong
@slender thistle the lord has spoken, come to the dark side, we got typed objects, hookers and a lot of garbage collectors
lmao

these benchmarks are so funny
i doubt its that big of a difference tbh
i would assume py and js would have a similar performance
wait py foster
Lmao
wooot mote
i assume lower = better
So you are saying glass is better good
these tests sound like they have no idea what they are doing
in js?
yup
Tim knows all
ye
so, to put it bluntly, is variable declared functions hoisted?
cuz assignment runs after declaration, and functions are hoisted by default, but im unsure about how its assigned if its within a variable
hmmm thats interesting then
i would assume they'd be hoisted as well, but only assigned after
bruh js hoisting is confusing as fuck holy shit
who the fuck made this?
lmao
variables are not hoisted, so it makes sense that whatever you give is also not hoisted
they though thou
Js is just confusing
iirc vars are hoisted
its only the assignment of the value that happens sync
i may be wrong about that but im fairly certain thats the case
its been a while fucking with hoisting
ye declaration is hoisted, but not assignment
thats what bugs me
vars and functions should be hoisted, should the function inside the var also be hoisted and once it passes on the var again afterwards assign the function?
it counts as an assignment, not as a declaration
what exactly is being tested?
some very cpu instensive algorithms
The fannkuch benchmark is defined by programs in Performing Lisp Analysis of the FANNKUCH Benchmark, Kenneth R. Anderson and Duane Rettig. FANNKUCH is an abbreviation for the German word Pfannkuchen, or pancakes, in analogy to flipping pancakes. The conjecture is that the maximum count is approximated by n*log(n) when n goes to infinity.
In different programming languages repeatedly access a tiny integer-sequence.
Python's timeit gave up on a 1k elements list
look at the top scores for this one
now look at the bottom scores for the same test
xDDD
5 min
What the fuck
Where would I go if I wanted to find more devs for a project?
Wits this?
Hello
One message removed from a suspended account.
what library are you using?
so @prisma oriole what does ur bot do?
@prisma oriole discord.js
jesus my bot is so much easier to create then using python or js or anything like that lmfao
uh
f
lmfao I dont even use like js or python or anything I use a app with simplifide codes so its easier and I dont have to run it at all and its totally free keeps my bot running 24/7 lmfao
is it right?
var usedMemory = os.totalmem() -os.freemem(), totalMemory = os.totalmem();
umm one sec

@earnest phoenix use client.guilds.cache.size to get the number of servers
ะัะพ ััััะบะธะน
@strange wadi my bots a security bot
@prisma oriole but that only show online user
that's the amount of cached guilds, not users
Hello bros is there any bot which gives twitter feeds without premium
${client.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()}
use this to show all users of your bots
lmfao I dont even use like js or python or anything I use a app with simplifide codes so its easier and I dont have to run it at all and its totally free keeps my bot running 24/7 lmfao
@strange wadi but how do you implement complex behavior or logic
no you cant because that only works if you have fetched all members
his code doesnt even separate dupes either
meaning the number is bloated also
how do i enable safe search for videos using the googleapis.com search
@strange wadi but how do you implement complex behavior or logic
@faint prism I dont lmfao thats why I have odly specific commands
XD
Hm. Whatever floats your boat I guess
yea but I seen some one send me just their bots stauts code and I have mad respect for the ppl that hand code them
sends me their bot's code
Ah, I'm getting a better picture
lol
Do you know any programming languages?
me?
Yeah
rip not really I use tools that simplify the code so its easier I havent done classes or anything yet as im only 15
and covid
So how would you simplify:
let n = 5+1
console.log(n)
bruh
My app gives me a list of options and Its nothing like them lemme get screen shot
I got mad respect for who every used real code
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
This is a easy app to start the developement
Exposed
One message removed from a suspended account.
Yea I know hes roasting me
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
I have a bot in bot designer for discord
One message removed from a suspended account.
Is easy
One message removed from a suspended account.
is there any npm for detecting 18+ youtube videos
I don't speak English
One message removed from a suspended account.
plus I can have my bot running 24/7 with out my pc having a heat stroke
:'v
O que bien
gracias
Me siento solo :'v
bruh why you guys flooding #development
One message removed from a suspended account.
stop it
ty
One message removed from a suspended account.
Lmfao he left
One message removed from a suspended account.
import asyncio
import schedule
def new_day():
print('new day')
schedule.every().day.at("00:39").do(new_day)
async def looper():
while 1:
schedule.run_pending()
await asyncio.sleep(5)
asyncio.run(looper())
print('hi')
It never prints hi. I made it asynchronous, but why does it not work now?
Is that how it's supposed to be used
Actually
I want to murder you
Why are you using asyncio in the first place
That's not how async works though
Can't say how exactly async works in Python, I suggest you dig up a few articles for it. As for your project, you're better off either scrapping the schedule package as a whole and searching for an async alternative, or create one yourself
or just don't make it async if you don't really care
how
yes
?
is there a link you can send for that]
cant seem to find anything online
abt that
Take a look at aioschedule pakcage
One message removed from a suspended account.
I have a glitch
It looks like that in my phone:
So i cant see how amny servers my bot is in
Can someone help me?
anyone know how to get righteous bot or jafbot in a discord?
hmmm. I'm not sure if I can ask mathematical questions... but let's say we have these variables: ally damage, enemy defense
how can i make it so the total damage will be, ally damage divided by the percentage of the enemy defense?
making it like ally damage/enemy defense isnt helpful
ally dmg / percent of enemy dmg
so for example if ally damage is 100, defense is 5, it will be
the ally's damage will be 80 (100 - 20)
but isn't that too much though?
do you recommend me to use another calculation?
why cant you just do ally dmg / percent of enemy defense
whats the enermy defense?
sorry im still confused
making it like ally damage/enemy defense isnt helpful
@gentle lynx why isnt it helpful
are those fields?
no
@earnest phoenix hey there buddy !!
I have another question with npm package
How can I make it like poeple don't have to put their token 2 times
Like in my package user has to do
const discord = require ('discord.js')
const ticket = require('djs-tickets')
const client = new Discord.Client()
ticket.token("bot token")
client.login("bot token")
why won't this stop the code when currentSticky is undefined? It continues into the else statement for some reasonjs if (currentSticky === undefined) { return; } else { const newSticky = await message.channel.send(currentSticky[0][0].messageContent) const newMsgID = newSticky.id const newMsgCh = newSticky.channel.id const newMsgGuild = newSticky.channel.guild.id const newestSticky = await StateManager.connection.query(`INSERT INTO stickynotes (messageID, messageChannel, messageGuild, messageContent) VALUES ('${newMsgID}', '${newMsgCh}', '${newMsgGuild}', '${newSticky.content}')`); await StateManager.connection.query(`DELETE FROM stickynotes WHERE messageChannel = ${message.channel.id} AND messageID = ${currentSticky[0][0].messageID}`); await message.channel.messages.fetch(currentSticky[0][0].messageID).then(m => m.delete()); }
log currentsticky
I fixed it...I forgot the [0][0] after currentSticky lol I always do that
of course
yeah...just do an eval command lmao
case 'meme':
fetch( 'https://meme-api.herokuapp.com/gimme' )
.then( async response => {
const meme = await response.json();
const embedf = new Discord.MessageEmbed()
.setColor( '#EFFF00' )
.setTitle( meme.title )
.setURL( meme.url )
.setImage( meme.url );
message.channel.send( embedf );
} );
break;
ReferenceError: fetch is not defined
then define fetch...
is it possible to have multiple collectors in one command?
Oh yes, but they would have to all be one part of a separate command. What were you after?
how can I write this in code?
allyDamage - (enemyDefense % of allyDamage)
for example, allyDamage is 200, enemyDefense is 10
10 is 5% of 200, so it will be
200 - 5 = 195
What language?
node.js
Alright.
It seems like there are no defined variables there, is that the whole code? Or just part?
just that part
Can you send the defined parts? Just so I can work with that?
I didn't do anything yet, just want the calculation
Well you can't get the calculation in code unless there are defined variables you can add to that part, I'm sorry, but I cannot help.
just assume the variables are defined
Yes it would be able to do
I can't because that would mess up the code you are writing and you would have to define them all over again.
Yes it would be able to do
@fickle sapphire
He knows that now, he just needs to define the variables.
ok let's say that allyDamage is 100 and enemyDefense is 20
It doesnโt matter what you make the numbers, as long as you have them as numbers
yes...
like: var allyDamage = 100; var enemyDefense = 20; var result = allyDamage - enemyDefense
uhm, i dont want to subtract them
like: var allyDamage = 100; var enemyDefense = 20; var result = allyDamage - enemyDefense
@fickle sapphire
yes, like that. but I was asking him what the variables were, because there may be a bug where u can bypass the damage variable. it would not be good to do it like you did.
how can i fetch
number of files in my cmds folder
Then: commandFiles.size (asuming that commandFiles is the name of your collection)
i have this in my main file ```client.commands = new discord.Collection()
@fickle sapphire
client.commands.size
k
console.log(client.commands.size) first to make sure it returns a number
yo
ye
i did that only
added that in
ready event
@earnest phoenix Whats Up
is their a way by which my bot can do this type of shit @fickle sapphire
yes duh
how
hi
case 'claim':
if (autoMineStart.has(`m_${message.guild.id}_${message.author.id}`))
{
let rand = Math.floor(Math.random() * 950 + 500)
let val = rand*inter;
message.channel.send(`You have earned ${val} coins from that mining session.. re-starting up the mine now`)
inter = 1;
setInterval(() => {
inter++;
}, 1.8e+6)
}
else {
message.channel.send("You haven't started up your mine.. starting it now!")
autoMineStart.add(`m_${message.guild.id}_${message.author.id}`)
inter = 10;
setInterval(() => {
inter++;
}, 1.8e+6)
}
break;
i have this command
where i define inter below where it is used
so in the if block it says inter is not defined
do a for loop in the commands collection and add every command to a string
what do i do
how do i get a file in the same folder? is it require("/file.js");?
nope
@fickle sapphire u there?
@next flax ye
./ is same working dir
With the for loop I quess
or filter em
how can i loop then
// Filter so we only have .js command files
const commands = readdirSync(`./commands/${dir}/`)```
?
will this work
work? maybe
but thats bad af
dont use forEach(0 loops
they are inefficient as fuck
read the docs
var array = Array.from(client.commands.keys()).splice(0).join(" ");
embed.setDescription(`${array}`)
This would work too
why you splicing at index 0?

Just leave the splice then xd
pro
oof
I just wanna define it in a var xd
dont use vars
let
use let/const
vars have their uses, and this aint one
rule of the thumb, dont use var
unless you need
I have recently viewed a AFK command from a different thread. Here is the code: client.on(โmessageโ, message => { // checks if the message author is afk if(db.has(message.author.id +โฆ
how is this
i just saw this
hey guys... i'm new at making bot in Discord and i have a problem in running the code just to make the Bot active... can you guys help me out???
For some reason the "node ." aint work
node : The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
- node .
-
+ CategoryInfo : ObjectNotFound: (node:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
install node
already installed
already... still aint work
um 9k
node can run single files just fine
I wanna make a bot, but im bad at coding
we all started knowing nothing
just put commitment and keep doing it and you'll get there evntually
show me your terminal
i assume you arent on the right folder
@.@
check #502193464054644737 or thishttps://discordjs.guide/@granite tendon
js is an oop, yes
:0
but can you create classes like in Java and C#?
yup
i assume you arent on the right folder
@opal plank
:o
you did not install node rey
at least not globally
owh?? really>>
yup
which is the best canvas wrapper?
like amethyse api
I can't find the dev portal
lmao.. bye man fo cultured XD
Google it?
I tried
@granite tendon https://discord.com/developers/applications
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
I have no idea
@granite tendon i just follow youtube tutorial

:'>
im actually making Paimon bot for Genshin server
this is so helpful
bhai dream 11 ki team milega kya
Create the application then under the application create the bot
aaj ka
@sullen thunder not here
Then Google the rest ๐
only english here no hindi
oof
I found something good
Make sure you're looking at tutorials for discord.js V12 if you're using javascript
I don't know any form of coding ;-;
Use this @granite tendon it's a good start to learning https://anidiots.guide/

How do I authorize my robot?
Use this @granite tendon it's a good start to learning https://anidiots.guide/
@rose warren (the site might seem toxic btw)
how can i make my bot's "custom status" refresh every 15 seconds?
how on earth everyone doesnt have an error on their code...
while im stuck with the node that doesnt work
how on earth everyone doesnt have an error on their code...
@real sierra because we don't sit and whine about not knowing how to do programming.
Instead, we try to figure what in the actual heck is causing the error.
you'll get there eventually
see my first messages in dis server
i was stuck in the npm init -y part
@real sierra because we don't sit and whine about not knowing how to do programming.
Instead, we try to figure what in the actual heck is causing the error.
@earnest phoenix im doing the same thing while having a class
see my first messages in dis server
@hazy sparrow you advertising your bot

@earnest phoenix im doing the same thing while having a class
@real sierra coding classes will not get you anywhere
programming is not a skill that you need a teacher to tell you
it's something everyone here learnt on their own
how can i make my bot's "custom status" refresh every 15 seconds?
@hazy sparrow Good question i have the same someone answer
i'd 100% not recommend getting classes they take months to teach sometime which takes days
use a setInterval
@real sierra coding classes will not get you anywhere
programming is not a skill that you need a teacher to tell you
it's something everyone here learnt on their own
@earnest phoenix what i mean in im coding the bot while having my regular class in collage
not having a programmer class
Same goes for normal school computer classes
Wot
Im actually trying to make a robot
@granite tendon owh... using arduino??
My school literally tells me an excel workbook is stored inside a worksheet
@granite tendon owh... using arduino??
@real sierra I don't know what that is,
I only learned about discord bots today
coding is a real job
who ever says it isnt
is delusional
@static wraith Time to execute server-side XSS on top.gg to ban you :)
wait... we are not talking about the same robot arent we?? XD
@real sierra I don't know what that is,
@granite tendon
oof lol
@static wraith Time to execute server-side XSS on top.gg to ban you :)
@earnest phoenix i dont even get what that means
im learning how to make the robot
But yes it is a real job
gtg bye
bye
programing is not necessarily a job
necessarily
everything has code
@static wraith but me has no money :(
and more will be in demands
and have heard of anti-injection / injection protection @static wraith?
Wtf free ๐คฃ
TOP.GG uses react (iirc) and it's impossible to make injection attacks to react applications.
Programming is NOT necessarily a job
we do it for fun, we find something's not working, we fix that with our skill, the guy pays us, rinse and repeat
Programming is NOT
necessarilya job
we do it for fun, we find something's not working, we fix that with our skill, the guy pays us, rinse and repeat
Well, everything is basically job when you get money from it.
You in incredibly wrong...
if you do something only for money it's a job
if you do something for fun (basically newbie programmers) it's not a job
No stds in code ๐คฃ
std stands for standard (library).
i Disagree in that massively
if you do something only for money it's a job
if you do something for fun (basically newbie programmers) it's not a job
@earnest phoenix
How?
because if you do something for fun and get paid its just a enojoyable job
@static wraith goto r/unpopularopinion
thats what you want to archieve
period
There is game studios which do games and they have programmers which they pay for programming their game.
Also, there is guys which only do it for fun on free tme.
I just thing that coding and programmers are gonna get very high in demand soon.
I'm a programmer but I don't wanna make it my career because I do it for fun not for money
@static wraith goto r/unpopularopinion
I just thing that coding and programmers are gonna get very high in demand soon.
Like they aren't already in high demand? Also coding and programming stands for same thing. Programming is more friendly word for to use instead of coding.
does anyone remember what the fuck started this discussion anyways
Clampy's XSS attacks
(mine)(it was a joke btw)
coding is a real job
who ever says it isnt
is delusional
@static wraith this is what started it
and if people only do it for money WHY THE FUCK DOES STUFF LIKE MOZILLA AND OPENJS AND D3.JS AND STUFF EXIST
how can i calculate 25% of 20 ?
if i want to make a help command like this
Prob thats a stupid question but I have this:
if (message.author.id !== "bla bla") return;
how can I make an array of a few ID and check if the author.id is in there
if(!IDs.includes(message.author.id)) return;```
arent you the guy from probot?
yes

and if people only do it for money WHY THE FUCK DOES STUFF LIKE MOZILLA AND OPENJS AND D3.JS AND STUFF EXIST
@earnest phoenix If you grow up, and need money and can't do anything else than program, where would you go?
Stay home?
wait I remember you
@gentle lynx multiply it by a decimal 20 * .25
thanks btw 
@tame kestrel thanks!
anytime
@next flax no, I'm a ProBot support member
@gentle lynx um ok
Does anyone know if Javascript maps/collections don't allow periods in the key?
aren't keys strings? they should be allowed then
Yeah thats what I thought, for some reason I am having trouble with it
Just kidding, I think I found the problem
yeah haha... I just figured it out... I was setting some types in a file with a weird name, either fs or requiring the module didn't go smoothly
how do I edit a role?
role.edit(), of course
https://discord.js.org/#/docs/main/stable/class/Role?scrollTo=edit
BRUH
nah .setPermissions work
Object keys can be only strings
@cinder patio what
yeah
@cinder patio
fs.readdirSync
you're missing the fs
embed.setFooter(`${message.guild.me.displayName} | Total Commands - ${client.commands.size - 1}`, client.user.displayAvatarURL());
categories.forEach(category => {
const dir = client.commands.filter(c => c.config.category === category)
const capitalise = category.slice(0, 1).toUpperCase() + category.slice(1)
try {
embed.addField(` ${capitalise} [${dir.size}] - `, dir.map(c => `\`${c.config.name}\``).join(" "))
} catch (e) {
console.log(e)
}
})```
readdirSync is a property of fs
ik
so it should be fs.readdirSync
oh ok
I think this explains it the best. All objects get turned to a string when you try to make them keys of an object. Map keys can be objects, object keys cannot be objects. @earnest phoenix
Ye
The code is correct
why its saying
smh
c.config is undefined
const categories = readdirSync("././commands/")
hence it cannot read the property category of it









