#development

1 messages · Page 1155 of 1

earnest phoenix
#

Hello

#

can someone help me

strange raven
#

@earnest phoenix javascript discord.js sumthing, im new to coding

earnest phoenix
#

so

#

uh

#

you need to get guild data

#

which can be done by doing

#

uh

#

#Client.guilds.cache

#

it will return an array of all guild that is cached

#

but every guild is cached on startup so

#

just get the array length

#

that's all

strange raven
#

do i just put Client.guilds.cache in the code wym

earnest phoenix
#

@tight plinth explain please

tight plinth
#

client = your bot client
client.guilds = servers your bot is in
client.guilds.cache= the actual list of servers (this is a map)
client.guilds.cache.size = the size of the map containing all servers your bot is in

#

try now to guess which one is the number of servers your bot is in

earnest phoenix
#

thank you friend

strange raven
#

oh i got it, thanks guys it just tells me a straight number

#

17

#

is there a way to see members

tight plinth
#

read docs

earnest phoenix
tight plinth
#

im not gonnado the same thing again

#

yo should get how to do it now

surreal sage
#

How do i covert a collection to json again? btw json.stringify returns a empty json thing

earnest phoenix
#

map to an array

#

collections are a complex form, you need an array iirc

pale vessel
#

use collection#array()

restive furnace
#

i forgot, but how i could make async function without needing to call it, like something (async () => console.log("ran this thing"))?

pale vessel
#

(async => something())();

placid iron
#

is there a server somwhere with emojis with the names of the public flags?

strange raven
#

ive tried looking on docs but cant find it

#

is there anyone who knows how to see my bots user count

sudden geyser
#

@strange raven what library

strange raven
#

javascript

sudden geyser
#

that's a language; not a library.

#

Are you using Discord.js

delicate shore
strange raven
#

discord.js yea sorry

delicate shore
#

Ok

sudden geyser
#

There are two ways you could do it.

The first one is simpler, which is to check the <Client>.users manager for a collection of cached users (.cache.size). However, this is only for cached users. It does not include every user.

The second alternative is to iterate over the <Client>.guilds manager (still has a .cache property). For every Guild in it, add up the .memberCount property, which is the total member count for a guild (including offline members). Using the .reduce function on the guilds manager is also helpful.

For example (the second one), reduce's structure looks like this (the first argument is a function you pass, the second argument is the initial value): js <Client>.guilds.cache.reduce(...)

astral yoke
#

why isnt this working

#

bot.guilds.members.get.random()

placid iron
#

we be doing things

strange raven
opal plank
#

reduce is a function

delicate shore
digital ibex
#

ok

delicate shore
#

A

opal plank
#

me and woo were talking about it couple hours ago

#

been checking out whats up with it for a couple hours now

delicate shore
#

Oh

opal plank
#

nothing major imo

delicate shore
#

Ok

strange raven
opal plank
#

because cache is a map

#

you need to iterate thru the map to get its values/properties

#

@strange raven

strange raven
#

im so lost

opal plank
#

you know what map is?

strange raven
#

no

opal plank
#

then read this

#

actually

#

nonon

#

thats array

#

this is map

sudden geyser
#

why isnt this working
@astral yoke,

  1. What version of Discord.js are you using?
  2. .get is a function. You can't call .random(...) on it. But if you remove the .get part, you can use the random method given to the collection instance.
astral yoke
#

12

digital ibex
#

why not just use size instead of complicating it?

sterile thicket
#

I'm using this code rn, https://hastebin.com/ogomaxufax.js for a voting poll thing
and when I set a, say, 30 secs poll and the first 10 sec I just react and take it back and then react again and so on, as a result, it doesn't count my vote..
can you help me find where should I make changes and with what?

sudden geyser
#

OfficiallyLost because it's not accurate

opal plank
#

howcome?

sudden geyser
#

It only contained cached users

#

not every user

opal plank
#

well yeah

digital ibex
#

so would doing that?

opal plank
#

idk if random() will do anything different

strange raven
#

so what do i have to do to get it to work

opal plank
#

havent checked that method

digital ibex
#

if thats ur issue then

astral yoke
digital ibex
#

cache all users

opal plank
#

@strange raven you need to access a value in a map first

#

do console.log(client.guilds.cache) and see what it returns, that'll give you a good visual idea

sudden geyser
#

scltxn there's no .members property on <Client>.guilds. what are you trying to do

astral yoke
#

im trying to get a random member from a random guild my bot is in

opal plank
#

do math.random with the size of the guild.cache

#

then fetch that guild members, and do another math random

#

¯_(ツ)_/¯

sterile thicket
#

I'm using this code rn, https://hastebin.com/ogomaxufax.js for a voting poll thing
and when I set a, say, 30 secs poll and the first 10 sec I just react and take it back and then react again and so on, as a result, it doesn't count my vote..
can you help me find where should I make changes and with what?

opal plank
#

cache => math.random(cache.size)
random cache => get members
member => math random.(members.size)

#

@astral yoke

sudden geyser
#

Not Erwin why do that when there's a dedicated method for it

opal plank
#

cuz i usually avoid a lot of bad code in d.js

strange raven
sudden geyser
#

How is it bad?

opal plank
#

@strange raven what did your console return?

#

not that specifically, i just avoid using d.js whenever its possible

#

the method likely does something similar either way

strange raven
#

a bunch of stuff

opal plank
#

did any of those 'stuffs' have memberCount in it?

balmy anchor
#

does anyone knows how to make something like a clickable text that opens link?
for example:

[Click Here]

and it opens link?

opal plank
#

embeds

placid iron
#

anyone know what a team user is and if they have a badge

opal plank
placid iron
balmy anchor
#

i know tried it but it doesnt work

opal plank
#

it does

strange raven
#

member count is 3 but that doesnt make sense because my bots in 17 servers

opal plank
#

some fields cant have links tho @balmy anchor

placid iron
#

@balmy anchor if you want the link to be in the code block you have to do: `text`

opal plank
#

iirc only description and fields can have it

strange raven
#

there mutiple member counts

placid iron
#

^ what erwin said

strange raven
#

there another one that says 103

opal plank
#

did you bother looking at the link i sent you?

strange raven
#

yes i did

opal plank
#

then you didnt properly read it

balmy anchor
#

i cant understand how you did that @opal plank

#

wut

opal plank
#

map doesnt have .memberCount property in it

balmy anchor
#

im currently using d.jda

opal plank
balmy anchor
#

so i just need to make an embed and do like u did?

opal plank
#

you should read the whole thing btw

#

embeds yeah

#

you need embeds to display links like that

balmy anchor
#

ok ill try

#

ok wait

opal plank
#

specifically description / fields

#

those allow for those link formats

trim lark
#

i stickied an error message and spent 45 mins wondering why i was getting errors

strange raven
#

this is to advanced for me, sorry for wasting your time, atleast i got server count

opal plank
#

tip: you should really learn Maps in js

#

its one of the basics

placid iron
balmy anchor
#

@opal plank Thanks it's working!

pale vessel
#

that developer badge is so hd

#

here

#

staff too

strange raven
#

is that showing every user

opal plank
#

@balmy anchor np

#

@strange raven all cached users, yes

placid iron
#

@pale vessel yeah i did it quickly and downloaded svgs locked to 20px for some reason lmamo

pale vessel
placid iron
#

pog

tight plinth
#

lol

misty sigil
pale vessel
#

most of them are 74x74 (actual size being 64x64 but with 10px padding

tight plinth
#

the thing is that you need another server to handle every emote lol

pale vessel
#

look good in embeds

earnest phoenix
#

looks good

trim lark
#

looks nice

earnest phoenix
#

looks (insert smth here)

earnest phoenix
coral trellis
#

Let's keep the topic development related please

still merlin
#

I tried using <icon> tags but that didnt work :/

solemn latch
#

You know you can just inspect the page and see what it is

pale vessel
#

@still merlin it's the link tag

still merlin
#

Cool, Thanks!

pale vessel
#

icon is for rel, <link rel="icon" href="image">

still merlin
#

Very epic, Thanks again

pale vessel
#

putting favicon.ico in the root directory also works but i never tried it

#

ye all good

earnest phoenix
#

what's the original

#

link

pale vessel
earnest phoenix
#

hi

#

how to make my bot blacklist the bad users

#

anyone here

pale vessel
#

make a blacklist system

#

if the user id is in the database, don't respond or do something

restive willow
#

how can you check if a message has a link in it?

pale vessel
#

use regex if you really need it to be accurate

restive willow
#

was just wondering if there was a method

#

for it

pale vessel
#

or otherwise look for http or something

#

if you're using node, you can probably use the build in url module

earnest phoenix
#

oh will that blacklist them? can i set the the while to blacklist them

stable eagle
#

.setDescription('${args[1]} is already your prefix dude.')

I have a problem with this not converting the first argument you put in your command, it instead does this output:

earnest phoenix
#

@stable eagle you're using ' to define your string

#

you need to use template literals

#

`

#

@earnest phoenix can you dm me i need to ask something

#

you can ask your question here

#

is not related to server

#

ok

fast trench
#

How i can play a playlist in discord.js and ytdl-core?

cinder sandal
#

how much time it takes to approve the bot

sinful belfry
fast trench
#

3-4 Weeks i mean

old ferry
#

how to get random user if message.content === "@random " ?

ionic dawn
#

reeperk i think there is a tutorial about ytdl

solemn latch
#

You mean getting a user from a mentuon?

old ferry
#

yes

solemn latch
#

Djs?

old ferry
#

I'm french i don't understand sorry

ionic dawn
#

Like "/ban @granite pagoda" ?

solemn latch
#

<Message>.mentions.users.first()
Or
Use regex

ionic dawn
#

Sry I pong someone

pale vessel
#

i think he meant get a random user if the content is "@hollow fossil"

#

fuck

solemn latch
#

Lmao

old ferry
#

i think he meant get a random user if the content is "@hollow fossil"
@pale vessel yes

solemn latch
#

Its their fault for having terrible usernames

#

?

jolly hatch
#

Excuse can someone help me ?
when i do member.roles.add(the role name);
that say (node:9640) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'add' of undefined

solemn latch
#

Djs 12?

jolly hatch
#

Yes

solemn latch
#

Is member properly defined as a member not a user?

jolly hatch
#

Yes

#

let member = message.mentions.users.first()

solemn latch
#

Thats a user

jolly hatch
#

Oh

solemn latch
#

Also, I dont think role names are role resolveable.
https://discord.js.org/#/docs/main/12.3.0/typedef/RoleResolvable

surreal sage
#

There is a api that generates fake bot tokens. What is it named?

solemn latch
#

That seems simple to do by hand

surreal sage
#

How then 👀

kindred musk
#

Does anyone know how to use AWS Lightsnail, i dont know how to get my bot file onto it 😐

proven dragon
#

What are the other activites for status
e(activity=discord.Game('Watching Servers'), status=discord.Status.online)

discord.Game is playing(watching servers)

What else can i use for like watching, listening

sudden geyser
solemn latch
#

I could not for the life of me find that

sudden geyser
#

r. danny best

proven dragon
#

What are the other activites for status
e(activity=discord.Game('Watching Servers'), status=discord.Status.online)

discord.Game is playing(watching servers)

What else can i use for like watching, listening
@proven dragon ?

solemn latch
#

Docs

still merlin
#

I'm trying to make a tag command for my bot but idk how, How do i pick up something just in like 2 double quotations, Can someone help me with that like what kind of stuff I'd need to do?- So like the title would only pick things up if it was in the first quotation marks it would only show that stuff ("tag title" "tag message" "tag footer" "tag colour" like that)

sudden geyser
#

So you want to capture all the text in quotes

still merlin
#

yes

slender thistle
#

Regex sounds appropriate for your case, imo

still merlin
#

Thanks

sudden geyser
#

Another way I like separating fields for input is by spacing them out with a bar (|) so the user can do my title | my description | my footer | etc. Quotes are also a good way

slender thistle
#

Allowing the user to use quotes in the command, though 🤔

#

Eh, there's the option of (!\\")

solemn latch
#

-stuff -other stuff
--group of stuff -stuffingroup -other stuff in group

#

Lots of ways to handle multiple things, all of them terrible

#

You know what would be cool?
Forms.
Like embeds, but where you can enter info

#

And it gets sent to the bot that made it

still merlin
#

Okay cool, thankyou

slender thistle
solemn latch
#

Yeah, like that. But in discord

slender thistle
#

That would be quite interesting

vocal forge
#

Hello there, I have a bot which create a temp voice channel and delete it when no one's in it anymore, the problem is that when setting up overwrites, the bot don't have enough perms to delete the channel
in the overwrite the bot have manage channel perm

viral lynx
#

Ay, I need help

misty sigil
#

what

#

please just say your question

viral lynx
#

I am new at scripting, I saw YT tutorial but I can’t do anything.. in Command Console I choose folder, and mpn init

#

And a different thing shows up

misty sigil
#

It’s npm

viral lynx
#

Tried it too

misty sigil
#

Is node installed?

viral lynx
#

Ye

misty sigil
#

try node -v

viral lynx
#

Maybe it’s my device.. I have Windows 8.1

misty sigil
#

what does node -v say

viral lynx
#

Let me write it

#

My bad, I did it when node.js was installing bruh

solemn latch
#

F

cinder sandal
#

how to make the bot status update every 5 minutes or something
status code:

client.user.setActivity(`<help | In ${client.guilds.cache.size} Servers | With ${client.users.cache.size} Member(s)`);```
misty sigil
#

setInterval

cinder sandal
#

what should i put it the ()

solemn latch
#

The function

slender thistle
solemn latch
#

The doc shiv linked also explained it

cinder sandal
#
setInterval(()->{
// code
}, 5000);```
like that
#

misstyped

#

5000 not 500

solemn latch
#

5000 is 5 seconds

cinder sandal
#

also set interval looks like this

setInterval(() => {
// insert code here
}, 5000); // time```
obtuse jolt
#

how can I use time stamps to check if something is valid with json and d.js

#

Idc that it’s json it’s for caching literally i don’t need it to be reliable

#

It just needs to work

cinder sandal
#

ty, seems to be working

solemn latch
#

If something is valid?

#

Like a valid timestamp?

obtuse jolt
#

Yes like have something last for 3 days then update

#

hmm

#

It would make sense if you knew what it was for

solemn latch
#

If your just doing expire timestamps.
Just if the timestamp is older than now fetch the updated version

obtuse jolt
#

How would I do that

#

Idk how time stamps work

solemn latch
#

If(jsontimestamp < now)

ivory seal
#

hi, i have a command in which when a msg is deleted, it will send an embed. How can i get the time the msg was deleted

obtuse jolt
#

So how do I get what the time stamp would be in 3 days

#

@ivory seal in what language?

ivory seal
#

@obtuse jolt js

#

node.js

obtuse jolt
#

just Date.now() isn’t it

solemn latch
#

Now + 3 days in ms

#

Date.now() I think

obtuse jolt
#

Then convert it into days seconds and whatever

solemn latch
#

Yeah.
Idk 3 days in ms off the top of my head. Google can do that for ya

obtuse jolt
#

ok I’ll try what you said

#

My bot has a module that can do it

#

3 days is 259200000ms

#

If you ever wanted to know

slender thistle
#

A bit of an easy formula if you ever worked with those

#
>>> 3*24*60*60*1000
259200000
obtuse jolt
#

Eek

#

I’ll stick with the module

#

fml

slender thistle
solemn latch
#

Most time math is really simple anyway

obtuse jolt
#

Date.now() + 259200000

#

Can I delete this qtpoints database now

solemn latch
dire obsidian
#

hell yeah, noob incomming

slender thistle
#

Why does regex101.com think ! is for matching literally the ! character with gm flags 🤔

#

Unless I'm missing something, shouldn't it be the negate operator?

earnest phoenix
#

2 questions:
1- about bot submission, how do i make my bot public instead of private?
2- also, how do i make my bot stay online 24/7 so that it will be online when someone tries to test it?

rustic nova
#

Yo, can someone recommend me some good free translation apis if possible, or cheap ones yandLove

solemn latch
#

Is your regex in python on the site

#

Diffrent platforms have diffrent rules

slender thistle
#

ffs yes it is

obtuse jolt
#

@earnest phoenix get a decent host is the answer to your 2nd question

earnest phoenix
#

can you get it free?

rustic nova
#

2 questions:
1- about bot submission, how do i make my bot public instead of private?
2- also, how do i make my bot stay online 24/7 so that it will be online when someone tries to test it?
@earnest phoenix 1 It should be public if you didn't change anything and 2. get a vps

obtuse jolt
#

Not really

rustic nova
#

Nope

solemn latch
#

Also, your bots developer page has public/private option

obtuse jolt
#

There are places that do free trials

earnest phoenix
#

ah ok thank you

obtuse jolt
#

Like

#

uhh

#

Vultr

#

$50 free trial

#

And they offer $5 VPS servers

solemn latch
#

Probably could get a few years of vps's by just changing companies

earnest phoenix
#

haha

#

ok thank you

misty sigil
#

Anyone ever worked with MongoDB user authentication?

obtuse jolt
#

good idea?

misty sigil
#

Particularly in the mongo shell, when self hosting a cluster

solemn latch
#

Is there a reason you need it in json and not in memory?

obtuse jolt
#

Because I want it to last 3 days

#

Not for the bots uptime duration

solemn latch
#

Is your bot restarting often enough that it matters?

obtuse jolt
#

My bot restarts a lot

solemn latch
#

Ah

obtuse jolt
#

I do a lot of updates

#

It will be mostly reads anyway so it should be fine

#

And even if it does break, eh

solemn latch
#

You could just load the cache into memory at startup and update the json hourly.

obtuse jolt
#

Yes but it won’t be a set list of domains

solemn latch
#

Would lower the chance of corruption to almost nothing and speed it up.

obtuse jolt
#

It’s going to be user generated

#

So if a user requests it

#

It gets added to the database

#

Then if someone wants it again and it’s a valid time stamp

#

It uses the database

#

Instead of the 30 second actual scan

honest perch
#

Do you discordjs

solemn latch
#

I do discordjs

cinder sandal
solemn latch
#

Both are officially listed on the dev site

cinder sandal
#

i mean, are they made by discord itself?

honest perch
#

Not made by discord staff if thats what you're asking

#

No its community made

#

Discord can't even make a working client

solemn latch
#

They are vetted, they are not made by discord

surreal sage
#

Im trying to await reactions on a msg and a whole server should be able to react but i think a filter needs to have a user specified to it (Discord.js v11)

#
                                                const filter = (reaction) => reaction.emoji.name === "✅"
                                                reactionMsg.awaitReactions(filter).then(collected => {
                                                    console.log(collected.first())
                                                })```
solemn latch
#

I dont give support on deprecated lib versions someone else will have to help

surreal sage
#

(the .then doesnt run when someone reacts rn)

#

i didnt ask you to help

#

i asked everyone that can help

solemn latch
#

Oh I just say that because I think its important to inform users they are using something which is no longer actively supported

surreal sage
#

ok?

solemn latch
#

Using depreicated software is bad mky

surreal sage
#

not really

#

because you can change discord.js v11 endpoint with ez

solemn latch
#

Using any deprecated software is bad.
It was deprecated for a reason.

surreal sage
#

because discord changed the endpoint

amber fractal
#

no

surreal sage
#

because they changed domains

solemn latch
#

It was because intents

amber fractal
#

not just that, it's old and outdated in many other ways

solemn latch
#

Iirc

surreal sage
#

yeah but ok

#

im just trying to get help

amber fractal
#

You wont find a lot of help for deprecated stuff, most people use stable or master

solemn latch
#

^ most people here moved off 11 a few months back and learned the new methods.

obtuse jolt
#

Now I just have to integrate it

solemn latch
#

Ay

obtuse jolt
#

6 entries per domain

#

eek

solemn latch
#

🤔

#

Are you testing in production

#

You madlad

obtuse jolt
#

HEHE

cinder sandal
#

how to make the bot say a number between [number] and [number]

solemn latch
#

Google is a great source for that type of stuff

tulip ledge
#

Is it worth it to compress and decompress a string to save 12 bytes?

solemn latch
#

f yes, 12 bytes is everything

tulip ledge
#

is that sarcastic or no?

slender thistle
#

I can tell it is

#

I wouldn't say it's enough to consider compressing tbh

solemn latch
#

i dont think theres really any point unless your working with a 40 year old cpu with 256 bytes of ram.

tulip ledge
#

Cuz I just compressed a full inventory and it only saved 12 bytes

#

284
272

solemn latch
#

are you storing inventory items as strings?

tulip ledge
#

yes

solemn latch
#

you could store them as ID's instead
item id 1 is coins
in the users inventory they have item id 1: 300

#

would save a lot more space, without any need for compression

tulip ledge
#

but to display it I would need to convert it then right

#

I mean I can try but I'd have to rewrite a big portion of code

solemn latch
#

yeah, but thats practially no cpu time

tulip ledge
#

So how would I store it?

#

Like 1:300,2:30,3:50

solemn latch
#

well it really would depend on your specific structure and database.

tulip ledge
#

I'm using MySQL

#

I already use ID's for weapons and armors but thats cuz they have specific properties depending on the user

pure lion
#

I'm using yourSQL too

tulip ledge
#

They are like: UE73-EI7-EI23

pure lion
#

Is that UUID?

tulip ledge
#

yes

pure lion
#

Assuming v3

tulip ledge
#

I think so

#

So saving it like that would be better?

pure lion
#

What're you trying to do?

#

Wait I'll read up

#

You could use switch case

solemn latch
#

i actually would reccomend doing it in database.

pure lion
#

Or just make an I incremental ID system and use switch case

#

In your db

solemn latch
pure lion
#

Where it's saved

solemn latch
tulip ledge
#

284 -> Original
111 -> Using ID's
272 -> Original Compressed

#

I'd use like a JS or JSON file and use it like this:

module.exports = {
  1: "Item",
  2: "Item 2"
}
solemn latch
#

i use my database for it, but you could use json

tulip ledge
#

Alright I think thats how I'm gonna do it

#

And I'll probably compress item ID's

earnest phoenix
#

How To invite probot

tulip ledge
#

Cuz they are unique ID's

solemn latch
#

item id's i would think are already compressed no?

golden condor
#

@earnest phoenix not the right place

earnest phoenix
#

!invite probot

golden condor
#

In the pro bot page

#

There will be an invite button

restive furnace
solemn latch
#

if your counting in order, you cant really compress that any further.

tulip ledge
#

44
45
How is the compressed one more?

#

Lmao

#

Item ID's are the weapons theyre like: EUR4-EIEZ-OT94

solemn latch
#

that would be the items modifier no?

tulip ledge
#

?

fringe axle
#
.setImage(`https://api.alexflipnote.dev/floor?image=${member.user.avatarURL()}&text=${text}`)
``` Image won't load
#

@ me if you know why.

solemn latch
#

for example
1: coins
2: iron sword
3: arrow

users inventory would have
1: 300
2: 1 with a modifer of EUR4-EIEZ-OT94
3: 20 with a modifer of XXXX-XXXX-XXXX

tulip ledge
#

No as I store the inventory and weapons seperatly

solemn latch
#

youd have a list of all standard items
a db of all users items with each item having its own modifier

#

that probably is a waste of space then too

tulip ledge
#

I don't see a different way to do it

#

As I want to seperate the materials and the equipment

solemn latch
#

typically youd just flag that in your item database

#

1: coins, inv
2: iron sword, weapon
3: arrow, ammo
4: healing potion, inv

#

otherwise your storing users multiple times in multiple locations for no real reason.

tulip ledge
#

I can try that

#

I was also thinking, my friend stores a JSON object like this:
User: JSON Object wich contains all the things
And he compresses that object would that be better?

solemn latch
#

honestly, when your storing inventories based off an id system, i dont think you can compress it much anyway.

#

maybe 10% at most

#

i dont see why not, but id ask that in #support

tulip ledge
#

I think I'm just gonna keep it like it is rn and just use ID's for the materials

#

@solemn latch Sorry for tag but would I use an object then look for object[id] or would I make an array and use the ID to locate the index of the array?

solemn latch
#

you can use a map
let items = new Map()
items.set(id,{item object, or string})
items.get(id)

#

iirc, this is also a pretty common thing to do in mysql, if both your item list and user inventories are in mysql you can actually fetch all relevant data at the same time

tulip ledge
#

And I have no clue how to do that so I'll just stick with this

trim jay
#

how to make bot website

solemn latch
#

That requires a lot of knowledge

#

About front end and backend development

#

And how they work together.

misty sigil
#

frontend is tedious imo

solemn latch
#

Not saying you can't do it.
Just its kind of out of scope for this community and channel

trim jay
#

ohk

#

🙂

#

np

slender thistle
#

not really

#

No one really said frontend isn't development

solemn latch
#

I feels its too broad to answer.

#

Could just say github pages and buy a domain 🤔

slender thistle
#

Definition of development is broad too catshrug

solemn latch
trim jay
#

😂

earnest phoenix
solemn latch
#

🤷‍♂️ broad questions are hard to answer.
If you have more specifics I can help. Theres also a million resources online for making websites.
I have only done a few websites, and only know a few methods which may or may not be useful for what you want to do.

earnest phoenix
#

@ everyone

fervent goblet
#

is there a stream URL for dualfm

#

?

honest perch
#

yes

fervent goblet
#

how do i go about getting it?

honest perch
#

or check network stats

#

thats how most people get it

earnest phoenix
#

so...

#

Hey, does music commands require a database?

ionic dawn
#

Lé Spam

honest perch
#

Hey, does music commands require a database?
@earnest phoenix no

ionic dawn
#

but, probably not

honest perch
#

why would they

earnest phoenix
#

@earnest phoenix no
@honest perch okay, thanks

#

why would they
@honest perch but what about queue?

ionic dawn
#

no

honest perch
#

that doesnt need a db

earnest phoenix
#

oh

#

Thanks

honest perch
#

that would be a very bad and slow way of doing it

earnest phoenix
#

Yea

honest perch
#

but if youre playing from youtube

#

you will need multiple ips

earnest phoenix
#

Ye

honest perch
#

an ipv6 block

ionic dawn
#

imagine requesting data from a db every time you change a song

earnest phoenix
#

okay

#

Cheers

honest perch
#

imagine requesting data from a db every time you change a song
@ionic dawn you gave me the idea

ionic dawn
#

huh?

balmy anchor
#

does anyone knows how to check the if the author has perm blabla to use a command in jda?

kindred musk
#

does anyone know how to host a bot on AWS Lightsnail? Please ping me

solemn latch
#

lightsnail?

#

or lightsail?

frigid rivet
#

@balmy anchor jda ?

kindred musk
#

or lightsail?
@solemn latch is that 2 different thing?

solemn latch
#

one, i dont know what it is

#

the other is a vps

balmy anchor
#

doesnt matter anymore its ok

solemn latch
#

on lightsail, you can just use ssh to connect.
i recommend bitvise for ssh and sftp

kindred musk
#

@solemn latch its lightsail i got it wrong lol

kindred musk
#

tnx

solemn latch
#

its just a vps, so you can treat it like any other system.

quartz kindle
#

lightsail has terrible reviews on vpsbenchmark lmao

earnest phoenix
#

lmao

solemn latch
#

f

earnest phoenix
#

i think the best free vps is google

#

they are good

misty sigil
#

its only 12 month

solemn latch
#

lightsail is free? it says $3.50

#

oh

quartz kindle
#

google has terrible disk speeds tho

#

but they have good cpu

earnest phoenix
#

no money for more mem

#

:((

quartz kindle
#

and you thought contabo was bad

solemn latch
earnest phoenix
#

upcloud :0

solemn latch
#

never heard of them ngl

earnest phoenix
#

@quartz kindle VOH good ?

#

i think i will get a vps

#

in VOH

quartz kindle
#

what is voh?

misty sigil
#

@quartz kindle lmao i thought contabo was bad

earnest phoenix
#

oh OVH

#

lol

quartz kindle
#

oh ovh

#

lmfao

#

yes ovh is not that bad

earnest phoenix
#

ok

#

cuz it is cheap

gilded solstice
#

OVH is the best

quartz kindle
#

although their performance is also on the lower end

earnest phoenix
#

and has big ram

#

and SSD disk

#

that is good

solemn latch
#

iirc, most providers restrict disk speeds for smaller vps's anyway

quartz kindle
#

all hosts have ssd these days, but they dont tell you how good these vps's are

#

you need to test them once you're in

earnest phoenix
#

how

#

i need to test it

quartz kindle
#

for example galaxygate's SSDs reach 400MB/S, contabos SSDs hover around 100MB/S

earnest phoenix
#

:0

quartz kindle
#

google compute engine's disks are attrocious, at 35MB/S lmao

earnest phoenix
#

Wut

quartz kindle
#

lightsail is also like google

earnest phoenix
#

crying

#

google suck as fck

pale vessel
#

so google and lightsail are both bad?

earnest phoenix
#

it takes me 20$ per month

#

: /

quartz kindle
#

where?

earnest phoenix
#

google

quartz kindle
#

why lol

earnest phoenix
#

i have 300$ free

quartz kindle
#

ah good

#

you're using a multi-core one?

#

i only used the f1-micro, even with the free credit

dire obsidian
#

well guys so how youre rl pro can say me, if i make a github proyect private, the page will be deleted?

earnest phoenix
#

i am using f1-micro 2

quartz kindle
#

what page?

knotty steeple
#

yes

earnest phoenix
#

but with 1gb ram

quartz kindle
#

ah

dire obsidian
earnest phoenix
#

custom perfomance

#

1 core

knotty steeple
#

u can't make github pages for a private repo

earnest phoenix
#

1gb ram

dire obsidian
#

oh thanks

quartz kindle
#

the code for the page will not be deleted, but the page will probably no longer be online

dire obsidian
#

oh

quartz kindle
#

google also charges for excess bandwidth

#

they only give you 1gb/month free

#

my bot was using 400gb/month before intents lmao

misty sigil
#

ac_wut what

dire obsidian
#

just

#

i hate myself

#

i coant do anything better

#

ok how r u guys?

earnest phoenix
#

my bot was using 400gb/month before intents lmao
@quartz kindle LMAO

#

sarabscribe

pale vessel
#

that's not bad, just change the url color and make it more interesting

dire obsidian
#

uuu

misty sigil
#

uwu

pale vessel
#

@earnest phoenix suushshhshscdibe

knotty steeple
#

slap some bulma and ur done

earnest phoenix
#

saparabascribe

#

is there any node module for text highlight ?

quartz kindle
#

highlight.js

earnest phoenix
#

like

This is green text
#

:0

#

ok

#

thx

quartz kindle
#

there are many others

#

discord uses highlight.js

#

i also made a highlight.js previewer

earnest phoenix
#

nice

#

epic

#

i also made a highlight.js previewer
@quartz kindle you're ducking awesome

#

don't wanna swear and ducking sounds weirder than fucking

pure lion
#

there a way to host multiple websites through my nginx server (under different names ofc)

earnest phoenix
#

Also which image format should I use for my bot profile cards?

pure lion
#

png

earnest phoenix
#

you have only two options:
SVG SVG

little topaz
quartz kindle
#

yes you can host multiple websites on nginx

earnest phoenix
#

ids there any npm package or smth to generate SVG images

#

tim make one

#

lel

quartz kindle
#

if you want to display them on discord, discord doesnt support svg

earnest phoenix
#

f

#

do they support png

slender thistle
#

yes

misty sigil
#

yes

earnest phoenix
#

is it hard to use png

quartz kindle
#

everything supports png and jpg

slender thistle
#

not really

quartz kindle
#

these two formats are pretty much universal

solemn latch
#

i dont support jpg

quartz kindle
#

then you suck

slender thistle
#

png just allows transparency and isn't compressed (or at least not as hard as jpg)

solemn latch
#

lol

kindred musk
#

i am connected (via filezilla) to a bitnami vps hosting system, where do i put the (node.js) bot files? in the bitnami folder? in the home folder?

earnest phoenix
#

is it hard to use png
halp

#

lel

misty sigil
#

no

#

png is easy

quartz kindle
#

you can put it in whichever folder you want

solemn latch
#

in whatever you want your project folder

quartz kindle
#

you can create a folder for it as well

kindred musk
#

ok thanks!

earnest phoenix
#

hey, someone know why it doesn't work (vote with dbl api using shards)

const DBL = require("dblapi.js");
const dbl = new DBL('token dbl', { webhookPort: 5000, webhookAuth: 'pass' });

dbl.webhook.on('ready', hook => {
  console.log(`Connected to DBL Webhook at http://${hook.hostname}:${hook.port}${hook.path}.`)
});

dbl.webhook.on("vote", async (vote) => {

  console.log(`User with ID ${vote.user} just voted!`);
});```
solemn latch
#

are you doing this on every shard?

misty sigil
#

I believe they are.

solemn latch
#

iirc, youll get an erraddrinuse

#

or something similar

solemn latch
#

ah, yeah. only run one webhook.

earnest phoenix
#

how ?

solemn latch
#

you can make a separate process that you only run once that communicates with the bot.
or you can check if your on the first shard and only run it if you are.

quartz kindle
#

or you can run it in your sharding manager

solemn latch
#

oo

earnest phoenix
#

i do that

#
const { ShardingManager } = require('discord.js');
const config = require("./config");
const manager = new ShardingManager('./index.js', { token: config.token, totalShards: 2});
const database = require('./database/database.js');

manager.spawn();
manager.on('shardCreate', shard => console.log(`Shard ${shard.id} ready !`));

const DBL = require("dblapi.js");
const dbl = new DBL('token dbl', { webhookPort: 5000, webhookAuth: 'pass' });

dbl.webhook.on('ready', hook => {
  console.log(`Connected to DBL Webhook at http://${hook.hostname}:${hook.port}${hook.path}.`)
});

dbl.webhook.on("vote", async (vote) => {

  console.log(`User with ID ${vote.user} just voted!`);
});```
#

like that ? @quartz kindle

quartz kindle
#

yes

#

what exactly isnt working?

earnest phoenix
#

when i try to vote

#

nothing apear in the console

#

and i don't know why

quartz kindle
#

did you set up the webhook in top.gg?

earnest phoenix
#

oh no

solemn latch
#

your bot page, edit, bottom of page

fringe axle
#

Wait, you can do a vote system?

#

Lets go.

earnest phoenix
#

ohh sorry i don't see that

solemn latch
#

i heard nginx can load balance.
do you think i can load balance between different reverse proxies?

quartz kindle
#

sure

solemn latch
#

i found the answer 20 seconds after i asked

pure lion
#

:o

quartz kindle
misty sigil
#

wtf

solemn latch
#

i need to redo my stuff, thats way more efficient than what i was doing

#

oh weights too

#

oo

quartz kindle
#

if you wanna get more complex

amber fractal
#

is that nginx config?

quartz kindle
#

ye

amber fractal
#

no wonder I dont understand it KEKW

solemn latch
#

dynamic, meaning if one of them fail, itll go to other ones?

#

and backup as in if all other fail use those?

quartz kindle
#

yes you can prioritize which backups should be tried first, how many retries until the next one is called, etc..

#

plus delays and rate limits

solemn latch
#

why have i been doing what im doing

#

so much wasted time

earnest phoenix
#

sorry but i need to put what here 😄 @quartz kindle ? i don't understand

solemn latch
#

thanks tim, helped a lot

#

i got some science to do ;p

pure lion
#

how 2 fix too many redirects

#

on nginx and cf

quartz kindle
#

@earnest phoenix where is your bot hosted?

tardy hornet
#

lol i just made something up

#

it wont work right?

earnest phoenix
#

now i test so on my computer 😄

misty sigil
#

no @tardy hornet

#

heres some docs on the proper way on doing it

tardy hornet
#

where?

misty sigil
tardy hornet
#

thx

misty sigil
#

np

earnest phoenix
solemn latch
#

0.0.0.0 means any ipv4 address.
If its on a vps, its just the public vps ip.

#

if its hosted at home/glitch/heroku/some other non traditional server location. there might be a bit more to it

earnest phoenix
#

it's on my computer for the test @solemn latch

#

so i put what ?

misty sigil
#

you'd need to port forward

solemn latch
#

your homes public ip.
youll need to port forward

#

and if on windows youll need to let it past your firewall

misty sigil
#

you can get public ip by googling whats my ip

earnest phoenix
#

how ? ;-;

#

oh okay

solemn latch
misty sigil
solemn latch
#

clearly a qr code

quartz kindle
#

@earnest phoenix if its on your pc, you will need to port forward in your router

misty sigil
#

fucking hell you got me

earnest phoenix
solemn latch
#

that also works iirc

obtuse jolt
#

ok so here’s a mystery for you

When any user runs vt!scan 1.1.1.1 it does it then sends [object Object]

When I run the command it doesn’t not say [object Object] and there is nothing in the code that lets the bot even know who I am it just things I’m a normal person

#

why

#

the fuck

misty sigil
#

yes

earnest phoenix
#

i put in on top.gg and i save but then i do test and nothing '-'

solemn latch
#

port forward

misty sigil
#

is it port forwarded

#

ALSO is it formatted correctly

earnest phoenix
#

'-'

solemn latch
#

and if on windows, firewall

misty sigil
#

http://ip.here:5000/dblwebhook

earnest phoenix
#

i do what's my ip

solemn latch
#

@obtuse jolt i just did it again and didnt get object objected

earnest phoenix
solemn latch
#

is it possible its doing something else for non cached users?

#

or something

#

people whove never done a command before

earnest phoenix
quartz kindle
#

yes

#

for example if your ip is 999.999.999.999

#

the url will be

#

http://999.999.999.999:5000/dblwebhook

earnest phoenix
#

yes i do that...

quartz kindle
#

but you will need to port forward your router, as i said before

#

because your router will block it

earnest phoenix
#

how ;-;

#

oh

solemn latch
#

helps a lot

quartz kindle
#

that is why if you have a server, test it in the server, not in your pc

#

its much easier because servers dont block ports

earnest phoenix
#

oh okay

#

i will test ^^'

#

okay, work now thank tim woo and Matt

drowsy kite
#

Good night to everyone. Could someone tell me how do I get my bot to obtain and update information on a website when someone sends a command?

slender thistle
#

Optimally, you would use an API. If the website doesn't have one, you could try webscraping it, which most likely won't be appreciated by the people who own that website

drowsy kite
#

what is the webscraping?

quartz kindle
#

making your bot download the page from the website and read it as text

drowsy kite
#

ok

#

But how do I get the bot to update the command information using the website's source?

delicate zephyr
#

Check if they have an api

#

for the information they're providing

#

out of curiosity what site is this for?

tardy hornet
drowsy kite
#

my bot

out of curiosity what site is this for?
@delicate zephyr my bot is mostly football

tardy hornet
#

how do i make that if someone react with the \🗑️ it will delete the message

solemn latch
#

reaction collectors

tardy hornet
#

idk how to set one

digital ibex
#

look at the docs, lemme get it rq

digital ibex
#

ook

tardy hornet
#

thx

#

const filter = m => m.content.includes('discord');

#

i put where i they say discord the emoji?

solemn latch
#

looks like your looking at the wrong part

digital ibex
#

“m.reaction == whatever” maybe

solemn latch
#

you want reaction collectors not message collectors

tardy hornet
#

found it

solemn latch
#

reaction collectors are near the bottom

tardy hornet
#

yeah found it

drowsy kite
#

how do I know that the site I want my bot to collect information from, has the webhooks API?

solemn latch
#

typically you look on the site, if not there you google it

tardy hornet
drowsy kite
#

typically you look on the site, if not there you google it
@solemn latch what do you mean?

solemn latch
#

whatever site your on, look around in the info pages/header/footer

tardy hornet
#
const filter = (reaction, user) => {
    return reaction.emoji.name === '🗑️' || user.id === message.author.id;
};

const collector = message.createReactionCollector(filter, { time: 15000 });

collector.on('collect', (reaction, user) => {
    console.log(`Collected ${reaction.emoji.name} from ${user.tag}`);
});

collector.on('end', collected => {
    console.log(`Collected ${collected.size} items`);
});
#

how do i make that code to delete it?

drowsy kite
#

@solemn latch thanks for your support!

solemn latch
#

@tardy hornet well
reaction collector gives you a messageReaction

#

messageReaction has the property message

drowsy kite
earnest phoenix
#

is anyone else’s API Widgets not working?

drowsy kite
#

wtym?

slender thistle
earnest phoenix
#

Yeah

pure lion
#

Mfw botum.top

misty sigil
#

buy it

summer torrent
stark abyss
#

can someone teach me how to module export function with parameters

#

or provide a useful link

pure lion
#

buy it
Can we go half and half

tardy hornet
#
    message.react("🗑️")
  })
  const filter = (reaction, user) => {
    return reaction.emoji.name === '🗑️' || user.id === message.author.id;
};

const collector = message.createReactionCollector(filter, { time: 5000 });

collector.on('collect', (reaction, user) => {
    console.log(`Collected ${reaction.emoji.name} from ${user.tag}`);
});

collector.on('end', collected => {
  message.delete({ timeout: 0 })
  .then(msg => console.log(`Deleted message from ${msg.author.username} after 5 seconds`))
  .catch(console.error);})
  break;

what is the problem there?

summer torrent
#

any error

tardy hornet
#

no

delicate zephyr
#

What should be happening, and isn't?

tardy hornet
#

its should do when i react with \🗑️ it will delete the message @delicate zephyr

summer torrent
#

do that in collect event

tardy hornet
#

how?

summer torrent
tardy hornet
#
    message.react("🗑️")
  })
  const filter = (reaction, user) => {
    return reaction.emoji.name === '🗑️' || user.id === message.author.id;
};

const collector = message.createReactionCollector(filter, { time: 5000 });

collector.on('collect', (reaction, user) => {
    console.log(`Collected ${reaction.emoji.name} from ${user.tag}`);
    message.delete({ timeout: 0 })
  .then(msg => console.log(`Deleted message from ${msg.author.username} after 5 seconds`))
  .catch(console.error)
});

@summer torrent like that?

summer torrent
#

yes

tardy hornet
#

didnt work

opal plank
#

@tardy hornet likely cuz you doing a function on message, and the new message author ID is your bot's id

#

im assuming you did something like

client on (message) => {
message.channel.send(embed).then((message) => {
message.react()
collector
})
}
#

that message.react("🗑️") in the first line of your snippet leads me to believe you blocked your original message since the reaction is on the bot message

fringe axle
#
 collector.on('collect', (reaction, user) => {
      sentMessage.delete(mhelpEmbed)
    });
``` Why he's not deleting the embed? :0
sudden geyser
#

can someone teach me how to module export function with parameters
@stark abyss module.exports can be set to any value. For example, module.exports = 5 means requiring the file will return the value of 5 as that's the export.

So, to export a function with X parameters, you define a normal function and export it.

stark abyss
#

Oh

#

Okay thank you

#

One more question how would I use it?

sudden geyser
#

require the file with require(...). ... should be a string that's the relative path to your file

stark abyss
#

ok

#

@sudden geyser If I do

module.exports = function getUserFromMention(mention){
    if (!mention) return;

    if (mention.startsWith('<@') && mention.endsWith('>')) {
        mention = mention.slice(2, -1);

        if (mention.startsWith('!')) {
            mention = mention.slice(1);
        }

        return client.users.cache.get(mention);
    }
``` it gives me error SyntaxError: Unexpected end of input
sudden geyser
#

You're missing a } at the end.

stark abyss
#

oh yes sorry

#

@sudden geyser can you please explain little more on how to use it?
const exportFunction = require(./../../exportFunction.js); ?

uneven orchid
#

Hi

stark abyss
#

oh wait i put getUserFromMention instead of const exportfunction it's const getUserFromMention

#

right?

#

and then i can use it?

uneven orchid
#

Can You Giveme Bot ping

stark abyss
#

?

sudden geyser
#

Example: ```js
// ----------------- firstFile.js -----------------
module.exports = function getFive() {
return 5;
}

// ----------------- secondFile.js -----------------
const five = require("./firstFile.js") // We're assuming it's in the same directory.

console.log(five()) // The name you give the function does not matter.```

stark abyss
#

oh

#

okay I get it now! Thank you

opal plank
#

though you should prob use es6 sytax for thos kind of things

#

its a bit better

#

export named functions, multiples, default, import as, export as

#

they are all quite handy @stark abyss

still merlin
#

Does anyone know how you'd use the text-align: thing in css for something inside a div, I want my main text on the right, But with button onclick it reveals some text, but i need that text in the middle of the page.-.

earnest phoenix
#

i get such an error when i search the discord user with id.

- TypeError: Cannot read property 'toArray' of undefined
slender thistle
#

There's the option of abusing flexbox...

sonic lodge
#

@earnest phoenix show code

slender thistle
#

Or just margin: 0 0 0 auto kind of thing

earnest phoenix
#

.addField('Rozetler', kisi.flags.toArray().join(', ') ? kisi.flags.toArray().join(', ')

#

this region

sonic lodge
#

kisi.flags is undefined

solemn latch
sonic lodge
#

kisi is a supposed to be a user object, right?

#

it's possible for the flags property to be null

amber fractal
#

I dont like
0
0

earnest phoenix
#

yeah but it works when I use it by mention the user.

#

There is a problem when use id

solemn latch
#

the plan is to get the same background color as the numbers

#

and make a custom emoji with that color

#

thats blank

#

just something for later

earnest phoenix
#

When the flag is blank it says "Rozet bulunmuyor..".

#

.replace("VERIFIED_BOT", ":onaylibot01:") : Rozet bulunmuyor..)

solemn latch
#

now to add fire animations to every single emoji

#

for when ships are dead

#

4 hours later pandasad

sonic lodge
#

try adding a check somewhere to see if kisi.flags is undefined or not, and if it is, set it to an empty collection

earnest phoenix
#

Question what skill would be needed to make a bump bot

misty sigil
#

well uh

#

wdym?

solemn latch
#

depends what your bumping

earnest phoenix
#

Servers

solemn latch
#

theres several ways to bump servers

misty sigil
#

external bot?

solemn latch
#

so

misty sigil
#

or making your own

amber fractal
#

You'd need a server list Thonk

misty sigil
#

^

#

might add a server list to my bot

midnight blaze
#

not really. hmm, all you need is a channel, in your server that fetches messages, that starts with the bump command in other servers

#

actually quite easy

amber fractal
#

Well if you're bumping servers you need a list to bump on

earnest phoenix
#

But I mean a multi server bump bot

#

Once u add the bot n setup u can bump

opal plank
#

@solemn latch it seems we both got 2 major things achieved

misty sigil
#

you'd need a database for that?

solemn latch
#

ay whatcha get done?

opal plank
#

i made FREE NITRO bot

solemn latch
#

oo

midnight blaze
#

database to store the guild ids and the channels in the guild

solemn latch
#

gib nitro plz

opal plank
#

the forbidden rule that must never be broken, i did it

amber fractal
#

The easiest way would be to just put it at the start of an array so you dont have to keep sorting it at run time

earnest phoenix
#

They mean a scam bot

misty sigil
#

NoEE

opal plank
#

nah

#

actually FREE nitro

solemn latch
#

its name is free nitro, woo confirmed

#

:p

misty sigil
#

takes canvas

makes user card

adds nitro badge to user card

opal plank
#

Woo check in that weird not a discord server

#

imma show ya

earnest phoenix
#

#lawsuitfromdiscord

solemn latch
#

its actually free nitro

#

i didnt take it because i dont care for nitro

#

but yeah

opal plank
#

actually free nitro

solemn latch
#

remember when you made 99 countdown emojis erwin?

opal plank
#

I ahve now achieved the ultimate level of advertisement, being able to say that without being clickbait or scam

#

i still have that actually

solemn latch
#

wanna make me 17 on fire emojis pandasad

#

17x4 actually

opal plank
#

people told me im a retard for not using canvas for that

#

or imagewizard or some other shit

solemn latch
#

oh yeah it woulda taken half an hour just making the code

#

gifencoder makes it dumb easy

opal plank
#

yeah i didnt know any better at the time

#

so i simply photoshopped them

solemn latch
#

if i actually asked what you where doing i so woulda done it

opal plank
#

i do need to remake them

#

cuz 1 frame

solemn latch
#

fff

opal plank
#

i did not add 0 or something in the end and its triggering me that it ends on 1

earnest phoenix
#

Watch it log ur info n shit 😂

opal plank
#

you mean my clears throat FREE NITRO BOT?

earnest phoenix
#

@midnight blaze Open dms

midnight blaze
#

no

earnest phoenix
#

Yes

misty sigil
#

no

midnight blaze
#

Yes`nt

earnest phoenix
#

Anyone here up for commissions 🤣

misty sigil
#

no

opal plank
#

im pretty sure its against the rules here

earnest phoenix
#

How

amber fractal
opal plank
#

idk i recall seing shivaco and some other mods do a command saying use fivver or something

earnest phoenix
#

Fivver is a hiring site/app I think lol

opal plank
#

this

#

check link

amber fractal
#

a commission is literally just hiring a freelancer

opal plank
#

bottom line, you paying someone to do something