#development

1 messages ยท Page 1834 of 1

quartz kindle
#

for example

#
// this is wong, see reply
let a = 5;
a ??= 7; // 7
a ??= null; // 7
long crow
#

a?.b ?? 'nope' same a.b ??= 'nope'

#

Though tried it on array, didnt work the same

split hazel
#

i dont like babel anymore

quartz kindle
#
let a = null;
a ??= 7; // 7
a ??= 9; // 7
#

it only assigns if the var is null/undefined

split hazel
#

hot

waxen bough
#

that be useful i use if (!var) several times in my proj

quartz kindle
#

ye

long crow
#

details.studios.edges[0]?.node.name ?? 'NA' Like this wont work the the operator though

#

No idea

quartz kindle
#

welp its 3am, i g2gdropdead

#

cya

long crow
#

night

wheat mesa
#

a

#

No!

#

My pm2 is struggling to start my bot for some reason

#

Actually seems like it's my VPS struggling

split hazel
#

cpu 102%

wheat mesa
#

Yeah it's odd

#

Hangs on this

#

Like 75% of the time

#

Also hangs on an online status for a solid 2 minutes or so

#

(After I stop the process)

#

Finally it loaded

#

Is this normal usage for the stats provided? ```
Loaded with:
commands: 17
cached users: 34
total users: 1534
cached channels: 143
cached members: 41
cached guilds: 17
memory usage: {"rss":132317184,"heapTotal":68399104,"heapUsed":60919304,"external":23782217,"arrayBuffers":21612946}

#

Damn, Tim went offline

waxen bough
#

alone

split hazel
#

IT WORKED

#

nice

#

transpiled new node to node 10

#

@waxen bough @quartz kindle possible

#

left is babel right is original transpiled to node 12

#

think thats all the config you need (havent tried compiling djs yet)

#

can i target node v0 lmao

#

it worked (anticlimactic since syntax isnt too different)

wheat mesa
#

๐Ÿค”

#

I don't know what to believe anymore

split hazel
#

idk man

vital void
#

the line 207 is client.commands.get('help').execute(embed, args); its the execution of the help command that is stored in another file.

lyric mountain
#

Then it's not finding the file

#

Console.log what commands.get('help') returns

pure lily
#

ig it's pm2 monit

#

just make your terminal wider

cinder stratus
#

https://haste.ntmnathan.com/uwuyesewoq.js Hey this is my queue class and I have a method name cleanup, what I want to do is when it's called with param memberID it will filter the results and replace the items of array with the array returned after filtering

waxen bough
#

let's see if this will run fine haha. transpiled djs codde

split hazel
#

hot

earnest phoenix
#

I need help please!! I am looking for support with the Vote Tracker bot. I did the vt!setup, vt! is my prefix, and then did the info. in DM's, but once I entered authorization and webhook URL, I clicked save, but nothing happened.

#

pls

#

idk what I am doing

wooden dust
#

--wrongserver

earnest phoenix
#

I went to the Vote Tracker server and they said to come here

#

Because when I click save, it does nothing

#

So they said it must be something to do with Top.gg

wooden dust
#

-wrongserver

#

Why the fuck isn't it working

#

sigh

earnest phoenix
#

..

#

What? I am so confused...

wooden dust
#

Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Discord" button on the bot's page of the bot you need support for, not the "Join Discord" button at the top of our website. If there isn't a button that says Support Server, the server invite is invalid or you were banned from the bot's support server, then we can't help you. Sorry :(

#

There

earnest phoenix
#

I ALR DID ๐Ÿ˜ญ

wooden dust
#

Well...

earnest phoenix
#

No one can help me ๐Ÿฅฒ

wooden dust
#

So what exactly is your issue?

earnest phoenix
#

I just wanna know why the save button won't work ๐Ÿ˜ญ

#

Look

wooden dust
#

Save button where

earnest phoenix
#

I entered the URL, auth pass and clicked save

#

But the save button does nothing

#

Neither does the test

wooden dust
#

So you want support for the site

crimson oracle
#

its because of site issues

wooden dust
#

yeah most likely

earnest phoenix
#

I WAS IN SUPPORT AND THEY SAID TO COME HERE

#

๐Ÿ˜ญ

#

PLS

fresh verge
#

How do I fix this?

earnest phoenix
#

I'm legit crying this is so hard /hj

wooden dust
#

Not here

crimson oracle
#

Just wait for the site to be fixed

wooden dust
#

Wait what

#

lol

earnest phoenix
#

People are voting and not getting the perms for the role ๐Ÿ˜ญ

wooden dust
#

Idk why they told you to come here

earnest phoenix
#

And yelling at me

earnest phoenix
crimson oracle
#

just give them the stuff manually till shit works

earnest phoenix
#

This is just difficult and no one seems to know how tohelp

wooden dust
#

Cause noone can help

earnest phoenix
#

Pls

crimson oracle
#

Its mainly cuz of site issues again
We cant really help you in this case

earnest phoenix
#

Oki, I'll try again in a bit, maybe on Monday

crimson oracle
#

till then just give the stuff manually
Hopefully the site will be fixed

crimson oracle
#

so i forgot i added a function that tells whenever somebody joins a server firebot is in, and This popped up when i looked at the console

earnest phoenix
#

@near stratus

fresh verge
#

Wdym?

fresh verge
#

Too blurry?

pale vessel
#

Yeah he was being sarcastic lol

queen rose
#

its updated here

#

when i try to view

#

tada... empty

#

tried to clear cache and cookies

#

still same

#

tried other browsers and yup still same

#

top.gg website is updating or not? its more like when refreshin to other pages it has 3 side version

#

oldest, current and beta

#

there's also things l;ike buttons that is missing like API token

pale vessel
#

That's really weird

#

Do you have any extensions installed?

queen rose
#

heres a sample:

#

watch the things i am clicking carefully

#

uBlock is disabled in top.gg to support the dev since im listing bot and server for free

queen rose
#

other extentions is volume booster, metamask and ronin for my cryptos

sly sierra
#

@queen rose on your css code

#

Youโ€™re forgot the style tag

crystal wigeon
#

hey um

#

anyone use fastify?

vivid fulcrum
drifting wedge
#

ok so im in a class and i called a function

#
NameError: name 'log' is not defined```
#

python

#

and defined it

#

but it doesnt seem to be defined??

wooden dust
#

@drifting wedge show your full code

drifting wedge
#

its fine i figured it out

wooden dust
#

Alright

drifting wedge
#

i removed it from the class

queen rose
queen rose
#

lmao

sly sierra
#

you haven't put a style tag

queen rose
queen rose
sly sierra
queen rose
#

bro

#

im using "inline" css

#
  • its a website problem
sly sierra
#
  • sounds like a you problem
queen rose
#

a 14 year old teaching me.

#

@sly sierra next time make sure that you know what you are referring to..

queen rose
queen rose
sly sierra
#

Yea I know

#

English isn't my first language, thank you

queen rose
#

Same, but i know how to use it

wary flame
#

@vagrant panther You shouldn't push your token to a public github repo

#

there's a reason it auto resets

eager egret
#

i need help regarding vc roles bot

wary flame
#

Where do you host your bot?

#

Store your token in an enviroment variable and update the code to read the token from there

#

replit has config for enviroment variables iirc

#

@vagrant panther

eager egret
modern sable
gilded plankBOT
#

@eager egret

Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Discord" button on the bot's page of the bot you need support for, not the "Join Discord" button at the top of our website. If there isn't a button that says Support Server, the server invite is invalid or you were banned from the bot's support server, then we can't help you. Sorry :(

eager egret
#

ohhh oki oki

#

sorry

earnest phoenix
#

Does someone know how to delete a msg with id

#

Like let x = message.guild.messages.cache.get("msgID")
x.delete()

boreal iron
#

Let me guess you donโ€™t have access to the message obj?

#

If not you need to get the guild from the cache of your client
client.guilds.cache.get(msgid)

#

And after that simply fetch the message by its id

earnest phoenix
hollow depot
shrewd hazel
earnest phoenix
#

hello how setup aws server in pm2 dashboard

sterile thicket
#

I have a const abc = "something" in index.js
How do I import it in command file?

#

Does const { abc } = require('./index.js') works?

cinder patio
#

module.abc = "something"

sterile thicket
cinder patio
#

sure

#

is the command file imported by index.js though?

#

If it is then that's a circular dependency

earnest phoenix
#

how can setup accorate stats command

#

can any one tell a npm package

#

which show accorate

split hazel
#

@sterile thicket you have the mutate module.exports not module

sterile thicket
split hazel
#

yes

sterile thicket
#

And in the command file, const { abc } = require('./index.js')?

split hazel
#

yes

sterile thicket
#

Ok thanks that worked....

#

But

#

I also need to use the abc in the index file as well

#

Should I create another const abc = 'something' for that?

split hazel
#

I mean don't add anything it'll work

sterile thicket
#

It didn't... It says undefined

split hazel
#

what?

#

what are you trying to do

#

and did you replace const with module.exports

sterile thicket
#

do I do const module.exports?

split hazel
#

then you can either reference it with module.exports.abc or you need to keep your const and below that add module.exports.abc = abc

sterile thicket
#

alrighty, thank you very much

devout vapor
#

hey, i have a weird question, i think? Is it possible for a bot to not be able to get the guild id of a server?

my bot is in several servers but there is only ONE server where the bot keeps breaking cos it can't seem to get their guild id, and i'm not sure why D:

rose warren
#

Maybe it's an unavailable guild?

devout vapor
#

what does unavailable guild mean? o:

rose warren
#

A guild that's offline, crashed or rate-limited. What lib are you using?

split hazel
#

@devout vapor try running console.log(guild.available) on it

#

discord js docs encourage you to check if the server is available before processing anything on it

rose warren
rose warren
#

Read the docs above

devout vapor
#

OOO: okay, i will! thank you to both of you!

solar cave
quartz kindle
# wheat mesa ๐Ÿค”

you have 20mb in array buffers (binary data / audio) and 70mb in heap (cache / js code), you are using lots of memory for something. are you running a music bot? large json files?

earnest phoenix
#

My bot is not replying to my commands anymore, i have the code all correct and the code is running but its not responding to me, know why?

quartz kindle
long crow
#

Heapused

quartz kindle
#

thats why

long crow
#

Process.memoryusage.heapuse

quartz kindle
#

heap is only js code and caches

slender wagon
#

turn of the caching

quartz kindle
#

no buffers or binary data, and doesnt count node.js itself

#

if you want an accurate memory usage of the whole process, use .rss

long crow
#

Around 110mb iirc if following pm2

#

The whole process

slender wagon
#
process.memoryUsage().heapUsed / 1024 / 1024;
``` or u can do something like this to measure how much memory the nodejs process is using
long crow
#

That ia what i used

solar cave
#

where can i get my topgg token?

digital ibex
quartz kindle
#

your bot's edit page

digital ibex
#

i think

quartz kindle
slender wagon
#

hmmmm

slender wagon
#

.rss?

quartz kindle
#

yes

solar cave
earnest phoenix
#

process.memoryUsage().rss/ 1024 / 1024;

slender wagon
#

oh ok

quartz kindle
#

since node 15.6 you can also use process.memoryUsage.rss()

#

which is a faster version of process.memoryUsage().rss

#

since it calculates rss directly, instead of calculating all memories then getting only the rss

long crow
#

${(process.memoryUsage.rss() / 1024 / 1024).toFixed(2)} MB Let see what I got then

earnest phoenix
#

Same result just fixed on 2 decimals

long crow
#

with .rss()

quartz kindle
#

๐Ÿ‘

long crow
#

Wont matter on the first few minutes, few hours is what really matter to measuring RAM usage

#

But based on my heapUsed I dont think it will rise that much

quartz kindle
#

you said you have a music bot

#

audio data is not stored in the heap

long crow
#

yep, using youtube-dl

#

I take a look again after this 1hrs gone

slender wagon
long crow
#

No.

slender wagon
#

ok

long crow
#

Hmm.. look like nothing much going up/down. playing 48min song (Muse whole album)

summer acorn
#

this is only posting from a single shard, why? I tested the code and reduce did manage to get the total servercount

#

but when I post with dblapi.js right now, for some reason it's just only taking the shard's server count

#

and I posted it here instead of in #topgg-api since I am using the old dblapi.js by tonkku and not the new module

rose warren
#

dblapi.js is deprecated. I'd suggest moving to the new autoposter

summer acorn
#

no the new one is too hard to learn

#

I use dblapi.js for more than just posting

rose warren
#

It isn't. The server posting takes 2 minutes to switch.

summer acorn
#

I used some thinking and I think I found the issue

#

the webhook doe

rose warren
#

There are examples of code in the docs. Just copy and paste and change the details

summer acorn
#

dblapi.js has a built in webhook for votes, I couldn't even find anything regarding voting webhook on the new documentation

rose warren
summer acorn
#

you still gotta do the express stuff yourself, which you don't have to in dblapi.js

rose warren
#

The packages in pins will be updated for the upcoming v1 of the API.

summer acorn
#

since v13 changed the way you do broadcast eval

rose warren
#

v13 hasn't been released yet so it might not.

summer acorn
#

exactly, so I can't use it then

#

since I updated to v13

#

and that package was last updated 2 months ago

rose warren
#

Well the problem is you're not using an official package ๐Ÿคทโ€โ™‚๏ธ so it might not work with the API as you'd expect. You could try posting your stats directly to the API without a package to do it for you.

summer acorn
#

the problem I had, I found out that the process to fetch the client values and then add them together was being too slow, so awaiting the reduce before posting the stats should work, seen as it did work earlier

lyric mountain
#

don't u have something like guild config?

#

if so, just grab the row count

#

it'll be the same as the total guild count, unless you don't remove dead entries

summer acorn
#

adding the await did fix it

lunar cove
#

I'm trying to log the server votes but it ain't registering, any help please?

Here's the code :


const keepAlive = require('./server');
const Discord = require('discord.js');
const client = new Discord.Client();

keepAlive();
client.login(process.env['BOTTOKEN']);

client.on('ready', () =>{
    console.log("Bot is ready !!");
    client.user.setActivity('Tracking Votes', { type: "LISTENING" }).catch(console.error)
})

//Webhook
const express = require('express');
const Topgg = require('@top-gg/sdk');

const app = express()
const webhook = new Topgg.Webhook("tokenauth123")

app.post("/dblwebhook", webhook.listener(vote => {
  // vote will be your vote object, e.g
  console.log(vote.user) // 395526710101278721 < user who voted\

  // You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}))

app.listen(80)```

> And in dashboard : 
> **Webhook URL :** `https://test-bot.solace.repl.co:80/dblwebhook` (changed username for privacy)
> **Webhook Authentication:** `tokenauth123`
solemn latch
#

Also you shouldn't need to add the port to the url, they handle that for you

lunar cove
solemn latch
#

It's needed in some cases, not in others.

lunar cove
solemn latch
#

You should be checking if they provide it for you in an env variable.
If they do not just use 3000.

#

Or check the replit docs

lunar cove
#

Thanks a lot, I will try both

flat copper
#
const Canvas = require('canvas');
const Discord = require('discord.js');
const { join } = require('path');
const { wrapText } = require('../../function');
module.exports = {
	name: 'gandhi',
	category: 'Images2',
	async execute(client, message, args) {
		const { registerFont } = require('canvas');

		const m = await message.channel.send('Loading.......');

		const canvas = Canvas.createCanvas(1700, 1400);
		const ctx = canvas.getContext('2d');

		const background = await Canvas.loadImage(
			join(__dirname, '../../Gandhi.png')
		);
		ctx.drawImage(background, 0, 0, canvas.width, canvas.height);

		const a = args.join(' ');
		if (!a) return message.channel.send('please specify your message ');
		ctx.font = '200px type'; // Defining Size, Font
		ctx.fillStyle = '#ff0000';
		ctx.fillText(a, 1000, 600, 600, 1500);
		ctx.textAlign = 'center';

		const attachment = new Discord.MessageAttachment(canvas.toBuffer());
		message.channel.send(attachment).then(() => {
			m.delete();
		});
	}
};

I want to do like if text was long then it will automatically send it in next line

earnest phoenix
#

how can i make my bot send a message to a channel in my server when someone upvotes on top.gg?

lyric mountain
#

use @top.gg/sdk

pale vessel
main stag
#

How do we do this red text?

lunar cove
marsh bluff
main stag
#

`

#

So if itโ€™s green itโ€™s red in the outside?

earnest phoenix
lunar cove
earnest phoenix
lunar cove
solemn latch
errant python
#

Each repl is just containerised on a constantly alternating node system

#

The ports aren't virtualized/don't have separate IP's

#

You can have more than 1 port, you just have to try and find an open one

#

I've always done a small loop within 3000-4000 to find one, usually something random and uncommon works just fine ๐Ÿค—

solemn latch
#

๐Ÿ‘€ why doesnt repl have env variables for ports like glitch and heroku.
much easier for everyone

main stag
errant python
#

I have asked a similar question

last tapir
#
message.guild.roles.cache.map((x, i) => `${i + 1}| ${x.name} (${x.id})`
#

The above is not returning in the correct order, how can I fix that?

errant python
#

What order is it meant to be returning in?

last tapir
#

The top role is supposed to be on the top of the list.

errant python
#

I don't believe the api returns it like that, you have to sort through it manually

last tapir
#

What can I do to return it like that, though?

errant python
#

I don't use any discord libraries, but I am 99% sure it returns the bitwise indicator for role height

#

Been a bit since I've used the role system, so it may have changed

quartz kindle
#

collections are ordered by insertion

#

so roles.cache is ordered by which role was cached first, when roles were downloaded

#

it has no relationship to role order or position

lunar cove
# solemn latch repl it only allows the use of one port per program afaik. are you hosting a web...

Nope,

    at Server.setupListenHandle [as _listen2] (net.js:1316:16)
    at listenInCluster (net.js:1364:12)
    at Server.listen (net.js:1450:7)
    at Function.listen (/home/runner/AS-bot/node_modules/express/lib/application.js:618:24)
    at /home/runner/AS-bot/index.js:29:5
    at Script.runInContext (vm.js:130:18)
    at Object.<anonymous> (/run_dir/interp.js:209:20)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
Emitted 'error' event on Server instance at:
    at emitErrorNT (net.js:1343:8)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'EADDRINUSE',
  errno: 'EADDRINUSE',
  syscall: 'listen',
  address: '::',
  port: 3000
}
repl process died unexpectedly: exit status 1```

This is the error I'm getting
feral aspen
#

You can use this.

const roles = message.guild.roles.cache.sort((a, b) => b.position - a.position).map(role => role.toString());
quartz kindle
feral aspen
#

.sort is really confusing, I barely understand it, but works. (so as .reduce())

errant flax
#

how do i embed a url?
like

errant python
#

The client does that automatically

#

Do you mean in an embed via a bot?

solemn latch
errant python
#

Ah

quartz kindle
errant flax
solemn latch
#

actually speaking of opengraph tags, I'm having issues getting long(50mb+) videos to embed properly, what can i do about it?

lunar cove
errant flax
#

how do i use opengraph tags?

quartz kindle
errant flax
#

yes

solemn latch
quartz kindle
#

then you add them to the headers

#

in html

solemn latch
#

the above url is covers the opengraph protocol(OGP)

lunar cove
errant flax
#

what is a sub command group?

lunar cove
#

Here's the code :


const keepAlive = require('./server');
const Discord = require('discord.js');
const client = new Discord.Client();

keepAlive();
client.login(process.env['BOTTOKEN']);

client.on('ready', () =>{
    console.log("Bot is ready !!");
    client.user.setActivity('Tracking Votes', { type: "LISTENING" }).catch(console.error)
})

//Webhook
const express = require('express');
const Topgg = require('@top-gg/sdk');

const app = express()
const webhook = new Topgg.Webhook("tokenauth123")

app.post("/dblwebhook", webhook.listener(vote => {
  // vote will be your vote object, e.g
  console.log(vote.user) // 395526710101278721 < user who voted\

  // You can also throw an error to the listener callback in order to resend the webhook after a few seconds

}))

app.listen(3500)```

> And in dashboard : 
> **Webhook URL :** `https://test-bot.lace.repl.co:80/dblwebhook` *(changed username for privacy)*
> **Webhook Authentication:** `tokenauth123`
solemn latch
lunar cove
#

Ohh done that already in dashborad, srry , forgot to remove from here

quartz kindle
#

instead of trying to run multiple servers on multiple ports, which is not officially supported, why not just run one server for everything?

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

repl.it is supposed to give you only 1 port per instance, 1 port per app

#

because that 1 port is bound to the url they give you

#

you cannot have the same url for multiple ports

#

so your repl.co url is automatically linked to the first port you listen to in your code

#

and i guess that port is in your keepalive file

#

so instead of trying to create a separate server for the webhook

#

simply add the webhook to the existing keepalive server

#

so you can receive requests over the same port, using the same base url

crimson oracle
#

replit

#

no context

solemn latch
#

oh so i was right ๐Ÿ‘€

lunar cove
# quartz kindle so you can receive requests over the same port, using the same base url

Ohh well it's on port 3000 and with keeping this as port value I get this error

    at Server.setupListenHandle [as _listen2] (net.js:1316:16)
    at listenInCluster (net.js:1364:12)
    at Server.listen (net.js:1450:7)
    at Function.listen (/home/runner/AS-bot/node_modules/express/lib/application.js:618:24)
    at /home/runner/AS-bot/index.js:29:5
    at Script.runInContext (vm.js:130:18)
    at Object.<anonymous> (/run_dir/interp.js:209:20)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
Emitted 'error' event on Server instance at:
    at emitErrorNT (net.js:1343:8)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'EADDRINUSE',
  errno: 'EADDRINUSE',
  syscall: 'listen',
  address: '::',
  port: 3000
}
repl process died unexpectedly: exit status 1```
#

Also this is the code for my server.js

const server = express();

server.all('/', (req, res)=>{
    res.send('Your bot is alive!')
})

function keepAlive(){
    server.listen(3000, ()=>{console.log("Server is Ready!")});
}

module.exports = keepAlive;```
#

Sorry for being dumb, but can you help me ?superhappy superhappy

quartz kindle
#

you see where you have .all("/")

#

simply add a .post("/dblwebhook", listenerHere)

eternal osprey
#

why is this still sending me the error message when using !test spotify?

#
if(args != 'netflix' || args != 'spotify'){
      return message.channel.send("**Please input a valid parameter: spotify or netflix!**")
    }```
errant flax
#

how do i get an option from a sub command group in djs v13

errant flax
#

args is probably an array but log args

eternal osprey
#

should be args[0[ lol

#

still same error

lunar cove
# quartz kindle simply add a .post("/dblwebhook", listenerHere)

So did this

const server = express();

server.all('/', (req, res)=>{
    res.send('Your bot is alive!')
}).post("/dblwebhook", listenerHere);

function keepAlive(){
    server.listen(3000, ()=>{console.log("Server is Ready!")});
}

module.exports = keepAlive;```

> and got this error 

```ReferenceError: listenerHere is not defined
    at Object.<anonymous> (/home/runner/AS-bot/server.js:6:24)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at /home/runner/AS-bot/index.js:3:19
    at Script.runInContext (vm.js:130:18)
    at Object.<anonymous> (/run_dir/interp.js:209:20)
    at Module._compile (internal/modules/cjs/loader.js:999:30)```

Umm, what to do now ?
quartz kindle
#

dude...

#

not literally

#

your damn dbl listener

#

the listener you use in your dbl code

lunar cove
#

Well I'm sorry, lemme try again, I'm beginner at node so I'm making dumb mistakes, thanks for being being patient with me and I'm sorry once againsuperhappy

eternal osprey
quartz kindle
#

you simply put it on your existing server

lunar cove
#

just cut paste there ?

quartz kindle
#

server.post("/dblwebhook", webhook.listener(vote => { etc }))

#

instead of putting it in a new express server, in a new app

#

you put it on the server you already have

lunar cove
#

ohh now I'm getting a hang of it

quartz kindle
#

you can get rid of the second express altogether

#

just use one express for both things

eternal osprey
#
 if(args !== 'netflix' || args !== 'spotify'){
      return message.channel.send("**Please input a valid parameter: spotify or netflix!**")
    }```why does this fucking logcial or operator not work?
#

it sends me the return message constantly

quartz kindle
#

&&

#

not ||

solemn latch
#

if its not netflix or its not spotify will always give true

#

because if its netflix, its still not spotify = true;

eternal osprey
#

omg i am dumb

#

thanks

errant flax
#

how do i export a class in js?

tired panther
feral aspen
#

V13 is released. ๐ŸŽ‰

solemn latch
#

did they release the update guide?

#

I dont really use DJS anymore, but still would like to see the changes

errant python
#

Has anyone here worked with google's oauth2 system for google calendar

lunar cove
#
solemn latch
#

ill take a look then, thanks

earnest phoenix
#

Did release it official now?

solemn latch
#

OH YEAH CACHE CONTROL

#

Lets go!

earnest phoenix
#

Or do you have to still install from dev branch?

lunar cove
lunar cove
solemn latch
tired panther
errant python
#

So what is the point of Discord.js (practically)

#

I just took a look, last time I used it really was v8

#

Now it seems to have a lot of overhead

feral aspen
#

OOF.

errant python
#

Currently I just make my own requests and such without a library

cinder patio
#

if you don't like overhead use detritus

quartz kindle
#

djs is out? dayum

errant python
#

I was looking at Eris but it's dead now so /shrug

#

The API is just changing so much that I'm doubling my work updating everything

tired panther
solemn latch
#

16.6

#

and v13 is out, so its already a requirement

quartz kindle
#

gonna release djsl v4 then

errant python
#

Discord.js light?

solemn latch
#

still maintaining djsl?

stable eagle
#

and i already wondered if I shouldโ€™ve had installed latest node version on my vps lol

quartz kindle
#

likely not for v14

stable eagle
#

What will v14 have lol

solemn latch
#

ah neato

quartz kindle
long crow
#

Im procrastinating to make this. kekw

round cove
#

v13 out and now I don't wanna update my bots. ๐Ÿ˜”

lunar cove
errant python
#

I sense that someone is going to wonder how to get node v16.6 for d.js considering the default ppa still uses 14.x so I'll post it here for those searching (since I just did it to test it out)

curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh - This will fetch a script to add the ppa to your system (assuming a debian based os)
Always always always inspect the contents too, or if you feel ballsy trust the https
nano nodesource_setup.sh (or use vim if you are evil)
sudo apt update - update package list
sudo apt install nodejs - should install latest node version, 16.6.1

If you use node version manager (nvm):
nvm install node - installs the latest version if not already installed
nvm use 16.6.1 - starts using 16.6.1 (or for the future, just use nvm use node for the latest version installed)

round cove
errant python
#

I hate nvm so much so I never recommend it

round cove
#

WHAT

#

You must be insane

errant python
#

It's caused me many issues that I don't even wanna get into

round cove
#

He's crazy

errant python
#

Is it useful for some? Yes- for me? no

#

Crazy I am

long crow
split hazel
#

why is everyone rushing with the updates

#

I'm waiting until discord finishes everything in their todo list and then wait for the lib to release those changes

quartz kindle
#

because updeeeeeeeets

sterile thicket
#

DJs v13 is here

long crow
sterile thicket
#

So you don't have much to change

long crow
#

already push my refactors commit

split hazel
#

even though majority are against it and the fact it will break a lot of libraries, bots and features they still did it pensive

long crow
#

haha. defer() become deferReply() on last hour

split hazel
#

at this rate I'm just gonna fork the library and maintain my own copy of it lmao

long crow
#

and from 14.6 become 16.6

sterile thicket
#

Yes

#

Sucks

split hazel
#

there are ways to get around it but pfsh

#

this is the most I've hated djs in a while lmao

#

I don't think djs devs understand the concept of backwards compatibility

woeful pike
#

it's a major version upgrade lol, they're not supposed to be backwards compatible between major versions

split hazel
#

laughs in Microsoft

#

it's just so irritating to see them break so many features all the time

woeful pike
#

structures was a shitty idea imo

split hazel
#

and you can't stay on a specific djs version forever because a gateway update or something else will eventually render it useless

woeful pike
#

they're just pulling a python3

split hazel
#

I do agree but it seems wrong just removing it when so many bots and libs rely on it

#

and removes some of the flexibility of the lib for the better or worse

#

yeah you can use define property or something similar but man

#

Mark it as deprecated or something

lunar cove
# quartz kindle just use one express for both things

Umm, sorry for disturbing you again ABlushy ABlushy
I changed server.js to

const server = express();

server.all('/', (req, res)=>{
    res.send('Your bot is alive!')
}).post("/dblwebhook", listenerHere);

function keepAlive(){
    server.listen(3000, ()=>{console.log("Server is Ready!")});
}

//for top.gg
const Topgg = require('@top-gg/sdk');
const webhook = new Topgg.Webhook("4N8eXCvZHjpfwt");
server.post("/dblwebhook", webhook.listener(vote => {
  // vote will be your vote object, e.g
  console.log(vote.user) // 395526710101278721 < user who voted\

  // You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}));

server.listen(3000);

module.exports = keepAlive;```

And index.js to 
```console.log('Beep beep! ๐Ÿ‘‹');

const keepAlive = require('./server');
const Discord = require('discord.js');
const client = new Discord.Client();

keepAlive();
client.login(process.env['BOTTOKEN']);

client.on('ready', () =>{
    console.log("Bot is ready !!");
    client.user.setActivity('Tracking Votes', { type: "LISTENING" }).catch(console.error)
})```
> I think I'm missing a function there in index.js to call  or is it alright ?
split hazel
#

you have sinned by disturbing tim

lunar cove
#

His help is what gives me hope

split hazel
#

and you know can't you test it yourself

#

don't worry there isn't a quota on how many times you can run code

#

unless there's something I don't know about

long crow
# woeful pike structures was a shitty idea imo

So maybe someone that have no clue on this Structure fiasco, I see alot doesnt like it, but it said to bring something will break? Since I'm a classic js user, not really sure what is wrong with it, can enlighten me?

lunar cove
# solemn latch did you try using it?
    at Object.<anonymous> (/home/runner/AS-bot/server.js:6:24)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at /home/runner/AS-bot/index.js:3:19
    at Script.runInContext (vm.js:130:18)
    at Object.<anonymous> (/run_dir/interp.js:209:20)
    at Module._compile (internal/modules/cjs/loader.js:999:30)```

I got this error ๐Ÿ˜…
quartz kindle
#

you were not supposed to add that literally

#

also remove the second server.listen

#

you can only have one

lunar cove
lunar cove
# quartz kindle i told you that part was wrong lol

I'm now more confused SadGirl , sorry for taking so much of your time

index.js


const keepAlive = require('./server');
const Discord = require('discord.js');
const client = new Discord.Client();

keepAlive();
client.login(process.env['BOTTOKEN']);

client.on('ready', () =>{
    console.log("Bot is ready !!");
    client.user.setActivity('Tracking Votes', { type: "LISTENING" }).catch(console.error)
})```

> server.js 
```const express = require('express');
const server = express();

server.all('/', (req, res)=>{
    res.send('Your bot is alive!')
}).post("/dblwebhook", listenerHere);

function keepAlive(){
    server.listen(3000, ()=>{console.log("Server is Ready!")});
}

//for top.gg
const Topgg = require('@top-gg/sdk');
const webhook = new Topgg.Webhook("4N8eXCvZHjpfwt");
server.post("/dblwebhook", webhook.listener(vote => {
  // vote will be your vote object, e.g
  console.log(vote.user) // 395526710101278721 < user who voted\

  // You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}));


module.exports = keepAlive;```

> error
```ReferenceError: listenerHere is not defined
    at Object.<anonymous> (/home/runner/AS-bot/server.js:6:24)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at /home/runner/AS-bot/index.js:3:19
    at Script.runInContext (vm.js:130:18)
    at Object.<anonymous> (/run_dir/interp.js:209:20)
    at Module._compile (internal/modules/cjs/loader.js:999:30)```
solemn latch
#

looks like its still erroring from when you added "listenerhere"

lunar cove
#

Well i shall logout then login again and then try once

#

Still the same error SadGirl

solemn latch
#

do you have the old code still?

lunar cove
quartz kindle
#

did you still not remove that?

#

you have to remove what you added when you didnt understand what i said

#

this

#

.post("/dblwebhook", listenerHere);

eternal osprey
#

hey guys, i am deleting the sent message

exports.run = async (client, message, args, channel1) => {
    if(args != 'netflix' && args != 'spotify'){
      message.delete()
      return message.channel.send("**Please input a valid parameter: spotify or netflix!**")
    }```
 and now the return message is increasing with the amount of times that i used the command lol?
quartz kindle
#

wut?

eternal osprey
#

i am deleting the message of the users

#

i first use !test and it returns the error message once.

#

then i use it again and it sends 2 messages at the same time

#

and it just increases and increases

#

or am i just doing something wrong lol

clever agate
#

Help mee

#

AbortController is not defined

#

disocrd.js error

lunar cove
# quartz kindle wut?
const server = express();
//for top.gg
const Topgg = require('@top-gg/sdk');
const webhook = new Topgg.Webhook("4N8eXCvZHjpfwt");

server.all('/', (req, res)=>{
    res.send('Your bot is alive!')
}).post("/dblwebhook", listenerHere);

function keepAlive(){
    server.listen(3000, ()=>{console.log("Server is Ready!"), console.log(vote.user)});
}

module.exports = keepAlive;```
like this ?
quartz kindle
#

no

#

you were not supposed to add that

#

remove that

#

listenerHere makes no sense

#

when i said "listenerHere" it means "put your listener here"

#

this is your listener

cedar wave
#

Hello. I have a question for someone who is a bot developer. I own a really unique and we have reached the maximum amount of channels in it. We need a vc for every language in the server, but not every vc is used at once. (Like 4-5 are used at once out of the 45 we have).

Someone suggested having a bot that creates a vc like when someone requested it so as to keep the channel count down. Is this possible, and does it seem like a good idea? Also, how could the bot be created so that it is easy for new to discord people to use? (We get a lot of people who are brand new to Discord that join)

quartz kindle
#

but you already put it in another way and its fine like that, so remove that green box

lunar cove
clever agate
#

Tim, help me!!!!11!1!!11!

quartz kindle
#

and it should be fine

eternal osprey
#
 message.delete()
    const linkcodes = fs.readFileSync('./links.txt', 'utf8');
    const links = linkcodes.split('\n');
    const link = links[Math.floor(Math.random() * links.length)];
    message.channel.send(link)

i want to remove the pre-sent link variable from the txt file
how can i achieve that

eternal osprey
quartz kindle
sudden geyser
# cedar wave Hello. I have a question for someone who is a bot developer. I own a really uniq...

It's possible, but depends on your experience with Discord bots. If you have no experience, you'll have to seek out a bot that already has this functionality (which I don't know of) or ask someone to create one for you. If you have experience developing bots, it could be as simple as:

  • User types /vc <lang>
  • Bot creates voice channel with the language name for a temporary amount of time.
  • When the channel becomes inactive or room is needed for another voice channel, delete it.

The concept is very similar to threads.

eternal osprey
eternal osprey
lunar cove
# quartz kindle yes, remove the entire green box

Well now vote object is undefined ๐Ÿ˜…

const server = express();
//for top.gg
const Topgg = require('@top-gg/sdk');
const webhook = new Topgg.Webhook("4N8eXCvZHjpfwt");

server.all('/', (req, res)=>{
    res.send('Your bot is alive!')
})

function keepAlive(){
    server.listen(3000, ()=>{console.log("Server is Ready!"), console.log(vote.user)});
}

module.exports = keepAlive;```

> error
```ReferenceError: vote is not defined
    at Server.<anonymous> (/home/runner/AS-bot/server.js:12:75)```
#

should I include vote in server.all ?

quartz kindle
clever agate
earnest phoenix
sudden geyser
#

At the same time, it may not be the wisest decision to be creating and deleting voice channels. You can reuse channels and modify them instead. For example, in the Python Discord server, they have 10-20 channels for getting help with Python problems. Instead of creating a new channel, users can pick from inactive channels and make them active for their question. When they're done, it'll go back to being inactive.

cedar wave
clever agate
wheat mesa
sudden geyser
#

Not exactly. There are categories for available, occupied, and dormant channels.

  • Available can be used to "create" a new question (like /vc <lang>).
  • It'll get moved to occupied (like joining a voice channel).
  • When the question is marked as resolved or doesn't have activity in a certain amount of time, it'll get moved to dormant (like deleting the channel). After some more time, it'll get moved back to available.

So, channels are not created and deleted. Rather, they're just moved around. Of course, you don't have to use this system, but I personally think it's a good system for capping and allocating channels. The process can be invisible to users (so the channels always exist but users only see the in use channels).

lunar cove
#

I can't thank you enough @quartz kindle , it started working finally !!
Thanks a lot !!

AA_Gab_Bow AA_Gab_Bow

wheat mesa
#

I used devtools to take heap snapshots

#

First and second pic are after about an hour of running

#

3rd is about 1.5 hours of running

#

(No commands sent)

cedar wave
quartz kindle
#

you went from 67k to 93k arrays, 34k to 59k maps, 290k to 457k strings

#

either something is being cached, or something is leaking memory

wheat mesa
#

Well, the map is full of message objects from what I can see

#

I donโ€™t really know what the strings even store

quartz kindle
#

yes, from 45k to 81k messages

wheat mesa
quartz kindle
#

do you have the message cache enabled?

wheat mesa
#

Yes

quartz kindle
#

do you need it?

wheat mesa
#

With a one hour limit

#

Not really, I just have it on for some reason

quartz kindle
#

try disabling it

wheat mesa
#

Iโ€™ll try that

#

Iโ€™ll get onto my pc rq to try to fix this

#

Now that I think about it... whatโ€™s the point of even caching messages?

misty sigil
#

Anyone know anything about cf argo tunnels? I've tried a few different things but nothing works. It works on every other domain apart from www.domain.icu, my config is ```yml
tunnel: id
credentials-file: /root/.cloudflared/id.json

ingress:

lunar cove
#

Umm, since I can perform limited no of votes each day (1 in 12hrs), is there a way i can simulate the voting for testing the bot? I'm creating a vote tracker for my server

earnest phoenix
#

@lunar cove there is a test button on the webhook page

hollow depot
quartz kindle
#

and shit like snipe commands

earnest phoenix
#

severus snaper

quartz kindle
#

in your bot's vote settings

quartz kindle
earnest phoenix
clever agate
solemn latch
wheat mesa
# quartz kindle try disabling it

Results after disabling it. I no longer have that huge map. However this is right after starting up the bot, so hopefully it doesn't grow

lunar cove
wheat mesa
#

Yeah

#

Gonna leave it running for about 45 more mins then take a heap snapshot

tulip ledge
#

So, if I implement a cache what would be the best way to keep it small? Like put a timeout for 5 seconds to delete the entry?

lunar cove
# quartz kindle
An error has occurred while processing your request```
> I'm getting this as reply when pressing test and no log on console which I get when someone votes
lunar cove
quartz kindle
#

i said the test button in your bot's edit page

wheat mesa
lunar cove
#

Well I don't have my bot on top.gg

quartz kindle
#

then you cant test the webhook

#

you have to wait until your bot is approved

lunar cove
quartz kindle
#

that it works

lunar cove
#

nah

#

i created it yesterday

quartz kindle
#

then why are you adding a vote webhook?

lunar cove
#

to track server votes for my server

quartz kindle
#

oh thats a server webhook?

lunar cove
#

yeah

#

๐Ÿ˜…

quartz kindle
#

then go to your server's edit page

#

and click test there

lunar cove
#

yeah i did that

quartz kindle
#

idk then, ask in support or something

lunar cove
#

ok thanks a lot

wheat mesa
#

Do I need to have messages cached to be able to access payload.message.author.id?

#

I'd assume not, right?

#

I currently have this to grab a User/member object (doesn't matter which): ts const user = payload.message.mentions.first() || await payload.rest.fetchUser(args[0]) || payload.message.author; which all works except for the payload.message.author line. Do I need to have the GUILD_MEMBERS intent and/or the GUILD_PRESENCES intent enabled to access payload.message.author?

tulip ledge
wheat mesa
#

Should be

tulip ledge
#

So setting a timeout would not be taking more memory then the cache itself?

wheat mesa
#

I use a system for ratelimits on interactions similar to this:

        const RatelimitCache: Map<string, Timers.Timeout> = new Map();

        const timer = new Timers.Timeout();
        RatelimitCache.set(interaction.userId, timer);
        timer.start(RATELIMIT_COOLDOWN, () => {
          RatelimitCache.delete(interaction.userId);
        });
quartz kindle
#

if you are receiving the message via a messageCreate event, it should always contain an author field, except if its a system message

wheat mesa
#

Hmmmm... I get an error saying HTTP Exception 404 Not Found whenever I try to access a user's avatar from author

#

And it used to work

#

Also another weird error when trying to use one of my owner only commands (list all guilds) in DMs. Says that it cannot read id of undefined when I have clearly passed a message into the function (it's attempting to use message.id)

#
export function addReactionCollector(
  client: CommandClient,
  message: Message,
  author: string,
  data: RequestTypes.EditMessage[],
  onReact: (payload: GatewayClientEvents.InteractionCreate) => any,
  onUnreact?: (payload: any) => any,
  onEnd?: (payload: Message) => any,
  timer?: number,
) {
  client.reactionCollectors.set(message.id, {
// More code down here not relevant to the error
}
tulip ledge
#

Also how would u implement owner only commands with slashcommands

wheat mesa
worn grove
#

Hi! I'm a bot developer and I'm looking to verify my bot, im under 18, but im above 13. I have a School ID with me, what information do I need to provide in order for it to be accepted?

tulip ledge
#

U need to give up ur ID

#

I was 13 or 14 when they introduced the system and I got accepted

worn grove
#

oh ok

#

do I need to include date of birth and information like that?

tulip ledge
#

That info should be on your ID

worn grove
#

yea it is

#

Alright, thank you

tulip ledge
#

U need to provide front and back of your ID

worn grove
#

o

tulip ledge
#

At least thatโ€™s how it was when I did it

lunar cove
quartz kindle
#

๐Ÿ‘

swift cradle
wheat mesa
summer acorn
#

when I push package.json and package-lock.json to install a new npm package to my bot, I have to do npm i to install the new packages on the server, but sometimes that creates a different package-lock.json even though every package is updated in the push, is there a way I can avoid the change of the package-lock.json file in those scenarios?

#

it's not a big issue, it's just a question so that I won't have to stash before pulling after installing a new package

quartz kindle
#

package.json can override package-lock.json whenever a newer version is found for a dependency in package.json

#

npm ci will install from package-lock.json only

wheat mesa
#

Complete confusion is going on in my brain rn

summer acorn
#

ah I see, thank you Tim

wheat mesa
#

The dapi server told me that you only get a channel id for DMs

#

But that can't be true otherwise my command would've never worked in DMs before

quartz kindle
#

you only get channel id in dms

#

then its up to the library to chose what to do with it

wheat mesa
#

How on earth was this working yesterday then- ```ts
let _m = (await payload.message.channel?.createMessage(embeds[0])) as Message;

quartz kindle
#

the library will likely create a partial DMChannel object

wheat mesa
#

Maybe detritus broke something then? I didn't update the package or anything

quartz kindle
#

no idea, never actually used detritus

#

btw what happened to erwin

#

havent seen him in a long time

wheat mesa
#

He doesn't type here anymore

quartz kindle
#

coward

#

lmao

wheat mesa
#

He types in the detritus discord

#

He explained why in there but I don't think I'm supposed to send that here

quartz kindle
#

he "types" :^)

wheat mesa
#

lol

quartz kindle
#

as in, typing ts types

#

:^)

wheat mesa
#

This is confusing

#

I'm thinking that changing my intents must've broken something

#

For some reason

#

Didn't change anything for the command itself between then and that point in time

quartz kindle
#

i have to go slap erwin in his server now

#

what a pain

wheat mesa
#

lol

long crow
#
    "dependencies": {
        "axios": "^0.21.1",
        "bufferutil": "^4.0.3",
        "discord.js": "^13.0.0",
        "enmap": "^5.8.5",
        "fast-glob": "^3.2.7",
        "html-entities": "^2.3.2",
        "moment": "^2.29.1",
        "moment-duration-format": "^2.3.2",
        "utf-8-validate": "^5.0.5",
        "zlib-sync": "^0.1.7"
    }``` my dep shrink after I remove the music command. Muahaha
quartz kindle
#

still too many :^)

long crow
#

I can remove bufferutil, utf..., zlib, that is optional

quartz kindle
#

you can keep those

wheat mesa
#
"dependencies": {
    "@types/node": "^15.6.2",
    "@types/node-fetch": "^2.5.10",
    "detritus-client": "^0.15.0",
    "dotenv": "^10.0.0",
    "moment": "^2.29.1",
    "moment-duration-format": "^2.3.2",
    "mongodb": "^4.0.1",
    "node-fetch": "^2.6.1",
    "prettier": "^2.3.2",
    "ts-node": "^10.0.0",
    "tslib": "^2.2.0",
    "typescript": "^4.3.2",
    "ytdl-core": "^4.9.1"
  },
quartz kindle
#

i'd remove moment, enmap, axios

#

xD

wheat mesa
#

granted half of those dependencies are for ts

long crow
#

I only need jsconfig.json

vivid fulcrum
#

types can also go into dev deps

wheat mesa
#

Ah

#

Won't bother with changing that for a while

#

I've already broken enough shit haha

long crow
#

It error handling quite easy for me

split hazel
#

i'm surprised evie still maintains enmap

long crow
#

There is josh too, but I installed enmap first

wheat mesa
#

Heap snapshots are staying at 60-70mb after disabling message caching, thanks @quartz kindle!

quartz kindle
#

๐Ÿ‘

split hazel
#

you also have to remember the gc doesnt kick in until memory is low

quartz kindle
#

btw what happened to evie?

wheat mesa
#

lmaoooo

quartz kindle
#

havent seen her in a long time too

wheat mesa
#

How tf was it working

split hazel
#

she probably left

#

she was in djs, left, joined again then left again

quartz kindle
#

lel

split hazel
#

for reasons i understand now lol

quartz kindle
#

are those reasons shareable or private?

split hazel
#

she made a post about it in her server ages ago

quartz kindle
#

ah

#

im not in her server

split hazel
#

i think i left it

quartz kindle
#

if i were to guess, probably something about the djs community?

split hazel
#

because i was trying to lower my discord client memory usage

#

yes

quartz kindle
#

lmao

split hazel
#

i'll try find it

quartz kindle
#

go figure

#

djs community toxic yada yada

split hazel
#

i lowered the memory from 1gb to like 500mb

quartz kindle
#

nice

split hazel
#

though doesnt matter since after a couple hours it goes back to gb figures since theres probably a memory leak

quartz kindle
#

lul

split hazel
#

says everything lol@quartz kindle

quartz kindle
#

lel

#

sure, its great code

#

but not perfect

split hazel
#

good code but no patreon donations for you

quartz kindle
#

lmao

split hazel
#

i dont think the donations even go to some of the most active contributors

#

yeah it all goes to one guy as far as i can see lmao

#

the "owner" of djs you could say

rough walrus
#

Do I have to wait 1 hour so I can use slash commands?

split hazel
#

yes but if you make slash commands specific to a server the updates are instant

rough walrus
#

๐Ÿ‘

split hazel
#

you should assign slash commands to a specific server when testing and when you're releasing to everyone you make it public

quartz kindle
#

im gonna make an eval slash command

sage bobcat
#

One message removed from a suspended account.

fresh bluff
#

Got My bot working

#

Even has More commands and more

split hazel
fresh bluff
#

I Just don't Know how to add the status

split hazel
#

and wait how are you gonna do that if you cant add multiple lines

fresh bluff
#

How do i Code the bots status in?

split hazel
#

that sucks

rose warren
#

You read the docs

winged juniper
#

V13

quartz kindle
winged juniper
#

Answer old questions ๐Ÿ˜…

fresh bluff
#

Uh Im Using Python and Doesn't the Status code use C++

quartz kindle
#

what

split hazel
#

what

#

are you just saying new words you've learnt

sage bobcat
#

One message removed from a suspended account.

fresh bluff
#

The Discord Bot status Uses C++ Code

#

And Im using Python

split hazel
#

what library are you using

#

moving from the c++ code part

fresh bluff
#

So Idk How to add it

quartz kindle
long crow
split hazel
winged juniper
#
    const banned = await message.guild.fetchBans();โ€Š

Why this code give me error in discord.js v13

quartz kindle
#

fetchBans doesnt exist in v13

wheat mesa
#

Dear lord why is everything breaking

split hazel
#

you should read the breaking changes

quartz kindle
#

its guild.bans.fetch

split hazel
#

theres new ones all the time

wheat mesa
#

All of a sudden my reload command only works in DMs and not guilds

#

Great

winged juniper
split hazel
#

makes me wanna either maintain my own discord.js version on github or use another library

quartz kindle
#

lel

wheat mesa
#

Throws a HTTP 403 missing access error

#

gotta love it

vivid fulcrum
#

i always end up forking libraries i use and adjust them internally to my liking lol

rose warren
#

Tim djs-light v13 wen?

vivid fulcrum
#

but im too lazy to create my own library

fresh bluff
#

AH DAMIT I don't have a Developer Application License

split hazel
#

i'll probably do that and adjust some of the code to go back to how it was before

#

might even bring back structures

lunar cove
rose warren
#

I wasn't talking to you

fresh bluff
#

WOW The RP Is a C++

#

Now im confused

long crow
#

if I have an array of unknown length between 1 to 20, what is better to use? for of or for(let i;...) javascript

vivid fulcrum
#

my cat is jumping over my keyboard again lmfao

split hazel
#

what they all say

split hazel
vivid fulcrum
#

doesn't for of just transpile down to a normal for loop

#

for of is just syntax sugar

split hazel
#

i tested it and read some articles about it

#

it's a lot slower

fresh bluff
#

uh i think i crashed my bot

split hazel
#

depending on array size

vivid fulcrum
#

huh interesting

#

now i wanna do some research on it too

split hazel
#

maybe they changed something

#

go for it

long crow
#

size of 20 max, dont think it that large size

winged juniper
#
let messages = await message.channel.messages.fetch({limit:100});
messages = messages.array();

Why this is error in discord.js v13

fresh bluff
#

Ok my bot was just Being slow

split hazel
winged juniper
#

Thank you

long crow
#

I'm not sure and for certain can't remember all the changes

split hazel
#

who does

#

actually

#

it still returns a collection

#

according to the docs

#

@winged juniper try instead of .array do .values

long crow
#

Collection .array() method got removed

split hazel
#

ah

#

so yeah

quartz kindle
#

values returns an iterator, so you still have to consume it

split hazel
#

at this rate i'll have to rewrite my whole bot to work with v13

quartz kindle
#

messages = [...messages.values()]

fresh bluff
#

Hey Guys i need some help

quartz kindle
#

im gonna go from v12 to raw

split hazel
#

at some point we'll have to switch or switch libraries

#

oh yeah

quartz kindle
#

just need to finish my raw lib

fresh bluff
#

I can't get My RP code working

earnest phoenix
split hazel
#

detritus dont seem too bad

#

it looks really good

#

but is it going to be another library thats going to be abandoned in a year or so

#

or with api updates released at a very slow rate

wheat mesa
#

api updates are released very fast

cinder patio
#

doubt it'll get abandoned

wheat mesa
#

^

lunar cove
split hazel
#

what kind of caching tactics if any do they use

#

or is it just a self managed library

cinder patio
#

It's customizable

#

you can disable all caches

quartz kindle
#

djsl v4 is out

wheat mesa
#

I'm getting an HTTP 403 Missing Access exception with a 50001 code when I try to reload my commands in a guild. No idea why this is happening.

#

Whenever I use the command in DMs, I get no errors

fresh bluff
#

I HATE CODE ERRORS

long crow
#

Missing Access It mean the guild you in doesn't give the permission to the bot to execute

wheat mesa
#

But that doesn't make sense.

#

It's an internal command

#
let err = false;

        try {
          // Clear all of the commands
          message.client.commandClient!.clear();

          // Read all of the commands
          await message.client.commandClient!.addMultipleIn('commands', { subdirectories: true }).catch((...e) => {
            e.forEach(console.error);
            err = true;
          });

          if (!err) console.log('Reloaded Commands');
        } catch (e) {
          err = true;
          console.error(e);
        }

        // React to the message
        if (!err) return message.react('โœ…');
        else return message.react('โŽ');
long crow
#

Missing Permission mean not proper intents from the bot

wheat mesa
#

The intents shouldn't be wrong to my knowledge

long crow
#

Keyword Missing Access refer error from guild

#

mean the guild does not permit it

earnest phoenix
#

its a scam

#

dont register on it

#

ur account will get hacked

cinder patio
#

@sinful belfry

wheat mesa
sinful belfry
#

uh

#

ty

earnest phoenix
#

i have encountered the hacking situation 2 days back

quartz kindle
#

sorry but if you fall for that you're stupid

#

i mean, its like super obvious

earnest phoenix
#

yeah

split hazel
quartz kindle
#

rip

crimson kindle
#

can anyone help?

#

i dont understand it

split hazel
#

the error says everything you need to do

crimson kindle
#

but i dont search it

quartz kindle
#

so your actual error is this

crimson kindle
rose warren
#

djsl v4 = djs v13 or are there subtle differences? I'm rewriting my bot for v13 and slash commands and I've been wanting to switch to djsl for a while now. This re-write is basically a good opportunity for me to do all the optimisations I want to do.

quartz kindle
#

otherwise it should be the same

rose warren
#

Nice ๐Ÿ‘Œ

#

I'll install it tomorrow

split hazel
quartz kindle
#

although there is still a lot of untested things, so if anything comes up let me know

#

afaik there was no testing done whatsoever with djs voice for example

split hazel
#

discord js voice light

rose warren
#

Ok. I'm counting on it being in a testing environment until September at least anyway before pushing to production.

split hazel
#

the packets are compression strong

rose warren
#

I don't use voice anyway

quartz kindle
lunar cove
#

Umm, can I get some good guide for discord.js other than official documentation ?

fresh bluff
#

My Bot does not like me

rose warren
lyric mountain
rose warren
lyric mountain
#

but jokes apart, there're barely anything better than the official docs when learning how to use stuff

split hazel
#

stop brown nosing the docs

#

they're GOOD OKAY

rose warren
#

Yeah but if you don't know how to code those guides have examples

lunar cove
#

Ok thanks

lunar cove
rose warren
#

Tbh asking for alternatives to docs is better than just copying a tutorial off YouTube to clone a git repo ๐Ÿคทโ€โ™‚๏ธ

lunar cove
#

Well I wanna learn so I can customize superhappy

lyric mountain
#

you wanna learn so you can create your own fresh bot right?

#

...right?

earnest phoenix
lunar cove
earnest phoenix
fresh bluff
#

I found out how to add about me to my Bot (I blurred The Link to stop self promo)

rose warren
#

Congrats

lunar cove
#

now add custom status and activity

fresh bluff
#

My Code keeps Breaking when i try to

lunar cove
# fresh bluff idk How to
    console.log("Bot is ready !!");
    client.user.setActivity('Tracking Votes', { type: "LISTENING" }).catch(console.error)
})```
#

It's mine change it to your needs

fresh bluff
#

Where do i put it in my code?

lunar cove
#

just below client.login

fresh bluff
#

oh wait thats not in my code

lunar cove
#

lol, then it must be bot.login ig

fresh bluff
#

Im using Replit

lunar cove
#

Well I'm too

fresh bluff
#

ok

#

idk where to put it in

#

Hey Can someone Help me with my code

rose warren
#

Look at your lib's docs

fresh bluff
#

I get this when i run the code
client.on('ready', () =>{
console.log("Bot is ready !!");
client.user.setActivity('Tracking Votes', { type: "LISTENING" }).catch(console.error)
})

#

i meant this

#

File "main.py", line 15
client.on('ready', () =>{
^
SyntaxError: invalid syntax
๎บง
KeyboardInterrupt
๎บง
KeyboardInterrupt

rose warren
fresh bluff
#

IM new ok

lunar cove
#

your fundamentals are wrong

fresh bluff
#

Ok Can someone with Replit Help me

#

bc i can't do anything

lunar cove
#

Watch some guide on youtube to build a basic bot first

earnest phoenix
#

Replit is lil bit of confusing

fresh bluff
#

No How to I run the File That Is the Status File Into the main code without putting the JS code in the Python code

lunar cove
#

Well that too but it's better to do in c++ than js imo

fresh bluff
#

Mind my Grammar

fresh bluff
#

No I made a Second File In my Code for the JS

lunar cove
fresh bluff
rose warren
#

You have to set your bot's status using py

lunar cove
#

Nah I meant for general programming

errant python
#

I'm running into an issue with discord embeds, in which I get a 401 for them, but everything else is fine - messing with discord.js for the first time

earnest phoenix
quartz kindle
errant python
#

If I send it manually, it works fine

fresh bluff
quartz kindle
#

then stop

fresh bluff
#

How do i make the status code in py?

quartz kindle
#

what status code?

errant python
#

you have no idea what you are doing

rose warren
#

You read the docs

errant python
#

please stop messing with the api

fresh bluff
#

this

#

client.on('ready', () =>{
console.log("Bot is ready !!");
client.user.setActivity('Tracking Votes', { type: "LISTENING" }).catch(console.error)
})

rose warren
#

Is js

fresh bluff
#

How do i make that into Py

earnest phoenix
quartz kindle
#

read the py docs

fresh bluff
errant python
#

omg

lunar cove
quartz kindle
#

you are using discord.py right? is there any other py lib?

fresh bluff