#development

1 messages · Page 1036 of 1

restive pebble
#

Lol

#

I do this

autumn aspen
#

Or do I have to put everything in index.js

restive pebble
#

It dosent matter since no one gonna check

autumn aspen
#

Guys listen

restive pebble
#

Dude there is something called classes

autumn aspen
#

yeah

restive pebble
#

And handeler

spare mirage
#

🤦‍♂️

autumn aspen
#

It dosent matter since no one gonna check
@restive pebble can I put everything in index.js?

restive pebble
#

Yes

#

U can

autumn aspen
#

COmmand handler

#

Thx

#

Bc I feel its easier

restive pebble
#

Yes

autumn aspen
#

To but it in index.js

#

Bc Im new

pseudo kite
#

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.

autumn aspen
#

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

#

???

restive pebble
#

Docs

pseudo kite
#

Are you using discord.js? (that's the only thing I have experience with atm)

autumn aspen
#

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

slender thistle
#

preferences

autumn aspen
#

Are you using discord.js? (that's the only thing I have experience with atm)
@pseudo kite Yes

hasty lotus
#

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```
spare mirage
#

@autumn aspen its all in the guide

autumn aspen
#

Oh

#

thx then

#

I need to learn

pseudo kite
#

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

autumn aspen
#

thx

earnest phoenix
restive pebble
#

Discordmjs commando

autumn aspen
#

Wanna see my bot atm?

#

Its good

restive pebble
#

Instead I use my own Command

autumn aspen
#

It got an presence and active

earnest phoenix
#

@autumn aspen the link i sent is good for starters

restive pebble
#

It's hard to set that commando thingy

autumn aspen
#

and some cool commands

#

@autumn aspen the link i sent is good for starters
@earnest phoenix yeah

restive pebble
#

Hello auric

earnest phoenix
#

hi boeing

pseudo kite
#

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.

autumn aspen
#

guys how can I slpit a message like this

Hey

cool?

#

In a respond command

hasty lotus
#

\n

autumn aspen
#

What?

restive pebble
#

it's js lol

autumn aspen
#

lol

bronze bramble
#

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

hasty lotus
#

if you make :

message.channel.send("Hello\nEveryone")```
autumn aspen
#

I have a JavaScripted bot

hasty lotus
#

it will send

#

hello
everyone

autumn aspen
#

Thx

restive pebble
#

.py out of my range sorry

#

I'm nub

bronze bramble
#

Dam

pure lion
#

Moo best esolang

autumn aspen
#

Brb u dont get it guys lol

#

I will show u

pure lion
#

We don-

bronze bramble
#

@pure lion what

slender thistle
#

@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?

restive pebble
#

Is there any nasa api wrappers in npm

pure lion
#

We Devs aren't magicians with magical mirrors, please send the full errors and command files

hasty lotus
#

anyone good at express and ejs ?

restive pebble
#

I am thinking to make one with ts

#

Becuz I'm bored

#

Only 8 functions

distant bramble
#

no luck

restive pebble
#

None

pure lion
#

Dam

restive pebble
#

404 lol

bronze bramble
#

I’d like to enable my mods to be able to reply with modmail, in dms @slender thistle

restive pebble
#

So imma make then

autumn aspen
#

GUys how do I make a welcomer

#

My bot welcomes a person

distant bramble
#

just get the member join

autumn aspen
#

when he she joins

bronze bramble
distant bramble
#

and send a message to system channel wit or without cnvas

autumn aspen
#

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

slender thistle
#

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

autumn aspen
#

Me to

pure lion
#

@autumn aspen make a command that adds a role when someone runs it

autumn aspen
#

Oh ok

pure lion
#

And .on guildmemberadd

autumn aspen
#

@autumn aspen make a command that adds a role when someone runs it
@pure lion Oh I want it

pure lion
#

For welcome shit

autumn aspen
#

I rlly want that command

pure lion
#

That's verify

autumn aspen
#

when someone join it gives that role

#

yeah

pure lion
#

Oh

autumn aspen
#

u knwo EvilPauze bot?

pure lion
#

Ex

#

Ez

#

No I don't

autumn aspen
#

Its made by Alx smth

#

Alex

#

aaah I want a rlly good verify system

pure lion
#

It's not hard

bronze bramble
#

@slender thistle hrmmm I’ll see what I can figure out

autumn aspen
#

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

spare mirage
#

:/

pure lion
#

Start yourself off by reading the docs, and then I'll help when you get stuck

hasty lotus
#

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 ?

pure lion
#

I wish I knew ejs in any case

hasty lotus
#

ok... D:

spare mirage
#

b. If you are a beginner, have a will to learn and do not expect to be spoon-fed.

autumn aspen
#

ok

hasty lotus
#

@spare mirage ??

restive pebble
#

I don't lile website type things

#

So I won't learn those

autumn aspen
#

I wish I knew ejs in any case
@pure lion How do I do a perms of what roles can use my bot?

pure lion
#

@spare mirage are you high?

spare mirage
#

always

autumn aspen
#

lol

restive pebble
#

docs

pure lion
#

Jajajajajajajajjajaajajajjajajajajajajajajajajaja

#

Yes docs

#

Please

restive pebble
#

HasPermission

#

Search ot

autumn aspen
#

send me the link

#

YT

spare mirage
#

??/

#

DOCS

#

IS NOT YOUTUBE

pure lion
spare mirage
#

its called reading

#

with ur eyes

restive pebble
hasty lotus
pure lion
#

Ik

restive pebble
#

Nice link tho

pure lion
hasty lotus
#

uh ok

#

xD

restive pebble
#

404

#

Lol

autumn aspen
#

I know that u gonna put this ` instead of this ' but it says its a wrong command an error why?

restive pebble
#

12?

spare mirage
#

mesage

restive pebble
#

It has caching

spare mirage
#

.channel

#

.send

#

.:/

pure lion
#

Cachechachevavhedhqjhd

restive pebble
#

He defined channel brih

pure lion
#

@spare mirage sotp

autumn aspen
#

lol

#

help

spare mirage
#

bruh

restive pebble
#

Cache.find

spare mirage
#

what

#

u stop

#

ok

#

deal

pure lion
#

...ok anyway

spare mirage
#

whatever

slender thistle
#

let me bring my telescope to see what that code is

autumn aspen
earnest phoenix
#

shittestdev lol

pure lion
#

I can't see there's like 16 pixels

autumn aspen
#

Juts click on it

#

lmao

slender thistle
#

What is member in there

earnest phoenix
#

channel.send wtf

#

message.channel.send korrekt one

tight plinth
#

make sure member exists

autumn aspen
#

lmao

tight plinth
#

also show error

restive pebble
#

How u defined channel

pure lion
#

@earnest phoenix channel is defined as a channel

tight plinth
#

@earnest phoenix no

slender thistle
#

message.channel.send
Pay closer attention

#

please

#

they are finding a channel

autumn aspen
#

Aight

restive pebble
#

Yea btuh

autumn aspen
#

channel.send 🤡

pure lion
#

Buttuh

delicate drift
#

how add my bot is how many server?

earnest phoenix
#

member.guild.channels isn't it supposed to be message.guild.channels

restive pebble
#

cache.find

slender thistle
#

not where message doesn't exist

autumn aspen
#

member.guild.channels isn't it supposed to be message.guild.channels
@earnest phoenix what is it then?

earnest phoenix
#

how add my bot is how many server?
@delicate drift what are you trying to say

tight plinth
#

@earnest phoenix member.guild.channels works too smh

slender thistle
#

aka an event where a member joined/left

pure lion
#

Gets the member info

earnest phoenix
#

@earnest phoenix what is it then?
@autumn aspen literally what i said

slender thistle
#

Why does this channel get so fucked when there's multiple people trying to help

earnest phoenix
#

idk

autumn aspen
#

lol

earnest phoenix
#

smh

slender thistle
#

@autumn aspen Show the full event code

autumn aspen
#

Bc the victim dont have a brain

earnest phoenix
#

let me type it all out

autumn aspen
#

@autumn aspen Show the full event code
@slender thistle w8

tight plinth
#

@earnest phoenix no, it's channel.send
@autumn aspen show the error so we can help you

autumn aspen
#

Its not an error its like when someone join its come an error

restive pebble
#

Member.guild.cache.find

earnest phoenix
#

const channel = message.guild.channel.find /*/should be korrekt/*/

autumn aspen
#

I will check

spare mirage
#

how do I make a good ELMO protection

tight plinth
#

its comes an error?

#

wdym

restive pebble
#

Member.guild.channnels.cache.find

slender thistle
#

const channel = message.guild.channel.find /*/should be korrekt/*/
@earnest phoenix You made a mistake yourself

tight plinth
#

@earnest phoenix thats literally what he did smh

spare mirage
#

You said a bad word

slender thistle
#

also yes

restive pebble
#

Member.guild.channnels.cache.find
@restive pebble

#

Bruh

autumn aspen
#

@restive pebble
@restive pebble IM CONFUES IS IT THAT ONE?

#

oops caps

earnest phoenix
#

Probably not

restive pebble
#

Ok bai

autumn aspen
#

bai

earnest phoenix
#

message.guild.channels.find should work

autumn aspen
#

thx

restive pebble
#

It is v12?

spare mirage
#

how do I make a good ELMO protection
@spare mirage anyone know/

earnest phoenix
#

because member is not defined as anything and message.member is a property of message

#

can you show your logs? @autumn aspen

pure lion
hasty lotus
#

is there any web developper ? (express + ejs)

pure lion
#

i need to learn frontend lolololol

slender thistle
#

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

pure lion
#

If (event == members) { message = null }

autumn aspen
slender thistle
#

why did you remove the channel.send

autumn aspen
#

Im not

#

I coding

#

still

#

not done

slender thistle
#

... you had it before

autumn aspen
#

or wdym?

slender thistle
#

the welcome to server crap you had

autumn aspen
#

Oh Im coding it

woven sundial
#
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?
earnest phoenix
#

I keep getting leak detections? Ignore them?

autumn aspen
#

Lmao chillax

earnest phoenix
#

Want's me to use emitter.setMaxListeners()

slender thistle
#

stop using multiple events for the same stuff

#

use one and handle everything in it

hasty lotus
#

@woven sundial what version of djs are you using ?

autumn aspen
slender thistle
#

for example

bot.on("message", message => /* ALL OF MY STUFF HANDLED WITH IF-STATEMENTS */)```
woven sundial
#

DJS 11.5.1 @hasty lotus

hasty lotus
#

ok

autumn aspen
hasty lotus
#

why don't you just use bot.guilds.size ?

slender thistle
#

you don't really need to repost the same screenshot multiple times

autumn aspen
#

srry

woven sundial
#

why are you asking questions that aren't concerning my issue?

autumn aspen
#

But is it right so far?

pure lion
#

Why don't you

hasty lotus
#

they are

autumn aspen
#

Thx

pure lion
woven sundial
#

nah tey aren't

autumn aspen
#

Lmao

hasty lotus
#

@autumn aspen same question, what version of djs ?

slender thistle
#

Thx
@autumn aspen They weren't replying to you

autumn aspen
#

Oh

woven sundial
#

bot.guilds.size return "0" that isn't normal

hasty lotus
#

if you are using v 12 you should use guild.channels.cache.find

pure lion
#

I feel like there should be a Luca command for tias

autumn aspen
#

@autumn aspen same question, what version of djs ?
@hasty lotus How can I check?

hasty lotus
#

update to djs v12

pure lion
#

@autumn aspen check your package.json

hasty lotus
#

yep

autumn aspen
#

ok

slender thistle
#

bot.guilds.size return "0" that isn't normal
it's normal if the client hasn't connected yet

autumn aspen
#

Guys it is v.12.2.0

hasty lotus
#

and maybe at least update to last version of v11 (11.6.4)

quartz kindle
#

@woven sundial its normal to be size 0 because you do it before logging in

hasty lotus
#

Guys it is v.12.2.0
@autumn aspen then use guild.channels.cache.find()

woven sundial
#

ok I'm stupid smh

autumn aspen
#

thx

pure lion
#

@woven sundial no, nobody's stupid. You just gotta keep observing and learning till you get it, until then you're a student

autumn aspen
hasty lotus
#

yep

woven sundial
#
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
autumn aspen
#

thx

hasty lotus
#

@woven sundial try after the ready event of your bot

autumn aspen
#

@woven sundial try after the ready event of your bot
@hasty lotus is message.channel.send

#

or what?

hasty lotus
#

?

autumn aspen
#

is it message.send.channel

woven sundial
#

I don't think that the bot.ready influence that

hasty lotus
#

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 ??!

pure lion
#

It may not have access to caches and shit

autumn aspen
#

@autumn aspen what are you talking about ??!
@hasty lotus w8

slender thistle
#

I don't think that the bot.ready influence that
use the ready event because that's when all the cache is ready

hasty lotus
#
    .blog_card:hover {
     background-color: rgba(0, 0, 0, 0.6);
    }``` anyone know why it goes white on hover?

@low orbit is that css ?

woven sundial
#

oh well

hasty lotus
#

but he's on v11

pure lion
#

Why not use hex codes

#

Or just 'black'

slender thistle
#

opacity? 👀

hasty lotus
#

try an other rgba code

slender thistle
#

Are you sure that rule isn't being overwritten by something else?

hasty lotus
#

like 0.1, 0.1, 0.1, 0.6

#

to see if it's different

#

or if it stays white

autumn aspen
hasty lotus
#

pls

#

don't make screenshots

#

send your code

autumn aspen
#

How

hasty lotus
#

i don't see the end of the 16 ligne

#

so i don't know

#

How
@autumn aspen copy paste

#

¯_(ツ)_/¯

autumn aspen
#

Ok

earnest phoenix
#

who is ok with helping me test my bot

hasty lotus
#

@earnest phoenix no one

earnest phoenix
#

oof

autumn aspen
#
 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

hasty lotus
#

sry

#

not really good in english

#

but this channel

#

it's not testing

#

it's developing

#

what have you before ?

earnest phoenix
#

im making my bot and i want to test welcome message

autumn aspen
#

Me?

hasty lotus
#

yep

earnest phoenix
#

i need someone to join my server

autumn aspen
#

im making my bot and i want to test welcome message
@earnest phoenix Literally above u

earnest phoenix
#

jsut for 1 secong

hasty lotus
#

the error doesn't look to be at the end of the code

autumn aspen
#

jsut for 1 secong
@earnest phoenix I can'

earnest phoenix
#

i will dm the invite link

hasty lotus
#

so maybe at the top

#

i need someone to join my server
@earnest phoenix well, not me

slender thistle
#

Use another account

hasty lotus
#

but double accounts are forbidden :/

slender thistle
#

They are not

woven sundial
#
bot.on("ready", function() {
  console.log("hello, I'm online");
});```
Console doesn't returns anything
hasty lotus
#

@woven sundial use an arrow function

woven sundial
#

arrow function?

hasty lotus
#

=>

slender thistle
#

what's the difference honestly

hasty lotus
#
bot.on("ready", () => {
//your code here
})```
quartz kindle
#

in this case, no difference

ebon kelp
#

what's the difference honestly
@slender thistle there is no difference

woven sundial
#

It didn't fix anything

#

Cause as Shivaco said "what's the difference honestly"

quartz kindle
#

do this

#

bot.on("debug",console.log)

woven sundial
#

outside the ready function ?

hasty lotus
#

yes i guess

ebon kelp
#

@hasty lotus
Function() {}
Is the same as
() => {}

hasty lotus
#

mh ok

ebon kelp
#

But easier to write

woven sundial
quartz kindle
#

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

ebon kelp
#

An arrow function cannot be called, thats it

distant jewel
#
    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

slender thistle
#

tried print yet?

distant jewel
#

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

slender thistle
#

on_dbl_test 😎

distant jewel
#

ah

#

thanks

woven sundial
quartz kindle
#

what about bot.login(token).catch(console.log)

distant jewel
#

how do I use on_dbl_test, i dont get it

woven sundial
#

nothing too

slender thistle
#

it's an event that's fired when you press the Test button on top.gg

quartz kindle
#

show your full code again

ebon kelp
#

Is that express @woven sundial

woven sundial
#

I sent you the whole code in DM Tim

spare mirage
#

hmm how do I makea a slowmode?

#

with discordjs

distant jewel
#

@slender thistle ohh thanks

quartz kindle
#

@woven sundial the login process is getting stuck somewere, possibly because your discord.js is outdated

woven sundial
#

so I should just update to 12?

lusty quest
#

until october you should

quartz kindle
#

yes

#

v11 will stop working altogether in october

woven sundial
#

kay

wicked pivot
#

how can i start something in node js? example start test.txt and the text document opens on my pc

spare mirage
#

How can I set slowmode.. I cant find anything in the docs

lusty quest
#

can also recommend using d.js-light its not as agressive with caching as normal v12

slender thistle
#

channel.edit?

spare mirage
#

ahh ok

quartz kindle
#

@wicked pivot look into node's child_process functions

slender thistle
#

blind guess wasn't correct

spare mirage
#

@earnest phoenix u talking to me?

#

so

pure lion
#

You put a number in the brackets

spare mirage
#

channel.edit.setRateLimitPerUser("5");

pure lion
#

No

lusty quest
#

not as a string

slender thistle
#

remove the .edit

spare mirage
#

ok

#

I see

#

thanks

pure lion
#

<channel object>.srlpu(number)

slender thistle
pure lion
#

👁️

spare mirage
#

do u need a reason

pure lion
#

Na

distant jewel
#

i cant seem to find the test button

#

on my bots page

slender thistle
#

Edit page, sorry

lusty quest
#

or API page

distant jewel
#

oh alright

slender thistle
#

where you entered webhook URL and authorization key

distant jewel
#

alright, thanks

#

you know i still want my thumbs up...

slender thistle
distant jewel
#

:)

#

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

slender thistle
#

oh wait

#

uhhhh you forgot webhook kwargs in DBLClient

proper skiff
#

hey where is a good place to find a pfp for a bot

modest maple
#

you make one 🎉

#

be original™️

proper skiff
#

fax

granite nexus
#

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);
    }
});
proper skiff
#

lmao

modest maple
#

rather than plagiarising someone else's content

autumn aspen
#

'

proper skiff
#

tru

#

e

distant jewel
#

@slender thistle whats that

#

nvm found it

slender thistle
#

mhm

autumn aspen
#
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?

lusty quest
#

this is discord.js V12

autumn aspen
#

I have v12.2.0

lusty quest
#

it looks fine. it should work have you tried it?

autumn aspen
#

@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

slender thistle
#

Alright

#

Where's that

#

which event

autumn aspen
#

The below

#

channel.send(Welcome to our bot support server, ${member}, please read the rules in the rules channel before starting to chat.)
});

slender thistle
#

What's the rest

autumn aspen
#

Thats the whole command

slender thistle
#

it's not a command

#

what's the stuff above the const channel = ...

autumn aspen
#

lemme check

proper skiff
#

is there any other popular ways to get ur discord bot out there

slender thistle
#

????????

autumn aspen
#

idts

#

????????
@slender thistle Thats not it

#

its just the top

slender thistle
#

That's wrong on many levels

proper skiff
#

want me to rephrase

autumn aspen
#

How?

#

Put it in a guildMemberAdd event
@earnest phoenix How?

#

Bro u are here to learn what am I doing wrong?'

slender thistle
#

bot.on("guildMemberAdd", member => your code here)

autumn aspen
#

That sound wrong

slender thistle
#

We are here to help, not teach

autumn aspen
#

yup

granite nexus
#
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

slender thistle
#

a bit of spoonfeed but yeah

autumn aspen
#

thx

distant jewel
#

should i make a webhook for my guild and pass that in as a kwarg?

slender thistle
#

eeeeeee no

distant jewel
#

wot then

spare mirage
#

hmm

slender thistle
#

Those kwargs are parameters for an aiohttp.web to run on

#

aka a physical server running on your machine

distant jewel
#

im lost

slender thistle
#

Discord webhooks are "servers" waiting for requests

distant jewel
#

yes

slender thistle
#

and when they do receive one, they post messages

distant jewel
#

yes

slender thistle
#

that's what a webhook is. It's a server waiting for requests and handling them

spare mirage
#
message.channel.setRateLimitPetUser(modeslowamp).then(message.channel.send(`Slowmode is now ${modeslowamp}`));```
#

why is this not working?

strange trout
#

Typo

#

setRateLimitPetUser

#

Pet

spare mirage
#

oofo

distant jewel
#

ok but what do i pass in for the kwarg

slender thistle
#

which one exactly?

#

There's 3 kwargs for webhooks :^)

autumn aspen
#

Thx it worked

distant jewel
#

webhook_path

slender thistle
#

it's the thing right after ip:port in the webhook URL

autumn aspen
#

Can someone test join?

#

my server and leave

slender thistle
#

-helptest

gilded plankBOT
#

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.

proper skiff
#

sire

strange trout
#

use an alt

proper skiff
#

ill join

slender thistle
#

ip being your public IP address and port being whatever you set as webhook_port

distant jewel
#

it's the thing right after ip:port in the webhook URL
@slender thistle
what webhook url

slender thistle
#

basically a link that will point to your webhook

distant jewel
#

ok but where do i get that

slender thistle
#

You create it yourself assembling all the stuff together
http://ip:port<webhook_path>

distant jewel
#

ok and the ip will be the ip for my server or the machine im running on?

lusty quest
#

yes

distant jewel
#

alright thanks

spare mirage
#

how can I check how many files I have in a folder?

earnest phoenix
#

who can help me crate bots with code

#

right now i use apps

lusty quest
#

you can use fs then get the size of the array

spare mirage
#

@earnest phoenix the docs can

earnest phoenix
#

who is the docs_

#

?

strange trout
#

We won't give you code but we can lead you in the right direction

earnest phoenix
#

who its the docs?

spare mirage
#

how do I get an array size @lusty quest ?

strange trout
#

Google it

spare mirage
#

okoko

distant jewel
#

what port should i be using

autumn aspen
#

@slender thistle its still dont welcome a person?

lusty quest
#

did you get an error?

earnest phoenix
#

who is the docs

lusty quest
#

what language did you want to use?

autumn aspen
#

did you get an error?
@lusty quest no

#

English

lusty quest
#

not you @autumn aspen

autumn aspen
#

oh

lusty quest
#

is the event correct?

autumn aspen
#

Super can u help me

strange trout
#

Show us your code

autumn aspen
#

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

spare mirage
#

?

#

umm

strange trout
#

Spoon feeding epic

spare mirage
#

I tried

autumn aspen
#

lol

spare mirage
#

I know its nobt dynamic

#

dont be mad

#

Be sad

strange trout
#

fs.lenght

lusty quest
#

you have a command handler right?

spare mirage
#

yes

lusty quest
#

did it adds every command to a collection?

spare mirage
#

ans yes

lusty quest
#

then just use the collection for getting a dynamic help command

spare mirage
#

I dont want it to be dynamic

#

lol

lusty quest
#

ok

strange trout
#

You can get the amount of commands by using the collection

lusty quest
#

also this ^

spare mirage
#

brb

autumn aspen
#

Lmao guys my bad my command does run now!

strange trout
spare mirage
#

wasda

#

?

strange trout
#

Collection extends Map so you can use the size property to check how much items is in it

spare mirage
#

ahh

strange trout
#

Yup

spare mirage
#

so I can Map(MAPNAME).size

strange trout
#

No

#

You'd just do it on your commands collection

spare mirage
#

?

strange trout
distant jewel
#
webhook_path='ip:port/dblwebhook', webhook_auth='pass', webhook_port=port

but the test event still is not firing

spare mirage
#

ahhhh

strange trout
#

Is commands attached to your bot? Like bot.commands

spare mirage
#

yes.. I changed the const name though

strange trout
#

Let me see how it looks

spare mirage
#

what does util mean?

strange trout
#

Utility Class attached to my client. You don't really need to worry about it

#

It's just something I have

spare mirage
strange trout
#

No no

spare mirage
#

umm

strange trout
#

Where do you set your commands

earnest phoenix
#

how to create a channel with specific role perms and save its ID?

strange trout
#

Add them to the collection

spare mirage
#

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);
}```
strange trout
#

Yes

#

bot.commands

calm saddle
#

how to create a channel with specific role perms and save its ID?
@earnest phoenix all of those are in the docs

strange trout
#

It's attached to your bot so you can do bot.commands.size

earnest phoenix
#

docs make my mind struggle 😂

strange trout
#

Like that

calm saddle
spare mirage
#

ahh

calm saddle
#

hah light mode

earnest phoenix
#

ame too

#

light

#

mode

#

babes

calm saddle
#

imma call 911

earnest phoenix
#

hahahha

#

you can't catch me

calm saddle
#

im burning yall ;-;

cinder patio
earnest phoenix
#

i use opera browser VPN HHEHEHHEH

spare mirage
#

thanks @strange trout

calm saddle
#

somebody burn this man ;-;

restive pebble
#

why lol

slender thistle
#
webhook_path='ip:port/dblwebhook', webhook_auth='pass', webhook_port=port

but the test event still is not firing
@distant jewel webhook_path is what comes after ip:port in the actual URL

strange trout
spare mirage
#

stfu

#

light mode is gea

slender thistle
#

so webhook_path='/dblwebhook' would be http://ip:port/dblwebhook

lusty quest
#

poor users that have a HDR 1000 Monitor and use Darkmode

spare mirage
#

lol

earnest phoenix
#
  • visible struggle to understand the given links *
strange trout
#

Learn how to ready docs

#

It'll be very useful

spare mirage
#

I know how

earnest phoenix
#
  • and being able to type with asterisks without making it change style *
spare mirage
#

You have eyes

#

and you have school

calm saddle
#

does glitch not support uptime anymore??

earnest phoenix
#

no

#

no for everyone

spare mirage
#

u went to school to learn to read with ur eyes

lusty quest
#

nope they kick these intances

earnest phoenix
#

nope

strange trout
#

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

spare mirage
#

I know I know

#

what docs are best to use discordjs.guide?

earnest phoenix
#

that's what i was trying to say

#

that peeps here are better than docs

spare mirage
#

uhhum
Tim

earnest phoenix
#

gonna update mah code form v11 to v12.2.0

spare mirage
#

:3

lusty quest
#

its understandable but its annoying if you have to explain stuff that is written on a website

calm saddle
#

. - .

lusty quest
#

in a way that is easy to understand

digital ibex
#

djs guide isn't a documentation, its a guide

spare mirage
#

@digital ibex :/ almost the same

distant jewel
#

webhook_path='/dblwebhook', webhook_auth='x', webhook_port=5000 like this?

lusty quest
#

not really

strange trout
#

Very different

spare mirage
#

almost everything is DOCUMENTED there

#

lol

lusty quest
#
calm saddle
#

djs guide isn't a documentation, its a guide
@digital ibex you werent suppose to say that

lusty quest
#

compare this to the guide

spare mirage
#

imma use that from now

strange trout
#

No, the guide just has code that people can copy and paste

earnest phoenix
#

nope peeps here are the best of the best

strange trout
#

That's why people think it's better

earnest phoenix
#

yes

#
  • nope i dont want spoonfeed *
calm saddle
#

i just help out cause i wanna socialize

earnest phoenix
#

visible liar

calm saddle
#

;-; no u

spare mirage
#

||thats what she said||

strange trout
#

I'm just here because I don't know what else to do on my bot

earnest phoenix
#

does npm automatically detect changes to package.json and reinstall or do i need torun it again?

strange trout
#

Besides the stuff on my Trello

lusty quest
#

calculate gogol with your bot @strange trout

spare mirage
#

Alexis make a dashboard

strange trout
#

I have one

spare mirage
#

:OOOOOOOOOOOOOOOOO

strange trout
#

It ain't pretty though

spare mirage
#

Leak ur token for 200usd

strange trout
#

Switching to Vue.js once my bot is actually done

spare mirage
#

thats good fun

digital ibex
#

I gave up on vue

strange trout
#

Current one uses pug

spare mirage
#

Alexis the one thing u can do is make ur bot bigger than MEE6#0001

earnest phoenix
#

mee6 sucks

#

level up messages are spammy

spare mirage
#

BIGGER

#

not better

#

lol

strange trout
#

Eh, don't really care how many servers my bot is in

earnest phoenix
#

i'm also gonna add a level up system but it will DM users

spare mirage
#

cuz it already is better

digital ibex
#

its surely not that bad if loads of people invited it shrug

earnest phoenix
#

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

lusty quest
#

@spare mirage have you any idea of the scale the bot has hardware side?

strange trout
#

Or disable completely

spare mirage
#

@lusty quest u mean mee6

calm saddle
#

halp uptime not working it sends code 403 im using gitch to code

spare mirage
#

its fkn huge

earnest phoenix
#

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)

lusty quest
#

they have hardware that others use to start a small VPS hosting company

misty sigil
#

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

cinder patio
#

you have to pay for 24/7 hosting

lyric mountain
#

and glitch is banning accounts of people who do try to make 24/7 bots there using pingers

strange trout
#

@earnest phoenix no lol. look at the docs

digital ibex
#

I was gonna host my website there lol

lyric mountain
#

for websites it's fine ig

calm saddle
#

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

lyric mountain
#

since websites don't need to be 24/7

lusty quest
#

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

earnest phoenix
#

just tell your friend to keep his computer up 24/7 to ping it . Thanks to my friend for doing thtat with my bot

digital ibex
#

not for me

#

my website includes a websocket

#

and glitch isn't meant for websockets

misty sigil
#

I wish mine did

lyric mountain
#

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?

misty sigil
#

wouldn't it be easier and better to just host the bot on his pc then?
@lyric mountain no /s needed, it would be

digital ibex
#

lmaooo

lusty quest
#

there is a reason if you have bad internet

lyric mountain
#

@misty sigil that's because idk if he's being sarcastic or not

lusty quest
#

so you can ping a server with better bandwith

lyric mountain
#

dude, even a smoke-signal internet would be better than glitch

lusty quest
#

my internet is to slow to start my larger bot

misty sigil
lyric mountain
#

larger bots wouldn't even be on glitch anyway

#

¯_(ツ)_/¯

distant jewel
#

can i get some help

lyric mountain
#

only if you ask it

misty sigil
#

larger bots wouldn't even be on glitch anyway
@lyric mountain mee6 is on 365k glitch accounts

distant jewel
#

i did

digital ibex
#

does storage affect the performance?

lyric mountain
#

yes

lusty quest
#

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

lyric mountain
#

i did
@distant jewel you asked to ask, didn't asked the question itself

distant jewel
#

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

digital ibex
#

my bot uses 40mb

misty sigil
#

My bot uses 100mb at most

lyric mountain
#

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
@distant jewel is port 5000 open?

misty sigil
#

that’s api

distant jewel
#

how do I check

cinder patio
#

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

lyric mountain
#

are you using nginx?

distant jewel
#

whats that?

pure lion
#

supwhoneedshelp

digital ibex
#

mine?

lyric mountain
#

ok, I'll consider you're not

digital ibex
#

its only a private bot which is in 6 servers lmao

lyric mountain
#

try accessing your webhook path in the browser like http://YOUR_IP:port

#

if it gives bad gateway error then the port is blocked

strange trout
#

Mine is using 54mb, 7 servers

lyric mountain
#

or try using this https://apitester.com/

distant jewel
#

i get refused to connect. @lyric mountain

digital ibex
#

if ur using localhost and u dont wanna change ur internet stuff & ur using vsc, just use the rest client extension

#

its pretty cool

earnest phoenix
#

umm does .addField() no longer work in MessageEmbed() unlike RichEmbed() of v11???

digital ibex
#

method url

strange trout
#

Use postman for testing

misty sigil
#

Mine is using 54mb, 7 servers
@strange trout what how? mine uses 40mb on 41 servers

earnest phoenix
#

postman

#

wtf

lusty quest
#

@earnest phoenix it still does

earnest phoenix
#

it gives an error now

lusty quest
#

postman is a tool for accessing APIs

#

error message?

strange trout
#

A lot of stuff is cached

pure lion
#

Bruh

earnest phoenix
#

oops

strange trout
#

Besides discord.js stuff

earnest phoenix
#

it was the help embed that included my support server's invite

misty sigil
#

oh

earnest phoenix
#
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

lusty quest
#

the error?

earnest phoenix
#

out of 9 other embeds that give same errrrrrrrorrrrrs

lyric mountain
earnest phoenix
#
      .flat(2)
       ^
TypeError: fields.flat is not a function```
strange trout
#

Yeah but it's sweeped after a while

#

So it doesn't hurt too much

earnest phoenix
#

d

spare mirage
#

wtf

earnest phoenix
#

lmao

tulip ledge
#

@earnest phoenix What version node js?

earnest phoenix
#

14.5.0

tulip ledge
#

Weird

#

I expected it the be before v12

#

As nodejs didn't have the ArrayPrototype.flat function before 12.0.0

lusty quest
#

maybe glitch is gliched

cinder patio
#

do node -v in terminal just to be sure

tulip ledge
#

Are you sure

#

It's 14.5.0

earnest phoenix
tulip ledge
#

Dude

earnest phoenix
#

two people stalking me wtf

tulip ledge
#

Do node -v

strange trout
#

Yeah me

tulip ledge
#

In your terminal

strange trout
tulip ledge
#

Is 14.5.0 even out?

earnest phoenix
#

bruh

cinder patio
#

Yes

earnest phoenix
#

glitch is literally glitch

tulip ledge
#

@earnest phoenix We can't help u without code

earnest phoenix
#

10.0

tulip ledge
#

Yeah

lyric mountain
tulip ledge
#

DiscordJS requires a minimum of nodejs v12

earnest phoenix
#

glitch said that 14.5.0 is out

tulip ledge
#

Oh cool didn't know it was out

earnest phoenix
#

WTF

#

?

lyric mountain
#

just asking but...

#

what does .rainbow do?

earnest phoenix
#

idk

tulip ledge
#

Yeah lol

earnest phoenix
#

SMH

cinder patio
#

I'm assuming it makes terminal text colorful

strange trout
#

Can I see lol

lyric mountain
#

ah

tulip ledge
#

It works with chalk

earnest phoenix
#

what is the highest node version for ubuntu server hosting? the same os glitch uses

tulip ledge
#

Idk

earnest phoenix
#

idk smh 14.5.0 is out but doesn't work

lusty quest
#

14.5

earnest phoenix
#

LINUX SUXXXXXXXXXX

tulip ledge
#

But I'd suggest using the recommended version

earnest phoenix
#

ok

lyric mountain
tulip ledge
#

As the newer ones tend to be more unstable

lyric mountain
#

bro

lusty quest
#

lol its extremly easy to install on linux

lyric mountain
#

just do server${client.guilds.cache.size > 1 ? 's' : ''}

earnest phoenix
#

need a refresher what does the ? operater in javascript do

strange trout
#

Ternary op

lyric mountain
#

it's a ternary op: condition ? do : else

tulip ledge
#

if true ? <do this> : <other wise do this>

earnest phoenix
#

ok thx

#

basically a smol if() {} statement with less complexity

tulip ledge
#

yes

earnest phoenix
#

smol

tulip ledge
#

You just can't execute alot of code

lyric mountain
#

yeah, ternaries are one-liners

strange trout
earnest phoenix
#

downloading node....

tulip ledge
#

Why are u sharding with only 2 servers?

earnest phoenix
#

why so many anonymous looking at my code im popular 😎

sudden geyser
#

wot

lyric mountain
#

we're searching for code leaks

strange trout
#

Test bot

earnest phoenix
lusty quest
#

need to work with chalk in the future

earnest phoenix
#

imma put a screenshot instead

lusty quest
#

use hastebin

lyric mountain
earnest phoenix
#
  throw err;
  ^
Error: Could not locate the bindings file```
tulip ledge
#

Read the error

#

Doesn't exist

earnest phoenix
#

what is even the bindings file?

lyric mountain
#

npm i bindings ig

earnest phoenix
#

and i was reinstalling node and i can't access anything else than my own files on glitch

lyric mountain
#

start using github before something bad happens

spare mirage
#

can I use another font/color scheme for VSC? if Yes how?

earnest phoenix
#

can someone help me with my code its coming grey

cinder patio
#

file > Preferences > Color Theme

earnest phoenix
#

everything is a comment/string

#

oh

spare mirage
#

tanks

strange trout
#

I use One Dark Pro and JetBrains Mono for my font

cinder patio
#

I switch it up regularly

earnest phoenix
#

cannot find module discord.js WTF

#
internal/modules/cjs/loader.js:613
    throw err;
    ^
Error: Cannot find module 'discord.js'
#

colors babe

#

love pc discord

#

it is not grey...

#

@cinder patio could u help me

#

i can see it colored

cinder patio
#

Night Hyper, why are you using module.exports if you don't have a command handler and are just using switch statements?

earnest phoenix
#

so i just have to use if

#

can someone help why node can't find discord.js?

cinder patio
#

It looks like you have copied code from two different places, this is what happens when you do something like that

earnest phoenix
#

AND THE BINDINGS FILE IS DEAD AGAIN

cinder patio
#

code913 npm i discord.js

sudden geyser
#

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.

cinder patio
#

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

earnest phoenix
#

copy mine lol

solemn latch
#

Did you say your using glitch @earnest phoenix ?
Glitch is actively shutting down discord bots on their platform

earnest phoenix
#
case "rps":
case "rockpaperscissors":
message.reply("No spoonfeed figure out the code"):
cinder patio
#

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

earnest phoenix
#

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

sudden geyser
#

you can have your dream without using glitch

solemn latch
#

Google has that free year thing

#

🤔

earnest phoenix
#

me has no credit card

cinder patio
#

Your parents don't have one either?

solemn latch
#

Feels bad man

earnest phoenix
#

WHY DOES THE CREATOR OF RECAPTCHA REQUIRE CREDIT CARD VERIFICATION

cinder patio
#

you can get a vps for 3 bucks a month

sudden geyser
#

in case you go over the limit

earnest phoenix
#

Your parents don't have one either?
@cinder patio me doesn't want to touch their stuff

sudden geyser
#

plus verification

cinder patio
#

Say it's for educational purposes

earnest phoenix
#

verification part is what i said...

autumn aspen
#

Anyone knows how to do so the bit gives u a role when someone joins?

solemn latch
#

I mean, your bot runs on a server, servers are not free.
You'll be shutdown repeatedly over time.

sudden geyser
#

Holdfizzt what library

earnest phoenix
#

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 *

autumn aspen
#

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

sudden geyser
#

wrong @

strange trout
#

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

autumn aspen
#

Can someone send me the library link?

sudden geyser
#

Yeah but what library are you using

solemn latch
#

Should version control anyway

autumn aspen
#

Yeah but what library are you using
@sudden geyser Noone so far

strange trout
#

Highly doubt a lot of beginners (here) version control

steep cedar
#

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?

earnest phoenix
#

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

sudden geyser
#

How does that work. Did you write your own implementation of connecting to discord and all the mess or are you using a library

autumn aspen
#

My discord.js is v12.2.0 @sudden geyser

sudden geyser
#

okay then discord.js is the library

autumn aspen
#

yes

#

lol

#

Bruh!!!!1

sudden geyser
#

listen to the guildMemberAdd add event

steep cedar
#

yikes

autumn aspen
#

DOnt say docks again

strange trout
#

Yes docs

steep cedar
#

It's spelled docs

autumn aspen
#

Kill me

steep cedar
#

From documentation

solemn latch
#

Cache the prefix in memory, if it changes set it in the db, and cache it again

strange trout
#

learn how to navigate through them

steep cedar
#

Docs are important when programming, eventhough I don't really like the discordjs.org docs

autumn aspen
#

listen to the guildMemberAdd add event
@sudden geyser thx lol I alrdy fixed a event with that command

earnest phoenix
#

DOnt say docks again
@autumn aspen socks in spanish stands for "It is what it is" so says docks!!!

autumn aspen
#

lol

earnest phoenix
#

lmao

steep cedar
#

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?

earnest phoenix
#

docks of discord.js ships carrying user input and output

autumn aspen
#

Ok brb gonna read docs ........................No care m8 :)................................

earnest phoenix
#

how can docks carry ships

solemn latch
#

Only recache the one that changes

steep cedar
#

@autumn aspen socks in spanish stands for "It is what it is" so says docks!!!
@earnest phoenix This is an English Discord server though

sudden geyser
#

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.

autumn aspen
#

Lol

solemn latch
#

^

autumn aspen
#

Rekt it ur socks

cinder patio
#
steep cedar
#

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

cinder patio
#

have fun

strange trout
#

Or just don't cache at all

solemn latch
#

Set and get

steep cedar
#

Calling the db for every single message seems odd

autumn aspen
#

Spoonfeed

sudden geyser
#

hence you cache it

autumn aspen
#

lmao

#

thx

earnest phoenix
#

why doesn't bot.user.setPresence work in v12.2.0

steep cedar
#

Yes

earnest phoenix
#

Way tikettool

#

I find not

autumn aspen
#

Where can I paste this? member.roles.add("roleId or role object")

steep cedar
#

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

strange trout
#

You write it

amber fractal
solemn latch
#

Prefixes.get(guildid)
^ gives the object

Prefixes.set(guildid, prefixstuff)

earnest phoenix
#

Way tikettool

#

I find not

steep cedar
#

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.

earnest phoenix
#

Way tikettoolI find not

strange trout
#

What

earnest phoenix
#

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...

autumn aspen
#

Oh so I just write it somewhere in index.js?

#

member.roles.add("roleId or role object"

steep cedar
#

Prefixes.get(guildid)
^ gives the object

Prefixes.set(guildid, prefixstuff)
@solemn latch Oh, okay so Prefixes is my db right?

earnest phoenix
#

@fossil oxide

#

Way tikettool I find not

steep cedar
#

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.

sudden geyser
#

yikes