#development

1 messages · Page 1400 of 1

torn hollow
#

if(message.mentions.roles.first()?.name == "Server Booster"){

#

Can i delete .roles and put Lautaroice#0800

#

¿?

stoic girder
#

For person mention you can use mentions.members.first()?.name == "Lautaroice"

#

I think you need username and discriminator actually.

pale vessel
#

Tag, I guess

#

You can also just use your ID

stoic girder
#

yeah probably

opal plank
#

isnt it better to use id?

stoic girder
#

console.log(mentions.members.first()) and see what you need lol

pale vessel
#

Yeah

opal plank
#

what if you change your name?

#

or you are nicknamed

#

actually i think it shows under displayName

stoic girder
#

guess you could say same for role mention

opal plank
#

not under name

stoic girder
#

yeah i wasn't sure about the property name

opal plank
#

also using first() prob not best apporach

#

its a Map

#

check with has()

stoic girder
#

hmm

#

that would help in case multiple people are mentioned?

opal plank
#

its to avoid people using multiple mentions

#

if i do @stoic girder then @opal plank it'll get yours first[

#

event though @opal plank is there

stoic girder
#

yeah that's what i meant

pale vessel
#

It's not in any particular order but you're right

opal plank
#

i think its ordered by id

#

if i remember correctly

pale vessel
#

Discord API be like

torn hollow
#

if (message.mentions.members.first()== "lautaroice"){
console.log(mentions.members.first());
}

#

¿?

pale vessel
#

Nope

opal plank
#

all mentions/members/users are mapped in id order, though i could be wrong about that

#

though im 70% sure

pale vessel
#

You should use message.mentions.has("your id")

stoic girder
#

and you get your id by right clicking your username -> copy id

#

assuming dev mode is on

#

which is turned on in settings -> appearance

#

damn i love helping people even tho i suck at it

pale vessel
#

Relatable

torn hollow
#

@pale vessel In the if?

stoic girder
#

ye

#

fun fact - i was so so so close to start making discord bots in php

#

that would be awful

boreal iron
#

Not really

stoic girder
#

you tried?

boreal iron
#

I did

stoic girder
#

i mean i use php for some websites but people hate it so much

#

my first lang :v

pale vessel
#

PHP is not bad

torn hollow
#

if (message.mentions.has== "Lautaroice#0800"){
console.log(mentions.members.first());
}

stoic girder
#

aaaaah

pale vessel
#

That is your tag

boreal iron
#

Just doing an endless loop and requesting the API over and over again within the limits

#

Is as responsive as JS

pale vessel
#

Use message.mentions.has("209841194975494144")

opal plank
boreal iron
#

You won’t notice a difference

#

It PHP is not made to use it like this

pale vessel
#

What the what

boreal iron
#

Which doesn’t mean you can’t

torn hollow
#

And that nums?

pale vessel
#

That is your ID

stoic girder
#

that number is your ID, which i explained above how to get it

torn hollow
#

@pale vessel Where can i see that?

pale vessel
#

Please read defected's messages, I actually feel bad for him

stoic girder
#

wrong reply:

#

oops

torn hollow
#

But my id where you found that?

stoic girder
#

here you go

torn hollow
#

Ahhh

#

Okayyy

#

AHHAHA

stoic girder
pale vessel
#

Make sure you right click the profile picture, not the message since that would be the message ID

boreal iron
#

You should told him it doesn’t exist on mobile versions of Discord

earnest phoenix
#

i always do the name

boreal iron
#

He might be there

stoic girder
#

do people make bots on phones

pale vessel
#

Lol he sent a screenshot on web

#

@stoic girder Yes, a friend named Voltrex Master did that

stoic girder
#

woww

boreal iron
#

Not only he did

stoic girder
#

"why was my boat rejected"

#

im dying

#

earnest phoenix
#

i made a bot on phone once

stoic girder
#

is there like an app on play store

#

or you literally write code

#

on phone

boreal iron
#

Met a few people here hosting on their mobile phones

earnest phoenix
#

i used repl

boreal iron
#

Don’t wanna comment this but yeah why not

stoic girder
pale vessel
#

Auger did that

#

With a cs bot

stoic girder
#

imagine paying for hosting

earnest phoenix
#

same

boreal iron
#

Backed it up somewhere, gimme a sec

leaden lake
stoic girder
#

yikes, a language that i don't know

pale vessel
#

\Channel

#

Why?

#

You mean \nChannel?

leaden lake
#

oh yes, I wanted to type \nChannel

#

yeah thx

boreal iron
#

@stoic girder just an endless loop fetching the guild messages every 500 ms within the ratelimit adding ?after as GET argument to catch the latest messages only

#

Works like a charm

#

You won’t note a difference to a bot made in JS but as I said PHP is not supposed to act as live environment

stoic girder
#

that spaces in functions trigger me

#

what about discord php library?

#

there's one thats frequently updated

boreal iron
#

Nah I don’t like to use libs, doing my shit alone doesn’t require to update all the shit always

stoic girder
#

Some smaller libs, sure, but if this was an actual "big" bot, it would be a mess I assume.

pale vessel
#

Eh, it's could be the opposite

#

Once your bot is big, you need to be able to scale

stoic girder
#

Which is why I'm regretting SQLite and rewriting my whole god damn bot right now.

sudden geyser
pale vessel
#

So you would typically make your own lib to reduce caching or modify an existing library

boreal iron
stoic girder
#

I wouldn't reinvent the wheel but modifying could be useful.

#

All depends on the specific environment and use case.

pale vessel
#

Yeah

boreal iron
#

Aye the mentioned example wasn’t supposed to run on lots of servers of course

stoic girder
#

yeah

sudden geyser
#

Maybe not now, but in the future, there could be. Most bots use libraries because someone else (a community in fact) has already put in the hard work to make it easier / more elegant to use. But there is value out of making your own. It's like the difference between making your own HTTP client vs. using a library to do it for you

desert hazel
#

How can i make a bot that tracks my servers votes?

stoic girder
desert hazel
#

Yea

stoic girder
#

i have no idea let me check the docs for you PB_crossover_kek

#

@desert hazel Ok so in your server edit page you can set up a webhook URL. Your bot should have a HTTP server at that URL that will parse incoming POST requests.

#

I'm not sure do any of the DBL API packages have that feature, don't use them myself.

boreal iron
#

Yeah the libs contain tons of functions and method you don’t need to create your own. That’s correct but how djs for example communicates to the Discord API - sending POST, GET, PATCH whatever requests won’t change in the future. Using these libs is the easiest solution for the most use cases. But not if you wanna code it your own style and you’re able to it. Especially if you wanna put all the content in you really need.

#

Changing the API version to v8 didn’t change the way to communication works with the endpoint which didn’t require any change of my code.

sudden geyser
#

It's not just about classes, functions, utilities, etc. It's also about conforming to Discord's API & rules. For example, I don't see you handling rate limits in the screenshot you shared. Maybe you are and I'm just blind, but I wont nitpick on someone's choices.

pale vessel
#

He did say it's for a small bot...

boreal iron
#

Even if using a OOP style is not the most efficient style but it actually requires just a few changes if I ever need to change some of my ... what you would prototype functions

#

lol the screenshot is small look into a specific code snipped to the framework around

stoic girder
#

Working on an application bot... Questions can be added & removed by server admin.
Once someone applies, should I store question ID & answer or question text & answer?

ID would use less space but would create problems if a question is removed.

#

Any other cons of storing question text directly?

desert hazel
#

so how would i get the users name that voted, sent to this? and then it will update my bot

boreal iron
#

Before entering the loop there’re way more requests getting the guilds, the channels etc. and receives any message on any channel after the last sent message (cached)

desert hazel
#

or ID

stoic girder
#

@desert hazel dump the POST request data and see what it contains, i guess there is user_id var or something

desert hazel
#

ok so i make the the /webhook/url in my bot?

stoic girder
#

Where is your bot hosted, and which language are you using?

#

Do you know how to setup a webserver?

desert hazel
#

I can setup a website, plus using js

#

i think i can setup a site

#

using the http

errant perch
#
(node:3893) UnhandledPromiseRejectionWarning: Error: EMFILE: too many open files, open './storage.json'``` anyone might know why im getting this error? i'm using javascript
stoic girder
#

So setup a webserver, make a check if it receives a post request from top.gg, put the URL in settings on top.gg, and use the received data to do something with the user which upvoted.

desert hazel
#

okay lemme try that, can i ping you if needed?

stoic girder
#

Sure

desert hazel
#

Thanks

#

ok good

stoic girder
#

except you need the server to actually be hosted somewhere

boreal iron
#

make sure it’s accessible to the public

stoic girder
boreal iron
#

Aye

desert hazel
#

i did my IP

#

so do i need to forward my domain to my IP

safe creek
#

Quick question what does async def mean in py?

desert hazel
#

idek what port the request is coming in on

desert hazel
safe creek
#

Ok coool

stoic girder
#

@safe creek look up asynchronous programming

safe creek
#

Mmmk

stoic girder
#

i don't understand it too much

#

but

#

it works

#
    await doSomething(); // wait for doSomething to finish
    proceedWithCode();
}```
desert hazel
stoic girder
#

dump the whole request, does it work at all?

desert hazel
#

nope, if i go ip:5000/test it prints passed

stoic girder
#

you did press "test webhook"?

desert hazel
#

yep

#

thats all it says

stoic girder
#

maybe its due to port?

#

why not use "default" 80

desert hazel
#

i took the port from the docs

stoic girder
#

hmm

desert hazel
#

5000 is on the docs

#

wait

#

wait

#

maybe it cant get through the firewall on my wifi

boreal iron
#

Not on port 5000

desert hazel
#

f

#

lol

#

let me try open it

boreal iron
#

That’s why he told you to use the default webserver port

desert hazel
#

but dbl dont post on 80

stoic girder
#

DBL posts to whatever you set in the webhook URL field

desert hazel
#

oh, it didnt work when that was 80 then

#

just opened 5000 and didnt work either

boreal iron
#

Yeah your router doesn’t forward port 80 to your device anyway

desert hazel
#

so i need to forward it to my device

#

bet, one second

boreal iron
#

You need to forward ports if u wanna use it at your device and open the port in the firewall after

#

TCP

desert hazel
#

?

stoic girder
#

is there any alternative to "break" in Array.forEach

#

or i need to go with a regular for loop

desert hazel
#

stop it at the one you need with if?

stoic girder
#

yeah

desert hazel
#

cant you stop it at with a if(found === request)?

stoic girder
#

i have if(cancel) break

desert hazel
#

idfk if i am forwarding it correctly

stoic girder
#

i guess i can put all the code in if(!cancel

boreal iron
#

What do mean by breaking the array?

stoic girder
#

might as well just go with regular loop

stoic girder
boreal iron
#

break works in any loop

desert hazel
#

either i havent forwarded correctly, or its not working

stoic girder
#

questions.forEach(question => { if(cancel) break; });
SyntaxError: Illegal break statement

#

i'll just use for(q in questions)

desert hazel
#

yea

#

think my wifi broke ngl

#

forwarding to my pc has broke google

#

👀

stoic girder
#

just hate that it returns key, not the element itself, so you need let question = questions[q];

stoic girder
#

bot is hosted on your pc as well?

desert hazel
#

yes

#

how does discord work

#

and google dont

stoic girder
#

why not host it all on repl.it or something

#

idk shit about port forwarding

desert hazel
#

Bro i think im only allowing port 5000 to my pc KEK

boreal iron
#

Most routers are not able to resolve your own IP, just open the URL on your mobile device not using your LAN

stoic girder
boreal iron
#

And don’t forget the firewall as mentioned

#

Most cheap ISP routers are trash, actually have no real option to configure DNS rebind sec etc.

desert hazel
#

Bruh im using a 4g router lmaooo

stoic girder
#

get 5G OverDabbing

boreal iron
#

And also seen lots of routers don’t even supporting port forwarding even if you can set it up in the UI

desert hazel
#

Bro my 4g router is faster than my wired connection

earnest phoenix
#

same LOL

boreal iron
#

lol thought my country is a mess already but a wireless router phew

stoic girder
#

same here ngl

earnest phoenix
#

i got unlimited data so i just hotspot my 4g most of the time

desert hazel
#

i got unlimited data

safe creek
#

how many commands can i jam into one discord.py file?

desert hazel
boreal iron
#

lol do you live in the jungle lmao

desert hazel
stoic girder
#

i had unlimited and they lowered it to 200gb at same price

#

take that

safe creek
#

oh nice

desert hazel
#

i live in the lanes

#

OH SHIT

#

I THINK IT DID IT

#

OMG

earnest phoenix
#

our "unlimited" used to be 1TB of data a month and then you get throttled to really low speeds

#

now they dropped it to 200gb

desert hazel
stoic girder
#

where you from

#

literally

#

same

#

here

earnest phoenix
#

croatia

stoic girder
#

ooooho

#

također

desert hazel
#

FUCK

stoic girder
#

(sry for non english)

desert hazel
#

#1

boreal iron
#

Well cash is all they need

earnest phoenix
#

this

#

every ISP is a scam here

#

lol

stoic girder
#

yep

boreal iron
#

well hearing about your limits...

#

Can only dream about such limits

earnest phoenix
#

i wouldn't complain if they did it to new users

#

but they lowered the limits to everyone without notifying

boreal iron
#

More than 100 bucks are required per months for unlimited

#

here

desert hazel
#

bruh this shit buggin me

stoic girder
#
let AnswerSchema = new mongoose.Schema({
    question: { type: String },
    answer: { type: String }
});

module.exports = mongoose.model('Application', new mongoose.Schema({
    user: { type: String },
    guild: { type: String },
    answers: [ AnswerSchema ],
    status: { type: Number, default: 0 },
    date: { type: Date, default: Date.now }
}));

...

let applicationSchema = bot.data.getQuestionSchema();
let application = new applicationSchema({ user: msg.author.id, guild: msg.guild.id });

...

application.answers.create({ question: question.content, answer: answer });

Cannot read property answers of undefined.

#

Some obvious error

#

Or my code sucks

#

or both

#

ahh

#

im dumb as fuck

#

getQuestionSchema instead of applicationSchema

#

don't copy-paste kids

boreal iron
desert hazel
#

Na

#

im copy and pasting off a github one lmao

desert hazel
stoic girder
#

xd

#

i copy-pasted my own code

#

and yet i managed to mess it up

desert hazel
#

LOL

boreal iron
#

Oof time is running... wanted to sleep for a few hours already damn

stoic girder
#

heh, could've probably finished a lot more commands instead of chatting here for past hour or two

#

but nice to talk to you folks

desert hazel
#

cya

#

thanks for the help

stoic girder
#

wait

#

wrong

desert hazel
#

LO

#

LOL

#

LOL

stoic girder
#

xd

#

bye 🙂

desert hazel
stoic girder
#

lmao

#

im stealing that one

desert hazel
stoic girder
desert hazel
#

Big kek

stoic girder
#

wait

#

an emoji

#

can be that big

desert hazel
#

no

#

thats 4x emojis

stoic girder
#

4 of em lmao

desert hazel
stoic girder
#

thats a big brain move

desert hazel
#

i had one that was like 8

#

it was huge

stoic girder
#

lol

desert hazel
stoic girder
desert hazel
stoic girder
#

yours is bigger 😢

desert hazel
#

Sad pepe

earnest phoenix
rustic nova
#

This development naniSmug tempviber

stoic girder
earnest phoenix
desert hazel
#

im a dev

#

Shhh

#

dont grass

stoic girder
#

hehe boi

desert hazel
#

be kind

stoic girder
#

grass

#

hehe

earnest phoenix
dire cypress
#

Kii haal bhai

desert hazel
earnest phoenix
rustic nova
stoic girder
#

ok calm levi boi

desert hazel
#

ok imagine being a grass

#

imagine snitching

stoic girder
#

let imagine = grass

#

engineer

desert hazel
#

Snitches get stitches KEK

#

👀

stoic girder
#

application.answers.create({ data: moreData });

console.log(application.answers); -> empty array

is this expected? do i need to fetch the "row" again to get answers?

#

mongoose btw

desert hazel
#

try it 👀

#

i dont use mongoose

earnest phoenix
desert hazel
#

Ok levi

#

calm it

stoic girder
#

i just closed everything

#

2am tired af

desert hazel
#

Lol

#

Gn

rustic nova
#

aaaaaaaaaaaaaa

#

@oak cliff

desert hazel
#

SNITCH

#

OMG

#

A SNITCH

#

OMG

oak cliff
#

Dont post flashy emotes, thanks.

stoic girder
#

it will surely work if i get the row again, but more code, more memory and stuff

#

anyways

oak cliff
#

Rules are rules for a reason nyaaThumbsup

earnest phoenix
stoic girder
#

good night

desert hazel
#

Gn

earnest phoenix
stoic girder
oak cliff
#

also keep this channel on topic?

earnest phoenix
#

ok

oak cliff
#

I just said not to post flashy emotes.

earnest phoenix
#

@oak cliff thats not flashy tf

oak cliff
#

rapidly color changing emotes

#

flashy.

earnest phoenix
#

not rapid?

#

there

#

slow

oak cliff
#

doesnt belong in this channel anyway

proper bolt
#

yes

rustic nova
#

you don't know what you just started with mentioning json

proper bolt
#

json can lead to corruption issues down the line

#

do it once and get it right

#

k

#

he deleted his messages

errant perch
#

shhhhh

#

they're always watching 👀

earnest phoenix
#

whats the event for when you join a guild?

proper bolt
#

what lib

errant perch
#

bot.on("guildCreate", guild => {

})

#

i assume javascript

earnest phoenix
#

o thx

#

ye

errant perch
#

the event for a bot leaving a guild is guildDelete

#

just replace guildCreate with guildDelete

#

you're welcome

earnest phoenix
#

also - how can you find a channel called message-log and create a webhook there?

#

srry

#

im not that good with discord api

proper bolt
earnest phoenix
#

ik

proper bolt
#

full docs on how to do stuff there

earnest phoenix
#

i read

proper bolt
earnest phoenix
#

yes

#

ik how to create a webhook

rustic nova
#
#

best is to read through it

proper bolt
#

learning how to read through docs and rely more on yourself is a very important skill

earnest phoenix
#

but how do you find a specific channel name?

proper bolt
#

.find

earnest phoenix
#

i read through the documentation

#

?

rustic nova
proper bolt
earnest phoenix
#

oooo

#

a pass through

#

tot it

#

got

#

thx

somber wigeon
#

mmmm

fresh sky
#

14. Bots with commands allowing a user to DM another user must either state the author or that it was anonymous; in addition to having a block or opt-out feature.

Does this mean I can't make a feature that DM's a person when gets banned/kicked/warned????? Or did I read this wrong?

pale vessel
#

You read it wrong

#

That won't be a command

fresh sky
#

Ok Good Thought so

pale vessel
#

Make sure you have an option to disable it

fresh sky
#

Ok

proven lantern
#

client.on('guildMemberAdd', (member) => {})
should this listener be triggered when someone new joins the discord guild?

#

it doesn't seem to be working anymore

rustic nova
#

remember to enable the member intent

proven lantern
#

is that a new requirement?

rustic nova
#

your event requires the GUILD_MEMBER_ADD intent, as listed on this page

GUILD_MEMBERS (1 << 1)
  - GUILD_MEMBER_ADD
  - GUILD_MEMBER_UPDATE
  - GUILD_MEMBER_REMOVE
proven lantern
#

is there a config somewhere that i can add that to?

rustic nova
pale vessel
#

Include the intent in your client options too

rustic nova
#

yeah, both is better

pale vessel
#

ClientOptions#ws#intents

proven lantern
#

thanks, trying that out now

broken matrix
#

how do i change the color of vote and invite buttons

agile lance
broken matrix
#

No its not

#

smh

#

devlopment for code

agile lance
broken matrix
#

No its not

#

sped

#

no its not smh

pale vessel
#

Use the <style> tag

broken matrix
#

Smh

#

whats the id of the buttons

broken matrix
#

cant find it

pale vessel
#

Inspect element

broken matrix
#

yeahj cant find it

agile lance
#

Don’t you “smh” me when you’re not more clear about questions just asking “how can i change this button” isn’t clear enough. Thank you, Have a good day.

pale vessel
broken matrix
#

thank you flaz

agile lance
#

Okok, Let me get this straight. You reply back to me after I replied to you ENGAGING us into a thing called a “conversation” which means, you cant say anything about it. Thanks

pale vessel
#

Oh no! Anyway let's just move on

oak cliff
#

@agile lance dont attack people who are trying to help you

#

Follow rule one, thank you.

#

They were right, we allow any development topics in this channel, including html and css for the site.

broken matrix
#

Im a little new to html. Would i just do
div.titleandvote div.content {

#

to select a class

pale vessel
#

Yes but there's no .content under .titleandvote from what I'm seeing

broken matrix
#

i cant figure it out.

#

could you post an example

#

@pale vessel

near stratus
#

Do we need any special permission to use animated Emoji for bots ?

rustic nova
#

nope

near stratus
#

Cuz it isn't actually working

#

Just the normal emoji is working

rustic nova
#

remember that you have to get the emoji mention and your bot has to be inside that server

#

\:vibe:

#

doing something like that would give you !vibe

near stratus
#

:earth:
when I use this it just returns
:earth:

rustic nova
#

use the mention tag of that emoji then

near stratus
#

huh ?

near stratus
#

<:earth : 779014611835813898>

rustic nova
#

the :earth: gets parsed to the unicode 🌍

#

use the emoji mention tag

near stratus
rustic nova
#

the emoji mention tag

near stratus
#

like :earth:

#

??

rustic nova
#

Mention tag

#

!vibe for vibe for example

#

do \ then your emoji name

near stratus
#

I am using that

rustic nova
#

for putinFacepalm for example

near stratus
#
client.on("message", (message) => {
    let msg = message.content.trim();
    if (msg == "emoji" || msg == "emojis"){
        const emojiList = message.guild.emojis.cache;
        emojiList.forEach( (a) => {
            message.channel.send(`<:${a.name}:${a.id}>`);
        });
        //console.log(emojiList);
    }
});
client.login(process.env.BOT_TOKEN);
#

I am using this to get a list of emoji

rustic nova
#

add a to indicate it being animated

near stratus
rustic nova
#

<:a:name:id>

near stratus
#

oh

#

thanks

rustic nova
#

wait lemme test

#

yeah the a: is for indicating if it is animated

near stratus
#

Tha @rustic nova 😊 😊 😊

rustic nova
broken matrix
#

how do i change the color of the buttons (vote invite) and the tags

carmine cedar
#

so thats how you do animated emojis thanks!

rustic nova
#

css inside your long description

broken matrix
#

yeah but i dont know the css

main trench
#

I'm wondering if anyone has a link to either a quick.db or discord.js document that explains a little bit about a ignore channel code.

Basically I made a link deleting feature and I want to be able to have a specific channel where links can be sent and the link code will ignore this channel
Anyone know how this would be done or have a link to the document that explains this a little bit?

broken matrix
#

tried everything

rustic nova
#

inspect element is your friend

#

what did you try already? post your css

broken matrix
#

Yeah still didnt help

#

spent 2 hours on it

main trench
#

Just make a button tag in the css file

broken matrix
#
<style>
    div.titleandvote{
    transform: 0.5s!important;
    text-align: center!important;
    font-family: "courier", monospace!important;
    animation: fadeInAnimation ease 2.5s!important;
    animation-iteration-count: 1!important;
    animation-fill-mode: forwards!important;
    background: #9900cc !important;
    color: #fdca00!important;
}
</style>
main trench
#

And do button: { BackgroundColor: "color" }

rustic nova
#

yeah that's not how the css on the site works

main trench
#

I need to refresh on how css looks but that should be the code

rustic nova
#

oh wait

#

remove the div.

#

and try that

#

also, the css selector for both the buttons is .btn-orange

#

for all the buttons that is

slender thistle
#

why div. and not just div?

rustic nova
#

oh yeah, only div lmao

slender thistle
#

😛 baka

broken matrix
#

Ik its ;lazy but what should the code be like im very inexperienced

rustic nova
#

hint: to only change the invite and vote buttons (without the stars, shard server etc), just use the selector .titleandvote .btn-orange

slender thistle
#

CSS isn't that picky with rules. It's mostly the selectors that are the pain you have to deal with

broken matrix
#

Yes

#

how should i select it

rustic nova
#

just do what you did before, with the div.titleandvote

#

just renaming them to .titleandvote .btn-orange

#

without the div though

broken matrix
#
<style>
    prefix.btn-orange {

    background: #9900cc !important;
    color: #fdca00!important;
}
</style>
```?
rustic nova
#

getting these changed is pain

broken matrix
#

Very

rustic nova
#

not prefix.btn-orange

#

replace it with .titleandvote .btn-orange

broken matrix
#
<style>
    .titleandvote .bnt-orange {

    background: #9900cc !important;
    color: #fdca00!important;
}
</style>
#

That

rustic nova
#

yes

#

try that

#

well btn

#

not bnt

broken matrix
#

didnt work

rustic nova
#

what do you have now?

#

paste it

#

because i'm pretty sure it should work

broken matrix
#

<style>
.titleandvote .btn-orange {

background: #9900cc !important;
color: #fdca00!important;

}
</style>

rustic nova
#

what exactly doesn't work

#

put a space after the 00 and ! on color

broken matrix
#

<style>
.titleandvote .btn-orange {

background: #9900 cc ! important;
color: #fdca 00! important;

}
</style>

rustic nova
#

no

#
<style>
    .titleandvote .btn-orange {

    background: #9900cc !important;
    color: #fdca00 !important;
}
</style>
#

i highly suggest getting more css experience first before continuing to modify your bot page with design

slender thistle
broken matrix
#

Still isnt working

rustic nova
#

where exactly are you putting that on your bot page?

broken matrix
#

changing the background and the colors on the bottons

rustic nova
#

what doesn't change?

#

does the button color change?

broken matrix
#

No

rustic nova
#

get more experience in css first please

#

because that is crucial when designing your page

broken matrix
#

Yeah

#

i will

#

thank you for the help

#

Wait i got it

#

sorry to bug again but whats the selector for the tags and website- github links

rustic nova
#

bot-btnss

broken matrix
#

im blind then lol

rustic nova
#

websitelink for the website
support for the support button
github for github

#

not telling the one from report though, because that's a button you should not modify

broken matrix
#

Alright thank you

#

so just

<style>
    .websitelink  .btn-orange {

    background: #9900cc !important;
    color: #fdca00 !important;
}
</style>
rustic nova
#

that's your old one

#

if you want to add more, just append(add) them below the closing bracket

#

like

.websitelink .btn-orange {
stuffhere: hehe;
}

.yourotherthings {
color: rainbow
}
#

for example

broken matrix
#

ahh

#

ty

#
<style>
    .websitelink  .btn-orange {

    background: #9900cc !important;
    color: #fdca00 !important;
}
.support {
color: #fdca00
}
.github {
color: #fdca00
}
</style>
rustic nova
#

not exactly

#

oh wait

#

it's not .support .github etc

#

no wait wiat

#

jeez that's confusing

broken matrix
#

Yeah

rustic nova
#

ah got it

#

use #github

#

so in this case ```css
#github {
yourstuff: cool;
}

broken matrix
#

Got it

#
<style>
    .websitelink  .btn-orange {

    background: #9900cc !important;
    color: #fdca00 !important;
}
#support {
color: #fdca00
}
#github {
color: #fdca00
}
#btns {
color: #fdca00
</style>
#

Id asume that for the tags

rustic nova
#

yup

#

wait no

#

thats for the github support etc

broken matrix
#

how about tags and created by?

#

like im lost

rustic nova
#

i can't help you the whole time, try to learn a bit about css

broken matrix
#

Ok

strong tundra
#

should i link tailwind and use that

earnest phoenix
#

yeah i code html

Hacking into the mainframe l

rustic nova
#

l

earnest phoenix
#

If you can make me 1 bot for free dm me

hollow sedge
#

Wrong place

silver lintel
#

message.mentions.users.first() || message.guild.members.cache.get(args[0]) || message.author;
how do i make the message.guild.members.cache.get(args[0]) give a User object? because just adding .user to the end doesnt work

pale vessel
#

Make it a user (client.users.cache.get(id))

silver lintel
#

how do i make it so client.users.cahce... only works for members in the sevrer

vale garden
#

hi

#

does anyone know how you define a channel as an arg in py

#

discord.Channel or discord.ChannelType doesnt work

spark dawn
#

@vale garden mostly there are JavaScript or Typescript devs here so maybe checkout python docs

unborn ridge
#

i want a help

#

pls

#

anybody

#

??????????

idle patrol
#

ask away

spark dawn
#

@unborn ridge just ask it

unborn ridge
#

like i have my main folder

#

commands

spark dawn
#

hmm

unborn ridge
#
  if(err) console.log(err);
  let jsfiles = files.filter(f=> f.split(".").pop() === "js");
  
  if(jsfiles.length <= 0) {
    console.log(`NO COMMANDS FOUND !`);
  }

console.log(`LOADING ${jsfiles.length} COMMANDS !`);

jsfiles.forEach((f,i)=>{
  let sss = require(`./commands/${f}`);
  console.log(`${i+1}: ${f} Has Been Loaded !`);  
  bot.commands.set(sss.help.name,sss)
})
})```
#

i want to make subfolders

#

will they also wor

#

work

spark dawn
#

yeah

earnest phoenix
#

Use glob

unborn ridge
#

do i need to add something in index.js

earnest phoenix
#

Its like fs but only for finding file and stuff

unborn ridge
#

or just make a folder

#

and start the wok

spark dawn
#

not command sorry code

unborn ridge
#

?

spark dawn
#

wait a min

unborn ridge
#

i am unable to understand

#

cause if i dont make subfolder its messed up in between 109 commands

earnest phoenix
unborn ridge
#
 
// options is optional
glob("**/*.js", options, function (er, files) {
  // files is an array of filenames.
  // If the `nonull` option is set, and nothing
  // was found, then files is ["**/*.js"]
  // er is an error object or null.
})```
#

?

#

i have to type foldername in "**/*.js"

#

@earnest phoenix

spark dawn
#

@unborn ridge you should use a better command handler

#

if you have a lot to commands

carmine cedar
#

why does my bot repeat the message twice

unborn ridge
#

instances

#

@carmine cedar

#

ctrl+c in terminal will close an instance

#

so

#

do it

idle patrol
carmine cedar
#

ye

#

thats why

unborn ridge
#

pls help me too

#

'

#

i want to make subfolders

#

in commands folder

idle patrol
#

is it djs?

unborn ridge
#

yes

#

discord.js

#

@idle patrol

idle patrol
#

aah

unborn ridge
#

pls if u can help

idle patrol
#

im not proficient in that 😅

unborn ridge
#

it would be grat

idle patrol
#

sorry 8379_Sad_Boi_Hours

unborn ridge
idle patrol
earnest phoenix
#

@spark dawn glob is a better solution

unborn ridge
#

but how to do that

#

i dont know anything abou glob

#

@earnest phoenix cam u show a example

#

pls

earnest phoenix
#

The npm page have the example lol

spark dawn
untold rune
#

I can't figure out on_dbl_vote. Can anyone help me?

#

@commands.Cog.listener() async def on_dbl_vote(self, data): print('User with id {} has voted for the bot!'.format(data.user))

#

oops, wrong channel.

blissful raft
#

I need a new way to host, local hosting currently isn't an option

#

I've tried heroku, glitch, and repl.it, but they don't have what I need which is 24/7 uptime and ability to save data in a database, any option with both is perfect

rustic nova
#

a vps

blissful raft
#

Are there any free ones?

rustic nova
#

nope

blissful raft
#

Dang

untold rune
#

Did you do repl.it by itself? If you combine it with flask and uptimerobot, it has ||almost|| 100% uptime.

rustic nova
#

good and reliable hosting comes with a cost unfortunately

blissful raft
#

Uptime isn't the issue with repl.it, I can't install the dependency I need on repl.it

#

Which I guess turns into an uptime issue since I can't even run the bot on it lol

untold rune
#

I have more than 3 bots on repl.it, all with close to 100% uptime. What dependency do you need?

blissful raft
#

I need better-sqlite3

untold rune
#

Is it on github because I can't find it on the package menu?

blissful raft
#

I don't know if it's on GitHub, I install my dependencies with npm

unborn ridge
#
const { COLOR } = require("../../config.json");
module.exports = {
  name: "test",
  description: "Drop The Song From Queue",
  async execute(client, message, args) {
    if (message.member.voice.channel) {
        const connection = await message.member.voice.channel.join();
        // when in the voice channel
// Create a dispatcher
const dispatcher = connection.play('./audio.mp3');

dispatcher.on('start', () => {
    console.log('audio.mp3 is now playing!');
});

dispatcher.on('finish', () => {
    console.log('audio.mp3 has finished playing!');
});

// Always remember to handle errors 
dispatcher.on('error', console.error);
  }}
}
#

its not playing anything

#

why

#

i am trying from a long time pls

#

i am adding it in music bot music works

untold rune
blissful raft
#

Yes that lol, and thanks anyway

unborn ridge
#

can i get help

blissful raft
unborn ridge
#

no error

#

but no sound is played after connecting

blissful raft
#

Oh you're trying to play music from a file and not youtube or something else like that

#

I haven't really tried playing music from local files

#

Does it say that audio.mp3 has started playing @unborn ridge

unborn ridge
#

yes

#

no

#

it just says finished playing

#

@blissful raft

blissful raft
#

Hmmmm

#

I'm not sure what could be the issue, sorry

river wing
#
let suffix = ["", "k", "m", "b", "t", "q"];

if(args[1].toLowerCase().endsWith() == suffix){
    let power = 0;
    for(i = 1; i < suffix.length; i++){
      if (args[1].toLowerCase().endsWith() == suffix[i]){
        power = i*3;
        break;
      }
   }
    quantity = parseInt(args[1]) * Math.pow(10,power);
 }```
Does anyone know why if my args[1] is 100k, why this code give me 100 instead of 100000 for quantity
prime glacier
#

Error: Could not find player config at exports.getBasicInfo (/home/ubuntu/secret/node_modules/ytdl-core-discord/node_modules/ytdl-core/lib/info.js:59:13) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async Object.exports.<computed> [as getBasicInfo] (/home/ubuntu/secret/node_modules/ytdl-core-discord/node_modules/ytdl-core/lib/info.js:296:18) at async exports.getFullInfo (/home/ubuntu/secret/node_modules/ytdl-core-discord/node_modules/ytdl-core/lib/info.js:187:14) at async Object.exports.<computed> [as getFullInfo] (/home/ubuntu/secret/node_modules/ytdl-core-discord/node_modules/ytdl-core/lib/info.js:296:18) (node:15767) UnhandledPromiseRejectionWarning: Error [VOICE_PLAY_INTERFACE_BAD_TYPE]: Unknown stream type at VoiceConnection.play (/home/ubuntu/secret/node_modules/discord.js/src/client/voice/util/PlayInterface.js:84:11) at play (/home/ubuntu/secret/MusicSystem.js:40:8) at processTicksAndRejections (internal/process/task_queues.js:93:5) (node:15767) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)

honest perch
#

Read the error

#

And search for it

broken matrix
#

to change the color of the tags would i do

#
<style>
  .serversshards {

    background: #9900cc !important;
    color: #fdca00 !important;
}
</style>
rustic nova
broken matrix
#

Ty

#

Doent have what i need

rustic nova
#

It should

#

It's literally the last thing

broken matrix
#

It doesnt show how to change these

rustic nova
#

Learn css then

broken matrix
#

I have, im verifying that the codr above works

#

A link doesnt fix the issue

rustic nova
#

Learn 👏 css 👏 then

pure lion
#

^

#

sea ess ess

broken matrix
#

Cunts

pure lion
#

you could use a css lib

rustic nova
#

Aight

slender thistle
#

Use developer tools in your browser to see which CSS rules overwrite yours

#

or if yours is even applied

pure lion
#

@broken matrix don't be rude, we're trying to help

rustic nova
#

I'm just going to ignore that

rustic nova
#

Just because we have to follow the rules of spoonfeeding here #rules-and-info catblusho

#

Doesn't mean you have to call us cunts

broken matrix
#

Ok

slender thistle
#

One small example of just playing with dev tools in your browser and actually using them

wheat jolt
#
var channel = bot.guilds.cache.first().channels.cache.get('776834241405255719');
channel.setName(`Membrii: ${member.guild.memberCount}`);

these two lines of code are in my guildMemberAdd and guildMemberRemove events but the channel's name doesn't update

#

I've also checked if the events work, and they do

rustic nova
#

Did you enable intents?

#

Oh wait nvm if they work

wheat jolt
#

yup

broken matrix
#

i got it thank you

earnest phoenix
#

😭

pure lion
#

@wheat jolt just pass in the member.guild and get from channels.cache

rustic nova
#

@earnest phoenix are these Exam questions?

earnest phoenix
earnest phoenix
#

😐

pure lion
rustic nova
#

Yup, not helping then, we ain't your nerds making your homework

wheat jolt
#

no bud, from my bootloader

earnest phoenix
wheat jolt
#

ofc from my event

pure lion
#

nah im not helping you if you're gonna be a dick

wheat jolt
#

¯_(ツ)_/¯

slender thistle
#

oh boy oh boy oh boy

#

you people can't google simple stuff, can you

#

Creating a tuple is literally done as ("MY FIRST ELEMENT OF A TUPLE",)

earnest phoenix
#

IDK the what to search

rustic nova
#

Then why did you get assigned for that if you have zero clue?

earnest phoenix
#

she told me to search google

#

but meh IDK what to search

#

in the first place

#

@rustic nova pls help me

rustic nova
#

WeirdChamping don't even know python anyways

earnest phoenix
#

😐

blissful raft
#

I'm looking for something completely free because I don't have a way to pay for it lol

hazy rain
#

umm

stoic hull
#

So, how to fix node-gyp erroring in docker?

hazy rain
#

you know the rest

#

lmao

blissful raft
#

If I had a local hosting option I wouldn't have to worry about this lol

hazy rain
#

yeah

honest perch
#

If you cant afford hosting dont make a bot

#

Simple

upper summit
#

Any ideas why this function is not showing the correct number of users?

stoic hull
#

Users are not cached.

upper summit
#

ah ok 🙂

restive furnace
#
  • it's property
eternal osprey
#

hey girl

unique monolith
#

I Noticed That Your Able To Get Your Bot Added To The Server, But I Can Not Figure Out How Is There A Form You Have To Fill Out Or Something?

restive furnace
#

You can't, anymore.

pure lion
#

trying to nginx certbot but always getting this error

#
Failed authorization procedure. www.ale-bot.xyz (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from https://www.ale-bot.xyz
/.well-known/acme-challenge/8HNiAYFdttz-ZADkOAVoCvJRijCf3eOYjJvGt4iOuiw [2606:4700:3031::ac43:d337]: "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endi
f]-->\n<!--[if IE 7]>    <html class=\"no-js "```
earnest phoenix
unique monolith
#

XD

pure lion
#

enjine x

earnest phoenix
#

@unique monolith No You Are Capitalizing The First Letter Of Each Word

unique monolith
#

Its A Habit

restive furnace
#

Just type like normal human.

pure lion
#
server {
    listen                  145.239.115.76:443 ssl http2;
    listen                  [::]:443 ssl http2;
    server_name             www.ale-bot.xyz;

    # SSL
    ssl_certificate         /etc/letsencrypt/live/ale-bot.xyz/fullchain.pem;
    ssl_certificate_key     /etc/letsencrypt/live/ale-bot.xyz/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/ale-bot.xyz/chain.pem;

    # security
    include                 nginxconfig.io/security.conf;

    # reverse proxy
    location / {
        proxy_pass http://145.239.115.76:8080;
        include    nginxconfig.io/proxy.conf;
    }

    # additional config
    include nginxconfig.io/general.conf;
}

# non-www, subdomains redirect
server {
    listen                  145.239.115.76:443 ssl http2;
    listen                  [::]:443 ssl http2;
    server_name             .ale-bot.xyz;

    # SSL
    ssl_certificate         /etc/letsencrypt/live/ale-bot.xyz/fullchain.pem;
    ssl_certificate_key     /etc/letsencrypt/live/ale-bot.xyz/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/ale-bot.xyz/chain.pem;
    return                  301 https://www.ale-bot.xyz$request_uri;
}

# HTTP redirect
server {
    listen      145.239.115.76:80;
    listen      [::]:80;
    server_name .ale-bot.xyz;
    include     nginxconfig.io/letsencrypt.conf;

    location / {
        return 301 https://www.ale-bot.xyz$request_uri;
    }
}```
earnest phoenix
pure lion
#

which?

#

nah thats in a different file

#

idk if i need to change my A's

#

nope

#

dont need to

#

they're in the nginx.conf file

#

that I include

#

nah

#

its worked before

#

i dont know why its not working now but that's not the issue

#
Attempting to renew cert (ale-bot.xyz) from /etc/letsencrypt/renewal/ale-bot.xyz.conf produced an unexpected error: Failed authorization procedure. ale-bot.xyz (http-01): urn:ietf:params:acme:
error:unauthorized :: The client lacks sufficient authorization :: Invalid response from https://ale-bot.xyz/.well-known/acme-challenge/MgUzPukdqFpIZJU2o7JtV5CeF_Ihp5cq_NNgery60ds [2606:4700:3
037::6812:3f36]: "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 7]>    <html class=\"no-js ". Skipping.```
#

alrighty

#

same error

eternal osprey
#

hey @boreal iron i tried doing what you told me yesterday. I am running against some issues

pure lion
#

hm

#

loads for one second and then 404s

#

sdolpkhgdaoikladgiop

eternal osprey
#
if (message.content.startsWith(prefix + "raids")) {
    {
      let params1 = message.content.trim().split(/ +/g);
      let params2 = message.content.trim().split(/ +/g);
      ```

and 
```js

let raids = data.raids.filter(raid => getName(raid.pokemon_id).toLowerCase() === params1[0].toLowerCase() && raid.level >= (params2[0] ? params2[0] : 5))``` the code is somehow doing nothing. Is there something wrong with these 2 snippets that i implemented in my code?
earnest phoenix
#

@pure lion why do you have dice's pfp

#

is the index of params2 a number

eternal osprey
#

param2 is a number

#

params1 is a string

#

for example: !raids 6 egg

earnest phoenix
#

why are you indexing them

#

@eternal osprey bruh params1 is an array

#

.split is there

#

oh

#

i wasnt reading above

#

lol

earnest phoenix
#

he copy pasted the same code for params1 and params2

#

wtf is that kind of logic

#

yeah im reading it

#

lol

#

Or did you try to just set message.content to smth so params2 is different even with the same code

#

also none of types there are numbers

#

everything is a string

#

I think they forgot to get a number from the array

#

@earnest phoenix same

#

ig this should fix it:

let params1 = /* the code you already have */[0];
let params2 = /* the code you already have */[1];
pure lion
#

ohhhh i knowwww

earnest phoenix
#

or just

pure lion
#

i need to comment ssl stuff

earnest phoenix
#

keep one

pure lion
#

i am very smart

earnest phoenix
#

and index it later

#

because why would you do the same thing twice

eternal osprey
#

okay i understand.

earnest phoenix
#

also don't forget to parseInt params2

#

you also need to check the result of parseInt to make sure it doesn't return NaN or some retarded shit

eternal osprey
#

what would parseint do?

earnest phoenix
#

take a guess

eternal osprey
#

yeah i can do that by logging

earnest phoenix
#

dont forget to do parseInt else if you do array[params2] you'll pass a string and js will return the property of the array object named as the valye of params2

eternal osprey
#

aha okay!

#

so i just converts the array to a string and parses it futher?

earnest phoenix
eternal osprey
#

okay thanks!

earnest phoenix
eternal osprey
#

yeah i am reading the docs now, dont worry 🙂

#

thanks for the help btw

earnest phoenix
#

yw

eternal osprey
#

sorry to get back to you

#

i did everything what was said

earnest phoenix
#

Hi

eternal osprey
#

but somehow it still does nothing

#

@earnest phoenix hey

earnest phoenix
#

@eternal osprey Your bot name

eternal osprey
#

what?

earnest phoenix
#

Your bot

#

You have or not

eternal osprey
#

yeah i do have a bot

#

why

#

why?

eternal osprey
#

as we just defined params2[1]

earnest phoenix
eternal osprey
#

yeah well

#

i am trying it

#

but it does nothing if itype !raids 6 egg for example

#

does not even log anything

pure lion
#

I'm very confused; i try to visit my domain https://ale-bot.xyz and i automatically get redirected to the www buuuuuuuuut ive set nginx to not do this

#

i am so confused :(

#

it is

#

whats the error

#

turtle do you know how to help el me

#

@earnest phoenix is that the full err stack?

#

pwease?

#

gg

#

sometimes you need to get from cache or fetch shit

earnest phoenix
#

you also didn't send the full error

#

that stack trace is cut off

pure lion
#

smh

#

i need to fix this issue man

#

the www subdomain redirect

#

its set as an A record

#

and yet it doesnt redirect to my server

boreal iron
#

Depending on the TTL it can up to 48h until a DNS update is pushed

pure lion
#

feck

rustic nova
boreal iron
#

My DNS pushes updates immediately too but as I said it needs to setup to do so

earnest phoenix
#

Why spoonfeed

#

which liner is better ? ```# locally
npm install eslint

globally

npm install --global eslint```

#

@earnest phoenix eslint i local if its on time use

#

Globally if ir is mulri rime use

#

i use a vps so which one for me ? @earnest phoenix

#

..

#

Share vps with antone?

#

what ?

#

Just install globally

#

ok

#

but how can i unistall globally ?

#

@earnest phoenix ^

#

npm uninstall -g

#

npm uninstall --global eslint like that ?

#

oh

pure lion
#

its not working

#

i am going to cry

earnest phoenix
#

huh

#

@pure lion what happened

eternal osprey
#

hey uys

pure lion
#

@earnest phoenix nginx

earnest phoenix
#

nginx means ?

#

oh

pure lion
#

y it workn't

eternal osprey
#
client.on('message', async message => {
  if (message.content.startsWith(prefix + "raids")) {
    {
      let params1 = message.content.trim().split(/ +/g)[0];
      let params2 = parseInt(message.content.trim().split(/ +/g))[1];``` and
```js
let raids = data.raids.filter(raid => getName(raid.pokemon_id).toLowerCase() === params1[0].toLowerCase() && raid.level >= (params2[1] ? params2[1] : 5))``` when i type !raids 6 Absol for example, it literally does nothing.
pure lion
#

alrighty

earnest phoenix
#

nginx is like glitch or repl ?

pure lion
#
user                 www-data;
pid                  /run/nginx.pid;
worker_processes     auto;
worker_rlimit_nofile 65535;

events {
    multi_accept       on;
    worker_connections 65535;
}

http {
    charset              utf-8;
    sendfile             on;
    tcp_nopush           on;
    tcp_nodelay          on;
    server_tokens        off;
    types_hash_max_size  2048;
    client_max_body_size 16M;

    # MIME
    include              mime.types;
    default_type         application/octet-stream;

    # Logging
    access_log           /var/log/nginx/access.log;
    error_log            /var/log/nginx/error.log warn;

    # SSL
    ssl_session_timeout  1d;
    ssl_session_cache    shared:SSL:10m;
    ssl_session_tickets  off;

    # Diffie-Hellman parameter for DHE ciphersuites
    ssl_dhparam          /etc/nginx/dhparam.pem;

    # Mozilla Intermediate configuration
    ssl_protocols        TLSv1.2 TLSv1.3;
    ssl_ciphers          ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;

    # OCSP Stapling
    ssl_stapling         on;
    ssl_stapling_verify  on;
    resolver             1.1.1.1 1.0.0.1 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=60s;
    resolver_timeout     2s;

    # Load configs
    include              /etc/nginx/conf.d/*.conf;
    include              /etc/nginx/sites-enabled/*;
}
#

nginx.conf

earnest phoenix
#

@earnest phoenix it is used for hosting ?

quartz kindle
#

@earnest phoenix its a command line program that you run inside a linux server

pure lion
#

hey tim

#

systemctl start nginx
already running