#development

1 messages Β· Page 1396 of 1

limpid shadow
#

no srry i preesed wrong button

hollow sedge
#

ok

compact blaze
#

how would i have my source code on github such that my token does not get leaked

earnest phoenix
#

either read your token from an environmental variable

#

or .gitignore a file with your token in it

#

the approach with an environmental variable is more preferred though

compact blaze
#

i think ill have a different version of my code without my token online

#

and one on my local machine with the token

hollow sedge
#

you cant..

#

both of them need the token

earnest phoenix
#

literally just read from an environmental variable

#

lol

#

having different versions is so dumb

#

what's the point of using github then

safe creek
#
from discord.ext import commands
import os
import json 
import random




os.chdir("C:\\Users\\forth\\OneDrive\\Documents\\kigles\\eco.py")

client = commands.bot(command_prefix = "!")

@client.event
async def on_ready():
    print("Bot is ready...")

@client.command
async def balance(ctx):
    await open_account(ctx.author)
    
    user = ctx.author

    users = await get_bnk_data 

wallet_amt = users[str(user.id)]["wallet"]
bank_amt = users[str(user.id)]["bank"]

@client.command
async def beg(ctx):
 await open_account(ctx.author)

 users = await get_bnk_data 

users = ctx.author

earnings = random.randrange(101)

users[str(user.id)]["wallet"]   



em = discord.embed(title = f"{ctx.author.name}'s Balance",colour = discord.Color.blue())
em.add_field("name = Wallet",value = wallet_amt)
em.add_field("name = Bank",value = bank_amt)
await ctx.send(embed = em)



if str(user.id) in users:
        return False
else:
        users[str(user.id)] = {}
        users[str(user.id)]["wallet"] = 0
        users[str(user.id)]["bank"] = 0

    with open("bnk.json","w") as f:
        json.dump(users,f)
    return True


async def get_bnk_data():
    with open("bnk.json","r") as f:
        users = json.load(f)``` keeps giving errors ![notlikethis](https://cdn.discordapp.com/emojis/779088232042201130.webp?size=128 "notlikethis")
#

unindent does not match any outer indentation level (<unknown>, line 57)

violet haven
#

hi!

#

Ineed a little help

safe creek
#

k

violet haven
#

can u help me to understand something?

compact blaze
#

are there any free hosting options available?

violet haven
#
reponseDuServeur = objHTTP.responseText
    Debug.Print reponseDuServeur
    Quoi = Len(reponseDuServeur)
    Debug.Print Quoi

#

"OK" is the server's response

#

and Quoi is 8

#

Len() gives the length of the string

#

so why is the length = to 8

#

OK is just 2 so wtf

#
<?php
    $auth_success = "OK";
    echo $auth_success;
?>
#

php script that returns "OK"

safe creek
earnest phoenix
#

Indentation is like the basic of python

safe creek
#

ye ik but

#

it just errors no matter what

torpid axle
#

it seems like you have bad indentation on the first if else statement

#

sorry if im intruding-

earnest phoenix
#

Why are you returning there? The code below would be unreachable? MegaThonk

safe creek
#

ye ik

#

huh

#

want me to supply the full script?

earnest phoenix
#

Sure

safe creek
#

k

quartz kindle
earnest phoenix
#

Ye but, what's the point of that return though

#

Ig the with open should be indented inside the else statement

#

So should the return True. Nm, I still don't get what's the point of it MegaThonk

safe creek
#

My laptop just died

#

So that sucks

earnest phoenix
#

πŸ˜”

#

Also, don't do 2 tabs indent

safe creek
#
from discord.ext import commands
import os
import json 
import random




os.chdir("C:\\Users\\forth\\OneDrive\\Documents\\kigles\\eco.py")

client = commands.bot(command_prefix = "!")

@client.event
async def on_ready():
    print("Bot is ready...")

@client.command
async def balance(ctx):
    await open_account(ctx.author)
    
    user = ctx.author

    users = await get_bnk_data 

wallet_amt = users[str(user.id)]["wallet"]
bank_amt = users[str(user.id)]["bank"]

@client.command
async def beg(ctx):
 await open_account(ctx.author)

 users = await get_bnk_data 

users = ctx.author

earnings = random.randrange(101)

users[str(user.id)]["wallet"]   



em = discord.embed(title = f"{ctx.author.name}'s Balance",colour = discord.Color.blue())
em.add_field("name = Wallet",value = wallet_amt)
em.add_field("name = Bank",value = bank_amt)
await ctx.send(embed = em)



if str(user.id) in users:
        return False
else:
        users[str(user.id)] = {}
        users[str(user.id)]["wallet"] = 0
        users[str(user.id)]["bank"] = 0

    with open("bnk.json","w") as f:
        json.dump(users,f)
    return True


async def get_bnk_data():
with open("bnk.json","r") as f:
        users = json.load(f)``` keeps giving errors ![notlikethis](https://cdn.discordapp.com/emojis/779088232042201130.webp?size=128 "notlikethis")
#

Closest thing I can find

#

To my current one

earnest phoenix
#

man, the indentation is so awful

safe creek
#

Thanks Indian man that I copied this from I mean what

earnest phoenix
#
  1. @client.command -> @client.command()
  2. commands.bot -> commands.Bot
  3. your get_bnk_data function only load the json, but not returning anything, so the users would be None? MegaThonk
  4. users = await get_bnk_data this is not how you call a function
  5. fix your indentation \😳

There's like so much wrong with your code, ig you should def learn python before making a bot

#

bruh

#

why did it ping

torpid axle
#

im assuming i can ask this here cuz its more of a development issue i think but my bot keeps spamming command answers, but idk if its something wrong with the code. the thing is, it only spams on some commands and all of the phrase reactions but on others it doesnt. sorry to bother anyone ;-;

#

im new to bot development and started it as a little project for a server i am in but i kind of want it to go on top.gg for everyone to enjoy but i dont want to apply if its gonna spam every command

#

its not intended to spam either lol

earnest phoenix
#

hy

#

@torpid axle

torpid axle
#

hm?

earnest phoenix
#

so sorry

#

to unterrupt u

#

i'm a new one here guys

vernal rivet
#

ok, can you provide the coding of one of the commands that it is spamming?

torpid axle
#

yeah

earnest phoenix
#

@vernal rivet sorry how can i do that

vernal rivet
#

do what?

torpid axle
#

heres one - i have each command on a separate file

torpid axle
earnest phoenix
#

this is coding c

#

is it right

vernal rivet
#

do you terminate the bot and restart it after each changes?

torpid axle
#

the command itself works but it just spams

earnest phoenix
#

@torpid axle you're aware you can just get(command), right?

torpid axle
earnest phoenix
#

if else checking defeats the purpose of using a map

torpid axle
#

well it works so i use the way ive been doing it lol

#

except the spam part

quartz kindle
#

lmao

torpid axle
#

sorry if this is really simple and im just being a dumb dumb im new to all this

vernal rivet
#

then your problem is that you have multiple instance of it already

torpid axle
#

ah

#

how to i terminate the bot after each change?

quartz kindle
#
let cmd = client.commands.get(command);
if(cmd) cmd.execute(message, args)
#

its that simple

torpid axle
#

ah

quartz kindle
#

no more if else

vernal rivet
#

in the console, just do ctrl + c and if it askes you if you want to terminate it, just type y, and enter

torpid axle
#

ooh oki ty

rich ether
#

i finally got log channels working smh

#

and my ai

vernal rivet
#

but tim, what if i want to abuse switch cases, and make people suffer by staring at it happy_boy

quartz kindle
#

do it

#

and post here so i can meme it

vernal rivet
#

hold on

quartz kindle
#

i wrote 1.5k lines of c++ today, im tired af

vernal rivet
#

oofers

quartz kindle
#

not even doing anything special, just boring

earnest phoenix
#

same :feelsbadman: i have a bunch of exercises i have to do for CS but they're all boring

quartz kindle
#

rip

#

i still have like 2k more to go lmao

#

wrapping a c lib to js with node-addon-api

vernal rivet
swift comet
#

hello, good night

boreal iron
#

Ever worked with crc buffers?
I can give you some work which is challenging KEKW

quartz kindle
swift comet
#

i need multiboots webhooks autoresponde

#

u know

#

?

vernal rivet
#

happy_boy its the best code i ever made its bootiful right?

quartz kindle
torpid axle
#

its me again sorry but when i do ctrl + c it doesnt terminate ;-;

vernal rivet
#

mhm, you want to terminate it, then restart it

torpid axle
#

sorry - i meant it doesnt

swift comet
#

i need a multibot with predefined answers. And each bot will have a list of answers.

vernal rivet
#

how many consoles do you have open?

torpid axle
#

1

vernal rivet
#

does it say something about terminating?

torpid axle
#

the console is the terminal right? sorry its been a long day

vernal rivet
#

yes console = terminal, terminal = console

torpid axle
#

i thought so and no it doesnt

#

it just does this -

vernal rivet
#

happy_boy wait, does your bot listen to the console?

torpid axle
#

it should lol

vernal rivet
#

i mean do you have any process.stdin in your program?

torpid axle
#

oh-

#

no

vernal rivet
#

is this vscode terminal?

torpid axle
#

yeah

vernal rivet
#

oh, ok that explains the coloring of that ctrl + c

torpid axle
#

ye

vernal rivet
#

it works fine for me, i am trying this in my vscode, and it works

fathom nymph
#

Hey SO

#

I need help

torpid axle
#

ah

#

maybe i need the process.stdin

fathom nymph
#

so my friends say i need to require somethin in main file to make my Welcome And Leave command work

#

but i dont get what they are saying

vernal rivet
#

no process.stdin, was a question if it wasn't responding, but it should still terminate

swift comet
#

i need a multibot with predefined answers. And each bot will have a list of answers. do you know an bot?

torpid axle
#

ah

vernal rivet
#

you have to require a file to use the file in your program.

torpid axle
#

yeah its not terminating

vernal rivet
#

what does your terminal look like?

vernal rivet
torpid axle
fathom nymph
#

A File

vernal rivet
#

it was never executed lmao

#

that means it is being ran from another location

torpid axle
#

it was tho lol

earnest phoenix
#

how do i make the bot count how many servers its in on its status

neon heart
#

localhost? just restart your pc if terminal doesn't work

torpid axle
#

oh- it takes a bit to go offline

earnest phoenix
#

for example: Watching 300 servers

torpid axle
#

thats why it was showing online lmaooo

#

sorry for wasting your time with this

vernal rivet
#

your fine

torpid axle
#

ty for helping me ;-;

vernal rivet
#

np

torpid axle
#

imma go and see if it stops spamming

#

hopefully that worked

earnest phoenix
#

hello is anyone here know how to embed / print out aggregation results in mongodb using js? thank you!

vernal rivet
torpid axle
#

eyyy it worked

#

tysm ^^

vernal rivet
#

np

fathom nymph
vernal rivet
#

yert, uhhhhhh can you please use camelCase please πŸ˜… it hurts my eyes without camelCase, or snake_case

torpid axle
#

trigger words for the response are still spamming

vernal rivet
#

are they in a for loop?

torpid axle
earnest phoenix
#

you're not ignoring bots

vernal rivet
#

^^^

torpid axle
#

?

earnest phoenix
#

other bots can trigger your response

#

and your bot itself if it sends patoto

vernal rivet
#

you don't have check to see if the user is a bot or not, so if the bot response with a command name, it will execute, and cause a infinite loop

torpid axle
#

sorry that sent late LOL

vernal rivet
#

is there a command name that searches for >:(?

torpid axle
#

i dont think so

#

no

#

sorry ;-;

#

imma try to solve this on my own so yall dont have to waste your time with me lol

earnest phoenix
#

stilll confused

earnest phoenix
#

there is no section titled the guild section

vernal rivet
#

i mean .guilds section

torpid axle
#

i figured it out :>

#

i needed to add .toLowerCase()

#

ty again for all of your help ^^ i can now apply without worrying about the spam

earnest phoenix
#

@vernal rivet so client.guilds.size?

vernal rivet
#

client.guilds.cache.size

earnest phoenix
#

k

fathom nymph
#

ok now so

#

I Use djs just incase

#

So when i do say command

#

this happens

earnest phoenix
#

don't join with a newline

fathom nymph
#

wait

#

i dont rllt get it

#

my code i think is fine

earnest phoenix
#

it isn't

fathom nymph
#
module.exports = {
  commands: ['say'],
  description: 'Repeats What u say.',
  usage: '<message>',
  minArgs: 0,
  maxArgs: null,
  permissions: [],
  requiredRoles: [],
  callback: (message, text) => {
  message.channel.send(text)
  }
}```
#

but it wont wotk like !say ello ello

earnest phoenix
#

show your command handler

fathom nymph
#
const path = require('path')
const fs = require('fs')

const EventEmitter = require('events')
EventEmitter.defaultMaxListeners = 1000```
earnest phoenix
#

what

quartz kindle
#

lmao

earnest phoenix
#

umm what is the code to start 24/7 bot

#

run the bot

#

don't shut it down

#

🧠

fathom nymph
#

nvm there

fathom nymph
#

You can use a host on web

#

or vps

earnest phoenix
#

i asked about the keyword

quartz kindle
earnest phoenix
#

read this

#

Can anyone tell why my bot is late responding to commands even if the ping is lo

#

like , if i type (!) rythm would become functional

fathom nymph
earnest phoenix
#

IDK

quartz kindle
#

how are you measuring the ping?

earnest phoenix
#

I have restarted my bot but the same problem

#

I think some problem is with VPS I use

quartz kindle
#

where is the vps located?

earnest phoenix
#

Oof

#

Site

#

lulw, I had experienced that becuz i was storing prefixes on db and the db was being hosted in the other side of the world KEKW

#

Lol l

hollow sedge
#

oof site

vital carbon
#

that’s a place?

quartz kindle
#

lmao

earnest phoenix
#

/s

#

@earnest phoenix I haven't told the name

#

Of site

#

Lol

#

i was being sarcastic

#

Lol

#

Is my site i used

quartz kindle
#

in any case i didnt ask about the site

#

i asked about location, as in geographical location

earnest phoenix
#

Ok

#

India

quartz kindle
#

your vps is located in india?

earnest phoenix
#

Ya

quartz kindle
#

that would increase the ping a bit

earnest phoenix
#

Hmm

quartz kindle
#

discord is located in new york

vital carbon
#

rip that ping of yours lmao

torn hollow
#

Hello

earnest phoenix
#

It is 33

torn hollow
#

Someone can helpme with some?

quartz kindle
#

websocket ping is different from rest ping, still 130 ping is good enough, your bot shouldnt be slow

torn hollow
#

I want what my bot of discord read all messages and when he see the word Mati do something

vital carbon
#

huh

quartz kindle
#

check if message content includes Mati

torn hollow
#

But idk how to do that

#

How i need to start with that

quartz kindle
#

which language and library are you using?

torn hollow
#

Do you have code?

#

JS

quartz kindle
#

discord.js?

torn hollow
#

Yes

quartz kindle
#
client.on("message", message => {
  if(message.content.includes("Mati")) {
    // do something
  }
})
torn hollow
#

That goes in the switch?

#

Or out

quartz kindle
#

what switch

#

it goes wherever you want it to go

torn hollow
#

HAHAHA

#

The common comands

#

You understand me?

#

HAHAHA

quartz kindle
#

if you want it to be a command

torn hollow
#

Nonono

#

I want the people write normaly

quartz kindle
#

then no

torn hollow
#

And if someone write mati

#

The bot writes Mati es muy tonto

#

Hahaha

quartz kindle
#

then put it outside the switch

torn hollow
#

Okay

#

STR is?

#

Yes yes

#

I understand what do you want say

#

But my question is what is the meaning of STR

boreal iron
#

string

slender thistle
#

they basically meant any text

#

str was more of a "placeholder" there

torn hollow
#

Oh

#

Okay

#

Thanksss

#

@quartz kindle

#

I'm doing something wrong?

robust blade
torn hollow
#

@quartz kindle If you are going to write, send me a DM

#

😦

#

But if that don't start with Mati?

torpid axle
#

@torn hollow idk if im late or not but heres mine-

#

it works

torn hollow
#

Can you copy and paste?

#

JAJAJA

#

Please

#

To check

torpid axle
#

sure

#

like the code?

#

client.on('message', message => { if (message.content.toLowerCase() === 'patoto') { message.channel.send('Yes!'); } })

#

it sent weird but thats the thing lol

queen moss
#

Is it possible to wait for the "end" event to fire on a stream being piped to an express response

#

I've been trying but it never seems to recognize the event has been fired

#

I may be stupid and it isn't possible hence my asking here

#

for example <stream>.pipe(res).on("end") // do things

torn hollow
#

That not work

torpid axle
#

what doesnt work?

#

the code?

torn hollow
#

Yes

torpid axle
#

oh-

#

sorry-

#

hold on a sec

#

nu that should work

#

dont copy and paste - go from the screenshot i sent lol

torn hollow
#

😦

torpid axle
#

whats your script?

#

are you publishing the code before trying to see it works cuz that might be the issue

#

i have multiple trigger commands for that and they all work

#

also it wont work if you have any other words

#

you have to just have that one word

torn hollow
#

I don't know

torpid axle
#

go to the console and type node .

torn hollow
#

Send me DM

vernal rivet
#

?

torpid axle
#

why DM lol

#

i dont do DMs or friend requests cuz i dont know you personally ;-;

#

sorry

#

but you should publish your code by going to the terminal and typing node . and then test it out

vernal rivet
#

Are you new to programming?

torpid axle
#

me?

torn hollow
#

No, ask to me

torpid axle
#

ah

torn hollow
#

In JS yes

vernal rivet
#

Nah I know you are, I was asking lautaroice

#

Ok

torn hollow
#

I know java

vernal rivet
#

Do you know basic programming?

torn hollow
#

Obviously

torpid axle
#

im only new to js and discord bot programming but im really good in python lol

torn hollow
#

But this iss different

torpid axle
#

i was responding to koreanpanda lol

torn hollow
#

@torpid axle Me too

torpid axle
#

oh lol

torn hollow
#

@torpid axle I told you because i want to sent you a photo

#

Don't worry

torpid axle
#

i can send it here tho

torn hollow
#

Idk, may be is better

torpid axle
#

:/

vernal rivet
#

Ok so what are you trying to do?

tired nimbus
#

I need help.
For some reason it thinks
let loomianData2 = {}
is a function. I think im missing a close but Im not getting any syntax errors or popups

torn hollow
#

I'm trying what my bot reads the messenges and when one say the word "Mati" say something

#

Like

#

Yesterday Mati helps me with my homework

#

And the bot says

#

Mati is stupid

vernal rivet
#

Ok so that's all boolean logic you have to do

torn hollow
#

xD

vernal rivet
#

Ok I am probably reading this wrong, but you are wanting it to say something if it reads "Mari" or not?

torn hollow
#

Yes and no

torpid axle
#

idk if this is part of development but im not asking about terminating bots or anything lol

#

what if i wanted to do economy with my bot?

torn hollow
#

If someone say the word "MATI", the bot writes someone

torpid axle
#

how would i even begin to start coding that?

vernal rivet
torpid axle
#

ok lol

#

sorry i keep bothering you ;-;

boreal iron
vernal rivet
#

^^^

boreal iron
#

You probably forgot includes is case sensitive

vernal rivet
#

Returns a boolean value

oblique oar
#

hey

vernal rivet
#

Yes?

earnest phoenix
#

a man has fallen into the lego city river

torn hollow
earnest phoenix
#

try it and see

vernal rivet
#

^^^^^

boreal iron
#

If that’s the right djs syntax then probably yes

#

But be careful the internet will explode if this code is wrong

vernal rivet
#

Lmao

torn hollow
vernal rivet
#

Did you run the bot?

torn hollow
haughty bough
#

Someone using ytsr can tell me why when the safeSearch option is set to true this error happens: TypeError: Cannot read property 'user' of undefined

vernal rivet
#

"what the fuck is this thing that user is apart of. You expect me to know what the fuck you are talking about?!" That's the computer right now

torn hollow
#

F

haughty bough
#

Okay, I know that, but I can't find the problem.

boreal iron
#

Missing the right intents probably

#

Lautaroice

vernal rivet
#

Does d.js even ask you to choose the intents you want to use?

boreal iron
#

Dunno I don’t use djs

#

But I think so

vernal rivet
#

Only jda that I know of does

#

And no d.js never asked you to specify what intent you want to use. Even then the intent would be sending messages. That's something that would be included already

boreal iron
#

Yeah is probably only required for privileged intents

vernal rivet
#

Best solution is to console.log the message object and test it again. If it doesn't show in the console then you are missing a permission. If it does send then something is wrong

lyric mountain
#

Funny enough, I've had users ask me why my bot wasn't working, only to find out they removed her WRITE_MESSAGE perm

#

I wonder why that's a perm to start with

vernal rivet
#

Perm or intent?

lyric mountain
#

Permission

vernal rivet
#

Is to prevent users to talk in places that they shouldn't talk in

lyric mountain
#

Yeah but, for bots?

vernal rivet
#

Bots have to follow the same roles as users

#

Rules*

lyric mountain
#

Yeah, ig it'd be extra work for nothing

boreal iron
#

Just define the required permissions in your bot invite URL

#

If anyone removed them later that’s nothing you can change

lyric mountain
#

I did, but they still popup sometimes to ask

#

Either that or users webdating her

boreal flume
#

Greetings fellow hackers. For my bot that has recently been added to top.gg, I started to experiment a tad bit with the dblapi. Since my bot isn't really one with a reward system, I tried to make it send a message to a specific channel every time the bot was upvoted, yet I was unsuccessful at this, can anyone help me figure out what my issue is?
Code:

const bot = new Discord.Client({fetchAllMembers: true})
const dbl = new DBL('TOKEN', { webhookPort: 5000, webhookAuth: 'password' }, bot);

dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  bot.channels.cache.get('778460112313647175').send(`User ${bot.users.cache.get(vote.user).tag} just voted for Tic-Tac-Toe!`);
});
queen moss
#

incase anyone ever has this issue and looks it up in here- if you end up with a node stream always returning true on writes even if it hits the highWaterMark - you can count ticks between chunks written and override it by emitting the drain event every 50 ticks (anything sooner you'll run into a choppy stream) - make sure to pause the stream first, then resume after the drain has taken place. if you don't pause it, chunks keep writing and the drain never occurs

#

Oh and you're most likely using a simple webserver to serve the stream and piping it in- you have to call the drain event on the pipe as well, as node doesn't recursively drain pipes

#

I'm posting this here because there's nothing on stackoverflow on this 😍

opal plank
#

@boreal flume cant help much without errors or some more info

opal plank
#

there could be 3 things i can think of right away.
1 You didnt port foward(so no events are incoming)
2 You dont have the channel cached
3 You dont have the user cached

agile lance
#

do me a favor do

boreal flume
#

The users are cached

opal plank
#

are you use the user who voted will always be there though?

#

what if someone vote for your bot that isnt cached?

agile lance
#

console.log(bot.channels.cache.get(β€˜ID HERE’))

#

Do that ^

#

Tell me what it logs

opal plank
#

or not even a user that you have shared servers with

#

do all 3 checks tbh

#
console.log({channel: bot.channels.cache.get('778460112313647175'), user: user});```
#

add this there

boreal flume
#

It gives me the channel for logging it

opal plank
#

right under 'vote'

#

then trigger a vote

#
console.log({channel: bot.channels.cache.get('778460112313647175'), user: user, _user: bot.users.cache.get(vote.user)});```
#

^^ updated

#

@boreal flume

agile lance
#

Also @boreal flume This would be better in #topgg-api :)

boreal flume
#

Nothing is logged when I trigger a vote

opal plank
#

then port foward your stuff

#

your event isnt even triggering

boreal flume
#

What do you mean by port forward?

opal plank
#

thats the actual term

lyric mountain
#

Open the door

opal plank
#

port foward it

lyric mountain
#

Basically

boreal flume
#

But what does it mean...

opal plank
#

google port fowarding + your router model

#

enable incoming stuff for your host/pc

#

its kind of annoying to explain

boreal flume
#

My bot runs off a server

opal plank
#

then you must have that port open before it can recieve packets

lyric mountain
#

Ubuntu?

boreal flume
#

AWS

opal plank
#

google AWS port fowarding

lyric mountain
#

No, i mean

#

Oh

boreal flume
#

And I believe when I switched to port 80 it was an open port

#

Let me check though

opal plank
#

dont use port 80

lyric mountain
#

80 is http

opal plank
#

node and port 80 is a BAD idea

lyric mountain
#

Don't use 80, 443, 8080 and 8000

opal plank
#

^^

lyric mountain
#

And 4321 if you use postgres

boreal flume
#

There are only two ports open on the server

opal plank
#

then open one more

boreal flume
#

80 and 443

opal plank
#

or use nginx of some other tool to attach on those common ports

lyric mountain
#

80 and 443 are open by default

opal plank
#

just google how to open mroe ports

boreal flume
#

And how do I open ports?

opal plank
#

surely your vps allows it

lyric mountain
#

Else you'd get no access to the server

#

Do you have command line access?

opal plank
#

im fairly certain aws has a panel they can use it

lyric mountain
#

Never used aws, so idk

opal plank
#

it shuld be a matter or literally just typing on google how to open ports on aws

#

aws is too big to not have port fowarding

boreal flume
#

That is actually all I have

lyric mountain
#

Is it linux-based?

boreal flume
#

Yes

#

I believe

lyric mountain
#

Does ufw status do anything?

earnest phoenix
#

hi guys recently i had a little problem, i added a ban / kick command to my bot, but the problem is that when someone join my server, the bot automatically send this message : (message.author.username + ", vous n'avez pas la permission nΓ©cessaire pour utiliser cette commande !")
which is a respond to someone who use a ban command without having the administrator permission

#

the thing is that the message is automatically sent when someone join the server like a join message
but the message is for members who don't have admin permission and use the ban command

#

HEY CAN ANYONE HELP KOYA BOT IS NOT SHOWING WELCOME MESSAGE

boreal flume
solemn latch
#

@earnest phoenix is your ban command inside an on member add event

earnest phoenix
pale vessel
#

hmm, random scope

lyric mountain
#

See if there isn't some port or firewall panel in aws

pale vessel
#

@earnest phoenix you forgot an else

boreal flume
#

I found some stuff about opening ports from the command line

lyric mountain
#

Like, something MUST be controlling ports somewhere

earnest phoenix
boreal flume
# lyric mountain Like, something MUST be controlling ports somewhere
 aws lightsail open-instance-public-ports --port-info fromPort=5000,toPort=5001
Note: AWS CLI version 2, the latest major version of the AWS CLI, is now stable and recommended for general use. For more information, see the AWS CLI version 2 installation instructions at: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html

usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help
aws: error: argument --instance-name is required
pale vessel
#

Line 161

#

Before {

lyric mountain
#

Try that then

boreal flume
#

But when I put some random instance name, it say my region must be set

lyric mountain
#

Create a region

#

Use aws help

tribal siren
boreal flume
earnest phoenix
pale vessel
tribal siren
earnest phoenix
#

i believe that is the last field

#

where you join all the roles

tribal siren
#

does it count every single field

earnest phoenix
pale vessel
#

Per field

#

But the embed itself can't reach over 6k characters

earnest phoenix
#

you counted your code chars, not the actual returned values

tribal siren
#

let me put every value into lettercount

pale vessel
#

No, don't

boreal flume
# tribal siren does it count every single field

Why not just make it all into the description, and separate the sections by Bold Text, as most of your characters you are counting are coming from long code text that returns much smaller amounts of character

tribal siren
#

you're right

#

lemme do it

boreal flume
#

The embed description I believe has a character limit of a tad over 2k

earnest phoenix
pale vessel
#

The field value is supposed to be a string @tribal siren

#

You need to join the array (with "\n" in your case)

earnest phoenix
tribal siren
#

guess so

earnest phoenix
#

what should i do

pale vessel
#

You should add that permission check inside the command

#
if (content.startsWith()) {
    if (!member.hasPermission()) return send("no permission");
    let mention = ...
}```
unborn ridge
#
  if (!client.cooldown.has(`${message.author.id}`) || !(Date.now() - client.cooldown.get(`${message.author.id}`) > client.config.cooldown)) {
      let xp = db.add(`xp_${message.author.id}`, 100);
      let level = Math.floor(0.3 * Math.sqrt(xp));
      let lvl = db.get(`level_${message.author.id}`) || client.db.set(`level_${message.author.id}`,1);;
      if (level > lvl) {
          let newLevel = db.set(`level_${message.author.id}`,level);
        
      }
     cooldown.set(`${message.author.id}`, Date.now());
  }
}```
#

i was making rank system using quick.db

pale vessel
unborn ridge
#

oooo

#

promo

earnest phoenix
#

no one's gonna be interested

unborn ridge
#

@pale vessel bro

#

can u help

#

my rank card isnt updating

tribal siren
#
      await channel.overwritePermissions(role, {
        SEND_MESSAGES: false,
        ADD_REACTIONS: false
      });
    });```
#

why it no work

unborn ridge
#

error

stark abyss
#

your name kinda weird fonted

tribal siren
stark abyss
#

?dnw

thick gull
#

you need to do cache

#

iirc

agile lance
tribal siren
#

ok ill try

agile lance
tribal siren
#

it did

#

thank you

#

^^

agile lance
#

No problem! Glad to help!

sturdy gazelle
#

is there a way to check if the bot can send a message in a channel? (discord.js)

#

i want to save computations by just ignoring things in channels that the bot can read but not write

sudden geyser
#

Keep in mind, this method only works on text channels (no DMs)

#

If you want to check for that, you must try sending your message (and catching if an error occurs).

sturdy gazelle
#

well i was wondering if there was a way to check without just trying and seeing if it worked

pale vessel
#

If it's a DM, that's the only way to check

sturdy gazelle
#

im not worried about dm's so ill just blindly allow dm's since the only reason my bot is dming is if it was called for which, yes, you have to just send something to see if it works πŸ˜’

rocky hearth
#

Can I set custom status for the bot, without Playing

pale vessel
#

No

#

It just breaks if you try

rocky hearth
sturdy gazelle
#

thonk

#

(message.author.bot || (message.guild && message.channel.permissionsFor(client.user.id).has("SEND_MESSAGES"))) thats what i came up with

#

wait im dumb

#

lmaoooo

rocky hearth
#

But I think you should let the user know, that your bot don't have permission to send messages.

sturdy gazelle
#

hard to do that without perms

#

xD

rocky hearth
#

Its fairly eazy, not a very tedious task

#

anyway....

sturdy gazelle
#

i mean to dm yeah its easy but i get irritated when bots dm me so it would be silly to do it

silver lintel
#
let channel = message.guild.channels.cache.find(channel => channel.name.toLowerCase() === 'general');
    if (!channel) channel = message.guild.channels.cache.find(channel => channel.name.toLowerCase() === 'general-chat');
    if (!channel) channel = message.guild.channels.cache.find(channel => channel.name.toLowerCase() === 'chat');
``` how do i make this code better
earnest rivet
#

Lol

#

this luks

rotund trellis
#

Needs money

#

:/

earnest rivet
#

yeah 😦

rotund trellis
#

😦

earnest rivet
#

know anything else?

#

free and good

rotund trellis
#

Heroku

earnest rivet
#

look at this

#

noo

#

it costs

rotund trellis
#

needs cash

earnest rivet
#

hmm

rotund trellis
#

e

earnest rivet
rotund trellis
#

A server?

#

Hmm

earnest rivet
#

yeah thats weird

rotund trellis
#

needs cash

#

:/

earnest rivet
#

Noo costs moolah

rotund trellis
#

e

#

No

earnest rivet
rotund trellis
rotund trellis
earnest rivet
#

noo

blissful raft
earnest rivet
#

hmm

sturdy gazelle
#

get a raspbery pi

hollow sedge
#

Don't use hosting specifically geared towards discord bots

neon heart
rocky hearth
#

I updated the code, now it will not respond for the dms. @neon heart @sturdy gazelle

delicate shore
#

Like we use apache2 on Linux

#

For hosting website

#

What we use on windows

sturdy gazelle
#

oh i figured it out already let me see if it works in dms

rocky hearth
#

sorry, if disturbed. but it was related to u. so...

sturdy gazelle
#

oh i see

sturdy gazelle
#

thanks for pointing that out

earnest phoenix
#

hi

rocky hearth
#

If the channel is a 'dm' type, it will immediately return from it.

neon heart
#

okay

sturdy gazelle
#

if (message.author.bot || (message.guild && !(message.guild && message.channel.permissionsFor(client.user.id).has("SEND_MESSAGES"))))

#

that should work

#

oh i can simplify that

rocky hearth
#

yes.

sturdy gazelle
#

if (message.author.bot || (message.guild && !(message.channel.permissionsFor(client.user.id).has("SEND_MESSAGES"))))

#

better

rocky hearth
#

theres no need to put parenthesis around && and even !, save 4 more characters πŸ˜‰

sturdy gazelle
#

i get insecure about that so i do it also so i can easilly add or remove things

#

i do my oneliner if's like this:

if (thing)
  lol;
#

it might not be most efficient but its cleanest

#

also, having a restart command is so op like wow

vale garden
#

hi plz help me out

#
try: 
#....

except ValueError:
#.....
#

i have such a try except loop

#

but the error randomly showed up in console

#

instead of executing the except block

#

it generally works normally but i have had this prob once before

#

does anyone know why thsi is happening

rocky hearth
#

I dont know much about python but, doesn't it have catch keyword?

vale garden
#

in py its except

earnest phoenix
#

The error showed up in console isn't ValueError, is it

vale garden
#

it is

earnest phoenix
vale garden
#
File "main.py", line 639, in pokemon
    if not no or int(no) == 1:
ValueError: invalid literal for int() with base 10: '--name cleffa'
#

lol

#

makes no sense

earnest phoenix
#

could you send your code

vale garden
#

its a bit big

#

one sec ill send it by hastebin

delicate shore
#

How to

earnest phoenix
#

why is your except indented

delicate shore
#

Make a blast command

#

Means it'll send message in all guilds

vale garden
#

it isnt

delicate shore
#

In first channel

vale garden
#

its at the same indentation

#

as try

earnest phoenix
#

hm weird

somber wigeon
delicate shore
#

Read the error

vale garden
#

@somber wigeon show your code first

somber wigeon
#

Code

earnest phoenix
#

@vale garden the if statement is not at the correct indentation ig

somber wigeon
earnest phoenix
#

there is a tab and a space

#

not a tab and a tab

vale garden
#

i thought indentation could be of any size

earnest phoenix
#

even that doesn't matter, it's always good idea to have consistent indentation

vale garden
#

yea true

#

ok

earnest phoenix
#

the convention according to pep8 is to have 4 spaces per indentation level

harsh blade
#

Hey uh im new to developing discord bots and was wondering how do i ping a role?

pale vessel
#

If you have the role object, you can use role.toString() or `${role}`. Otherwise, you can use the id using <@&id>

harsh blade
#

@& ?

pale vessel
#

Yes

harsh blade
#

Alright, will try thanks

pale vessel
#

For example <@&265125253443878912> for Bot Developer

harsh blade
#

:0

#

smart

#

Okay so

#

it does ping me and it shows that it pinged the role but my manager isnt getting pinged

viscid violet
#

my bot has that option _help

#

No worries!

humble rock
#

And my bot has f!help too

viscid violet
#

oh and btw f! was the previous prefix of my bot

golden condor
#

Incorrectly documented prefix?

viscid violet
#

and i changed it now

golden condor
humble rock
#

Ok

#

Sorry

viscid violet
#

ok sorry Too

harsh blade
#

Lmao

#

i forgot u cant ping in embeds πŸ˜‚

somber wigeon
#

Who has a bot server on which my bot is, is called Abyssus my bot?

earnest phoenix
#

excuse me, wot

somber wigeon
#

Is that you have my bot on your server where you test your bot

earnest phoenix
#

oh, nope

keen drift
#

@strong tundra Hey, I was searching messages regarding microservice and you happen to be one of them.

Did you ever start on any?

strong tundra
#

not really

#

i was looking at using like rabbit/zeromq for that kinda stuff tho

keen drift
#

Ah, I was just wondering how people decide upon how many instances to run for the microservices

#

I have almost all the parts, but I'm not sure about the devops or orchestrating the microservices

strong tundra
#

id probably scale up as needed with like kubernetes or something

#

maybe dokku would work?

keen drift
#

I was going with a kubernetes approach about 2 years ago, it turns out running kubernetes alone is not fun

#

I'm currently wondering on how many of the http microservice I will run, the service that actually processes the event and send requests to Discord

#

Perhaps one is enough think_fish for now

strong tundra
#

yeah probably

#

until you figure out what you're going to do devops wise

keen drift
#

I'm going with Ansible and deploying an agent onto each machine, but that's so far only for the router layer.

strong tundra
#

ah interesting

#

never played around with ansible personally

cerulean pebble
#

Hey

#

100 votes = 1 USD ?

#

seems easy

#

if i have 100 accounts i can earn many hundreds usd

#

/month

keen drift
#

K8s is too complex for my application, and the overhead is huge for instances.

Currently I'm deciding to deploy N instances across X machines, which leaves N/X instances per machine, and each machine will have an agent to deploy those instances.

Might re-use the same agent to deploy HTTP workers depending on how much load it actually gets, not sure if I'll ever scale HTTP workers across machines, since it's rather stateless, and the only thing it does is process event received by internal message bus and send http requests.

astral yoke
#

why this be eroring

#

(node:15148) UnhandledPromiseRejectionWarning: TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.

cerulean pebble
#

hey some one anwser my ques

strong tundra
#

hm interesting

keen drift
#

I'm using Nats btw for my internal message queue

#

Coordinator, router, agent, and http worker all communicate via nats

strong tundra
#

idk why you'd need more than one http worker per machine though

keen drift
#

That's the uncertain part, could I ever get so much requests that the network I/O will be bottlenecked for one machine

strong tundra
#

yea

#

that would be for the machine though, not the worker, right?

keen drift
#

yeah I plan to have one http worker per machine if network I/O is the problem, which prob will be

strong tundra
#

ah yea

keen drift
#

I'll prob allocate VPS for the http workers, since it's just all network I/O, cpu will prob be idle

strong tundra
#

that seems reasonable

keen drift
#

welp that seems to solve most of my infrastructure problems think_fish Now to see how many instances of nats & redis I need

strong tundra
#

lol

tardy hornet
#

var secondMemberPP = await loadImage(opponent2.displayAvatarURL({format: "png"}))

error:

opponent2.displayAvatarURL is not a function

strong tundra
#

god

#

ive never actually used redis ever

keen drift
#

It's neat, I'm using compressed redis store

strong tundra
#

i should get started with darkredis i guess

keen drift
#

Since I plan to back the bot with a web interface, which means a HTTP API, cache has to be centralized with something

strong tundra
#

hm yeah

#

im looking into compression with redis and found a cool doordash engineering post

keen drift
#

I'm using bincode with twilight-models + flate2 for compression

strong tundra
#

ah

#

they use lz4 i think

keen drift
#
#[derive(Deserialize, Serialize)]
pub struct Guild(pub GuildModel);

impl FromRedisValue for Guild {
    fn from_redis_value(v: &Value) -> RedisResult<Self> {
        if let Value::Data(data) = v {
            let mut decoder = ZlibDecoder::new(&data[..]);

            let mut decoded = Vec::new();

            decoder.read_to_end(&mut decoded).map_err(|_| {
                let err: RedisError = (ErrorKind::TypeError, "Unable to decompress data").into();

                err
            })?;

            let guild: Guild = deserialize(&decoded).map_err(|_| {
                let err: RedisError = (ErrorKind::TypeError, "Unable to decode to guild").into();

                err
            })?;

            return Ok(guild);
        }

        Err((ErrorKind::TypeError, "None binary data").into())
    }
}
strong tundra
#

neat stuff

keen drift
#

I went with flate2 zlib because twilight gateway has an optional feature for utilizing that

#

and flate2 zlib-ng feature utilizes SIMD instructions for speed-ups

strong tundra
#

yea

#

you were talking about that the other week i think

keen drift
#

Yeah, however I don't really have much of a test bot with numerous traffic to benchmark the compression trade-off

strong tundra
#

ah

keen drift
#

Clusters consists of N shards, and each cluster will communicate to coordinator for shard id allocations.

From there, cluster will heartbeat on an interval, and coordinator will send shut down request to clusters if something goes wrong, allowing the agent to boot up another instance.

strong tundra
#

ah i see

#

that's neat

#

i'll probably do something similar when i get around to it

keen drift
#

Yup, an uncharted territory for sure, I'm figuring out things as I go

strong tundra
#

heh

keen drift
#

maybe I need an rubber ducky, talking to something about my problem and I somehow figure things out

strong tundra
#

i don't think too many people have done stuff like this

#

and i think the only docs i could find are on discord's own website

#

at least with big bot sharding

keen drift
#

Yeah, and I'm glad I found twilight, I was originally using serenity

#

just split enough for building microservice with it

strong tundra
#

heh

#

yeah serenity isn't too good for what you're using it for

astral yoke
#

this errors ```const { ownerid } = require("../../loaders/reader");
const { MessageEmbed } = require('discord.js')
module.exports = {
config: {
name: "add"
},
run: async(bot, message, args) => {
if(!message.channel.name.includes('s-ticket'))return;

    let notallowed = new MessageEmbed()
    .setColor('#e64b0e')
    .setDescription(`Need to be admin or created the channel!`)

    if(!message.member.roles.cache.has("710751019495194645")) {
        if(!message.channel.name === `${message.author.name}s-ticket`) {
            message.channel.send(notallowed)
        };
    }
    let user = message.mentions.members.first()

  let channelsend = new MessageEmbed()
  .setColor('#e64b0e')
  .setTitle(`Added User`)
  .setDescription(`${user} has been added to the channel!`)



    

    message.channel.overwritePermissions(user.id, {'VIEW_CHANNEL': true, 'SEND_MESSAGES': true, 'MENTION_EVERYONE': false})
      message.channel.send(channelsend)

    
    }  

}``` (node:15148) UnhandledPromiseRejectionWarning: TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role

#

didnt mean to flood

keen drift
#

And somehow my clippy broke 😐

strong tundra
#

oof

#

i should actually start using clippy

#

i hear it can be helpful

keen drift
#

it is, especially reducing cognitive overhead on expr

thick granite
#

Can someone help me with css on top.gg page

strong tundra
#

ah cool

#

i think my bot has a gh actions linting process but it always fails cause i never bother

#

lol

keen drift
#

I usually run clippy + fmt prior to commiting

#

my gh action just builds and run tests

rain obsidian
#

hello

#

pls give stats code

keen drift
#

this is funny, I guess this is a bug with clippy? Says it's been fixed, I forced a whole cargo check, and it's giving me lints again. Nvm, still an issue with cargo apparently.

pale vessel
strong tundra
#

it probably is lol

prime glacier
#

AbortError: The user aborted a request.

unborn ridge
#

i need help pls

#

i would be very happy if it get solved

#

please

carmine magnet
#

Yes ?

unborn ridge
#

i a, setting wecole meesage

#

and i ant

#

that

carmine magnet
#

I just solve error, not giving code

unborn ridge
#

tellling error

carmine magnet
#

Yes tell me your error

unborn ridge
#
  let chx = db.get(`welchannel_${member.guild.id}`);
  let msx = db.get(`welmessage_${member.guild.id}`)

  

  const welcomeChannel =db.get(`welchannel_${member.guild.id}`);

  // Send welcome message
  

      let data = await canva.welcome(member, { link: "https://wallpapercave.com/wp/wp5128415.jpg" })
 
      const attachment = new Discord.MessageAttachment(
        data,
        "welcome-image.png"
      );
    chx.send(msx,attachment);
  }
  
 
);```
#

so if i try to replace text after 4th line it says cannot replace of null something like this

blazing ravine
#

why not starting deploy ```css

Node.js app detected

-----> Creating runtime environment

   NPM_CONFIG_LOGLEVEL=error
   NODE_ENV=production
   NODE_MODULES_CACHE=true
   NODE_VERBOSE=false

-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)

   Resolving node version 12.x...
   Downloading and installing node 12.19.1...
   Using default npm version: 6.14.8

-----> Restoring cache
Cached directories were not restored due to a change in version of node, npm, yarn or stack
Module installation may take longer for this build

-----> Installing dependencies
Installing node modules (package.json)
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/amishshah/ytdl-core-discord.git
npm ERR!
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128

   npm ERR! A complete log of this run can be found in:
   npm ERR!     /tmp/npmcache.AYNu9/_logs/2020-11-20T10_06_37_627Z-debug.log

-----> Build failed

   We're sorry this build is failing! You can troubleshoot common issues here:
   https://devcenter.heroku.com/articles/troubleshooting-node-deploys
   
   Some possible problems:
   
   - Node version not specified in package.json
     https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
   
   Love,
   Heroku

! Push rejected, failed to compile Node.js app.
! Push failed```

unborn ridge
#

are u having config.json file on github

blazing ravine
#

yes

unborn ridge
#

and token added in settings

#

?

blazing ravine
#

yes

unborn ridge
#

send ss of resorces tab

#

or u can check

#

how u run ur bote

#

node .

#

?

blazing ravine
#

node index.js

unborn ridge
#

i need to check can u send screensho of resources tab

blazing ravine
#

1min

unborn ridge
blazing ravine
#

oh wait i found why not starting

#

"ytdl-core-discord": "amishshah/ytdl-core-discord",

#

cant install this

#

after remove from package.json ytdl core

#

work

unborn ridge
blazing ravine
#

but how to install yrdl core "ytdl-core-discord": "amishshah/ytdl-core-discord",

unborn ridge
#

npm i ytdl-core

#

"ytdl-core": "^4.0.5"

#

see i have it

blazing ravine
#

oki thanks

#

ok working thanks

harsh blade
#

When i create a support ticket myself, this line works just fine

await c.send(${message.author} has created a new ticket Support will be with you soon <@&765885271861624843>);

But when anyone else than me opens a ticket, it dosent ping me, dosent even include the "Support will be" line

earnest phoenix
#

hi

harsh blade
#

hi

earnest phoenix
#

it's literally just

// check if the message sender is the bot owner
// if they are then run the eval
eval(/* message content */);
prime glacier
#
const format = /[ `!@#$%^&*()_+-=[]{};':"\|,.<>/?~]/;
member.setNickname.replace("format");``` 
not working
earnest phoenix
#

yes

#

i think its a discord bug

#

@earnest phoenix you ping me ?

#

no it's not

#

replies can turn on or off mentions

earnest phoenix
earnest phoenix
#

huh

#

i dont know about that lol

#

replies are a new thing

earnest phoenix
#

@earnest phoenix did i ping you ?

#

yes

#

oh

#

nice

#

anyways

#

@earnest phoenix if you were trying to tell me how to make eval command... i make eval command yesterday

#

ok

hasty lotus
#

Is there a function in djs to reply to a message ?

earnest phoenix
hasty lotus
#

No the new one

hasty lotus
earnest phoenix
#

i don't think so

hasty lotus
#

Ok

tranquil copper
#

Anyone a idea how to start a specific shard or from a specific shard point. Like i have one server and there is running shard 0 to 10 and i want a second server with shard 11 to 20 is that possible

safe creek
#

is there any way i can make my bot send a reply into a channel the command was executed inside and allow the users to customize the prefix

earnest phoenix
#

py?

#

how to make my bot uses less ram

#

i use discord.js

digital ibex
#

well I mean that’s a broad question

#

even harder for us to answer if u don’t know what ur doing

earnest phoenix
#

i need help with pymongo

pale vessel
#

Just state your problem

#

Saying you need help does not help

quartz kindle
earnest phoenix
#

we can do document.createElement to make new elements but how do i do the opposite to delete one

earnest phoenix
quartz kindle
#

element.remove()

earnest phoenix
#

ok

crimson vapor
#

discord.js-light

earnest phoenix
#

@earnest phoenix facepalm

#

djs is an abbreviation

#

the actual name is discord.js

#

@crimson vapor their codes are same as discord.js ?

#

@earnest phoenix imagine saying i need hek

#

THAT WAS ACCIDETNT

crimson vapor
#

discord.js-light uses less ram

earnest phoenix
pale vessel
#

"Storage"

earnest phoenix
#

*RAM

#

*space

#

@earnest phoenix so i dont need to change anything from my code ?

restive furnace
quartz kindle
#

it depends what your code does

#

you will likely need to change all your .cache.get() to .fetch()

earnest phoenix
#

i need help with pymongo, so i want to get all servers id and check all of them if they have some specific value nvm just i dont know how to get all servers ids so it would be helpful if someone knows

#

thats it ? @quartz kindle

quartz kindle
#

it depends what your code does

earnest phoenix
#

@quartz kindle my bot is @earnest phoenix

quartz kindle
#

discord.js comes with everything enabled, so everything always works
discord.js-light comes with a lot of things disabled by default, which you will need to manually enable depending on what your code does

#

for example if you need permissions, you need to enable cacheRoles:true and cacheOverwrites:true

earnest phoenix
#

ok so i am not gonna install discord.jslight lol

earnest phoenix
quartz kindle
#

as you wish :^)

earnest phoenix
#

nope tesla tower

quartz kindle
#

how much ram is your bot using?

earnest phoenix
#

200

#

bruh

quartz kindle
#

how many guilds?

earnest phoenix
#

at only 30 servers

#

are you dumb?

restive furnace
quartz kindle
#

this is my bot with discord.js-light

#

134mb ram with 6k guilds

earnest phoenix
#

my old which i probaly copy from github uses 400 mb ram at 1900 servers

pale vessel
restive furnace
#

normal djs prob would eat like 600mb to 800mb

quartz kindle
#

it was already eating 800 at 2.5k

#

xD

earnest phoenix
#

how to get whole row in pymongo

restive furnace
#

huh it eats the ram really

earnest phoenix
#

@pale vessel lmao

quartz kindle
#

btw those 134mb are because i cache user data and api responses for 24 hours

#

if i didnt cache those, it would be around 70mb

earnest phoenix
#

@earnest phoenix do you know who is nikola tesla

quartz kindle
#

a genius

earnest phoenix
#

its tesla car owner maybe

quartz kindle
#

wat

#

you dont know nikola tesla?

restive furnace
carmine summit
#
      let preferredGames = response.preferredGames[0] || 'None'
```Cannot read property 0 of undefined
earnest phoenix
#

i got that name from tesla tower in clash of clans

quartz kindle
#

...

earnest phoenix
quartz kindle
#

and where do you think they got the name from

crimson vapor
#

ofc the tesla coils

earnest phoenix
#

if i install these packages will it decrease my ram usage ?

crimson vapor
#

what else

quartz kindle
#

and where do you think tesla coils came from

earnest phoenix
restive furnace
#

Nikola Tesla was genious, Elon Musk is owner of Tesla Motors.

crimson vapor
#

LOL I was joking

carmine summit
#
      let preferredGames = response.preferredGames[0] || 'None'
```Cannot read property 0 of undefined
quartz kindle
#

lmao

quartz kindle
#

@earnest phoenix those affect cpu, not ram

earnest phoenix
#

he is also serb

#

like me

earnest phoenix
#

@restive furnace @quartz kindle @crimson vapor stop this is #development

earnest phoenix