#development

1 messages ยท Page 1042 of 1

elfin flower
#

E

devout wagon
#

great timing tool

slender thistle
#

almost instantly what

devout wagon
#

list(map(str, range(10000))) doesn't take a second to evaluate

elfin flower
#

im

#

im trying to make the webhook do that

slender thistle
#

alright what the living hell

#

I don't really notice the difference in performance between the both but Jesus Christ

#

how's timeit at fault here then lol

devout wagon
#

I have no idea

#

I don't even know that library

slender thistle
devout wagon
#

Does it start a subprocess or what

slender thistle
#

Time to use time.time then again

spare mirage
#

hallow

slender thistle
#

this looks more realistic

#

measured in seconds

elfin flower
#

okay now lemme ask normally

#

for channel in message.guild.channels:
a = await channel.create_webhook(name = "why am i sending messages in all channels")
await a.send("why am i doing this")

im trying to make the bot send that message in every channel in the server
but when i tested it, it only worked on one channel
how do i tell it to send it to all the channels in the guild.channels list?

slender thistle
#

Why do you want to send a message in every channel

#

Do you have a try-except

elfin flower
#

oh

#

ill try that

slender thistle
#

I assume no

#

Why do you want to send a message in every channel
question still applies

elfin flower
#

im getting creative with discord py out here

#

i think

slender thistle
#

Creative API abuse

#

sure

elfin flower
#

oh

devout wagon
#

why do you even create a webhook in each channel

elfin flower
#

wait does it create

#

frick

#

nvm

misty sigil
#

just checking in

devout wagon
#

Is client.guild anything at all?

#

I don't think so

misty sigil
#

hmm

#

where did i get that

#

its message.guild lmao

restive lily
sudden geyser
#

watch your indentation

pale vessel
#

@misty sigil guild#me is your bot as a guild member

misty sigil
#

@misty sigil guild#me is your bot as a guild member
@pale vessel thats what i wanted

#

for perm checking

restive lily
#

still an error

sudden geyser
#

python cares about your indentation

#

your setup function requires it

restive lily
#

i fixed the indetation

#

does some thing indented or not

#

not matter how i indent it bot is an error @sudden geyser

sudden geyser
#

ah can you upload your file to a site like hastebin

pure lion
#

need help with .updateOne()

heavy pollen
#

Hello guys, I'm getting ECONNRESET and ETIMEDOUT errors sometimes. When I get this errors, my bot is being offline. How can I fix? :)
I'm using Discord.js v 11.6.4

pure lion
#
const Discord = require('discord.js-light')
const mongoose = require('mongoose')
const { Guild } = require('../models/index')
const config = require('../config.json')
const guild = require('../models/guild')

module.exports = {
    name: 'prefix',
    async execute(client, msg, args) {
        const data = await Guild.findOne({ guildID:msg.guild.id });
        let Prefix = args[1]
        if (!Prefix) {
            let prefixEmbed = new Discord.MessageEmbed()
                .setTitle('Prefix help')
                .setDescription(`The guild prefix is \`${data.prefix}\``)
            msg.channel.send(prefixEmbed)
        } else if (Prefix.length > 10) {
            return msg.channel.send('The prefix must be less than 10 characters (for now)')
        } else {
            Guild.updateOne({guildID:msg.guild.id}, {prefix:`${Prefix}`})
            return msg.channel.send(`The prefix was set to ${Prefix}`)
        }
    }
}
#

@heavy pollen put your bot back online x)

opal plank
#

@heavy pollen update to 12

#

11 is being discontinued

heavy pollen
#

@heavy pollen put your bot back online x)
@pure lion ...

#

11 is being discontinued
@opal plank i know i will but there isnt solve for v11 for now?

opal plank
#

i dont see why go thru the trouble

#

updating isnt that hard

heavy pollen
#

If I have my pc, I will update.....

opal plank
pure lion
#

so can anyone help me with mongoose

opal plank
#

<= doesnt use mongo

pure lion
#

<= is crying rn

heavy pollen
#

I just need help for this 2 error

#

Not for updating to v13

#

V12*

pale vessel
#

you have to

opal plank
#

without more info i cant say

pale vessel
#

why not now?

pure lion
#

istg if v13 changes the syntax again im going to scrEam

opal plank
#

mobile coding, as shit as it is, is a thing

heavy pollen
#

How I can update without pc

#

I ust ask

opal plank
#

where is your bot deployed?

hushed jungle
#

How to stop memory leak that makes the memory collector stop the appllication over time ๐Ÿ˜ฆ

opal plank
#

you check where the mem leakis coming from and fix it

#

you gotta debug it and see where the leak is coming from, first

hushed jungle
#

It says it has too many instances. I think it makes an event listener every time a message is sent.

pure lion
#

x)

#

It says it has too many instances. I think it makes an event listener every time a message is sent.
you what-

opal plank
#

wdym too many instances?

#

shards?

pure lion
#

700 shards at 3 guilds

#

count em 8)

hushed jungle
#

No just eventEmitters that listen for messages in servers.

pure lion
#

how many do you have...?

heavy pollen
#

where is your bot deployed?
@opal plank to my vps

hushed jungle
#

Never payed much attention to it since the bot works fine without fixing it

pure lion
#

ooooooooohhhhhhhhhhhboyyyyyyyyyy

hushed jungle
#

But I realized after 3 days it crashes the bot

#

๐Ÿ˜ฆ

opal plank
#

@heavy pollen you need to ssh or access where the vps files are and then update it from there

#

just like you would on your pc

hushed jungle
#

I got the warning that I need to increase the event limit, guess I could try that.

heavy pollen
#

@heavy pollen you need to ssh or access where the vps files are and then update it from there
@opal plank I can access to vps

#

In phone

quartz kindle
#

there is no reason to increase the limit

opal plank
#

@heavy pollen then there we go, just edit the files from there

#

you prob wont have a linter or a proper way to visualize syntax errors or debug, but it will work

hushed jungle
#

I don't know how to fix the leak then ๐Ÿ˜ฆ

heavy pollen
#

I will client#debug

#

And share result to you

opal plank
hushed jungle
#

Coding and mobile in one sentence

heavy pollen
#

i wonder if there are decent apps for coding in mobile
@opal plank Mobile coding is trash

#

Just try for 1 times

opal plank
#

im aware

heavy pollen
#

You will see

opal plank
#

trust me, i know

#

but since you dont have other options, either that or leave the bot crashing

digital ibex
#

@pure lion im totally not late at all, what do u need with mongoose?

heavy pollen
#

So you are saying update to v12

#

Right?

opal plank
#

could go to a LanHouse or something similar if they still exists

#

yeah, definetly update your code to v12

heavy pollen
#

Will i client debug for results

#

Or just update?

opal plank
#

wdym client debug?

digital ibex
#

wut

heavy pollen
#

Debug event

opal plank
#

you are changing code, why you debugging?

heavy pollen
#

Before updating*

opal plank
#

i mean, yeah, you wanna test and see if there are errors n such

#

check the guide and update all the old stuff, then debug to make sure everything is in place

pure lion
#

@digital ibex hi totally not la-

#

.updateOne()

#

h o w

digital ibex
#

u can just do

pure lion
#
            Guild.updateOne({guildID:msg.guild.id}, {prefix:`${Prefix}`})
#

:^)

hushed jungle
#

Weird I don't get the warning anymore but I did not change anything

pure lion
#

thats called me eating you memory

opal plank
#

im addicted to postgres and i need treatment

spare mirage
#

Hey! I need some help using an api

hushed jungle
#

But I want to eat my tasty memory ๐Ÿ˜ฆ

pure lion
#

if its alexflipnote istg

#

@spare mirage ?

pale vessel
#

what even is the problem

digital ibex
#
const people = // people model
const person = await people.findOne({ name: 'bob' });
person.updateOne({ name: 'dave' });
      ```
spare mirage
#

was dat

digital ibex
#

?

hushed jungle
#

nvm I had to go over the limit of 10 messages

pure lion
#

oh

digital ibex
#

thats gonna make bobs name be dave

hushed jungle
#

(node:644606) MaxListenersExceededWarning: Possible EventEmitter memory leak detected.

digital ibex
#

in the db

#

if thats what u meant?

pale vessel
#

just updateOne(find, new)

#

why two queries

digital ibex
#

idk im just used to that

pale vessel
#

oh

hushed jungle
#

Is it normal to use multiple event emitters?

pure lion
#

smememeh

#

no

#

very no

hushed jungle
#

It seems to make one for every message sent ๐Ÿ˜ฆ

pure lion
#

VERY NO

pale vessel
#

@pure lion what is the problem?

digital ibex
#

if its the same, no, otherwise yes

pure lion
#

not sure, brb

hushed jungle
#

Not sure how I code it so it uses just uses one eventEmitter though

pure lion
#

handler

#

'o command

digital ibex
#

you dont need a handler

pure lion
#

50 pieces of gold

spare mirage
#
PS F:\Users\Edwin\Desktop\Banana> npm install --save brawlhalla-api
npm WARN banana@1.0.0 No repository field.

+ brawlhalla-api@4.0.8
added 5 packages from 50 contributors and audited 133 packages in 7.064s

2 packages are looking for funding
  run `npm fund` for details

found 1 low severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details``` is it bad to get errors/warns while installing an api?
pure lion
#

no

#

warnings mean its working

#

:D

digital ibex
#

just js event.on('listener', (params) => { if (something) { do something } if (something) { do something } });

#

i feel sorry for u that ur not using strooplejs

#

D:

spare mirage
#

wait really

#

lmao

digital ibex
#

no

#

it was a joke

#

lmao

hushed jungle
#

What is stroople

#

lol

digital ibex
#

my library :^)

spare mirage
#

I get them all the time

#

do I just test?

hushed jungle
#

But I already have client.on('message', msg => { }

#

Why is that not good?

pure lion
#

@digital ibex didnt work :^)

pale vessel
#

no like what is the problem

pure lion
#

But I already have client.on('message', msg => { }
@hushed jungle need a total of o n e

digital ibex
#

i only made it the other day so its still in development lol, dont use it

#

how're u doing it?

pure lion
#

the problem is that when i run the command jackshit happens and its not logging lolololol

hushed jungle
#

Total of one?

digital ibex
#

send the code

#

u only need one

#

you dont need multiple

pure lion
#
const Discord = require('discord.js-light')
const mongoose = require('mongoose')
const { Guild } = require('../models/index')
const config = require('../config.json')
const guild = require('../models/guild')

module.exports = {
    name: 'prefix',
    async execute(client, msg, args) {
        const data = await Guild.findOne({ guildID:msg.guild.id });
        let Prefix = args[1]
        if (!Prefix) {
            let prefixEmbed = new Discord.MessageEmbed()
                .setTitle('Prefix help')
                .setDescription(`The guild prefix is \`${data.prefix}\``)
            msg.channel.send(prefixEmbed)
        } else if (Prefix.length > 10) {
            return msg.channel.send('The prefix must be less than 10 characters (for now)')
        } else {
            data.updateOne({prefix:`${Prefix}`})
            return msg.channel.send(`The prefix was set to ${Prefix}`)
        }
    }
}
#

porbo

#

thats how i got my index js to 50 lines

hushed jungle
#

But how do I make sure it only makes one of these message listeners?

digital ibex
#

console.log(Guild)

pure lion
#

if stacking

#

ok

digital ibex
#

remove the listener but only keep one

pure lion
#
{
  _id: 5f0753f2705fdb5058508587,
  guildID: '710964023117479966',
  prefix: 'aa!',
  w_gChannel: null,
  info: true,
  ping: true,
  poll: true,
  uptime: true,
  __v: 0
}
hushed jungle
#

I tried to remove listener after using it but it would still show this particular error.

digital ibex
#

is that lower case guild or upper case guild ?

pure lion
#

up

hushed jungle
#

Should I use client.once instead of client.on?

digital ibex
#

log the prefix after u update it

#

u can use either

pure lion
#

okay

#

logs the default prefix

#

wait ill await the edit and log it

digital ibex
#

oh yeah, mb. you have to await it

pure lion
#
{ n: 1, nModified: 1, ok: 1 }

logged

spare mirage
#

what are popular games that yall would like to see for an discord bot rank command?

pure lion
#

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

#

h

digital ibex
#

yeah, it worked

pure lion
#

aaaaaaaaaaaa

#

wait ill log it

#

yep it worked

#

epicccccccccccccccccccccccccccccccccccccccccccccc

sick cloud
#

d.js: would user join or user ban fire first

compact echo
#

How would I make a login system that uses html, nodejs, and mongodb?

sick cloud
#

@compact echo look into express, express-session and bcrypt packages, would be your easiest route

compact echo
#

Ok

#

I'll look into it

hushed jungle
#

Still have the eventEmitter leak ๐Ÿ˜ฆ

#

I tried removing it but then I can only send 1 message and it will stop working

digital ibex
#

learn nodejs PES2_Weird

hushed jungle
#

I try ๐Ÿ˜ฆ

digital ibex
#

not by making a bot

#

no

#

try with a simple website or something

hushed jungle
#

Any book or guide you could recommend?

digital ibex
#

for node, i dont know any. just search on youtube: nodejs tutorials

#

thats how i learnt it

gray zealot
#

any ideas why this doesnt work? ๐Ÿ˜„ ```js

Client.on('message', message => {
const slot = require('./slots.json');

   if (message.content === (`${prefix3}slots`)) {
    message.channel.send(`${slot[Math.floor(Math.random() * slot.length)]}`);
   }

})

digital ibex
#

what doesnt work

gray zealot
#

it outputs undefined

sudden geyser
#

Are you sure slot is an array

digital ibex
#

what outputs undefined

#

send the slots.json file

gray zealot
#

Are you sure slot is an array
@sudden geyser css { "slots" : [ "๐Ÿ๐Ÿ๐Ÿ", "๐Ÿ๐Ÿ๐ŸŒ", "๐Ÿ๐Ÿ๐ŸŠ" ] } there is more but this is it

#

2 big to send ๐Ÿ˜„

sudden geyser
#

watch the S

gray zealot
#

?

digital ibex
#

const { slots } =

sudden geyser
#

actually nvm I'm dumb. You need to access the index, which is slot.slots

digital ibex
#

u have an s

gray zealot
#

look at the const

digital ibex
#

do const { slot: slots } = require('./slots.json')

gray zealot
#

ok

sudden geyser
#

That won't work, it'll be an object of { slots: [...] }, so really accessing slot.slots[Math.floor(...)] should ideally work.

gray zealot
#

ok... ty

digital ibex
#

both would work

gray zealot
#

ok

#

ty!

#

error!

#

:D

const slot = require('./slots.json').slot.slots;
                                         ^

TypeError: Cannot read property 'slots' of undefined
    at Client.<anonymous> (C:\Users\kianc\Desktop\Kian2.5\bot.js:2211:42)
    at Client.emit (events.js:327:22)
    at MessageCreateAction.handle (C:\Users\kianc\Desktop\Kian2.5\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\kianc\Desktop\Kian2.5\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\kianc\Desktop\Kian2.5\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
    at WebSocketShard.onPacket (C:\Users\kianc\Desktop\Kian2.5\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
    at WebSocketShard.onMessage (C:\Users\kianc\Desktop\Kian2.5\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
    at WebSocket.onMessage (C:\Users\kianc\Desktop\Kian2.5\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)
    at Receiver.receiverOnMessage (C:\Users\kianc\Desktop\Kian2.5\node_modules\ws\lib\websocket.js:797:20)
tulip ledge
misty sigil
#

bj command?

tulip ledge
#

yes

misty sigil
#

no idea sorry, but good luck

gray zealot
#

@digital ibex @sudden geyser nvm ty! I fixed the error

#

it works nwo

#

*now

#

๐Ÿ™‚

spare mirage
tulip ledge
#

Does anybody knwo why when I type "hit" it doesn't work?
https://hastebin.com/miwolodoma.js
I've logged some stuff and from what I've seen it doesn't go into the awaitMessages().then it does however goe into the filter

sudden geyser
#

Do you mean user leave?

opal plank
#

huh?

spare mirage
#

I just discovered the most annoying thing

#

I spend 2 hours making a command... didnt work guess what

#

I need an api key

#

fk

tulip ledge
sick cloud
#

lol

#

yes

#

@sudden geyser leave or ban, that's what i wanna know

gray zealot
#

its for setTimeout

#

I can take a bigger ss

#

...

spare mirage
#

is that the elijah

gray zealot
#

tag?

solemn latch
#

elijah is a common name ๐Ÿค”

gray zealot
#

yeah ๐Ÿ˜„

spare mirage
#

#0001

gray zealot
#

nope

spare mirage
#

:3

gray zealot
#

#8888

spare mirage
#

0001 is a bot dev too

#

xD

#

Elijahbot

solemn latch
#

trying to make a cooldown system?

gray zealot
#

yes

solemn latch
#

you dont need setTimeout for cooldowns

gray zealot
#

yes, but he said I need If you mean cooldowns like ?daily you have to use database

#

database...

solemn latch
#

if you dont mind them resetting on reboot(really not a hugeee deal) you dont need one

gray zealot
#

?

tulip ledge
#

I fixed mine the issue was that message was being passed to the function and message is the msg object wich was sent by the bot

gray zealot
#

yay!

#

if you dont mind them resetting on reboot(really not a hugeee deal) you dont need one
@solemn latch what di u mean?

#

*do

solemn latch
#

for example.
if daily is only intended to run once a day. and you dont have a db, and your bot restarts itll forget they ran it

gray zealot
#

oh, yeah...

solemn latch
#

but since bots dont need to be rebooted too often, you can skip that

gray zealot
#

and I do that alot ๐Ÿ˜„

#

idk how to get around it...

#

I need to update my code?

#

lol

solemn latch
#

if you update a command, you can use a reload command

#

to reload the command

gray zealot
#

client.delete then client.login?

digital ibex
#

u wot

#

client.delete ?

gray zealot
#

it deletes it....

strange trout
#

You have to make a way to reload the command

#

With your command handler

solemn latch
#

client.delete deletes your login

#

๐Ÿค”

strange trout
#

If you have one

gray zealot
#

๐Ÿคฃ im clueless

spare mirage
#

no

gray zealot
#

๐Ÿคจ

digital ibex
#

i dont use djs but i dont remember a delete function but apparently its a thing ok

spare mirage
#

only we are clueless

gray zealot
#

๐Ÿ™‚

spare mirage
#

client.delete sounds fun xD

gray zealot
#

lol

spare mirage
#

!eval client.delete

digital ibex
#

i cant find anything in the docs about client.delete, can you send me a link to it

opal plank
#

just do !eval client = undefined;

gray zealot
#

???

#

I dont understand the guide ๐Ÿ˜„

opal plank
#

that'll likely fuck everything up

digital ibex
gray zealot
#

lol

spare mirage
#

hm

#

im boutta delete eval commadn

gray zealot
#

see, I am clueless

opal plank
#

delete function for what?

#

delete is a thing in native js

#

for whatever reason you guys are trying this

#

delete client || bot should work

sudden geyser
#

@sick cloud I tried to test it with two separate methods (first, sending a message | second, logging it with a variable) and both got banned first, then left after.

sick cloud
#

so theoretically i can set a var in the ban event so it won't fire the leave event if they were banned right

sudden geyser
#

You could, yes. However, I'm not 100 and 10% sure the ban event will be the first one fired as it's async.

sick cloud
#

only real way though, eh

sudden geyser
#

yeah, what I'd do is just set a condition/variable and if it's been set to the appropriate value (meaning the event was already fired), ignore it.

quartz kindle
#

client.delete? wtf are you trying to do?

solemn latch
#

honestly

#

not sure what happened

#

talking about reloading commands, and client.delete came out of nowhere

gray zealot
#

lol yeah me and my cluelessness ๐Ÿ˜„

earnest phoenix
#

I'm pretty sure client.delete isn't a thing lol

gray zealot
#

๐Ÿ˜„

earnest phoenix
#

@gray zealot have you used discord.js or Javascript in general before?

pure lion
#

Anyone know a good wrapper for the djs docs?

pale vessel
#

wrapper?

gray zealot
#

@gray zealot have you used discord.js or Javascript in general before?
@earnest phoenix yes ๐Ÿ˜

pale vessel
#

discord.js-docs?

pure lion
#

It sux

gray zealot
earnest phoenix
#

Ok lol was curious

gray zealot
#

๐Ÿ˜

pale vessel
#

maybe you don't know how to use it properly

gray zealot
#

๐Ÿ˜

pure lion
#

Probably not

gray zealot
#

๐Ÿ˜

#

๐Ÿ˜„

earnest phoenix
#

Emoji spam do be epic tho

pure lion
#

@pale vessel also the docs are shit

pale vessel
#

no

#

it's well documented

gray zealot
#

yes!

pure lion
#

Theyre outdated

pale vessel
#

oh, outdated != shit

pure lion
#

Can you help me then?

#

No idea what the search function was changed to

quartz kindle
#

if you want to kill your client there is client.destroy()

#

but that wont help with reloading commands

gray zealot
#

yes that ^^^^

quartz kindle
#

Lol

pure lion
#

@hushed jungle how many times do we have to say this

vivid cedar
#

@pure lion, The amount parameter isn`t a number!

#

@vivid cedar, The amount parameter isn`t a number!

#

@vivid cedar, The amount parameter isn`t a number!

#

@vivid cedar, The amount parameter isn`t a number!

pure lion
#

You only ne-

quartz kindle
#

what the fuck

#

this this guy just selfbot

pure lion
#

Smh

hushed jungle
#

I don't really remember what you said tbh

pure lion
#

You only need one message listener

#

:)

#

:))))))))

hushed jungle
#

I know but not how to code it ๐Ÿ˜ฆ

pure lion
opal plank
#

imagine self botting

solemn latch
#

@solemn latch how many times do we have to say this

#

๐Ÿค”

#

how did you trigger it

pure lion
#

@vivid cedar e

hushed jungle
#

How do I do code block?

pure lion
#

@hushed jungle how many times do we have to say this

#

:/ strange

hushed jungle
#

It's not really we you are the only one responding to me lol

quartz kindle
#

i looks like he immediately killed it

#

because it started responding to itself

#

lmao

opal plank
#

responding to itself ontop of that

pure lion
#

Lololol

opal plank
#

300iq

hushed jungle
#

client.on('message', msg => {
if (command)
});

solemn latch
#

lol

hushed jungle
#

Is this not good?

pure lion
#

@vivid cedar retar

hushed jungle
#

test

opal plank
#

@hushed jungle how many times do we have to say this

#

hmmm

#

just tried the same message that seemed to trigger it

hushed jungle
#

Why is everyone pinging with with the same message

#

loll

solemn latch
#

the self bot

opal plank
#

lmao

pure lion
#

Can somone help me with discord.js-docs

#

It has bad...docs

solemn latch
#

its good docs

#

๐Ÿค”

vivid cedar
#

WTG

quartz kindle
#

djs docs are very good lol

#

@vivid cedar did you selfbot?

opal plank
#

yes, wtf indeed

vivid cedar
#

No im not

pure lion
#

No I mean the package "discord.js-docs" has bad docs

opal plank
#

are you sure?

quartz kindle
vivid cedar
#

Yeap

solemn latch
#

theres 0 way

#

thats not selfbot

pure lion
#

@green kestrel most likely selfbot

vivid cedar
#

I swear

opal plank
#

sure

vivid cedar
#

Im not selfbot

ember atlas
#

The fuck

misty sigil
#

its a badly coded self bot

solemn latch
#

it was under a second

pure lion
#

Oh hey another mod hiiiii

solemn latch
#

those messages

quartz kindle
#

then explain what happened

opal plank
#

badly is an understatement

misty sigil
pure lion
#

Lol you're gonna get beaned

opal plank
#

bgon bot

misty sigil
#

if you're gonna selfbot atleast do it well

Lol you're gonna get beaned
b e a n e d

ember atlas
#

What was that

pure lion
#

Breaking tos in a developer server notlikenoot

opal plank
#

100% not selfbot Boss

misty sigil
opal plank
#

i swear

pure lion
#

Definitely not

vivid cedar
#

Wait

pure lion
#

Nope, can't have been

quartz kindle
#

let the guy explain

opal plank
misty sigil
#

sends 4 identical messages in less than 1 second
not selfbot nice verified

pure lion
#

Explain how he's going to get his acc unbanned?

vivid cedar
#

I do for avatars

solemn latch
#

yikes

misty sigil
#

yikes

solemn latch
#

lol

pale vessel
#

did he just-

misty sigil
#

still against tos

ember atlas
#

Well

opal plank
#

yikes

quartz kindle
#

well im sorry to say but thats not allowed

opal plank
#

bye

pure lion
#

Bean bean bean bean bean bean bean

ember atlas
#

I will see you later

opal plank
#

o/

misty sigil
pure lion
#

In court!

ember atlas
#

-b @vivid cedar admitted to self botting

hushed jungle
gilded plankBOT
#

dblMod Banned emirhๅ†ญn#6932 (@vivid cedar)

misty sigil
#

bye

opal plank
#

gg ez

pure lion
#

Ee no re

quartz kindle
#

ok guys, but no need to witch hunt and start trolling lol, let the guy explain first (also to bait confession)

topaz fjord
#

rip to my boy

ember atlas
#

Ok Iโ€™m gonna go back to work

#

Bye

hushed jungle
#

We'll never forget

opal plank
#

cya boss

quartz kindle
#

๐Ÿ‘

pure lion
#

Can someone help me with discord.js-docs package :<

misty sigil
#

go to work boss

topaz fjord
#

he was just trying to add some more functionality to his discord account

pure lion
#

Cya boss

quartz kindle
#

what discord.js-docs package?

opal plank
#

i mean you right, though i feel like there was enough proof there to make an argument

misty sigil
#

he was just trying to add some more functionality to his discord account
@topaz fjord KEKW

topaz fjord
#

am i wrong

misty sigil
#

wait

pure lion
misty sigil
#

why does selfbotting exist but not botselfing

pure lion
topaz fjord
#

it doesn't seem like something that you should be banned for unless it's used a bad purpose

opal plank
#

technically logging as a bot is allowed as far as im concerned

#

you may use a bot as a client, not a client as a bot

topaz fjord
#

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

pure lion
#

I believe that's not allowed either, not sure

quartz kindle
#

why do you want to use discord.js-docs? you want to send information from the docs to discord?

pure lion
#

No

opal plank
#

we had a talk in DAPI, no one was able to point out a rule that said otherwise

pure lion
#

Yes

quartz kindle
pure lion
#

Also cooool time to download livebot ๐Ÿ˜„

quartz kindle
#

lmao

opal plank
#

lmao

#

doesnt d.js have their own bot alraedy?

pure lion
#

Best docs

topaz fjord
#

using a npm module for discord.js docs

pure lion
#

Yes

topaz fjord
#

the definition of stupid

pure lion
#

I'm that lazy

#

How am I stup-

quartz kindle
#

so basically you want to make a command that shows the docs

pure lion
#

Yes

quartz kindle
#

thats actually not an easy task

topaz fjord
#

cheerio + axios

quartz kindle
#

since the docs are quite extensive

solemn latch
#

honestly, doc commands for luca

#

would be really nice

opal plank
#

you COULD ask them if their bot is open source

topaz fjord
#

and you can get similar functionality without a shitty lib

opal plank
#

d.js already has their own bot that does exactly that

solemn latch
#

oo

opal plank
#

try asking them if its open source

solemn latch
#

^

#

lmk if it is, id like to take a look

quartz kindle
#

you can go to the djs server and use their bot in the bots channel lul

misty sigil
#

^ second that

opal plank
#

of course i dont mean for you to copy it, but will give you a template to work with

#

ima ctually impressed the bot has a proper name and its not 'D.JS Bot'

hushed jungle
#

Should I give up on my event Emitter leak problem since I can't find a solution on Google/Stackoverflow.

quartz kindle
#

its a shitty name tho

hushed jungle
#

I could use client.setMaxListeners(0); but that just ignores the warning.

quartz kindle
#

@hushed jungle show the error

#

which event is it?

#

message?

hushed jungle
#

Yes

#

client.on('message', msg)

pale vessel
quartz kindle
#

are you using that multiple times for different comands?

amber fractal
#

dont make a message listener for ever command

hushed jungle
#

No

#

Everything is under that function

#

I don't

quartz kindle
#

show code

hushed jungle
#

Yeah, sure give me a sec

#

Wait am I allowed to link to github?

quartz kindle
#

sure

hushed jungle
#

Otherwise I just reference that

quartz kindle
#

does that warning show up right after starting it up or only after some time?

hushed jungle
#

After sending 11 messages.

amber fractal
#

You're not getting any other errors? and it isnt crashing?

hushed jungle
#

No, the only crash happened today when the console printed "Killed", implying it killed itself because it was using too much resources.

#

Which may be related to this memory issue.

#

Thus why I try to fix it.

#

Everything else runs like a charm otherwise.

#

I knew of this warning before but ignored it since I thought it would not be a problem but I never had the bot running for a long time and I guess on the long run it runs out of resources because of this.

amber fractal
#

Does it happen on any 11 messages?

pure lion
#

@pale vessel a

stark abyss
#

how to check if you can dm this user or not?

hushed jungle
#

I can test that

pure lion
#

Jsjsjsjsjsjsjs

amber fractal
#

Attempt to dm them

#

if you cant, then you cant.

#

no other way that I know of myself

stark abyss
#

well.. how can i return it if i can't?

amber fractal
#

It'll error

#

try/catch it

quartz kindle
#

@hushed jungle you have a circular dependency

stark abyss
#

ok ty

pure lion
#

Try {
//Dm
} CatCh {
//Peepeepoopoo
}

hushed jungle
#

Normal messages seem to be fine.

stark abyss
#

thx

hushed jungle
#

What is a circular dependency โ“

pure lion
#

๐Ÿ”ด

amber fractal
#

when you require something that's required in a parent module

quartz kindle
#

@hushed jungle main requires quiz which requires main which requires quiz which requires main which requires quiz...

hushed jungle
#

Ah, I see.

quartz kindle
#

you have that on reddit.js and uesp.js as well

#

the main file should never be required anywhere

topaz fjord
#

A requires B
B requires A
A requires B
...

#

oh i see im late

quartz kindle
#

requiring the main file prevents the main file from loading completely because it keeps waiting for the never-ending require cycle to finish

hushed jungle
#

I had a function in main which I wanted to use in the other files so I just did this to get access to that.

amber fractal
#

You can pass the function as a parameter (lol) or define it in a separate module

hushed jungle
#

Yeah I will have to look into that.

#

But the memory problem is not related to the eventEmitter then?

quartz kindle
#

everything is related to the circular dependency

hushed jungle
#

Alright, thanks for finding that out for me I would have never seen.

quartz kindle
#

since its an infinite loop, the memory rises infinitely, and since the main file is required multiple times, it can cause multiple concurrent clients to be started, or other weird things

amber fractal
#

I did that accidentally in the TermTalk lib and was so confused as to why it wasn't working :P

quartz kindle
#

i did that in a lib i was writing too

flat goblet
#

Is there a way to send a local image file inside an embed using Discord.Net?

quartz kindle
#

possible yes

#

there should be a method to attach files

flat goblet
#

There is attach files, except Im not sending as attachment, I am sending within the embed

quartz kindle
#

the attachment is a requirement

flat goblet
#

I think only url is accepted, not path

quartz kindle
#

once attached, you can set it as an image in the embed, using the following url: attachment://filename.extension

flat goblet
#

So send attachment, retrieve attachment, put image into embed, delete attachment?

quartz kindle
#

the attachment should be sent together

#

in the same message

#

for example, something along the lines of ```js
.send({
embed: {
image:{
url:"attachment://myfile.jpg"
}
},
files: [{
attachment:file data,
name:"myfile.jpg"
}]
})

#

discord.net should have convenience methods that build it for you

flat goblet
#

Ok thank you

pure lion
#

How do I add fields with a forEach loop

pale vessel
#

embed.addField()

pure lion
#

Okay

earnest phoenix
#

In using switch cases, is it possible to make it do something if the string is for example args[0] and in the case to be userinfo and also ui... Is it possible

solemn latch
#

i suggest using a command handler

quartz kindle
pure lion
#

You can stack cases

solemn latch
#

advanced command features are best done in a command handler

earnest phoenix
#

case "someString" || "ThisString": is this kind of thing Possible?

pure lion
#

No

#

Stack vertically, like this:
case '1':
case '2':

quartz kindle
#

oh i didnt see flazepe already linked those lmao

earnest phoenix
#

@pure lion i didn't mean that

pure lion
#

It works the same way

#

And no, I don't believe you can use and or in a case

quartz kindle
#

you can stack them horizontally as well

earnest phoenix
#

For example as an aliases...

//Do something
break;
case "main string" || "aliases":
//Do the same thing that the main string does when aliases is done
break;
quartz kindle
#

case "somestring": case "anotherstring": { do something }

earnest phoenix
#

Oh that's how it works?

#

Lol thanks

pure lion
#

Yeah

#

*rejected crying*

quartz kindle
#

lmao sorry

pure lion
#

Nah not you don't worry lol

spare mirage
#

what db should I use for leveling

tired nimbus
#

any db lol

hushed jungle
#

I still get the eventEmitter error after removing the main requires.

#

๐Ÿ˜ฆ

pure lion
#

@spare mirage not quick.db pogey

spare mirage
#

so I dont use quickdb

#

ok

#

thanks

quartz kindle
#

@hushed jungle did you update the code on github?

hushed jungle
#

Not yet I wanted to make sure it worked first but I can push now

tired nimbus
#

quick.db is good if you're a beginner to sql or dbs

#

but it only uses one column

#

for everything

#

and makes a new row every single time

hushed jungle
#

@quartz kindle Push is done ๐Ÿ™‚

pure lion
#

does anyone know the ratelimit for changing statuses

#

ok then

solemn latch
#

like once every 5 seconds or something stupid low.
Might be considered API abuse

#

at those rates

pure lion
#

smh

slender thistle
#

5/20s iirc

pure lion
#

Ty shiv

opal plank
#

Discord has a very loose interpretation of API abuse; as quoted by them:

American Jake01/21/2018
@Danny automating the API in that way /is/ abuse. Automatically doing "X" every N is generally not a good idea. Where X could be posting a message, changing someone's nickname, renaming a role, changing a channel topic, etc... 

Generally bots should only react to user actions... 

Although, for very large N we generally don't care. But for small N, we do care. Think rainbow bots, etc....

"N" is not really defined, as rate limits are not a good thing to try to get very close to. You're going to have to mostly use common sense here, compare how close you are the rate limit, how often you do this, etc. @pure lion

quartz kindle
#

@hushed jungle i cant see anything wrong, does it still happen after 11 messages? any message at all? even messages without commands?

hushed jungle
#

Thanks for getting back to me. I think only after executing a command. Normal commands don't see to have an effect.

quartz kindle
#

can you console.log(client._events)

#

inside a command

hushed jungle
#

sure

opal plank
#

thats one thing i havent learned, why people use _ before their stuff?

#

_this

misty sigil
#

yea why

quartz kindle
#

its a general convention to define private methods, since js doesnt have a built in way to define them

hushed jungle
amber fractal
#

people like to use it for private things

hushed jungle
#

Define private methods?

amber fractal
#

Soon tho js will have private methods and variables

#

idk when node will support them though

quartz kindle
#

it already has private properties

#

in classes

#

since node 12 i think

hushed jungle
#

Oh this is a question about why to use _ before events

#

I wondered that too

opal plank
#

yeah ive seen classes use that sort of stuff but never learned it myself

hushed jungle
#

Is the output of the console.log good?

#

I attached it to the help command

quartz kindle
#

run the help command again

#

and see what it logs again

hushed jungle
quartz kindle
#

wtf

#

thats with 2 runs of the help command?

hushed jungle
#

11 or something

amber fractal
#

did you update it on your github?

hushed jungle
#

I spammed it until I got the warning

#

Yes

quartz kindle
#

ah

amber fractal
#

I'm just gonna run this locally and see if i can find it

quartz kindle
#

so you ran it 11 times

hushed jungle
#

It's up to date with the live version

#

f!help (11x)

quartz kindle
#

seems like the problem is not in discord.js

#

its a drain event in TLSSocket

#

not a message event

#

the only thing in your code that uses tls sockets is node-fetch

hushed jungle
#

It uses it for fetching web pages.

#

But the help command doesn't do that.

quartz kindle
#

whats your node.js version?

hushed jungle
#

12.9.0

amber fractal
hushed jungle
#

I can't manually change it they have made a selection of versions I can choose from

#

No local you don't get this message

#

I noticed that too during testing

quartz kindle
#

where is your bot hosted?

amber fractal
#

It's gotta be a problem with your host

hushed jungle
#

I have a shared hosting at namecheap

#

And they offer node.js deployment

quartz kindle
#

sounds like a hosting issue

#

and/or node.js issue

hushed jungle
#

Well I could try to find different hosting then since now it crashes in the long run

#

But I used this since I already had access to it so it's the cheapest option for me

amber fractal
#

Well, if you dont get it locally, but you do get it on the host and nothing changed, that's all I can think of

#

what do they even charge?

hushed jungle
#

Uhm I pay yearly for three a max of three websites.

#

And a couple of other stuff like databases, etc.

#

I am looking through my mail for the price

quartz kindle
#

@hushed jungle a quick google search indicates this is a bug with node.js v12.9.0 and it was fixed in v12.9.1+

amber fractal
#

I didnt even know namecheap offered stuff like this, I'd assume it'd be for webserver hosting

quartz kindle
amber fractal
#

F

hushed jungle
#

I found that one too but was not sure if it applied to this situation

quartz kindle
#

you'll have to contact namecheap and ask them to update node

#

12.9 is a very weird version to be on

#

considering the LTS is 12.13-12.18

hushed jungle
#

LTS?

amber fractal
#

long term support

quartz kindle
#

^

amber fractal
#

basically the current version

#

without the beta features

hushed jungle
#

I think the price is like 30 dollars Steven.

#

For the web hosting.

quartz kindle
#

node 14 should become LTS soon

hushed jungle
#

Their VPS is 125 lol

quartz kindle
#

per year?

hushed jungle
#

I doubt namecheap will update the nodejs version since it is using an applet for it

#

30 dollar per year yes

#

And 125 per year

#

And that's with a one year discount

quartz kindle
#

what other node versions do they offer?

#

125 per year is very expensive

#

but 30 per year is ok, depending on the resources you get

amber fractal
#

It's specs have to be decent if that's the discounted price right?

quartz kindle
#

im paying 33 per year for 1gb ram

hushed jungle
amber fractal
#

weird versions

quartz kindle
#

that sorting tho

#

lmao

hushed jungle
#

Yeah idk

#

For some reason the most recent version is in the third place

#

Makes sense

quartz kindle
#

11.15 is the latest 11 version

#

10.21 is the latest 10 version

sudden geyser
#

it's like someone started top to bottom, lost their placement, and went back to the top

quartz kindle
#

but discord.js requires 12+

hushed jungle
#

I also have 1gb

#

50mySQL db

quartz kindle
#

so basically you're out of luck

tired nimbus
#

i self host

hushed jungle
#

20gb storage

quartz kindle
#

unless namecheap upgrades their node

hushed jungle
#

yes ๐Ÿ˜ฆ

#

I can run it now but eventually it will crash again

#

Because memory ๐Ÿ˜ฆ

tired nimbus
amber fractal
#

you'd think a thing for webservers would have node versions good for webservers

hushed jungle
#

Guess I need to host somewhere else lol

amber fractal
#

and not ones that create memoryleaks

quartz kindle
#

its worth opening a ticket in namecheap

hushed jungle
#

I guess it's limited since this is more of a feature people with a VPS would use

quartz kindle
#

this has to be taken care of

hushed jungle
#

I can always try their support has always been kind to me even with the most stupid questions

amber fractal
#

marketing tactic mmLol

hushed jungle
#

I assume this falls under hosting support?

#

lol

misty sigil
#

yes

quartz kindle
#

show them your errors, link them the github issue, explain that its a bug with node 12.9.0 and that node recommends upgrading asap

hushed jungle
#

Yeah the github link should prove useful

#

Any hosting suggestions if this doesn't work out?

#

Or should I just upgrade to a full fledged VPS

misty sigil
#

contabo is cheap

amber fractal
#

I can't recommend contabo any less after it was learned they used ssd swap as ram

#

lmao

misty sigil
#

wat

amber fractal
#

That was about my reaction too

misty sigil
#

ovh time blobdance

amber fractal
#

atleast it was rumored

#

but I mean mmLol

strange trout
#

Hai

gray zealot
#

Hi again! ๐Ÿ˜„ Is the a way I can make it so if the command is something like !messages it will say how many times you have used one of the bots commands?

Hi alexis ๐Ÿ™‚

misty sigil
#

I think you'd need a db

quartz kindle
#

yup

rare valve
#

Like a specific command?

#

Or just like any

gray zealot
#

starting with a certain prefix

quartz kindle
#

you need a database or some sort of storage to keep the number saved and updated

gray zealot
#

๐Ÿ˜ฌ

#

||idk how ๐Ÿ˜‚||

rare valve
#

You would have to check every message that was sent using an event and see if it includes your prefix and if it does make a vestibule and add one to it every time a message that contains that prefix is sent and save that on a database or something

strange trout
#

You could save it in memory and do something like You have used <number> commands since the last restart

rare valve
#

Variable*

gray zealot
#

hmm

strange trout
#

But a database would be better to count the total number

gray zealot
#

how would I do that... ๐Ÿ˜‚

rare valve
#

You would need to get a databas

#

Database*

strange trout
#

Depends what type of database you want

gray zealot
#

...

misty sigil
#

yea

#

what do you plan on using ?

strange trout
#

I mean this would be a good way to learn some SQL basics

rare valve
#

Yeah

gray zealot
#

what do you plan on using ?
@misty sigil im not sure bc Idk what ones there are ๐Ÿ˜‚

misty sigil
#

KEKW do some research

strange trout
#

You'd have to learn how to setup the database and some simple queries

gray zealot
#

ok

rare valve
#

You could use phpmyadmin and run it locally without having to buy anything online

#

But I donโ€™t recommend doing that if you donโ€™t want to run your computer 24/7

strange trout
#

It really depends what type of database they want

rare valve
#

But you could use it while your learn

#

Yeah

strange trout
#

I'd go with SQL

misty sigil
#

why, Mongo is quite good

gray zealot
#

๐Ÿ˜„

strange trout
#

I use PostgreSQL but setup is not super beginner friendly

gray zealot
#

ok...

strange trout
#

Either one is fine though. Look into SQL and NoSQL databases

gray zealot
#

ok

misty sigil
#

sql injection has entered the chat
lmao jk jk KEKW KEKW KEKW KEKW

strange trout
#

PostgreSQL + Sequelize is a good combo

#

That's what I've been using

#

Updating is as easy as

await message.guild.update({ prefix: '' });
misty sigil
#

god damnit

gray zealot
misty sigil
#

i have client.db.collections("prefixes").findOne("g_id":message.guild.id)

#

@gray zealot any

gray zealot
#

ij

#

*ok

opal plank
#

Snake case cursed

strange trout
#

Fetching guild prefixes is just

const { prefix } = await message.guild.fetchData(['prefix']);
gray zealot
#

you talking to me?

#

๐Ÿ˜„

strange trout
#

Me? No, I'm just showing how I have my database setup

gray zealot
#

\๐Ÿ˜„ ok

fiery canyon
#

I like noodles

gray zealot
#

ok

sick cloud
#

in web js

#
    <anonymous> file:///C:/Users/ThatTonybo/Desktop/ssr-login/assets/js/app.js:7

i get this error rn

earnest phoenix
#

you can't require in web no

#

what are you doing

sick cloud
#

is there any alternative

#

the index.html requires the app file and i want it to require the router file

#

some how

earnest phoenix
#

from googling around people are saying to include your script in your html DOM

#

but they're executed in parallel

#

honestly if you want that kind of a structure

#

look into SPA or other js frameworks e.g. angular or react

errant perch
#

how do i check if a message has a emoji in it

#

im using discord.js

earnest phoenix
#

custom or unicode

errant perch
#

unicode

earnest phoenix
sick cloud
#

i'm working on making an alternative to a framework, making my own

hasty lotus
#

I use PostgreSQL but setup is not super beginner friendly
@strange trout i agree

#

but postgre is so good

#

it can readso many lines so fast

lyric mountain
#

I wish pgAdmin 4 wasn't buggy af

hushed jungle
#

Guys I have negative ping

#

lol

#

Like how

earnest phoenix
#

@hushed jungle don't worry the more lower the better

#

Lol

hushed jungle
#

-48768ms

#

0_o

earnest phoenix
#

Now that's an undefined moment

left lake
#

is that for like a bot ping

hushed jungle
#

Yes

left lake
#

you probably have your math mixed up

hushed jungle
#

I just changed hosting

#

So I wanted to test

#

And it worked fine with the previous one

left lake
#

what i did for my bot to prevent it from looking stupid is check the number for positive or negative, if its negative just say it errored

#

else you have your math mixed up

earnest phoenix
#

What's the host? Nasa? Wtf @hushed jungle

hushed jungle
#
  {
    let ping = Date.now() - msg.createdTimestamp;
    msg.channel.send(`My ping is ${ping}ms and the API latency is ${client.ws.ping}ms.`);
  }```
#

Just some random hosting website I found which seemed legit

#

Code is fine right?

left lake
#

whats the website

#

dont answer that actually

#

it doesnt matter what the website is, having negative ping means the bot is processing your response beofre you even sent it

hushed jungle
#

Huh

left lake
#

basically if the ping is negative

#

it means the bot processed your command before you even sent it

#

approx. 48 seconds if my ms to seconds big brain is correct

hushed jungle
#

How is that even possible lol

left lake
#

its not

#

which one is returning a 48kms response time

#

ping or API

hushed jungle
#

ping

earnest phoenix
#

I think the solution for this is to send a message like pinging then edit it by dividing the created timestamp of the pinging created message and the timestamp of your message

hushed jungle
#

API is 941

#

Which is high but legit enough

left lake
#

oh wait

#

yeah

#

do what voltrex said

#

my bot sends "Pinging...", edits it, then returns the time it took to do that

hushed jungle
#

Yeah I should try that

left lake
#
let omsg = await message.channel.send("Ping...")
  let latency = Date.now() - message.createdTimestamp
  let check = Math.sign(latency)
  if(check === -1){
    latency = "Error"
  }
hushed jungle
#

This clearly doesn't work

left lake
#

granted i did some more

#

extra work

#

so if it does ever return a weird value

earnest phoenix
#

Hold up

left lake
#

people arent like "omg wth bro"

earnest phoenix
#

Wtf is that

left lake
#

wtf is what

earnest phoenix
#

The thing you showed

left lake
#

its a portion of my ping command

#

i just did some extra stuff to it ๐Ÿ˜

earnest phoenix
#

I have not seen a single ping command have that... Were you working on your ping command for days my dude

left lake
#

no what

#

it took me atleast 10 minutes...

amber fractal
#

that's all extremely basic js lmao

left lake
#

a ping command is really easy...

empty tinsel
#

.,.

earnest phoenix
left lake
#

most ping commands are straight-forward

#

i like to be extra with my commands so i add more checks just in-case it wants to return a wonky number

earnest phoenix
#

"Me Wondering that even Math.sign function existed"

amber fractal
left lake
#

oh it checks if a number is positive or negative

#

so if a number is positive it returns 1

#

if its negative it returns -1

#

useful for uhh

#

i forget what i was using it for initially but

amber fractal
#

< 0 or > 0 is too simple

left lake
#

yeah im extra

#

๐Ÿ˜

#

plus it looks cool so go away

amber fractal
#

tbf that's not even exact ping, but close enough

left lake
#

who even cares when it comes to a ping command

#

the bot fuckin responded go away

amber fractal
#

Defensive over a command that everyone does a little wrong mmLol

left lake
#

idrc about my ping command, i just did it to do it

hushed jungle
#

Should I substract the Discord API latency when showing the bot's ping or include it?

earnest phoenix
exotic cradle
#

Anyone know a script that sends a custom message (set by me ) when a user joins?

left lake
#

sure, thats easy

lyric mountain
#

Yes, javascript

left lake
#

do you have any code to show for what you've done

#

and thats a very good response

hushed jungle
#

yay now my ping is 4273ms

#

0_o

left lake
#

progress

exotic cradle
#

..

#

mine is- hold on

earnest phoenix
hushed jungle
#

I mean I guess it's not negative

exotic cradle
#

167ms

hushed jungle
#

So I have that going for me

left lake
#

its better than negative