#development
1 messages · Page 1036 of 1
Or do I have to put everything in index.js
It dosent matter since no one gonna check
Guys listen
Dude there is something called classes
yeah
And handeler
🤦♂️
It dosent matter since no one gonna check
@restive pebble can I put everything in index.js?
Yes
You'll prob end up regretting that later on once you have a fair bit of commands, but it's def easier to start out with.
Aight cya gonna keep code
You'll prob end up regretting that later on once you have a fair bit of commands, but it's def easier to start out with.
@pseudo kite Lol true
Bc how do u frikin fix a command handler
???
Docs
Are you using discord.js? (that's the only thing I have experience with atm)
or can I put each commands in one like kick.js and ban command in ban.js
I have seen many pro bot devs that putting their commands in index.js
preferences
Are you using discord.js? (that's the only thing I have experience with atm)
@pseudo kite Yes
guys do you know how to fis this error :
>> 1| <% include('blocks/header', {bot, user, path}); %>```
the code is that (in the ejs file) :
```<% include('blocks/header', {bot, user, path}); %>
it's in an express server```
@autumn aspen its all in the guide
I suggest looking into discord.js-commando, It's what I use mostly atm.
Here's a link to the documentation: https://discord.js.org/#/docs/commando/master/general/welcome
thx
Discordmjs commando
Instead I use my own Command
It got an presence and active
@autumn aspen the link i sent is good for starters
It's hard to set that commando thingy
and some cool commands
@autumn aspen the link i sent is good for starters
@earnest phoenix yeah
Hello auric
hi boeing
I'm gonna have to move over to my own system eventually for some of the stuff I have planned, but it works very well for now.
\n
What?
it's js lol
lol
Guys so I have a mod mail, essentially just that line. You can message the bot and it sends the message to a channel, but mods can’t reply thru the bot. Who can help, .py btw
if you make :
message.channel.send("Hello\nEveryone")```
I have a JavaScripted bot
Thx
Dam
Moo best esolang
We don-
@pure lion what
@bronze bramble Could you elaborate please?
Do you want the moderators to be able to reply to the messages the bot sends in modmail channel?
Is there any nasa api wrappers in npm
We Devs aren't magicians with magical mirrors, please send the full errors and command files
anyone good at express and ejs ?
no luck
None
Dam
404 lol
I’d like to enable my mods to be able to reply with modmail, in dms @slender thistle
So imma make then
just get the member join
when he she joins
and send a message to system channel wit or without cnvas
Also I can fix a verify system
who wants?
No spoonfeed
and send a message to system channel wit or without cnvas
@distant bramble Welp u have much to learn
I’d like to enable my mods to be able to reply with modmail, in dms
I'm not exactly familiar with the whole modmail thing but you could store the user's ID somewhere in the message and moderators could use a command like.reply <user_id> This is a response to your modmail message
Me to
@autumn aspen make a command that adds a role when someone runs it
Oh ok
And .on guildmemberadd
@autumn aspen make a command that adds a role when someone runs it
@pure lion Oh I want it
For welcome shit
I rlly want that command
That's verify
Oh
u knwo EvilPauze bot?
It's not hard
@slender thistle hrmmm I’ll see what I can figure out
so it gives first a role then when thay verify the bit gives em the verified role
It's not hard
@pure lion Help me if u can pls
:/
Start yourself off by reading the docs, and then I'll help when you get stuck
guys do you know how to fis this error :
>> 1| <% include('blocks/header', {bot, user, path}); %>``` the code is that (in the ejs file) : ```<% include('blocks/header', {bot, user, path}); %> it's in an express server```
any idea ?
I wish I knew ejs in any case
ok... D:
b. If you are a beginner, have a will to learn and do not expect to be spoon-fed.
ok
@spare mirage ??
I wish I knew ejs in any case
@pure lion How do I do a perms of what roles can use my bot?
@spare mirage are you high?
always
lol
docs
https://docs.discord.js.stopit.stopbeinglazy.org
@pure lion invalid link
Ik
Nice link tho

I know that u gonna put this ` instead of this ' but it says its a wrong command an error why?
12?
mesage
It has caching
Cachechachevavhedhqjhd
He defined channel brih
@spare mirage sotp
bruh
Cache.find
...ok anyway
whatever
let me bring my telescope to see what that code is
@slender thistle whats wrong?
shittestdev lol
I can't see there's like 16 pixels
What is member in there
make sure member exists
lmao
also show error
How u defined channel
@earnest phoenix channel is defined as a channel
@earnest phoenix no
Aight
Yea btuh
channel.send 🤡
Buttuh
how add my bot is how many server?
member.guild.channels isn't it supposed to be message.guild.channels
cache.find
not where message doesn't exist
member.guild.channels isn't it supposed to be message.guild.channels
@earnest phoenix what is it then?
how add my bot is how many server?
@delicate drift what are you trying to say
@earnest phoenix member.guild.channels works too smh
aka an event where a member joined/left
Gets the member info
@earnest phoenix what is it then?
@autumn aspen literally what i said
Why does this channel get so fucked when there's multiple people trying to help
idk
lol
smh
@autumn aspen Show the full event code
Bc the victim dont have a brain
let me type it all out
@autumn aspen Show the full event code
@slender thistle w8
@earnest phoenix no, it's channel.send
@autumn aspen show the error so we can help you
Its not an error its like when someone join its come an error
Member.guild.cache.find
const channel = message.guild.channel.find /*/should be korrekt/*/
I will check
how do I make a good ELMO protection
Member.guild.channnels.cache.find
const channel = message.guild.channel.find /*/should be korrekt/*/
@earnest phoenix You made a mistake yourself
@earnest phoenix thats literally what he did smh
You said a bad word
also yes
Probably not
Ok bai
bai
message.guild.channels.find should work
thx
It is v12?
how do I make a good ELMO protection
@spare mirage anyone know/
because member is not defined as anything and message.member is a property of message
can you show your logs? @autumn aspen

is there any web developper ? (express + ejs)
i need to learn frontend lolololol
because member is not defined as anything and message.member is a property of message
Why are you STILL assuming it's a message event
and not MemberAdd or ANYTHING related to MEMBERS
If (event == members) { message = null }
@earnest phoenix Am I coding right?
why did you remove the channel.send
... you had it before
or wdym?
the welcome to server crap you had
Oh Im coding it
const Discord = require("discord.js");
const bot = new Discord.Client();
let users = bot.guilds.reduce((prev, guild) => (prev += guild.memberCount), 0);
bot.login(process.env.SECRET);
console.log(bot.guilds.reduce((prev, guild) => (prev += guild.memberCount), 0));
console.log(bot.guilds.size);
const fs = require("fs");
const fileName = "./public/api.json";
const file = require(fileName);
file.users = users;
file.servers = bot.guilds.size;
fs.writeFile(fileName, JSON.stringify(file), function writeJSON(err) {
if (err) return console.log(err);
console.log(JSON.stringify(file));
console.log("writing to " + fileName);
});```
I'm trying to simply write in a json my total users and guilds but it returns me "0" can someone help me?
I keep getting leak detections? Ignore them?
Lmao chillax
Want's me to use emitter.setMaxListeners()
stop using multiple events for the same stuff
use one and handle everything in it
@woven sundial what version of djs are you using ?
Schivaco is it right so far?
for example
bot.on("message", message => /* ALL OF MY STUFF HANDLED WITH IF-STATEMENTS */)```
DJS 11.5.1 @hasty lotus
ok
@slender thistle is right so far?
why don't you just use bot.guilds.size ?
you don't really need to repost the same screenshot multiple times
srry
why are you asking questions that aren't concerning my issue?
But is it right so far?
Why don't you
they are
Thx
nah tey aren't
Lmao
@autumn aspen same question, what version of djs ?
Thx
@autumn aspen They weren't replying to you
Oh
bot.guilds.size return "0" that isn't normal
if you are using v 12 you should use guild.channels.cache.find
I feel like there should be a Luca command for tias
@autumn aspen same question, what version of djs ?
@hasty lotus How can I check?
update to djs v12
@autumn aspen check your package.json
yep
ok
bot.guilds.size return "0" that isn't normal
it's normal if the client hasn't connected yet
Guys it is v.12.2.0
and maybe at least update to last version of v11 (11.6.4)
@woven sundial its normal to be size 0 because you do it before logging in
Guys it is v.12.2.0
@autumn aspen then use guild.channels.cache.find()
ok I'm stupid smh
thx
@woven sundial no, nobody's stupid. You just gotta keep observing and learning till you get it, until then you're a student
@hasty lotus is this better?
yep
const Discord = require("discord.js");
const bot = new Discord.Client();
bot.login(process.env.SECRET);
let users = bot.users.size
console.log(bot.users.size);
console.log(bot.guilds.size);
const fs = require("fs");
const fileName = "./public/api.json";
const file = require(fileName);
file.users = users;
file.servers = bot.guilds.size;
fs.writeFile(fileName, JSON.stringify(file), function writeJSON(err) {
if (err) return console.log(err);
console.log(JSON.stringify(file));
console.log("writing to " + fileName);
});
```That don't work too. However logged the bot before asking for datas
thx
@woven sundial try after the ready event of your bot
@woven sundial try after the ready event of your bot
@hasty lotus is message.channel.send
or what?
?
is it message.send.channel
I don't think that the bot.ready influence that
well, if the bot isn't ready, some properties of the bot migth not be available
is it message.send.channel
@autumn aspen what are you talking about ??!
It may not have access to caches and shit
@autumn aspen what are you talking about ??!
@hasty lotus w8
I don't think that the bot.ready influence that
use the ready event because that's when all the cache is ready
.blog_card:hover {
background-color: rgba(0, 0, 0, 0.6);
}``` anyone know why it goes white on hover?
@low orbit is that css ?
oh well
but he's on v11
opacity? 👀
try an other rgba code
Are you sure that rule isn't being overwritten by something else?
@hasty lotus smth wrong?
How
i don't see the end of the 16 ligne
so i don't know
How
@autumn aspen copy paste
¯_(ツ)_/¯
Ok
who is ok with helping me test my bot
@earnest phoenix no one
oof
const channel = guild.channels.cache.find(channel => channel.name === "welcome");
if (!channel) return;
channel.send(`Welcome to our bot support server, ${member}, please read the rules in the rules channel before starting to chat.`)
});
@hasty lotus
sry
not really good in english
but this channel
it's not testing
it's developing
what have you before ?
im making my bot and i want to test welcome message
Me?
yep
i need someone to join my server
im making my bot and i want to test welcome message
@earnest phoenix Literally above u
jsut for 1 secong
the error doesn't look to be at the end of the code
jsut for 1 secong
@earnest phoenix I can'
i will dm the invite link
Use another account
but double accounts are forbidden :/
They are not
bot.on("ready", function() {
console.log("hello, I'm online");
});```
Console doesn't returns anything
@woven sundial use an arrow function
arrow function?
=>
what's the difference honestly
bot.on("ready", () => {
//your code here
})```
in this case, no difference
what's the difference honestly
@slender thistle there is no difference
outside the ready function ?
yes i guess
@hasty lotus
Function() {}
Is the same as
() => {}
mh ok
But easier to write
they are not exactly the same, but in this case they work the same
anything else icero? there should be a lot more debug logging
An arrow function cannot be called, thats it
def __init__(self, bot):
self.bot = bot
self.token = x
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True)
@commands.Cog.listener()
async def on_guild_post(self):
channel = self.bot.get_channel(730394760363376670)
await channel.send('posted')
@commands.Cog.listener()
async def on_dbl_vote(self, data):
print(data)
channel = self.bot.get_channel(730394760363376670)
await channel.send(f'{data}')
For the server count post, its posting but its not firing the event
tried print yet?
lemme do that
also is there a way to call the event without actually having it be fired automatically cuz i cant find people to upvote every 10 seconds
on_dbl_test 😎
https://arix.is-inside.me/9Z37HsOo.png
Thats all Tim
what about bot.login(token).catch(console.log)
how do I use on_dbl_test, i dont get it
show your full code again
Is that express @woven sundial
@slender thistle ohh thanks
@woven sundial the login process is getting stuck somewere, possibly because your discord.js is outdated
so I should just update to 12?
until october you should
kay
how can i start something in node js? example start test.txt and the text document opens on my pc
How can I set slowmode.. I cant find anything in the docs
can also recommend using d.js-light its not as agressive with caching as normal v12
channel.edit?
ahh ok
@wicked pivot look into node's child_process functions
blind guess wasn't correct
You put a number in the brackets
channel.edit.setRateLimitPerUser("5");
No
not as a string
remove the .edit
<channel object>.srlpu(number)
👁️
do u need a reason
Na
Edit page, sorry
or API page
oh alright
where you entered webhook URL and authorization key

:)
nothing seems to be happening
@commands.Cog.listener()
async def on_dbl_test(self, data):
print(data)
channel = self.bot.get_channel(730394760363376670)
await channel.send(f'{data}')
when i click test
hey where is a good place to find a pfp for a bot
fax
btw for @earnest phoenix
You can make a command to "fake" user joining
client.on('message', message => {
if (message.content === '!join') {
client.emit('guildMemberAdd', message.member);
}
});
lmao
rather than plagiarising someone else's content
'
const channel = guild.channels.cache.find(channel => channel.name === "welcome");
if (!channel) return;
channel.send(`Welcome to our bot support server, ${member}, please read the rules in the rules channel before starting to chat.`)
});
``` Guys can u use this command in discord.js v12.2.0?
@slender thistle
So?
this is discord.js V12
I have v12.2.0
it looks fine. it should work have you tried it?
@lusty quest can u use this command?
const channel = guild.channels.cache.find(channel => channel.name === "welcome");
if (!channel) return;
channel.send(`Welcome to our bot support server, ${member}, please read the rules in the rules channel before starting to chat.`)
});
No
But they smth was wrong with channel.send
The below
channel.send(Welcome to our bot support server, ${member}, please read the rules in the rules channel before starting to chat.)
});
What's the rest
Thats the whole command
lemme check
is there any other popular ways to get ur discord bot out there
????????
That's wrong on many levels
want me to rephrase
How?
Put it in a guildMemberAdd event
@earnest phoenix How?
Bro u are here to learn what am I doing wrong?'
bot.on("guildMemberAdd", member => your code here)
That sound wrong
We are here to help, not teach
yup
client.on('guildMemberAdd', member => {
const channel = member.guild.channels.cache.find(ch => ch.name === 'member-log');
if (!channel) return;
channel.send(`Welcome to the server, ${member}!`);
});
like this
a bit of spoonfeed but yeah
thx
should i make a webhook for my guild and pass that in as a kwarg?
eeeeeee no
wot then
Those kwargs are parameters for an aiohttp.web to run on
aka a physical server running on your machine
im lost
Discord webhooks are "servers" waiting for requests
yes
and when they do receive one, they post messages
yes
that's what a webhook is. It's a server waiting for requests and handling them
message.channel.setRateLimitPetUser(modeslowamp).then(message.channel.send(`Slowmode is now ${modeslowamp}`));```
why is this not working?
oofo
ok but what do i pass in for the kwarg
Thx it worked
webhook_path
it's the thing right after ip:port in the webhook URL
-helptest
We aren't a server full of guinea pigs, and are not obligated help you with features that can easily be tested with alts or friends. If you don't have either - at least you can make alts without problems.
sire
use an alt
ill join
ip being your public IP address and port being whatever you set as webhook_port
it's the thing right after ip:port in the webhook URL
@slender thistle
what webhook url
basically a link that will point to your webhook
ok but where do i get that
You create it yourself assembling all the stuff together
http://ip:port<webhook_path>
ok and the ip will be the ip for my server or the machine im running on?
yes
alright thanks
how can I check how many files I have in a folder?
you can use fs then get the size of the array
@earnest phoenix the docs can
We won't give you code but we can lead you in the right direction
who its the docs?
how do I get an array size @lusty quest ?
Google it
okoko
what port should i be using
@slender thistle its still dont welcome a person?
did you get an error?
who is the docs
what language did you want to use?
not you @autumn aspen
oh
is the event correct?
Super can u help me
Show us your code
wait
bot.on('guildMemberAdd', member => {
const channel = member.guild.channels.cache.find(ch => ch.name === 'member-log');
if (!channel) return;
channel.send(`Welcome to our bot support server, ${member}! Please before chatting read the rules first, thanks! `);
});
Error why?
Lmao I think whats my pb is
Spoon feeding epic
lol
fs.lenght
you have a command handler right?
yes
did it adds every command to a collection?
ans yes
then just use the collection for getting a dynamic help command
ok
You can get the amount of commands by using the collection
also this ^
brb
Lmao guys my bad my command does run now!
Collection extends Map so you can use the size property to check how much items is in it
ahh
Yup
so I can Map(MAPNAME).size
?
webhook_path='ip:port/dblwebhook', webhook_auth='pass', webhook_port=port
but the test event still is not firing
ahhhh
Is commands attached to your bot? Like bot.commands
yes.. I changed the const name though
Let me see how it looks
what does util mean?
Utility Class attached to my client. You don't really need to worry about it
It's just something I have
hmm command handlers still weird
No no
umm
Where do you set your commands
how to create a channel with specific role perms and save its ID?
Add them to the collection
this?
bot.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
bot.commands.set(command.name, command);
}```
how to create a channel with specific role perms and save its ID?
@earnest phoenix all of those are in the docs
It's attached to your bot so you can do bot.commands.size
docs make my mind struggle 😂
docs make my mind struggle 😂
@earnest phoenix https://discordjs.guide/popular-topics/common-questions.html#legend
the examples are there man xDD
ahh
hah light mode
imma call 911
im burning yall ;-;
@earnest phoenix https://discord.js.org/#/docs/main/stable/class/GuildChannelManager?scrollTo=create Here are the docs for the specific method you need
i use opera browser VPN HHEHEHHEH
thanks @strange trout
somebody burn this man ;-;
why lol
webhook_path='ip:port/dblwebhook', webhook_auth='pass', webhook_port=portbut the test event still is not firing
@distant jewel webhook_path is what comes afterip:portin the actual URL
Everything looks better in light mode
so webhook_path='/dblwebhook' would be http://ip:port/dblwebhook
poor users that have a HDR 1000 Monitor and use Darkmode
lol
- visible struggle to understand the given links *
I know how
- and being able to type with asterisks without making it change style *
does glitch not support uptime anymore??
u went to school to learn to read with ur eyes
nope they kick these intances
nope
Justii you can't be one to talk. You've gotten plenty of help here that could've been resolved by looking at the docs
uhhum
Tim
gonna update mah code form v11 to v12.2.0
:3
its understandable but its annoying if you have to explain stuff that is written on a website
. - .
in a way that is easy to understand
djs guide isn't a documentation, its a guide
@digital ibex :/ almost the same
webhook_path='/dblwebhook', webhook_auth='x', webhook_port=5000 like this?
not really
Very different
djs guide isn't a documentation, its a guide
@digital ibex you werent suppose to say that
compare this to the guide
imma use that from now
No, the guide just has code that people can copy and paste
nope peeps here are the best of the best
That's why people think it's better
i just help out cause i wanna socialize
visible liar
;-; no u
||thats what she said||
I'm just here because I don't know what else to do on my bot
does npm automatically detect changes to package.json and reinstall or do i need torun it again?
Besides the stuff on my Trello
calculate gogol with your bot @strange trout
Alexis make a dashboard
I have one
:OOOOOOOOOOOOOOOOO
It ain't pretty though
Leak ur token for 200usd
Switching to Vue.js once my bot is actually done
thats good fun
I gave up on vue
Current one uses pug
Alexis the one thing u can do is make ur bot bigger than MEE6#0001
Eh, don't really care how many servers my bot is in
i'm also gonna add a level up system but it will DM users
cuz it already is better
its surely not that bad if loads of people invited it 
Eh, don't really care how many servers my bot is in
Discord: hmm here take a temporary bot block until you get it verified
@spare mirage have you any idea of the scale the bot has hardware side?
@lusty quest u mean mee6
halp uptime not working it sends code 403 im using gitch to code
its fkn huge
can someone take a look at my source and tell me all the stuff i need to change fir updating it to v12.2.0? glitch.com/~codecodiscordbot (no exposed token)
they have hardware that others use to start a small VPS hosting company
halp uptime not working it sends code 403 im using gitch to code
@calm saddle glitch doesn’t host anymore
I mean it does, but it doesn’t host 247
you have to pay for 24/7 hosting
and glitch is banning accounts of people who do try to make 24/7 bots there using pingers
@earnest phoenix no lol. look at the docs
I was gonna host my website there lol
for websites it's fine ig
can someone take a look at my source and tell me all the stuff i need to change fir updating it to v12.2.0? glitch.com/~codecodiscordbot (no exposed token)
@earnest phoenix MessageEmbed cache.get/find user.addRole => user.roles.add stuff like that
since websites don't need to be 24/7
time to rent a Root Server and make a Free Discord Bot hosting Company. Just give them super small Docker Container with like 0.25 CPU and 250MB ram and 2GB Storage
just tell your friend to keep his computer up 24/7 to ping it . Thanks to my friend for doing thtat with my bot
I wish mine did
just tell your friend to keep his computer up 24/7 to ping it . Thanks to my friend for doing thtat with my bot
wouldn't it be easier and better to just host the bot on his pc then?
wouldn't it be easier and better to just host the bot on his pc then?
@lyric mountain no /s needed, it would be
lmaooo
there is a reason if you have bad internet
@misty sigil that's because idk if he's being sarcastic or not
so you can ping a server with better bandwith
dude, even a smoke-signal internet would be better than glitch
my internet is to slow to start my larger bot

can i get some help
only if you ask it
larger bots wouldn't even be on glitch anyway
@lyric mountain mee6 is on 365k glitch accounts
i did
does storage affect the performance?
yes
i think i could get my bot running there. it uses about 80MB ram but my issue is that i cant send all required files fast enought
if you use Json DB you loose a lot of performance
i did
@distant jewel you asked to ask, didn't asked the question itself
webhook_path='/dblwebhook', webhook_auth='x', webhook_port=5000 im trying to setup the webhook thing but i cant seem to get it working, this is what I have rn
my bot uses 40mb
My bot uses 100mb at most
webhook_path='/dblwebhook', webhook_auth='x', webhook_port=5000im trying to setup the webhook thing but i cant seem to get it working, this is what I have rn
@distant jewel is port 5000 open?
that’s api
how do I check
ram usage depends on what your bot does and how many servers it's in, so just saying how much ram yours uses doesn't make much sense lol
are you using nginx?
whats that?
supwhoneedshelp
mine?
ok, I'll consider you're not
its only a private bot which is in 6 servers lmao
try accessing your webhook path in the browser like http://YOUR_IP:port
if it gives bad gateway error then the port is blocked
Mine is using 54mb, 7 servers
or try using this https://apitester.com/
Do you know how your APIs are performing? Check your first and third party APIs for functionality and performance with our free and easy-to-use API tester.
i get refused to connect. @lyric mountain
if ur using localhost and u dont wanna change ur internet stuff & ur using vsc, just use the rest client extension
its pretty cool
umm does .addField() no longer work in MessageEmbed() unlike RichEmbed() of v11???
method url
Use postman for testing
Mine is using 54mb, 7 servers
@strange trout what how? mine uses 40mb on 41 servers
@earnest phoenix it still does
it gives an error now
A lot of stuff is cached
Bruh
oops
Besides discord.js stuff
it was the help embed that included my support server's invite
oh
const helpembed = new Discord.MessageEmbed()
.setTitle("THE COMMANDS")
.addField(
"The prefix is C! and only the prefix is case sensitive",
"btw you can't change the prefix"
)
.addField(
"🤣FUN🤣",
"random <help> ,rps ,kill ,thank ,rick_roll ,dog ,8ball ,doge ,dog ,puppy ,pup ,doggo ,cat ,kitten ,kitty ,cah <help> ,cube_scramble ,scramble ,cubescramble ,someone ,hack"
)
.addField(
"🎲GAMBLING🎲",
"slots ,roulette ,hi_lo ,blackjack, flip ,coinflip ,dice"
)
.addField(
"💻UTILITY💻",
"online ,ping ,sourcecode ,announcements ,donate ,support ,advertise ,advert ,ad"
)
.addField("💰ECONOMY💰 (beta)","balance ,bal ,beg ,fish ,scout ,search ,pm ,post_meme ,postmeme")
.addField(
"For more help on commands visit the #support channel of NOPE",
"now yeet me out of the window"
);
that's the embed
the error?
out of 9 other embeds that give same errrrrrrrorrrrrs
omg
.flat(2)
^
TypeError: fields.flat is not a function```
d
wtf
lmao
P.S. check my source on glitch.com/~codecodiscordbot if you need more info for the thingy that's causing the eeeeerrrrrrrorrrrrs
@earnest phoenix What version node js?
14.5.0
Weird
I expected it the be before v12
As nodejs didn't have the ArrayPrototype.flat function before 12.0.0
maybe glitch is gliched
do node -v in terminal just to be sure
Dude
two people stalking me wtf
Do node -v
Yeah me
In your terminal

Is 14.5.0 even out?
bruh
Yes
glitch is literally glitch
@earnest phoenix We can't help u without code
10.0
Yeah
DiscordJS requires a minimum of nodejs v12
glitch said that 14.5.0 is out
Oh cool didn't know it was out
idk
Yeah lol
SMH
I'm assuming it makes terminal text colorful
Can I see lol
ah
what is the highest node version for ubuntu server hosting? the same os glitch uses
Idk
idk smh 14.5.0 is out but doesn't work
14.5
LINUX SUXXXXXXXXXX
ok
As the newer ones tend to be more unstable
bro
lol its extremly easy to install on linux
just do server${client.guilds.cache.size > 1 ? 's' : ''}
need a refresher what does the ? operater in javascript do
Ternary op
it's a ternary op: condition ? do : else
if true ? <do this> : <other wise do this>
yes
smol
You just can't execute alot of code
yeah, ternaries are one-liners
This is what mine logs
downloading node....
Why are u sharding with only 2 servers?
why so many anonymous looking at my code im popular 😎
wot
we're searching for code leaks
Test bot
errrrrrrrorrrrrrrs
bruh message is over 2000 characters```
need to work with chalk in the future
imma put a screenshot instead
use hastebin
just use https://hastebin.com dude
throw err;
^
Error: Could not locate the bindings file```
what is even the bindings file?
npm i bindings ig
and i was reinstalling node and i can't access anything else than my own files on glitch
can I use another font/color scheme for VSC? if Yes how?
can someone help me with my code its coming grey
file > Preferences > Color Theme
tanks
I use One Dark Pro and JetBrains Mono for my font
I switch it up regularly
cannot find module discord.js WTF
internal/modules/cjs/loader.js:613
throw err;
^
Error: Cannot find module 'discord.js'
colors babe
https://hastebin.com/runixaqeba.js my rock paper scissors is coming grey pls help
love pc discord
it is not grey...
@cinder patio could u help me
i can see it colored
Night Hyper, why are you using module.exports if you don't have a command handler and are just using switch statements?
It looks like you have copied code from two different places, this is what happens when you do something like that
AND THE BINDINGS FILE IS DEAD AGAIN
code913 npm i discord.js
Night HyperX always follow DRY: Don't repeat yourself (your rock paper scissor conditioning is too long). Also what do you mean it's coming grey. You can't even use it like that really.
His whole logic is messed up, seems like he's copied the RPS command from somewhere else and just put the whole thing inside a case statement
copy mine lol
Did you say your using glitch @earnest phoenix ?
Glitch is actively shutting down discord bots on their platform
case "rps":
case "rockpaperscissors":
message.reply("No spoonfeed figure out the code"):
It's greyed out because you have a break; statement before the rps code, which won't even run anyways, because you are declaring a function and not executing any code
Did you say your using glitch @earnest phoenix ?
Glitch is actively shutting down discord bots on their platform
@solemn latch
WHAT
THE
nvm
basically they're killing our dreeeeeeeams even though they use AWS and amazon don't care for our stuff
you can have your dream without using glitch
me has no credit card
Your parents don't have one either?
Feels bad man
WHY DOES THE CREATOR OF RECAPTCHA REQUIRE CREDIT CARD VERIFICATION
you can get a vps for 3 bucks a month
in case you go over the limit
Your parents don't have one either?
@cinder patio me doesn't want to touch their stuff
plus verification
Say it's for educational purposes
verification part is what i said...
Anyone knows how to do so the bit gives u a role when someone joins?
I mean, your bot runs on a server, servers are not free.
You'll be shutdown repeatedly over time.
Holdfizzt what library
Say it's for educational purposes
@cinder patio * mom who doesn't want to listen to anything and dad who has a psychopathy level of 80% intensifies *
I mean, your bot runs on a server, servers are not free.
You'll be shutdown repeatedly over time.
@solemn latch My is online 24/7
Holdfizzt what library
@sudden geyser send me link
wrong @
You'd be learning a bunch of stuff too like logging in remotely with ssh. And it'd probably get you to version control your projects as well
Can someone send me the library link?
Yeah but what library are you using
Should version control anyway
Yeah but what library are you using
@sudden geyser Noone so far
Highly doubt a lot of beginners (here) version control
How can you implement a server prference database so that each server can set their own prefix for example? Would I need to grab the server ID out of the message and send a request to the database every time a message comes in or is there a more convenient way?
bot is finally online but its not showing up with the status message. DOes bot.user.setPresence() not work in discord.js v12.2.0
How does that work. Did you write your own implementation of connecting to discord and all the mess or are you using a library
My discord.js is v12.2.0 @sudden geyser
okay then discord.js is the library
listen to the guildMemberAdd add event
yikes
DOnt say docks again
Yes docs
It's spelled docs
Kill me
From documentation
Cache the prefix in memory, if it changes set it in the db, and cache it again
learn how to navigate through them
Docs are important when programming, eventhough I don't really like the discordjs.org docs
listen to the
guildMemberAddadd event
@sudden geyser thx lol I alrdy fixed a event with that command
DOnt say docks again
@autumn aspen socks in spanish stands for "It is what it is" so says docks!!!
lol
lmao
Cache the prefix in memory, if it changes set it in the db, and cache it again
@solemn latch So when the bot starts it caches the entire db and only onchange it caches the entire db again?
docks of discord.js ships carrying user input and output
Ok brb gonna read docs ........................No care m8 :)................................
how can docks carry ships
Only recache the one that changes
@autumn aspen socks in spanish stands for "It is what it is" so says docks!!!
@earnest phoenix This is an English Discord server though
cst that's one method, or you could start off with an empty cache and start caching per-guild when you receive a message. really there are a million ways you can implement it.
Lol
^
Rekt it ur socks
To listen for people joining: https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-guildMemberAdd
To add roles: https://discord.js.org/#/docs/main/stable/class/GuildMemberRoleManager?scrollTo=add (member.roles.add("roleId or role object"))
Only recache the one that changes
@solemn latch How to do that? Sorry if I sound stupid but maybe is there an article for that? Haven't really worked with that
have fun
Or just don't cache at all
Set and get
Calling the db for every single message seems odd
Spoonfeed
hence you cache it
why doesn't bot.user.setPresence work in v12.2.0
Yes
Where can I paste this? member.roles.add("roleId or role object")
But how do I go about that? Is there maybe some guide on that? I have never worked with serverside applications that cache stuff, only frontend so serverside is a bit new to me
Dude
You write it
https://discord.js.org/#/docs/main/stable/class/ClientUser?scrollTo=setPresence it does you just need to know how to use it
Prefixes.get(guildid)
^ gives the object
Prefixes.set(guildid, prefixstuff)
When you want to code you shouldn't just copy & paste. That won't get you anywhere in the long term. You need to understand it.
Way tikettoolI find not
What
When you want to code you shouldn't just copy & paste. That won't get you anywhere in the long term. You need to understand it.
@steep cedar unless...
Oh so I just write it somewhere in index.js?
member.roles.add("roleId or role object"
Prefixes.get(guildid)
^ gives the objectPrefixes.set(guildid, prefixstuff)
@solemn latch Oh, okay so Prefixes is my db right?
member.roles.add("roleId or role object"
@autumn aspen You need to put that in a function, or in the case of discord.js in a client.on() method. Otherwise it will not fire.
yikes
