#development

1 messages ยท Page 1514 of 1

crystal wigeon
#

so what if i need the client as well

cinder patio
#

Then you can't really do this kind of thing with discord.js

#

You don't need the client to delete a message for example, you can make the request yourself

crystal wigeon
#

i mean thats just one example

#

but what if i need the client for other operations

#

i obv cant login again on the receiving process

cinder patio
#

yea that's why making the HTTP requests yourself is the only way to do this

crystal wigeon
#

wym

#

can you elaboratE?

#

if you dont mind

slender thistle
#

An active websocket connection is only needed to receive events

#

Most of the stuff your bot does is HTTP requests, which doesn't require an active connection at the time of request

crystal wigeon
#

someone here earlier told me not to use ws

slender thistle
#

I don't know what kind of fuckery is going on here and what the use case is, so imma head out to eat

cinder patio
#

discord.js is not designed to be used like this, so if you want to delete a message for example, you will have to make the HTTP request yourself

crystal wigeon
#

forget about deleting message

#

so the problem statement

#

is

cinder patio
#

I'm just giving it as an example

crystal wigeon
#

how do i share the message and client between 2 processes, one way is just taking the required data and serializing it over redis

#

im not able to get my head around this http you talking about

#

should i put a http server behind the client login?

#

after the client logins and when i wanna share my data

#

i just send it over http?

#

to the other process

cinder patio
#

no no no, HTTP request, not server

#

you make HTTP request to HTTP servers

crystal wigeon
#

so over http req i'll be able to send the message and client without serializing ?

cinder patio
#

in this case, the discord api is the server, while you are the client who makes the request

crystal wigeon
#

yeah

cinder patio
#

no that's just how to make http requests, you will still have to serialize the message data, and you can't serialize the client

crystal wigeon
#

so my receiving process must be a server

#

mmm

#

so bots build on js is not scalable?

cinder patio
#

you don't need a server - you just can't send complex objects from process to another process, only serializable data, and that's numbers, strings, bools, arrays, and simple boekcts

lusty quest
#

they are?

#

you can shard them

umbral zealot
#

They are scalable. You just can't exchange javascript class instances through HTTP

lusty quest
#

just not that efficent

crystal wigeon
#

i still dont understand why a good config VM couldn't handle even 50 users

#

there was huge latency

#

even tho its in us

#

the vms

#

i see

lusty quest
#

there is a bug within your code

solemn latch
#

latency? just ping issues? no cpu issues?

crystal wigeon
#

it also caused the commands to be executed twice or something

umbral zealot
#

"latency" means "lag" so, the number of users shouldn't affect latency at all.

crystal wigeon
#

yeah the lag wsa hude

#

no cpu issues

solemn latch
#

double instanceing

crystal wigeon
#

because it was just single thread

lusty quest
#

it doesnt is bcs of the single threaded nature of js

crystal wigeon
#

im trying to break this into multi processes

umbral zealot
#

I've handled 1400 server with about a million and a half users on a single nodejs thread so... it's not nodejs itself that's the issue.

crystal wigeon
#

mm

#

double instancing?

lusty quest
#

you had 2 instances running

crystal wigeon
#

i got like 30k ping when users spammed commands

lusty quest
#

that spawned 2 different "bots"

crystal wigeon
#

ah that

#

AHH

#

i tried workers

solemn latch
#

users spamming commands could have resulted in a ratelimit

crystal wigeon
#

so ig the workers picked two jobs

lusty quest
#

also with the Ping stuff, did you use apis?

crystal wigeon
#

probably

lusty quest
#

had once my bot reaching 100kms bcs of an command that accessed an api

crystal wigeon
#

hmm

#

rate limit for 50 users?

solemn latch
#

ive seen commands get ratelimited off one command

lusty quest
#

to be fair it where an edge case, one user got bored and constructed an argument for the command that caused the API to DDos the bot

crystal wigeon
#

why is that

earnest phoenix
#

How Can I Get My Emoji ID?

crystal wigeon
#

discord is doing that?

solemn latch
#

well, if your command does multiple api calls, you can get ratelimited.

earnest phoenix
crystal wigeon
#

by multiple api calls you mean the api calls to djs?

solemn latch
#

for example, editing a message 5 times in a short period of time = ratelimited.

umbral zealot
#

What exactly does your bot do, @crystal wigeon ?

crystal wigeon
#

to get info like guild etc

umbral zealot
#

like how is it needing separate process on 50 users?

#

that's insane

crystal wigeon
#

ikr

solemn latch
#

if you fetch a guild, thats an api call. if you get a guild, its not an api call.

crystal wigeon
#

i see

#

well i'am fetching user

#

data

#

from message.members

#

.cache

umbral zealot
#

That's literally nothing

crystal wigeon
#

i assume thats not api call?

earnest phoenix
#

@umbral zealot Thx

solemn latch
#

cache is a get typically.

crystal wigeon
#

yeah

umbral zealot
#

So you get user data and... then what

crystal wigeon
#

hang on

umbral zealot
#

are you creating full 10-minute videos with sound processing or something? lol

crystal wigeon
#

so im assuming message.send("some data") is an api call?

earnest phoenix
#

correct

crystal wigeon
#

and message.edit()

#

also is an api call

earnest phoenix
#

also correct

solemn latch
#

anything where discord has to do something is an api call

crystal wigeon
#

create embeds should not be an api call correct?

earnest phoenix
#

i.e. REST

crystal wigeon
#

ok lemme show you what my bot does

solemn latch
#

sending an embed is an api call, just making the embed is not.

crystal wigeon
#

got it

#

so yeah iam sending embeds

#

and then editing that embed

#

so here i cant be sure how many times this gets called

umbral zealot
#

That's pretty much nothing, like, generating those 2 progress bars is something, but it shouldn't require so much processing power, that's super simple

solemn latch
#

his cpu power isnt the issue

crystal wigeon
#

yes but the edit api call

solemn latch
#

we already determined that

crystal wigeon
#

yep

umbral zealot
#

How often are you editing though

crystal wigeon
#

yeah like 2 secs?

#

2 - 5

#

secs

umbral zealot
#

when a command is sent, or on a timer?

crystal wigeon
#

it invokes on a command then its just a timer until the health is 0

solemn latch
#

if multiple people use the command in a channel, you could hit the ratelimit quite easily.

crystal wigeon
#

which spikes the ping?

solemn latch
#

a single person probably wont

#

if it cant send any messages because of that ratelimit yeah

crystal wigeon
#

yeah my bot went viral 2 days ago and my server got flooded with 200 users who wanted to iuse the bot

#

and then starting sending commands in channels

solemn latch
#

so, on my game bot, i had restrictions for only one game in a channel at a time.

crystal wigeon
#

now i know why i get those missing message nad not permitted by discord error

earnest phoenix
#

limit those battles or whatever they are to one per channel

#

yeah

#

what woo said

solemn latch
#

as many ratelimits are per channel, that may solve your issues

crystal wigeon
#

ok so my question is

#

how is another game bot

#

able to not get rate limited?

solemn latch
#

ratelimits are very often per channel

crystal wigeon
#

there is literally a bot called anigame

#

which is same as mine

lusty quest
#

throw more processing power on it. or use a language that is multi threaded

solemn latch
#

we already determined its not cpu power

crystal wigeon
#

python is multithreaded?

#

yeah not cpu issue

#

the latency is due to discord being rate limited the commands right?

lusty quest
#

well then more stuff like C# C++, GO, Rust

solemn latch
#

probably.

#

I would look into the ratelimit event

slender hamlet
#

I think the python api is a bit looser

#

In terms of rate limiting

earnest phoenix
#

keep in mind that node often isn't able to take use of your hardware to it's fullest potential

crystal wigeon
#

if the bot gets verified, will the rate limit thing exceed or something tho?

earnest phoenix
#

consider using langs superbrain listed

crystal wigeon
#

yep im well aware of that

#

it only uses like 500 memory

#

this is just one instance

lusty quest
#

how many guilds?

crystal wigeon
#

160 guilds

#

600 players

lusty quest
#

wow what did you store in memory?

crystal wigeon
#

the test bot is just a replica of original bot which is in 160 guilds but the player base is same since im usign same db

lusty quest
#

did you do a lot of image manipulation?

crystal wigeon
#

yeah but its compressed

#

and on a canvas

lusty quest
#

yea the Canvas stuff will bog your bot down

crystal wigeon
#

wym

lusty quest
#

its slow and will take some time to render

crystal wigeon
#

thats not the issue here tho

#

yes it does take few seconds

lusty quest
#

well you got the issue that you have high latency. what if of the 160 Guilds 6-12 render an Image at once.

crystal wigeon
#

so will getting the bot verified increase the rate limit thing or something?

lusty quest
#

nope

#

unless you hit 400k Guilds then you have to contract Discord Support bcs you need the other API access

crystal wigeon
#

i see

lusty quest
#

yea and js is single threaded

earnest phoenix
#

consider switching to another language

#

node just isn't as powerful for this task

lusty quest
#

canvas will render one after the other

crystal wigeon
#

yeah js is single threaded, but i have workers jsut need to figure out how to share the message and client, tho switching to another language would be i'll have to re-do the bot

#

also idk go

#

only python

#

and its also single threaded ?

#

ig

lusty quest
#

python is not that better

crystal wigeon
#

yea

#

its slower than js

lusty quest
#

consider a compiled language

sudden geyser
#

It's not any better for the job.

lusty quest
#

like the ones ive listed a short while ago

earnest phoenix
#

i would personally suggest c# because it has this powerful tasks api

you can run tasks in parallel and throwing them into another thread will automatically be handled when needed

crystal wigeon
#

well there's a learning curve for me there

lusty quest
#

its a bit harder to learn than js

crystal wigeon
#

idk any of those languages xD

#

yeah

lusty quest
#

but not impossible

crystal wigeon
#

i was gonna learn go for ML but was told its no that poppular and im better off learning something else

lusty quest
#

if you know js you will find some stuff that is similar in most languages

#

C# got ML.Net a quite powerful ML package

#

ive got recently into Rust and for now i like it (still havent really used it im still working throu the docs)

earnest phoenix
#

why does this happen when my prefix is m.

#

?

lusty quest
#

?

#

your bot doesnt respect the prefix?

earnest phoenix
#

lol

#

do i have to make it ===

lusty quest
#

ohh now i get it the bot rates itself

earnest phoenix
#

THE PREFIX

lusty quest
#

language?

earnest phoenix
#

english

#

?

lusty quest
#

๐Ÿคฆ

crimson vapor
#

dev language

lusty quest
#

programming lang

earnest phoenix
#

i think he means the bot language

crimson vapor
#

coding language

earnest phoenix
#

oh

#

lol

#

discord js

crimson vapor
#

js I assume

#

yea

#

show your code for your prefix

earnest phoenix
#

uhh

#

its a string

crimson vapor
#

how do you check if it stats with the prefix

#

show that

earnest phoenix
#

i do

#

(message.content.toLowerCase() === `${prefix}roll`)

crimson vapor
#

oh

crystal wigeon
#

lol

earnest phoenix
crystal wigeon
#

lmao

earnest phoenix
#

Hello, it's normal that the bot is inactive ??

lusty quest
#

did you login with the bot?

solemn latch
#

if you dont run it, yeah its normal.

earnest phoenix
#

Yes the bot has been active in my server until now

#

@earnest phoenix and where is the main command line of the ${prefix}?

like this

const prefix = pre.fetch(`prefix_${message.guild.id}`);```
#

Are we talking about the Giveaway bot ??

crystal wigeon
#

btw last question, so even if i try to multi processes the traffic, i'll still hit the rate limit thing right?

solemn latch
#

theres like 100 giveaway bots

earnest phoenix
#

1000*

lusty quest
#

yes the ratelimits stay the same

earnest phoenix
#

It's called giveaway bot

#

how original

earnest phoenix
lusty quest
#

he probably loads it from the json

earnest phoenix
#

yeah...

lusty quest
#

if you console.log your prefix it also logs it correctly?

earnest phoenix
#

I doubt if that is a smart thing to do while it can be much easier in 1 line

const prefix = 'm.';```
lusty quest
#

yea but hardcoding such stuff is bad practise

earnest phoenix
#

uhm

lusty quest
#

and what if he wants to reference it in mutiple files?

earnest phoenix
#

so i just make it a const inside the main file

#

fair enougjh

#

and now good?

#

so whats wrong with the string in the json file?

lusty quest
#

loading it from the json is fine

earnest phoenix
#

okay

#

ill test it out

#

ok

lusty quest
#

just dont use json as a "Database"

earnest phoenix
#

quick.db is better

lusty quest
#

barebones sqlite is better. quick.db is extremely restricting

earnest phoenix
#

still returns the command

#

with a different prefix

lusty quest
#

console.log(prefix) does your prefix ends up in your console?

earnest phoenix
#

yes

#

it sends m.

#

in log

#

if its a different prefix

#

like

#

r.

#

i still returns m. in log

lusty quest
#

could you make a small screenshot or copy/paste of your code? maybe there is something else wrong. Also make sure to not include any token

earnest phoenix
#

then something else is not right in your message event.

make sure everything is in the right order

#

ok

#

i mean

#

ill send you lol

#

my code is messy

#

but ill sends

lusty quest
#

cant be worse than other stuff i saw here

earnest phoenix
#

want me to send in dm?

lusty quest
#

i dont do DM stuff

earnest phoenix
#

sure

#

Sending it here would help others figure out the issue if one person can't

#

uhh

#

which means i have to send all of my bots code

#

We don't need the entirety of your bot's code, just the parts you defined and used the prefix

#

Starting points of your message event would suffice

#

    const args = message.content.substring(prefix.length).split(" "); // prefix split

    switch(args[0]){```
crimson vapor
#

I see

#

ok

earnest phoenix
#

everything else is case

#

except for

crimson vapor
#

you're only checking the length

lusty quest
#

use a codeblock in the future 3x `

earnest phoenix
#

ok g

crimson vapor
#

```

earnest phoenix
#

i know

#

That's not where the issue is occurring i assume, may you show us where you're defining your prefix

#

right

#

lol

#

so its just prefix

#

i dont need length

#

i think not in the message event

#

uhh

#

wait

#

monbreyFacepalm You're planning to set your prefix accordingly but setting it outside the event listener

#

If I want administrator to use this command do I just put administrator in line 14?

#

like this

bot.on('message', async message => { // message async due to vrcuser and other commands not present for right now
    const prefix = 'm.';
    const args = message.content.substring(prefix.length).split(" "); // prefix split

    switch(args[0]){```
#

thank you @earnest phoenix and everyone else

earnest phoenix
mellow kelp
#

@earnest phoenix but you probably don't need administrator permissions

lusty quest
#

he just suggests him to hardcode the prefix and ditch the config file

mellow kelp
#

no bot needs the whole administrator permission, so you should just check the individual perms you need

earnest phoenix
#

Cant I just put

#

This channel, development in a nutshell KEKW

#

administrator

#

Ima just do that

mellow kelp
#

well k

earnest phoenix
#

Permission flags are all uppercase

#

...

mellow kelp
#

dot dot dot

earnest phoenix
#

@mellow kelp is it with caps or just smoll letters?

mellow kelp
#

caps

earnest phoenix
#

Dotpost combo

crystal wigeon
#

smoll

earnest phoenix
#

Administrator

crystal wigeon
#

lmao

earnest phoenix
#

Correct?

#

@crystal wigeon I was doing it for fun lol

#

Read my message

crystal wigeon
#

ADMINISTRATOR

earnest phoenix
#

i have it so and works perfectly KEKW

 const pre = new db.table(`guild_${message.guild.id}`);
    const prefix = pre.fetch(`prefix_${message.guild.id}`);
    const pre1 = new db.table('serverside');
    if(!prefix){
        pre.add(`prefix_${message.guild.id}`, '!>');
    }
    if(message.author.bot) return;
    if (message.content.indexOf(prefix) !== 0) return;
    if(!message.member) message.member = await message.guild.fetchMember(messsage);
    if(!message.guild) return;

    const args = message.content.slice(prefix.length).trim().split(/ +/g);
    pre1.add(`used`,1);
    const cmd = args.shift().toLowerCase();

    if(cmd.length === 0) return;
crystal wigeon
#

permissions are all in uppercase

earnest phoenix
#

i dont get it

crystal wigeon
#

smol

earnest phoenix
#

Alr thanks ๐Ÿ™‚

#

This channel

#

๐Ÿฅ„

lusty quest
earnest phoenix
earnest phoenix
mellow kelp
#

fax

earnest phoenix
#

my question wasnt helped

#

lol

#

i still dont understand

lusty quest
#

what is the question?

#

does the prefix still doesnt work?

earnest phoenix
#

mhm

earnest phoenix
#

const args = message.content.substring(prefix.length).split(" "); // prefix split

#

I never said that

earnest phoenix
#

Million did

#

bro

#

tell me why you tryed helping and it did nothing

earnest phoenix
#

and said

#

do this

#

i already had a string for the prefix

#

you code is fucked up waitWhat

#

thanks

#

gathered

lusty quest
#

lol his code is fine?

#

for a basic bot

earnest phoenix
#

and not working

#

Chat, thanks for brutally ignoring whatever i said

#

am i missing semi colons lmao

lusty quest
#

they are not really needed

earnest phoenix
#

joke*

sudden geyser
#

Pup I think you forgot to wrap <2021> under <2020> /s

earnest phoenix
#

huh

#

"development"

#

oh

#

my rich presence

sudden geyser
#

yes

lusty quest
#

did you trim your args before splitting? incase there are whitespace

earnest phoenix
#

@earnest phoenix and what about if you try this as args?

const args = message.content.slice(prefix.length).trim().split(/ +/);
earnest phoenix
#

i think he meant me

#

and no

#

my code is working perfecly

#

it is something else

#

Oh

#

yeah

#

i would send you my stuff

#

if you want

#

lol

#

Just do it

lusty quest
#

maybe go step by step to check if there is something going around your args

earnest phoenix
#

Let's see what's wrong

#

ok booss

dusky sundial
#

Has anyone here ever tried running two redis services at once?

lusty quest
#

its easy if you use containers

#

just bind them to different ports

dusky sundial
#

Yeah, I'm trying to

lusty quest
#

but why did you need 2?

dusky sundial
#

2 bots

#

I'd like them to use two different dbs

crimson vapor
#

redis is just a cache

lusty quest
#

just use unique keys

crimson vapor
#

you can just prefix with the bot's discrim or smth

lusty quest
#

i use the Same redis and Mongo Server for 4 Bots and a WIP Dashboard

dusky sundial
#

I'm pretty new to databases, especially redis. Would I just set the key to something like my bot's id and then store the entire data of the bot as a json string as a value to that key?

lusty quest
#

how did you plan to store stuff?

dusky sundial
#

Uh

#

How do you mean?

lusty quest
#

like what did you store?

#

some examples

dusky sundial
#

Well for one of my bots I wanna store currency

earnest phoenix
#

you're aware redis is memory only, right?

dusky sundial
#

yeah

earnest phoenix
#

it's no different than storing the data in your code

lament rock
#

Redis offers disk persistence

lusty quest
#

then just add to each prefix the id of the bot to make it unique to the bot. but for Persistant storage i would use a Database and then cache it in redis

dusky sundial
#

What database would your recommend?

lament rock
#

For stuff like econ, a structured database like any SQL based solution such as MariaDB/MySQL would be very good. Redis is more for Object caching for worker nodes to access

lusty quest
#

Mysql, MongoDB, Postgres are the 3 most used

#

(atleast for Bots)

#

each of them got theyre ups and Downs

lament rock
#

MariaDB is probably the most performant SQL server

lusty quest
#

would not bet on it, Cassandra is also extremely fast

lament rock
#

Is Cassandra SQL

lusty quest
#

yes

#

Discord uses it for Storing Messages

pale vessel
#

used it

lusty quest
#

wait nvm

#

its Wide Column Store based of Big Tables and DynamoDB

lament rock
#

I just use Maria since it's an open fork of MySQL which means supporting the same IOPS

lusty quest
#

uses CQL

lament rock
#

You must have gotten SQL and structured confused

#

If you're feeling quirky, you could get away with Mongoose

lusty quest
#

MongoDB is relatively easy

#

i use it now for a While and its nice, used Mysql before

lament rock
#

Some of the wrappers I've seen more resemble ORMs than wrappers which I don't particularly like.

lusty quest
#

Mongoose is nice, but if you want something faster use plain mongodb instead

#

one thing that is sad with mongodb is that you need a license for in memory storage engines

earnest phoenix
#

postgres + orm is heaven

#

you'll probably get the most support with postgres too due to it being oss

#

i fixed the issue for now using

#

if (!message.content.startsWith(prefix)) return;

cinder patio
#

Try sequelize if you are looking for an ORM

lament rock
#

If you're a masochist, write your own ORM

#

Generics aren't painful at all

solemn leaf
#

its for design?

#

why does it suck

#

without it all sites would looks hit

earnest phoenix
#

Can someone uh help me test my bot?

#

Me

#

Dm

#

Alright thanks

stable eagle
#

DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.

Where can I change that?

lament rock
#

Read the error stack

#

the first frame from the top is where the error originated from

distant cobalt
#

How do you check if the bot has any permissions ? In djs

earnest phoenix
#

<message>.guild.me.hasPermission("perm");

#

souh why is my bot not working on other servers itโ€™s only working in mine

#

Iโ€™ve updated gave it administrator perms but it still wonโ€™t work

dusky sundial
#

Define "working"

earnest phoenix
#

What?

#

Well the uh commands are only working in my server

dusky sundial
#

Like, are none of the commands working or is it offline etc.?

#

Okay

#

Well, does it print any errors when the command fails?

earnest phoenix
#

Nope just dosent even respond

#

Only in my server

dusky sundial
#

Is there anything in your bot that's only supposed to work on your server?

earnest phoenix
#

Nope

dusky sundial
#

And the bot has permissions to send messages in the channels you're trying, yes?

earnest phoenix
#

Yes

dusky sundial
#

Pretty hard to say what the issue might be without seeing the code

earnest phoenix
#

Is it fine if you can take a look?

#

Cuz thereโ€™s like 8 commands

#

And uh I can really take pics of them all

dusky sundial
#

I'm guessing you're doing js, which I'm not too experienced with.

solemn latch
#

you should use hastebin

cinder patio
#

send the link to the repl

#

we can all see your code3

earnest phoenix
#

Alrighty

earnest phoenix
#

Alr

#

Uh wtf

#

I can only send in DMโ€™s since people can copy my token or something

solemn latch
#

repls are public anyway even if you dont hand out the link

#

which is why you put your token in the environment variable

#

which you should do now

earnest phoenix
#

I didnโ€™t but thereโ€™s something but nvm..

solemn latch
#

random unused if statement on line 76 index.js if (message.content.startsWith("") )

earnest phoenix
#

No, if I remove it for some reason the uh

#

Coding gets ruined

quartz kindle
#

im pretty sure i told you to remove that line before lmao

earnest phoenix
#

@quartz kindle remember I did?

cinder patio
#

aliases: "dep" && "put"

earnest phoenix
#

Then the bot stoped working

quartz kindle
#

that doesnt mean it should be there

#

that just means you have bigger problems that are being hidden by that

earnest phoenix
#

Well, I canโ€™t really do much

cinder sandal
#

that if statement is useless because you can't send messages with 0 characters

earnest phoenix
#

And uh, so why is my bot not working?

cinder sandal
#

do you have any errors in the log

cinder patio
#

two message listeners ๐Ÿ‘€

earnest phoenix
#

Nope

earnest phoenix
quartz kindle
#

@earnest phoenix btw, you just leaked your token

dusky sundial
#

So if you remove the redundant if statement, does it still not give any errors?

earnest phoenix
#

Thatโ€™s why? Bruh

cinder patio
#

Nah that's old

earnest phoenix
#

Yea I think thatโ€™s old

#

Uh

#

Reset that prefix(?

#

Why?

#

._.

#

Oh

cinder sandal
#

do any of your if statements have the prefix mentioned

earnest phoenix
#

I mean token

quartz kindle
solemn latch
#

lol

earnest phoenix
#

Wait I think I found out

#

Lol

solemn latch
#

oo

#

what was it

earnest phoenix
#

1 sec

#

Wtf still not working

#

Why does it work in my server then

#

But not in other servers

cinder patio
#

maybe it's because you don't know what you're doing... just a speculation

solemn leaf
#

didnt know string#green was a thing

earnest phoenix
#

@cinder patio but how tf does it effect the other servers???

cinder patio
#

if you didn't copy code from 100 different places you wouldn't be here asking us this

earnest phoenix
#

Well not all are copied

#

And it has nothing to do with that

#

Itโ€™s just working on my sever

solemn leaf
#

not all

earnest phoenix
#

This is the uh invite link

solemn leaf
#

@ember atlas

earnest phoenix
#

Not advertising-

#

Bruh this guy-

#

I just wanted to show if there was something wrong with the link..

solemn leaf
#

How can the invite link be wrong

cinder patio
#

That's exactly what the problem is. You don't know what your own code does. Your index file has code from 3 different tutorials. You can't just copy and paste code from different codebases and expect it to work

earnest phoenix
#

@solemn leaf something with perms..

#

@cinder patio all commands work in my server not in others

ember atlas
#

Hello

#

What can I fix today @solemn leaf

solemn leaf
#

they deleted thanks continue killing people

earnest phoenix
#

Bru-

#

So why is the uh

#

Not working

solemn latch
# earnest phoenix Bru-

not that this is the reason your bots not working, but

    if (command.staff && !message.member.hasPermission("BAN_MEMBERS")) return message.reply('You must be an administrator to execute this command!');

your telling people you must have admin, but are requiring ban members

#

might be confusing.

earnest phoenix
#

OH YES OMG LOL

#

@solemn latch thanks lol

solemn leaf
#

wow that was stupid

ember atlas
#

@earnest phoenix Glad you got your answer but I unfortunately have to mute you for advertising. Sorry.

#

-m @earnest phoenix posting their invite link to their bot in #development without being prompted to | 3 days

gilded plankBOT
#

๐Ÿค Muted pepoo the coder#7362 (@lean jungle)

solemn latch
#

thats boss for you pogey

solemn leaf
#

yo

#

is there a way to get my html from my old bot page or do I have to remake it all

solemn latch
#

denied bots descriptions are not stored

#

^ if its not denied its there

solemn leaf
#

that css thou

#

it was so good

#

welp

#

ill see if I can find snippits of it in this discord

solemn latch
#

its why we generally advise users to back them up.

ember atlas
#

Personally if your bot isnt approved yet dont do fancy HTML, wait until its approved

solemn leaf
#

I had it backed up

ember atlas
#

In most cases after approval you'll be contacted before removal so it's better

solemn leaf
#

4 months ago

#

kk

#

ill just do no css

smoky garnet
#

i deleted all emoji

solemn leaf
#

what

#

what

#

rip

#

cya robot

#

nice knowing you

wet dove
#

-atmods

gilded plankBOT
#

@smoky garnet

Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.

Here are some examples of emergencies:

  • Raids / Multiple members mass spamming.
  • Severe disruption of Discord's ToS (NSFW content, etc)
  • Anything that requires more than 2 moderators to handle.
dusky sundial
#

Why would you tag mods for an issue with emojis? upsidedown_thinking

smoky garnet
#

have pr

flat pelican
#

Why did you ping us??

solemn leaf
#

just pinged 20 people

#

๐Ÿคฃ

ember atlas
flat pelican
#

what's "emote issue"?

smoky garnet
#

was declined.

dusky sundial
flat pelican
#

Did you seriously ping 25 moderators for a decline in a channel where you are supposed to talk about code and app developpement?

smoky garnet
#

hehehehe

#

sorry

flat pelican
#

that's not funny

earnest phoenix
#

it's the being dumb for me

smoky garnet
#

sorry

flat pelican
#

people and common sense: ๐Ÿง 

dusky sundial
#

I hope this guy is drunk lmao, otherwise I'm not sure anymore

#

there's people for everything

smoky garnet
#

bro there is not problem for you do you know @dusky sundial

earnest phoenix
#

this feels like talking to cleverbot

dusky sundial
#

I'm not sure what that means, but thank you?

solemn latch
#

oml cry

smoky garnet
solemn leaf
#

@earnest phoenix

earnest phoenix
#

help, i need a vps, can you recommend me something specific?

solemn latch
#

galaxygate

misty sigil
crimson vapor
misty sigil
#

thanks but its full of purple goop

earnest phoenix
#

Something specific, more powerful, for a complex bot, you understand?

misty sigil
#

ah i see

crimson vapor
earnest phoenix
#

=)))))

crimson vapor
#

when you fucking drop it

#

twat

solar crane
#

ุงู„ูˆูˆูˆ

earnest phoenix
#

Uhum

misty sigil
#

you could probably go for the 10/month galaxygate plan

crimson vapor
#

gg?

earnest phoenix
#

It doesn't matter the price

crimson vapor
#

well how many cores and threads as well as ram do you need?

earnest phoenix
#

Idk, 2/4/8 cores, and 4/8 gb ram

lament rock
#

Some VPS providers I've used are: Vultr, OVH and Contabo.
Vultr has some decent pricing for high frequency core clocks.
OVH has a low core clock with 1 core but 2GB of ram at $3.5 USD which is pretty good for a small "ram heavy" project.
Contabo has a low core clock but 4 cores and 8GB of RAM. Kinda sus pricing - $6/m for a VPS in the US but I have 2 instances through them and nothing sus yet.

earnest phoenix
#

Uh, thx vm

slender wagon
#

oh this is waht i wanted to talk about lol

earnest phoenix
#

Lol

crimson vapor
#

well they buy old hardware and sell it for cheap

#

like 256 gb ddr3 isnt that much

lament rock
#

I forget which Xeons their docs say, but I imagine dual Xeons isn't relatively cheap

earnest phoenix
#

Aham, understand

#

Thx so much

slender wagon
#

contabo doesn't include a ssl certificate?

solemn latch
#

dont think most vps providers do ๐Ÿค”

slender wagon
#

how come ssl is free in providers like vercel

lament rock
#

Because certbot

solemn latch
#

vercel seems to be more web focused

lament rock
#

Getting an SSL cert through LetsEncrypt is literally free

slender wagon
#

can that be done in contabo or are u forced to buy it as a add on

solemn latch
#

actually vercel seems 100% web focused, rather than general VPS hosting.

#

letsencrypt is free always

#

afaik

crimson vapor
#

yea

lament rock
#

LetsEncrypt can be done on any machine running Windows or Linux. I'm not sure about the specifics of other OS'

#

It all depends on what you choose

slender wagon
#

so to get a ssl certificate you'll have to pay for it and renew it every 12 months?

lament rock
#

No? When did I ever mention that

solemn latch
#

letsencrypt auto renews it for you.

slender wagon
#

no i mean

solemn leaf
#

No Im pretty sure you can get ssl for free

slender wagon
#

if i use contabo

solemn latch
#

once you setup letsencrypt you dont have do do anything again

lament rock
#

If they offer paid SSL, it's probably through someone other than LetsEncrypt

slender wagon
lament rock
#

LOL

#

just setup LetsEncrypt on the machine and get a cert for free for life

slender wagon
#

oh so there is a way to get through that too

#

lol

solemn latch
#

yeah

slender wagon
#

alright

#

thanks

lament rock
#

Also, pretty sure you have to run a script every so often to renew a LetsEncrypt cert. I just have a cron for it so no big deal.

slender wagon
#

i mean that can be done lol

solemn latch
#

when you setup letsencrypt pretty sure they have an option to auto renew built in, i havent done it in over a year so i dont quite remember the process.

topaz fjord
#

yes they do

slender wagon
#

is making a site using a theme and then implementing your own backend good, or should i rather work with wordpress

lament rock
#

Ah. Hm. Might be something new they're offering then or something I skimmed over.

#

Depending on what the website does, you don't need a backend other than simple HTTP request handling

slender wagon
#

no i mean it's like fully customized and there are alot of stuff i am sure i can't do in wordpress

topaz fjord
#

also you do know that the certificate isn't free right?

slender wagon
#

which certificate

topaz fjord
#

which most likely covers the cost of the certificate

slender wagon
#

but can't i do that when i run the machine

#

like the other guy said

lament rock
#

That's why we recommended setting up LetsEncrypt since that is free

slender wagon
#

Yup gotchya

charred pumice
#

With ytdl-core is there a way to skip to a certain part of the video?

solemn latch
#

did you look at the ytdl-core docs like someone said yesterday?

charred pumice
#

I had to leave after yesterday my bad

#

My internet went out

solemn latch
#

ah, yeah. iirc, they said its called skip, and it would be in the docs.

charred pumice
#

Ah thanks

dense flare
#

if a new feature of my bot needs more permissions, will everybody have to kick and reinvite the bot to use this feature?

earnest phoenix
#

they can edit the permission

mellow kelp
#

you could check for permissions before doing the new thing

#

and send a message saying which permissions your bot needs

dense flare
#

but there is no automated way to prompt the server admin to the auth2 site to accept the new permissions?

earnest phoenix
#

Hi how long do you have to show up bot in the search?

slim void
slim void
earnest phoenix
#

oh ok thx

slim void
#

No problem.

earnest phoenix
#

How i can put a canvas buffer in new MessageEmbed().setImage()?

mellow kelp
#

you gotta create an attachment with the buffer

earnest phoenix
#

Yes

mellow kelp
#

then use attachFiles() to attach it and set the image to attachment://<your-attachment.png>

earnest phoenix
#

๐Ÿ’

mellow kelp
#

what's your code?

earnest phoenix
mellow kelp
#

you must attach a MessageAttachment

#

and it's an array .attachFiles([attachment])

earnest phoenix
earnest phoenix
pure lion
#

How can I sort an array of mongoose documents by an element inside of the documents?

mellow kelp
#

pretty sure Array.sort will do the trick

pure lion
#

Ah okay

#

Makes sense tbf

mellow kelp
#

yea

frail siren
#

what do we all use to host our bots?

lament rock
#

Depends on your needs. Do you need a lot of RAM? A multi core CPU? What's your budget? How many guilds is your bot in and how many do you expect it to be in down the line?

hoary vine
#

๐Ÿ˜ซ

umbral zealot
#

What were you trying to do, exactly?

hoary vine
#

make a bot

umbral zealot
#

No, I mean, exactly

#

what did you do to get to this error

hoary vine
#

idk

umbral zealot
#

you don't know what you're doing?

solemn latch
#

making your bot invite link?

umbral zealot
#

well there's probably not much we can help with then if you have no idea.

#

You were somewhere just before that screen. what was that "Somewhere"

hoary vine
#

when i finished verifying it showed that

umbral zealot
#

verifying what?

hoary vine
#

to add the bot

umbral zealot
#

Where were you Before this screen?

hoary vine
#

verifying to add my bot

umbral zealot
#

WHERE

mellow kelp
#

i love this channel

umbral zealot
#

verifying where

#

on what site

#

app

#

page

#

where were you specifically and exactly

hoary vine
mellow kelp
#

works fine for me

hoary vine
#

what

umbral zealot
#

remove response_type=code in the end, I don't know why you had that there but it shouldn't be there.

hoary vine
#

how

umbral zealot
#

by... using the backspace key on your keyboard...

#

you know like

#

using... the computer... MarioFP

hoary vine
#

OMG

#

IT WORKED

#

LEMME CHECK IF IT WENT INTO THE SERVER

umbral zealot
#

please god help me notlikethis

solemn latch
#

probably dont click buttons you dont know what they mean when developing stuff.

hoary vine
#

and its offline

solemn latch
#

when you where making your invite link, seems you clicked "require code grant"

hoary vine
#

how do i fix it being offline :/

solemn latch
#

bots have to be ran on a server

#

and developed with code

umbral zealot
# hoary vine how do i fix it being offline :/

You appear to have a fundamental misconception about the nature of bots. A bot is not something you create and "get online", instead it is a program that runs on a computer somewhere and interacts with Discord's API, sort of pretending to be another user that just happens to respond automatically. A bot account you create on Discord's website is merely a (mostly) normal account that you use with the API instead of with the regular Discord client. Creating a bot account doesn't mean you automatically get a fully functioning bot for your server, you still have to write a program that actually provides the logic for the bot. This requires programming knowledge, and you must know a programming language.

hoary vine
#

i made code how do I add it

solemn latch
#

you have to run the code

hoary vine
#

how

solemn latch
#

since you made the code, i would guess you know how to do that

#

oh

hoary vine
#

this is my first bot

solemn latch
#

did you make the code, or just copy paste it ๐Ÿค”

hoary vine
#

made it

solemn latch
#

then you should know how to run it

umbral zealot
#

did you type any code

#

like, programming code

hoary vine
#

yes

umbral zealot
#

Where did you type this code

hoary vine
#

should i dm the code

umbral zealot
#

no

hoary vine
umbral zealot
#

I....

rustic nova
#

If you made the code, you probably also know how to run it

solemn latch
#

my favorite code editor

umbral zealot
hoary vine
#

can you tell

rustic nova
#

Then you did not make the code if you don't know

umbral zealot
hoary vine
#

?

#

how do i run the code

umbral zealot
#

go learn programming first

#

you seriously need to actually take the time to learn

solemn latch
#

we actually dont know either, since we dont know what language its written in

#

its such an open ended question no dev can answer it with the information we have

hoary vine
#

its in javascript

long marsh
#

Woah! What a day! Switched out all Discord.Collections() to leverage redis instead (leveraging Keyv). Fixed a ton of stuff ๐Ÿ‘. Thanks for you help yesterday, Woo!

solemn latch
#

in your command prompt with the directory set to your bots folder it will be
node filename.js
@hoary vine

solemn latch
long marsh
#

Oh wait ... did I just read notepad

#

wtf

solemn latch
#

yeah, its one of those days in dev pandasad

long marsh
#

๐Ÿ˜„

umbral zealot
#

yep

long marsh
#

๐Ÿ˜ฌ

solemn latch
#

i dont know how to explain that any clearer tbh

umbral zealot
#

"Here I've been doing coding for like 5 minutes HELP ME NAOW"

long marsh
#

Next question: "What's a terminal"

umbral zealot
#

seriously

#

don't waste our time and yours

hoary vine
#

send video

umbral zealot
#

I already sent you the resources.

solemn latch
#

videos are a bad resource for learning js and discord bots

gilded olive
#

discord bots specifically*

umbral zealot
#

There is no 5-minute video to teach you weeks/months of programming

solemn latch
#

lots of bad practices, old information, and misinformation

long marsh
#

You got it, lol

solemn latch
#

great minds think alike @long marsh ๐Ÿ˜„

long marsh
#

All it needed was a redis url + 3rd party redis integration

solemn latch
#

oh, thats lucky. honestly havent used redis yet.

umbral zealot
#

it's funny because that's the same methods I use on enmap and josh ๐Ÿ˜‚

long marsh
#

And, of course, a little snippet in my docker-compose.yml file ๐Ÿ˜‰

  redis:
    image: redis:alpine
    ports:
      - 6379:6379
#

Runs it alongside my bot docker container ๐Ÿ‘

#

All my shards will open connections to the container (debatable ... should probably create an API container ... but eh)

hoary vine
#

should i?

long marsh
#

๐Ÿคญ

umbral zealot
#

sure. yes. vscode is perfect

hoary vine
#

it is?

long marsh
#

lmao

#

Nah, Charen's lying.

#

Kidding, yeah. It's good ๐Ÿ‘

hoary vine
#

k

long marsh
#

I use it ๐Ÿ˜„

umbral zealot
#

VSCode is used by over 50% of programmers, according to a StackOverflow survey.

long marsh
#

I can believe it

hoary vine
#

its downloading

long marsh
#

The only language I had trouble with using it for was Java.

gilded olive
#

java is more intellij

umbral zealot
#

yeah but that's because you should be using IntelliJ IDEA for Java ๐Ÿ˜„

long marsh
#

Absolutely agree

#

The java team at my job is the only department that uses IntelliJ

umbral zealot
#

makes sense

long marsh
#

Charen, are you a software dev?

#

In a career sense, I mean

#

Feel free to not answer - prob not the place for it.

umbral zealot
#

In a career sense I'm currently jobless but I'm a senior react dev, yeah

long marsh
#

React ๐Ÿคข

#

It's not bad, haha. I'm a 'Backend' Developer at my job

umbral zealot
#

Backend ๐Ÿคข

long marsh
#

That's fair

umbral zealot
#

j/k I write a lot of nodejs, I'm pretty full stack tbh

long marsh
#

Yeah, I'd imagine

earnest phoenix
#

how can i get my bot off from heroku?

umbral zealot
#

"off from"?

gilded olive
#

hosting on*

earnest phoenix
#

turn off

#

i mean turn off

mellow kelp
#

you mean turn off?

solemn latch
#

im so lost

mellow kelp
#

resources tab -> turn off your worker

long marsh
#

Barnie, are you asking how to transition your bot to another host provider or turn it off?

umbral zealot
#

you can turn your Application off from the heroku control panel

earnest phoenix
#

turn it off

mellow kelp
earnest phoenix
#

oh right

#

thx

long marsh
#

Yeah, there's a page that has the dyno where you can turn it off ๐Ÿ‘

hoary vine
#

opening vsc

long marsh
#

Haha, we don't necessarily need updates of that my guy.

crimson vapor
#

Next message: opening folder

long marsh
#

๐Ÿ˜„

umbral zealot
#

If we start getting update every 5 minutes for the next month I'm going to lose my mind.

long marsh
#

At the ending of the day, they're lacking some major fundamentals. Instead of asking for help, they should be learning how to research it themselves. Of course, I don't have to tell anyone this but them ๐Ÿ˜„

gilded olive
umbral zealot
#

I'm going to keep telling them anyway

long marsh
#

๐Ÿ˜„

umbral zealot
#

because rule 8.4

mellow kelp
#

man this channel is awesome

crimson vapor
#

Not all the time

long marsh
#

Anyone else here running their bot on Docker?

umbral zealot
#

personally I find no point in that

#

ยฏ_(ใƒ„)_/ยฏ

crimson vapor
#

I agree

#

Webservers make sense

long marsh
#

I like it for the development environment & the easy push to production. I have a full pipeline that basically just logs into the server and runs a few docker commands to respawn the application.

#

And, I can rollback the bot to a specific version anytime.

gilded olive
#

i cant even install docker on my pc SoWeary

crimson vapor
#

True itโ€™s efficient

long marsh
#

And, for local development, it's easy just to build the image + run the docker container

umbral zealot
#

Docker's great when you share code or deploy, but like, for bots that's pretty damn overkill imho

long marsh
#

And, I know, it'll work on any computer.

long marsh
umbral zealot
#

yeah but how often do you need your bot to work on anything else than your dev PC or your host?

long marsh
#

I agree - it's not needed to run.

#

Future proofing ๐Ÿ˜ฌ

umbral zealot
#

I already have crap to install to get my bot running, personally I don't care much for adding more layers of complexity

long marsh
#

See, I don't ๐Ÿ˜„

#

Just docker

mellow kelp
#

imagine running your bot on kubernetes

long marsh
#

I don't use kubernetes ๐Ÿ˜„

umbral zealot
#

future proofing but docker probably won't be relevant in a few years

#

ยฏ_(ใƒ„)_/ยฏ

mellow kelp
#

who knows tho

long marsh
umbral zealot
#

an abstraction layer on top of docker

mellow kelp
#

for now i find docker kinda overkill

umbral zealot
#

which is an abstraction layer on top of the OS

#

which is in itself an abstraction layer on top of the kernel

#

which abstracts the hardware

long marsh
#

Abstraction may have not been the best word - better API? I'm trying to say that I don't believe docker will be obsolete. The Docker CLI itself may be, but not the technology.

umbral zealot
#

anyways

#

too much abstraction

#

I shall abstain

lament rock
#

I wouldn't want my application to restart when you can delete required files from require cache and then re-require and resync

#

uptime is pretty priceless

long marsh
#

Are you for or against docker ๐Ÿ˜„

lament rock
#

against the idea of respawning production worker nodes

long marsh
#

Oh, technically, the bot never actually sees downtime. Maybe a shard will.

opal plank
#

fuck me, i cant think of a proper way to setup my new stuff

long marsh
#

Or a collection of shards

lament rock
#

Thats the same thing... Having to reidentify to the gateway and go towards your 1000 daily rate limit is completely unnecessary

gilded olive
long marsh
#

๐Ÿค”

long marsh
opal plank
lament rock
#

What language do you use

gilded olive
#

what does that command do

long marsh
opal plank
#

stuffs with user

gilded olive
#

very informative

opal plank
#

trying to create a mail system

gilded olive
#

modmail?

long marsh
#

It doesn't matter that language though, unless you're specifically using a library.

opal plank
#

not quite

#

but mail like

gilded olive
#

wdym mail tho

opal plank
#

straight up mail

#

like, messages

gilded olive
#

like each user has like a inbox?

opal plank
#

mail

gilded olive
#

oh

opal plank
#

yeah

gilded olive
#

database time

opal plank
#

thats the issue

#

cant think of a good scaleable way to do it

long marsh
opal plank
#

i can think of plenty of ways to do it, none are good enough for my standards

gilded olive
#

๐Ÿ˜ญ

#

lower than your standards then

lament rock
#

There's this thing called require.cache
It's an Object keyed by file paths which holds references to required files. you can delete entries from the cache and then re-require files and the new exported data will populate that Object. You can then sync the result of the new require with old Objects to get new references

gilded olive
#

you use typescript right

opal plank
#

correct

opal plank
#

@quartz kindle can u gib halp with logic? im too dumbo

long marsh
gilded olive
#

oh you're looking for logic

#

like code logic or just thinking logic

opal plank
#

correct, i can apply almost anything

#

nah i need a framework

#

and i cant think of a good one

#

implementing is easy for me

solemn leaf
#

Erwin

opal plank
#

but i need a frame to work from

#

yes aki?

solemn leaf
#

Just find a good database

opal plank
#

imma bonk you so hard

lament rock
solemn leaf
#

No

opal plank
#

i know what im doing, i just dont know HOW to do it

#

if that makes sense

#

like i mentioned, i need a SCALABLE way

solemn leaf
#

Make members have a storage limit

opal plank
#

not the issue

solemn leaf
#

Hnm

lament rock
solemn leaf
#

Whats the issue

gilded olive
#

hmmm