#development

1 messages ยท Page 1425 of 1

stark abyss
#

I am unsure what steps I am supposed to take next ๐Ÿค”

earnest phoenix
#

google your library and then add input sanitization onto it

stark abyss
#

hmm my library?

earnest phoenix
#

yes

stark abyss
#

djs?

earnest phoenix
#

the library you use to connect to postgres

stark abyss
#

oh

#

pg

coarse topaz
#

I don't understand pandasad

#

It's weird because it was working perfectly fine some weeks ago without this option being enabled

uncut river
#

someone @ me if they know how to change the buttons on my bot page with CSS

earnest phoenix
uncut river
#

and a quick guide for editing other elements, like i have the inspector menu, just what am i supposed to look at for editing

earnest phoenix
#

required

#

@uncut river the element classes

uncut river
#

so like just

p.bot-btnss {
 color etc blah blah?
}```
#

?

earnest phoenix
#

try it and see

#

but yes that should work

#

just selecting the classes and overwriting their properties

narrow marten
#

how do I change my bot's bg color

earnest phoenix
#

same answer i just gave above

coarse topaz
#

I see.. Thanks! Though I don't get how I'm supposed to include this new function in my code yet x)

earnest phoenix
#

the snippet lite gave in the message i linked are the client options you're supposed to use

#

the client options go into the client constructor

#

google might clear up your confusion

#

i would link you resources but im on mobile just typing is a pain in the ass

uncut river
#

preview doesn't seem to work though

narrow marten
#

uh any code snippet to make the background color black?

earnest phoenix
#

lol

stark abyss
#

so I think I understand it now, for discord bot use it doesn't seems like something super dangerous to worry about. Even so I am gonna go ahead and "santize?" thinkingLol it. I am looking at validator npm rn its kinda confusing on what I should use tho

earnest phoenix
#

you can lose all of your data

earnest phoenix
#

your users can leak it

prime glacier
#

how can i do that

stark abyss
#

well that's more dangerous then what I understood

earnest phoenix
#

by sql injection; they're injecting their own statements that can make your db go boom

stark abyss
#

ic

#

i def need one it seems liek

earnest phoenix
#

the first answer i found for pg input sanitization links to an SO thread and if you scroll down you can see how you can use prepared statements that automatically sanitize your input

stark abyss
#

alright i did search that and it wasall php and eventually i came to validator but ill look at that

coarse topaz
earnest phoenix
#

i think its SERVER_MEMBERS or something like that, again check the message i linked

#

it has a link to a valid list of intents you can use

#

you basically put intents you need in an array

stark abyss
#

@earnest phoenix Not very familiar with sql or psql or db at all, perhaps you could tell me some of the special characters that should be filtered?

limpid bear
#

i want the bot to do "variable%"

#

but i dont know how do get the variable and the % in the same message

lucid prawn
#

this did work

if(message.content.startsWith(prefix + "cutieness" )){
   if (message.channel.nsfw === true) return;
   else message.reply('Sorry this is not a nsfw channel!')

this did not work

   if (message.channel.nsfw === false) return;
    else message.reply("This is a Nsfw") 
                }

how do i fix it

stark abyss
opal plank
#

bruh

#

bloat 1010

stark abyss
opal plank
stark abyss
#

that one seems somewhat useful does it not?

opal plank
#

if(/@.*./.test(string)) return true;

#

but without installing a whole package bloating your code

lucid prawn
stark abyss
#

if(!message.channel.nsfw) return; maybe thinkLul

earnest phoenix
#

@stark abyss i dont understand why you need a third party lib when the one you're using is probably already capable of prepared statements and sanitization

stark abyss
#

oh

earnest phoenix
#

what is the exact name of the package you're using

#

just pg?

stark abyss
#

yeah

#

literally pg which is weird

earnest phoenix
#

see 'Parameterized queries'

stark abyss
#

ok

limpid bear
#

how do i put a variable and text in the same message

stark abyss
#

Ah I think I understand now

#

i am not sure what you mean but

let user = "idfk"
message.channel.send(` Welcome to this server ${user}`)```
#

Thanks cry, I think I understand how this works now. I should be able to find the right resources now. I am gonna sleep now lmao gn

lucid prawn
carmine chasm
stark widget
#

@lucid prawn what do u actually want to do?

#

do just want to check if the channel is nsfw?

lucid prawn
#

yes

#

and send a embed

#

@stark widget

stark widget
#

hmm

delicate shore
earnest phoenix
#

is it possible to install opus without root perms?

delicate shore
#

why not send attachment

#

pls help

stark widget
#

so u just need to check if the channel is nsfw, if it is, then u send an embed

#

and then u can put an else statement

south cedar
#

How do you get a bot to tack a % to the end of a number that varies based on user inputs

lucid prawn
#
if(message.content.startsWith(prefix + "fuck" )){
   if (message.channel.nsfw === true) return;
   else message.reply('Sorry this is not a nsfw channel!')
}
  else(!message.channel.nsfw) return
    else message.reply("This is a Nsfw") 

like this @stark widget

stark widget
#

no

earnest phoenix
#

is it possible to install opus without root perms?

twilit geode
#

links to how to collect top.gg votes with bot?

lucid prawn
#
if(message.content.startsWith(prefix + "call" )){
   if (message.channel.nsfw === true) return;
   else message.reply('Sorry this is not a nsfw channel!')
}
  if(!message.channel.nsfw) return
     if (message.channel.nsfw === false) return;
    else message.reply("This is a Nsfw")
stark widget
#

wait

#

u are doing smth totally wrong

south cedar
stark widget
#

rn u are checking if the message is prefix+fuck, then if it not, u are checking if the channel is not nsfw, and it is amess

lucid prawn
#

how do i fix it

#

@stark widget

stark widget
#

uhhh

#

just a sec

earnest phoenix
#

is it possible to install opus without root perms?

stark widget
#

ok, im back

earnest phoenix
#

@earnest phoenix dont think so

#

sad

limpid bear
earnest phoenix
#

Try install it ig

#

how?

#

Uhh idk

#

I never use linux before

twilit geode
#

links to how to collect top.gg votes with bot?

stark widget
#

@lucid prawn first of, check if the the message is prefix+ call, then in the {} brackets, u can do another check if the channel is nsfw or not

earnest phoenix
stark widget
#

@lucid prawn this is how if checks work:

if(condition){//do something with it
}

earnest phoenix
#

@twilit geode api reference

#

@stark widget the {} thing is called body

stark widget
#

oh

#

ok thanks

prime glacier
#

HOW CAN I DO IT PLEASE HELP

earnest phoenix
#

if () { //Statement
//Statement body
}

lucid prawn
stark widget
#

ah

earnest phoenix
#

@lucid prawn learn js.

#

Before coding, just learn how syntax work

#

And stuff

lucid prawn
#

i know js

stark widget
#

then why are u messing up

earnest phoenix
#

From the look of the code, no you dont.

lucid prawn
#

i just not did that before

stark widget
#

so u dont know js

earnest phoenix
#

Just learn how syntax work or the language work

stark widget
#

@lucid prawn learn atleast basic js

earnest phoenix
#

And you will know how to fix your code

stark widget
#

that would help

stark widget
lucid prawn
#

the command worked when it no nsfw
it did not work when i turn it on
@stark widget

earnest phoenix
#

@earnest phoenix do you know a way to get opus without root access?

#

Uhh

#

Idk how opus work

#

k

#

rip

#

Send the the opus doc, i will see what i can do

stark widget
#

@lucid prawn please learn js please

lucid prawn
#

nvm i will just make two different command for it thx

#

@stark widget

stark widget
#

ohk

earnest phoenix
#

@lucid prawn just take my word

#

Learn js.

#

Its better to learn the language and then watch tutorial after

opal plank
#

Bad

lucid prawn
opal plank
#

Dont watch tutorial

#

Read docs

earnest phoenix
#

No

#

Thats not what i mean erwin

opal plank
#

Bad

earnest phoenix
#

I mean learn js then watch tutorial about js not making a bot

opal plank
earnest phoenix
opal plank
#

W3 schools for begginers
Mozilla docs for intermediate
Actual node docs for advanced

lucid prawn
#

i fixed it and i will learn js bye @earnest phoenix

opal plank
#

Docs

drowsy epoch
#

Is here fine

earnest phoenix
#

ive just had a crazy idea

#

blazor WASM + react + recoil

drowsy epoch
#

@earnest phoenix is here fine?

earnest phoenix
#

c# code running alongside a react app with easy state management

#

Ye

drowsy epoch
#

ok

drowsy epoch
#
C:\Users\OneDrive\Documents\GitHub\DynamoBotReboot\index.js:6
const dbl = new DBL('the auth token is here', client);
                                                                                                                                                                                   ^       

ReferenceError: Cannot access 'client' before initialization
    at Object.<anonymous> (C:\Users\thoma\OneDrive\Documents\GitHub\DynamoBotReboot\index.js:6:180)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47```
earnest phoenix
#

well have you read the error

#

^

#

โ†‘

drowsy epoch
earnest phoenix
#

You read the error

#

And search google for solution

#

And read the code

#

And fix it

#

In a nutshell

drowsy epoch
#

Let me think

earnest phoenix
#

You didnt initilize the variable client

#

So your code should have smth like

#
const client;
// or
let client;
// or
var client;
drowsy epoch
#

ok

earnest phoenix
#

Thats where the error occur

#

You declare the variable but you didnt intilize it

drowsy epoch
earnest phoenix
#

Initilize it then

earnest phoenix
#

if that would help

#

๐Ÿ™‚

twilit geode
#
client.once('ready', () => {
    console.log('BOT ONLINE!');
    client.channels.cache.get("783533581808959499").send("logged in");

client.user.setActivity(`${prefix}help in ${client.guilds.cache.size} servers`, { type: 'LISTENING' });
   });

im trying to have it msg in a channel that it has come online, but im getting this error and I dont know what it means

(node:684) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
    at RequestHandler.execute (/home/runner/NonUtilityBot/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async RequestHandler.push (/home/runner/NonUtilityBot/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
(node:684) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:684) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
#

wait

#

i might be dum

earnest phoenix
#

read it and you will then understand it

twilit geode
#

I THINK I JUST DID A BIG STUPID

earnest phoenix
#

quite possibly

twilit geode
#

my fucking god

#

im so stupid

#

i thought it was a code error

#

or some of discords new bot perm shit

earnest phoenix
#

I need some help whenever i close the debugging console my bot goes offline is there a way to keep the bot online all the time????

#

I am using atom to code my bot

#

and whenever the python console closes the bot's commands don't work and it goes offline would i need a website??

proven ivy
#

wwhere you started running the bot?

earnest phoenix
#

how would i change this is my first time using atom

#

so idk

#

when you turn off your pc, does your OS still run? obviously not, in the same way if you close the program that is running your bot, it won't stay on

proven ivy
earnest phoenix
#

so i always have to have it open

proven ivy
#

if you close it it is ded

earnest phoenix
#

alr m8 thx @proven ivy

proven ivy
#

your welcome

earnest phoenix
#

if you want to keep it running 24/7 without having your pc turned on, look into renting a cheap VPS

limpid bear
#

how do a make a bot message go on to the next line

earnest phoenix
#

use a newline character

#

\n

royal night
#

is heroku good solution for 24/7 bot hosting

#

?

earnest phoenix
#

no

royal night
#

look i have cPanel Web Hosting

#

Can I Host My Bot There ?

#

I Got 1GB RAM

earnest phoenix
#

also no

royal night
earnest phoenix
#

because it isn't a vps

royal night
#

oh

earnest phoenix
#

it's a webhost

royal night
#

But I Got SSH Also

limpid bear
earnest phoenix
#

i mean if it can run your language, sure

#

@limpid bear /n is not the same as \n and for gods sake please learn js because that code makes 0 sense

royal night
#

yeah

twilit geode
#

so when it asks:

the URL you want the webhook to be sent to
how do ik what that is...

earnest phoenix
#

\n is a unicode character like any other, you include it in your string

royal night
#

<br> is same as \n

earnest phoenix
#

@twilit geode the url to your web server

slender thistle
#

The logic is similar, the functionality differs between environments

twilit geode
earnest phoenix
#

any web server

#

do you understand what a webhook is

twilit geode
#

not... entirely...

royal night
earnest phoenix
#

What does a webshook do?

royal night
#

Can I Host My Bot On My 2nd PC

earnest phoenix
#

in the simplest terms it's a reverse API
instead of you making requests to the site, the site makes requests to you

twilit geode
royal night
earnest phoenix
twilit geode
earnest phoenix
#

you need to have an active web server listening for requests

twilit geode
earnest phoenix
#

rent a cheap VPS that will act like one

royal night
earnest phoenix
#

How much time will it take to make my bot review

royal night
#

Generally inj Our Area No One uses Upload So I Get Upto 700Mbps

earnest phoenix
#

I uploaded it

twilit geode
mint charm
earnest phoenix
#

bot.on("message', message => {

royal night
earnest phoenix
#

error f

mint charm
#

yes

earnest phoenix
#

๐Ÿ˜‚

royal night
#

yeyy

mint charm
#

i have to use glitch till next year cuz cpu usage

earnest phoenix
#

any one help

earnest phoenix
royal night
#

i use heroku anyhow many problems

#

i have almost 15-16 accounts on Heroku as it provides 450HRS Of Worker Time

earnest phoenix
#

cc addd

#

Brrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

royal night
earnest phoenix
#

more hour

twilit geode
earnest phoenix
# earnest phoenix any one help

well, we can't help you if you don't state what exactly is your issue

imagine going to the doctors and just saying "this hurts". okay, where does it hurt? when did it start? what type of pain?

earnest phoenix
earnest phoenix
#

|||||||||||||
||||
|||||||||||||

#

@earnest phoenix

royal night
#

??

earnest phoenix
#

@earnest phoenix

#

@earnest phoenix

#

@earnest phoenix

#

i dont understand how that is even remotely spoon-feeding

#

@earnest phoenix

#

@earnest phoenix

#

keep your autistic tendencies outside of the chat

#

@earnest phoenix

mint charm
#

stop spamming dude

twilit geode
#

have to drag it out of them @earnest phoenix

earnest phoenix
#

K @mint charm

#

I will not spam now sry

#

I am dead

royal night
#

gg

earnest phoenix
#

gg

#

wth

earnest phoenix
twilit geode
#

lol

earnest phoenix
#

Can anyone suggest me a free 24/7 bot hosting for discord

#

none

#

Pls

royal night
#

Heroku

earnest phoenix
#

nothing is free

#
2020-12-02T06:08:37.831596+00:00 app[worker.1]: token_bot.on("message', message => {
2020-12-02T06:08:37.831597+00:00 app[worker.1]:              ^^^^^^^^^^^^^^^^^^^^^^^
2020-12-02T06:08:37.831598+00:00 app[worker.1]: 
2020-12-02T06:08:37.831598+00:00 app[worker.1]: SyntaxError: Invalid or unexpected token
2020-12-02T06:08:37.831599+00:00 app[worker.1]:     at wrapSafe (internal/modules/cjs/loader.js:915:16)
2020-12-02T06:08:37.831599+00:00 app[worker.1]:     at Module._compile (internal/modules/cjs/loader.js:963:27)
2020-12-02T06:08:37.831600+00:00 app[worker.1]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
2020-12-02T06:08:37.831600+00:00 app[worker.1]:     at Module.load (internal/modules/cjs/loader.js:863:32)
2020-12-02T06:08:37.831601+00:00 app[worker.1]:     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
2020-12-02T06:08:37.831601+00:00 app[worker.1]:     at Module.require (internal/modules/cjs/loader.js:887:19)
2020-12-02T06:08:37.831601+00:00 app[worker.1]:     at require (internal/modules/cjs/helpers.js:74:18)
2020-12-02T06:08:37.831602+00:00 app[worker.1]:     at /app/index.js:39:21
2020-12-02T06:08:37.831602+00:00 app[worker.1]:     at Array.forEach (<anonymous>)
2020-12-02T06:08:37.831603+00:00 app[worker.1]:     at /app/index.js:37:11```
#

Brr

mint charm
#

does this thing no longer support today or what
npm WARN deprecated har-validator@5.1.5: this library is no longer supported

royal night
#

use a latest verison of it

#

or 5.1.5 is the latest

#

?

earnest phoenix
#

it won't matter which version you use

mint charm
#

its alrdy the latest ver

earnest phoenix
#

@royal night you said me to do this

#

the entire lib is deprecated

earnest phoenix
earnest phoenix
#

which means if you run into issues, there won't be support for it

royal night
#

haha

mint charm
#

sad times

royal night
#

๐Ÿ˜”

#

Hey Can I Install Ubuntu in My 2nd PC & Host My Bots What About It ?

#

or in VMs

mint charm
# earnest phoenix Can anyone suggest me a free 24/7 bot hosting for discord

oh just noticed your message, you can do it on glitch btw, but it sometimes need to reactive by opening the project again (around every 2h-3days)

put this on server.js before the token part

setInterval(async () => {
  await fetch("https:// (your project name) .glitch.me").then(console.log("Pinged!"));
}, 300000 <you can change this to any number 1-300000, but better 200000+ for no logs spam>);```
opal plank
#

thats against glitch's TOS, uptime bots

#

Use AWS, or google's F1 micro

mint charm
#

if u're taking the risk tho..

royal night
#

What About Azure ?

opal plank
#

you could do github student too, i think it gets you 100$ for digital ocean or azure

royal night
#

i would love to host on Digital Ocean But I Dont have money as i am Student !

#

๐Ÿ˜”

mint charm
#

same

opal plank
#

i just posted 3 reliable ways you can do

#

if you care about quality, dont use glitch or heroku

#

if you dont give 2 f's about your bot's uptime and quality, go ahead and use them

slender thistle
#

if you care about quality
Crossing this out

royal night
#

i noticed one thing

#

i need to restart my bots everyday to make sure its working properly in heroku

mint charm
#

i use glitch cuz ill get my new laptop after new year, my current one always consumse so much cpu usage

opal plank
#

you use glitch cuz you bad dev

mint charm
#

and that

opal plank
#

glitch wont keep your bot on 24/7

royal night
#

yeah

#

it sleeps right ?

slender thistle
#

I have a $2/month VPS host multiple bots for me without any issues

opal plank
#

yes, then he goes and uses uptime pinging bots to try and keep his bot alive

mint charm
#

not always, but i can still make it active when my laptop turned off atleast

opal plank
#

even though glitch and heroku arent meant for bot hosting

royal night
#

lol

opal plank
#

which is against their TOS btw

royal night
#

i have 35 Dollars Hosting / Year For Website

slender thistle
#

Heroku doesn't sleep even

mint charm
#

nah, never turn off my laptop even im sleeping, just restarting it xd

opal plank
#

it just poofs

pale vessel
#

Heroku, sleep it's 12am

opal plank
#

you get 25 days worth iirc

#

you wont get full month

slender thistle
#

Kekw

#

550 hours

royal night
slender thistle
#

1000 with attached CC

opal plank
#

550 h sounds about right

slender thistle
royal night
#

550 hrs is less/month

opal plank
#

if you going to put a credit card, might aswel go AWS for a whole year for free trial

royal night
#

yeah

dark coral
#

how to develop a bot on discord anyone want to give examples ๐Ÿ˜ i have learnt many coding languages like JS , JSX , python , C++ , lua ๐Ÿ™‚

silent cloud
old latch
#

yeah

dark coral
#

do we have to develop bots on react native code

#

๐Ÿ˜

#

it seems like it

old latch
#

and for the guide go to discordjs.guide

dark coral
#

ok

old latch
#

read there ^

#

;)

dark coral
#

๐Ÿ˜‰

#

is there a dev kid here?

#

or am i the only one?....

#

๐Ÿ˜

earnest phoenix
#

๐Ÿ‘€

#

Me

old latch
#

what do you mean by dev kid? well everyone with green names is a dev for sure, but a kid?

#

idk

earnest phoenix
#

im having flashbacks from when i was acting like this when i was 14

old latch
earnest phoenix
#

bragging about knowing popular stacks but you actually just know the names

old latch
#

lmao

earnest phoenix
#

Lmafo

dark coral
#

lol

atomic vault
#

can some one say how to add permission to a channel during creating by bot that everyone cant send message

earnest phoenix
#

@dark coral i assume you mean young developer

dark coral
#

yah

#

im almost 13

earnest phoenix
#

You are not 13?

dark coral
#

no... not yet...

earnest phoenix
#

@coral trellis

dark coral
#

this is my brothers account

lusty quest
#

you break Discord TOS you know

dark coral
#

???

#

wut

#

TOS?

lusty quest
#

bcs of COOPA all users need to be atleast 13 years old

earnest phoenix
#

Fun fact, i am 13 year old bot dev :^)

golden condor
#

What's the situation here

#

This seems strange

atomic vault
#

i also
i made a website without cms

golden condor
#

What's cms

old latch
#

I reported :)

earnest phoenix
atomic vault
golden condor
#

Oh

atomic vault
golden condor
#

Cool

old latch
#

I sent in reviewer

golden condor
#

They were banned

quick ginkgo
#

this is my brothers account
NanoMaxico

RIP

lusty quest
#

possible just a cheap excuse

old latch
#

why should he use his brothers account wtf

golden condor
#

Perhaps because he is underage

#

Or his parents won't let him go on discord

old latch
#

he didnt even know what TOS means

lusty quest
#

or he just used his real birth date on initial registration and then got flagged

lusty quest
atomic vault
#

how to tag a user how joins server by bot

old latch
#

what?

lusty quest
#

in discord.js you can just parse the member object to a message and it will mention the user

atomic vault
#

we cant tag like @ name

old latch
#

u tagged someone

lusty quest
#

channel.send(`${user_object}`) will mention the user

lusty quest
#

you use strings. javascript just joins strings

#

if you want to use them in math convert them to a number

atomic vault
#

use int

limpid bear
#

how do i use int

devout frost
#

parseInt(args[i]) is how you parse one of the arguments to an int

atomic vault
#

int(var)

lusty quest
#

int is not a thing in javascript

#

you can use parseInt(string) or Number(string)

pale vessel
#

use Number() in your case

limpid bear
#

i used number on the args. but same results.

lusty quest
#

well you parse them again into a string

#
send(Number(args[0])+Number(args[1])+Number(args[2]))
earnest phoenix
#

I'm not really good with databases but is requesting a guild config from mongodb something ok to do every time a message is sent?

#

nope

green kestrel
#

Is it a bird ๐Ÿฆ
Is it a plane โœˆ๏ธ
No it's a superbrain (8) ๐Ÿง 

earnest phoenix
#

cache your results

lusty quest
#

use a cache

#

hammering your db with stupid requests is not really what you want

earnest phoenix
#

i do cache the guild configs currently

#

ok... thanks for the answer

green kestrel
#

Database are designed for lots of queries and smart databases cache anyway. Doesn't mongo do this ?

#

If you're also using e.g. redis for your cache that is working the same way

earnest phoenix
#

so you're saying mongodb caches it ?

green kestrel
#

I don't use mongo, I'd assume so? That was my question

lusty quest
#

no mongodb doesnt cache (only keys)

green kestrel
#

Ew.

#

That's horrible

#

Do what superbrain8 said

limpid bear
#

ok look. the code i sent is an error message. and the problem was args 0 was not more args 1. but it says that it is.

earnest phoenix
#

ok

#

regardless whether the database caches or not you shave off extra time to access the database when you keep a local cache

lusty quest
#

i recomend using a map. i have currently a local running redis server for caching

green kestrel
#

I locally cache the results of complex queries only

#

But I'm using a mysql database and it does cache very effectively, for a database on localhost you won't see a performance issue with this even with tens of thousands of servers if done right

white mesa
#

who do you colour chat on you top.gg page

green kestrel
#

For the local cache I use std::unordered_map

earnest phoenix
#

yeah for localhost it scales super well, there's practically zero latency

#

it's unrealistic for large bots to use the same machine for their shards and to keep a database though

lusty quest
#

you could still use a local cache tho

earnest phoenix
#

yeah

green kestrel
#

My system expects that each server has a local instance of a master-master mysql cluster on it

#

But I won't have to scale out until at least 200k servers

#

Which really is huge bot territory imho

lusty quest
#

this is a nice thing with mongodb, you can super easy scale it *vertically

green kestrel
#

Mysql is a pain for that

#

Not looking forward to it

earnest phoenix
#

it's best to do optimization as soon as possible rather than letting it be an afterthought imo

#

i was going to say this earlier but i forgot what i was going to say lol

lusty quest
#

well most people who dont put efford into scaling Mysql servers properly tend to just bruteforce it with more powerful hardware

green kestrel
#

Yes, however avoid premature optimisation... Does js have a proper runtime profiler?

#

I use valgrind to profile my c++ and determine where optimisation is best placed

earnest phoenix
#

im fairly certain it does

lusty quest
#

i guess Firebug or Blackbird

#

but i never really used it

earnest phoenix
#

node is built on top of cpp and it likes to crunch on memory

#

so, a hot topic

green kestrel
#

Every interpreted language really is written in C or C++

#

But tbh V8 is a memory hog

worldly peak
#

how to make bot

green kestrel
#

CPU efficient for a js interpreter but at the cost of ram

earnest phoenix
#

this

#

2 gigs of ram just to run 4 chromium apps without stuttering

worldly peak
#

what

green kestrel
#

If you want CPU and memory efficient js at the cost of compatibility look at duktape.js

lusty quest
#

i think about switching to C# from js but its so much stuff i have to port over

earnest phoenix
#

id say it's worth it

#

the net core, or rather just net now, garbage cleaner is insanely good

lusty quest
#

i know its worth but so much stuff to re learn

green kestrel
#

My bot is currently on 3gb ram

lusty quest
#

barely 100MB but with about 300 Guilds

green kestrel
#

You can get similar efficiency with well written C#

worldly peak
#

how to em how to are make bot

lusty quest
green kestrel
#

Aegis is an odd library, it'll take 200mb just to start up with no guilds but memory increases super slowly, and linearly with guilds

#

43000 guilds and 3.3 million users is 3gb for me

lusty quest
#

hmm. switched a while ago to Discord.js-light and it cut down Memory usage by a lot (used to run with about 200-300MB ram while serving 80 Guilds)

green kestrel
#

There's CPU oddities though caused by a library bug

desert hazel
#

Brain if you don't shut up pleading_devil_twapple pleading_devil_twapple pleading_devil_twapple pleading_devil_twapple

#

@green kestrel sadd

green kestrel
#

@desert hazel real_gun ๐Ÿ‘ป <-- thats a ghost that's also an OG.

#

which is why he carries

earnest phoenix
#

If i were to rewrite my bot i would probably use java... But I'm fine with eris and node js currently

green kestrel
#

ew java

#

thats like saying "if i was going to rebuild my brick home i'd use sugar cubes"

#

each to their own i guess!

earnest phoenix
#

and why do u hate java ?

green kestrel
#

i dont hate java - i hate the way its taught academically in colleges, universities.
i see very little efficient well written considerate java that isnt a memory hog, because of stupid practices

#

java can be done well, it doesnt happen often because of the culture around it

#

lets not include android dev, theyre forced to be efficient there, more so than desktop/enterprise/server

#

when i learned it, there was a culture around it that went like this:

#

"java has a virtual machine, you should imagine that this machine has infinite ram, capability for threads, and cpu, and scaling what you write to fit on real hardware is the job of a systems architect"

#

typical fortune 500 thinking.

#

it breeds bad design and antipatterns

#

but this isnt the fault of the language, but the fault of teachers

#

it also used to be the case, many years ago, that java WAS inefficient no matter what you did because the garbage collector sucked ass... thats not been an issue since uh... java 1.8, a loooong time ago

earnest phoenix
#

I learn by myself mostly and java seems really easy to me cuz i know basic Js

green kestrel
#

js is nothing like java

#

the syntax seems similar, same as it seems similar to C++, they both have classes, use semicolons to terminate lines, they have the same flow structures but both demand architecturally different code to work right

#

if you wrote java like you write js, you'd be in a pickle in no time flat

#

and vice versa

earnest phoenix
#

Most of languages have similar syntax to C++

green kestrel
#

most languages in the same syntax family do yes

tranquil drum
green kestrel
#

then you have things like python, BASIC, erlang, perl, etc, that look nothing like C

#

@tranquil drum good, it seems android has rubbed off on them then, they dont teach that shit no more ๐Ÿ˜„

#

at least not where you learned

tranquil drum
#

Haha the same professors teach lower level stuff too

earnest phoenix
#

w3schools seems pretty good for java Thonk

green kestrel
#

w3schools seems pretty good for.... uh..... hmm..... accessing when the official reference for your language is down?

tranquil drum
#

I guess I'm trying to defend java a little bit since it's my favorite server language along with rust

green kestrel
#

one of my friends swears by java, loves it

rustic nova
#

peek Did someone say Java?

green kestrel
#

we have debates about it often ๐Ÿ˜›

#

no go back to sleep Aurel ... j/k ๐Ÿ˜„

#

yeah, im glad to hear that people arent teaching java wrong any more

green kestrel
#

^ java

earnest phoenix
#

well i think you just had a bad experience while learning java. But the language itself seems good

green kestrel
#

ive been a C++ person for decades, but C++ has its flaws, iteration time (time waiting for compiles) is the worst there is

#

with C++ its like you save tons of time at runtime, but at the cost of sat twiddling your thumbs when you could be coding, so you'd best get the code right lol

tranquil drum
#

I think java's great, I just wish reflections and some other typing were more straightforward

tranquil drum
green kestrel
#

"bot compiling, thats 10 mins to watch youtube" (TEN minutes. im not kidding. ten minutes, and it spits a huge binary out the other side):

trivia@mx1:~/triviabot/build$ ls -alh
total 235M
-rwxr-xr-x  1 trivia trivia  54M Nov 26 23:49 bot
-rwxr-xr-x  1 trivia trivia  11M Oct  6 12:56 module_bandwidth.so
-rwxr-xr-x  1 trivia trivia  26M Nov 25 15:04 module_diagnostics.so
-rwxr-xr-x  1 trivia trivia  11M Oct  6 12:56 module_presence.so
-rwxr-xr-x  1 trivia trivia 130M Dec  1 22:23 module_trivia.so

tranquil drum
#

true but the code you have to write just looks arcane

green kestrel
#

yes, for the bot part

#

and PHP for its api and dashboard because i like to hear people shout REEEEEEE

tranquil drum
#

yikes

green kestrel
#

indeed, but its worth noting that a discord bot spends 99% of its time i/o bound

#

the other 1% parsing json

#

so your biggest saving from C++ is memory efficiency, if done right, not CPU

tranquil drum
#

what library are you on?

#

how much does the cache take up?

green kestrel
#

so yeah heres the benefit in terms of memory use, each cluster has 5500 guilds and uses only 400-500mb ram

trivia    1647  1.9  1.1 2308112 388892 pts/15 Sl+  Nov27 138:35 ./bot -members -clusterid 2 -maxclusters 8
trivia    3981  1.7  1.5 2065932 510000 pts/18 Sl+  Nov23 214:15 ./bot -members -clusterid 4 -maxclusters 8
trivia   11948  2.0  1.3 2439184 446192 pts/20 Sl+  Nov26 161:38 ./bot -members -clusterid 5 -maxclusters 8
trivia   13033  1.8  1.0 2111504 343488 pts/17 Sl+  Dec01  24:45 ./bot -members -clusterid 3 -maxclusters 8
trivia   18947 19.4  1.1 2093400 370416 pts/6  Sl+  Nov29 685:47 ./bot -members -clusterid 0 -maxclusters 8
trivia   25935  1.8  1.1 2242576 385444 pts/13 Sl+  Dec01  22:51 ./bot -members -clusterid 1 -maxclusters 8
trivia   29042  1.9  1.4 2303492 481720 pts/21 Sl+  Nov29  88:41 ./bot -members -clusterid 6 -maxclusters 8
trivia   29099  1.8  1.0 2119696 346456 pts/22 Sl+  Nov25 187:31 ./bot -members -clusterid 7 -maxclusters 8
#

im on aegis.cpp

tranquil drum
#

I'm also on jda and my shards use ~200MB

green kestrel
#

a total of 43000 guilds, 3.3 million users, god knows how many millions of roles, hundreds of thousands of channels, all cached in ram as std::unordered_map

tranquil drum
#

did you write your own discord client?

green kestrel
#

its designed to scale outwards, i can take each of these cluster processes and in theory run it on a completely standalone machine, it doesnt need a central controlling process

#

no i used aegis.cpp which is based on asio and websocketpp, but afterwards i became a library dev on it, to add my own features directly to it e.g. cluster support

#

i didnt want to have to maintain my own fork of aegis so i spoke to the dev and got commit access

tranquil drum
#

I'm jealous, I'm using tcp to share some state across shards

green kestrel
#

i share as little state as possible, and it store it in the mysql db

#

the mysql db is my coordinating data set, that way i can in theory just scale out the mysql cluster and it 'just works'

#

but im about 150k servers away from having to scale out yet and i need more funds to be able to do that

#

@swift umbra sure, thats the intent, but most libs dont easily allow it because they design with a central control process

#

and the central control process might talk to the shard processes over ipc such as a unix socket, or a localhost tcp socket

#

eliminating the central controlling process or structure makes it easier to do

#

at the expense of making the bot harder to code initially

tranquil drum
#

I guess I got lucky with jda being able to shard across servers

green kestrel
#

for example aegis, as it stood when i started using it, only supported single process sharding, each shard is a new websocket connection and a member of the same asio thread pool in the same process

#

the clustering feature lets me split it out, so i have 4 shards per cluster, and 8 clusters for a total of 32 shards

#

i'd advise getting sharding working long before even 1000 servers

#

that way when you need it, youre not left panicking, just flip the switch and shard

#

its usually not as simple as just 'enable it in djs'

#

stuff like getting user counts and stuff only accesses the local vars?

#

instead of the shard broadcast ?

#

the way ive done this is kept shards from talking to each other as much as possible

#

e.g. shard 2 never needs access to a user record in the cache of shard 4

tranquil drum
#

wait it does?

#

I thought it was only if you were in the same vm

green kestrel
#

oh and when you get to sharding.... one thing to remember that trips people up

tranquil drum
#

but a cache on shard 2 can't be accessed by shard 4

green kestrel
#

ALL DMs come in on shard 0 ๐Ÿ˜„

tranquil drum
#

the JDA instance is only the instance of that vm

green kestrel
#

not a problem for me as my bot doesnt accept user dm's, but if your bot does... need to be prepared for that

#

i only send DMs and thats done via REST so not an issue

#

one physical process per shard?

#

that sounds a bit painful tbh

weary quiver
tranquil drum
#

right, but if your shards are on different machines then you can't share the cache between them

#

You installed discord.js

green kestrel
#

how does it share cache then, shared memory?

weary quiver
#

@tranquil drum how to delete it

tranquil drum
#

npm uninstall discord.js

weary quiver
#

Oh thx

tranquil drum
green kestrel
#

what no love for discord.js version 11 lul ignore me... sarcasm

tranquil drum
#

that's why I had to set up a tcp socket

green kestrel
#

ah

#

what format do you transfer cached objects on that socket teemaw

tranquil drum
#

mysql sounds way more efficient though

#

i'm transferring with json

green kestrel
#

is it something lightweight and binary, or something horrid like json or .... ew... xml

#

at least you didnt say xml

tranquil drum
#

but i'm only sending the bits I need

green kestrel
#

java people used to LOVE xml

#

xml for everything!

tranquil drum
#

lol android uses xml for so much

green kestrel
#

xml and its ungodly heavy parsers

#

pom.xml - where australians store information about british people?

tranquil drum
#

come to gradle my friend

earnest phoenix
#

Is there any website same as repl and glitch

green kestrel
#

you cannot win teemaw, if you strike down his xml schema, it will become more bloaty than you could ever imagine.

earnest phoenix
#

Yes @swift umbra

#

@swift umbra with free domain

weary quiver
#

@tranquil drum i uninstalled that then downloaded again but it is not in the folder I wanted to be

weary quiver
#

I used window PowerShell

tranquil drum
#

you need to change your directory in ps to the directory of your project

earnest phoenix
#

@swift umbra does heroku has private project option ?

weary quiver
#

I did that @tranquil drum

tranquil drum
#

javascript web apps ๐Ÿ™‚

earnest phoenix
#

Ok

tranquil drum
weary quiver
#

Ok

tranquil drum
atomic vault
#

.xyz is for $12/y
i seen $1.18 in name cheap

earnest phoenix
#

@tranquil drum but how to use heroku and host for 24/7 ?

tranquil drum
#

it's like a first year discount thing

tranquil drum
earnest phoenix
#

๐Ÿค” wdym ? @tranquil drum

tranquil drum
#

they have a dyno tier called "Hobby" which is on 24/7

earnest phoenix
#

@tranquil drum link ?

tranquil drum
#

free dynos sleep after 30 minutes of inactivity

#

there should be a pricing link on the site

atomic vault
earnest phoenix
#

Can i use uptime robo to make my web 24/7 online ? @tranquil drum

weary quiver
#

@tranquil drum still nothing i tried deleting then installing I was in the right directory

#

But it always downloads in another folder

tranquil drum
#

However free heroku accounts only have 550 hours every month

earnest phoenix
#

@tranquil drum uptime robo pings website in every 5 mins

weary quiver
#

Yes

#

Here

tranquil drum
earnest phoenix
#

Oh

tranquil drum
weary quiver
#

Yes

tranquil drum
#

is that not where you want it?

weary quiver
#

No no

#

It is downloaded in a "new folder"

#

Confusion

#

I haven't renamed my folder

green kestrel
#

tip of the day

#

pressing print screen key takes a screenshot of your desktop that you can paste into discord

#

sending photos of a screen is normally what my parents do lul

rustic nova
#

And what most new Developers do LMAO

green kestrel
#

really? ๐Ÿ˜ฎ

void shadow
#

hello i have a question can you make discord bot using js that can read peoples linked discord acc on namemc and their mc name

green kestrel
#

never saw it till i came here

rustic nova
#

well the part of taking a photo with the phone

sly grotto
#

lol

rustic nova
void shadow
#

ok

#

yes thre is but idk how to get discord name from user

rustic nova
#

There seems to only be one for java

#

unless you're coding in java

void shadow
#

im in js

rustic nova
#

you'll need to scrape the site then most likely

#

though no clue how that is done

#

what do you need?

atomic vault
#

what happen?

rustic nova
#

Ids should be the emoji ids, correct?

tranquil drum
#

Theyโ€™re a list of MessageReaction

#

You can call getReactionEmote().getIdLong()

rustic nova
#

yeah you should be able to iterate through them if you want to store the ids

#

through what teemaw said

tranquil drum
#

Pick any way of iterating through a List you want

rustic nova
#

the way i would suggest you do is with forEach()

#

you can also just use a for loop

tranquil drum
#

You canโ€™t do that since getReactions() returns a List<MessageReaction> instead of a MessageReaction

#

You need to iterate over the list to access the MessageReaction

#

Check out forEach

#

Itโ€™s a method of List

rustic nova
#

Something like

getMessage().getReactions().forEach(reaction -> {
long emojiID = reaction.getReactionEmote().getIdLong();
// Do whatever you want with emojiID

});

#

emojiID is then the ID of each Emoji from the reactions of the message

near stratus
#

why am I getting this error ?
! [remote rejected] main -> main (push declined due to email privacy restrictions) error: failed to push some refs to 'https://github.com/usrrname/.........git'

rustic nova
#

seems like a github error

#

right?

near stratus
#

Yeah

#

But what's wrong ?

rustic nova
#
green kestrel
#

someone asked me to check this place out

#

i was so miffed by what i found i decided to share it

rustic nova
#

your email you stored inside your git configuration most likely doesn't match the one from your repository (if i read this correctly)

green kestrel
#

anyone else spot something wrong here? lol

rustic nova
#

ah yes, website is called sqlclusters, they mention that they don't support clusters

green kestrel
#

yeah lol

#

i mean REALLY

near stratus
#

oh

green kestrel
#

price point was really good otherwise

near stratus
#

thanks

lusty quest
#

they even know making clusters in Mysql is pain

tranquil drum
rustic nova
#

ohhh

green kestrel
#

tbh, i'd be looking into google cloud mysql cluster or such, if i needed that

tranquil drum
#

Either disable it or change your local git config email

green kestrel
#

they modded it to make master-master clusters easier iirc

tranquil drum
#

Do they support clusters for other sql backends though

lusty quest
#

i just get a 2nd 5$ VPS and install Mongodb on it. then i launch them together with my existing Node in Clustered mode and im done

green kestrel
#

thats great, if you use mongo

rustic nova
#

I actually tried using Mongodb, got the installation instructions, read the docs while it was installing, then immediately removed it again because i didn't understand anything sad

#

not ready to move from mysql yet

lusty quest
#

its simple. install docker then run the MongoDB container. saved me so much headache

rustic nova
#

even if mysql is a pain, it's the most comfortable form of database for me

#

yeah it's not the installation, it's how to use it

green kestrel
#

there isnt really need to move from or to mysql/mongo, pick the right one for your use case first and stick with it ๐Ÿ™‚

tranquil drum
#

Mongo selectors are sick

green kestrel
#

and theres nothing to say you cant use both!

tranquil drum
#

I use them for couchdb ๐Ÿ™‚

lusty quest
#

well i moved from Mysql to Mongo, and im still fine with it

green kestrel
#

mongodb is essentially a key/multi-value store

#

not an ACID compliant transactional db

#

they have different use cases

tranquil drum
#

But the selectors though

lusty quest
#

Mysql does some stuff better than Mongo, one good example is caching and you dont need to run duplicated keys bcs of linking Tables. Mongo on the other hand is not bound to a Schema

cursive forge
#

How would I make a help cmd? using js

green kestrel
#

if you were able to move from mongo to sql without having to re-engineer much or anything, you probably were using mysql as a k/v store e.g. like myobj = mysql->get("some key");

lusty quest
#

ive wrote myself a migration tool that worked but i guess everyone who reads the code gets a stroke

green kestrel
#

@cursive forge what have you tried?

vague imp
#

I shifted from MySQL to mongo

cursive forge
#

I am trying to make it a function

vague imp
#

It was much better for me then sql

lusty quest
vague imp
#

@cursive forge if you have command handler the. It's quite easy

#

Almost same code

cursive forge
#

I don't got a command handler lol

old latch
#

get one

lusty quest
#

without you could make it manually, but i suggest getting one and then make a dynamic help command

#

the discordjs.guide also got some help for making command handler

green kestrel
#

mmmm coffee time, now this is java.

#

costa caramel latte with vanilla syrup ๐Ÿ˜„

lusty quest
#

i drink it mostly pure

#

just hot water bean juice

tranquil drum
#

You can call isEmote() on the ReactionEmote

#

Yep

tranquil drum
#

Oh wait I thought bots could use all emotes

lusty quest
#

i dont think its possible. since you need to know the uid of the emote (if its a custom emote)

#

you could probably use a Server to set there your custom emotes and then use the emote on other servers

devout frost
#

Well you can only use emotes where your bot has access to the guild

tranquil drum
#

You could probably do JDA.getEmoteById() to see if itโ€™s cached

#

Although you could also just try to react with the emote and handle the error of the bot canโ€™t

earnest phoenix
#

I'm trying to draw a simple line chart of my bots ping on node js. Is there any simple API or library i can use?

lusty quest
#

chart.js

earnest phoenix
#

can i send it as a png?

#

to the channel where the command is ran

lusty quest
#

yes

#

ive made a bot using it

earnest phoenix
#

its an npm library right?

lusty quest
#

yes

earnest phoenix
#

ok.. ill try using it

still breach
#

I can rename the ticket 2 times, and when I try it for the 3rd time, it doesnโ€™t work.
Eventually, 8 minutes later, it renames to โ€œ3โ€

Does this have anything to do with discord itself, host, code, idk?

devout frost
#

You get ratelimited, you can only change the channel name twice a 10 minutes

still breach
#

Ah that explains a lot

#

Thanks

knotty obsidian
#

When I try to hide the channel it just flickers and doesn't hide, anyone know the problem?

channel.createPermissionOverride(event.getGuild().getPublicRole()).setDeny(Permission.VIEW_CHANNEL).queue();

(Everyone is the server can see the flickering, including people with and without roles.)

young flame
#

quick question

#

i have a setup command

#

and im using await messages so it's like

#

enter the muterole id

#

and i want the await messages to get the id from the message but it doesn't

#
let role = args[0]
 await message.channel.awaitMessages(m => (m.author.id === message.author.id) && (m.content === `${role}`), {
                    max: 1,
                    time: 20000,
                    errors: ["time"]
                }).catch((err) => {
                    return message.channel.send(new Discord.MessageEmbed()
                    .setColor('#ff3636')
                    .setDescription(`${no} | Setup has been canceled, didnt send a message in 20 seconds.`))
                });
#

yeah its admin only

#

well admin - guild owner

#

i tried using brackets and just role

#

but i dnt know how to get it to like realize they sent the role id and set it

#

uh no error

#

it doesn't set it after it says setup has been canceled

#

wym by log?

#

my console just says no value specified because it doesn't get the role

pseudo wadi
#

Why not setup a function to collect the role id

#

Not on pc so i dnt hve an example

young flame
#

hm

pseudo wadi
#
async function getResponses(message) {
    const validTime = /^\d+(s|m|h|d)$/;
    const validNumber = /\d+/;
    const responses = { }

    for(let i = 0; i < prompts.length; i++) {
        await message.channel.send(prompts[i]);
        const response = await message.channel.awaitMessages(m => m.author.id === message.author.id, { max: 1});
        const { content } = response.first();
         if (i === 0) 
          responses.prize = content;
          else if (i === 1) {
            if(!isNaN(ms(content)))
            responses.duration = content;
            else 
            throw new Error('Invalid time format') | message.channel.send('Invalid time format!, Cancel giveaway!');
          }
          else if (i === 2) {
            if (validNumber.test(content))
            responses.winners = content;
            else 
           throw new Error('Invalid entry for winners!') | message.channel.send('Invalid entry for winners!, Cancel giveaway!');
          }
      }
        return responses;
}
  }
}
valid grotto
#

What about using MessageCollector()?

pseudo wadi
#

That can also wrk

young flame
pseudo wadi
#

,

pseudo wadi
young flame
#

lbrb

earnest phoenix
#

I don't think your filter is correct

#
m => m.content.match(/^(\d{17,19})$/) && m.author.id === message.author.id```
knotty obsidian
#

how do i put multiple permissions in a permissionoverride at once

lusty quest
#

it uses an object

#

if you know how to make one you can add mutiple permissions

#

(atleast in js)

young flame
earnest phoenix
young flame
#

wuT

knotty obsidian
#

well this doesnt work

(Permission.MESSAGE_READ | Permission.MESSAGE_WRITE)
young flame
#

what verison

knotty obsidian
#

14 ik

young flame
#

why are you-

lusty quest
#

this is not js

young flame
#

oh

lusty quest
#

or an ancient version

knotty obsidian
#

nvm lol forgot that , exist

lusty quest
#

d.js v12 right?

young flame
#
message.author.hasPermission(['MANAGE_MESSAGES', 'BAN_MEMBERS']);
#

shouldn't that work

#

or something

lusty quest
#

this is for reading

#

not setting

young flame
#

o

valid grotto
#

Yo why doesn't this work? if(!message.channel.id === theChannel.id) return;

I've logged them both and they're different but for some reason it's not returning

lusty quest
#

are both channels cached?

valid grotto
#

yes

lusty quest
#

the 2nd channel is an actual channel or a object containing the id?

valid grotto
#

it's an id nonetheless

#

and yes it's a channel

cinder patio
earnest phoenix
#

@young flame

let passed = false;
let collector = message.channel.createMessageCollector(m => m.content.match(/^(\d{17,19})$/) && m.author.id === message.author.id, {
max: 1,
time: 20000
});
collector.on("collect", collectedMessage => {
passed = true;
let role = message.guild.roles.cache.get(collectedMessage.content);
if (role) {
// Do whatever if the role exists
}
});
collector.on("end", () => passed ? message.channel.send("You didn't send anything in 20 seconds") : null);``` your entire thing simplified
cinder patio
#

so you are comparing false === theChannel.Id

young flame
#

wut

lusty quest
#

yea what GoogleFeud said

young flame
#

o

lusty quest
#

you need !=

young flame
#

looks complicateD

valid grotto
#

Ah right, thanks guys @lusty quest @cinder patio

latent cave
#

Umm why am I getting this error

#

Handler.js:39:14)
at async GuildMember.edit (C:\Users\Marine sensor\Desktop\discord-ba-bot\node_modules\discord.js\src\structures\GuildMember.js:312:5) {
method: 'patch',
path: '/guilds/783359880466792488/members/442622170565443584',
code: 50013,
httpStatus: 403
}

lusty quest
#

did you got the Gateway intent for members?

earnest phoenix
#

Your bot doesn't have permission to do a patch action on a guild member

latent cave
#

Umm

#

How can I give him the permission?

#

btw I didn't script this, I paid someone to script it for me

earnest phoenix
lusty quest
#

ask the guy who made it.

latent cave
#

He's saying don't dm me ever

delicate shore
#

Bruh

pearl trail
#

o

latent cave
#

He's like ask development chat

earnest phoenix
#

Omega

#

Kek

delicate shore
#

Omego lul

lusty quest
#

10/10 scam

pearl trail
#

what are you trying to do?

latent cave
#

hayperToday at 3:27 PM
Development channel
Dont dm me ever again.
Its yourside not mine
It aorl on my zide
Work side
Stop dming me

pearl trail
#

so it throw error

delicate shore
#

It's hayper ?

latent cave
#

Yea

delicate shore
#

Hayper the one that's in this server ?

latent cave
#

ye

earnest phoenix
#

Hayper... So the emergency food made a discord bot

latent cave
#

emergency food?

earnest phoenix
pearl trail
latent cave
#

So can you help me to fix this issue?

pearl trail
earnest phoenix
#

Just give the bot permission in whatever server it's trying to do that thing on the guild member

pearl trail
#

oh wait

#

its about permission

latent cave
#

k

#

rn

#

You mean permissions in the role?

#

the bots role?

earnest phoenix
#

Whatever role

latent cave
#

He has all the perms :/

earnest phoenix
earnest phoenix
#

Screenshot?

pearl trail
young flame
#

ok

pearl trail
#

on stackoverflow

earnest phoenix
#

you are the owner of the server

#

the bot can't change your nick

latent cave
#

I know

pearl trail
#

yep

earnest phoenix
#

i have explained this like a million time

latent cave
#

The bot is going offline automatically

#

I KNOW

#

THE BOT

#

IS GOING OFF

pearl trail
#

._. chill chill

earnest phoenix
#

Of course, it's throwing an abort error

latent cave
#

๐Ÿ˜‚

lusty quest
#

handle the error lol

pearl trail
#

so, you are trying to change your nickname in your server?

#

but you are the owner of that server?

latent cave
#

3rd*

lusty quest
#

its not an excuse lol

earnest phoenix
#

Imagine not checking for the bot's permissions before doing an API request

latent cave
earnest phoenix
#

it's becasuse

latent cave
#

ildMember.js:312:5) {
method: 'patch',
path: '/guilds/783359880466792488/members/442622170565443584',
code: 50013,
httpStatus: 403

earnest phoenix
#

it exit on error

#

if an error happened

pearl trail
#

hm

earnest phoenix
#

then it will exit

#

Just

latent cave
#

Emm

#

How can we fix it

earnest phoenix
#
process.on("unhandledRejection", () => {})```
lusty quest
#

handle the error and the bot will stay online

earnest phoenix
#

also

#

he only have 3 day experence of coding :^)

latent cave
#

Didn't code a shit

pearl trail
#
//ur code
}.catch(err => console.log(err))

sorry if i wrong.

latent cave
#

It was all haypers favor

earnest phoenix
#

I literally sent something to fix all your promise rejections

latent cave
#

Hold on step by step

lusty quest
#

then learn javascript first. then get back onto your bot

latent cave
#

What should I rn

earnest phoenix
#

anyways i gonna leave now

#

@summer acorn send please

latent cave
earnest phoenix
#

Bottom

latent cave
#

k

earnest phoenix
#

Of the code

latent cave
#

process.on("unhandledRejection", () => {})

young flame
latent cave
#

This?

#

process.on("unhandledRejection", () => {})

#

?

earnest phoenix
#

@summer acorn i should have trust you can make bot with you sad

#

@young flame put async before collectedMessage

young flame
#

o

earnest phoenix