#development

1 messages · Page 539 of 1

blazing pasture
#
client.on('message', message => {
  var args = message.content.split(/[ ]/);
    
        const admin = alist.includes(message.author.id)

    if(message.channel.type === "DM") return;
       
    var command = message.content.split(" ")[0];
    command = command.toLowerCase().slice(config.prefix.length);
    
 if(!message.content.startsWith(config.prefix) || blacklist.includes(message.author.id)) return;
#

my message event can respond to bots

#

i think i got a fix, dont worry

earnest phoenix
#

can anyone thank me on glitch

#

i need custom domain

mossy vine
#

can anyone delet this

earnest phoenix
#

huh 😡

#

no one

#

glitch is aa platorm which supports bot hosting

mossy vine
#

this channel is for development related questions, not for asking for shit lmao

knotty steeple
#

and glitch is for fucking websites

earnest phoenix
#

nope

#

dbl is on glitch

#

idiots

knotty steeple
sick cloud
#

dbl is on do

knotty steeple
#

excuse me

#

what the fuck

earnest phoenix
#

yea XD

#

if u dont believe ask mods

#

admins

knotty steeple
#

get out with ur bullshit lmao

#

its hosted on a vps

sick cloud
#

@modern sable can you ask this guy to stop shit posting

modern sable
#

@earnest phoenix DBL is hosted on a server and not glitch

earnest phoenix
#

uh

#

ok

grizzled crane
#

@coral trellis there's a pin post with awesome useful resources for js ... could you please edit it so it says Object ORIENTED instead of ORIENTATED ?

#

also sorry for the trouble

coral trellis
#

Eh I’m on my way to the airport if I remember in a week then sure

grizzled crane
#

cool

#

enjoy your travel

coral trellis
#

Thank you

normal wyvern
#

Hello

#

I need some help, does anyone know JS

violet jetty
#

What help?

quartz kindle
#

almost everyone here knows js lul

grizzled crane
#

I queued my bot on the approval list, do I also need to invite it on this server ?

earnest phoenix
#

@grizzled crane you can't invite here the mods do that

grizzled crane
#

I see

#

ok

#

should I then keep it online or ?

earnest phoenix
#

and they will have to test and approve it first

#

also you should probs get a host maybe

grizzled crane
#

ok

proven obsidian
#

i need N/A

#

problem fix

quiet flare
#

wait

#

const dbl = require("dbl.js");
const { Command } = require('discord.js-commando');
const { RichEmbed } = require('discord.js');

module.exports = class EmbedCommand extends Command {
    constructor(client) {
        super(client, {
            name: 'dbl',
            aliases: [],
            group: 'admin',
            memberName: 'dbl',
            description: 'TR Discord bot liste bot istatistiklerini gönderir.',
            examples: ['dbl'],
        });    
    }
    
    hasPermission(msg) {
        return this.client.isOwner(msg.author);
    }

  async run(msg, args) {
   
  let dblClient = new dbl.Client({
  dbltoken: "dbls token",
  id: "Your İD"
});

dblClient.postServerStats({serverCount: `${this.client.guilds.size.toLocaleString()}` , shardCount: `${this.client.shard.count}`}).then((stats) => {
  msg.channel.sendMessage('Discord bot liste istatistikler gönderildi.');
}).catch((e) => console.log(`${e}`));
      
    
  dblClient.getBotStats("Bot id").then((stats) => {
  console.log(stats);
}).catch((e) => console.log(`${e}`));
}
}```
#

@proven obsidian

knotty steeple
#

dont use commando

#

solved

quiet flare
#

d.js or commando?

knotty steeple
gleaming glen
#

lovin' it

neat falcon
#

commando no

earnest phoenix
#

ok

normal wyvern
#

Hello

#
const schedNumber = 1;
const currentSchedArray = new Array();
currentSchedArray.push({
	1: schedNumber
});

const schedNumberExists = currentSchedArray.filter(autoSched => autoSched['schedNumber'])
console.log(schedNumberExists)

Uncaught syntax error unexpected token &

small nymph
#

HI

keen drift
#

understandable

small nymph
#

HI

normal wyvern
#

@keen drift

#

Is there a reason?

keen drift
#

well, at least provide what line it occurs on

normal wyvern
#

Idek

#

Why is that error there at all

#

There is no&

keen drift
#

What line number, jesus

normal wyvern
#

That's the only code

#
const schedNumber = 1;
const currentSchedArray = new Array();
currentSchedArray.push({
	1: schedNumber
});

const schedNumberExists = currentSchedArray.filter(autoSched => autoSched['schedNumber'])
console.log(schedNumberExists)

Uncaught syntax error unexpected token &

#

This is the ONLY CODE

#

it doesn't say line number

#

That's the whole code.

keen drift
#

where are you seeing the error

west raptor
#

mobile

keen drift
#

that error doesn't even fit your screen

#

wtf is dcoder

normal wyvern
#

That's the end of the error

keen drift
#

well shit, use a real interpreter

normal wyvern
#

Can you?

keen drift
#

i have no idea what Dcoder is

normal wyvern
#

That code would work anywhere

#

Just another app that terminates executes JS

earnest phoenix
#

`npm ERR! Unexpected token { in JSON at position 69683 while parsing near '...": "^1.1.3"
npm ERR! {
npm ERR! "name": ...'

npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npm-cache/8.14.0/_logs/2018-12-21T17_35_03_973Z-debug.log`

#

pls help me

keen drift
#

works

earnest phoenix
#

**npm ERR! Unexpected token { in JSON at position 69683 while parsing near '...": "^1.1.3"
npm ERR! {
npm ERR! "name": ...'

npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npm-cache/8.14.0/_logs/2018-12-21T17_35_03_973Z-debug.log**

#

help mee pls

keen drift
#

cool

knotty steeple
#

read

normal wyvern
#

What works?

#

Does my code work for you? @keen drift

keen drift
#

look at the screenshot

normal wyvern
#

I don't see a thing

#

What exactly is the console?

keen drift
#

what

#

you can't see the link I posted directly after

normal wyvern
#

Huh.

#

No

#

There's none

keen drift
#

so you don't see the imgur link?

normal wyvern
#

Yes

#

I do

#

It's the same photo

#

Nothing was logged

#

All i see is your $

keen drift
#

what you mean nothing is logged

#

an empty array is logged

normal wyvern
#

Ok

#

Where's the problem

#

It's in the filter

keen drift
#

There's no problem

#

It interprets successfully

#

idk wtf dcoder is

earnest phoenix
#

@keen drift its this app on the play store where you can "code" on mobile

normal wyvern
#
const schedNumber = 1;
const currentSchedArray = new Array();
currentSchedArray.push({
	1: schedNumber
});

const schedNumberExists = currentSchedArray.filter(autoSched => autoSched.length > 0)
console.log(schedNumberExists)
#

Can you really quickly try that

keen drift
#

why are people coding on mobile

normal wyvern
#

I think it's the filter

#

That's why there a empty array

earnest phoenix
#

it's like an ide but it has most of the programming languages

keen drift
normal wyvern
#

I know

#

It's the filter is tut?

#

Isn't it*

keen drift
#

what

normal wyvern
#

That should be right because the filter actually

#

Filters something, right?

#

That above is right?

keen drift
#

idk, get on a computer

#

why you coding on a phone

normal wyvern
#

No access to pc rn

#

Anyone can try this pls

#
const schedNumber = 1;
const currentSchedArray = new Array();
currentSchedArray.push({
	1: schedNumber
});

const schedNumberExists = currentSchedArray.filter(autoSched => autoSched.['schedNumber'].length > 0)
console.log(schedNumberExists)
earnest phoenix
#

numbers don't have the length function

normal wyvern
#

What is it then?

#

Ozh

earnest phoenix
#

what are you even trying to do

normal wyvern
#

Oh yeah

#

It's just nothin

#
const schedNumber = 1;
const currentSchedArray = new Array();
currentSchedArray.push({
	1: schedNumber
});

const schedNumberExists = currentSchedArray.filter(autoSched => autoSched.['schedNumber'] > 0)
console.log(schedNumberExists)
#

That's right.

#

Can someone check pls

earnest phoenix
#

that isn't

normal wyvern
#

Really?

#

Why?

earnest phoenix
#

because json

#

i'm 99% sure you can do without the dot

#

also don't put it in a string

normal wyvern
#

oh yeahhh

#

The dot

#

But if 1 = 'string';

#

Then i would right? @earnest phoenix

earnest phoenix
#

pretty sure

normal wyvern
#
const schedNumber = 1;
const currentSchedArray = new Array();
currentSchedArray.push({
	1: schedNumber
});

const schedNumberExists = currentSchedArray.filter(autoSched => autoSched[schedNumber] > 0)
console.log(schedNumberExists)
#

How can i check if property name is > 0

earnest phoenix
#

ok

keen drift
#

what is that code even suppose to do

normal wyvern
#

How can i do it? If the property name > 0 @keen drift

keen drift
#

what you mean if property name

#

what are you trying to accomplish

normal wyvern
#

I'm trying to see if a property name same as the arg exists

#

Otherwise it won't continue command @keen drift

keen drift
#

...

normal wyvern
#

So how can i get property name.

#

Or value

#
const schedNumber = 1;
const currentSchedArray = [];
currentSchedArray.push({
    1: schedNumber
});

const schedNumberExists = currentSchedArray.filter(autoSched => autoSched.hasOwnProperty(schedNumber));
console.log(schedNumberExists);
keen drift
#
const schedNumber = 1;
const currentSchedArray = [];
currentSchedArray.push({
    1: schedNumber
});

const schedNumberExists = currentSchedArray.filter(autoSched => autoSched.hasOwnProperty(schedNumber));
console.log(schedNumberExists);
normal wyvern
#

Ok

#

Thanks alot! @keen drift

earnest phoenix
#

spOonFeEd

knotty steeple
#

what database should i use with dart

#

also if im making a bot what platform to use

#

for dart

#

i guess server makes sense

west raptor
#

server probably

knotty steeple
#

ok but

#

i need ans for first question

west raptor
#

idk

#

I haven't really fucked with dbs all that much

knotty steeple
#

im gonna use mysql

#

im making my new bot in dart and it needs databases

earnest phoenix
#

oHnOeSitSsQL

normal wyvern
#

Use postgreSQL

#

I think mySQL is a bit too much for a first database user or whatever. @knotty steeple

#

JSON file is better actually.

knotty steeple
#

what

normal wyvern
#

Use JSON file to save stuff

west raptor
#

no

knotty steeple
#

ok

#

let me say something

normal wyvern
#

What

knotty steeple
#

im not a "first database user"

#

second

normal wyvern
#

Oh ok.

knotty steeple
#

json can be corrupted

normal wyvern
#

Really?

west raptor
#

this isnt sam's first time using a db

#

lol

normal wyvern
#

So can datbases

knotty steeple
#

and last

#

how do you even json with dart

normal wyvern
#

Idk wtf dart is???

#

All I'm saying mySQL is overkill postgreSQL is easy to use.

knotty steeple
#

so dont say anything?

#

if you read what i said you would know i wanted a database to use with dart which is a programming language

#

how is postgres better

normal wyvern
#

I lied it is not easier(wait what) to use. But it is better for sure

#

Relations, ARRAY data fields,

knotty steeple
#

dont really need that do i

#

no

#

ok

topaz fjord
#

There's no point in making a bot with dart

#

Literally the main reason everyone uses dart is for flutter

prime cliff
#

"All I'm saying mySQL is overkill postgreSQL is easy to use."

#

Mysql is literally easy just select values in table where id=''

earnest phoenix
#

how can i do send servercount dbl?

quartz kindle
knotty steeple
#

@topaz fjord ok

#

idrc

earnest phoenix
#

when i do the command for my bot to play a song it just says not found even when i do the exact song title

#

@loud salmon

loud salmon
#

i didnt mean that i could help you

#

your answer is pretty vague anyway

#

i meant to say put that in development

earnest phoenix
#

can someone help me pls
when i do the command for my bot to play a song it just says not found even when i do the exact song title

lusty dew
#

Ok so I haven't used VS code in a while how do I change the terminal from powershell to cmd?

topaz fjord
lusty dew
#

Thank you

earnest phoenix
#

when i do the command for my bot to play a song it just says not found even when i do the exact song title

#

its nadeako

slim heart
#

Then somethings wrong with whatever api you’re using to get the song

topaz fjord
#

ask in nadekos support server

#

this isnt it

slim heart
#

Oh nvrm lol

#

I thought it was his bot

earnest phoenix
#

ok no but my bot is made of nadeko

slim heart
#

🤔

lusty dew
#

Lol

topaz fjord
#

still ask in nadekos server

earnest phoenix
#

ok

slim heart
#

That was the wrong emoji

lusty dew
#

If its made of nadeko

#

Best bet is to ask in the Nadeko Server

slim heart
#

Nooooooo how’d u know

noble coral
#

how i can add mee6

#

to my discord server

slim heart
#

...

noble coral
#

idk

#

reaally

slim heart
#

Yeah. You don't need to join this server to ask how to invite. Also probably could've just googled it

noble coral
#

i cant

#

look

vernal rivet
#

its not hard to do

slim heart
#

...

vernal rivet
#

yee

noble coral
#

i cant tap authorize button

slim heart
#

Thats a discord problem

#

not a bot problem

vernal rivet
#

cause you need to be signin to your discord

noble coral
#

i sign in

vernal rivet
#

;-; then you don't have proper permission to do that, talk to the server owner to do it, or get the proper permission to do so

noble coral
#

but

#

oh come on

#

i just cant

#

how i can fix it

earnest phoenix
#

then do it on your own server

vernal rivet
#

yes

earnest phoenix
#

easy

vernal rivet
#

you have to have the right permission to do it

#

which is manage server

noble coral
#

how i get this premesion

topaz fjord
#

to add a bot to your server you need the permission "Manage Server". If you don't have it, ask the server owner to give it to you or ask them to add the bot

noble coral
#

i logined on discord

vernal rivet
#

did you login on the bot website?

topaz fjord
#

the permission "manage server" is within the server you want the add the bot to

noble coral
#

i cant login there

vernal rivet
#

not that hard mate

#

next time, please look on online before coming to us for help that doesn't include making a bot, and running to problems with it.

earnest phoenix
#

@noble coral in ordered to get the permissionManage Server inside the server you want to add it to you must either (Have a role with either the permission of Manage Server or Administrator) and/or (Be the Owner)

vernal rivet
#

yes

lusty dew
#

How can I make node work in the cmd terminal on VS code?

#

It isn't working and I have never faced this problem

topaz fjord
#

need

#

more

#

info

lusty dew
#

It says Npm is not recognized

quartz kindle
#

either install node in the correct folder or add node's environment variables to PATH

topaz fjord
#

^

lusty dew
#

ok

#

ty

#

How would I add Node to PATH?

topaz fjord
lusty dew
#

It's still not working

topaz fjord
#

try reinstalling node

lusty dew
#

Ok

knotty steeple
#

uh

#

Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

topaz fjord
#

check the logs

knotty steeple
#

i have

#

-- Unit nginx.service has begun starting up. Dec 21 13:40:02 ajhasavps nginx[17324]: nginx: [emerg] "server" directive is not allowed here in /etc/nginx/nginx.conf:1 Dec 21 13:40:02 ajhasavps nginx[17324]: nginx: configuration file /etc/nginx/nginx.conf test failed Dec 21 13:40:02 ajhasavps systemd[1]: nginx.service: Control process exited, code=exited status=1 Dec 21 13:40:02 ajhasavps systemd[1]: nginx.service: Failed with result 'exit-code'. Dec 21 13:40:02 ajhasavps systemd[1]: Failed to start A high performance web server and a reverse proxy server. -- Subject: Unit nginx.service has failed -- Defined-By: systemd

quartz kindle
#

nginx: configuration file /etc/nginx/nginx.conf test failed

#

check your conf file for syntax errors

lusty dew
#

Still doesn't work @topaz fjord

#

I reinstalled it

topaz fjord
#

@knotty steeple send your nginx file

#

@lusty dew whats the error

knotty steeple
#
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    gzip off;
    server_name ip anotherip;
    proxy_set_header X-Real-IP  $remote_addr;

    location {
        proxy_pass http://localhost:3000;
    }
}
#

i dont

#

nginx much ok

quartz kindle
#

you're trying to use server in the nginx.conf file

#

instead of website.conf

knotty steeple
#

a

lusty dew
#
'node' is not recognized as an internal or external command,
operable program or batch file.
topaz fjord
#

did you restart after install

knotty steeple
#

its just for a

#

api

topaz fjord
#

the config is in /etc/nginx/sites-available/default

#

also

knotty steeple
#

what

topaz fjord
#

I recommend this for the location {}

#
location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        proxy_pass http://serverip:port/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header   X-Forwarded-Proto $scheme;
   }
knotty steeple
#

so uh

#

my config

#

goes in /etc/nginx/sites-available/default

topaz fjord
#

yes

#

also

#

server_name is the domain

knotty steeple
#

i know

#

so

#

what do i put in nginx.conf

topaz fjord
#

nothing

#

you keep it the way it is

knotty steeple
#

but then it still

#

fails

topaz fjord
#

what does it say

knotty steeple
#

Dec 21 13:45:10 ajhasavps nginx[18284]: nginx: [emerg] "server" directive is not allowed here in /etc/nginx/nginx.conf:2 Dec 21 13:45:10 ajhasavps nginx[18284]: nginx: configuration file /etc/nginx/nginx.conf test failed

topaz fjord
#

did you revert nginx conf back to how it was before

knotty steeple
#

how exactly do you do that

topaz fjord
#

you go into nginx.conf

#

and delete what you added

knotty steeple
dapper cargo
#

I'll wait till you guys are finished

topaz fjord
#

literally I put it layman's terms

#

sudo nano /etc/nginx/nginx.conf
then delete the server shit you added

knotty steeple
#

what the fuck

#

same error

topaz fjord
#

show me ur nginx.conf

knotty steeple
topaz fjord
#

why

#

did

#

you

#

delete

#

everything

knotty steeple
#

what

topaz fjord
#

show me ur nginx conf

knotty steeple
#

thats it

topaz fjord
#

there's nothing in it?

knotty steeple
#

exactly

topaz fjord
#

copy and paste this into your nginx.conf

dapper cargo
#

So i want to be able to launch a uri from a hyper link any ideas on how to do it? Anything i try does not work. The uri's are all stuff like spotify:track:3n3Ppam7vgaVa1iaRUc9Lp

#

So the uri's are ment to open applications

#

I cant figure out how to convert it to a usuable link

topaz fjord
#

the hyper links need to be https or http

dapper cargo
#

Thats the problem

knotty steeple
#

Dec 21 14:06:02 ajhasavps nginx[22089]: nginx: [emerg] unknown directive "ser" in /etc/nginx/nginx.conf:1

dapper cargo
#

I cant find a way to get a https/http that will redirect to the uri

#

I thought of using api's but i cant find any that would work?

topaz fjord
#

@knotty steeple show config in hastebin

knotty steeple
#

its ur thing

topaz fjord
#

still show it

knotty steeple
#

e

#

how

topaz fjord
#

hastebin

knotty steeple
#

how do you copy shit

topaz fjord
#

you highlight it

#

then it's copied to your clipboard

knotty steeple
#

while scrolling down

#

ok then

topaz fjord
#

you dont

#

I copy the top then copy the rest

knotty steeple
#

fucking

topaz fjord
#

what version of nginx

knotty steeple
#

uhh

#

idk

topaz fjord
#

oh wait

#

you see at the top

#

where it says

#

ser www-data

#

change ser to user

knotty steeple
#

ye

topaz fjord
#

so it's user www-data;

knotty steeple
#

typos

#

ok works

#

cool

#

Error: listen EADDRINUSE :::3000 PepePls1

#

how do i terminate whats using that port

#

porn

inner jewel
#

lsof -i :3000

#

then kill it

topaz fjord
#

also

#

natan

knotty steeple
#

huh

#

nothing

topaz fjord
#

doesn't this interfere with it

listen 80 default_server;
    listen [::]:80 default_server;
knotty steeple
#

but uh

#

tcp6 0 0 :::3000 :::* LISTEN -

quartz kindle
#

add ipv6 only

#
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
inner jewel
#

i've done that without issues in the past @topaz fjord

slim heart
#
if (command == "f") {
    if (!client.MisAdmin(message)) return;
    let arg1 = args[0]
    let arg2 = args[1]
    client.unloadFilter()
    let filterfile = JSON.parse(fs.readFileSync('./modules/filter/filter.json'))
    filterfile[arg1].push(arg2)
    fs.writeFile('./modules/filter/filter.json', JSON.stringify(filterfile), async (error) => {
        if(error) {
            message.reply(error)
            client.loadFilter()
            return;
        } else {
        client.loadFilter()
            .then(async (res) => {
                if(res == true) {
                    let msg = await message.reply(`Added ${arg2} to the ${arg1} key: ${filterfile[arg1]}`)
                    setTimeout(function() {
                        msg.edit(":boom:")
                        setTimeout(function() {
                            msg.delete()
                        }, 500)
                    }, 5000);
                    return;
                } else {
                    message.reply("Error: " + res)
                    return;
                }
            })
        
        }
    })
}```
What's wrong with this? It works, it does work most of the time in fact, but it ALWAYS throws this error in console:
`UnhandledPromiseRejectionWarning: TypeError: Cannot convert undefined or null to object`
And aswell as sometimes it just stops, it lags my entire bot and just stops literally every other function, the bot goes basically completely unresponsive for no exact reason. I would think that the console'd error has something to do with it so.
knotty steeple
#

let filterfile = JSON.parse(fs.readFileSync('./modules/filter/filter.json'))

#

idk

mossy vine
#

Oh my god no why are you loading the file every time

slim heart
#

It's not like im running +f 24/7 c

#

also samurai wdym

knotty steeple
#

look at that line

slim heart
#

whats wrong with it-

knotty steeple
#

oh idk

#

it cant find the file?

slim heart
#

it can

#

because like i said it works all the time

knotty steeple
#

whatever

slim heart
#

even when my bot goes unresponsive after that and even the error in console it still rewrites the file with the new stuff

#

but for some reason it still makes the error etc.

#

sooo...

tall gyro
#

Where do I ask wth am I to do when my bot gets declined 2 times for the same reason - a reason that wasn't a problem in the first place

knotty steeple
#

solve the issue

formal agate
#

they did that to me

#

they probably set perms wrong

#

my bot logged the entire thing

tall gyro
#

They told me my help command sucks but it tells everything it's supposed to

formal agate
#

lol

knotty steeple
#

ask the mod who declined it

#

and go to the right channel

formal agate
#

is it like 16 different messages?

#

or one?

tall gyro
#

It's one single message that explains the 3 commands it actually has interactions with

formal agate
#

ooof

knotty steeple
#

naming bots after yourself

formal agate
#

need to add perms to it tho

knotty steeple
#

anyways

formal agate
#

yes

knotty steeple
#
ask the mod who declined it
and go to the right channel
formal agate
#

im "creative"

tall gyro
slim heart
#

Husky u need to add descriptions to your commands

tall gyro
#

That's how it's help command works

slim heart
#

You can’t just have the command

formal agate
#

ik that @slim heart

slim heart
#

Obviously not

formal agate
#

lol

#

idc rn

#

you can "enter" the command and get more help

slim heart
#

Well you should care or else obviously you won’t get accepted

knotty steeple
#

thats not going to get it declined waitwhat

#

my first bot had the same looking help command

#

no description

slim heart
#

Ok samurai we know you’re special

formal agate
#

In js I'm trying to pull data out of the discord oauth. I've managed to pull the token from the "response" correctly. Now idk how to make a authorized request to receive data from the scope requested.

vernal rivet
#

Jpberry is right. If you don't put the description of the commands in the help command, then it's not going to help the user in anyway

slim heart
#

And oauth

#

This is fun

formal agate
#

yes

#

by fun you mean me pulling the hair out of my head kind of fun then yea

knotty steeple
#

yes im special

lusty dew
#

When you forget how to make a cmd handler

formal agate
#

omg

vernal rivet
#

Lol

formal agate
lusty dew
#

@formal agate Ikik

#

Im making jokes my dude

formal agate
#

lol

slim heart
#

Get the code, send it to your bots endpoint, bot makes authorized request with the code to discord, bot gets token in return, either bot use token and returns info or bot gives token in response, take token, store it, make requests, get info, bada boom bada bang oauth in a nutshell

inner jewel
vernal rivet
#

Lol

#

I like that joke

formal agate
#

@slim heart ik that, im trying to figure out how to pull data other then the "code" aka "token"

slim heart
#

No

#

Code is not token

#

No aka

formal agate
#

yes

slim heart
#

U use code to get token boi

formal agate
#

docs say

slim heart
#

Ok shutup the docs are dumb

#

Use the code

#

Request the token from discord

#

Receive token

vernal rivet
#

Code and token are two different things

slim heart
#

Make more request to discord

#

And get infos

formal agate
#

where do you request the token at then?

slim heart
inner jewel
#

you redirect user to auth page -> user authorizes -> gets redirected to yoru page with an oauth code -> you send a request to the token exchange endpoint -> discord gives you a token

#

that's for the regular oauth flow

formal agate
inner jewel
#

no

slim heart
#

W h a t

#

No

inner jewel
#

you send the code in the request body

formal agate
#

i just relized what i said

slim heart
#

Or request header

inner jewel
#

no

slim heart
#

Whatever u want

#

Yes

inner jewel
#

not in the header

slim heart
#

I do it and it works OwO

inner jewel
#

the code is sent in the request body for the token exchange endpoint

#

the TOKEN is sent in the headers for authorization

formal agate
#

k

slim heart
#

Oh yeah

#

Ok shush Ik I’m dumb

inner jewel
#

just read the example code

slim heart
#

Also you should be sending it back to an endpoint or something because don’t you have to have your clients id and token to make the request?

#

Cuz I just set my response to token and store the token cuz I’m lazy

#

btw @knotty steeple the answer to my question was that i was using readFileSync so i was using sync io which yeah yeah, and then I just had to make it .readFile() and add a callback instead and it worked so

misty rune
#

how do you handle reaction role and such ?

slim heart
#

on reaction give role

misty rune
#

do you store in db like id of message guild + id reaction = id role ?

slim heart
#

kind of simple...

#

well set which reaction gives which role and then when the user clicks the reaction it searches through the db, gets the role id, and gives it

misty rune
#

so idmessage + reaction id = role

#

basically

inner jewel
#

a table with message id, reaction id/unicode, role id would be enough

misty rune
#

nice cool thanks

#

just was wondering

tall gyro
#

So I've been looking and apparently the mod-log didn't even record my bot getting denied a second time Thonk

#

I instead just messaged the guy who denied it the first time

lusty dew
#
client.on("message", async message => {
    if(message.author.bot) return;
    if(message.content.startsWith(`@ripe burrow `) || client_settings.prefix){
        var command = message.content.slice(`@ripe burrow `.length).toLowerCase();
        var cmd = command.split(" ")[0];
        var args = command.replace(cmd+" ", "");
        var commandfile = commands.get(cmd);
        if(commandfile) commandfile.run(client, message, args).catch((e)=>console.error(e));
    }
});

Error: https://hastebin.com/uvapolujas.css

I have used this part in many of my bots why is it not working now?

quartz kindle
#

@slim heart in case you still have the problem you mentioned, you're mixing sync and async, which can cause it to try to load the file while its locked saving

lusty dew
#

Tim

#

Do you know what's wrong with mine?

#

I haven't gotten this error before

knotty steeple
#

good idea

#

read the error

lusty dew
#

I haven

#

Have*

#

I know commandfile.run isn't a function

#

but it has worked before

#

so why isn't it now?

knotty steeple
#

what is commands

earnest phoenix
#

would it be considered api abuse if I generate an invite for the servers my bot is in using a listserver command

lusty dew
#

I have a test command

#

so

quartz kindle
#

commandfile.run is not a function, which means that run was not found in commandfile, which means that commandfile is wrong or undefined, which means that commands.get(cmd) found nothing, which means that cmd doesnt exist or is not a valid command

lusty dew
#

test.js

#
const Discord = require('discord.js')

module.exports.run = async (client, message, args) => {
    message.channel.send('I AM ALIVE :joy:')
}

module.exports = {
    names: ["test", "t"]
}
#

That is inside the command file

knotty steeple
#

making server invites without the end user knowing is against discord tos

earnest phoenix
#

thanks

lusty dew
#

@knotty steeple That's what I have in my command file

#

test.js

#

Also

knotty steeple
lusty dew
#

Sorry for the pig

#

xD

#

O

quartz kindle
#

@_@

lusty dew
#

I didn't see what tim said

amber fractal
#

Ill take the pig if he doesnt want it

#

Sell it for some good cash

knotty steeple
#

but seriously no shitposting

visual zenith
earnest phoenix
#

I'm working on implementing A* Pathfinding into my bot and I have no clue how I'm going to visualise the node coordinates...

#

@visual zenith I can give you the code I use for my bots suggestion system

visual zenith
#

sure?

knotty steeple
#

rule 7

visual zenith
#

xD

earnest phoenix
#

wait what

quartz kindle
#

code looks fine

earnest phoenix
#

XD

visual zenith
#

??

earnest phoenix
#

does anyone have an answer to my question?

quartz kindle
#

what exactly is your question

earnest phoenix
#

well do you know how a* pathfinding works

#

it has a grid and it calculates the quickest way to dodge obstacles and get from point a to b

#

and it returns a bunch of coordinates

#

and i want to get those coordinates and put them in a grid or something

quartz kindle
#

so you already have the algorithm, you just want to make a drawing with it?

earnest phoenix
#

yea

lusty dew
#
client.on("message", async message => {
    if(message.author.bot) return;
    if(message.content.startsWith(`@ripe burrow `) || client_settings.prefix){
        let command = message.content.slice((message.content.startsWith(client_settings.prefix) ? client_settings.prefix : `@525815816411676673`).length)
        let cmd = command.split(" ")[0];
        let args = command.replace(cmd+" ", "");
        let commandfile = commands.get(cmd);
        console.log(command)
        console.log(commands)
        console.log(commandfile)
        if(commandfile) commandfile.run(client, message, args).catch((e)=>console.error(e));
    }
});

Error: https://hastebin.com/icoboxupeq.coffeescript

#

Command is undefined

#

that's what I got back from the console log

slim heart
#

.startsWith is a Boolean

#

Returns a boolean*

#

let command = message.content.slice((message.content.startsWith(client_settings.prefix) ? client_settings.prefix @525815816411676673).length) what even is this

#

Am I just not understanding that

#

@lusty dew

lusty dew
#

It is supposed to allow me to use both prefix and mention

slim heart
#

whatever i dont think its the problem

#

where are you defining commands

lusty dew
#

Full code

slim heart
#

Is it only when u run a specific/any command?

lusty dew
#

Right now I only have one command

#

Its a test command

#

when I do s-test

#

it throws the error

slim heart
#

ok whats the code in that file

lusty dew
#
const Discord = require('discord.js')

module.exports.run = async (client, message, args) => {
    message.channel.send('I AM ALIVE :joy:')
}

module.exports = {
    names: ["test", "t"]
}
slim heart
#

and whats the name of the file?

lusty dew
#

test,js

#

test.js

slim heart
#

hmmm

lusty dew
#

I don't understand it

slim heart
#

does it say "loaded" etc. etc.

#
console.log(`${f} loaded and ${inspect(props.names).replace("[","").replace("]","")} are the available aliases`);```
lusty dew
#

yes

slim heart
#

alright after fs.readdir do console.log(commands)

#

like after the whole callback etc.

lusty dew
#
test
{ names: [ 'test', 't' ] }
#

Thats what I got

slim heart
#

so it's not adding prop

lusty dew
#
Collection [Map] {
  'test' => { names: [ 'test', 't' ] },
  't' => { names: [ 'test', 't' ] } }
Senpai#5500 is online
{ names: [ 'test', 't' ] }
#

Thats the right one

#

My bad

#

I grabbed an old one

slim heart
#

still not adding props

lusty dew
#

yea

slim heart
#

try doing this

let props = require(`./commands/${f}`);
for(i=0;i<props.names.length;i++) {
 commands.set(props.names[i], props)
}```
#

the only thing i could think of is the foreach loop is causing a problem idk tho

lusty dew
#
fs.readdir("./commands/", (err, files) => {
    if(err) console.log(err);
    let jsfile = files.filter(f => f.split(".").pop() === "js")
    if(jsfile.length <= 0){
        console.log("Couldn't find commands.");
        return;
    }
    jsfile.forEach((f, i) =>{
        let props = require(`./commands/${f}`);
        for(i=0;i<props.names.length;i++) {
         commands.set('props.names[i]', props)
        }
        console.log(`${f} loaded and ${inspect(props.names).replace("[","").replace("]","")} are the available aliases`);
    });
    console.log(commands)

});
#

This is what you mean right?

#

or do I get rid of the jsfile.forEach thing

slim heart
#

dont use ' in the props.names[i]

#

also yes

lusty dew
#
fs.readdir("./commands/", (err, files) => {
    if(err) console.log(err);
    let jsfile = files.filter(f => f.split(".").pop() === "js")
    if(jsfile.length <= 0){
        console.log("Couldn't find commands.");
        return;
    }
    jsfile.forEach((f, i) =>{
        let props = require(`./commands/${f}`);
        for(i=0;i<props.names.length;i++) {
         commands.set(props.names[i], props)
        }
        console.log(`${f} loaded and ${inspect(props.names).replace("[","").replace("]","")} are the available aliases`);
    });
    console.log(commands)

});
#

Same error

#

commandfile.run is not a function

slim heart
#

same console.log() too?

lusty dew
#
Collection [Map] {
  'test' => { names: [ 'test', 't' ] },
  't' => { names: [ 'test', 't' ] } }
Senpai#5500 is online
slim heart
#

:/

#

i dont get it

lusty dew
#

I don't either

#

I have used this same code before

#

I don't know why it's having problems now

slim heart
#

i dont really know Discord.Collection() so i think its the same as every other one but idek

#

i know Enmap

lusty dew
#

oof

sick cloud
#

collections are just extended maps made by discord.js devs

lusty dew
#
const Discord = require('discord.js')
const client = new Discord.Client()
const fs = require('fs');
let inspect = require("util").inspect;
let commands = new Discord.Collection();
client_settings = require('./settings/bot.json')



fs.readdir("./commands/", (err, files) => {
    if(err) console.log(err);
    let jsfile = files.filter(f => f.split(".").pop() === "js")
    if(jsfile.length <= 0){
        console.log("Couldn't find commands.");
        return;
    }
    jsfile.forEach((f, i) =>{
        let props = require(`./commands/${f}`);
        for(i=0;i<props.names.length;i++) {
         commands.set(props.names[i], props)
        }
        console.log(`${f} loaded and ${inspect(props.names).replace("[","").replace("]","")} are the available aliases`);
    });
    console.log(commands)

});





client.on('ready', () => {
    console.log(`${client.user.tag} is online`)
})

client.on("message", async message => {
    if(message.author.bot) return;
    if(message.content.startsWith(`@ripe burrow `) || client_settings.prefix){
        let command = message.content.slice((message.content.startsWith(client_settings.prefix) ? client_settings.prefix : `@525815816411676673`).length)
        let cmd = command.split(" ")[0];
        let args = command.replace(cmd+" ", "");
        let commandfile = commands.get(cmd);
        console.log(commandfile)
        console.log(commandfile.run)
        if(commandfile) {
            commandfile.run(client, message, args).catch((e)=>console.error(e));
    }
}
});



client.login(client_settings.token)
#

It says commandfile.run isn't a function I still can't figure it out

quasi hearth
#

I've been having this strange issue where my not apparently seems to keep disconnecting and relogging very often. Does anyone know why this happens?

lusty dew
#

@sick cloud Can you help?

quasi hearth
#

Do your commands file have a run function?

lusty dew
#

Yes

#
const Discord = require('discord.js')

module.exports.run = async (client, message, args) => {
    message.channel.send('I AM ALIVE :joy:')
}

module.exports = {
    names: ["test", "t"]
}
sick cloud
#

why did you mention me

lusty dew
#

Thats the command file

#

I can't figure out why it says commandfile.run isn't a function

bright spear
#

Don't randomly mention people

lusty dew
#

I have asked many people

#

did what they said

#

still keeps popping that error

#

Also sorry

earnest phoenix
#

what lang is it

lusty dew
#

It's discord.js

earnest phoenix
#

k

#

what are you coding it on

lusty dew
#

VS code

earnest phoenix
#

k

#

uhh

#

gimmie the code

quasi hearth
#

See above for the code

earnest phoenix
#

k

lusty dew
#

Yea

#

Its above

earnest phoenix
#
const Discord = require('discord.js')

module.exports.run = async (client, message, args) => {
    message.channel.send('I AM ALIVE :joy:')
}

module.exports = {
    names: ["test", "t"]
}

this?

lusty dew
#

no

#

the one above i

#

it(

earnest phoenix
#

k

lusty dew
#

**

earnest phoenix
#

wtf is this

#
if(message.content.startsWith(`@ripe burrow `) || client_settings.prefix){
lusty dew
#

Its so you can use either Prefix or mention

earnest phoenix
#

you want it so when they type just the prefix it is gonna send a message? wtf

lusty dew
#

Hm?

quasi hearth
#

I'm not sure, but I don't think the code is actually running the file, but rather setting the value as strings instead of an object? Does the send commands work?

earnest phoenix
#

nvm

quasi hearth
#

Debugging...

lusty dew
#

^

#

I made a test command

quasi hearth
#

Do your send commands work?

lusty dew
#

to make sure everything else works

quasi hearth
#

/test command?

lusty dew
#

and it doesn't work

earnest phoenix
#

oh

lusty dew
#

yea

earnest phoenix
#

i see

lusty dew
#

s-test

#

does't work

earnest phoenix
#

uhh why are you using a discord collection

quasi hearth
#

Try logging the type of the thing

earnest phoenix
#

its a collection

lusty dew
#

@earnest phoenix HM?

#

Hm*

earnest phoenix
#

commands is a collection

lusty dew
#

Yea

#

I know

earnest phoenix
#

uhh why?

quasi hearth
#

It may be that your code is saving it as a string instead of an object

earnest phoenix
#

im pretty sure a collection is similar to an array, not an object

#

but you are treating it like an object

#

not sure though im not familiar with discord collections

lusty dew
#

Idk

#

I have used the code like it is before and it worked fine

earnest phoenix
#

also a collection doesnt have the set property

lusty dew
#

I don't know why it is acting like this now

earnest phoenix
#

^^

quasi hearth
#

Oh

#

I know

#
module.exports.run = async (client, message, args) => {
    message.channel.send('I AM ALIVE :joy:')
}

module.exports = { //this overwrites the run.
    names: ["test", "t"]
}```
earnest phoenix
#

what

quasi hearth
#

on the first line, module.eports is an object with "run" as an async function

#

the next line sets module.exports to only have a names array in it

earnest phoenix
#

k

quasi hearth
#

removing the run function

#

fix @lusty dew :

module.exports = {
    run: async (client, message, args) => {
        message.channel.send('I AM ALIVE :joy:')
    },
    names: ["test", "t"]
}```
earnest phoenix
#

k

bright spear
#

A collection is an extended js map

lusty dew
#

@quasi hearth It still doesn't send I AM ALIVE 😂

uneven depot
keen drift
#

stealing that sc

#

thanks

quasi hearth
#

@lusty dew hmm. What is the log output when trying to run the command?

slim heart
#

nono wait @lusty dew @quasi hearth was onto something keep all of your original code but on the bottom part do

module.exports.names = ["test", "t"]```
#

ur defining module.exports.run but when you do module.exports = {} again, it just clears out that original run because its rewriting the object

keen drift
#

My current challenge is horizontal scaling (scaling across machines), as vertical scaling has become inefficient both budget and performance wise.

My initial impression and idea is to uses k8s (Kubernetes) to deploy my bot clusters. But part of v2 has a centralized API for a dashboard interface. But that’s going to be difficult as cache or data is scattered around nodes and I would have to use a centralized method like a message broker (rabbitmq/nats/etc.) to retrieve them.

One of my concern with that is the availability in case one node goes down; then partial API requests will fail. This is especially prominent when restarting for maintenance or to reshard.

Looking at most databases, the most common method of horizontal scaling is sharding and replication. So one of my idea is to create an abstraction router layer that forwards events and acts as RPC layer for data requests, effectively allowing replica sets per shard. But that seems like an impossible feat at my skill level and timeline. So, the other idea was to piggyback off redis for their method of distributed and replicated cache, and the API would query Redis for data instead of through my message broker. While this does work, I’m also concern on how I should invalidate the cache, say if a shard goes offline, then a guild removed the bot, the redis key would remain w/o knowing it has no use anymore. One idea was to format the redis key so that it would look like shard:x:data-type:data-id, then purge all data associated with that shard and repopulate with gateway provided data but seems unnecessarily hacky.

Then I came across something like FredBoat/sentinel (https://github.com/FredBoat/sentinel), which acts as a router to children bot nodes, which I have no idea what purpose it’s serving. It’s still scattering the data when the sentinel is sharded. Can’t find much, still a WIP repo and I don’t do Java /shrug

spark leaf
#

You probably have already considered Redis, but mentioning it regardless in case you didn't ^^

#

I think you can have decentralized Redis, as in you don't need to use its hierarchy feature

uneven depot
#

maybe can do something like guild-id:data-type:data-id as a key, then invalidate based on calculated shard id

#

or maybe include shard count along with shard id, since changing the count will also change the ids

modern aurora
#

Hi

coral trellis
modern aurora
#

@coral trellis

bitter sundial
#

@modern aurora reset your token

#

you just showed it to everyone

harsh acorn
#

lol

modern aurora
#

Yes @bitter sundial but wats rong with iT

harsh acorn
#

what error is it throwing

modern aurora
#

Kaden i Will invite you privé 1 sec

harsh acorn
#

what error is it throwing ?

modern aurora
knotty steeple
#

pro tip

#

dont code on mobile

earnest phoenix
#

Hello? I was wondering if you guys could help me, I need to make a premium pais system I thought of doing it through role but I am not sure how you can get the roles of a certain server, thanks :0

knotty steeple
#

pais?

misty rune
#

Paid

earnest phoenix
#

Sorry

bright spear
#

Also the token is like your bots password so now anyone can log in as your bot and do anything including destroy servers @modern aurora

knotty steeple
#

and what library

#

always say what library you using

#

if its for bots

earnest phoenix
#

discord.js

knotty steeple
#

do you know how to get a certain guild

earnest phoenix
#

Wdym?

bright spear
#

Guild = server btw

earnest phoenix
#

Ik

bright spear
#

So you do know how to get a certain guild

#

By id or whatever

earnest phoenix
#

By

#

Id?

#

Yeah

bright spear
#

So once you have the guild iirc guild.roles is a collection of the roles

earnest phoenix
#

ok

knotty steeple
#

you can find the role by name

bright spear
#

Did u read the docs first?

earnest phoenix
#

Yes

#

I am just stuck

bright spear
#

On what part though

earnest phoenix
#

Wait, one second.

#

if (!message.member.roles.has(role)) return message.channel.send(premiumMessage)

#

const guildID = client.guilds.get("518346817558151181");
const role = guildID.roles.find("name", "Premium User")

#

But it just doesnt seem to work

knotty steeple
#

thats not how you find a role

#

use a function

#

in the find

#

guildID.roles.find(r => r)

earnest phoenix
#

Hmm

knotty steeple
#

r has the name property so you can check if that is equal to the role you want

earnest phoenix
#

Ok, thanks

#

So

#

guildID.roles.find(name => Premium User)?

knotty steeple
#

no

earnest phoenix
#

Welp

knotty steeple
earnest phoenix
#

Thanks

#

Im so baffed 😦 sorry

jagged plume
#

the arrow function gives you each role object, and you want to check each role object's "name" property

#

hence role =>

earnest phoenix
knotty steeple
#

yes

jagged plume
#

exactly

earnest phoenix
#

OKkk thanks so much

#

😃

knotty steeple
#

are you using that to check if someone is premium

earnest phoenix
#

Yes? Do you have suggestion of a better way?

knotty steeple
#

that system can fuck up sometimes if discord decides to take a shit

earnest phoenix
#

oh

#

Thats bad

knotty steeple
#

you can store premium user ids in a database

earnest phoenix
#

my sql?

#

Or equivalent

knotty steeple
#

yes

#

any database

#

but i also use mysql peepoMmmYea

jagged plume
#

that has the added benefit of storing extra information like expiry dates if you choose to add it

#

definitely a better way of doing it

earnest phoenix
#

Ok thanks :0

#

Do you have any places where I can learn the basics, I have never touched sql before?

knotty steeple
#

just google learn sql

earnest phoenix
#

ok cool thanks

quartz kindle
#

if you're not familiar with sql, you could also try a nosql database, which is more javascript friendly (.set() .get() instead of "SELECT N FROM TABLE")

knotty steeple
#

here is a sample
SELECT items FROM table

earnest phoenix
#

Ahhh @quartz kindle Something like this? const talkedRecently = new Set();

quartz kindle
#

nope

#

database.set(key, value)

knotty steeple
#

i used sets for my daily cooldown 😩

earnest phoenix
#

Same

#

lol

#

Thanks guys

quartz kindle
#

regardless, there are literally thousands of databases out there

#

good luck picking one lmao

earnest phoenix
#

Lmao

#

bye

quartz kindle
#

i'v been thinking about it for months and still havent decided for one

knotty steeple
#

1st is mysql

#

second is sqlite

#

third is a website to learn sql

jagged birch
#

sequelize is good

keen drift
#

@uneven depot that's rather expensive, my original proposal is just store the shard id and invalidate itself upon new data

#

@spark leaf Yes I did bring up redis in my original statement and the problem that comes with that route

inner jewel
#

@keen drift fredboat sentinel is just so restarts are faster

#

because the ws connections aren't dropped

topaz fjord
#

Quick question

#

Is there a way for LL to send the audio stream to two places at the same times

#

I need your expertise natan

inner jewel
#

no

brittle nova
#

Is there a shorter way of doing mongo.db('databaseName').collection('collectionName')?

topaz fjord
#

@inner jewel is there another way besides using LL

inner jewel
#

¯_(ツ)_/¯

#

sending from one source to multiple destinations isn't impossible

#

just that no one bothered doing it

#

actually

#

lavaplayer has something that does exactly that

topaz fjord
#

o h

#

because I wanted to make a dashboard that lets you continue the playing song

inner jewel
#

so you want to send the audio to the browser?

topaz fjord
#

yes

inner jewel
#

you're out of luck then

#

you'd need a custom LL-like thing

#

and implement the audio -> browser yourself

topaz fjord
#

but then again copyright is a thing and I don't want to deal with that

elder cloud
#

Hi

west raptor
#

hi

normal wyvern
#

Hi, if loopTime = 200 in the above code then is it bad idf 1k members run this code /\

queen violet
#

why would 1k people start a match

knotty steeple
#

what kind of editor

#

makes this kind of indentation

normal wyvern
#

@queen violet Scrims

#

Hi, if loopTime = 200 in the above code then is it bad idf 1k members run this code /\

queen violet
#

scrims?

normal wyvern
#

ye

#

DW

queen violet
#

the fuck are scrims

normal wyvern
#

PLS ANSwer my questin

knotty steeple
#

pls answer his question

earnest phoenix
#

Hello

queen violet
#

its not gonna work if im understanding this right

earnest phoenix
#

Who need help

queen violet
#

you made a timeout for every 60 seconds

queen violet
#

that removes 1 from a value

mossy vine
#

fortnite scrim = joining a certain fortnite match

normal wyvern
#

Hi, if loopTime = 200 in the above code then is it bad idf 1k members run this code /\

queen violet
#

and youre looking for when that time is 200

normal wyvern
#

ITS NOT ONLY FOR FORTNUTE LMAO

knotty steeple
#

stop repeating yourself

normal wyvern
#

any gam where you can ready up and see game identifier

mossy vine
#

can someone mute this kid plz

queen violet
#

stop repeating the messages

#

and fucking

#

listen to me

#

jesus

mossy vine
#

still wouldnt work

normal wyvern
#

Anywas, does anyone know if tht pastebin wold be bad if 1k people used at same time?

mossy vine
#

you do know that you cant join games that are already in progress, right?

queen violet
#

in the same computer? maybe

#

but if everyone is supposed to run ont heir computer

normal wyvern
#

forget the concept would it be bad?

queen violet
#

theres no universal computing limit

mossy vine
#

yes

queen violet
#

thats not how computers work

normal wyvern
#

omg, If 1k people run that code from my server / computer and loopTime = 1500 would that be bad/

#

@queen violet

#

sorry didnt see ya

knotty steeple
#

look

#

most of the time no one knows what you are saying

#

repeating it again and again isnt helping

mossy vine
#

hell i still dont even understand what he wants

queen violet
#

why the hell

#

do you not just

#

make a list

#

and when 100 entries are on that list

#

you look for a match

#

you dont need to timeout and do all this stuff

normal wyvern
#
  1. If i had 1k people running that pastebin all at the same time, and the loopTime was equal to 1500, would that be bad on memory? What would be a good memory for that?
knotty steeple
#

man if my rpg bot was like this it would go to hell

queen violet
#

also fortnite matches are limited to 100 people

#

not 1k

normal wyvern
#

Omg thats not thwe scrims part can people just answer that question because you will not understand wholely

queen violet
#

also this is against epic games tos

#

dude

normal wyvern
#

THIS IS JUST TO RERUN A MATCH THIS IS JUT AN EXAMPEL

#

Hi, if loopTime = 200 in the above code then is it bad idf 1k members run this code /\

queen violet
#

test it yourself we cant know if its gonna run well

mossy vine
#

can someone please

normal wyvern
#

OMg, i mean will it be bad on memory?

queen violet
#

of course it will

#

1000 timeouts will never be good on memory

knotty steeple
#

learn how to make good

#

and optimised

#

code

queen violet
#

^

#

thats what im trying to teach you

#

have matchfinding in my bot

#

tho not for fortnite

normal wyvern
#

OMG I HAVE A CODE FOR THE MATCH PART THIS IS EOMTHING ELSE

queen violet
#

and it doesnt use 200 timeouts

#

then what the hell is this for?

normal wyvern
#

its setInterval

queen violet
#

????

normal wyvern
#

not timeout

#

Can you please acuutally read the code

queen violet
#

jesus fucking christ i already told you

normal wyvern
#

waht?

queen violet
#

timeout = setInterval

normal wyvern
#

ok

#

youre the same guy?

#

ok

queen violet
#

🤦 ok im done

loud salmon
knotty steeple
normal wyvern
#
let time = 1200
let timeInterval = setInterval(() => {
        if (time === 1){
            
          clearInterval(timeInterval)
        }else {
          time -=1;
        }
      }, 60000)
queen violet
#

yes running that 200 times will be bad on memory

#

also will take 60 times longer than youre thinking probably

knotty steeple
#

and bad on reputation

normal wyvern
#

It works tho

loud salmon
#

so does a fork bomb

knotty steeple
#

not everything that works is good

queen violet
#

its gonnat ake 1200 minutes

#

not 1200 seconds

normal wyvern
#

ok read above code?

queen violet
#

you do realize right

normal wyvern
#

I updated it

loud salmon
#

we did

#

please

knotty steeple
#

i can have the shittiest code

#

but it works

#

doesnt mean its good

#

i mean

queen violet
#

explain something to me

normal wyvern
#

OK, what should be the maximum amount of people running tat code abive?

#

on 2gb?

queen violet
#

we dont know your ram

#

and were not calculators

knotty steeple
#

how about

#

you use

#

1 timer

queen violet
#

^^^ ^^

knotty steeple
#

and learn to write better looking code