#development

1 messages · Page 1399 of 1

boreal iron
#

lmao

eternal osprey
#

i am just saying that it is not nice to interrupt a conversation.

#

that is all

tribal siren
#

lmao

eternal osprey
#

i am not feeling entitled or anything.

cedar trench
#

I'm trying to setup webhook listener using express of nodejs. But the test button isnt sending anything! ||no auth key is used cuz the webhook doesnt ask for it||

molten yarrow
#

you posting your stuff for a week already its not interupting at all

tribal siren
cedar trench
#

express module

tribal siren
#

okay jet pump it up

boreal iron
#

Anyways if you don’t use a command handler, just check if your content includes your command prefix, then splitting the content and use the array elements as your args will do the job for you

cedar trench
eternal osprey
#

okay i will

#

thanks

tribal siren
#

ye, online webhook listener is not good in your case

cedar trench
#

why not

tribal siren
#

since it’s online

#

get it?

boreal iron
#

But it’s like impossible to give you an example on mobile, but I’m sure someone will help you how to use split

cedar trench
#

well if i'm hosting an express module to get the post requests, thats online too?

boreal iron
#

In the case you don’t know.

earnest phoenix
#

Can someone help me ? my bot has a streaming problem I can't solve, it works normally on my computer, on vps it doesn't work like it doesn't play music, and a music bot

past needle
earnest phoenix
#

how i can download a video of youtube and send the file in .mp4? 🤔

earnest phoenix
past needle
#

sure

cedar trench
#

const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' }); in this whats the password?

worldly python
#

Just whatever auth token you're using i assume

past needle
#

nvm

sudden geyser
#

your password can be whatever you want. It's just to verify it's coming from DBL and not some third party

feral aspen
#

What's the code to make the title of an embed a hyperlink?

#

I actually forgot.

sudden geyser
#
{
  title: "hi",
  url: "https://google.com/"
}```
I think
feral aspen
#

For embed Javascript

sudden geyser
#

That's how it'll be sent to Discord. You may be using something else. I don't know what embed JavaScript is referring to.

#

Pato you didn't show us the error

#

you showed us the stacktrace

#

but didn't include the actual message

feral aspen
#
const embed = new Discord.MessageEmbed()
.setTitle(A HYPERLINK TEXT)

lyric mountain
#

Hamood, set the embed's url

sudden geyser
#

I think .setURL

lyric mountain
#

Doesn't the setTitle allow two args?

past needle
#
const embed = new Discord.MessageEmbed()
.setTitle('title')
.setURL('url')
sudden geyser
#

they want to set the title zeph

past needle
#

here

sudden geyser
#

Kuu no

#

it should though

agile lance
#

yea

past needle
feral aspen
#

It gives undefined.

lyric mountain
#

That's the description

#

Not the url

#

The "Freshstart" is hyperlinked

feral aspen
#

I want the title hyperlinked.

lyric mountain
#

The title is the "Freshstart"

agile lance
#

To remove the undefined, do .setDescription(description)

feral aspen
#
const embed = new Discord.MessageEmbed()
    .setColor(colors.cyan)
    .setTitle("Freshstart")
    .setURL("https://www.google.co.uk/")
    .setDescription("Hello")

    message.channel.send(embed)```
#

I did that.

#

Ignore google link

tribal siren
#

Ok now

agile lance
#

That will work

tribal siren
#

What did it give

lyric mountain
feral aspen
#

The same picture above.

tribal siren
feral aspen
#

How can I remove the undefined thing

past needle
tribal siren
#

There’s no way to hyperlink description through “.set”

past needle
#

just remove ```js
.setDescription()

lyric mountain
#

If you want to put inline urls, do [some text](https://google.com)

feral aspen
#

Ok soz, it worked! 🤦‍♂️

tribal siren
#

Nice

feral aspen
#

I'm sorry.

past needle
tribal siren
#

Bot Developer

past needle
#

this is what ```js
.setURL

feral aspen
#

Bro, I just woke up @tribal siren

past needle
#

😂

feral aspen
#

Ill need to have coffee after checking an error my idiots sent.

tribal siren
#

lmao ok lemme believe

feral aspen
#

Well, I didn't ask you to believe.

#

😐

past needle
feral aspen
#

Peace.

high spear
#

Anyone know how to make a rob command on bdfd

lyric mountain
#

Wtf is bdfd?

umbral zealot
#

"bot developer for discord" which is a shit app on mobile phone for pretend devs.

past needle
indigo flax
#

Alright, so whenever I shard my bot, the server's data is still there. BUT, a couple of hours later, a lot of people are dming me that their data is gone. But then a couple hours later, it's back. This is because I have 3 shards on my bot. And for some reason, every few hours, servers change shards. As an example, a server changes from shard 1 to shard 2, which means their data is still in shard 1, but not shard 2, then a few hours later their servers moves back to shard 1. How do I shard my bot where you keep the same shard forever?

lyric mountain
#

I thought it wasn't supposed to switch shards

rocky hearth
#

Can I use djs properly with latest version of node15.x??

worthy pine
#

yes

#

but errors will now stop the process

rocky hearth
#

you mean completely kills the process

worthy pine
#

yes

rocky hearth
#

ok I'll to try to catch that 😁

lyric mountain
#

Lul node is becoming a lot closer to java

rocky hearth
#

and thats actually a good thing, in my opinion

sudden geyser
#

why though

rocky hearth
#

but I use typescript, so nothing new for me

sudden geyser
#

JavaScript is already very weakly-typed

earnest phoenix
#

java in 2020 lul

lyric mountain
#

Java yesterday, java today, java forever

earnest phoenix
#

2 billion devices

rocky hearth
#

no its 3

#

since 20 years, and will always be

sudden geyser
#

I don't like writing Java myself but it's okay

lyric mountain
#

Actually, I abandoned oracle JDK a long time ago

#

So it's been a time since I've seen that billion devices screen

earnest phoenix
#

and most of those devices were shitty contracts in 2005 for phone manufacturers to have some shitty java games lmfao

#

oracle sucks ass

lyric mountain
#

Like, that "you cannot use jdk commercially" is what I call a strategic dick move

earnest phoenix
#

give us your address, DNA sample, iris and your hand to download JDK 8

lyric mountain
#

And the only advantage of jdk over openjdk is the ease to install

earnest phoenix
#

internally oracle distribs have some very very small performance advantages

#

but it can be looked over cause of how small it is

rocky hearth
#

Why canvas is not working?

lyric mountain
#

Details plz

willow mirage
#

cuz ur not good in Math

past needle
rocky hearth
#

it just dont install, with node1.15

lyric mountain
#

Errors?

rocky hearth
earnest phoenix
#

i tried them in 2 vps, but same error

lyric mountain
#

Ig node 15 has some breaking changes

earnest phoenix
#

canvas must update

#

and compatible too 1.15

pale vessel
#

1.15?

lyric mountain
#

You either downgrade or search if someone made a node 15 compatible canvas

rocky hearth
#

and y homebrew doesn't install the node-lts

sudden geyser
#

Curious is there more to the output.

#

It looks like it got cut off.

rocky hearth
#

yes, there is much more

sudden geyser
#

can you upload it to a site like hastebin

rocky hearth
#

3x more as of that image

lyric mountain
sudden geyser
#

minecraft

pale vessel
#

Ah, Minecraft

#

Quite old

sudden geyser
#

java 17 lts notlikenoot

lyric mountain
#

17 is still in development ain't it?

sudden geyser
#

yes

#

It's the upcoming LTS version too

lyric mountain
#

Will it have major features?

sudden geyser
#

the current one is 11 so everyone sits on that

lyric mountain
#

Like, 15 got text blocks

sudden geyser
#

they have virtual threads

#

which are useful

#

for keeping an imperative code base with other languages doing coroutines or async/await

lyric mountain
#

Nice

sudden geyser
#

There's a lot of other stuff but virtual threads are the only things that interest me

lyric mountain
#

A thing I've been waiting forever is inline variables in strings

sudden geyser
#

oh yes I do wonder why java doesn't have that

#

17 versions and we still use String.format

tribal siren
#

@rocky hearth aye gg on your bot accepted lmao

lyric mountain
#

Fun fact is that kotlin has it

sudden geyser
#

I use Kotlin more than Java but still don't like it. I feel like it tries being easy then it quickly jumps

#

I still don't understand its coroutines system

lyric mountain
#

Yeah

rocky hearth
lyric mountain
#

Also they try to convince u that functions are funny /s

tribal siren
sudden geyser
#

nah, funky

lyric mountain
#

Btw, do you remember how not to use lambdas?

#

Like, I definitely forgot how to write codes without lambdas

raven orbit
#

H

sudden geyser
#

I can live without them, but convenient. I like being able to place the function to pass outside argument list. kotlin call([1, 2, 3]) { nums -> nums.forEach { num -> println("$num!") } }
Swift has it too and uses it so much in SwiftUI over methods in classes

earnest phoenix
#

how i can download a video of youtube and send the file in .mp4? 🤔

umbral zealot
#

Yo don't ping admins for your questions

woeful pike
#

carefully

earnest phoenix
remote vessel
#

my bot is logging this in console

StatusCodeError: 400 - {"message":"checkpoint_required","checkpoint_url":"/challenge/43857146388/KWBY7RX9pJ/","lock":false,"flow_render_type":0,"status":"fail"}```
what is this?
umbral zealot
#

no idea.

solemn latch
#

400 being a bad request

umbral zealot
#

looks like an instagram error from what google is saying

remote vessel
#

so why it comes

umbral zealot
#

Because you're trying to do something with the Instagram API? PRobably?

remote vessel
#

yeah

#

i have a insta command

umbral zealot
#

Well, there's a problem with it.

remote vessel
#

insta api is the worst

solemn latch
#

Check the Instagram api docs for more info on potentially why your request is bad.

remote vessel
#

after the bot restarts for 100 times or more

#

the api doesnt let u use ur acc

umbral zealot
#

Sounds like you're mis-using or abusing that API and they don't like it.

remote vessel
#

so i wont restart

#

thats not possible

#

i m deleting that command

solemn latch
#

Sounds like instagram got rid of a lot of legacy api stuff. Potentially you're just using deprecated methods.

earnest phoenix
#

it seems they're trying use the private api

#

not the public one

remote vessel
#

yeah

#

forget it

#

no use

earnest phoenix
#

pretty much nobody will support the use of the private api

remote vessel
#

no one uses insta command

earnest phoenix
#

it's private for a reason 🤷‍♂️

remote vessel
#

i use the npm package of insta api

umbral zealot
#

if not one uses the insta command then use, you can definitely just delete it 😄

subtle kiln
#

Hello, I want to delete from a message all reactions that aren't from my bot (I'm using discord.js). Here what I've done:

// fetch previous message
message = await channel.messages.fetch(this.messageId)
// remove reactions
for (const reaction of message.reactions.cache.values()) {
    console.log(reaction.users.cache.values()) // for debug purpose, it shows an empty object
    for (const user of reaction.users.cache.filter(user => user.id !== client.user.id).values()) {
        await reaction.users.remove(user)
    }
}

But it removes nothing

pale vessel
#

@quartz kindle Quick question because I forgot, map first or slice first?

boreal iron
#

Do you wanna remove an element before mapping the array or not?

pale vessel
#

I do

#

I can use array.length = n but I'd prefer to use slice

boreal iron
#

If you wanna purge your original array (returning the new array) and you wanna map that new array, then yes, use slice() as first

pale vessel
#

Thanks

#

I asked since I'm not sure which one is faster

boreal iron
#
let array = ["Who","fucking","cares","this","shit"];

array.slice(0,3).map(element => { console.log(element + ".. \n"); });
#

would map the new array (["Who", "fucking", "cares"]) you can work with

#

but of course doesn't change the original array var

pale vessel
#

Ye

#

Both do the same thing no?

boreal iron
#

Both?

#

slice and map?

pale vessel
#

Slice first and map/map first and slice

#

The result would be the same

boreal iron
#

Oh that's what you mean

pale vessel
#

Ye

boreal iron
#

No mapping first doesn't work

pale vessel
#

I should do a comparison

#

Why?

#

Map returns an array

boreal iron
#

Because slice returns your sliced array, map will use

pale vessel
#

Yeah

#

That's what I need

boreal iron
#

Using map before slice will slice nothing

pale vessel
#

Map returns a value

#

Maybe you're thinking about forEach?

#

Your example suits forEach more tbh

#

Since it doesn't return a value

boreal iron
#

aye since I dunno what you're trying to do, lel

#

that's why I said

#

would map the new array (["Who", "fucking", "cares"]) you can work with

#

Which requires to use .slice() first and .map() after

pale vessel
#

I meant as in js ["Who","fucking","cares","this","shit"].slice(2).map(x => x + "\n"); ["Who","fucking","cares","this","shit"].map(x => x + "\n").slice(2);do the same thing

high spear
#

Anyone know how to make like a hunt command?

pale vessel
#

Define "hunt" command

high spear
#

Like u need to have bought a pistol then u go into the forest kill animal sell flesh for money

boreal iron
#

errr nope, it's not the same thing

#

first would skip the first two elements of your array, second example would not

pale vessel
#

What?

#

It's not first two, it slices first two

#

First two would be slice(0, 2)

high spear
boreal iron
#

yo skipping is just another word

earnest phoenix
#

try harder lol

pale vessel
#

oh ye

#

I'm blind

amber sedge
#

How to make that the bot reacts and when the user reacts to that.. it deletes the message

pale vessel
#

It would skip

#

The mapped array is in the same order

amber sedge
#

Like the bot reacts a message and if the user reacts it. The message deletes

pale vessel
#

So it doesn't matter which order you do first (slice first or map first)

boreal iron
#

I mean just use an editor and try it out, but belive me it's not the same

pale vessel
boreal iron
#

It depends if you wanna (skip) REMOVE the first to elements of the array you wanna map (later) or if you wanna slice the map later

amber sedge
#

How to make like the bot reacts a message and when the user reacts it. The message delete

pale vessel
queen needle
#

reaction collector check if reaction is whatever emoji if it is delete message

amber sedge
#

Now my pc froze wow

queen needle
#

what's the code you used

amber sedge
#

Js

torn hollow
#

Hello, how can i print all my args without put all with ","

boreal iron
#

That's actually incorrect, regarding to your example it will return

["Who","fucking","cares","this","shit"].slice(2).map(x => x + "\n");
cares
this
shit
["Who","fucking","cares","this","shit"].map(x => x + "\n").slice(2);
Who
fucking
cares
this
shit
torn hollow
#

Like this

amber sedge
#

I can't give the code cuz pc ded and time to sleep.. I can send the code tomorrow

torn hollow
amber sedge
#

What is that ?

torn hollow
pale vessel
#

Is your slice() not working? lmao

queen needle
#
args.Join(",")```
Joins all args with  a ,
boreal iron
amber sedge
#

Oof

pale vessel
amber sedge
pale vessel
#

I have no idea what you're on about

#

It's this simple

#

I already got my answer anyway so that's fine

boreal iron
#

oh lol it doesn't work for some reason on my end

#

lmao

#

wtf

torn hollow
#

@queen needle Thx

boreal iron
#

I already got my answer anyway so that's fine

aye

split hazel
#

does map have a limit? (v8)

pale vessel
#

The Map() constructor? I don't think so

split hazel
#

i got an error when trying to set a value above 16777216

#

well amount of keys

#

might try increasing heap

#

yeah stops at the same number RangeError: Value undefined out of range for undefined options property undefined

pale vessel
#

Same here

leaden lake
#

Why do I have the following error ?```py
for filename in os.listdir("./cogs"):
if filename.endswith('.py'):
client.load_extension(f"cogs.{filename[:-3]}")

Traceback (most recent call last):
  File "c:/Users/Shaal0wFR/Desktop/Bot Discord/Unconnected Bot _BETA_/test_on_Atom.py", line 547, in <module>
    for filename in os.listdir("./cogs"):
FileNotFoundError: [WinError 3] Le chemin d’accès spécifié est introuvable: './cogs'
split hazel
#

i might surpass that amount in some cases so i'll probably stick to objects

pale vessel
split hazel
#

it's not really documented anywhere other than one stack overflow post

earnest phoenix
#

how do you make a eval

#

do you use eval()

pale vessel
#

yes

earnest phoenix
#

so you would do
@client.command
i dont know what the check for owner is
async def eval(ctx):
await ctx.send(eval(ctx))

#

or something

toxic raven
earnest phoenix
#

idfk how to make a stupid eval

boreal iron
#

anyone ever worked with crc32 ?

earnest phoenix
#

crc32?

boreal iron
#

yeah crc32 checksums

earnest phoenix
#

oh i havent

boreal iron
#

nvm

#

oh i havent
that may blow up your mind KEKW

leaden lake
#

how do I do a refresh of my os.listdir directory ?

earnest phoenix
#

call the method again

#

lol

river wing
#

i need help with something. how do i code for javascript that if i input 100k ill get the value 100000 instead of 100 when i do parseInt()

leaden lake
#

doesn't work

earnest phoenix
river wing
#

oh cool thanks

#

im guessing thats another library

tulip ledge
#

I've ran into this really annoying issue... So my friend and I made a database manager wich allows me to use db.get(), db.find(), etc and it basically turns into SQL and communicates with my sqlite databse. Now I need to find the data from a user where a certain key has a certain value now the issue is the way the database is stored is like this:

KEY       |   VALUE
user-<ID>   { level: 0, money: 0, ... }

Now I need to get user-<ID> where level is 0 for example, is there any way to do that?

boreal iron
#

SELECT key FROM database.table WHERE value LIKE '%level: 0%'

#

if you just need the raw query call

tulip ledge
#

alright ty

boreal iron
#

But having a user id as table key and searching for a random value just destroyes the concept of a database

tulip ledge
#

?

#

No the level: 0 is an example

#

as the users have a uuid as one of the keys

#

thats what I need to find

#

SELECT key FROM MoneyMoves WHERE value LIKE '%uuid: ${value}%'; this returns undefined

#

oh and I'm also doing that as they have ALOT of data and the compressing algorithm I'm using compresses more of the string is longer so having seperate keys would take more space

boreal iron
#

Does the string uuid: xxx even exist?

river wing
boreal iron
#

in your db

earnest phoenix
river wing
#

by using 100m it gives 0.1 and not 100 million

earnest phoenix
#

because it's using metric conversion

#

m means milli

#

i guess steal the logic from the library

#

and adjust it

river wing
#

ok means that the highest it can go is T?

earnest phoenix
#

try it and see

river wing
#

i mean Y

tulip ledge
#

user-259776081316282368 {"uuid":"be8329ba6e084d2d80c23223ef9b7ebf","ign":"Vigintillion"}

#

yes it does

#

SELECT key FROM MoneyMoves WHERE value LIKE '%"ign":"Vigintillion"%';

tulip ledge
#

I used ign here to hardcode it to be sure it works

earnest phoenix
#

you don't need the entire library anyways so you can steal the logic from humanizer and adjust it to work the way you want to

river wing
#

ok thank you

tulip ledge
#

@boreal iron if u want to see this is how the data gets inserted:
INSERT INTO MoneyMoves (key, value) VALUES ('${key}', '${value}')

boreal iron
#

user-259776081316282368 {"uuid":"be8329ba6e084d2d80c23223ef9b7ebf","ign":"Vigintillion"}
SELECT key FROM MoneyMoves WHERE value LIKE '%uuid: ${value}%';
%uuid: is not your saved value
Is see "uuid" in your db being a JSON string not the value you're searching for (uuid:)

#

Saving a whole JSON string and searching for parts of the string completely destroyes the being of a database but okay

#

Search for "uuid":"${value}"

#

If the uuid is an unique hash anyways, just search for the hash itself, not needed to put "uuid": before

tulip ledge
#

alright

#

1 issue tho

boreal iron
#

SELECT key FROM MoneyMoves WHERE value LIKE '%${value}%';

tulip ledge
#

SELECT * FROM MoneyMoves WHERE value LIKE '%"${key}":"${value}"%'; works
But if I change * to key it returns undefined

boreal iron
#

Is the column name key?

tulip ledge
#

should be

#

CREATE TABLE IF NOT EXISTS MoneyMoves (key TEXT, value TEXT)

boreal iron
#

oh lel yeah I see your message above

fresh sky
#

Question How do you change your bots page Colour I see people doing that but I wonder how?

tulip ledge
#

u can add css to ur bot page

boreal iron
#

@tulip ledge that's weird, try to add the table name to test it
SELECT MoneyMoves.key FROM MoneyMoves WHERE value LIKE '%"${key}":"${value}"%';

fresh sky
#

But how would I make the full page a colour it would only make it the text box place

boreal iron
#

Just get the right element and change it's style

fresh sky
#

nvm that worked

#

Thx

boreal iron
#

Most browsers having an element inspector and allow you to manipulate the source code to see the results

fresh sky
#

I used

<style>
body{
background: Hex code;
}
</style>
tulip ledge
#

still returns undefined

boreal iron
#

well then select all in this case, dunno your code

tulip ledge
#

well

#

the issue is

#

it returns this { uuid: 'be8329ba6e084d2d80c23223ef9b7ebf', ign: 'Vigintillion' }

#

not the key ;-;

pure lion
#

when i try to use peerjs behind my nginx server it always appends /peerjs:443? to the end of the uri. is there a way i can stop this behaviour?

boreal iron
#

Well without being able to see the code... I can assume only

pure lion
#

with me or...?

boreal iron
#

nope

pure lion
#

ah

tulip ledge
#

@boreal iron U want me to dm u the whole Database class?

#

I'll dm u cuz I trust u

boreal iron
#

The result should be an array or object (depends on the program language by default)

tulip ledge
#

I cant Dm u

boreal iron
#

Nope, only the code line of the query and the result

#

Yeah because I disabled DMs

tulip ledge
#

ahhh I see now

#

res(this.desterilize(data[0].value));

#

it only returns data [0]

boreal iron
#

It's not needed to see the whole code, just these few lines

#

Guess this will deserialize your JSON string

#

which is not what you wanna do

quartz kindle
#

which sql lib/db are you using?

#

mysql?

boreal iron
#

Just post the whole line

#

Think he said sqlite but dunno which lib

#

I wonder why he doesn't wanna post the whole line of code where he's querying the database

#

(or lines)

keen drift
#

Regarding clusterization, what's the methodology of performing seamless deployment rollover during re-sharding?

Currently, I'm spinning up the new clusters as the old clusters are brought offline, but it feels janky.

boreal iron
#

@tulip ledge Not much we can do without these lines of code, sorry

earnest phoenix
#

hi, is there any solution to this

pure lion
#

t h i s ?

earnest phoenix
#

i have a server in nodejs, it receives clients and it works just fine, however, im trying to send custom data to each client manually

pure lion
#

can you help me sdlkgndslkgn

earnest phoenix
#

yes like.. console with input

#

that sends data to client

honest perch
keen drift
#

Also is there another Discord server regarding the gateway I can ask questions in think_fish

honest perch
#

modify the port

#

or smt

#

or edit the internal structure

pure lion
#

misly you expect me to know how to do this

honest perch
#

yes

quartz kindle
pure lion
earnest phoenix
pure lion
#

wrong channel

keen drift
#

Yeah, that's fair point as well, I might need to implement queue de-duplication when bringing up clusters. I remember the gateway not allowing different num_shards, I suppose that has changed for larger bots.

earnest phoenix
pure lion
earnest phoenix
#

net

keen drift
#

Perhaps, I'll stop old clusters from issuing additional events while transitioning, that sounds better, and avoids duplication of events at the cost of a slight (noticeable?) downtime.

pure lion
#

@earnest phoenix is there a frontend?

supple dome
#

ho ho ho happy chrismas friends

earnest phoenix
#

yes

pure lion
#

ho ho ho

earnest phoenix
#

c# application

pure lion
#

ah

#

i dont know cs but i can try and help

#

do you have the necessary libs at the front?

earnest phoenix
#

yes everyting works fine

pure lion
#

but

#

?

earnest phoenix
#

however, i need to manually send data to client (c# app)

pure lion
#

ah

keen drift
#

I'm assuming the gateway resume session_id is binded to the num_shards? Not sure if I can reuse to resume another cluster with different num_shards. That would help avoid hitting the ratelimit ceiling.

earnest phoenix
#

dont worry about c#, problem is with node

pure lion
#

when you say manually send, what do you mean?

earnest phoenix
#

lets say when client connects, node opens a console that lets me input data to that client

pure lion
#

ah

#

like process.stdin.read()?

earnest phoenix
#

idk im not good with node

#

lemme search it

pure lion
#

id assume it is that

keen drift
#

@idle mountain Hey, how big is coinbot now think_fish

earnest phoenix
#

nothing, it will prompt in the same console

idle mountain
#

@keen drift big big

earnest phoenix
#

and only allow me to send to 1 client

idle mountain
#

lemme check

#

11,259 lines

#

of executable code

keen drift
#

i mean, guilds

idle mountain
#

oh

keen drift
#

yes, I was going to ask about your deployment method if it's big

idle mountain
#

it's up to 40k

#

about

#

deployment is ezpz, just build to linux, move files, and run

keen drift
#

not sure where to ask regarding my questions 😛

idle mountain
#

this is probably the right channel for it, I just thought you were in the wrong channel by accident bingLUL

keen drift
#

doesn't seem like anyone is doing distributed sharding so far here

crystal wigeon
#

hey guys so umm, the description containing a "\n" from DB doesnt go to the next line, but the mark ups like asd works

#

discordjs

idle mountain
#

@keen drift don't even know what that is, so nope bingLUL

keen drift
crystal wigeon
#

not sure why thats happening.

idle mountain
#

ah, yeah, i don't really use several clusters- just one server running is good enough for me. only 40 shards, so while deployment isn't seamless, I don't really mind it being offline for like... five minutes

crystal wigeon
#

can someone help?

keen drift
#

lucky, I'll just mess around until I find something that doesn't break then

regal locust
#

Hey is there a way to hook up my Discord bot to UptimeRobot so I can get uptime/downtime stats and notification?

Helpful Stuff```
`UptimeRobot.com Account`: `Free`
`Discord Library`: `discord.py`
`Language`: `Python`
`Python Version`: `3.?`
earnest phoenix
#

if u create a web server within your bot

#

then ping it with uptimerobot

regal locust
#

I've thought about that but I'm not sure how

#

I self-host

#

No my phone

pure lion
#
[this doesnt work please help me](https://alebot.is-inside.me/LxmyDqYo.png)```
earnest phoenix
#

open port

regal locust
#

*on

pure lion
earnest phoenix
#

and ping your ip:port

pure lion
#

as

crystal wigeon
#

Shows the Global Market to find the Cards based on your requirements.\nUse filters to find the card you are looking for.\n[Example] iz market -n jett->Finds all cards that includes the name 'jett.'\n[Example] iz market -cls assassins->Finds all the cards that belong to the class 'assassin'.\nYou can use iz market buy/sell/remove to buy/sell/remove a card from the Global Market.\n[Example] iz mk buy <cardID>->Will purchase the card from the Global Market.\n[Example] iz mk sell <cardID> <price>->Will put up the card from your inventory on the Global Market.\n[Example] iz mk remove <cardID>->Will remove the card you've put up for sale on the Global Market

basically this string is coming from DB and it doesnt seem to be going to the next line... any help appreciated!

pure lion
#

what is your db

crystal wigeon
#

mongo

pure lion
#

what is that doing on mongo

regal locust
earnest phoenix
#

yes

regal locust
#

hmm

crystal wigeon
#

im fetching the string from db

earnest phoenix
#

its pretty easy

crystal wigeon
#

but when i send it in the embed

#

it doesnt detect the \n markdown

#

but it picks up the `` markdown

#

asd

regal locust
earnest phoenix
#

doubt

#

as long as ppl dont connect to u ;d

regal locust
#

Okay

#

Thanks for your help!

boreal iron
#

Well you can costumize your port of course and allow specific IP sources only, in your case the IPs/DNS of uptimerobot

regal locust
#

My WiFi goes down sometimes so it'd be helpful lol

earnest phoenix
#

anyone can ping your ip and port but you can reject it ez

regal locust
#

I have the cheapest router ever lol so hopefully that would work

#

Yeah

boreal iron
#

probably not

regal locust
#

I think my router supports most of the fancy stuff just with a horrible website

#

Well thank you

#

I have experience with Flask

boreal iron
#

well port forwarding is one thing, it has nothing to do with your firewall

earnest phoenix
#

doubt

regal locust
#

Hmm

#

I don't think I have a firewall

#

At least I didn't set one up

boreal iron
#

Assuming your "self" host project is running on Windows/Linux you will have to allow the webserver/app to pass the firewall

earnest phoenix
#

there has to be a firewall

boreal iron
#

At least the port you selected

crystal wigeon
#

;-;

regal locust
#

I use Termux

#

On ANdroid 9

#

Not sure about using firewalls for that

boreal iron
#

Termux is an Android terminal emulator and Linux environment app that works directly with no rooting or setup required.

earnest phoenix
#

xd

boreal iron
#

ouch

earnest phoenix
#

i dont think its a good idea

regal locust
#

Port forwarding with it?

crystal wigeon
#

someone pls help?

earnest phoenix
#

with what

regal locust
#

With Termux

crystal wigeon
earnest phoenix
#

@regal locust dont port forward on termux

regal locust
#

ok

#

I guess I can live without uptime stuff lol

earnest phoenix
#

bad format

crystal wigeon
#

wym

#

what you mean

earnest phoenix
#

can u show the code

crystal wigeon
#

"asdasd \n asdasd "

#

this is how the string is

earnest phoenix
#

js?

crystal wigeon
#

yeah

earnest phoenix
#

idk xd

crystal wigeon
#

;-; sad

boreal iron
#

post the code, my magical glass ball doesn't work anymore

crystal wigeon
#

it has nothing to do with code

#

var command = await getCommand(args[1]);
const newEmbed = createEmbed(message)
.setTitle(Command: ${command.name})
.setDescription(command.description)

#

literally

#

all im doing

#

is getting something from DB

#

setting the description

#

desc = "Asdasdasdasd \n asdasdasd sdasd"

#

literally

#

sad

#

this works

#

but the "\n"

#

isnt working

boreal iron
#

Did you escape the string before inserting into the database?

crystal wigeon
#

yeah

#

i added "\n"

#

into the db

#

"text\ntext"

#

or should i do \n?

#

"\ \n"

boreal iron
#

It will add \n because it escapes the string

#

wow

crystal wigeon
#

xD

boreal iron
#

Discord is shit

#

\ \n

crystal wigeon
#

so should i add \ \

#

or \n?

boreal iron
#

Even Discord escapes the string

crystal wigeon
#

i've added \n

#

\n

#

\n

#

\asd

#

\ \n

boreal iron
#

Just replace \\n with \n

crystal wigeon
#

i was using \n

#

it doesnt work

#

i tried \ \n didnt work either

boreal iron
#

Because you're editing the database by hand, right?

crystal wigeon
#

wat buhr i legit inserted a string using postman

earnest phoenix
#
collector.on("remove", (r,u) => {   
console.log(u)
})

it's printing the user that reacted instead the user that removed the reaction, what to do?

#

discord.js btw

#

you can't get the user who removed the reaction iirc

#

discord doesn't send it

crystal wigeon
#

what do i do with the markdown TwT

boreal iron
#

Once again, adding a string to the db including special chars like \ requires to escape the string which probably happens automatically due your lib.

crystal wigeon
#

yes but it isn't working

boreal iron
#

That means the value you will get from the database is an escaped value \\ is this case

crystal wigeon
#

ah

boreal iron
#

Discord doesn't show the 2nd \

crystal wigeon
#

so my \n from db will be converted to \\n?

boreal iron
#

Like you figured it out already

#

Type \\n into the chat and wonder

crystal wigeon
#

yeah i got that

#

but my db has only "\n"

#

not \\n

#

so

#

from db

#

im getting \\n

boreal iron
#

That's why I said, replace \\n with \n

crystal wigeon
#

?

boreal iron
#

That's what you see not how it's saved

crystal wigeon
#

okay im confused

#

the string log

pure lion
#

@earnest phoenix would you know how to help le me with peer?

earnest phoenix
#

can't right now

boreal iron
#

giving your one example

crystal wigeon
#

see the log from db

pure lion
boreal iron
#

Saved as escaped string \\n but shown as \n

crystal wigeon
#

ah i see

boreal iron
#

brb

crystal wigeon
#

it worked :)) thanks a lot!! today yet again i learnt something new!

boreal iron
#

great

#

not anything you see is actually how it really is

#

lmao

broken matrix
#

Hey when im doing internal css it doesnt change the detailed description. It changes the regular back ground. How do i fix it?

quartz kindle
#

use the element inspector to find the correct css selectors

pure lion
#

tim tim tim

#

!!

broken matrix
#

Thank you

pure lion
#

do you know peer

quartz kindle
#

never used it

pure lion
#

im really stuck here and its not fun

#

dam

#

its not even the internal shit

#

its just connecting to the server

quartz kindle
#

whats the issue?

pure lion
#

im trying to connect from my frontend to a peer server behind my nginx server

#
const myPeer = new Peer(undefined, {
    host: "https://dice.ryadev.xyz/peer"
});
#

el here

#

and ive started the server with this

#
peerjs --port 9000 --path /peer --proxied tru```
broken matrix
#
<div class="content">

this?

pure lion
#

the issue is that it appends :443/peerjs?<some params> to the end of the uri

boreal iron
#

@broken matrix Put !importantbehind all attributes which are already defined by top.gg

#

This will overwrite the prev set ones

pure lion
#

i am going to ping tim

#

am i?

#

yes, i am

#

@quartz kindle

quartz kindle
#

@pure lion host is not supposed to have the full url

#

only the domain name

#

the rest of the url goes into path

pure lion
#

ah

#

ok thank you c:

#

got this now

broken matrix
#

@boreal iron could you show me an example

boreal iron
#
div.longdescription div.content
{
  background-color: #ffffff !important;
}
broken matrix
#

ty

rough knot
#

:D

earnest phoenix
#

how do i write somebody's username but not mention them: for example, "Hello, user, how are you" without doing @User#0000

rough knot
#

Wich language u use?

#

Python or Js?

earnest phoenix
#

js

#

js > py

earnest phoenix
#

I am trying to make a no prefix feature but have no idea. Can anyone help me?

pure lion
#

@earnest phoenix either use another message event or call it before checking the content

sudden geyser
#

What library are you using

pure lion
#

ugh im so close

#

it tries to connect with a wss connection not ssl

earnest phoenix
sudden geyser
#

Then factor out checking if the message starts with a prefix.

#

If you already have a command handler it's just commenting out some code.

#

Instead your code should check if the message starts with the command name

pure lion
#

i think they mean a feature

#

not removing the prefix entirely

#

like xp, if you will

broken matrix
#

@boreal iron this?

<style>
        html, body { background: linear-gradient(to bottom, #9900cc 60%, #fdca00 100%) }!important; 
</style>
boreal iron
#

not outside the attribute

#

inside

#

background: linear-gradient(to bottom, #9900cc 60%, #fdca00 100%) !important;

earnest phoenix
#

uh oh, im struggling with js here
im trying to loop something, but

pure lion
#

gg

earnest phoenix
pure lion
#

did you do for (;;)

#

what did you do lad

earnest phoenix
#

while (true) 😔

pure lion
#

smart lad

#

what were you trying to do?

earnest phoenix
#

im new at js dont bully me

pure lion
#

while data?

earnest phoenix
#

also it multiplies response everytime i send it

sudden geyser
pure lion
#

@earnest phoenix why the loop

earnest phoenix
#

i need it to send messages forever

pure lion
#

use setInterval

#

the syntax is

sudden geyser
#

Price are you forgetting to break out of the loop

pure lion
#
setInterval(() => {/*code goes here*/}, timestamp)```
#

if you don't know yet, () => {} specifies an arrow function

#

its just a normal function but a shorter way of add

earnest phoenix
#

i keep running out of memory

pure lion
#

use setInterval

#

it gives the stacc time

earnest phoenix
#

but i need to manually enter a message

pure lion
#

you can send a message every x ms

earnest phoenix
#

so it has to wait

pure lion
#

then wait for user input

earnest phoenix
#

bruh idk js, it odd

#

o wait

#

maybe im just retarded

#

i have 2 loops in both apps

#

ok it worked now, but every time i sent a message it multiplies it

quartz kindle
#

that while is an infinite loop

pure lion
#

tiMmMmM

#

its trying to connect via wss but i want to specify https

#

and i am passing in .pems at the server side but shit doesnt wanna connect

rustic nova
earnest phoenix
#

i dont get why its duplicating messages

pure lion
#

you have yourself an infinite loop

earnest phoenix
#

no loop

pure lion
#

use setInterval to stop el this

earnest phoenix
#

theres a client in other app pinging node server, server sends a message to client

#

but message gets duplicated

pure lion
#

ah

#

strange

#

is there any other code?

earnest phoenix
pure lion
#

there is el loop there

earnest phoenix
#

it doesnt go after that line until server has responded

pure lion
#

ahhhh

#

right so

#

hm

earnest phoenix
#

when sending messages

pure lion
#

ah

earnest phoenix
#

its adding clients for some reason, even tho its the same one

pure lion
#

you're nesting events

#

so every time theres a connection, there is a new data listener

#

so if you called the connection event more than say, 11 times, you'd run into that error

earnest phoenix
#

i understand that but

#

any fix?

pure lion
#

hmmmm

#

sdoighsdogihsdoih

#

do you neeeeeeeeeeed to use the net package

earnest phoenix
#

idk is there anything better

pure lion
#

yeah

earnest phoenix
#

as i said im new to js

pure lion
#

so right now im making a webrtc app

earnest phoenix
#

is express.js same thing

pure lion
#

im using express and the built in node http server

earnest phoenix
#

ok ok i have an idea

#

imagination, epic

pure lion
earnest phoenix
#

everytime client is connected button gets added to a page

pure lion
#

mmm?

earnest phoenix
#

i cant explain, bad english

#

Salut

pure lion
#

its fine i understand thus far

#

what would the button do?

earnest phoenix
#

send message to cilent

pure lion
#

sounds good

earnest phoenix
#

i need just an example, will figure out other things

pure lion
#

idk man im trying to figure mine out

#

its very painful

earnest phoenix
#

tru

#

actually i used to do it long ago

#

writing buttons and shit webpage with fs

#

and it bloody worked

#

but how do i connect that button to trigger an event? 😭

pure lion
#

on a webpage?

earnest phoenix
#

ye, button on a webpage triggers event in node (For specific client only)

pure lion
#

a form element

earnest phoenix
#

okay but how can button send events to node

#

my brain is fried i cant think

pure lion
#
<form action="path" method="POST">
  <input type="submit" value="send message">
</form>```
earnest phoenix
#

so can path be a function

#

something.js

pure lion
#

el?

#

no replace path with the actual path

boreal iron
#

not a function but a file

earnest phoenix
#

like, define path

#

i know what u mean but like

pure lion
#

yeah path is a path

earnest phoenix
#

i dont

pure lion
#

put /

earnest phoenix
#

to what

#

path to what

pure lion
#

path

#

that is the path

boreal iron
#

to your file which receives the POST request

earnest phoenix
#

should i use like ejs or

pure lion
#

C# ooohhhhh

#

it doesnt matter

earnest phoenix
#

na c# has nothing to do with server

pure lion
#

i like the ejs icon more HeartUWU

earnest phoenix
#

node is the bad guy here

pure lion
#

idc

#

go poot

earnest phoenix
#

rumors about nodejs being trash are coming true

#

ait c# server it is

#

tnx

pure lion
#

its not the oceans fault the boat broke

sudden geyser
#

it does suck but everyone uses it

pure lion
#

use deno kekw

sudden geyser
#

still sucks. begone javascript

pure lion
#

ts go brrr

sudden geyser
#

high level javascript

pure lion
#

liar

#
require("os");
#

js low level lang

#

you can make os

earnest phoenix
#

js doesnt even use ; 🤮

pure lion
#

it does

earnest phoenix
#

na i tried without it worked

pure lion
#

we don't care

solemn latch
#

its optional in most cases, but not always.

#

its good practice to always use it.

pure lion
#

yes woo

#

slay it

umbral zealot
#

Unless you understand the specific rules of ASI, you shouldn't be omitting semicolons. They're not optional in ECMAScript, you can just omit them because the JIT compiler fixes them for you.

solemn latch
#

^

pure lion
#

epic

earnest phoenix
#

btw does express support sockets and client shit

pure lion
#

assuming theres a cs lib for it

earnest phoenix
#

cs?

pure lion
#

c#

umbral zealot
#

Gotta post this, sorry :D

Semicolons in JavaScript are NOT optional.
A few examples to prove the point:

let a, b, c, d
const arr = [1, 2, 3, 4]
[a, b, c, d] = arr
(function test() { console.log(a) })()

ReferenceError: arr is not defined

(function() {
 (function() {
 console.log('Hello')
 })()

 (function() {
 console.log('World!')
 })()
})()

TypeError: (intermediate value)(...) is not a function

const someModule = require('some-module')
(async function() {
  const thing = await someModule("blah")
  console.log(`Hello, ${thing}!`)
})
earnest phoenix
#

a dont bring cs into this

sudden geyser
#

I use semicolons myself, but I believe it's a choice for the developer because the times you do run into issues with semicolons are not often.

umbral zealot
#

My point is they're not always optional, so unless you know what you're doing, you can't claim they are and not just use them.

sudden geyser
#

fair point

outer perch
#

so, my bot's dev version isn't resolving a user, me. can't understand why

#

it doesn't even launch

sudden geyser
#

do you have intents enabled

outer perch
#

no, but it resolved before that

#

before even getting verified

sudden geyser
#

are you looking in the cache or asking discord

#

has your bot been verified now

#

but you don't have it enabled

outer perch
#

yes

outer perch
#

returns null

sudden geyser
#

.resolve looks in the cache.

#

You'll need to use .fetch

#

which will return a promise resolving to a user

earnest phoenix
#

native deps are a pain in node pls

pure lion
#

ok so when i try to start a peer server and pass in the ssl key and cert it returns 502 but when i dont pass in cert it uses wss and not https

#

the clientside uses wss but when i get through chrome it decides to work

outer perch
#

actually it launched, but goes down after that xD

earnest phoenix
#

it throws bad request? hmm

trim atlas
sudden geyser
#

show the url pls

ember oak
#

Hello, could anyone send me a tutorial or explain how is it possible to make conversation with bot in dms. I want to do application bot, so it takes converation messages and send it as an embed in certain guild channel.

#

Discord js v12

sudden geyser
#

If you want to do something every time the user sends a message in the DM, you might as well just listen to the message event and filter the channel if it's a dm

pure lion
#

is there a way to connect via ws through nginx

ember oak
#

@sudden geyser I'm pretty new to this, how can I do it?

sudden geyser
#

Check if message.channel.type is equal to "dm"

pure lion
#

^

ember oak
#

ok thanks, I will try

tired nimbus
#

what should you do if node canvas gives you
[Unhandled Rejection] Error: Server responded with 503

pure lion
#

that isnt a canvas error

rustic nova
#

@broken matrix try using inspect element on the bot description

tired nimbus
#

it is a canvas error

broken matrix
#

After that?

pure lion
#

how

tired nimbus
#

node_modules/canvas/lib/image.js:56:28

boreal iron
#

Which element do you wanna costumize now? @broken matrix

broken matrix
#

longdescription

earnest phoenix
#

Hey, my bot shows as online on my servers, but it shows as offline on top.gg.

pure lion
#

did you just add?

boreal iron
#

What's your issue?

#

.longdescription

rustic nova
#

the background value

#

that should change your description background

boreal iron
#

depends what u wanna edit

earnest phoenix
pure lion
#

probably a cache issue

earnest phoenix
#

ok

boreal iron
broken matrix
#

Ok brb

pure lion
#

my goddd

#

aioghfoadiho

boreal iron
#
div.longdescription div.content
{
    background: linear-gradient(to bottom, #9900cc 60%, #fdca00 100%) !important;
}

Based on the background you mentioned

#

looks weird but I mean... why not

loud ingot
#

anyone know how to fix this, error:

C:\Users\gaute\OneDrive\Skrivebord\StatsBot\commands\weather.js:25
    }).catch(err => {
      ^

TypeError: Cannot read property 'catch' of undefined
    at Object.execute (C:\Users\gaute\OneDrive\Skrivebord\StatsBot\commands\weather.js:25:7)
    at Client.<anonymous> (C:\Users\gaute\OneDrive\Skrivebord\StatsBot\index.js:35:34)
    at Client.emit (node:events:329:20)
    at MessageCreateAction.handle (C:\Users\gaute\OneDrive\Skrivebord\StatsBot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\gaute\OneDrive\Skrivebord\StatsBot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\gaute\OneDrive\Skrivebord\StatsBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\gaute\OneDrive\Skrivebord\StatsBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\gaute\OneDrive\Skrivebord\StatsBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\gaute\OneDrive\Skrivebord\StatsBot\node_modules\ws\lib\event-target.js:132:16)
    at WebSocket.emit (node:events:329:20)
broken matrix
#

What is the top menu value?

#

I cant get it on inspect

sudden geyser
#

weather.find doesn't return a promise.

#

it returns undefined

#

You're probably supposed to do your checking in the callback.

#

In the callback, check if err is equal to null. If it is, do what you have in the callback right now. If it's an error, do what you're supposed to be doing in the catch block.

loud ingot
#

so if i have the args as a valid city, it works

loud ingot
sudden geyser
#

In function(err, result) {...}: js if (err === null) { // stuff to do if there was no error } else { // stuff to do when there was an error. }

loud ingot
#

but it is with the args

#
C:\Users\gaute\OneDrive\Skrivebord\StatsBot\commands\weather.js:18
          .setTitle(result[0].location.name)
                              ^

TypeError: Cannot read property 'location' of undefined
    at C:\Users\gaute\OneDrive\Skrivebord\StatsBot\commands\weather.js:18:31
    at Request._callback (C:\Users\gaute\OneDrive\Skrivebord\StatsBot\node_modules\weather-js\index.js:49:18)
    at Request.self.callback (C:\Users\gaute\OneDrive\Skrivebord\StatsBot\node_modules\request\request.js:185:22)
    at Request.emit (node:events:329:20)
    at Request.<anonymous> (C:\Users\gaute\OneDrive\Skrivebord\StatsBot\node_modules\request\request.js:1154:10)
    at Request.emit (node:events:329:20)
    at IncomingMessage.<anonymous> (C:\Users\gaute\OneDrive\Skrivebord\StatsBot\node_modules\request\request.js:1076:12)
    at Object.onceWrapper (node:events:435:28)
    at IncomingMessage.emit (node:events:341:22)
    at endReadableNT (node:internal/streams/readable:1294:12)
#

i get this

#

and it cant get a result because the args is wrong

sudden geyser
#

Then you should check beforehand if results is empty.

#

If it's always empty, you may want to revisit and debug your code to see if you did something incorrect.

#

I've not used the weather-js module.

loud ingot
#

and that would be

if(results === null) return message.reply('msg');
#

?

sudden geyser
#

no

#

See if results.length is 0

earnest phoenix
#

hi

#

is this bot development

#

or just development

sudden geyser
#

development, but mostly bot development.

#

development as in programming

earnest phoenix
#

yes

#

how do i make a website from my bot

#

to display the bots stats

eternal osprey
#

hey @boreal iron i had a question about our conversation we had a few hourss back.

#

your suggestion was that i should remove the commandlineargs and work with normal args?

#

how would i do that

tulip ledge
#

@earnest phoenix You can use express and ejs or react or vue to display variables in your website

earnest phoenix
#

im using express

#

but im trying to send more than 1 thing

#

without an error

boreal iron
#

Getting back to you tomorrow.
I’m on way right into my bed

#

Just split your message.content and use the array split returns to get your command parameters

#

Whatever they are

#

Splitting by whitespaces (split(" ") for example)

#

let params = message.content.trim().split(/ +/g);
params[0] is your command

#

Etc @eternal osprey

#

Difficult to type on mobile okeh

torn hollow
#

Ey, if i want what someone do @serverbooster and my bot say something, what do i need?

boreal iron
#

Search for the string in the emitted message event

torn hollow
#

Like this?

#

client.on('message', message => {
if (message.content.toLowerCase().includes("mati")){
message.reply('Tremendo come gordas ese');
}
}

boreal iron
#

For example yeah

torn hollow
#

@amber trellisbooster?

#

Lmao

#

@boreal iron is not running Hahaha

#

The others funcs

stoic girder
#

remove "@"

boreal iron
#

toLowerCase() ...

#

Think about it

stoic girder
#

also that

#

lol

pale vessel
#

Isn't it a role?

boreal iron
#

Looks like so

torn hollow
#

Yes

#

Is a role

stoic girder
#

Roles are formatted like this: <@&ROLE ID>. You can use let role = msg.mentions.roles.first(); and compare the role ID/name perhaps.

torn hollow
#

If someone mentions the role

stoic girder
#

if(msg.mentions.roles.first())

torn hollow
#

And in the ()

#

I need write server bosster"?

stoic girder
#

if(msg.mentions.roles.first() && msg.mentions.roles.first().name == "Server Booster")

#

Not sure if you need the first condition, will it throw a warning or not.

pale vessel
#

Yeah since if it doesn't exist it'll return undefined

#

If you use Node 14+ you can just slap an optional chaining operator mentions.roles.first()?.name == "Server Booster"

stoic girder
#

Damn didn't know about that, yet I use Node 14. Thanks!

torn hollow
stoic girder
#

message.mentions

#

Or however is your message variable called.

torn hollow
#

Thx

eternal osprey
#

@boreal iron thanks man!

torn hollow
#

Now if i want what someone @torn hollow and writes something?

boreal iron
#

Np

stoic girder
#

@torn hollow you want to detect if a role is mentioned and additional message is written or?

torn hollow
#

If my friend Carlos puts in the chat @torn hollow, the bot writes "Un capo"

#

Like that

#

I have if someone write the word, but no the mention