#development

1 messages · Page 1208 of 1

honest perch
#

omfg

opal plank
#

@sick fable you need to pick a host first

earnest phoenix
#

theyre asking what provider youre using

opal plank
#

Digital ocean, locally, something

honest perch
#

what provider did you buy the server from, or are you self hosyinh

sick fable
#

Someone guide me up. I am 14 y/o

earnest phoenix
sick fable
#

what provider did you buy the server from, or are you self hosyinh
@honest perch wha-

honest perch
#

what does age have to do with anything. also you gave us like 0 info

opal plank
#

read this carefully

sick fable
#

Hmm

weak rain
opal plank
#

@sick fable which company did you buy your VPS?

sick fable
#

Lmao, wait

honest perch
#

i dont think they have one tbh

opal plank
#

me neither tbh

quartz kindle
#

@sick fable hosting means your bot program will run 24/7 inside some computer. this computer can be anything, such as your home pc, or a server you rent from a hosting company

earnest phoenix
#

i agree

weak rain
#

that map is compulsory?

sick fable
#

@sick fable hosting means your bot program will run 24/7 inside some computer. this computer can be anything, such as your home pc, or a server you rent from a hosting company
@quartz kindle oh

#

@sick fable which company did you buy your VPS?
@opal plank I don't have one.

earnest phoenix
#

self-hosting wont run 24/7

opal plank
#

im assuming your question will be now (how to turn but on) ?

honest perch
#

self-hosting wont run 24/7
@earnest phoenix depends

sick fable
#

Yes

opal plank
#

unless you keep it 24/7

#

¯_(ツ)_/¯

sick fable
#

¯\_(ツ)_/¯

#

(╯°□°)╯︵ ┻━┻

quartz kindle
#

in any case, renting a server from a hosting company is not free, but is not expensive either (starting at $2.50/month or even lower), and is the recommended way to host bots that should be online 24/7, and is what most people here do

honest perch
#

host it on potato ez

sick fable
#

Lmao😂

honest perch
#

honestly if you have a spare pi and stable internet its not that bad either

opal plank
#

or pull an 'erwin' and use an Old Wii

quartz kindle
#

if you dont want to pay, there are a few companies that offer limited hosting for free, some of them with either trial limitations or limit how many hours per day they allow your bot to be online

sick fable
#

if you dont want to pay, there are a few companies that offer limited hosting for free, some of them with either trial limitations or limit how many hours per day they allow your bot to be online
@quartz kindle I want that one only

quartz kindle
#

google has a free forever plan that is more than good enough, but you need a credit card to register

sudden geyser
#

or pull an 'erwin' and use an Old Wii
@opal plank try running a minecraft server on a very old laptop

sick fable
#

google has a free forever plan that is more than good enough, but you need a credit card to register
@quartz kindle hmmm

quartz kindle
#

alternatively, you can run the bot yourself in your own computer

#

it will be online as long as your computer is on

opal plank
#

@sudden geyser runing server is fine, loading client is the issue

#

as long as it supports java it should be ok

steady wharf
#

idk im not a magik man
@misty sigil i fix that

wooden jasper
#

-p indonesia raya

simple stump
#

I'm trying to make a queue system for my new music bot, however, the queue is always one song. I try to add something to the array, but a new song just plays (the connection.play(); is what controls playing a new song). I just want to add a new song to array, rather than deleting it.
Code:

            var server = servers[message.guild.id];

            const channel = message.member.voice.channel;
            if (!message.member.voice.channel || channel.join == null) {
                message.channel.send("Channel doesn\'t exist or you're not in a voice channel!");
            } else {
                console.log(server.queue);
                server.queue.push(args[0]);
                if (/*server.queue[0] != "" && */server.queue.length = 1) {
                    channel.join().then(function(connection) {
                        connection.play(ytdl(args[0]));
                    })
                } else {
                    console.log("ok zoomer thing is not empty");
                    server.queue.push(args[0]);
                }
                /*
                channel.join().then(function(connection) {
                    connection.play(ytdl(args[0]));
                })
                */
            }

Full code: https://hatebin.com/mrqsuzpfnc

gritty bolt
#

does anyone know of a nodejs library that can convert strings such as "1 hour" or "30 minutes" to timestamps?

sudden geyser
#

look up ms

misty sigil
#

ms?

gritty bolt
#

wow thats exactly what i wanted

#

thanks

thick gull
#

is there any decent reddit node packages i can use to get random images?

#

someone said random-puppy isn't the best

#

so im not suer

misty sigil
#

use the official api

green kestrel
#

Are image embeds broken for everyone?

thick gull
#

i meant node packages

#

yeah discord is dying again

still merlin
#

I can't upload any images with my friends nor can my bot, I think discord images broke

green kestrel
#

Discord is sending them as download attachments with a huge delay

still merlin
#

Yeah

misty sigil
#

Yes it’s broken for everyone @green kestrel

green kestrel
#

Client bug?

misty sigil
#

discord is having a die moment

#

as usual

#

CDN broke

green kestrel
#

I just had an app update 30 mins ago,.it broke then

#

Ah ok

earnest phoenix
#

pog moment, discords dead

#

@simple stump
I assume server.queue is an array.

let array = []

// now lets say you're pushing a song

array.push("Song 1");

// Output: ["Song 1"] which can be accessed by array[0]

array.push("Song 2");

// Output: ["Song 1", "Song 2"] which can be accessed by array[1];

//If you want to remove the first song, slice it out.
//use .slice or .pop
#

or you can shift it .-.

#

how can i learn if someone boosted my server? (with event(s)) guildBoostAdd? Or guildMemberBoost?

keen compass
#

you can use guildMemberUpdare

sudden geyser
#

Listen for the message event

keen compass
#

guildMemberUpdate

earnest phoenix
#

so , if (member.premiumSince !== null) will work, right?

keen compass
#

idk, but you can check if the member was given the Server Booster role,

earnest phoenix
#

Oh, i forgot that

#

ok

#

thx

earnest phoenix
#
async def number():

        if 'number' in locals():
            print('number exists!')
        else:
            number = 0

        print(number)
        number = number + 0

I'm trying to check if number exists and if not define it -- and later add 0 to it.
But it always prints 0.

quartz kindle
#

you check if number exists in locals

#

but you never update it in locals

#

in any case is locals() the right place to store such variables?

#

anyway try something like this ```py
async def number():
if 'number' in locals():
print('number exists!')
locals()["number"] = locals()["number"] + 1
else:
locals()["number"] = 0
print(locals()["number"])

sudden geyser
#

locals() I think is bound to the scope

#

Which is why at the top scope you get a lot of stuff, but in the function you get an empty dict.

earnest phoenix
#

Hello! How can I add in my bot status in how much servers my bot is in and how much members it is watching?

misty sigil
#

what library?

earnest phoenix
#

What?

misty sigil
#

what lib?

earnest phoenix
#

Oh discord.js

#

@misty sigil???

misty sigil
earnest phoenix
#

How can i learn the any server's boost count?

#

I'm bad at server boost , bruh

#

Could someone tell me how to do the bot invitation link instead of getting that link to be "click here" if you know please tell me

#

?

misty sigil
#

in an embed?

gritty bolt
#

im trying to make a reminder command for my bot but I don't know how to actually get the bot to remind the user at the right timestamp

#

i already have the timestamps stored in the db but I don't know how to make the bot dm the users at that timestamp

#

could anyone get me in the right direction?

lyric mountain
#

maybe use cron for checking it every minute

hardy cobalt
#

T

lyric mountain
#

that's what I do actually

opal plank
#

use node schedule @gritty bolt

gritty bolt
#

but how would I do that for every timestamp in that DB?

summer torrent
torpid heart
#

You sure you supposed to login via root?

summer torrent
#

wdym

#

im using termius. This is my first time on windows terminal

opal plank
#

@gritty bolt loop em if you have multiples

#

¯_(ツ)_/¯

torpid heart
#

Yeah well as far as I know root is the "user" with access to everything and sometimes depending on your vps provider or your server you have to make an own user with custom permissions. Do you log in with root in termius?

earnest phoenix
#

Hello

summer torrent
#

@torpid heart yes

gritty bolt
#

@opal plank so you mean like do a .forEach for everything in the database every time the bot starts?

opal plank
#

forEach bad

#

use for in this case

gritty bolt
#

what should i use instead

opal plank
#

use for in this case

gritty bolt
#

oh

#

my bad

torpid heart
#

The difference between .forEach and for in in the case of speed is not that significant

gritty bolt
#

i read that wrong haha

opal plank
#

also yes, delete entries that are old and not needed

#

on startup you should only require active timestamps

gritty bolt
#

yeah

#

Im gonna try and delete them once the job has run

opal plank
#

just do a check if somehow your bot missed that specific time

gritty bolt
#

yeah

opal plank
#

if (job < now) run job

paper ravine
#

Anyone know how to code a starboard disc py

obtuse wind
#

is there anyway I can fix my banid command?
bUser is not defined for let bUser = args[0]; for userID only

Windows,Node,D.JS V11, etc fun stuffs

misty sigil
#

what is args

obtuse wind
#

args as in arguments~

#

such as message args

pure lion
#

Is there a fast way to add extra domain names and sites to my webserver with nginx?

golden condor
#

Not really

pure lion
#

What's the slow way

#

I tried adding another conf to the sites enabled but it redirects to the other site

nimble kiln
#

Just add all the domains under server_name

#

server_name www.domain.com domain.com www.domain2.com domain2.com;

#

@pure lion

golden condor
#

@pure lion you have to restart the server

pure lion
#

Oh that's fucking cool

#

@nimble kiln does it automatically redirect?

misty sigil
#

ip > domain you mean?

pure lion
#

Say I'm going to the site via domain2, is there a possibility of it showing site1 and not site2?

faint prism
earnest phoenix
#

t'es francais? @golden condor

#

je vois que t'écoutes du Black M

#

mdr

golden condor
earnest phoenix
#

d'accord

#

viens

#

j'dosi te parler

#

2s

nimble kiln
#

@nimble kiln does it automatically redirect?
@pure lion If you add all domains in one server{}-block then all domains will go to the root-directory you specified there

earnest phoenix
#

How long does it take for a bot to be verified? If it does.

faint prism
#

How long does it take for a bot to be verified? If it does.
@earnest phoenix +4wks

earnest phoenix
#

Alright, cheers.

nimble kiln
#

You could use if-statements to send them to different locations, maybe. But if you have different root directories then just add a second server-block

pure lion
#

@nimble kiln it's a node app, I want each domain to take me to a different place

nimble kiln
#

I mean, for node apps I use reverse proxies

pure lion
#

Yes

#

I do that too

nimble kiln
#

I only have apache examples

pure lion
#

a

nimble kiln
#

it's possible with nginx tho

#

You can catch multiple domains in one server block, then proxy to different /directories based on the hostname

fringe axle
#

Anyone knows statuspage.io and can help me with it? I want to connect my discord bot to it.

pure lion
#

@nimble kiln example?

nimble kiln
#

eh, like I said only for apache. But I can try and look around

pure lion
#

Can you show me how you did it on Apache?

nimble kiln
#

On apache I dont redirect based on hostname, I got one hostname and subdirectories:

    ProxyPass /socket.io/ ws://127.0.0.1:1/socket.io/
    ProxyPassReverse /socket.io/ ws://127.0.0.1:1/socket.io/
    
    ProxyPass /longlinkwhichshouldnotgetfoundanytimesoon/ http://127.0.0.1:2/
    ProxyPassReverse /longlinkwhichshouldnotgetfoundanytimesoon/ http://127.0.0.1:2/
    
    ProxyPass / http://127.0.0.1:1/
    ProxyPassReverse / http://127.0.0.1:1/```
pure lion
#

Hmmm

faint prism
#
robots.txt:
  disallow: /longlinkwhichshouldnotgetfoundanytimesoon
pure lion
#

Can I redirect based on domain name from request?

delicate shore
#

Discord is messing it up with images

#

Tf is happening

pure lion
#

Not any more

delicate shore
#

Oh yeah

#

I don't have a Wii tho

nimble kiln
#
        # do something
    }```
#

^nginx

pure lion
#

nginx has if statements?

#

:o

nimble kiln
#

Indeed

#

certbot uses them

misty sigil
#

lmfao

#

LUL do one lol from me gagahaah

pure lion
#

wait does it have switch case?

nimble kiln
#

idk 🤣

pure lion
#

:o

nimble kiln
#

actually

pure lion
#

I hope it'll work with ssl

nimble kiln
#

it's using $request_body

#

dont check this 😂

#

I never had to play around with nginx's proxy unfortunately, cause the server where I host my bot already runs an apache server (apache boooo) for my monitoring

golden condor
nimble kiln
golden condor
#

No

#

It's just me holding my phone lol

pure lion
#

I hope it'll work with ssl

nimble kiln
#

oh dang u right

pure lion
#

Oh

#

O h

nimble kiln
#

I'm pretty sure it works with ssl

pure lion
#

I'm retarded

#

Jaj

nimble kiln
#

Y..es?

golden condor
#

I wasn't even tryna do that lol

#

The number keeps going up 😩

pure lion
#

On DO there's a tool to add multiple nginx poopoo boyes

nimble kiln
#

Callum what are you doing

pale vessel
#

👌 got em

pure lion
#

Basically it sets everything up for you

golden condor
#

Fixing my c: drive so I can defrag

faint prism
#

hdd

golden condor
#

Apparently I've done a bad

pure lion
#

Haha lol defrag

nimble kiln
#

On DO there's a tool to add multiple nginx poopoo boyes
@pure lion Send link

pure lion
#

Okay

golden condor
#

And I just realised I'm in developement

#

Fuck

nimble kiln
golden condor
#

Sorry about that lads

#

I'll be off now

nimble kiln
#

cya

pure lion
#

Aw it doesn't exist

nimble kiln
#

oh boy that looks fancy, thx for sharing

pure lion
#

Np lol

earnest phoenix
#

My bot doesn't login.
Most likely a websocket connection

How would I resolve this?

golden condor
#

What operations do you perform?

#

It could be your internet

nimble kiln
#

@earnest phoenix Try debugging:
client.on('debug', msg => console.log(msg));

earnest phoenix
#

Well I tried both my VPS and my PC, it wont connect

#

Ill debug.

#

@golden condor what do you mean by operations?

nimble kiln
#

Maybe you're banned for too many restarts

earnest phoenix
#

I barley restarted

nimble kiln
#

In 24hrs?

earnest phoenix
#
  • its been 24h
nimble kiln
#

mhm, still. Debugging is worth a shot

earnest phoenix
#
[ws] [connection] Sending a heartbeat
READY [REDACTED]
[ws] [connection] Heartbeat acknowledged, latency of 1274ms```
#

and then it died

nimble kiln
earnest phoenix
#

well, its sending heartbeats.

#

not logging itself in though

#

uhhh

#

4k

#

1k

#

LoL

#

¯_(ツ)_/¯

nimble kiln
#
  client.on("warn", (e) => console.warn(e));
  client.on("debug", (e) => console.info(e));```
#

yeet my debug, slapp that stuff in

#

maybe that shows more?

earnest phoenix
#

maybe ur vps is running something big

#

yes boss

#

like Database self host

#

i did one time

misty sigil
#

db selfhost isnt that bad my dude

earnest phoenix
#

i hosted MySQL on my vps

#
const config = require('./config.json');
const { Client } = require("discord.js");
const client = new Client();

client.on("ready", () => {
    console.log("READY")
});

client.on("error", (e) => console.error(e));
client.on("warn", (e) => console.warn(e));
client.on("debug", (e) => console.info(e));

client.login(config.tokens.main).catch(console.error);```

This is literally the whole code if you're wondering
#

and it had 2k ping

misty sigil
#

oh

earnest phoenix
#

Only thing I use with my VPS is host my customers bots

#

and lagging

misty sigil
#

maybe thats just a mongo thing now

earnest phoenix
#

so i moved to Atlas

#

using mongo

#

so i don't have to selfhost a databse

#

:))

#

and added some swap file

#

so everything are fast now

#

:))

nimble kiln
#

@earnest phoenix Any new output(s)?

earnest phoenix
#

READY [uuid?]

#

hmm

#

its online..

#

uhh let me add a quick message event

nimble kiln
#

wait why does it post a [uuid] after READY

earnest phoenix
#

i said uuid?

nimble kiln
#

ok thonk

earnest phoenix
#

idk if its a uuid

#

its a long auth time for just a simple file

#

uuid = ?

nimble kiln
#

Works?

earnest phoenix
#

apparently

nimble kiln
#

Noice.

earnest phoenix
#

I will try to start it in the main code lmfao

nimble kiln
#

Good luck 🤞

earnest phoenix
#

🤞

nimble kiln
#

yes yes good

earnest phoenix
#

same

#

i thought it was a uuid

#

prob me cause i started learning java

nimble kiln
#

i mean, it looks uuid like. But idk

earnest phoenix
#

still sending heartbeats

restive furnace
#

but its back up
def not copy of aeon's av

nimble kiln
#

Which discord.js version are you using

earnest phoenix
#

v11 ._.

nimble kiln
earnest phoenix
#

i still use 11.6.4

nimble kiln
#

Update time HYPERS

restive furnace
#

how your guys's login is nice

earnest phoenix
#

no PepeHands

nimble kiln
#

Why 😢

restive furnace
#

cooler than mine

earnest phoenix
#

I have to update alot of functions

misty sigil
#

still

nimble kiln
#

Mostly you have to add .cache to all your stuff

misty sigil
#

you won't be able to connect after oct 7th iirc

vague kite
#

Does the test button on dbl work??

misty sigil
#

yes

earnest phoenix
#

really? I thought you needed to get verified before oct 7th

#

if thats not the case then ill update soon

misty sigil
#

you need to be verified to have over 100 servers

earnest phoenix
#

already am verified

misty sigil
#

you wont be able to use djs v11 after oct 7th iirc

vague kite
#

yes
Odd so when ever I click test button it doesn't send a message but when someone votes it sends a message

earnest phoenix
#

ill research

restive furnace
#

and u need to switch to d.js v12 after oct 7th

#

^^^ prob

nimble kiln
#

Odd so when ever I click test button it doesn't send a message but when someone votes it sends a message
@vague kite That's probably something for #topgg-api, but try to click the "Test" button a couple times (Wait a few seconds in between each Test tho) - For me I had to use it couple of times before it actually tested

still merlin
#

would

if (isNaN(amount)) return message.channel.send('**error** Please Give me a valid number);
return give me a vaild number
if i did '1s' or '1h', '6h', '17d'

vague kite
#

That's probably something for #topgg-api, but try to click the "Test" button a couple times (Wait a few seconds in between each Test tho) - For me I had to use it couple of times before it actually tested
Okay thanks will try now

earnest phoenix
#

would prob give you 1, 1, 6, 17

#

try using ms

#

or parsems

#

i forgot

nimble kiln
earnest phoenix
#

oh whoops, i thought it was parseInt

nimble kiln
#

1s would be a string, so it's not a number

earnest phoenix
#

welp..

nimble kiln
#

Eh, this is weird

earnest phoenix
#

mhm

pale vessel
#

are you looking for isNaN(parseInt("1d"))?

nimble kiln
#

I had that error once aswell, but I think it was caused by being ratelimited - Either ratelimited or straight up banned

earnest phoenix
#

weird

#

I dont wanna contact support

#

it took me a month for my last email to get a response

pale vessel
#

that should resolve by itself after some time

nimble kiln
#

I'd say send me your code so I can test, but yeah 😂

earnest phoenix
#

theres a github

#

apollyon600/projectalpha

#

although, not all files are pushed due to .gitignore

nimble kiln
#

well ok, your little 10line-testscript doesnt work either

#

or does it?

earnest phoenix
#

it does

#

but it takes 10 seconds to connect

#
const config = require('./config.json');
const { Client } = require("discord.js");
const client = new Client();

client.on("ready", () => {
    console.log("[LOGGING] THE BOT IS ONLINE")
});

client.on("error", (e) => console.error(e));
client.on("warn", (e) => console.warn(e));
client.on("debug", (e) => console.info(e));

client.on("message", msg => {
    if (msg.content == 'start') msg.channel.send("YES")
})

client.login(config.tokens.main).catch(console.error);```
Heres the quick code, message event still has flaws but yeah
nimble kiln
#

i mean, I'm using d.js v12

#

I'm gonna start your testscript with my test-bot account

earnest phoenix
#

should still be the same

nimble kiln
#

@earnest phoenix Logged in after a few seconds, and commands works

earnest phoenix
#

I assume it was instant?

nimble kiln
#

Where is that "Provided Token" coming from, I dont have that on my main bot 👀

#

Must be the way I define my stuff in the main bot:

const client = new discord.Client({
    partials: ['MESSAGE', 'CHANNEL', 'REACTION']
});```

His way:
```const { Client } = require("discord.js");
const client = new Client();```
earnest phoenix
#

Does it take too long to approve the bot la on the top.gg website?

nimble kiln
#

@earnest phoenix Well yeah sorry, bot is still up and working just fine :/ Maybe it is time to update to v12? 🙃

earnest phoenix
#

Does it take too long to approve the bot la on the top.gg website?
@earnest phoenix ? Help

nimble kiln
#

Does it take too long to approve the bot la on the top.gg website?
@earnest phoenix Check the pins in #support - It takes 4weeks and longer

earnest phoenix
#
const { MessageEmbed } = require('discord.js');
const superagent = require('superagent');
const request = require('request');
const { autimatic } = require("../../JSON/colours.json");

const url = 'https://srhpyqt94yxb.statuspage.io/api/v2/status.json';
      request(url, function (err, response, body) {
        if (err) {
          console.log(err);
          return message.reply('error.');
        };
    
        body = JSON.parse(body);
        //testOff = JSON.parse(testOffline);
const embed = new MessageEmbed()
.addField(`Durum`, `${body[3]['description'] === "All Systems Operational" ? 'çalışıyor' : 'hata'}`)
message.channel.send(embed);
#

TypeError: Cannot read property 'description' of undefined

nimble kiln
quartz kindle
#

@nimble kiln that information comes from client.on("debug")

#

the token that shows up there is what you give it in client.login()

earnest phoenix
#

@nimble kiln im probably ratelimited, but I will def upgrade to v12 soon

nimble kiln
#

@nimble kiln that information comes from client.on("debug")
@quartz kindle I am debugging in my main bot, doesnt show up

earnest phoenix
#

I wanted it to be faster is a long time but it can be approved before, right?

nimble kiln
#

You can't make it go faster, you have to wait

quartz kindle
#

it takes around 4 weeks

earnest phoenix
#

GAS GASS GASS

nimble kiln
quartz kindle
#

gas gas gas > dejavu

earnest phoenix
#

^

nimble kiln
#

gas gas gas > dejavu
Oh, thanks

earnest phoenix
#

thx @nimble kiln

nimble kiln
#

@earnest phoenix Come over here, what do you need help with

earnest phoenix
#

Umm It's just discord reseted my Bot's token.

#

Got this message.

#

It's obviously clear from the message.

pale vessel
#

lol

nimble kiln
#

Well, this is the wrong discord for that. But just go to your developers page and request a new token. Also make sure to fix the problem
It got caused by 1000 restarts within 24hrs

earnest phoenix
#

Damn waitWhat, Alright.

nimble kiln
#

You probably have a restart script which restarts your bot

earnest phoenix
#

"name": "API", "status": "operational" how can I get this data as body?

#

body1.components.API.status ?

#

anothers bot it display so big image

quartz kindle
#

@earnest phoenix you're already been told how

earnest phoenix
#

but this is different

#

I solved the other

solemn merlin
#

Someone know how tosend a message with discord webhook using node.js http lib ?

earnest phoenix
#

I want to take this area "name":"API","status":"operational"

nimble kiln
#

you have to loop through body.components

This will give you Cloudflare and operational:
body.components[0].name
body.components[0].status
@earnest phoenix

quartz kindle
#

you can also use array.find

earnest phoenix
#

thx

#

bro

#

i love u

nimble kiln
#

you can also use array.find
Or this 🙂

quartz kindle
#

@earnest phoenix it means you're using too many event listeners

#

this is an event listener: client.on("message")

earnest phoenix
#

Oh alr.

quartz kindle
#

instead of doing ```js
client.on("message", message => {
// command 1
})
client.on("message", message => {
// command 2
})
client.on("message", message => {
// command 3
})

#

do this

#
client.on("message", message => {
  // command 1
  // command 2
  // command 3
})
obtuse wind
#

yikes

#

i remember when I did that top example

#

my bot didnt like it at all and had too many errors

#

though i'd recommend

earnest phoenix
#
client.user.setActivity(`whatever`);
#

So I should use this?

obtuse wind
#
bot.on("message", async message => {
  if(message.channel.type === "dm") return;
    if(message.author.bot) return;
  if(!message.content.startsWith(prefix1)) return;

  let messageArray = message.content.split(" ")
  let cmd = messageArray[0];
  let args = messageArray.slice(1)

if(cmd = `${prefix}commandName`){
//functions here
}

if(cmd = `${prefix}commandName`){
//functions here
}

});
``` instead
#

yes @earnest phoenix

nimble kiln
#

Are you using discord.js v11? thonk

#
client.user.setActivity(`whatever`);

@earnest phoenix But yes, use this

earnest phoenix
#

Yes

real niche
#

Isn't it more than just a string?

obtuse wind
#

Well I am; I am not able to update to v12 because my NPM wont update my node to v12

earnest phoenix
#

I am using discord.js v11

#

^^

#

Same

#

But

nimble kiln
#

I am using discord.js v11
@earnest phoenix If possible you should update to v12

earnest phoenix
#

Beacuse I am using glitch

#

Umm

nimble kiln
#

oh, glitch

real niche
#

It's not if possible

earnest phoenix
#

If I updated to v12 the bot will crash

#

since

#

Glitch allow v11

real niche
#

It's required past oct 7th

earnest phoenix
#

Yeah

obtuse wind
#

well what about users like me; node doesnt update

earnest phoenix
#

Glitch probably should update it to v12

obtuse wind
#

and if I cant update my node to v12 I cant get discord v12

real niche
#

v11 is no longer supported past the 7th and iirc cannot handle new discord api changes that will happen on the 7th

earnest phoenix
#

Mhm.

obtuse wind
#

yikes so id just have to shut my bot offline then after oct 7th

earnest phoenix
#

Probably glitch Is the problem.

real niche
#

Or just upgrqde to v12

#

I think repl.it is similar to glitch

#

And I know it supports v12

slender thistle
#

Sort of

#

Both are supposed to be testing environments

real niche
#

I would recommend you host it yourself though

obtuse wind
#

@real niche i cannot update to discord v12 because my node refuses to download the latest version for whatever reason

real niche
#

What is the reason?

#

It probably says it somewhere

obtuse wind
#

doesnt say any reason; i've tried installing node v12 and everytime I installed nodev12; and check it, it always says node version: 10.9.0

#

for whatever reason, I cannot go passed v10.9 and i've had this conversation before with someone

real niche
#

How do you install it?

obtuse wind
#

directly from nodes site?

real niche
#

Wait are you on windows?

obtuse wind
#

Windows 10 yes

real niche
#

That's strange. Those installers should work. It might be that it is installing but you have two installations.

obtuse wind
#

i'll attempt it again

opal plank
#

wait what?

obtuse wind
#

if it doesnt work I'll just destroy my bot

opal plank
#

you cant install node on your system?

#

bruh, just upgrade node

real niche
#

type where node into cmd

obtuse wind
#

no I have node v12 on my system; my bot just wont upgrade it from v10

opal plank
#

how come?

obtuse wind
#

its in program files

opal plank
#

use node manager to have multiple node versions

#

open the powershell to update it with admin

real niche
#

Can you try to uninistall node?

opal plank
#

wont matter if program files are admin locked

obtuse wind
#

i can uninstall node sure

opal plank
#

wont matter tbh

chilly mason
#

can someone help me code a mute command too stupid to understand coding

real niche
#

Learn how to code first

opal plank
#

@chilly mason we dont spoonfeed

quartz kindle
#

a mute command is not easy to make

#

because discord does not have a mute feature

real niche
#

Well it's just adding a role

opal plank
#

if you need a general guide, we can provide one

quartz kindle
#

in order to mute someone you need to use roles and keep track of timers in a database

chilly mason
#

no i made the command i just dont know where to put it

opal plank
real niche
#

That's a temporary mute, which is much more difficult

opal plank
#

did u use bot maker or something along those lines?

obtuse wind
#

i just started downloading v12.18.3 LTS for node

real niche
#

@obtuse wind uninstall node, then run where node again (probably in a new commadn window)

#

Alright

nimble kiln
#

in order to mute someone you need to use roles and keep track of timers in a database
Or you live on the edge and hope that your bot will never crash, so you can just keep everything in memory KEKW

real niche
#

yes

#

Who needs upgrades?

obtuse wind
#

ill do that;

real niche
#

I just want to make sure it's completely uninstalled before you try to install the new version

opal plank
#

wait its windows 10?

#

i dont remember what where does

real niche
#

It tells you the path of a comand

#

Well this is just ready. What is your full webhook code?

vague kite
#

Ignore that I'm dumb dw

#

Ahh yeah should have put it in there sorry

real niche
#

Did you fix it?

vague kite
#

Not yet but I know the fix

#

I totally forgot to start the http server

#

🤦‍♂️

real niche
opal plank
#

yeah who would be dumb enough to forget to put http

#

ppppf shame on you

#

@slender thistle

real niche
#

idk somehow asking people for help helps you solve your dumb issues

opal plank
#

usually after you type it you think about it again

real niche
#

Ok I didn't mean it quite like that. I mean without getting actual help.

#

^^

vague kite
#

idk somehow asking people for help helps you solve your dumb issues
Yeah honestly

real niche
#

Then your like "Oh shit this guild id was actually the channel id fuck me"

obtuse wind
#

just reinstalled node with the v12.18.3 and its still saying on my node that its v10.9.0 .-. i'm just gonna have my bot go offline from here on-out

quartz kindle
#

what does it say when you run node -v in command prompt?

glacial snow
#

#server-nevalid

obtuse wind
#

again, v10.9.0 ( for Tim )

quartz kindle
#

did you completely uninstall it?

#

control panel > uninstall

obtuse wind
#

i completely uninstalled it yes

sterile thicket
#

ok so, please help me with this...
no matter if the message.content is 5 rose or rose 5
But the variable would take the right one i.e

var amount = "5"; //number```
quartz kindle
#

uninstall it again

#

make sure it says that node doesnt exists when you try to run node -v

summer torrent
#

@sterile thicket do you want to parse number and string?

sterile thicket
#

yes

summer torrent
#

parseInt(message.content)

#

for number

grand rover
#

how i get tokens with the Casino Bot?

summer torrent
#

or use regex

#

ask Casino Bot's support server

obtuse wind
#

okay

#

im confused now

#

I just spammed node -v command in cmdprompt

#

that is very odd.

quartz kindle
#

Lol

obtuse wind
#

so does that mean I can install discord v12?

quartz kindle
#

its already installed according to that

obtuse wind
#

no im still using v11 for d.js

sterile thicket
#

parseInt(message.content)
for number
@summer torrent that gives me NaN only

obtuse wind
#

now my computer is not finding npm im confused

sterile thicket
#

I meant, I want to take only those args which has number only and also tale that arg which has alphanumeric chracters

digital ibex
#

close cmd and open it again, trixinity

obtuse wind
#

uh ok

#

my npm changed from 6.9.0 to 6.14.0 so yay?

digital ibex
#

<args>.match(/^\d/) @sterile thicket to check if its a number

obtuse wind
#

changing discord to v12 would be npm install discord@12.3.1 correct?

opal plank
#

or npm update to update all outdated packages

cinder patio
#

or just npm i discord.js

#

to get the latest discord.js version

obtuse wind
#

ill use that instead cause its saying no target found for discord@12.3.1 so

quartz kindle
#

if you already have v11 installed, it wont update to v12

#

you have to either npm i discord.js@12, or uninstall v11 first

obtuse wind
#

okay now that everything is updated to cough v12 and higher; i guess I have to scratch my programming cause nothing has .cache.

cinder patio
#

yup

rotund wave
#

It happened that my bot has some problems with the api code, my bot has music content, and when I want to play a stream from youtube my bot just comes in and says it finished playing the song, I tried various ways to fix it but I didn't succeed, all I learned was something to do with this -> curl -I https://discordapp.com/api/v7/gateway

#

I get an error ;3

#

@drowsy sentinel

summer torrent
#

then show error

drowsy sentinel
#

I wouldn't know what you're doing, that's not much context.

rotund wave
#

Unfortunately my console doesn't get any error or anything like that, the console behaves quite normally

real niche
#

So there was no error?

summer torrent
rotund wave
#

I tried to play music on my bot but stream music, she interrupted the music and said that the music was finished, but nowhere in the console showed an error, and if the streamers were working normally

#

curl -I https://discordapp.com/api/v7/gateway

#

This is a bug I found and which others told me was a real problem for letting the stream over the bot

quartz kindle
#

music issues happen all the time for a variety of reasons

#

the problem can be anywhere from youtube to your code

rotund wave
#

I have tried it on other bots and it works normally

quartz kindle
#

other bots you made or bots from other people?

rotund wave
#

I went through the glitch forum I apologize for the ad, and they said it was a mistake is there any way to fix it?

#

From other people

quartz kindle
#

glitch has a lot of issues with bots, most people are moving out of glitch

#

do these other bots that work also use glitch?

rotund wave
#

I have my own host

quartz kindle
#

then fixes from the glitch forum wont apply to you

rotund wave
#

Ufff

#

Can I show you the mistake, to see better when it enters the channel?

midnight blaze
thorny kraken
#

As in generate an image?

midnight blaze
#

is the best way to create a gif? the problem is that the time is delayed and not 1to1 correct

#

is there like a way to show a gif with the correct time/seconds?

thorny kraken
#

There isn't really an accurate way since the gifs would be delayed by latency (which can be compensated for), and discord's preview server latency, which is significantly harder to compensate for

#

It's definitely possible to get within a couple seconds accuracy, but not by milliseconds

midnight blaze
#

meh, I wish there would be a way tho 🤔 maybe we can edit the canvas every minute?

thorny kraken
#

If you were to make it generate an image based off of the minute, you can probably get away with a very simple api

midnight blaze
#

I see, I guess api is the only way rip

thorny kraken
#

If you wanted to do it yourself you could easily do it with image manipulation APIs

#

It should just be overlaying 3 elements on top of each other (background, hours and minutes hand)

#

Then just rotate them a bit depending on the current time and it would work

midnight blaze
#

🤔 I had this in mind already, I guess this is the way to do it. thanks for the ideas

drifting wedge
#

whats a check for python to check if ur alone in the vc with the bot:

sudden geyser
#

I don't think there's a built-in check for that.

#

You'll need to write your own.

quartz kindle
#

check how many members are in a voice channel

viral spade
#

After a couple of hours running my bot restarts because of a mysql "Connection lost" error. I thought all my connections errors are handled.

I connect to one manager and one data db (might be multiple data dbs in the future) in these two files:
dataDb: https://pastebin.pl/view/b72ee237
managerDb: https://pastebin.pl/view/6169f083

Any idea why the error occurs or how to prevent a restart of the bot?

dreamy cedar
#

is there anyway ask the user for multiple inputs
i tried collectors but it works only with the first input

drifting wedge
#

using mongo and python

#

how do i make a command

#

client.command doesnt work

sick cloud
#

how do websites like github store code

viral spade
#

@dreamy cedar Havent tried them out, but maybe on collection of the first message, start the next collector?

dreamy cedar
#

u mean i put collector inside another collector
i dont think that it will work

earnest phoenix
#

how can i convert the base64 image type to .setThumbnail?

quartz kindle
#

try Buffer.from("image data here","base64")

sick cloud
#

and if you're on djs use messageattachment

sweet kestrel
#

I lost my email to login to discord

sick cloud
#

yet you're on discord

#

makes sense

earnest phoenix
#

send a message if args[0] contains the letters a b c
how can i do that

karmic compass
#
if(args[0].includes("a") || args[0].includes("b") || args[0].includes("c") {
  //Code
}
#

bnruhw awit

#

ok thats the one

earnest phoenix
#

thx

sweet ruin
#

Hello All! I am creating audit logs. and this is how i doing them

client.on('inviteDelete', async (invite) => {```
#

my problem is that it isnt working for memberUpdate

#

or any of those

#

how do I get the object for that?

quartz kindle
#

audit logs and events are two different things

#

what are you trying to do?

sweet ruin
#

im on the official discord.js website

#

and it has it all under here

quartz kindle
#

yes

#

those are audit log actions, not events

#

there is no client.on("audit log action")

#

its not an event

sweet ruin
#

but messageDelete is?

quartz kindle
#

messageDelete is an event

opaque eagle
#

Here's my code and some info about random(). Why does TS think that res is of type any and not ImgurResult?```ts
const res = await fetch(IMAGE_API)
.then(res => res.json())
.then(body => Util.random<ImgurResult>(body.data));

random<T>(source: ArrayLike<T>, before?: number, after?: number) => T;```
earnest phoenix
#

Here's my code and some info about random(). Why does TS think that res is of type any and not ImgurResult?```ts
const res = await fetch(IMAGE_API)
.then(res => res.json())
.then(body => Util.random<ImgurResult>(body.data));

random<T>(source: ArrayLike<T>, before?: number, after?: number) => T;```

@opaque eagle
because it is, running json() converts the string into an object, ts doesn't know which one magically

#

cast it as Promise<T>

opaque eagle
#

Oh, I thought that it'd infer it's ImgurResult since Util.random returns objects of that type

earnest phoenix
#

might be because of the anonymous object as the type in the promise

#

oh no wait

#

res is whatever fetch returns

#

check if node fetch has types

#

you can then do (res: thetype) =>

dreamy cedar
#

is there anyway ask the user for multiple inputs
i tried collectors but it works only with the first input

earnest phoenix
#

how do i get .setImage motd for minecraft command? do you know api

#

huh

sharp thicket
#

see it says missing user_image query when you click it

ivory wasp
#

Hii

earnest phoenix
#

Hello

drifting wedge
#

How can I check if there is only the bot in a vc?

sick cloud
#

members size === 1 && that member id === your bot id

drifting wedge
#

@sick cloud for me?

sick cloud
#

yes

chilly mason
#

hi

#

can someone help me ree

drifting wedge
#

how do i run a command

#

like how do i make a command

#

client.command doesnt work

#

like @client.command

chilly mason
#

i have the worst command format

drifting wedge
#

@chilly mason wut u need?

chilly mason
#

it takes 9 hours to make like 2 commands

#

uh

#

i need to make an embed

#

and itd not working

drifting wedge
#

wut lib?

dusk vault
#

it takes 9 hours to make like 2 commands
@chilly mason bro i make a command every 5 mins lmao

chilly mason
#

?

ember lodge
#

why the audio doesn't play?

dusk vault
#

bruh dont spam

chilly mason
#

i suck at coding, im kinda new to coding too and its not working reeeee

drifting wedge
#

@chilly mason

dusk vault
#

check docs?

drifting wedge
#

yea ok but what do u need help?

#

for

#

?

chilly mason
#

here

#

ill make a pastebin

drifting wedge
#

WHAT LIBARARY?

chilly mason
#

?

drifting wedge
#

is it discord py

chilly mason
#

idk i think its js

#

im too stupid

drifting wedge
#

cant help sorry

chilly mason
#

oof

#

can anyone else help

chilly mason
#

no

dusk vault
#

yes

#

@ember lodge

#

the user must take an action before playing sounds

#

like clicking

modest smelt
#

hey guys

dusk vault
#

its a security restriction

lament meteor
#

there is an autoplay tag iirc

modest smelt
#

i have a question

#

how do i make a command for premium users in discordpy

dusk vault
#

there is an autoplay tag iirc
@lament meteor it wont work unless the usee clicks

lament meteor
ember lodge
#

but it doesn't work automatically?

modest smelt
#

how do i make a command for premium users in discordpy

lament meteor
modest smelt
#

anyone gonna help?

lament meteor
#

it doesnt require input

dusk vault
#

step 1: learn python
step 2: learn discord.py
step 3: use a different language jkjk

modest smelt
#

how do i make a command for premium users in discordpy

dusk vault
#

bruh

modest smelt
#

can someone at least say something

#

any ideas

lament meteor
#

depends on how u are getting the premium

dusk vault
#

I DID

chilly mason
#

how do i make a embed im new

lament meteor
#

or payment

modest smelt
#

@lament meteor wdym

#

i want it to be paid

lament meteor
#

how do u plan to get the payment

dusk vault
#

ima head out, people here make my head hurt and i want to stab things bye

modest smelt
#

probably pay pal?

dusk vault
#

cya later

lament meteor
#

is it gonna be like monthly or lifetime?

#

@dusk vault lol this is kinda shithole

modest smelt
#

monthly

lament meteor
#

hmm

chilly mason
#

'd

modest smelt
#

btw this is for discordpy

lament meteor
#

u could probably give them a role every month and check if they have the role

modest smelt
#

@chilly mason i can help u after im done with ur embeds

#

but that will only work in 1 server

chilly mason
#

ok

ember lodge
lament meteor
#

make sure they are in the support server and check the role there

#

show ur code?

modest smelt
#

@lament meteor again, that would only work in my server

lament meteor
#

u could probably hide it with css

modest smelt
#

what if they don't want to join the support server

chilly mason
#

i created the embed code but it doesnt work

ember lodge
#

how do i do it when i click the button?

modest smelt
#

@chilly mason is this discordpy?

ember lodge
#

when i click a button with ID: mybtn it reproduces that audio

chilly mason
#

@modest smelt i think its discord.js

modest smelt
#
#embeds = variable
embed = discord.Embed(title = "Name it whatever", description = "Description")
embed.add_field(name = "Whatevs", value = "Whatevs", inline = False)
#inline = False just means that it will start a new line. if you want more than one command in a line, just ignore that command. Play around with it
#hopefully u using ctx
await ctx.send(embed = embed)
#you put embed = variable name. i made my variable = embed
```code in python
chilly mason
#

im js

modest smelt
#

oh

#

then idk

lament meteor
#

@modest smelt if they are paying for something it doesnt hurt to join a server

modest smelt
#

i guess so

lament meteor
#

thats how Timo's(one of the moderators) bot does premium

modest smelt
#

ok

#

ill look more into it l8er

#

thanks for your help!

lament meteor
#

i personally use patreon

#

and cuz it automatically adds a role when someone subscribes

modest smelt
#

how do u use patreon?

#

can u help me setup?

lament meteor
#

sadly no

modest smelt
#

oh ok

lament meteor
#

@chilly mason what error did you get?

chilly mason
#

i didnt get an error the command just doesnt work

lament meteor
#

@ember lodge wut do u mean?

chilly mason
#

here is my command

lament meteor
#

hmm

chilly mason
#

ignore the yeet and spam commands

ember lodge
#

well what i mean is to reproduce the audio automatically when the user enters the website

lament meteor
#

hmm

chilly mason
#

when i do -embed it doesnt do anything

lament meteor
#

@chilly mason try to add like a console.log in the cmd incase the cmd itself isnt running

chilly mason
#

wait what

#

im new so where is cmd

lament meteor
#
} else if(command === 'embed'){
console.log('yes i am working')
        const testEmbed = new Discord.MessageEmbed();
        testEmbed.setTitle('User Info')
        testEmbed.setDescription(`Username: ${message.author.username}\n ID: ${message.author.id}`)
        message.channel.send(testEmbed)
    }```
#

if you get a message in the console then that is weird

chilly mason
#

ok

lament meteor
#

@ember lodge can u send ur current code?

#

its ok if u just give a snippet

ember lodge
#
       <audio controls autoplay>
        <source src="https://cdn.glitch.com/5be59cbc-4cc9-497d-b104-80bbeeeadb6a%2Fstart.mp3?v=1599010773482" type="audio/mpeg">
        Your browser does not support the audio element.
      </audio>
#

that's the part of the audio

lament meteor
#

does it autoplay?

ember lodge
#

nop

lament meteor
#

hmm

#

dm me the link let me see

chilly mason
#

it just says my bot is online

#

nothing else

ember lodge
#

it's on local host

lament meteor
#

oh

ember lodge
#

well i think if i can't

chilly mason
#

wait whats wrong with mine

ember lodge
#

how do i play it when i click a button?

dusk vault
#

if you make it autoplay

chilly mason
#

ohh

lament meteor
#

how you handle inputs seem to be wrong

dusk vault
#

it will automaticcally play when you click a button

chilly mason
#

i forgot to do the -embed

ember lodge
dusk vault
#

or the page

lament meteor
dusk vault
#

yes

chilly mason
#

i got this warning

dusk vault
#

because user input lets the browser play audio

#

otherwise it simply WONT

#

iirc a keypress works too

lament meteor
#

there are workarounds

dusk vault
#

no there arent

lament meteor
chilly mason
lament meteor
#

i suggest learning js?

#

like i cant rlly help u if u dont understand errors like that sad

ionic dawn
#

What you guys talking about? blacklol

chilly mason
#

reeee

#

bruh

earnest phoenix
#

You can't calculate the antenna without transcoding the wireless UDP pixel

#

Is there a way to quit using && every time I want to run more than 1 function on a line?

#

If we transcode the antenna, we can get to the HDD array through the ethernet DHCP address

#

JS related

#

wdym

#

example

#

send

#

plox

#

Let’s say I want to run 2 sql.run functions at once

#
func()
func()

func(); func()

#

Rn I’m doing sql.run(blah blah) && sql.run(other blah blah)

#

there are two otpions

#

idk why you would necessarily want them on the same line

#

Alright I’ll try it

sonic lodge
#

you dont need the && either

earnest phoenix
#

Okay thanks

#

or ; for that matter i think considering its functions

eternal zodiac
#

Hi

#

!Rank

earnest phoenix
#

func(); func(); func(); func(); func(); func(); func(); func();
this.func() = func(t);
this.func() = func(func(t));

wanton anvil
#

I want power rangers pics can anyone suggest a api for me

#

web api is preferable

#

ping me on answer please

earnest phoenix
#

google api

winter urchin
#

Hi

earnest phoenix
#

@mint thicket ban speedrun

#

also

#

-development

mint thicket
#

Ez

earnest phoenix
#

is there any discord server for discord support

restive furnace
#

discord-testers iirc

uncut vortex
#

Hey I have a question how do you make it so on discord.js you add multiple reactions at once instead of one at a time.

pale vessel
#

you can't

twin shoal
#

just add them one at a time

uncut vortex
#

Yeah its just slow

earnest phoenix
#

It's been 32 hours since my last login from my bot.
None of my heavy codes for this bot doesn't work.
Everything I login, every event loads BUT the ready.js event.
Debugging just shows it heart beating but never readies up.

If you have a solution, please help me
This code works instantly on my other bots, my main bot however, doesnt work.

What is interesting to me is that my bot still logs events even when its offline, not to mention I resetted its token 10 times already. It still logs events.

const config = require('./config.json');
const { Client } = require("discord.js");
const client = new Client();

client.on("ready", () => {
    console.log("READY")
});

client.on("error", (e) => console.error(e));
client.on("warn", (e) => console.warn(e));
client.on("debug", (e) => console.info(e));

client.login(config.tokens.main).catch(console.error);```

This is literally the whole code if you're wondering
#

When it logs its events, everything is undefined but its guild size.

#

It still somehow logs even when its offline.

ionic dawn
#

Dont understando

earnest phoenix
#

ugh, ill make a video 1 sec.

ionic dawn
#

What should the bot be doing and is not doing?

#

Show does numbers and that undefined?

earnest phoenix
#

monkaTOS

#

Alright sending the video, hopefully you can figure it out

#

imma just refresh its tokens now ._.

#

how can bot use gif emotes

ionic dawn
#

^ Appy your bot

#

And @earnest phoenix I can't really tell, I dont think im the right guy to help you, but if the bot goes on but dnt load anything it dsnt even mean the bot is good, propably reach the login part but have an error or skip the next thing and is now stuck at the READY

slender thistle
#

@heavy crown you're 12?

ionic dawn
#

Discord ToS

earnest phoenix
#

incoming punishment

#

@ionic dawn all events are listed, error, debug, and warn

#

if there was an error then it should of logged it

ionic dawn
#

Well I dont really know your strucure but, perhaps you missing somthing or as I say, is stuck on something at loading

#

Mayb any typo, or is just a copy paste from one of your bots?

#

Did he deleted the messages?

golden condor
#

Banned

uncut vortex
#

@earnest phoenix this may not work but maybe try replacing
const { Client } = require("discord.js");
const client = new Client();
with
const Discord = require('discord.js');
const client = new Discord.Client();

earnest phoenix
#

that is literally the same thing

#

#1 is lighter than #2

uncut vortex
#

Basically yeah but simple things can can mess it up

trim saddle
#

@slender thistle why does batman beat someone unconscious and then say "NOW TALK"

#

wait this is development

#
if batman.attack == 999:
    question_response("NOW TALK")
full leaf
#

Has any1 connected top.gg webhooks to .netconsole app before and could explain the process to me to get that to work 🤔

#

rn im checking vote list / has uservoted yet on vote command but seems inconsistent and has delays

trim saddle
#

who uses top.gg webhooks off discord

earnest phoenix
#

if i do:

const phin = require("phin");
phin({
  url: "https://some-random-api.ml/TELK/IS/A/QT",
  method: "GET",
  parse: "JSON"
});

how is phin parsing JSON?? The recieved response is in HTML so it doesn't make sense to me

pale vessel
#

because that url's response is not a valid json? @earnest phoenix

earnest phoenix
#

the response is: types

pale vessel
earnest phoenix
#
<html>
  <body>
    <pre>
      {"something":"something"}
    </pre>
  </body>
</html>

If i put that in my browser it will show::

{"something":"something"}

But that's still HTML right? Then how can it parse JSON?

#

@pale vessel

earnest phoenix
#

yes

#

@earnest phoenix JSON.parse();

#

lemme just copy paste the code from one of the endpoints of the API

#

thef fuck

#

my browser added those extra html thingies

#

the actual response is JSON

pale vessel
#

yeah

#

browsers do that

earnest phoenix
#

my brain hurts
the trash inside is too weird

#

@earnest phoenix JSON.parse();
@earnest phoenix waitWhatwaitWhatwaitWhat

#

JSON.parse('{}');

#

what are you even trying to say

#

JSON.parse(response.body);

#

no

#

Thats how it parse it

#

i don't do that

pale vessel
#

no

earnest phoenix
#

JSON.parse

#

@pale vessel wdym

pale vessel
#

it should parse it with the parse: "json" option

earnest phoenix
#

i just pass parse: "json" in the options object

#

it should parse it with the parse: "json" option
@pale vessel both ways work

pale vessel
#

i'm aware, yes

earnest phoenix
#

And

#

You want to know how it parse?

#
phin({
  url: "hayper gay",
  method: "flazepe's method",
  parse: "JSON"
});

Is the same as```js
phin({
url: "hayper gay",
method: "flazepe's method"
}).then(response => {
JSON.parse(response);
});

#

lol

pale vessel
#

response.body

earnest phoenix
#

i just toldya how to save three lines of storage space
no need to thank me

#

You want to know how it parse?

#

response.body
@pale vessel god it's an example

pale vessel
#

mmlol

earnest phoenix
#

I am confused

#

You asked how phin parse html?

#

to json*

#

@earnest phoenix alright so what

fluid basin
#

i just toldya how to save three lines of storage space
no need to thank me
one-liners: exists

earnest phoenix
#

Anyways this is how they parse it

#

who uses top.gg webhooks off discord

#

if (Object.parse.equals("JSON")) return JSON.parse(nddejwiwidje.bodyidklolhahha);
else if ...
else if ...
else if ...
else return witirebjwod

#

Thats how they do it

#

Simple if else and regurn

#

Return

#

Also no that is not spoon feeding

daring delta
#

Someone else that getting this error msg?
[JDA MainWS-ReadThread] WARN GuildSetupController - Accumulating suspicious amounts of cached events during guild setup, something might be wrong. Cached: 2000 Members: 1/134938 Status: CHUNKING GuildId: 264445053596991498 Incomplete: 6/7
The Guild ID is this discord and it have runned fine until i was going to restart the bot then i got it.
Have worked fine before. 😕

earnest phoenix
pure lion
#

:o

earnest phoenix
#

The "source code" forums

ancient nova
#

I made my bot's economy global

earnest phoenix
#

I didnt say anything about the website being bad, so why did you ping me for no reason

golden condor
#

Finna make stack underflow

cinder sandal
#

stackoverflow saved my life

green kestrel
#

there we go, added all the stuff to my bot so that i can award nitro to each months winner 😄

#

that took a while lol

dreamy cedar
#

is there anyway ask the user for multiple inputs
i tried collectors but it works only with the first input

uncut vortex
#

Does anyone know how to have multiple instances of code running at the same time linked to one user

clever vector
#

Hello guys

#

How i can track some other memes from other subreddit when my code is like this

#
const Discord = require('discord.js');
const fetch = require("node-fetch");

exports.run = async (client, message, args) => {
    let loadingEmbed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setDescription(`:loading: Generating a meme!...`)
    let msg = await message.channel
      .send(loadingEmbed)
      .then(m => m.delete({ timeout: 2000 }));

    fetch("https://www.reddit.com/r/Memes.json?sort=top&t=daily")
      .then(res => res.json())
      .then(body => {
        if (!body) return message.reply("I broke, try again!");

      const allowed = message.channel.nsfw ? body.data.children : body.data.children.filter(post => !post.data.over_18);
      if (!allowed.length) return message.channel.send('Hmm looks like an error to me...');
        const randomnumber = Math.floor(Math.random() * allowed.length)
       
    let url = `https://www.reddit.com${allowed[randomnumber].data.permalink}`
    let embed = new Discord.MessageEmbed()
      .setTitle(allowed[randomnumber].data.title)
      .setURL(url)
      .setImage(allowed[randomnumber].data.url)
      .setDescription("**-----------------------------------**")
      .addField("Upvotes and Comments", `:upvote: **${allowed[randomnumber].data.ups}** | :comment: **${allowed[randomnumber].data.num_comments}**`)
      .setColor("RANDOM")

    return message.channel.send(embed);
    });
  }

exports.help = {
  name: "meme",
  description: "Checkmate some memes from Reddit",
  usage: "meme",
  example: "meme"
}

exports.conf = {
  aliases: [],
  cooldown: 3
}
golden condor
#

Hi I'm tryNa use a usb stick with a vm on virtual box, how can I attach a physical usb to it or make a virtual one, ping me if you can help or have an answer (ty)

quartz kindle
#

never used virtualbox, but on vmware when you attach a usb and you have the vm open and active in front of you, it asks you if you want to connect it to the guest or host

#

you can also go into some option in the toolbar to connect/disconnect usb devices from the vm

earnest phoenix
#

too much )

#

also

#

please don't use glitch to code

#

bad idea

#

oof

#

use real ide

#

like vsc

pale vessel
#

too much )
@earnest phoenix read the code lol

earnest phoenix
#

yes

#

look