#development

1 messages · Page 1650 of 1

opal plank
woeful pike
#

ask veld

opal plank
#

otherwise i would lmao

crimson vapor
#

@humble gyro

cinder patio
#

you can mock the member objects

opal plank
#

need a single guild with a bunch of members

misty sigil
#

yo veld while you’re here any details on the lua thing

crimson vapor
#

but then there are no presense updates

opal plank
#

this makes it a good test subject

crimson vapor
#

its easier to test on "prod"

#

than fake the data

opal plank
#

@humble gyro 👀

cinder patio
#

but discord doens't send all members anyways

#

doesn't it send like 2?

#

200?

opal plank
#

you can request all

crimson vapor
#

yea

opal plank
#

its chunked tho

#

thats why i told million to wait before putting the tests out

#

both for garbage collector

#

and to wait for chunking

crimson vapor
#

yeah thats why im doing many tests

#

at 10 minutes

1. discord.js-light
2. discord-rose
3. eris
4. discord.js
5. idk how to spell```
opal plank
#

let me check something

dark crest
#

hum i am trying to do a leveling system someone know y that not work?

let xp = db.fetch(`xp_${message.guild.id}_${message.author.id}`)
var addxp = Math.random() * 15 + 11;
db.add(`xp_${message.guild.id}_${message.author.id}`, addxp)
let lvlnow = db.fetch(`rank_${message.guild.id}_${message.author.id}`)
if(!lvlnow) db.set(`rank_${message.guild.id}_${message.author.id}`, 1)
let needxp = lvlnow * 5
if(needxp < xp){
db.add(`rank_${message.guild.id}_${message.author.id}`, 1)
db.set(`xp_${message.guild.id}_${message.author.id}`, 1)
return message.channel.send("nice now you level: " + lvlnow)
}

earnest phoenix
#

what part doesn't work

crimson vapor
#

please space out your code for readability

viscid gale
#

;-;

dark crest
earnest phoenix
#

what are you trying to achieve

viscid gale
#

.

opal plank
earnest phoenix
#

@viscid gale if it is then no need to tell us that it's readable

crimson vapor
#
Object.entries(process.memoryUsage()).reduce((T, [K, V]) => (T[K] = (V / (1024 ** 2)).toFixed(1) + 'MB', T), {})``` @opal plank
dark crest
crimson vapor
#

please run that

earnest phoenix
viscid gale
crimson vapor
#

I don't know how to do /1024/1024 in my head

opal plank
earnest phoenix
crimson vapor
#

thank you

crimson vapor
#

@earnest phoenix

earnest phoenix
#

ah ofc, he's too smart

#

My function?

#

Pogging

opal plank
#

i could test on my bot, but it would be better to have a bot in a single guild instead

earnest phoenix
crimson vapor
#

do you think you could test my bot's code on your token, removing any responses?

#

so it just doesn't do shit

#

but still to test mem

opal plank
#

,

#

@crimson vapor

crimson vapor
#

wdym

#

thats stupid imo

opal plank
#

you calling tim stupid?

crimson vapor
#

no

opal plank
#

HERESY

crimson vapor
#

wtf

#

no

#

think about it

#

listen

opal plank
crimson vapor
#

if I do thatt its stable cache

opal plank
#

BURN THE SINNER

crimson vapor
#

if I host a token

#

its events and shit

earnest phoenix
#

Erwin, what exactly did you want to me to test

crimson vapor
#

a way better representation

earnest phoenix
#

My bot is here

viscid gale
#
Return frontend script to client that CANNOT be viewed by client side user. After all, why obfuscate code when you can just HIDE it

uk when i first began with this last week everyone who responded was saying "it's impossible" but now that it works they silent >:{
this can be used in really cool ways u web devs

opal plank
#

i called you out of instinct

#

but thinking carefully it matters not

#

my bot could be used for it too

#

bordering 600k members

#

but thats not the thing

crimson vapor
#

sooo

#

no to my question?

opal plank
#

having a single guild be used as reference would probably cut down extra varioables

#

members should be, by far, the biggest threshold on bots

#

i would say go --yolo and only enable guilds, channels and members

#

a normal bot should get by with only those

#

and disable everything else

#

though that might be unfair as fuck in terms of benchmarking

#

tim wanted to compare efficiency, but thats hard to do when the lib caches everything

#

it would be fine if you compared the same things, members with members, without extras

crimson vapor
#

yea

#

but also websocket events

#

right?

opal plank
#

probably yeah

crimson vapor
#
// ERIS
{
  rss: '47.3MB',
  heapTotal: '12.6MB',
  heapUsed: '10.7MB',
  external: '1.4MB',
  arrayBuffers: '0.1MB'
}
// DISCORD.JS-LIGHT
{
  rss: '43.3MB',
  heapTotal: '9.4MB',
  heapUsed: '7.8MB',
  external: '1.5MB',
  arrayBuffers: '0.1MB'
}
// DISCORD.JS
{
  rss: '51.6MB',
  heapTotal: '16.2MB',
  heapUsed: '14.6MB',
  external: '1.5MB',
  arrayBuffers: '0.1MB'
}
// DISCORD-ROSE
{
  rss: '53.2MB',
  heapTotal: '11.4MB',
  heapUsed: '9.8MB',
  external: '1.5MB',
  arrayBuffers: '0.2MB'
}
// DETRITUS
{
  rss: '54.5MB',
  heapTotal: '16.7MB',
  heapUsed: '14.8MB',
  external: '2.1MB',
  arrayBuffers: '0.7MB'
}```
#

@opal plank

opal plank
#

next try going as cacheless as possible

#

as of rn im only thinking about memory

crimson vapor
#

like as possible

#

or just recommended?

opal plank
#

but detritus commandHandler by itself makes it worth ditching the other libs

#

functionality also plays a role

crimson vapor
#

so

#

no cache at all?

opal plank
#

thats not cacheless

#

thats leaves members, channels and guilds

#

@crimson vapor ```ts
import { CommandClient } from 'detritus-client';

const commandClient = new CommandClient(token, {
cache: {
applications: { enabled: false },
channels: { enabled: false },
connectedAccounts: { enabled: false },
emojis: { enabled: false },
guilds: { enabled: false },
members: { enabled: false },
messages: { enabled: false },
notes: { enabled: false },
presences: { enabled: false },
relationships: { enabled: false },
roles: { enabled: false },
sessions: { enabled: false },
typings: { enabled: false },
users: { enabled: false },
voiceCalls: { enabled: false },
voiceConnections: { enabled: false },
voiceStates: { enabled: false },
},
shardCount: 1,
prefix: '?',
});

commandClient.add({
name: 'ping',
run: context => {
return context.reply({
embed: {
title: 'Pong! DETRITUS',
description: ${Object.entries(process.memoryUsage()).reduce( (T, [K, V]) => ((T[K] = (V / 1024 ** 2).toFixed(1) + 'MB'), T), {} as any, )},
},
});
},
});
commandClient.run();

setInterval(() => {
console.log(
Object.entries(process.memoryUsage()).reduce(
(T, [K, V]) => ((T[K] = (V / 1024 ** 2).toFixed(1) + 'MB'), T),
{} as any,
),
);
}, 1000);```

#

that should be close enough

dark crest
#

its not work that not log and no errors pls help

crimson vapor
#

idk eris

#

guess ill not restart it

dark crest
#

i did

crimson vapor
#

@opal plank ok I restarted with no cache

lyric mountain
hot sage
#

So, I'm making a moderation bot using BDFD (since I can't use python/Java Script) and I feel like I need more commands but I am unsure of what else to add

crimson vapor
#

@opal plank sad your lib didn't respond

snow urchin
crimson vapor
#

you can't

lyric mountain
crimson vapor
#

use postman i anything

lyric mountain
#

also, why can't u use those two langs?

dark crest
hot sage
lyric mountain
#

w3schools, mozilla, udemy, codeacademy, etc

thick nexus
#

What happens if you do .replace() and that isn't in the string

lyric mountain
#

nothing

thick nexus
#

Ok noice

small meteor
#

Can someone help me?

earnest phoenix
#

?

small meteor
#

no matter what port I put for the dashboard port whether its 443 or 80

#

I have SSL running through Cloudflare and the server is hosted through OVH

#

I created firewall rules to allow and still not working

hot sage
#

since people say that BDFD sucks (which i agree with) what if i use glitch.com

#

which has javascript

quartz kindle
#

still sucks

small meteor
#

@earnest phoenix Any idea?

quartz kindle
#

but its a step in the right direction

hot sage
#

😦

#

i have a chromebook so thats why i cant get python or js

crimson vapor
#

do you have a vps?

quartz kindle
#

both should work on chromebooks

earnest phoenix
small meteor
#

Yea, i'm using OVH @crimson vapor

crimson vapor
#

no I meant golden pineapple

small meteor
#

Oh

crimson vapor
#

sorry

small meteor
#

its ok

#

Is anyone able to help me? LOL

hot sage
#

im newer to things like this

hot sage
solemn latch
#

which one do you want?

hot sage
solemn latch
hot sage
#

my type of chromebook isn't new enough to run the linux beta 😭

daring prawn
solemn latch
#

pretty sure you can still do it, just extra hoops to jump through

lyric mountain
#

ratelimit

#

but define "so slowly"

#

like, it is supposed to take about 0.5s to add reactions

#

well, no idea for javascript, but for java there's a setting called relativeRatelimits

#

which when enabled makes reactions slow af

#

see if for js there's something similar

opaque seal
#

I'm making a microservice for my database with rgcp and kotlin. I'm making a service which has a getGuild method which basically sends back the database data of that guild. The grcp response message should be a stringified json of that data right?

sour flame
#
const { Client, Collection } = require('discord.js')
class EconomyClient extends Client {
    constructor() {
        super();
        this.discord = require('discord.js');
        this.fs = require('fs')
        this.path = require('path')
        this.mongoose = require('mongoose')
        this.commands = new Collection();
        this.timeouts = new Collection();
        this.config = {
            prefix: 'e!'
        };
        this.schema = this.mongoose.model(`economy`, new this.mongoose.Schema({
            User: String,
            Coins: Number
        }));      
    }
    commandHandler(path) {
        this.fs.readdirSync(this.path.normalize(path)).map((f) => {
            const File = require(this.path.join(__dirname, `..`, path, f));
            this.commands.set(File.name,File)
        });
    };
    start(token,path) {
        this.commandHandler(path);
        this.login(token);
        this.mongoose.connect(`Database`, {
            useNewUrlParser: true,
            useUnifiedTopology: true
        });
        this.mongoose.connection.on('connected',() => console.log("DB connected"));
        this.on('ready', () => console.log(`${this.user.tag} is now online!`));
        this.on('message', async(message) => {
            if(message.author.bot || !message.guild || !message.contect.toLowerCase().startsWith(this.config.prefix)) return;
            const args = message.contect.slice(this.config.prefix.leght)
        })    
    }
};
module.exports = EconomyClient
``` My coding so far on Economy Bot
quartz kindle
#

but cant beat external tools

solemn latch
#

what is it tim?

#

the tool

hot sage
#

since i cant find a way to get linux on my chromebook, I am wondering if the pre-installed program called text can be used to code

viscid gale
#

ok.. im basically trying to make something that can host
the host would send script to the client that the user can't pick up

#

but apparently.. i still have ways to go :l

hot sage
#

this app

quartz kindle
#

this is what we mean by "impossible to hide"

misty sigil
#

it is impossible to hide

#

unless you render it serverside

viscid gale
# quartz kindle

i posted this like an hour ago.. so i guess it was difficult.. but still, tell me, how did you do it?

quartz kindle
viscid gale
#

i see, i see

quartz kindle
#

you may even fool a browser, but you cant hide network requests from the entire operating system

viscid gale
viscid gale
quartz kindle
#

http is layer 7

#

it has to go through all other layers before it reaches the browser

#

all other layers can be intercepted

viscid gale
#
Return frontend script to client that CANNOT be viewed by client side user. After all, why obfuscate code when you can just HIDE it
viscid gale
vivid fulcrum
#

pssssssst

#

packet sniffing

#

just like i told you before

#

stop trying to do the impossible

misty sigil
#

it's not worth it

viscid gale
#

dude.. half the people said it was impossible to hide it from the browser

misty sigil
#

you can either obfuscate it, or render the page serverside, you're not gonna hide it completely

viscid gale
#

why stop now when i made this progress

misty sigil
#

anyone who's dedicated enough will find it

vivid fulcrum
#

what you're doing now is literally the definition of a sisyphus job

quartz kindle
#

technically we said impossible to hide from the client

viscid gale
quartz kindle
#

which includes non-browser stuff

viscid gale
misty sigil
vivid fulcrum
#

i did say it before indeed

#

you have to open the door to walk through it
"no i can walk through walls"
you can't, you have to open the door first to enter
"no I CAN walk through WALLS"

#

dumbified analogy

viscid gale
#

sometimes a gate is more secure than the walls

vivid fulcrum
#

this is an anology

#

do you really think you're smarter than the people who are actively working on web protocols

#

if it could be done, it would have already been done

viscid gale
vivid fulcrum
#

??

viscid gale
drifting wedge
#

for java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int[] board = {0,0,0,0,0,0,0,0,0};
        System.out.println(board)
        Scanner input = new Scanner(System.in);
        System.out.println("[ X ] - INPUT ARRAY FORMAT: ");
        String input2 = input.nextLine();

        board[Integer.parseInt(input2)] = 1;

        System.out.println(board);
    }
}``` where is this going wrong?

```[ X ] - INPUT ARRAY FORMAT: - SCRIPT
0 - MY INPUT
[I@4e04a765 - SCRIPT```
#

im trying to make tictactoe

vivid fulcrum
#

if someone really wants to hide the frontend script, they wouldn't expose it in the first place - they would use SSR instead

drifting wedge
#

whats ssr?

viscid gale
#

server side rendering

vivid fulcrum
viscid gale
#

meaning the script would never hit the client

viscid gale
vivid fulcrum
#

no, you're geniunely delusional

drifting wedge
#

why woud you hide your script?

#

its fucking js lol

quartz kindle
#

also

viscid gale
drifting wedge
#

not nuke launch codes

quartz kindle
#

if you open the page with dev tools on, and you dont close the alert

drifting wedge
#

give me an example

quartz kindle
#

sure this only works because the alert is blocking until clicked

drifting wedge
#

im asking the guy

#

not you guys

hot sage
#

wait a minute

#

so i found something insane in BDFD

drifting wedge
#

why would you try to hide it

#

@viscid gale

hot sage
#

i found how I can use javascript in bdfd

viscid gale
# quartz kindle

so appending has that weakness.. ok i'd just seal eval and use eval then.. easy fix, BUT THE OTHER THING U DID WILL NEED WORK

vivid fulcrum
#
delusional
/dɪˈluːʒ(ə)n(ə)l/

characterized by or holding idiosyncratic beliefs or impressions that are contradicted by reality or rational argument```

in case you didn't understand what i meant by delusional
**anything** you send to the client, the client can see, you're just changing the way you send it
#

i don't know what you don't understand about this

drifting wedge
#

@vivid fulcrum why is he trying to hide it?

vivid fulcrum
#

but this is genuinely web protocols 101

#

ask them

#

delusion / dementia

drifting wedge
#

he isnt answering

solemn latch
#

I think its just an experiment

drifting wedge
#

ohh

viscid gale
drifting wedge
#

he's i dont see it

quartz kindle
#

hes experimenting with a different form of obfuscation basically

drifting wedge
#

i dont see it*

#

where?

viscid gale
drifting wedge
#

@viscid gale youre making a website tryna get people to host ur bot for you?

vivid fulcrum
#

again, you're just changing the way you send it, you're not changing the fact that you're sending it

solemn latch
#

i mean, i think its interesting. I dont think its practical, worth playing around with.

quartz kindle
#

wat

viscid gale
hot sage
#

is javascript in BDFD any better than the original language

drifting wedge
#

no

hot sage
solemn latch
#

pretty sure js in bdfd is more restricted.

hot sage
#

._,

drifting wedge
#

i dont understand ppl using bdfd

#

just code it

#

like literall

#

you can make a bot in 3 lines of code

#

10 total words

#

10!

solemn latch
#

my newest bot is super pog 👀

drifting wedge
#

verified yet?

solemn latch
#

nah

drifting wedge
#

gave up on woobot?

solemn latch
#

yeah woobot is ded

drifting wedge
#

rip

hot sage
#

@drifting wedge i cant use any other coding program, so

drifting wedge
#

why nit

#

not*

hot sage
#

cus im on a chromebook that is to old to run linux

drifting wedge
hot sage
#

if it could run linux then i could oc get js or python

drifting wedge
viscid gale
#

so basically.. i'll give an example

let's say the host is a game server.. it will give the client code to make a special connection(unique headers and shit) but the game dev doesn't want people imitating the code to make the connection themselves(they only want browser connections to do it)
usually, one would obfuscate the code so that it is ALMOST IMPOSSIBLE for the user to figure out the connection mechanism(unique headers or whatever) but what if you can just hide the code completely?

another example, is the hidden script can be an encryptor and decryptor system.. and if that script is hidden, encrypted communication between client and server can happen flawlessly(since no user would find the encryptor and decryptor system)

quartz kindle
#

it doesnt matter what your computer is, you can code in any language

hot sage
viscid gale
quartz kindle
#

if you dont want to or cant run it in your own pc, you can always code it there and run it somewhere else

vivid fulcrum
#

you're just changing the way you give the script to the client

hot sage
vivid fulcrum
#

the client gets the script either way

#

data in, data out

drifting wedge
#

@vivid fulcrum gib script 🔫

#

this is a stickup

#

hand over your js

quartz kindle
#

gib script please or i report you

hot sage
solemn latch
#

a server, or a vps

quartz kindle
#

another pc, a hosting service, a server, etc

solemn latch
#

or repl

hot sage
#

o

viscid gale
#

xDDD

vivid fulcrum
quartz kindle
#

most bot owners rent servers to run their bots in, aka VPS, Virtual Private Server

drifting wedge
#

its hidden

quartz kindle
#

its not free but its very cheap

vivid fulcrum
#

if there was a (good) way to do this, it would have already been done

#

and it technically has - SSR

viscid gale
#

ssr is a big name for executing script on host

vivid fulcrum
#

yes

#

you do not send the entire script to the client

viscid gale
#

the 2 examples that i gave are impossible to replicate ssr

quartz kindle
#

ssr is dumb, change my mind

viscid gale
#

you cant pretend to make a client server connection in theory you have to tell the client to connect

vivid fulcrum
#

sure

#

that's not related whatsoever to what i said

viscid gale
#

but hiding script would be able to do things ssr cannot do

vivid fulcrum
#

you CAN'T hide it

#

you CANNOT

#

i don't know what you don't understand about data in, data out

hot sage
#

wait a minute

solemn latch
#

it takes one person who knows how to defeat your method to defeat the purpose, which it seems many developers understand it, which includes the common hacker you seem to be targeting against.

hot sage
#

glitch does free bot hosting right?

solemn latch
#

its against their tos

#

replit can do it free without breaking any TOS, just dont expect great performance

vivid fulcrum
#

if i really want to tell you to grab me a can of coke, i can tell you that face to face - i can also write you a letter, text you and call you. you'll still get the message - "can you grab me a can of coke"

it's the same way for this. you're just changing the method of sending the script, not the fact that you're ACTUALLY sending the script. again - data in, data out

unreal estuary
#

where can i host my nodejs apps other than heroku 4 free

misty sigil
#

its generally a bad idea to host for free

unreal estuary
#

well im a broke teenager so

viscid gale
viscid gale
hot sage
unreal estuary
#

ive been using heroku but all my hours are used up

viscid gale
#

imagine paying to host

solemn latch
#

am i the only one who had pocket money as a teenager? 👀

misty sigil
#

nah

hot sage
#

thats why im on a chromebook rn

viscid gale
vivid fulcrum
#

paying for a VPS is equivalent to a cheeseburger and fries at mcdonalds once a month

unreal estuary
quartz kindle
#

the best free host you can get is google compute engine F1 micro, but you need a credit card to create an account

hot sage
#

ah

quartz kindle
#

just borrow one from your parents

solemn latch
#

yeah, $30 a year is a decent VPS, or a cup of coffee from starbucks a month.

misty sigil
quartz kindle
#

alternatively, if you cant have a credit card, and absolutely dont want to pay a single cent per year, your best bet would be repl.it

solemn latch
#

^

vivid fulcrum
#

you can definitely find ways to earn money even as a teenager, without any physical work

#

sell your services

unreal estuary
#

paypal is

#

limited

vivid fulcrum
#

i've picked up fiverr recently and it's a decent side hustle as i can't balance an actual job with extracurriculars and school

#

you should definitely check out fiverr and services alike

unreal estuary
#

yeah

#

but like how should i accept money

vivid fulcrum
#

fiverr allows you to withdraw to paypal or through bank transfer

unreal estuary
#

yeah ill try use paypal

#

unless it gets banned

vivid fulcrum
#

there's definitely ways

#

you can open up a btc wallet

#

accept payment in btc on forums like ogusers and mcm

quartz kindle
#

i tried using fiverr, didnt get a single job

unreal estuary
#

or other crypto currencies

vivid fulcrum
#

there's probably a provider that accepts it

#

just gotta find the right one

solemn latch
quartz kindle
#

instead i received 4 fake messages from chinese people who said they have "big business opporunity" for me

vivid fulcrum
#

i've earned around 150 USD in my first month

quartz kindle
#

and 1 message from a a dude from angola wanting to learn react, the only thing i dont do in js

misty sigil
#

tim maybe you should've listened

#

there might've been a big business opporunity

unreal estuary
#

lol

viscid gale
solemn latch
#

nah

viscid gale
#

;-;

vivid fulcrum
#

i honestly respect side hustling a lot, but i hate it when people complain about their financial situation and then proceed to... do nothing about it

misty sigil
#

yea, it really isn't hard to save a bit of money

viscid gale
#

well.. as of now im broke but when i finish college i shall graduate from unemployed

#

after i reach college of course

vivid fulcrum
#

you should definitely find some places open to take traineeships

#

get work experience

solemn latch
#

i do think a lot of younger people here are also afraid to ask their parents to support them.
I think most here would be surprised how far your parents will go to help you make a little money, or to help you learn.

I remember using my moms paypal for all kinds of stuff. I would ask every time, explain what i was doing, and how i was getting money.
back then i didnt need servers, but if i asked any family member for $3 a month for learning purposes(using a vps to host my projects) im confident any one of them would have done it.

quartz kindle
#

can you get rated on fiverr without doing jobs?

vivid fulcrum
#

i don't think so

#

the only ratings i got were when i turned in my orders

lament rock
#

bot reviews

#

dodged a bullet on that one

quartz kindle
#

how did you get your jobs considering fiverr is so competitive?

#

like no matter what you post, there are already 20 other people with 500 stars doing the exact same thing

vivid fulcrum
#

i sucked up to fiverr's algorithm

#

i took any free courses available to skyrocket my profile

quartz kindle
#

hmm

vivid fulcrum
#

obviously there's more to that

#

having images in your gig etc

#

basically doing everything fiverr allows you to do

quartz kindle
#

yeah i did all i could and let it run for 3 months

#

until it deactivated itself from inactivity, because i didnt get any message to reply to

#

xd

vivid fulcrum
#

oof

#

a lot of that is also affected by the gig name and the gig image

#

you gotta make users want to click on your gig

#

then once they click - make them want to work with you with your wording in your description

#

why they should work with you

#

what you offer but others don't

quartz kindle
#

yeah i have no problem with that

#

im good at writing docs and descriptions

#

i know how to present myself and my product

#

i guess i was just unlucky

#

might give it another try later

vivid fulcrum
#

quite possibly, i definitely recommend it

quartz kindle
#

what kind of jobs did you do?

vivid fulcrum
#

discord bots and totally not userbots

#

i'm totally not saying not to not get my account deleted

quartz kindle
#

and your gig was just about making discord bots?

vivid fulcrum
#

yup

quartz kindle
#

ah

vivid fulcrum
#

i might move to full software development later

quartz kindle
#

i tried broader js jobs

#

maybe thats why

vivid fulcrum
#

true

quartz kindle
#

more specific things often work better

#

i didnt want to go for bots because i've had bad experiences with that

vivid fulcrum
#

try multiple gigs focused on different things

quartz kindle
#

13 yo kids wanting bots that do EVERYTHING and pay 100 bucks

vivid fulcrum
#

(in the future)

#

for the most part, my audience on fiverr is sane

quartz kindle
#

do you also host their bots?

#

or just give them the code

vivid fulcrum
#

nope, that's on them

#

i compile the code and obfuscate it

#

the source code is sold separately as an addon in the order

quartz kindle
#

hah tricky

vivid fulcrum
#

there's also a full license i wrote

quartz kindle
#

advantages of c langs i guess

vivid fulcrum
#

you can also do that with node i think? compiling to node bytecode but god knows if it's going to work properly

quartz kindle
#

nwjs can do that

#

they have a bytecode compiler for js files

#

its nice for desktop apps

sour flame
#
const { Message } = require('discord..js');
const Client = require('../structures/Client');
module.exports = {
    name: `ping`,
    /**
     * @param {Client} client
     * @param {Message} message
     * @param {String[]} args 
     */
    run: async(client, message, args) => {
        const msg = await message.channel.send(`Pinging...`);
        await msg.edit(client.embed({ description: `Pong!\nMessage edit: ${msg.createdAt - message.createdAt}\nWs: ${client.ws.ping}`}, message));
        await msg.edit(`Pong!`);
    }
}
``` Did I do something wrong in coding cause e!ping not working
unreal estuary
#

cant u use pkg to compile node apps

drifting wedge
#

@vivid fulcrum u sell bots

#

on fiverr

#

but dont give the code

vivid fulcrum
#

😉

#

the app just works™️

#

if you want the code, pay for it

#

license your code fellas

drifting wedge
#

i mean people dont give a shit about licenses

vivid fulcrum
#

fair point

drifting wedge
#

like patents

#

u post the "code" out there and tell people not to

vivid fulcrum
#

but mentioning legal action will make them aware of the danger

drifting wedge
#

instead of not posting

#

@vivid fulcrum if i copy ur code will u sue me?

#

exactly

#
  • u dont know my real name
#

i wouldnt

#

cuz im an upstanding person

#

but other ppl

vivid fulcrum
#

if i were to actually take some legal action against you, i'd probably find your contact information somewhere i guess

drifting wedge
#

i mean ig so

#

but where would you?

vivid fulcrum
#

github

drifting wedge
#

i dont have contact info there

vivid fulcrum
#

commits

drifting wedge
#

wdym?

vivid fulcrum
#

your email is in the commits

drifting wedge
#

oh

#

still

#

someone could ignore?

#

then what do you do?

vivid fulcrum
#

again i'm not qualified for this so i don't know lol

drifting wedge
#

yeah lol

#

but like exactly

#

if someone would copy your code

#

u cant do anything really

vivid fulcrum
#

you probably could if it was that important to take legal action against

drifting wedge
#

ehh

#

like patents for example

#

u say exactly how to make it

#

publicly

#

and tell people to "not make it"

lyric mountain
#

licenses are a simple yet effective way to protect ur stuff

unreal estuary
quartz kindle
#

pretty sure most people do some form of license infringement without knowing

unreal estuary
#

yeah

#

isnt it automatically in the package.json

#

idk

quartz kindle
#

there is a lib that checks npm licenses for you

unreal estuary
#

what is it

quartz kindle
#

check this out

#

only things that i have installed are discord.js and eslint

#

15 ISC and 1 unlicense

#

you cant freely use ISC libs without permission

unreal estuary
#

woah

quartz kindle
#

actually nvm

#

im confusing it with UNLICENSED

unreal estuary
lament rock
#

I used to distribute my source as UNLICENSED until I made my own non permissive license.

#

people still tried to deploy my bot to Heroku despite it requiring an sql db and a redis instance

crimson vapor
#

UNLICENSED means do whatever the hell you want?

lament rock
#

No

#

UNLICENSED is intrinsically non permissive. It's an "all rights reserved"

quartz kindle
#

aka, you're forbidden to use it without my permission

crimson vapor
#

Ty for the translation

median cipher
#

hi

unreal estuary
#

literally all my projects are private so eh

livid lichen
#
Bot.setInterval(() => {
    Bot.user.member.voice.setDeaf(true, "To protect & respect users' privacy, Ch1llBlox will always stay deafened.");
  }, 1000)
``` Would this work?
crimson vapor
#

Did It work?

livid lichen
#

Not sure.

#

I'm about to see.

sudden geyser
#

Deafening yourself probably does not even give the user extra privacy except for confidence

sudden geyser
#

But that's just a feeling. It's not actual privacy

sour flame
#
const { Message } = require('discord..js');
const Client = require('../structures/Client');
module.exports = {
    name: `ping`,
    /**
     * @param {Client} client
     * @param {Message} message
     * @param {String[]} args 
     */
    run: async(client, message, args) => {
        const msg = await message.channel.send(`Pinging...`);
        await msg.edit(client.embed({ description: `Pong!\nMessage edit: ${msg.createdAt - message.createdAt}\nWs: ${client.ws.ping}`}, message));
        await msg.edit(`Pong!`);
    }
}
``` Did I do something wrong in the code?
livid lichen
zenith terrace
#

you did 2 .

#

discord..js

sour flame
#

lol

#

thx

sudden geyser
#

Alright, though I think you should change the reason supplied since it's kinda misleading.

livid lichen
sudden geyser
#

oh I see

livid lichen
#

Yeah.

lost wadi
#

(node:20811) UnhandledPromiseRejectionWarning: MongoError: The dollar ($) prefixed field '$inc' in 'alm_oro.0.$inc' is not valid for storage.

#
let data = await g_economy.findOne({
      userID: message.author.id
    });

    if (!data) data = await g_economy.create({ userID: message.author.id });
let busca_id = data.alm_oro.find(x => x.id == parseInt(args[0]));

    if (busca_id) {
      
      const si_existe = new Discord.MessageEmbed()
        .setAuthor(
          message.author.tag,
          message.author.displayAvatarURL({ dynamic: true })
        )
        .setDescription(
          ":coolduerme: Se han almacenado " +
            data.pro_oro +
            " de oro"
        )
        .setColor("RED")
        .setTimestamp();

      let dep
      if(busca_id.limite < data.pro_oro) dep = data.pro_oro - busca_id.limite
      dep = data.pro_oro

        await data.updateOne({
        alm_oro: {
          id: parseInt(args[0]),
          limite: busca_id.limite,
          $inc: {lleva: dep}
        }
        });
      await data.updateOne({
        userID: message.author.id,
        $inc: {pro_oro: -dep}
      })
      message.channel.send(si_existe);
    }
#

ping me if you can help me

proven lantern
#
   <filter>,
   <update>,
   {
     upsert: <boolean>,
     writeConcern: <document>,
     collation: <document>,
     arrayFilters: [ <filterdocument1>, ... ],
     hint:  <document|string>        // Available starting in MongoDB 4.2.1
   }
)```
lost wadi
#

I want you to add to "lleva"

proven lantern
#

you already have the data so you should just be able to do something like data.alm_oro[0].lleva = data.alm_oro[0].lleva + 1

lost wadi
#

I do not understand

lost wadi
#
await data.updateOne({
        alm_oro: {
          id: parseInt(args[0]),
          limite: busca_id.limite,
          lleva: dep
        }
        });

If I do this, it will put the value that "dep" has, but it does not add

#

I do not know what to do

proven lantern
#
await data.updateOne({
  alm_oro: {
    id: parseInt(args[0]),
    limite: busca_id.limite,
    lleva: dep + 1
  }
});```
lost wadi
#

What does the "+ 1" do?

#

.___.

viscid gale
#

@quartz kindle you online?

#

oof

umbral zealot
#

Anything the rest of us can maybe help you with? ^_^

crimson vapor
#

DJS | DJSL | DROSE | DETRITUS | ERIS

#

djs with no configuration

#

djs-light and drose with no caching

#

detritus with almost all of it disabled

#

eris was default

solemn leaf
#

detritus

#

lookin fine today

summer torrent
#

time to drose rewrite

solemn leaf
#

anyways @viscid gale you dont need tim

#

we can help you perfectly fne

earnest phoenix
#

my gateway + logic workers only use 3mb together

viscid gale
#

u might not want to

solemn leaf
#

if we dont want to

#

what would make tim to want to

viscid gale
#

Cuz he legit did it the first time

solemn leaf
#

what is it

earnest phoenix
crimson vapor
#

rust?

earnest phoenix
#

both are go

crimson vapor
#

ah

#

go

#

what is the minimum alloc memory for go?

#

its like 20mb for node

viscid gale
#

Ok.. so I tried to hide some script.. I can trick the browser but I already dmed him asking him to use that tool again because I added some text in a specific way so I'll be able to tell where my wanna be hidden script gets caught

earnest phoenix
#

I've no idea, I don't think there is a minmum since when the logic worker boots its at like 400KiB

viscid gale
#

@solemn leaf that's y I was trying to ask him specifically

solemn leaf
#

that is for a bot?

viscid gale
#

No it's for a .. OMG goodnight :(

crimson vapor
earnest phoenix
#

4611 are the intents. and I don't block any events

solemn leaf
#

I defaulted mine to be 516 I think

earnest phoenix
#

also having zero alloc read and write websocket lib helps a LOT

hasty mulch
#
@commands.command(name='bounty')
@commands.guild_only()
async def _bounty(self, ctx, member: discord.Member = None, amount = None):
    if not member:  # if member is no mentioned
        member = ctx.author  # set member as the author
    
#          user = ctx.bot.get_user(id=ctx.author.id)
#          bountyperson = ctx.bot.get_user(id=member.id)
    
    if amount == None:
        async with aiosqlite.connect('/home/pi/Documents/Central_Communications/database/economy.db') as db:
            cursor = await db.execute(f"SELECT bounty FROM economy WHERE user_id = {member.id}")
            bounty = await cursor.fetchone()
            bountycheck = bounty[0]
            print(bountycheck)
            if bountycheck == None:
                embed=discord.Embed(
                    type='rich',
                    colour=discord.Color.dark_green(),
                    description=f'{ctx.author.mention}: You do not have a bounty placed on you!'
                    )
                embed.set_author(name=ctx.author, icon_url=str(ctx.author.avatar_url))
                embed.set_footer(text="Developed by LIPD Productions Inc.#1205", icon_url=str(ctx.guild.icon_url))
                embed.timestamp=datetime.datetime.utcnow()
                await ctx.send(embed=embed)
                pass
            pass
        pass
    pass
#

How can I get bountycheck as a str?

earnest phoenix
#

thonk

hasty mulch
#

?

earnest phoenix
#

what is bounty data type in db?

hasty mulch
#

Text

#

@earnest phoenix

earnest phoenix
#

then it's already a string? Thonk

hasty mulch
#

Well, the if statement doesn’t see it as a string

#

How do I do that thing where I see what type bountycheck is?

earnest phoenix
#

what bountycheck prints?

#

type(obj)

hasty mulch
#

It is a str, wtf?

#

Why isn’t it passing in the if statement?

earnest phoenix
#

I have no clue which if statement

hasty mulch
#

if bountycheck == None:

earnest phoenix
#

wdym by not passing?

#

pro tip: use is operator when comparing to None

hasty mulch
#

Derp...

#

Still nothing

hasty mulch
earnest phoenix
#

because, it's str Thonk

#

What are you on?

#

this is hard to explain, but how do I store information by a name or soemthing (so I can find it back later) then inside of that information it has more info, then once it is stored, how do I later retrieve it

hasty mulch
earnest phoenix
#

there's no issue lol

#

you're comparing a str with None, what's so weird from it evaluating False?

hasty mulch
#

If there was no issue, then I would get the embed, but I don’t

earnest phoenix
#

Do you genuinely really expect str to be equivalent with None lmao

hasty mulch
#

It works with the args

earnest phoenix
hasty mulch
livid lichen
#

const User = Bot.users.fetch(request.vote.user)TypeError: Cannot read property 'users' of undefined. I'm quite stuck right now. Anyone know what I did wrong?

livid lichen
earnest phoenix
#

show the code

livid lichen
#
Router.post("/ch1llblox/uservote", Webhook.middleware(), async (request, response) => {
    const User = global.Bot.users.fetch(request.vote.user)

    if (User){
        try {
            var Multiplier = await global.Bot.Database.get(`UserData_${request.vote.user}.multiplier`)
  
            if (!Multiplier) {
                Multiplier = 1
            }
    
            await global.Bot.Database.add(`UserData_${request.vote.user}.ch1llbucks`, 1000 * Multiplier)
    
            User.send(`Thanks for voting!\nYou just earned yourself \`❄${await global.Bot.FormatNumber(1000 * Multiplier)}\` coins for voting on top.gg.`)
            console.log(`User voted! Username: ${User} ID: ${request.vote.user}.`)
    
            return response.status(200).send({ status: 200, message: "OK" })
        } catch(err) {
            
        }
    }
})
#

Console.log(global.Bot) Shows it's there.

earnest phoenix
#

I don't see Bot itself defined

livid lichen
#

Gives the bot.

earnest phoenix
#

well you just put that there

livid lichen
earnest phoenix
#

const User = Bot.users.fetch(request.vote.user) you sent this before

#

where it just shows Bot by itself

livid lichen
earnest phoenix
#

chill on the ping

livid lichen
#

Alright sorry

bleak spire
earnest phoenix
#

yeah you're confusing me

livid lichen
gilded dust
#

Ay

earnest phoenix
#

cool, i'm just not gonna help

livid lichen
earnest phoenix
#

i dont understand why you put Bot there by itself when you said Bot is global.Bot

#

have you saved the code

livid lichen
quaint wasp
#

umm

#

how do I do this?

#

oh

#

OW

#

never mind.

#

wait

#

does the file suppose to be named...

#

git.git?

#

or..

#

me.git?

#

Or name doesnt matter?

#

I did this but it didnt work

#

help..

long crow
#

Just your name and email

#

Without the fancy wrapping

#

Like user.name yolo

grizzled raven
#

i think it's really something like git config --global user.name SmugTheKiller

#

and git config --global user.email "whatever@starboard.lol"

long crow
#

Without the quote

grizzled raven
#

if you want the config for just that repository then remove the global flag

#

but eh they probably solved it in vc

quaint wasp
#

o

hasty mulch
#
@commands.command(name='bounty')
@commands.guild_only()
async def _bounty(self, ctx, amount, member: discord.Member):
    print(f'Bounty on {member}')
    user = ctx.bot.get_user(id=(ctx.author.id))
    bountyperson = ctx.bot.get_user(id=(member.id))
    async with aiosqlite.connect('/home/pi/Documents/Central_Communications/database/economy.db') as db:
        await db.execute(f"UPDATE economy SET bounty = bounty + {amount} WHERE user_id = {member.id}")
        print(f'Placed a {amount} bounty on {member}')
        pass
    await ctx.message.delete()
    await user.send(f'I have placed the {amount} bounty on {member.mention} successfully!')
    pass

Why is it whenever I give a member argument, this command just doesn’t want to complete

#

@earnest phoenix Any ideas if you’re still around?

earnest phoenix
#

if you want member to be optional, set the default value for it, for instance could be None

#

These are pretty much useless tbh

#

ctx.author and member are what you need, no need to get it again

#

Also, why on earth bounty is text? Why not integer?

hasty mulch
#

Idk at this point

#

@earnest phoenix Apple took away my photos so I’m trying to do this and get my photos back

devout thorn
#

...

spice tide
#

does anyone know how to make a command work only in dms

#

@earnest phoenix

earnest phoenix
#

Just simple if statement. If you're using d.py and its command handler, there's dm_only decorator

spice tide
#

I use js

earnest phoenix
#

Doesn't change my point

spice tide
#

e

earnest phoenix
#

I'm here because of pokemon go? I was just wanting some pokemon

hasty mulch
#

@ember atlas

ember atlas
#

@earnest phoenix This isnt the server for that

earnest phoenix
#

Help?

#

How can i make a join role? at js?

#

@earnest phoenix Its a top.gg server

agile lance
spice tide
#

okkk

#

thank you

agile lance
#

np

#

if that doesnt work for whatever reason you can do: if(message.channel.name == undefined || message.channel.name == null) { // COMMAND CODE } else { message.reply("This command is DM only."); }

zenith terrace
#

or you could do

if(!message.channel.type === "dm") {
// error code
} else {
//code
}```
#

it should work

#

or do the other way around if(message.channel.type === "dm")

earnest phoenix
#

You can do:

if(!message.channel.type === 'dm') {
// error code
} else {
// your code
}
lyric mountain
#

Actually

#

That'll not work

#

Because !message.channel.type becomes a boolean

#

And boolean cannot be equals to a string

#

Help menu of what?

#

Idk, ask in its support server

sacred aurora
#

what about checking if message.guild exist

#

that'll work right

lyric mountain
#

That's doable

spice tide
#

atom?

#

you need atoms?

lyric mountain
#

@earnest phoenix you're in the wrong server

#

Some mod please do -wrongserver

#

You mean the text editor?

#

What about it?

#

I don't know, it's you who's trying to ask a question

simple zodiac
#

Anyone know how to get the total boost count in a server? I'm trying to add a server info command for my bot, and I can't figure out how to get the total count. (Using discord.js)

cinder patio
simple zodiac
#

why do you have guild in <>?

umbral zealot
#

Because it's pseudocode, where <guild> represents "a guild object"

simple zodiac
#

oh ok

#

do you know how to get the tier?

#

I tried ${message.guild.premiumSubscriptionTier} but that gave me undefined

umbral zealot
#

There's only 3 of them surely you can just add some conditions?

simple zodiac
#

wdym?

cinder patio
#

There's .premiumTier

umbral zealot
#

"if the sub count is between 2 and 15, it's tier 2", etc

simple zodiac
#

ah ye

#

i was looking for what google feud said

cinder patio
slender thistle
#

tldr rtfd

simple zodiac
#

sorry

old cliff
#

what event is emmited when all shards are spawned?

simple zodiac
#

Thanks for the help tho google, that worked.

earnest phoenix
#

How do i check what all servers my bot is in?

#

Anyone mind helping?

#

@earnest phoenix @leaden forum

#

Maybe u could help

earnest phoenix
earnest phoenix
#

Idk how

#

Hi this is a question related to the documentation. How do i create emojis in servers with code? it isnt stated anywhere on the documentation.
this is what i am assuming it might be

message.guild.emojis.create("name", {
    image: "link"
})

so if you guys know how to do it. can you help me? (discord.js)

inland galleon
#

hello

#

i made 2 bt

#

<820157036016173098>

old cliff
#

How does sharding on multiple devices work?

inland galleon
earnest phoenix
#

Hi

#

Im Using discordrb

restive furnace
#

i am not that good at explaining but i can try

old cliff
#

Nvm I googled it 1 hours ago

restive furnace
#

oh ok

old cliff
#

shardingmanager on ready?

pale vessel
#

oh you use that

willow mirage
#

@pale vessel lmao so lucky

#

atleast I submitted my website before it

pale vessel
old cliff
#

wdym?

willow mirage
#

free domains

pale vessel
earnest phoenix
#

I made a repl on replit.com using the create react app template, change no files and when i run the repl it crashes

old cliff
#

also what does sharding manager shardlist do?
Does it spawn only the indicated shard?

earnest phoenix
#

It says caniuselite or smth is outdated

lament rock
restive furnace
#

why use shardingmanager even? just implement your own + assing one process more than 1 shard

earnest phoenix
#
/rbd/pnpm-volume/2a14667f-7197-42b7-8bde-032a9ed22324/node_modules/.registry.npmjs.org/youtube-sr/4.0.3/node_modules/youtube-sr/build/main.js:69
                                    url: item.channel.thumbnails?.default.url,
                                                                 ^
SyntaxError: Unexpected token .
    at Module._compile (internal/modules/cjs/loader.js:703:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/rbd/pnpm-volume/2a14667f-7197-42b7-8bde-032a9ed22324/node_modules/.registry.npmjs.org/discord-player/3.4.0/node_modules/discord-player/src/Player.js:3:14)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/rbd/pnpm-volume/2a14667f-7197-42b7-8bde-032a9ed22324/node_modules/.registry.npmjs.org/discord-player/3.4.0/node_modules/discord-player/index.js:5:13)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
#

Can anyone help me

willow mirage
#

update to v14.x.x

#

node.js

earnest phoenix
#

K

willow mirage
#

i mean node.js

#

not d.js

iron tendon
#

Why don't we use INI files for config?

(Left: INI, Right: JSON)

cinder patio
#

It's personal preference

#

also JSON files work best for node.js cause there's a built-in parser, while you'll have to install 3rd-party parsers or make your own for other config formats

restive furnace
#

writing parsers is what i do daily

#

make your own config format

lament rock
#

It's worth noting that most of the user base of discord.js and other high level libs are beginners

restive furnace
#

true true

old cliff
crystal wigeon
#

i got threats

#

from a dude

#

on discord

#

where do i report?

lament rock
#

Discord trust and safety

tired panther
crystal wigeon
tired panther
#

rip

crystal wigeon
#

lol

#

sad

tired panther
#

Is it normal, I have written Discord on email for the Member Intent on 24.2 and they did not reply till today adontfeelsoblob

lusty quest
#

its normal

old cliff
#

Bru

opaque seal
#

Is anyone here good with kotlin microservices (grpc)

restive furnace
#

ask the question please.

pale vessel
#

Hey, I have a question.

quartz kindle
#

hey, i have a question

earnest phoenix
#

Hey, I have a question

radiant kraken
#

Hey, I have a question

vivid fulcrum
#

Question, I have a hey

feral aspen
#

bot.users.cache.get("ID")

#

Is there a way to fetch by name?

#

I'm just checking with docs as well.

vivid fulcrum
#

fetch or get

feral aspen
#

I didn't find how to do that in docs.

#

It just tells me this.

vivid fulcrum
#

yes, but do you want to fetch or get

#

they're different things

feral aspen
#

Anything to find the user name by the bot's cache and not from the server.

#

.. and not the user id

feral aspen
#

Oh, thanks.

#

:)

marble juniper
#

lol

iron tendon
marble juniper
#

I use a modified discord.js lib

iron tendon
quartz kindle
tired panther
#

js is good to blobsmirk

opaque seal
iron tendon
#

guess what lib erisly uses

lament rock
# iron tendon commercial bots use python, java or c#

Not all. In the scope of bots, there is no difference between python and javascript. They're both interpreted languages, just one more representing functional but still oop than the other, arbitrary code execution at runtime, large user bases and lots of libs in active development

#

I can't see why anyone would want to unironically code a bot in java. Cs, I can understand why

pale vessel
iron tendon
lament rock
#

Okay. Couldn't any other language do that

vivid fulcrum
#

java has nicely designed libs

#

java as a language is 🚮

iron tendon
#

also, what is this G.A.S Bot bot?

lament rock
iron tendon
lament rock
#

Ew

vivid fulcrum
#

the questionable language design aside, the performance sucks ass

iron tendon
#

kotlin ftw

vivid fulcrum
#

...which still runs on JVM

lament rock
#

heap size go brr

iron tendon
#

bts ftw

born to shit forced to wipe

lament rock
#

JVM heap alloc suck

fierce ether
#
    const user = client.users.cache.get(id) || (!!findMember && findMember.user)``` this dosent fetch from client, only works if member is in guild
lament rock
#

client.users.fetch is the function to fetch from Discord

vivid fulcrum
#

java is absolute garbage in 2021, i'd definitely recommend going with c# instead due to similar syntax and the fact that .net became really powerful in the last 4 years

#

cross compilation, self contained apps, godly GC

fierce ether
lament rock
#

sure. That returns a Promise<User>
Although, you'd probably want to handle the error properly if you're absolutely expecting it to be a User

fierce ether
#
    const user = client.users.cache.get(id) || (!!findMember && findMember.user) || client.users.fetch(id).catch(() => {})
    if (!user) throw new CommandError(t(this.errors.invalidUser))```
lament rock
#

you'd need to await the Promise from fetch

#

!!Promise<any> would always resolve to true

cinder patio
#

Also why double !

fierce ether
#

its now returning this

pale vessel
#

looks about right

fierce ether
#

yeh its the user object, but idk why its still throwing errors

pale vessel
#

can you show what you edited?

fierce ether
#

i had to change the memberparamater thats why

#
  static async parse (arg, context) {
    if (!arg) return

    const { guild, client} = context
    const user = await super.parse(arg, context)
    const getMember = guild.members.cache.get(user.id) || await client.users.fetch(user.id).catch(() => {})
    return getMember
  }``` to this
pale vessel
#

that's weird, you're mixing members and users

#

members.cache.get() returns a member and users.fetch() returns a user

fierce ether
#

message.guild.ban is not a function?

fierce ether
vivid fulcrum
#

jinx

fierce ether
#

yes thx

#

but now that throws errors yet im catching it

#
    try{
        if(member.bannable) { 
             await member.ban({ days: 7, banReason })
          } else guild.members.ban(member, { reason: banReason })
        } catch(e) {
        
        return message.send(e)
      }```
pale vessel
#

why, they both do the same thing?

fierce ether
#

its console logging error?

#

oh do they?

pale vessel
#

you're not awaiting the guild.members.ban

autumn dust
#

Hey i typed a!help to my bot and it gave me this error

PS C:\Users\justi_8vy6ryi\Downloads\TTGProtect-master\TTGProtect-master> node bot.js
[info] Started the best Discord bot! Running...
[info] Connected to Discord as: Aferistai#8799 with the id: 794595155592085515! Prefix: a!, branch: master, version: 7.3
[command-execute] The command help has been executed by Rui#0069 in Aferistai
(node:3076) UnhandledPromiseRejectionWarning: TypeError: Discord.RichEmbed is not a constructor
    at C:\Users\justi_8vy6ryi\Downloads\TTGProtect-master\TTGProtect-master\events\message.js:18:27
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:3076) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:3076) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
``` Help me
pale vessel
#

you might have updated to discord.js v12, which renamed it to MessageEmbed

fierce ether
#

do i not need both then?

pale vessel
fierce ether
#

guild.members.ban(member, { reason: banReason })?

pale vessel
#

doesn't matter

#

any of those two

#

and await it

#

sus

sour flame
#
(node:7776) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7776) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Universal Economy#6211 is now online!
(node:7776) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toLowerCase' of undefined
    at EconomyClient.<anonymous> (C:\Users\ravi_\Desktop\Discord Bots\EconomyBotV4\structures\Client.js:39:73)
    at EconomyClient.emit (events.js:310:20)
    at MessageCreateAction.handle (C:\Users\ravi_\Desktop\Discord Bots\EconomyBotV4\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\ravi_\Desktop\Discord Bots\EconomyBotV4\node_modules\discord.js\src\client\ websocket\handlers\MESSAGE_CREATE.js:4:32)
``` Keeps giving meh an error when I do e!ping
sour flame
pale vessel
#

i guess i am sus Sadge

pale vessel
#

the property before .toLowerCase() is undefined

sour flame
#

kkk

#
     });
        this.mongoose.connection.on('connected',() => console.log("DB connected"));
        this.on('ready', () => console.log(`${this.user.tag} is now online!`));
        this.on('message', async(message) => {
            if(message.author.bot || !message.guild || !message.contect.toLowerCase().startsWith(this.config.prefix)) return;
            const args = message.contect.slice(this.config.prefix.lenght).trim().spilt(/ +/g);
            const cmd = args.shift().toLowerCase();
            const command = this.getCommand(cmd);
            if(!command) return;
            if(command.timeout) {
                if(this.timeouts.has(`${command.name}${message.author.id}`)) return message.channel.send(this.embed({ description: `Please wait ${this.ms(Date.now() - this.timeout.get(`${command.name}${message.author.id}`), 
                {long: true}
                )}`,
               })
             );
``` Here
pale vessel
#

It's message.content, not message.contect

sour flame
#

lol

#

mispelled

pliant obsidian
#

can someone tell me why I still get this error Top.GG API Error: 429 Too Many Requests even if no one spams the api?

#

are the rate limits cumulative? like if i got ratemited 2 times in 1 min will it be 1h 59min? or it still 1h?

sour flame
#

My screen

zenith terrace
#

failed to connect to mongo

sour flame
#

I see that

#

I changed that

graceful shore
#

can someone help i keep getting this error and i dont know what is causing it

vivid fulcrum
#

did you read the error

pale vessel
#

no

zenith terrace
#

no

lament rock
#

Who reads

vivid fulcrum
#

nerds smh

graceful shore
#
C:\Users\Creep\Desktop\node_modules\discord.js\src\rest\RequestHandler.js:154
      throw new DiscordAPIError(request.path, data, request.method, res.status);
            ^

DiscordAPIError: Missing Access
    at RequestHandler.execute (C:\Users\Creep\Desktop\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async RequestHandler.push (C:\Users\Creep\Desktop\node_modules\discord.js\src\rest\RequestHandler.js:39:14) {
  method: 'post',
  path: '/channels/784226460138995722/messages',
  code: 50001,
  httpStatus: 403
}
vivid fulcrum
#

ok, but did you read the error

graceful shore
#

yes

vivid fulcrum
#

and what does it say

graceful shore
#

missing access

vivid fulcrum
#

so, what are you confused about

graceful shore
#

i dont know what is causing it

#

i dont know what is missing access

vivid fulcrum
#

you not checking for permissions before executing commands

lament rock
#

look at the method and the path

#

you can deffer that you don't have permissions to send a message to a channel

graceful shore
lament rock
#

That would be logical, yes

onyx hare
#

Cant rmbr the link to find the bots top token

graceful shore
#

well i didnt get this error before so maybe its because im using canvas and its trying to send images in channels the bot does not have perms for

vivid fulcrum
#

you should check if your bot has permissions a command requires before executing it in the first place

graceful shore
#

yeah

#

how do i check if the bot can send images

vivid fulcrum
#

attach files permission

graceful shore
#

nvm found it

thick nexus
#

O there's a embed limit of 6k?

#

What dat mean

lament rock
#

Only 6000 characters can be sent in an embed across all fields

#

this includes author, footer, description and such fields

thick nexus
#

Hmmm

graceful shore
#

@vivid fulcrum im still getting the error even tho im doing

if (!member.guild.me.hasPermission(['ATTACH_FILES', 'SEND_MESSAGES'])) return;
sudden geyser
#

Missing Access usually means you don't have permission to access some area, like if you don't have permission to view a channel yet try posting a message in it (I think)

slender thistle
#

hasPermission
passed array

sudden geyser
#

You can do that.

#

Checks if all permissions match

pale vessel
#

check channel overwrites too

slender thistle
#

Now I'm not sure if that's just counter intuitive or me being pissy at random stuff for no reason

pale vessel
#

member.permissionsIn(channel).has()

#

you probably just need that

livid lichen
#
node:32) Warning: Accessing non-existent property 'MongoError' of module exports inside circular dependency
<stack here>
``` Hi! Is there any way I can remove the stack from the error?
pale vessel
#

Downgrade mongoose

livid lichen
#

I've seen process.on().

pale vessel
#

they will patch it once mongodb releases a fix

#

you can ignore the error

livid lichen
#

I just mean is there a way to hide the large stack that follows the error.

#

That was just an example.

pale vessel
#

I don't think you can hide the stack unless you're the one logging it (for any errors in general)

sudden geyser
#

Generally you shouldn't be hiding it.

pale vessel
#

you shouldn't hide it, you should fix it

livid lichen
#

True, but it's something I can't.

pale vessel
#

Already sent that multiple times already

#

if you're using mongodb, downgrade that instead

earnest phoenix
#

Hi this is a question related to the documentation. How do i create emojis in servers with code? it isnt stated anywhere on the documentation.
this is what i am assuming it might be

message.guild.emojis.create("name", {
    image: "link"
})

so if you guys know how to do it. can you help me? (discord.js)

pale vessel
onyx hare
#

How Can I Have This Wait 2 Seconds Before The Message Deletes So Its Doesn't Delete Before The Embed Sends

message.channel.send('**Fetching Servers...**').then(sent => {
        sent.delete();
      })
pale vessel
#

use the timeout option

#

message.delete({ timeout: <milliseconds> })

onyx hare
#

ty

willow mirage
fierce ether
#

how often can i change a vc channel name?

#

every minute?

river panther
#

:)

#

verified

#

me

#

my bot

feral aspen
#
{
    "greetings": {
        "world": "Hello"
    }
}

const { ?? } = require("Path to the JSON file")

#

I am not sure how I can get the "world" one in my {} to be used.

slender thistle
#

{ world }?

feral aspen
#

Didn't work.

#

Returns undefined

slender thistle
#

nah I'm outta here, count me out with this

feral aspen
#

Bye, I guess? 😂

chilly veldt
#
for filename in os.listdir(r'C:\Users\Satya\Desktop\Warden\warden\src\main\cogs'):
    if filename.endswith('.py'):
        client.load_extension(filename[:-3])```
```py
import discord
from discord.ext import commands
class Test(commands.Cog):

    def __init__(self, client):
        self.client = client

    @commands.Cog.listener()
    async def on_ready(self):
        print("ok")

def setup(client):
    client.add_cog(Test(client))```
  ```File "c:/Users/Satya/Desktop/Warden/warden/src/main/warden.py", line 14, in <module>
    client.load_extension(filename[:-3])
  File "C:\Users\Satya\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\bot.py", line 664, in load_extension
    self._load_from_module_spec(spec, name)
  File "C:\Users\Satya\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\bot.py", line 616, in _load_from_module_spec
    raise errors.NoEntryPointError(key)
discord.ext.commands.errors.NoEntryPointError: Extension 'test' has no 'setup' function.```
why doesnt this work :(
pls ping when you reply :)
slender thistle
#

I shouldn't be giving an advice in any case since I don't speak JS

#

Ah now that's my field

chilly veldt