#development

1 messages · Page 1277 of 1

honest perch
#

Why not

opal plank
#

good luck getting verified with undocumented features

indigo flax
#

That seems like a lot of work to make the status online on a phone

honest perch
#

Discord is a stable platform

#

All I gotta say

opal plank
#

its in the identification/gateway payload

#

@honest perch go to a diff channel, this isnt for trolling

indigo flax
#

Not Erwin wernet u a mod

opal plank
#

ive never been a mod here

#

too much effort

unique patio
#

I use nodejs apps on my phone to ho st my bots.

#

It's very easy, not sure with iphones however don't own one.

#

Write like how you would in visual studio code or whatever you use, make your package.json through npm init; upload your files set the server up and boom.

#

Phones do great for up to 1,000 people.

#

sometimes more

honest perch
#

@opal plank not trolling

opal plank
#

@honest perch i have explained why you shouldnt do it

#

first, you are modifiying a library, whcih 90% of the cases here, people dont know what they are doing

#

second, you are modifying it to use an undocumented feature

#

third, using undocumented bits of the api might lead to punishment and will likely get you denied in verification

#

they are undocumented for a reason

honest perch
#

It would of been patched if they cared

opal plank
#

its not 'patched'

honest perch
#

Just like the bot streaming feature

#

They patched it in like a week

opal plank
#

you seem to not understand the reason why stuff is undocumented in the api

#

its to be used by the client

#

its not for general use

sinful thistle
#

Why are we here Just to Suffer

opal plank
#

its against TOS to be using undocumented stuff

#

while they dont care in most cases, you'd be using it for a public bot

honest perch
#

I mean activity "5" isn't documented but I dont see it being bad

opal plank
#

if you wanna take the risk, go ahead and do it, im not encouraging users to use undocumented stuff, same way i dont condone people of using client mods

unique patio
#

As long as I can still send my bots in to broadcast FFMPEG and still XSS

#

That's all the bot I need.

opal plank
#

like i mentioned, its your opinion, you are more than welcome to ask a staff or someone higher up about it

unique patio
#

My one discord broadcasts like 20+ twitch streams all at once

#

diff channels

honest perch
#

"$browser": "my_library",

unique patio
#

Fun little promoting thing we got 😄

honest perch
#

So if I make a lib called iOS then can I use mobile status

#

Cause then its the libs name

opal plank
#

lib =/= mobile

#

first, there arent libs for mobile

#

not documented at least

#

you'd be using linux

honest perch
#

Yes but my_library should = name right?

#

The status is based on the client browser

unique patio
#

Ohhh mobile status, you can do it but you need to access gate-way differently. I've done it and rate-limiting is exceeded fast under these parameters.

#

Discord doesn't allow it to affectively go down,

opal plank
#

like i said dude, you are more than welcome to raise a ticket here if you wish, im not a staff and im abiding by the TOS,
https://github.com/discord
feel free to go bother them, im not here to argue with you

GitHub

A new way to chat with your communities and friends. Discord is the easiest way to communicate over voice, video, and text. - Discord

unique patio
#

I was doing it for a JS project a while back it's not smooth at all

#

I had to XHR all my requests to and from to gain access, rewrite library like they were saying to find it's poop city.

#

They give the BOT api for a reason to monitor/allow these usages

#

Idea is cool-ish depending on your means my case was re-theming a site but also with the XSS hosting bot, all in browser it was a tad abusive.

fringe jungle
opaque hawk
#

Hi guy

#
const peoples = message.member!.voice.channel.members;

return message.channel.send(`
The following people have been rickrolled: ${message.channel.send(peoples.map(guildmember => guildmember).join('\n))}
`);```
dense nest
#

I made an api

opal plank
#

@fringe jungle evaluation works in js, you cant precompile it

opaque hawk
#

That’s what I told him

opal plank
#

also thats correct, map doesnt exist on collection

#

Discord Collection extends map

fringe jungle
#

sigh

opaque hawk
#

:d

opal plank
#

trust you IDE

#

it wont tell you wrong stuff 99.999% of the time

opaque hawk
opal plank
#

if it says something, believe it

opaque hawk
#

Sometimes the errors lag and there will be correct syntax highlighted for a completely unrelated reason so you have to refresh the page and wait for it to go away

sudden geyser
#

it wont tell you wrong stuff 99.999% of the time
@opal plank JavaScript would like to have a word with you

opaque hawk
#

XD

unique patio
#

For eval like in JS/Node; I'd do something like this

if (typeof functionarray[nameofvariable] == "function") {
     functionarray[nameofvariable](arg1, arg2);
 }

let functionarray = {
test: () => {
console.log("you passed test through");
}
};

for fun "eval like" you can set nameofvariable like so

let nameofvariable = `test`;
let nameofvariable = `test_${newvariable}`;

#

You could load up thousands of functions like this and have a complexity rating of 5-20~

#

Big lolz

opal plank
#

@sudden geyser you misread the part where they mentioned typescript

sudden geyser
#

high level javascript

unique patio
#

😄

#

Fun little tricks that beat the jsbench.

opal plank
#

im currently trying to make my own typescript api

#

its working, though its very basic

#

gonna use that as middle ground for the dashboard

earnest phoenix
#

How can I get the participantId of a json file named "aproxthethat"?

{
  "participantIdentities": [
    {
      "participantId": 1,
      "player": {
        "platformId": "TR1",
        "accountId": "5vqU8LNi2dZHaXIvfUmFwOZCXmWqP-NmEfrsRdxZW66JzaL6vP6Qb5TA",
        "summonerName": "FiddleSticks0",
        "summonerId": "R65nvvCPD_DJYxdciOZBcbP8KW9dME71Y9rh3k7xMQP7neo",
        "currentPlatformId": "TR1",
        "currentAccountId": "5vqU8LNi2dZHaXIvfUmFwOZCXmWqP-NmEfrsRdxZW66JzaL6vP6Qb5TA",
        "matchHistoryUri": "/v1/stats/player_history/TR1/2425255479341888",
        "profileIcon": 4568
      }
    },
    {
      "participantId": 2,
      "player": {
        "platformId": "TR1",
        "accountId": "gKXPhNTNeYEttj-xV9AWziRs6eDCGyWfxvxDiar4j4FpxIW23KGn9GKc",
        "summonerName": "aproxthethat",
        "summonerId": "ug1XDV8d5Bh4M6CmTiQVfvT7Gi4953SOnDrnKpKByaq9ouo",
        "currentPlatformId": "TR1",
        "currentAccountId": "gKXPhNTNeYEttj-xV9AWziRs6eDCGyWfxvxDiar4j4FpxIW23KGn9GKc",
        "matchHistoryUri": "/v1/stats/player_history/TR1/2033771425100256",
        "profileIcon": 4655
      }
    }
  ]
}
unique patio
#

JS?

earnest phoenix
#

yeah

unique patio
#

const randomname = require('directory to json');

randomname.player

#

but your structure is different so it needs accessing differently.

#

so you'd start at participantIdentities[0].participantId === ID

#
let len = randomname.length;
for (var i = 0; i < len; i++) {
  if (participantIdentities[i].participantId === id) {
    // do something
   }
}
earnest phoenix
#

I guess I misunderstood.
summonerName = I want to get the participant ID of "aproxthethat"

unique patio
#

Okay so same thing

quartz kindle
#

you want to get the id from a summoner name?

earnest phoenix
#

yeah tim

quartz kindle
#

use array.find()

unique patio
#
let len = randomname.length;
for (var i = 0; i < len; i++) {
  if (participantIdentities[i].player.summonerName === name) {
    // do something
   }
}
#

ezpz

sudden tulip
#

how do i ban someone

unique patio
#

You can run a break after done looping if that's all you need done too @earnest phoenix

sudden tulip
#

regardless of role status

#

in discord .js

unique patio
#

member.ban();

#

But you need authority to do so, or it returns error.

sudden tulip
#

will that do regardless of role satus

spark anvil
#

Good morning

unique patio
#

Well if you're a everyone role, and trying to do it to admin

#

Nah.

#

You get an error from discord, but if allowed to it will

sudden tulip
#

say im a admin trying to ban another admin

#

for reasons

#

dont ask

quartz kindle
#

your bot can only ban members with lower roles than your bot

unique patio
#

Yeah nope

sudden tulip
#

damn

unique patio
#

Role priority it's explained in the servers role too when making them.

#

IF your bot will ban any violator regardless of role, you could run a try catch, for the cases they can't be banned it'll dismiss it and let you know why.

sudden tulip
#

what abt a command

#

where i do !!echo [text]

#

how do i do that in js

#

ik in c# and py

unique patio
#

You get a message emit from discord when you are ready.

sudden tulip
#

the bot will echo the text

unique patio
#

(have authed/logged in); you can take the received messages and process them accordingly.

sudden tulip
#

!!echo hi

#

bot msgs

#

"Hi"

unique patio
#
client.on('message', (receivedMessage) => {
receivedMessage.channel.send("I got something can you get the rest?");
});
sudden tulip
#

thats not what i mean

#

!!echo

#

will literally echo the text

unique patio
#

I gave you the first part to the solution thus, "can you get the rest?".

warped fjord
#

hi

unique patio
#
if (receivedMessage.content.startsWith("basic check")) {
// do something

}
sudden tulip
#

omg

#

i think there is a misscommunication here

unique patio
#

There's no spoon here

#

that's all

#

😉

sudden tulip
#

đŸ„„

unique patio
#

Can't feed you a full solution from nothing.

sudden tulip
#

i dont want to check if it starts with

#

i want the command to echo the args

unique patio
#

Oh that's more specific

sudden tulip
#

Person: !!echo test test

unique patio
#

You need to split it then and strip the prefix

sudden tulip
#

Bot: test test

unique patio
#

Imagine this

    Command.Check(receivedMessage);
#
function Check(receivedMessage) {
    var splitCommand = receivedMessage.content.substr(1).split(/\s+/);
    // Command Check
    try {
        if (typeof PublicCommands[splitCommand[0].toLowerCase()] == "function") {
            PublicCommands[splitCommand[0].toLowerCase()](splitCommand.slice(1), receivedMessage);
        } else if (typeof Aliases[splitCommand[0].toLowerCase()] == "function") {
            Aliases[splitCommand[0].toLowerCase()](splitCommand.slice(1), receivedMessage);
        }
    }catch (e) {
        console.log("ERROR", e);
    }
}
#

substr(1) removes 1 letter from beginning, that's if it's matching prefix of coarse. No other time!

#

.split(/\s+/) splits the string into an array based on \s+ which is spaces newlines

#

splitcommand[0] is our command after the prefix sent to slot 0

sudden tulip
#

im going to provide c# code

#

that does the exact same thing

#

1 sec

#

lemme open vs

unique patio
#

in JS it's just .substr(1).split(/\s+/) and accessing your array accordingly but making sure to check if it's a command to split by doing a prefix check.

sudden tulip
#

😐

#

the echo command will just make the bot repeat everything after !!echo

#

!! being my prefix

#

echo is the command

#

any text after echo

#

will be the text the bot responds with

#

i have this same thing in c#

#

i gotta find the class file

quartz kindle
#

check if command starts with prefix, then check if command is echo, then remove the prefix and the command from the string, and send the rest

unique patio
#
client.on('message', (receivedMessage) => {
if (receivedMessage.content.startsWith("!!")) {
    var splitCommand = receivedMessage.content.substr(2).split(/\s+/);

    receivedMessage.channel.send(splitCommand[1]);
}
});
#

I explained this

#

it's no easier than that.

#

I tap out

sudden tulip
#

i think its a miscommunication

unique patio
#

Miscommunication = provide full answer?

stoic stirrup
#

Is glitch good to use for a bot? I dont know really ANYTHING about bots so idk

sudden tulip
#

@unique patio ty

#

now i want to restrict it to ids

unique patio
#

You can figure that out

#

if you know C#

#

Can't copy and paste it all.

sudden tulip
#

fairpoint

unique patio
#

That structure there should be all the spicey noodles you need

#

to get it working and deciphering your users input

quartz kindle
#

that code will only send the first word, not all words

unique patio
#

It's a demo

quartz kindle
#

yes, just for him to know, in case hes copy pasting

unique patio
#

^ yeah

#

fair

sudden tulip
#

fuck

#

welp

#

time to google

unique patio
#

[index] of the split

#

Just know how the codes work and you good

sudden tulip
#

😐

unique patio
#

Expanding is fast from here, spend an hour

sudden tulip
#

its that simple

unique patio
#

It is that simple

sudden tulip
#

wow

quartz kindle
#

also, make sure you account for prefix length in the substring, so its not hardcoded

unique patio
#

Yeah

#

100% substr minuses the length of string you set for prefix

#

That could be set differently, but most just use 1 so no fancy code needed to calc length of string

#

Adjust accordingly and you're off to the races

#

Well back to figuring out an adapter for this site login, gonna get messy with their auth required.

faint prism
#

if you know C#
@unique patio did someone say C# :)

sinful thistle
#

YES

sudden tulip
#

c# gang

sinful thistle
#

Any spanish people?

sudden tulip
#

si

#

jajajaj

modest crane
#

c# gang and spanish gang? nice

thin turret
#

spanish javascript gang

#

lista.paraCada(elemento => consula.escribe(elemento))

opal plank
#
if(taco == burrito) { no === speako() => {burrito})
coral trellis
#

Please keep this channel for actually providing support

forest drift
#

how would i make it so when a user sends for example #development the bot translates it into 272764566411149314?

#

discord.js

sick viper
#

language/pt

#

como faz isso??

forest drift
#

oh ok, so just like username mentions?

earnest phoenix
#

@swift umbra you

#

Did it work

#

Wrong

sick viper
#

/language pt

earnest phoenix
#

.id

#

not .getId()

sudden geyser
#

almost

forest drift
#

thanks

earnest phoenix
#

Almost right but not

sick viper
#

AlguĂ©m fala portuguĂȘs??

earnest phoenix
#

Ni

plucky latch
#

What is Bot's library ?

earnest phoenix
#

@swift umbra ya explain it for him please, ty

sick viper
#

Que ???????? NinguĂ©m fala portuguĂȘs?

earnest phoenix
#

Nao

#

@swift umbra explain itsDeigo what is a l8bary

sick viper
#

TĂĄ vou pegar o Google tradutor pra me ajudar kk

earnest phoenix
#

Si

#

ÂżCuĂĄl parece ser el problema?

#

@sick viper

#

ÂżestĂĄs ahĂ­?

sick viper
#

To

sage bobcat
#

One message removed from a suspended account.

sick viper
#

Que??????

sage bobcat
#

One message removed from a suspended account.

sick viper
#

Eu sou do Brasil

thin turret
#

đŸ‡ŹđŸ‡§đŸ—Łïž

earnest phoenix
#

opa linguagem errada desculpe

sage bobcat
#

One message removed from a suspended account.

thin turret
#

Thats spanish

sage bobcat
#

One message removed from a suspended account.

thin turret
earnest phoenix
#

Oque parece ser o problema

sick viper
#

I'm from Brazil

earnest phoenix
#

Oh you can talk english

#

Whats the problem

thin turret
#

nĂłs falamos inglĂȘs aqui

earnest phoenix
#

Guys

#

Hes not spanish

#

He speak portugeese

sick viper
#

I can't add my bot

earnest phoenix
#

Ah, ele enviou alguma mensagem de erro?

sick viper
#

Yes

thin turret
#

As a spanish speaker I can somewhat understand portuguese text but cant write it

earnest phoenix
#

VocĂȘ poderia me mostrar?

sick viper
#

@sick viper what's the problem?
@swift umbra I can't add my bot

earnest phoenix
#

VocĂȘ poderia me mostrar a mensagem de erro?*

sick viper
#

@earnest phoenix meu web nĂŁo carrega

#

Fica aparecendo que estĂĄ valid

earnest phoenix
#

Verifique se o seu firewall bloqueou a conexĂŁo

opal plank
#

English here

sick viper
#

Verifique se o seu firewall bloqueou a conexĂŁo
@earnest phoenix thanks

earnest phoenix
#

@opal plank i know

#

I am using google translate

opal plank
#

dont

earnest phoenix
#

Its development topic wdym

opal plank
#

not in english though

stark abyss
#

Comment:
Quick.db is a very trash db don't bother your time on it. It's not even saving the stuff correctly

sage bobcat
#

One message removed from a suspended account.

opal plank
#

*laughs in i told you to use postgres *

quartz kindle
#

i have no freaking idea what this br dude was on about

opal plank
#

he wants to add his bot to top gg

#

without a pint of clue of english

quartz kindle
#

but even his pt messages made no sense to me

sage bobcat
#

One message removed from a suspended account.

opal plank
#

its simple 'how to add bot to top.gg' related

earnest phoenix
#

@quartz kindle tim tim

quartz kindle
#

@_@

earnest phoenix
#

Can you make discord.js light sharding complatible with TS?

opal plank
#

Huh

#

any JS is valid in Ts

#

just make the interfaces

earnest phoenix
#

It doesnt accept JS file

quartz kindle
#

whats wrong with ts

opal plank
#

it du

#

enable it

earnest phoenix
#

In new SgardingManager

#

@opal plank i did

opal plank
#

"allowJs" = true

quartz kindle
#

you cant use ts files in the sharding manager

#

not even in djs

earnest phoenix
#

yeah

#

Can you make it complatible?

quartz kindle
#

nope

earnest phoenix
#

Awh

opal plank
#

i have no idea what you guys talking about

#

just wirte it in tsc and transpile it

quartz kindle
#

a ts file is uncompiled code, you cant run a ts file

#

you cant do node file.ts

earnest phoenix
#

Oh lol

opal plank
#

thats what im on about

quartz kindle
#

all ts files must be compiled to js before being able to run

opal plank
#

^^

earnest phoenix
#

I am fucking dummie

opal plank
#

all good

#

bruuuh making api's in ts harder than i though

#

being 3/4th s of a bottle down doesnt help either

quartz kindle
#

whats so hard about it?

opal plank
#

the whole learning

#

i havent had the chance to play with api's much in-depth

#

so playing with body, request, middleware, css, php and all the sorts its quite new stuff for me

earnest phoenix
#

Same

quartz kindle
#

i want to move all my web shit from php to js, but im too lazy...

opal plank
#

lemme know if you want to have some fun with me

quartz kindle
#

you're using ts so no thx

#

:^)

opal plank
#

Koa seems to be quite powerful

#

its the same and you know it

#

its just that i type my objects

quartz kindle
#

who needs typing

opal plank
#

who needs bugs?

quartz kindle
#

i dont have bugs :^)

opal plank
#

me neither|| lies||

quartz kindle
#

all my bugs are discord.js's fault

opal plank
#

all mine are twitch-js

quartz kindle
#

f

opal plank
#

so up until now we on the same field

#

still kinda annoyed that i havent recieved a reply in a few days

#

went out of my way to simplify my code and add it to a private repo to give to the authors and havent got a reply in a few days

opaque eagle
#

So I'm trying to port over some node code that uses the ws npm module to the browser, using the native WebSockets API in the dom. But, I'm stumped on this part. How can I mimic the second two parameters of websocket.send() (options and callback).

zenith knoll
#

The user aborted a request.

#

uh

sand mason
#

how to keep the music bot 24*7 in vc ??

zenith knoll
#

dont make it leave

opal plank
#

why the heck would u keep it 24/7 in a vc?

thick gull
#

groovy clone

#

just dont go offline ?? ?

opal plank
#

anywhoozels

#

back to screeching at API

sand mason
#

why the heck would u keep it 24/7 in a vc?
@opal plank to make the vc in use

opal plank
#

but why

sand mason
#

just dont go offline ?? ?
@thick gull wdym

thick gull
#

is it your bot

#

like your code

opal plank
#

<channel>.join()

#

thats it

#

dont leave

#

10/10

thick gull
#

yea

sand mason
#

tnx

opal plank
#

you welcome, i guess?

zenith knoll
#

The user aborted a request.

sand mason
#

đŸ€Ł

zenith knoll
#

?

#

what does that mean

clever dust
#

try to reconnect

fluid basin
#

@opaque eagle why do you need those options and callback in a browser context? The internal websocket implementation in the browser will handle packet sending, and therefore does not have a callback.

If you want to increase code reuse, you can create your own class wrapper around the native WebSockets impl yourself and overriding the send method to include those parameters

opaque eagle
#

oh alright

zenith knoll
#

helkpo

#

i get this error

#
at RequestHandler.execute (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:107:21)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:11) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
clever dust
#

restart the application or wait a few minutes then restart again

opal plank
#

OOOOOOOOOOH

#

bruh this is so janky

#

wtf

fluid basin
#

@quartz kindle make your own fork of d.js instead of only d.js-light

#

problems solved

opaque eagle
opal plank
#

just make Discord 2, problem solved

fluid basin
#

@opaque eagle ping is another low-level function that is not exposed by the browser API if I'm not wrong

opaque eagle
#

oh alright

opal plank
#

I really wonder if theres a good way to use apache with typescript

fluid basin
#

the browser only provides an abstraction on top of the websockets

opal plank
quartz kindle
#

i dont wanna make a fork, otherwise i'll have to update it myself when discord changes shit

opal plank
#

so i dont have to recompile code

quartz kindle
#

i rather have the djs team do the discord api updates for me

opaque eagle
#

i'm technically working in deno but it's the same WebSockets api with the same methods and stuff, so I just say dom

fluid basin
#

you can always rebase mmulu

opal plank
#

i can relate

#

its much better to let other people do the work

quartz kindle
#

constantly rebasing would be a pain lol

opal plank
#

its not lazyness, its just 'future proofing' by pushing onto non lazy people

fluid basin
#

hrm fair enough

opal plank
#

AAAAAAAAAAH

#

fricking api i swear to god

#

What type is even a response?

fluid basin
#

@opaque eagle if you want to use ping with extra data, you will need to implement your own protocol for that

quartz kindle
#

a response class instance

#

which extends a readable stream

opaque eagle
#

oh ok

opal plank
#

hmmm

#

lemme see if i can find that

#

im just setting any rn which is absurdely idiotic on my end

#

it has body, response, headers, request, params, holy shit

quartz kindle
#

is that koa?

opal plank
#

i really hope theres already an interface for this

#

yeah

quartz kindle
#

there probably is an interface for that, should be a popular lib

fluid basin
#

damn another bloat-ish web server framework

opal plank
#

im looking for it but still

quartz kindle
#

doesnt it attach its classes to the exported object?

#

cant you do res: Koa.response

opaque eagle
quartz kindle
#

or something

fluid basin
#

what are you trying to do?

opal plank
#

thats actually smart

#

lemme check

#

im not even able to ping my own api now

fluid basin
#

hrm

#

does that even support templates

#

and rendering

opal plank
#

authentication error

fluid basin
#

well ok if you don't need templating/rendering its better to use a more lightweight library

opal plank
#

Hmmm

quartz kindle
#

you dont need the framework to support it, you can use a renderer manually

fluid basin
#

pretty much as well

opal plank
#

GOT IT

fluid basin
opal plank
#

huh?

#

nanicure?

#

how is body empty?

fluid basin
#

what library are you using to parse the body

opal plank
#

none

#

Koa

#

but i assume i need body parser

#

though it should not be empty

fluid basin
#

you need a bodyparser afaik?

#

thats the case for most libraries, including express

opal plank
#

thats the thing

#

this is express 2.0

#

and i am

fluid basin
#

hoho then you are going to have fun

#

ah

#

make sure that is use'd before your routes are loaded

opal plank
#

though thats on the main app, not the router

#

what if i do router.use()?

#

time to break shit, brb

fluid basin
#

well the thing is typescript can't deal with dynamic contexts that well yet (in terms of syntax and pre-processing)

quartz kindle
#

or just process the stream yourself xd

opal plank
#

still empty

#

wtf

fluid basin
#

lel

opal plank
fluid basin
#

send main code

opal plank
#

its not parsing it

#

main code is one big mess

fluid basin
#

thonk

quartz kindle
#

lmao

opal plank
#

also typescript

fluid basin
#

mess correlates to being error prone

#

you can always use rawBody though

opal plank
#

cant even

#

it comes parsed

#

i could use headers

#

but it bothers me that body isnt comin

#

oh

#

i need to put applciation-type json on header dont i?

silver lintel
#
Promise {
  User {
    id: '453103897012338688',
    username: 'Plebus Supremus',
    bot: false,
    discriminator: '2784',
    avatar: '64de2606d3fc0833e6a6747c7e81369a',
    flags: UserFlags { bitfield: 64 },
    lastMessageID: '759963963541684246',
    lastMessageChannelID: '753764342503309324'
  }
}
``` how to get the username?
opal plank
#

and now i just crashed it

#

jesus christ if you ever want to break code, just put it on my hands and gimme 10 minutes

fluid basin
#

@silver lintel await the promise, then use the obtained value and access its username property

silver lintel
#

ooh it works ty

fluid basin
#

you can try Content-Type: application/json in postman @opal plank

earnest phoenix
#

can anyone tell me why it run

#

?

opal plank
#

thats precisely what i did willi

fluid basin
#

oof then

opal plank
#

im getting no response

fluid basin
#

send entire sauce pl0x

opal plank
#

foine

fluid basin
#

wat

#

hastebin exists

earnest phoenix
#

?

opal plank
#

imagine ghost pining oliy

earnest phoenix
#

@earnest phoenix nice ghost ping oily

coral trellis
#

@earnest phoenix Please don't invisible ping people

opal plank
#

@fluid basin any clue?

lofty otter
#

Pls help

#

If anyone can

opal plank
#

@lofty otter dont ask to ask

fluid basin
#

oops went to grab some food @opal plank

#

back now, lemme take a look

lofty otter
#

I need help

#

Cause there is my music bot

#

And i am not able to find the HTML

#

So can you produce one

opal plank
#

music bot

umbral zealot
#

What "html"?

opal plank
#

and html

#

what

umbral zealot
#

@lofty otter why does your music bot need html?

lofty otter
#

So that it can play music

#

That’s why

umbral zealot
#

HTML doesn't play music, buddy

lofty otter
#

Cause it’s my first time

umbral zealot
#

HTML is for websites not music bots.

lofty otter
#

It was showing to fill the 300 max characters

umbral zealot
#

I'm pretty sure you write markdown in there not html

#

And we can't write your bot's description, it's up to you to describe your own bot.

#

(you can use HTML, but if you don't know it, better just use markdown)

fluid basin
#

@opal plank wait just curious why are you using both commonjs and es6 imports?

opal plank
#

i think i sent you outdated code

#

its cuz making a json for config is annoying

#

so i just leave it as json and require it

#

importing json is annoying

#

though its legit 2 lines more

#

export default {}

import * as config

#

done

#

but you see, thats one extra line to export it

#

its worth it

dense nest
opal plank
#

@fluid basin this is what bugs me

#

root is fine but any other endpoint it just 'nopes'

fluid basin
#

weird

opal plank
#

OOOO

earnest phoenix
#

@nimble kiln someone use ur api!!!

opal plank
#

OOOOOOOOH

#

i see why

dense nest
#

@earnest phoenix lmao

opal plank
#

shame on you for not seeing this willy

fluid basin
#

yeah I saw

dense nest
#

@earnest phoenix lolrittter is my freind so i tend to use some of his work as examples

#

.-.

opal plank
#

thats why its not working

umbral zealot
#

using JWTs for authentication is bad. spray

fluid basin
#

yes

#

why are you using jwt

#

(though also you didn't tell me you were using jwt XD)

opal plank
#

i have no clue what half of those things are

#

front end dev in learning

#

im fiddling with cryptop now

umbral zealot
opal plank
#

i'll ask around for a better alternative, brb

dense nest
umbral zealot
#

@opal plank cookies.

#

No need to ask around, the answer is cookies.

dense nest
#

O

opal plank
#

that explains a bit but not much

dense nest
#

I like cookies

#

Lmao

opal plank
#

also its koa-jwt

#

not sure if they are the same

umbral zealot
#

any JWT should not be used for auth

#

the gist I posted has a link to a youtube video that goes in depth if you're interested. But overall, TL;DR, session cookies are what you want to use.

opal plank
#

so im gonna have to figure out cookies

#

fok

#

jest, cookies, koa, middlewares, php, laravel

#

ffs how much shit is gonna get thrown at me today?

dense nest
fluid basin
#

what are you trying to make in the first place even

opal plank
#

short, dashboard

fluid basin
#

ah ok

opal plank
#

long: learning

#

i already got a dashboard

#

though its in php

#

and i'd highly like to move away from that hell

fluid basin
#

express would be easy if you want to use nodejs

opal plank
#

bad

fluid basin
#

and great for starting off

opal plank
#

bad

fluid basin
#

tbh

opal plank
#

ive used express

#

koa is express 2.0

#

ive used express quite a few times in the past

#

though koa has a bit of a learning curve

#

and i havent gotten too much into express

#

i went to dick with php for web stuff

#

php html css and js combo

#

eeey theres a middleware for this

umbral zealot
#

I usually just do passport and passport-discord if I'm logging in discord users

opal plank
#

wont work in my case i dont think

#

specially cuz im dealing with multiple oauth's

#

twitch youtube AND discord

umbral zealot
#

ah well

fluid basin
#

although if you're developing an api then maybe using jwt will be better

#

(though imo I think jwt is still rather big)

earnest phoenix
hazy sparrow
#

Can i send 2 embeds in 1 message?

opal plank
#

@earnest phoenix thats json not json with comments

umbral zealot
#

I don't think you can send 2 embeds, no

opal plank
#

2 different types

umbral zealot
#

I've never actually seen it done so I gotta say no.

earnest phoenix
#

@opal plank Mkay, so what do I need to fix?

opal plank
#

delete that line

earnest phoenix
#

This one?

karmic compass
#

No //

#

You can't use comments I json

earnest phoenix
#

ok

karmic compass
#

In*

#

It literally underlines it in red like what

earnest phoenix
#

Omg,

#

Thank you.

queen moss
#

hey all, so for a class assignment we have to design a chat application that allows for user file uploads in a secure way, if I never execute the file in the upload directory, I simply allow it to be downloaded in a read only way, I should....? be fine right?

#

this is in node^

#

I couldn't really find an exact answer so I figured id ask here

umbral zealot
#

"in a secure way" often means, like, with encryption

queen moss
#

secure way server side for clarification here

#

as in like, keeping the server side safe from attacks via file upload

umbral zealot
#

I mean, if a file is never accessed or executed, it's "secured" but you could also block some file types I guess

queen moss
#

aight, that's kinda what i figured but this textbook is from like 2012 and I didn't really trust it lol

#

tysm

earnest phoenix
#

uwu

#

@queen moss please don't block file types .txt, .text, .mcworld, folders pls

#

You can't use comments I json
@karmic compass yes you can

umbral zealot
#

no you can't.

#

json doesn't have comment support

earnest phoenix
#

@karmic compass @umbral zealot you can have comments in JSON in older versions mmLol

umbral zealot
#

older versions that nobody uses and nothing supports. sure.

earnest phoenix
#

why does Visual Studio Code have a language called JSON with comments waitWhatSpin

#

is it possible to round message.guild.members.cache.size to the nearest whole number

#

loading A qt is typing...

#

is it possible to round message.guild.members.cache.size to the nearest whole number
@earnest phoenix ```
Math.round(collection.size); // Collection#size returns a number so you can do Math.round() on it

sonic lodge
#

why would you need to round it

#

it'll always be an integer

earnest phoenix
#

because it keeps giving me this weird huge decimal

#

oof

#

because it keeps giving me this weird huge decimal
@earnest phoenix wutdafuk

#

lemme see the docs

#

oh wait

#

im stupid

#

wrong line

#

````(`${guildInfo.humans}%` Humans ```

#

tthis one

#

it gives the percentage of humans

#

but idk how it gets a decimal

#

wut da fuk

#

it gives the percentage of humans
but idk how it gets a decimal
@earnest phoenix a percentage can be defined as a decimal multiplied by 100..... don't skip meth classes

sonic lodge
#

you can use .toFixed() to get the number with a specified amount of digits

#

or is it .toPrecision()

earnest phoenix
#

idk

#

lemme search the docs

#
                name: `Members: \`${message.guild.members.cache.size}\` (\`${guildInfo.humans}%\` Humans | \`${guildInfo.bots}%\` Bots)`,```
#

where would i put it

sonic lodge
#

guildInfo.humans.toFixed(2) or something like that

earnest phoenix
#

me bots in 101 servers i wanna make sure it dont break

#

@earnest phoenix try doing GuildMemberManager#cache and filter it using Collection.filter

#

im trying the thing POOLED told me

#

if that doesnt work ill try that

#

ok

warm marsh
#

to fixed determines the amount of numbers after a decimal point.

dense nest
#

Didnt realize i wasnt in development

#

Lmao

#

@slender thistle

slender thistle
#

Ey

#

So

#

Do you have the image stored as a local file?

#

Or is it an image you get from somewhere in bytes?

dense nest
#

Just an image stored as a local file

#

I usually just get my images from my other webserver lol

#

Omp

#

Oml

#

Lmao

slender thistle
#

Yeah well

dense nest
#

Ig that works

slender thistle
#

if it's stored on the same machine

#

Use open()

dense nest
#

It's just from my other server 😂

#

Oki

slender thistle
#

p.s. use rb mode

#

aka read-bytes

indigo flax
#

hey

#

i want to run my shards

#

but if i do

#

node sharding.js

#

it doesnt work

earnest phoenix
#

wtf show code os sharding.js

indigo flax
#

ok

earnest phoenix
#

Of*

indigo flax
#
let apiInfo = {};

const manager = new Discord.ShardingManager("./app.js", { totalShards: "auto", respawn: true, token: config.token })

manager.spawn();
manager.on("launch", async shard => {
    console.log("Shard " + shard.id + " starting.")
})

webAPI.listen(80)

webAPI.get("/", async (request, response) => {
    response.json(apiInfo)
})

async function updateInfo() {
    let rawShards = Array.from(manager.shards.values()), shards = {};
    for (var shard of rawShards) shards["SHARD_" + shard.id] = shard;
    
    let newInfo = {
        guilds: await manager.fetchClientValues("guilds.size").then(r => r.reduce((prev, val) => prev + val, 0)),
        users: await manager.fetchClientValues("users.size").then(r => r.reduce((prev, val) => prev + val, 0)),
        shards: {}
    };

    for (var s in shards) newInfo.shards[s] = {
        status: await shards[s].fetchClientValue("status").catch(() => 6), // https://discord.js.org/#/docs/main/stable/typedef/Status & 6 = unable to reach shard
        guilds: await shards[s].fetchClientValue("guilds.size").catch(() => null),
        users: await shards[s].fetchClientValue("users.size").catch(() => null)
    }

    apiInfo = newInfo;
}

setInterval(updateInfo, 30000)```
earnest phoenix
indigo flax
#

?

earnest phoenix
#

I think this should be manager.on("shardCreate", shard => console.log(`Shard ${shard.id} is active`)

indigo flax
#

Line #?

#

@earnest phoenix nvm i rewrote everyting

#

it fixed

earnest phoenix
indigo flax
#

sorry for only 4 guilds

#

i released this bot publiclly like a few hours ago

#

and only to 2 friends

ruby cosmos
#

🐍

white vapor
#

how can I use apostrophes in the messages the bot sends? using quotes doesn’t work

earnest phoenix
#

what lang

#

usually u can use like \' in some or if u want to use quotes in a string 'hey "hey"'

#

i tried installing a package on repl.it with -g flag but npm said it doesn't have permissions to. I removed the flag but now bash says firebase ain't a command (i'm not dumb i know what global means). How would I use firebase then?

slender thistle
#

@earnest phoenix escaping is done with backwards slash

earnest phoenix
#

yeah i thought i put that guess not

#

oh wait

#

cant put thta

#

there we are

#

had to escape a fake escape

#

lmao

#

anyone help

#

nvm got it to work

#

sorry for only 4 guilds
u supposed to shard at like 2k guilds

delicate shore
#

How to stop node process from terminating when uncaught ..... occurs

#

and no pls don't suggest try,catch

#

it doesn't work

fluid basin
#

not recommended

earnest phoenix
#

i think u can disable all errors

#

in node js

fluid basin
#

not recommended

earnest phoenix
#

yeah but he wants so

#

¯_(ツ)_/¯

delicate shore
#

hmm

fluid basin
#

any uncaught/unhandled errors can lead to unsafe situations and instability, terminating the program is the intended behaviour to prevent any unwanted/unexpected stuff to happen, whether it is to your bot responses and code execution or even database

delicate shore
#

oh

#
process.on('uncaughtException', function (err) {
  console.error(err);
  console.log("Node NOT Exiting...");
});
#

this is what i tried using

fluid basin
#

please use an autorestarter/process monitor for your bot, and fix the errors when you see them

delicate shore
#

yes i use pm2

#

But it doesn't provide in-depth detail

#

that where error occured

fluid basin
#

pm2 logs bot.js --lines 100

delicate shore
#

How do you know my file is bot.js
BigBrain

#

and yes I have already tried that as well

earnest phoenix
#

bruh i made a template bash file for pushing changes to my GitHub repo and i used underscores in places where i need to put stuff and i just executed the file without putting em so now i have an underscore hell

wholesome 100

delicate shore
#

it says Error : few things then .......................

fluid basin
#

find the error and find out why it happened

#

if you can't then unless you post the exact logs here no one can help you

earnest phoenix
#

it says Error : few things then .......................
@delicate shore you're passing too many things it's telling you to pass few things mmLol

delicate shore
#

ok

earnest phoenix
#

chat dead

slender thistle
#

@earnest phoenix 2500 enforced, 1000 recommended

earnest phoenix
#

please resurrect chat

shrewd shore
#

How to make a bot which will post facts related images or suggest me a bot

earnest phoenix
#

How to make a bot which will post facts related images or suggest me a bot
@shrewd shore you need to code it or search a bot like that on top.gg
adverts aren't allowed so we can't directly suggest you bots

modest crane
#

search an api for that and integrate that api on a bot

slender thistle
#

748100257761460364 you need to code it or search a bot like that on top.gg
adverts aren't allowed so we can't directly suggest you bots
If it's reasonable and actually helpful, we're lenient

ebon lintel
#

h

pure lion
#

Nyoom

green kestrel
#

so the reason why imho you shouldnt auto fetch changes from gh to your production is.... its easy to break production

pure lion
#

Oh right

#

If someone does a fucky wucky

green kestrel
#

either have the update be manual, and/or pull only from a branch called 'live' so you must merge that branch to have it show up

#

OR, dont do it at all

pure lion
#

Okay sounds good :D

#

Also other dumb question completely unrelated

green kestrel
#

and if you do do it, then dont do it via git pull or anything like that, because you dont want the .git metadata knocking around especially e.g. in dashboard content

pure lion
#

oHhHHhHhhhHhHhh

green kestrel
#

use rsync, or fetch and untar a release

pure lion
#

igotu

#

also

#

are .cc files cpp header files?

green kestrel
#

hmm..... theyre traditionally not header files

#

but c++ compilers dont care

pure lion
#

So they're functionally the same oRrrrrr?

green kestrel
#

you could call a C++ header file "mystuff.owo" and do #include "mystuff.owo" gcc wouldnt give a crap

pure lion
#

:O

green kestrel
#

C++ compilers basically just dump the contents of any file you say is a header directly at that point in the file

pure lion
#

That's so dumb and amazing

green kestrel
#

yeah

pure lion
#

Thank you brain, very cool :3

green kestrel
#

it allows for stuff like template metaprogramming, but at the same time its so returded and 1970s

earnest phoenix
#

headers are usually .h if i remember

green kestrel
#

or .hpp, or no extension at all

earnest phoenix
#

u can do no extension?

#

how does that work

pure lion
#

So I could just have a file with machine code?

green kestrel
#

the official standard e.g. C++11 onwards encourages you to not have a file extension, so then you can just do e.g. #include <iostream>

pure lion
#

Precompiled cpp sangry

#

Oh aight

green kestrel
#

no, visual studio has something called precompiled headers, which is like that, but generally no, the compiler parses and compiles header files

#

precompiled headers is just a way to speed up compilation

pure lion
#

Smart vs

green kestrel
#

because the biggest thing that sucks most of all about C++ and C is compilation times

pure lion
#

Also I'd assume that vs > vsc for .net?

green kestrel
#

my bot takes about 5 mins to compile fully on my dev server 😩

#

vsc is a simple editor, if you want to compile C++ youll need visual studio community and the windows 10 platform SDK

#

both free

silver lintel
#

how do you get id of emoji?

green kestrel
#

same for C# iirc but its been a while since i did C#

pure lion
#

Also, when including a file, does compiling mean it turns it into a dockerfile of sorts where you don't need the other file?

green kestrel
#

@silver lintel personally i make my bot log everything on my special test server and just put the emoji there... and it'll show me the <:emojiname:\123456>

silver lintel
#

ahh k

green kestrel
#

theres other ways but i find that the most convenient, so long as only you and your bot are on this special test server that isnt a privacy violation

#

dockerfiles are completely seperate to compilation

#

the process of compiling a C++ program or project just outputs executables

#

its then up to you how you choose to deploy or manage them

pure lion
#

What I mean is, does the exe need to see the file included?

green kestrel
#

the way i do it is i have two systems, physically separate a live and dev environment, when im happy i git pull them onto live (but not for web parts e.g. dashboard) and make -j to build it

#

then restart at my convenience

#

i really do need to learn docker

pure lion
#

Same tinydeskengineer

green kestrel
#

the exe when compiled does not need the source code at all

pure lion
#

That's weird

green kestrel
#

after compilation youll be given some other files too e.g. .pdb, you also dont need those in production - theyre for debugging crashes

hazy sparrow
#

this only happens if i do the kill command only

pure lion
#

When people download the cpp game engine exe on my GitHub it says if errors because a file isn't there

hazy sparrow
green kestrel
#

which file?

hazy sparrow
#

kill.js

green kestrel
#

i was asking OwO but ok 😄

pure lion
#

Glut.h

hazy sparrow
#

sorry lul

pure lion
#

I think

#

It's on my gh if you wanna have a look

green kestrel
#

if its a game engine, wont people be compiling it against their own code?

#

btw.... mind if i ask, why do you make a game engine?

#

is it to make a game in?

#

e.g. for you to make a game in?

hazy sparrow
#

yeah lol what else

green kestrel
#

see now thats an interesting question... because im a game dev and ive released a game, and most people who release a game dont make an engine.
theres a phrase in the game developer community "make games not engines"

#

conversely those who make an engine rarely ever make a working released game

#

if youre making an engine for the fun of making an engine by all means just dont expect it'll lead to a released game

#

you can spend so long wrapped up in the minutae of tiny stuff you'd never get finished, much like if you chose to make your own discord lib before making a bot

pure lion
#

btw.... mind if i ask, why do you make a game engine?
Wanted to learn C

green kestrel
#

ambitious

#

😄

pure lion
#

Very

#

It almost works

#

The rays go fucky sometimes tinydeskengineer

#

And there's no collision tinydeskengineer tinydeskengineer tinydeskengineer tinydeskengineer tinydeskengineer tinydeskengineer

#

But it's my baby

green kestrel
#

im a big fan of unreal engine 4

#

respect to you for making something though 😄

pure lion
#

I'm a big fan of not using mainstream stuff 8)

#

respect to you for making something though 😄
Yayyyyyyy

green kestrel
#

for every person who creates something theres a whole horde of "ideas people" who say 'wouldnt it be great of i could convince someone else to do this for me'

#

especially in game dev

pure lion
#

I can definitely see that

green kestrel
#

the words you hate to hear on a game dev discord "so i had this great idea for a game and all i need is 20 programmers, 30 graphics people, a sound guy" (note they dont say anything other than 'graphics people' as they have no clue whats actually involved)

#

these people dont often even have any background in project management đŸ€Ł

pure lion
#

At least I know what's going on, pretty simple if you chose the right lib ngl

green kestrel
#

you ask them what their budget is they say "oh i thought we could all work for free.... but if it hits it big, we'll share profits"

pure lion
#

I just gotta be careful when looking for a programming job/gig then?

green kestrel
#

nah just stick to proper companies that dont advertise their jobs solely on a discord server 😄

#

if you want to get paid, i mean

pure lion
#

Well that makes sense

#

What are the requirements to work at discord 8)

green kestrel
#

no idea, i dont work at discord

hazy sparrow
#

they released a vid about that on their yt channel i think

green kestrel
#

im guessing if you wanted to develop for them you;d need react, flux, electron for front end dev

#

but their backend is elixir

hazy sparrow
#

i only remember that you should be 18+ to work at discord mmLol

green kestrel
#

you need to be 18+ for any real job that isnt peeling potatoes or washing pots 😄

hazy sparrow
#

not for americans tho

green kestrel
#

well it depends

#

what jobs can you get before 18, paper round? part time work?

hazy sparrow
#

eh

#

car washing

green kestrel
#

i mean you could in theory become an entrepreneur at age 13 and make a business but it would all be in your parents name as you cant legally sign any contracts

pure lion
#

im guessing if you wanted to develop for them you;d need react, flux, electron for front end dev
I think they use py for backend but this is all manageable

green kestrel
#

its not python

pure lion
green kestrel
#

theres something in the api docs that hints at what they use too

hazy sparrow
#

programming pay very well now

green kestrel
#

one second

hazy sparrow
#

around $80k per year for average programmers

#

average

green kestrel
#

im pretty sure a lot of it is or was erlang

#

this is one of the two choices of data stream format you get for the websocket

#

either json or ERLPACK

fickle sapphire
#

@hazy sparrow tax it!

#

😛

green kestrel
#

if it wasnt a lot of erlang back there, they probably wouldnt be sending erlpack

#

i wonder what tiny fraction of bots use erl

fluid basin
#

oh nice full stack

#

be prepared to have tons of frontend and backend experience

#

and coordinating the two in general

green kestrel
#

here we go

#

erlang/elexir and rust

fluid basin
#

since its a full stack pos you'll prolly get pulled left and right from frontend and backend groups

hazy sparrow
#

imagine making a dank memer currency system clone using json

green kestrel
#

my day job is full stack

#

but nothing on the scale of discord

hazy sparrow
green kestrel
#

does the kill command have an execute method?

hazy sparrow
#

brb

#

wait shi i think i know what is causing this error

#

i forgot the execute

green kestrel
#

@earnest phoenix whats your current level of programming knowledge? how you answer will determine the best way for you to create a bot 🙂

rocky hearth
#

I'm using typescript, how do I structure the client?? I've tried extending the Client but it won't helps in typechecking.

rare plume
#

Hey, does soneone know a beginner guide for canvas? I try to get better in it bloblul

rocky hearth
#

for djs?

rare plume
#

Yes

rocky hearth
#

There is already an guide on djs. Have u read it?

hazy sparrow
rare plume
#

Yes, but i mean a more in depth guide

hazy sparrow
#

probably do a quick search in yt or google

carmine summit
#

my bot cant reacts messages older than reboot..

blazing valve
rare plume
#

Alright, thanksbloblul

blazing valve
#

I'm sorry jeb 😐 😳

hazy sparrow
#

how do i like get the next message of the authjor after a command like
"!ping"
"type pong"
"pong"
"thank you"

how do i know if the next message of the user is "pong"

nimble kiln
green kestrel
#

If you own a bot that is in over 250,000 guilds, there are some additional considerations you must take around sharding.
^^ discord api docs

does anyone know what these additional considerations are? im just curious, nowhere near that figure.

#

from what i heard its just a requirement that your shards must be a multiple of a number they give you, and not less than a multiple of one of that number

#

usually a power of two number

delicate zephyr
#

I think you email support

nimble kiln
#

^and this yes

delicate zephyr
#

ratelimits and shit too

#

since at 250k you will probably have to get a specialised token that allows you to have higher ratelimits and stuff depending on what you do

green kestrel
#

yeah true

silver lintel
#

is ther a way to change letter spacing with canvas?

pale vessel
#

split("").join(" ") troll

eternal osprey
#

hey could someone help me?

#

my setinterval sends the same embeds over again

#
 setInterval(function Myfunction(){
         
      T.get("search/tweets", { q: args, count: 10 }, function ( 
        err,
        data,
        response
      
      ) {
        console.log(data);
        status = data.statuses[0];

        data.statuses.forEach((status) => {
          const embed = new Discord.MessageEmbed();
          embed.setTitle("Twitter Feed Poster");
          embed.setDescription(`${status.text}`);
          embed.setImage(`${status.user.profile_image_url}`);
          embed.setFooter("Command created for Pokehub!");
          embed.setColor("#FF0000");
          embed.setAuthor(
            "@" + `${status.user.screen_name}\n` + `${status.user.name}`
          );
          embed.setURL(
            `https://twitter.com/${status.user_screen_name}/status/${status.id_str}`
          );
          message.channel.send(embed);
          
        });
      });
    },5000)```
shrewd glen
#

ok

eternal osprey
#

this is a tweet searcher and displayer for discord

#

but it sends the same 10 embeds every 5 seconds.

#

why doesn't it update?

shrewd shore
#

Who can help me to made a bot of facts, which will give a random facts in server

earnest phoenix
#

Who can help me to made a bot of facts, which will give a random facts in server
@shrewd shore nobody because of the way you asked

silver lintel
#

^

#

use api

eternal osprey
#

hey

silver lintel
#

but it sends the same 10 embeds every 5 seconds.
@eternal osprey erm, ofc, you are sending it { q: args, count: 10 } 10 times, },5000) every 5 seconds

eternal osprey
#

i know

#

it sends the SAME

#

mesage

#

if i use !feed fifa for example

#

without the use of interval, it ssends 10 messages that are different.

#

how would i fix that'

junior turtle
#

I'm using Nodemon.JS and I want to run a restart command from discord, where the bot would execute rs in its own console

earnest phoenix
#

Use pm2 or a process manager

#

Then in the restart command just do process.exit()

shrewd shore
#

Can anyobe help me in making a bot that will give facts automatically?

quartz kindle
#

where do you want to get the facts from?

eternal osprey
#

anyone that could help me please?

#

i've been waiting for an hour now.

quartz kindle
#

you're making a request every 5 seconds, and for each request you're sending 10 messages? thats already blowing up your rate limits lol

zenith terrace
#

API abooose

eternal osprey
#

i know

#

i have reduced it to 1 message every 20 seconds

#

but that was not my question Tim.

quasi anchor
#

Well have you tried logging the feed it gets

#

maybe you messed up your loop and it only gets one message for some reason

eternal osprey
#

nope

#

it is just the embed that doesn;t change with the setinterval.

#

i have been at this for 3 freaking hours

#

and no-one could help yet

umbral zealot
#

you need to keep the embed message variable outside of the setInterval

#

and use msg.edit() instead