#development

1 messages Β· Page 1493 of 1

distant copper
#

Gracias los dos

#

Revisare

umbral zealot
#

I mean, it was introduced in node 8.9.0 so it's old, but not 0.X old.

sudden geyser
umbral zealot
#

Oh yeah would you look at that.

pulsar bone
#

what the heck is wrong with dank memer bot why it is hacking permission
i haven't allowed any permission to that bot but it still have permission will joining
whenever i disallow permission on invite it didn't create a role for bot but when i invite dank Memer it create a role which have permissions i dont know Why

sudden geyser
#

You may want to ask in the bot's support server.

pulsar bone
umbral zealot
#

Ok great, ask them wtf is wrong with their bot πŸ˜‚

sudden geyser
#

Are you talking about the integrated/managed role?

umbral zealot
#

This isn't bot support it's #development help. For programmers.

umbral zealot
#

If you invite a bot with permissions, any permissions, it creates a role with that bot's name

#

it's how Discord works, has nothing to do with Dank Memer or top.gg.

plucky topaz
#

i cant believe how much mewing has helped me with my jawline

pulsar bone
plucky topaz
#

its been like 6 months but it has really helped

umbral zealot
plucky topaz
#

oh ok

umbral zealot
#

You probably did have permisisons checked but you forgot

#

No bot can "hack" permissions or roles.

pulsar bone
pulsar bone
sudden geyser
# pulsar bone i didn't allow any permission

The only way to create a managed/integrated role is through having Discord do it for you. In this case, the check boxes you enable/disable when inviting the bot. If any of the permissions are enabled, the role is created. If none, no role is created. I doubt Dank Memer is "hacking" Discord into making one.

umbral zealot
#

If someone had found a way to break discord's permission system, trust me, it wouldn't be to create a role for dank memer

#

That would be a ridiculous application of an exploit.

pulsar bone
#

saying it last time

umbral zealot
#

I guarantee you're mistaken πŸ˜‚

pulsar bone
sudden geyser
#

A video is better.

umbral zealot
#

no roles.

pale vessel
#

YEs

umbral zealot
#

Either way, this has nothing to do with development or programming.

distant copper
#

the problem keeps giving me the same error

sudden geyser
#

Did you log require?

distant copper
#

everything is fine, it's just that error that gives me trouble

pulsar bone
distant copper
#

sent the images again?

pulsar bone
sudden geyser
#

Interesting. Can you check your server audit logs?

#

I don't get the same result.

distant copper
pulsar bone
distant copper
umbral zealot
#

This sounds like an actual bug with repl.it

distant copper
#

nobody knows how i fix this?

umbral zealot
#

There's no way any recent version of nodejs would tell you require.resolve is not a function.

#

So it must be an issue with their system.

green kestrel
#

yay well this was worth staying up till 4am for πŸ’ͺ flex flex... got grapes.js working for stats page editing :D

crimson vapor
#

is this your dashboard?

green kestrel
#

oh and grapesjs is a massive pain in the ass if you dont want to let it touch the html layout, just sayin'.

#

yeah MILLION

crimson vapor
#

thats hot

#

I rate

green kestrel
#

im wondering if i should make it tabbed or something though

#

got a lot of content on it now

crimson vapor
#

maybe

queen needle
#

you should imo tabbed layouts are better and easier to use

green kestrel
#

I find they can be unfriendly on mobile though?

#

hard to click tiny tabs

crimson vapor
#

oh

queen needle
#

thats true

crimson vapor
#

different on mobile then

#

fun with css

queen needle
#

but that sounds like a problem for them being on mobile

distant copper
crimson vapor
#

hello

distant copper
#

someone help me with this?

queen needle
#

css is very fun'nt

crimson vapor
#

what is require.resolve

umbral zealot
# distant copper

I have answered you. require.resolve has been a function for as long as nodejs has existed basically. So, this is a problem that you will need to bring up to repl.it support.

crimson vapor
#

is that even needed tho

queen needle
#

thats the weirdest event handle ive ever seen

umbral zealot
#

Not really, this person is just copy/pasting from a tutorial

#

A tutorial that I've written myself, so, I literally know that this has worked for 4 years.

crimson vapor
#

LMAO

queen needle
#

lolll

umbral zealot
#

In fact that very line was removed from our tutorial a couple years back oh, actually, wrong, it's still there.

#

but clearly other people have copied it

#

that's what you get from cargo culting and noobs not taking the time to learn the language.

crimson vapor
#

I think its funny that I would say im decent at nodejs but know maybe 1/100 of the built in features/abilities

#

probably close to 1/1000

queen needle
#

same

#

then theres people like voltrex

crimson vapor
#

yea

queen needle
crimson vapor
#

reduce ram

#

but its too advanced

#

so yikes

umbral zealot
#

There's no point in keeping the cache for an event file, since you can't re-require it anyway

#

It was a micro-optimisation, not worth very much, to be honest.

queen needle
#

yeah

umbral zealot
queen needle
#

lmao

crimson vapor
#

its kinda amazing

#

there are people like you who can put this into words and explain why everything works as it does

queen needle
#

that just amazes me

crimson vapor
#

and there are people who can't figure out the different theres and yours

#

no hate for people that cant

#

its just an easy one

queen needle
#

like i understand how the code i write works but its hard to explain it to someone else

crimson vapor
#

agreed

umbral zealot
#

I do have a talent for writing documentation and tutorial. blobbowing

crimson vapor
#

lol

#

good talent to have

queen needle
#

thats how you know youre good at what you do is if you can explain it to someone else

crimson vapor
#

makes you a good employee KEKW

umbral zealot
#

"If you can't explain it simply, you don't understand it well enough." - Albert Einstein (slightly paraphrased)

queen needle
#

blurryeyes rip me then

umbral zealot
crimson vapor
#

I don't like black or white quotes like those, its like for the most part they apply, but some times they dont and its kinda just weird

queen needle
#

yeah

crimson vapor
#

basically to me it reads: "you're not good enough if you can't explain it"

queen needle
#

yeah or "Unless you can explain to someone without the knowledge you don't have that knowledge" thats also basically what its saying

umbral zealot
#

No no it's not about being good enough. You can apply knowledge without being able to explain it. But maybe you don't understand that knowledge at a level that's deep enough to be able to adapt it differently.

#

Some people are really good at applying knowledge.

#

Doesn't mean they understand the concepts behind that knowledge.

opal plank
#

Aka literally everyone that has ever worked without a diploma/degree

#

a farmer doesnt need to know about cellulose to be able to take care of his roses

errant perch
#

how do i mute someone in a voice channel with discord.js

carmine summit
#

member.mute()

#

?

earnest phoenix
#

Can I give bot Adminstrator Perms? I am coding Anti Ping

torn ravine
pale vessel
#

why do you need administrator permission

torn ravine
#

kinda a privacy concern if you ask me

umbral zealot
earnest phoenix
#

It gives error when channel is private and no SEND MESSAGE perms

umbral zealot
#

Ok so give the bot SEND_MESSAGE permissions. πŸ˜‚

pale vessel
#

lmao duh

torn ravine
#

^

earnest phoenix
#

What if user doesn't give permission

umbral zealot
#

Just make sure you have the permissions you need. Administrator is never a required permission.

earnest phoenix
#

It's not about me

umbral zealot
#

Then tell them "I can't do that, I don't have permissions to send messages"

pale vessel
#

then they don't want the bot to see the channel

umbral zealot
#

If they don't give your bot perms, they don't want your bot to have the perms.

#

It's perfectly appropriate for some people to restrict bots in certain channels.

earnest phoenix
#

Lol

umbral zealot
#

Then don't, just fail silently.

earnest phoenix
#

πŸ˜‚

umbral zealot
#

You laugh but that's literally the proper way to address this situation.

earnest phoenix
#

I am thinking to dm

umbral zealot
#

That might become real obnoxious real fast.

earnest phoenix
#

Hm

earnest phoenix
#

if you cant, ouchies

#

Anti ping is automatic.

#

No command needed

umbral zealot
#

When I made an anti-mention-spam bot 4 years ago, I just deleted the message if I could, and sent a warning if I could.

#

no fuss necessary.

earnest phoenix
#

Lmao

#

You'll get same error without permission SEND MESSAGES

opal plank
#

yeah lets spam the chat with more messages saying "i dont have permission to do that job i was suppose to" ontop of the spam of pings

umbral zealot
#

I mean, it's possible to catch errors and ignore them, whatever language you're using

#

Β―_(ツ)_/Β―

opal plank
#

js iirc

umbral zealot
#

In JS I like to just .catch(o_0 => {})

#

But only when I know I don't care about the error.

sacred trout
#

hello

earnest phoenix
#

Hehe ok

opal plank
umbral zealot
#

like that, yeah

sacred trout
#
@client.command()
async def play(ctx, url):
    if not ctx.message.author.voice:
        await ctx.send("You are not connected to a voice channel")
        return
    
    else:
        channel = ctx.author.voice.channel
        await channel.connect()
        
    server = ctx.message.guild
    voice_channel = server.voice_client

    async with ctx.typing():
        player = await YTDLSource.from_url(loop=client.loop)
        voice_channel.play(player, after=lambda e: print('Player error: %s' % e) if e else None)

    await ctx.send('**Now playing:** {}'.format(player.title))```
#

[;ease help

opal plank
#

to the voind we go with those

sacred trout
#

TypeError: from_url() missing 1 required positional argument: 'url'

umbral zealot
#

Ok so give it a url argument. πŸ˜‚

sacred trout
#

umm

#

how loal?
me dumb and new to th

#

is

opal plank
#

its literally here

#

you missing url there

umbral zealot
#

You're trying to play a video from a URL, but you're not giving it a URL

sacred trout
#

url loop=cleint.loop?

#

client

opal plank
#

no, loop = client.loop

#

url = url

umbral zealot
#

I dunno maybe I'm dumb but I don't think "loop" and "url" are the same thing

opal plank
#

^^

#

player = await YTDLSource.from_url(loop=client.loop,url=url)

sacred trout
#

so i just do url = url in other line

opal plank
#

try that

sacred trout
#

oh

opal plank
#

<= doesnt know python, btw

sacred trout
#

loal

opal plank
#

though the error is pretty self explanatory

sacred trout
#

yeeeeee

near stratus
#

How many requests can I make with YouTube API for free per day ?

sacred trout
#

it works!

opal plank
#

yw

sacred trout
#

lol

opal plank
near stratus
opal plank
#

you need to calculate based on what requests you do btw

#

each request uses up an X amount of points

#

or units, dunno the heck u2b calls them

near stratus
opal plank
#

yeah thats completely unrelated

near stratus
opal plank
#

correct

#

PUT requests also are pricey iirc

near stratus
#

yeah

hollow sedge
#

Just found out that sqlite has in-memory capability..this is epic

sudden geyser
#

but that's not persistent

lusty quest
#

well that is one reason why people use it. if you dont use a braindead wrapper you have so many options

#

in memory is not really ment for being persistant over Reboots of the host

hollow sedge
#

You can load a db file into memory

lusty quest
#

its just for having a cache with fast response times

umbral zealot
#

I think you're confused, a memory sqlite means it's not saved on disk πŸ˜‚

hollow sedge
#

I'm not confused..?

umbral zealot
#

It's not a db cache, it's an ephemeral database that goes away when you reboot

hollow sedge
#

I think you're confused

#

I realize that

lusty quest
#

i know

#

but i would use it as a cache

umbral zealot
#

Alright sure, sorry, I guess I'm the confused one

hollow sedge
#

Oh wait

#

You were talking to him

umbral zealot
#

I've actually used the memory sqlite to run my jest testing for Enmap

#

Very useful.

lusty quest
#

i had my issues with Enmap. mostly bcs sqlite can be pricy on memory if used inefficent

umbral zealot
#

Are you saying Enmap uses sqlite inefficiently?

#

Now I know you're confused. The issue is that Enmap itself caches everything into memory.

#

It's meant to be an easy database, not an efficient one.

lusty quest
#

Enmap used 1GB ram the other day. then i switched to Mysql and then later to MongoDB

umbral zealot
#

Yeah none of these cache data in memory so of course they'd use less of it

hollow sedge
#

Wait those aren't even in memory

lusty quest
#

Mysql got a Ram Cache?

umbral zealot
#

It's part of the reason I'm creating Josh - it's almost as simple, but doesn't cache anything in RAM.

lusty quest
#

and MongoDB stores all Indexes in ram

#

also i have my DB running on a different Server. so it can use Ram as it like without interrupting my Bot(s)

hollow sedge
#

Could just get more RAM

#

Wouldn't that be cheaper than having another server

lusty quest
#

cost the same, but i like to have stuff spread out on more than one Machine.

#

maybe i switch to a K8 Cluster soon then i have everything handled by the Cluster on 1-2 Nodes

hollow sedge
#

Yeah I see that

#

It's more scalable

orchid cobalt
#

I am trying to run my Quart app and my discord bot in the same file . I am doing so because I think is the only way to send messages with the bot.
The problem here is, just the bot comes online and app doesn't run.
But if I remove the bot.run part, app comes online and works fine

hollow sedge
#

The bot running and the app running are blocking forever

#

You need to run it on a separate thread

summer torrent
#

you can use webhook to send message

hollow sedge
earnest phoenix
#

Does someone know how to get a free custom website domain?

orchid cobalt
lusty quest
orchid cobalt
summer torrent
#

what

earnest phoenix
lusty quest
#

havent used one in years but i think .tk domains

summer torrent
rustic nova
orchid cobalt
#

yeah leave it , i meant i can't dm someone with webhooks

orchid cobalt
rustic nova
#

Freenom is a medium way to get a domain, but i highly suggest buying an actual domain as soon as possible

odd stratus
ivory seal
#

HTTPError [FetchError]: request to https://discord.com/api/v7/gateway/bot failed, reason: getaddrinfo EAI_AGAIN discord.com i get this error when i start my bot

misty sigil
#

i'd reckon erela.js

ivory seal
#

thats discord.js

lusty quest
#

hmm

#

so you dont did any API request yourself

sacred aurora
#

does anyone know how to set messageembed color to white?

#

i already try #FFFFFF and 0xFFFFFF

#

but still doesn't work

earnest phoenix
#

.setColor("#FFFFFF")

#

strings my friend

sacred aurora
#

yeah it is

indigo folio
#

ffffff doesn't work for some reason

#

discord hates it

sacred aurora
#

hmmmmm

earnest phoenix
#

try FFFFFE

lusty quest
#

try really light Gray

indigo folio
#

use f1f1f1

earnest phoenix
#

fefefefe for almost complete white

sacred aurora
#

thanks

wicked pivot
#
let date = []
            let guilds = []
            Object.values(Guild).map(r => {
                date.push(r.day)
                guilds.push(r.guild)
            })

            let width = 800
            let height = 600

            let chartCallback = (ChartJS) => {
                ChartJS.plugins.register({
                    beforeDraw: (chartInstance) => {
                        const { chart } = chartInstance
                        const {ctx} = chart
                        ctx.fillStyle = 'black'
                        ctx.fillRect(0, 0, chart.width, chart.height)
                    }
                })
            }

            let canvas = new CanvasRenderService(
                width,
                height,
                chartCallback
            )

            const configuration = {
                type: 'bar',
                data:{
                    labels: date,
                    datasets: [
                        {
                            label: 'Guilds Add',
                            data: guilds,
                            backgroundColor: 'white'
                        },
                    ],
                },
            }```

module use : chartjs-node-canvas

only one of the two values ​​is displayed
earnest phoenix
#

does the color stay after rendering one column?

wicked pivot
#

this is the final rendering

odd stratus
pale vessel
#

@Tony Kun#8496 what

#

there's two

#

look in the chart

#

the second on is at 10 so it's the lowest value

#

so you can't see the bar

wicked pivot
#

ah I didn't see that I'm stupid

earnest phoenix
#

man i gotta start learning how to fucking read

lusty quest
#

ahh yes chart.js where a pain in the ass to figure out how it works

wicked pivot
#

by any chance not possible to make one so that its starts at 0? and not at 10?

lusty quest
#

its possible.

#

need to look at what ive had done for it, probably not the best way but it worked for me

wicked pivot
#

okay

lusty quest
#

hmm, i use the same data structure as you do, need to research somethign really quick

lusty quest
# wicked pivot by any chance not possible to make one so that its starts at 0? and not at 10?

https://stackoverflow.com/questions/52715393/chart-js-bar-graph-will-not-start-at-zero-as-minimum-value you need to set the zero for the axis. this post is from 2018 ive used min:0 instead of beginAtZero

#
 const ticksOptions = [{ ticks: { fontColor: "white", fontStyle: "bold",min:0 } }];
    const options = {
        // Hide legend
        legend: { display: false },
        scales: { yAxes: ticksOptions, xAxes: ticksOptions }
    };
``` i pass the options in the configuration
wicked pivot
#

I have to put this where?

lusty quest
#

after your data bracket in your configuration (i just pass the value)

wicked pivot
#

it works thanks

lusty quest
#

took me back then a few days to figure this out

#

the frontColor and Style are not needed, if wanted you can change them also

wicked pivot
#

it is true that chartjs is quite complicated :0

lusty quest
#

its not that complicated, if you understand how it works

lament rock
#

The same could be said about any API

wicked pivot
#

for once I will be satisfied with my little graph that I understand very well and not go too far in the research

lusty quest
lament rock
#

If you understand how it works, it's not complicated

#

That's the premise of having an understanding of something

earnest phoenix
#

Which one is better- Message to User with Embed or without Embed?

lusty quest
#

depends

earnest phoenix
lusty quest
#

what you send

earnest phoenix
#

Success Reply

#

Or Warning

lusty quest
#

i would just send a normal message. an Embed would be to much

earnest phoenix
#

I am curious to understand

lusty quest
#

for me Embeds are more something for stuff that needs to look not shit.

#

and a simple Status message is a bit overkill to use embeds

earnest phoenix
#

Gotcha

marble juniper
#

anyone know how I could optimise my tensorflow.js model

earnest phoenix
#

Machine Learning πŸ˜‰

lusty quest
#

where is the issue?

marble juniper
#

cpu usage

lusty quest
#

image stuff or text stuff?

marble juniper
#

image

lusty quest
#

get a dedicated GPU. Tensorflow on CPU is really taxing

marble juniper
#

well

#

easier said than done

#

lol

#

I don't have that much money to get one

#

for a server

#

I use an image ai in my bot

lusty quest
#

maybe look into the specalized ML server Amazon, Google and Azure offer

marble juniper
#

K

#

im gonna assume they are expensive

lusty quest
#

they are fine, not cheap but not that expensive

marble juniper
#

also I tried stuff like a quantum version of my ai

#

which is converting it to be smaller and faster

#

but the accuracy was horrible

#

only thing i really need is a good cpu

#

with my pc it was only 14% and I haven't even used the gpu

#

so yeah

#

idk about other methods to improve models

lusty quest
#

the smallest Amazon Sagemaker costs between 0.065- 0.075$ /Hour so yea they are quite expensive

marble juniper
#

like I assumed

#

lol

#

mine would just

#

run constantly

lusty quest
#

maybe rent a higher powered Root server and run it on there

marble juniper
#

I might port it over to a dedicated server

#

the ai with the api

lusty quest
#

my Hoster to go offers Servers with Ryzen 3600 for about 40€/Month

marble juniper
#

and then using docker n stuff

#

ye

#

will transfer it to a better server

lusty quest
#

or you buy a old Server from Ebay, buy a quadro p2000 or something like this together with a matching CPU in the server and then rent into a datacenter with it. (should be not this expensive)

earnest phoenix
#

hi

#

how do i put server count

quasi hearth
earnest phoenix
#

bot how do i put it on top,gg (discord.js)

quasi hearth
lusty quest
#

how many shards your bot is running on

earnest phoenix
#

Mine got 500

#

what is shards

lusty quest
#

500 Shards?

quasi hearth
#

If you are making a small bot, you dont have to worry about shards, but basically, shards are splitting your bot into many parts for faster processing

amber thistle
lusty quest
#

CSS hackery

amber thistle
#

i thought we could only use but <embed> is html

fathom nymph
#

Help

#

here is the part

let levels = db.has(`level_${message.guild.id}`, { sort: '.data' })
let content = levels
#

It send this

lusty quest
#

well has returns true or false

fathom nymph
#

how?

lusty quest
#

bcs it just checks if the value exist in the DB

#

quickdb?

fathom nymph
#

@lusty quest

#

Yes

lusty quest
#

use get instead of has

earnest phoenix
#

is there a endpoint to get a list of guilds that a user has admin permission

#

my dashboard is listing out all the guilds that a user is in

#

no

#

uh

#

but is there anyways to do it

#

there's an endpoint to get all user guilds which returns partial guild objects

you get a permissions field there and you can then filter through that to get ones where they have admin perms

#

oh

#

imma check out the permissions field

lusty quest
#

use bitwise fields. i do a check to see if a user got Manage Guild permissions with 0x20

#

(i get this stuff with oAuth2)

earnest phoenix
#

from the message

lusty quest
#

get the index of the ping and then slice it out

earnest phoenix
#

slice or splice?

lusty quest
#

did you tryed args.shift().toLowerCase()?

earnest phoenix
#

code

lusty quest
#

ohh you want an optional parameter

earnest phoenix
#

Yes

lusty quest
#

but you dont know what index ping will have right?

earnest phoenix
lusty quest
#

ive used something like this in one of my bots, but i have to search for it

earnest phoenix
#

sure

#

I need help

lusty quest
#

right ive used the minimist npm package

earnest phoenix
#

I didnt use any 3rd party package

#

I wanto remove that word

lusty quest
#

well then you probably have to get the index of the word then shift it and slice after it

earnest phoenix
#

args.splice ? change to shift?

lusty quest
#

wait nvm

earnest phoenix
#

will it work?

lusty quest
#

slice is not needed

#

since its already split into different segments, you just need to find the index for the ping

#

try includes("-ping")

earnest phoenix
#

Yes i dont know how to do it.

#

OK

lusty quest
#

i did it with a really stupid way. by running a for loop over the args array and then check on each index if it includes the needed word

#

its not pretty or efficent but it worked for me

earnest phoenix
lusty quest
#

in your for loop

earnest phoenix
#

okk

lusty quest
#

instead === ping

#

if its true you can work with it

earnest phoenix
#

kk

earnest phoenix
#

i dont know how to remove that -ping

lusty quest
#

slice it with the index of the message

earnest phoenix
#

args.splice(i, 1);

lusty quest
#

try and see

#

also adding mutiple numbers to slice will remove them from the array

#

so in your case you remove the 2nd and what ever your index is

earnest phoenix
#

this was the result

#

i want to slice out that word if its in whole message

lusty quest
#

hmm try splice(i,0)

earnest phoenix
#

kk

earnest phoenix
lusty quest
#

are you sure you endup with the correct array?

earnest phoenix
#

wait leeme show you code

lusty quest
#

hmm

#

try ```js
const str= args.indexOf("-ping")
str.splice(str,0)

#

or something like this

earnest phoenix
#

kk

lusty quest
#

did you return str?

#

it doesnt need to be inside the loop

earnest phoenix
#

it was inside loop

#

Outside loop. Return str still not working

#

Anyway thanks

#

Ill figure out something

earnest phoenix
#

Whats a good interval for changing status of a bot?

rustic nova
#

every minute

solemn ocean
#

is there a bot which can ask feedback of server from users and then tell the admins what they told

opal plank
#

yes, but this channel is for development, we can help you make one, you might wanna go for #general to ask for a specific bot @solemn ocean

solemn ocean
#

i did but no one told about the bot like this

#

can you send invite if there is

opal plank
#

i cannot, since i dont know any

#

though there's likely a ton of them around

#

just gotta search for it

solemn ocean
#

ok

earnest phoenix
#

why this err

#

how do i make a box

#

with css

rustic nova
earnest phoenix
#

How do i change the font

#

@rustic nova

rustic nova
#

font-family

earnest phoenix
rustic nova
#

Can't help you then

earnest phoenix
#

why tf does it look like this

#

@rustic nova

rustic nova
#

damn that's dope css

#

Yeah that's probably something you won't be able to do yet

earnest phoenix
#

im losing braincells

#

legit

#

Can anyone tell me how to host my bot 24/7? Btw I use repl.it

earnest phoenix
#

Can it be used on iPad?

marble juniper
earnest phoenix
#

I don’t wanna buy anything tho lol @marble juniper

#

Like a free 24/7 hosting website that can be used on iPad

rustic nova
#

You won't have any luck then

#

good 24/7 hosting can only be bought

marble juniper
#

^

#

its either pay and have 24/7 good hosting or don't and no 24/7 hosting

pale vessel
#

or work for aprixstudios and use their vps /s

marble juniper
#

lol no

marble juniper
earnest phoenix
#

Does it has to be bought?

marble juniper
#

y e s

#

just buy one

earnest phoenix
#

If i did have money lmao

marble juniper
#

a vps isn't that expensive

earnest phoenix
#

How much?

#

But I know my bot isn’t gonna become famous so yea..

lusty quest
#

depends somewhere between 3-5$/month

marble juniper
#

the cheapest one is 3$ a month

earnest phoenix
#

@marble juniper that’s like 20kr here LOL

marble juniper
#

turkish currency or something

#

I assume

lusty quest
#

then find a local hoster

#

this is not lira

earnest phoenix
#

@marble juniper lmao Denmark

neon heart
marble juniper
#

buy a raspberry pi

#

bruh

lusty quest
#

buy a Samsung Smart Fride. (yes theoretical this works, they run Android)

marble juniper
#

lol

#

isn't that like

#

more expensive

earnest phoenix
marble juniper
#

than a simple raspberry pi

lusty quest
#

but you dont have to explain to your family why this thing is running all the time

earnest phoenix
#

@marble juniper **cough cough Samsung fridge 34 thousand kr here

marble juniper
#

yall have a fucked currency conversion

lusty quest
#

i know its a joke

#

buy a Raspberry Pi they go here for 30-50€

earnest phoenix
#

Wtf

marble juniper
#

buy a samsung smart fridge and run my bot on it for it to become a samsung smart stove

earnest phoenix
#

That’s like 200kr here

neon heart
#

what is Samsung fridge?

earnest phoenix
#

@neon heart like a huge fridge with a screen

umbral skiff
#

hi

marble juniper
#

lol

neon heart
#

i search in google and i got Samsung refrigerator

earnest phoenix
#

lol

marble juniper
#

a fridge but smarter

umbral skiff
#

How many cores do i need to run the music bot without problems?

earnest phoenix
#

Get it?

#

LOL

lusty quest
#

1 but a lot of ram

earnest phoenix
#

@neon heart where you live?

neon heart
#

indonesia

earnest phoenix
#

Ahhh

#

Nice lol

lusty quest
#

also you probably want to multi thread your Bot

umbral skiff
lusty quest
#

for the first 100 Guilds yes

#

if you get more you need more

umbral skiff
#

2 vCPU
4 GB Ram
good?

lusty quest
#

could work for the beginning. if you know how to code efficent it will work

earnest phoenix
#

@neon heart you made lava link?

neon heart
neon heart
earnest phoenix
#

OOHH

#

Nice

#

lol

umbral skiff
lusty quest
#

yes

earnest phoenix
lusty quest
#

bcs music bots thend to use a lot of ram if not coded efficent

earnest phoenix
#

S5yeueuee

#

I play PokΓ©mon go everday

#

In your dreams wtf it’s a dead game

umbral skiff
#

can i use private pc for hosting?

lusty quest
#

yes but you have to keep it running 24/7

umbral skiff
#

What is the best system to do that?

lusty quest
#

start the process and never shutdown the pc?

umbral skiff
#

No, I mean an operating system

lusty quest
#

Linux,Windows,MacOS,ChromeOS

umbral skiff
#

i have
amd r5 3600x 6core 12thread
8gb
200Mpbs network

#

Is this good?

lusty quest
#

and you cant afford running a 3$ VPS?

#

this is better than most VPS

umbral skiff
#

Give me an example of vps

lusty quest
umbral skiff
#

What is the best plan?

lusty quest
#

the one that fits you?

umbral skiff
#

yes

#

for 1000 Guilds

lusty quest
#

depends on how much ram your bot Uses, if you code efficent you can probably run a bot with 1000 Guilds on 500MB ram

umbral skiff
#

It now works on 6 servers and consumes 110 mb

neon heart
#

You have to see what your bot needs and calculate it

#

for example if now your bot only consumes - + 200 mb, then 500 - 1gb is the best choice

umbral skiff
#

aha ok

#

thanks for the information

safe abyss
#

How to get my bot online

#

@CatAvory Helper#7319 won't go online

#

Sometimes

rocky hearth
#

Typescript has tuples implemented with arrays.
Is there anything similar for Maps or Sets??
In other words, I just want to fix the size of the Map

drowsy epoch
#

Is there a rule on how fast status’s can change for bots?

lusty quest
#

yes there are ratelimits

#

iirc 5 times per 10 minutes

lusty quest
earnest phoenix
#

the minimum safe interval is once per 15s

#

otherwise you might hit a gateway ratelimit

near stratus
#

was <guild>.member.hasPermission removed from discord.js ?

lusty quest
#

replaced with permissions.has()

near stratus
#

<guild>.member.permissions.has("...") ??

lusty quest
#

yes

near stratus
#

thanks

knotty obsidian
#

How do I get how much servers my bot is in (Java)

earnest phoenix
#

in which library

knotty obsidian
#

JDA 4.2.0_168

terse swallow
earnest phoenix
knotty obsidian
#

ok thx

terse swallow
#

what do we put on <guild>?

earnest phoenix
#

an instance of a guild

smoky herald
terse swallow
#

ok thank

worn badge
#

can anyone tell me why this is not working
if (client.guilds.cache.get('ID HERE').members.cache.get(id))
returns false even tho i tried it with many IDs of people that are in the correct server id

sudden geyser
#

Make sure you have guild member intents enabled.

#

Else you'll need to make a rest request to ask Discord if the user is in the guild

worn badge
neat harness
#

@tight plinth

// Modules //
const fs = require('fs');
const Discord = require('discord.js');
const DBL = require('dblapi.js');
const mongoose = require('mongoose');

// Boot Resources //
const Essentials = require("./resources/utils/essentials.js");
const config = require("./resources/data/config.json");

// Starting up Discord Client //
const client = new Discord.Client({
  fetchAllMembers: true,
  presence: {
    activity: {
      name: config.client.presence.activity.onBoot.name,
      type: config.client.presence.activity.onBoot.type
    }
  }
});

// Global `client` variable resources //
client.config = config;
client.logins = require("./resources/data/login.json");
client.dev = require("./resources/data/developers.json");
client.color = require("./resources/extensions/colors.json");
client.emoji = require("./resources/extensions/emojis.json");
client.def = require("./resources/extensions/defaults.json");
client.package = require("./package.json");
client.commands = new Discord.Collection();

// Handlers //
var handlers = fs
  .readdirSync(`./resources/handlers`)
  .filter(file => file.endsWith(".js"));
for (var file of handlers) {
  require(`./resources/handlers/${file}`)(client);
}

// Getting other global `client` variables //
client.owner = client.config.admin.owner.id;
client.admin = client.config.admin.id;
client.name = client.config.client.info.name;
client.description = client.package.description;

// Connecting to MongoDB Database //
mongoose.connect(
  `mongodb+srv://${client.logins.mongodb.username}:${client.logins.mongodb.password}@${client.logins.mongodb.cluster.url}.mongodb.net/${client.logins.mongodb.cluster.database}?retryWrites=true&w=majority`, {
    useUnifiedTopology: true,
    useNewUrlParser: true
  }
).catch(err => console.log(err));

client.login(client.logins.token);
```Is this compact enough for a Index?
tight plinth
#

i mean if it works yes

neat harness
#

it does

sudden geyser
#

You could structure your index file any way you want, but I recommend using the index/main file as a loader for your modules, then do your stuff elsewhere. In this case, you're doing that.

young flame
#

or should i like

#

make it so you can do like

#

~>loop q to loop the queue ect

earnest phoenix
#

imo the embed is too extra

#

well, the author and the footer are

young flame
#

H but i like the colorrrrrrsssss

earnest phoenix
#

makes it look too fat

young flame
#

thats even betteR

#

but fine qwq

lusty quest
#

looks cluttered with a lot of unnecessary informations

young flame
#

oki oki i get it

earnest phoenix
#

much

young flame
#

time to code a illegall spotify api

earnest phoenix
#

looks less cluttered now, i like it

young flame
#

ive been coding this bot

#

for 4 months

#

its only taken this long because im lazy tbh

earnest phoenix
#

its ok i spend more time staring at my code than actually working on it

#

lmfao

#

@young flame at least you know how to code

#

:(.

young flame
#

sameee

#

it could have been done

#

but i dont wanna do the mod logging stuff

#

so i decided to add more commands until i was forced to do the mod loggin stuff

willow mirage
#

Anyone know how i can connect discord bot with Dialogflow ?

young flame
#

uh

#

you mean the chat api thing?

#

here

#

@willow mirage

willow mirage
#

yes

willow mirage
#

@young flame they are outdated . . .

opal plank
umbral zealot
umbral zealot
#

maybe it's defined in the wrong scope

#

If something stops working and nothing's changed, something's changed.

#

sure why not

#

well

#

your problem is

#

it's not defined when you call it

#

needs to be defined at the top

sudden geyser
umbral zealot
#

in javascript yes

#

but this is js in html

#

it's more finicky

sudden geyser
#

oh

#

ew

umbral zealot
#

Though to be fair, I might be a bit wrong - this could be fully caused by the syntax error

#

actually that might be it

#

since the script has an error it's not loaded, so, the function isn't defined. girlhmmthink

serene knoll
gilded olive
lusty quest
willow mirage
#

oh ok

remote remnant
#

Hello, does anyone know how to get an array of values from a quick.db database? I’m trying to create a leaderboard command that will display the top 10 users with the highest db value, but nothing in the quick.db documentation explains this. Thanks.

hazy elm
#

M

marble juniper
#

just ask there

#

lol

remote remnant
#

Ok, thanks.

willow mirage
#

Help, my Ready event is not happening

#

idk why

lusty quest
#

more informations? errors, how did you call the event?

#

also what language

willow mirage
#

Nope

#

D.js

#

on debug still normal

lusty quest
#

how did you execute the event?

willow mirage
#

No errors

#

wdym?

#

require('./handlers/events')(client);

#
const { readdirSync } = require("fs")

module.exports = (client) => {
    try {
        const load = dirs => {
            const events = readdirSync(`./events/${dirs}/`).filter(d => d.endsWith('.js'));
            for (let file of events) {
                const evt = require(`../events/${dirs}/${file}`);
                let eName = file.split('.')[0];
                client.on(eName, evt.bind(null, client));
            };
        };
        readdirSync("./events/").forEach(x => load(x));
    } catch (e) {
        return require("../tools/functions/error")(e, undefined)
    }
}; 
lusty quest
#

this points then to your event

willow mirage
#

and i put the event file in ./handlers/client/ready.js

#

nope

lusty quest
#

how does your ready file looks like?

willow mirage
#
const mongoose = require('mongoose');

module.exports = (client) => {
    try {
        await client.user.setActivity(`any messages in DM`, { type: "WATCHING" });
        await mongoose.connect(process.env.mongo, {
            useNewUrlParser: true,
            useUnifiedTopology: true
        }, () => {
            console.log(`${client.user.tag} has been conencted to database.`)
        })
        console.log(`${client.user.tag} is ready!`);
    } catch (e) {
        return require('../../tools/functions/error')(e);
    }
}
#

normal

lusty quest
#

looks fine.

#

other events work?

willow mirage
#

dude

#

it is not ready

#

how im gonna test other events

lusty quest
#

you dont need to handle the event to get other events

willow mirage
#
Provided token: Nzk0OTYyNDM2NTAzMzcxNzk2.X_Ccdg.***************************
Preparing to connect to the gateway...
[WS => Manager] Fetched Gateway Information
    URL: wss://gateway.discord.gg
    Recommended Shards: 1
[WS => Manager] Session Limit Information 
    Total: 1000
    Remaining: 990
[WS => Manager] Spawning shards: 0        
[WS => Shard 0] [CONNECT]
    Gateway    : wss://gateway.discord.gg/
    Version    : 6
    Encoding   : json
PS D:\talky-bot> node .
Provided token: Nzk0OTYyNDM2NTAzMzcxNzk2.X_Ccdg.***************************
Preparing to connect to the gateway...
[WS => Manager] Fetched Gateway Information
    URL: wss://gateway.discord.gg
    Recommended Shards: 1
[WS => Manager] Session Limit Information 
    Total: 1000
    Remaining: 986
[WS => Manager] Spawning shards: 0        
[WS => Shard 0] [CONNECT]
    Gateway    : wss://gateway.discord.gg/
    Version    : 6
    Encoding   : json
    Compression: none
[WS => Shard 0] Setting a HELLO timeout for 20s.
[WS => Shard 0] [CONNECTED] wss://gateway.discord.gg/?v=6&encoding=json in 268ms
[WS => Shard 0] Clearing the HELLO timeout.
[WS => Shard 0] Setting a heartbeat interval for 41250ms.
#

this is on the debug

tulip ledge
#

Token

willow mirage
#

still normal

tulip ledge
#

Ur token

#

Ur token

willow mirage
#

iti s ok

tulip ledge
#

Is in there

lusty quest
#

its not the full token

willow mirage
#

hashed

willow mirage
#

ah

#

the debug work fine

lusty quest
#

how old is your d.js version?

willow mirage
#
client.on('debug')
#

let me check

lusty quest
#

bcs it uses the V6 api

willow mirage
#

it is v12

lusty quest
#

yea but what version

willow mirage
#

v12.5.1

lusty quest
#

bcs the V6 API is deprecated

willow mirage
#

so?

lusty quest
#

hmm its the latest

willow mirage
#

yep

peak cosmos
willow mirage
#

i did npm i discord.js@12.x.x

#

so ye lastest

lusty quest
#

did you get any more stuff after the heartbeat interval?

willow mirage
#

nope

#

nothing

#

i waited 15mins

#

smh

lusty quest
#

strange. looks like you dont authenticate to the gateway

willow mirage
#

wdym?

digital ibex
#

quick question

willow mirage
#

?

willow mirage
#

we are not py

digital ibex
#

does anyone know a css framework which only does checkboxes? kinda a stupid question but was just wondering

willow mirage
#

so ye . ..

#

@peak cosmos sorrey

#

ping @ Shivaco

lusty quest
#

discord.js uses a Websocket connection to the Gateway (Discords Websocket server) if you login you get a Hello Event. after this you should authenticate

willow mirage
#

but don't

lusty quest
#

did you see any heartbeat events?

peak cosmos
#

been told to ping u

willow mirage
#

Just the ping of the heartbeat and sending heartbeat

digital ibex
#

like a normal css framework, does tabs, navbars, buttons etc. but im only looking for form / just checkboxes. any ideas?

lusty quest
#

hmm so the websocket is connected. did you pass any intends to your client?

willow mirage
#

wdym?

lusty quest
#

its possible that you dont send any intend

willow mirage
#

Wdym passing intends ?

lusty quest
#

one sec. ive had done this for now on a Websocket level but forgot what to add to the client options

willow mirage
#

ok

#

just ping me

#

when u have answer

fair axle
willow mirage
#

```js

text

```

fair axle
#

thanks

lusty quest
peak cosmos
#

so know one knows whats going on?

willow mirage
#

in the index.js file

lusty quest
#

after the client is initilized?

willow mirage
#

yep

halcyon kite
#

hey so i am trying to make a command that can be reset but i want it to stop doing that part of the command, so how do you do it? i am using quick.db for this on discord.js here is he code for that part

lusty quest
#

hmm bcs thats the only thing i can think off why you dont get the ready event

willow mirage
#

maybe the server is sux

#

and i have to wait

lusty quest
#

nah

willow mirage
#

nvm imma go eat, i will after. Maybe just a Discord side error

#

bye

lusty quest
halcyon kite
#

so i wanted to reset that part where the pb part is

lusty quest
#

pb?

halcyon kite
#

when fw 1 / 0 is done

#

then you cant do the command unless reset by admin

lusty quest
#

yea you run this part of code anyways bcs you check if fw ===1 or if fw === 0 to execute the code after this

halcyon kite
#

well

#

you cant do the pb part

lusty quest
#

it has the same effect as if the check is not there

halcyon kite
#

not the fw1 or fw0

lusty quest
#

so the collector doesnt work?

#

or did you want to prevent that the part gets executed at all?

earnest phoenix
halcyon kite
#

so when i make a preventer all it does is stop the whole command from doing it

#

not the part

lusty quest
#

but you want to prevent this special part?

halcyon kite
#

yes

#

but not the whole command

#

using quick.db

lusty quest
#

i would suggest to add a check after if(collected.first().content where you get a value from your db that decides if the thing is locked or not

#

like a simple boolean would work

halcyon kite
#

ok

#

ill see what i can do with this info thx

lusty quest
#

and in your admin command you can just switch the boolean to lock or unlock it

halcyon kite
#

ok

#

hmmmmmm im pretty sure i can check like if(lock === 1) return message.channel.send("test")

#

after i fetch the lcok

#

ill try it

lusty quest
#

just check if (lock== true) return message.channel.send()

#

but 1 and 0 should also be valid in js

halcyon kite
#

hmmm heres what it displays

lusty quest
#

did you fetch the lock from the database?

halcyon kite
#

well i did 1 instead of true

#

and yes

lusty quest
#

did you stored it with true or 1?

halcyon kite
#

it locks me out of command compltely not the special part

lusty quest
#

bcs if you use true you cant use ===

halcyon kite
#

i used 1

#

not true

lusty quest
#

in the db?

halcyon kite
#

yes

#

bc i use numb

lusty quest
#

then it should be valid

halcyon kite
#

yes but it blocks the whole command not special part

lusty quest
#

where is your if(lock) check? directly after the pb check?

halcyon kite
#

here

willow mirage
#

Im done

#

this D.js sux

lusty quest
#

i have no issues with it. are you sure you login?

willow mirage
#

yes

halcyon kite
#

here

willow mirage
#

wait imma restart pc

halcyon kite
#

pb was example

lusty quest
#

it works as intended

halcyon kite
#

here ill try again

lusty quest
#

like you ran the command and it locked the entire command

halcyon kite
#

yes

willow mirage
#

and it still not working

#

d.js sux

lusty quest
#

you have somewhere an error show your main file

halcyon kite
#

wtf now it works

#

:/

lusty quest
#

it worked before?

halcyon kite
#

no it showed that message

opal plank
lusty quest
#

it showed that you already spawned the thing like in your lock check

halcyon kite
#

oh yeah

#

i changed the lock part from lock 1 to lock

#

:/

toxic glade
#

hmm

halcyon kite
#

well its fixed

toxic glade
halcyon kite
#

so bye

toxic glade
#

me want codes

opal plank
toxic glade
#

from where ?

opal plank
#

internet? books? resources?

toxic glade
#

books

lusty quest
#

the internet is a fantastic thing to learn stuff (if you search right)

opal plank
toxic glade
#

ohk

lusty quest
#

or check the pins in this channel

opal plank
#

or that

#

or faq

halcyon kite
#

then u can search up how to start a discord bot using node.js for javascript bc i code in JS

opal plank
#

bad

#

you should learn how to use javascript BEFORE doing a bot

halcyon kite
#

part after u learned

willow mirage
#

D.js sux confirmed

lusty quest
#

show your main file. maybe there is an error

willow mirage
#

me?

lusty quest
#

yes

willow mirage
#
const {Client, Collection} = require("discord.js");
const client = new Client();
require('dotenv').config();

client.start = new Date();
client.chats = 0;
client.aliases = new Collection();
client.commands = new Collection();
client.guild = new Collection();

require('./handlers/commands')(client);
require('./handlers/events')(client);

client.login(process.env.BOT); 
lusty quest
#

thats some dense code

opal plank
#

tell me about it

lusty quest
#

he doesnt get the ready event

willow mirage
#

Ready event is not working

opal plank
#

im not even sure that dotevn is going to work

willow mirage
#

well i just require it

opal plank
#

dotenv.config()?

willow mirage
#

work or not idc

lusty quest
#

this is valid

opal plank
#

dotenv.js?

willow mirage
#

but to the main error

#

ready is wokring

#

smh

lusty quest
#

gg

halcyon kite
#

noice

willow mirage
#

d.js just sux

opal plank
#

what IS dotenv?

lusty quest
#

no

willow mirage
#

discord server sux

#

@opal plank process.env

opal plank
#

well no shit, that i know

lusty quest
#

dotenv exposes enviroment variables in a .env file as process.env

opal plank
#

you requirinjg something that is already on the process

#

what IS YOUR dotenv

#

lemme rephrase the question

willow mirage
#

a .env file?

opal plank
#

.env.config() is a thing?

willow mirage
#

it is

#

a THING

opal plank
#

the heck

lusty quest
#

yea?

willow mirage
#

read pls

opal plank
#

oh its a fucking module

#

goddamit

willow mirage
#

BRUH

opal plank
#

ENV is native

#

i thought you were requiring the ENV raw

willow mirage
#

not alway

lusty quest
#

well dotenv just exposes the .env file to the entire process in a handy way

opal plank
#

ENV is native

willow mirage
#

BUT CAN YOU FOCUS ON MY READY EVENT

opal plank
#

CAN YOU NOT SCREAM

willow mirage
#

YOU ARE SCREAMING

opal plank
#

jesus christ, cancer chat this early in the day

willow mirage
#

xD

halcyon kite
#

u are BOTH screaming so chill

opal plank
#

good luck withy our problem

lusty quest
#

console.log(process.env.BOT) if it returns undefined your .env file is in a bad spot in your file system

willow mirage
#

nah it won't

lusty quest
#

did you checked this?

willow mirage
#

cuz in debug shows the token is valid

crimson vapor
#

I feel bad for you Erwin

willow mirage
#

and my bot is online

crimson vapor
#

just trying to help

#

getting yelled at

willow mirage
#

But he helped a wrong problem

#

well it is not a problem

#

a wrong place

willow mirage
#

yep

#

others event work

crimson vapor
#

show code for ready

#

show code for message event

halcyon kite
crimson vapor
#

time to play a game of spot the differences

lusty quest
#

the events look fine.

willow mirage
#
const mongoose = require('mongoose');

module.exports = (client) => {
    try {
        await client.user.setActivity(`any messages in DM`, { type: "WATCHING" });
        await mongoose.connect(process.env.mongo, {
            useNewUrlParser: true,
            useUnifiedTopology: true
        }, () => {
            console.log(`${client.user.tag} has been conencted to database.`)
        })
        console.log(`${client.user.tag} is ready!`);
    } catch (e) {
        return require('../../tools/functions/error')(e);
    }
}
crimson vapor
#

show message

#

if you can

willow mirage
#

what message?

crimson vapor
#

message event

willow mirage
#
module.exports = (client, message) => {
    if (message.author.bot) return;
    if (message.channel.type == "dm") {
        return require('../../tools/talking/talking.js')(message);
    }
}
crimson vapor
#

and you know that works?

willow mirage
#

yep

#

dude that is not the problem

#

smh

crimson vapor
#

chill

willow mirage
#

The problem is the bot is not ready

#

It doesn't login

crimson vapor
#

well you have 2 problems

#

1 of 2

willow mirage
#

i did

crimson vapor
#

you didn't log in

willow mirage
#

i did . . .

lusty quest
#

he does

crimson vapor
#

or the event handler didn't work

lusty quest
#

in his main file

willow mirage
#

dude i was playing with d.js for a year now, i know what im doing. The problem is just that d.js sux

crimson vapor
#

I like djs lmao

#

your ready event should always be called

lusty quest
#

i use D.js now for 2 years and have no issues

willow mirage
#

me no

opal plank
#
const {Client, Collection} = require("discord.js");
const client = new Client();
require('dotenv').config();

client.start = new Date();
client.chats = 0;
client.aliases = new Collection();
client.commands = new Collection();
client.guild = new Collection();

client.on('ready', () => console.log('Index ready'))
require('./handlers/commands')(client);
require('./handlers/events')(client);

client.login(process.env.BOT); ```
@willow mirage do that and run it
willow mirage
#

i did

opal plank
#

do it again

willow mirage
#

ah wait

#

oh

#

smart