#development

1 messages Β· Page 1547 of 1

lyric mountain
#

Like

#

25 per month

quartz kindle
#

it says you have unlimited process types and they are always on

lyric mountain
#

Will buy u about 5 VPSs

raw talon
#

where should i get a VPS?

#

maybe i'll do waht i gotta do

quartz kindle
#

im paying $3/mo for mine

lyric mountain
#

I've only used contabo, so I can only recommend it

quartz kindle
#

im on galaxygate

opal plank
#

tim using heroku confirmed

raw talon
#

arghh

lyric mountain
raw talon
#

thats not what i came here to resolve lmao

quartz kindle
#

lmaoo

lyric mountain
#

They changed the site

#

Now it's bootstrap KEKW

zenith terrace
quartz kindle
#

oooo finally

lyric mountain
#

Finally contabo has a logo lul

quartz kindle
#

finally contabo no longer looks like a scam website from 2005

lyric mountain
#

Lul can't disagree

earnest phoenix
#

guys can help me how to make repl.it always run

rustic nova
#

contabo remake

lyric mountain
#

The cloud logo means Contabo Cloud Computing

earnest phoenix
#

huh?

lyric mountain
#

Which is A E S T H E T I C

raw talon
#

i'm surprised you guys aint using AWS?

earnest phoenix
zenith terrace
#
await await await await blablabla.send("timtimtim")``` @quartz kindle
lyric mountain
#

And it's not the cheapest of the dudes

raw talon
#

isn't there a free micro tier?

earnest phoenix
regal rover
#

how do i do the how to see how many servers bot is in?

lyric mountain
#

Free is never good

regal rover
quartz kindle
lyric mountain
#

Imagine swastika

regal rover
#

how do i do the how to see how many servers bot is in?

lyric mountain
#

Get the size of the guild collection

quartz kindle
regal rover
#

how do i do that 😳

lyric mountain
#

What lang?

quartz kindle
#

because google and aws have horrendous disks

regal rover
#

js

lyric mountain
#

client.guilds.cache.size() i guess

regal rover
#

oh

lyric mountain
#

Don't quote me on that tho

regal rover
#

ok

#

πŸ˜„

#

thx

#

😳

sick sluice
#

hi, does anyone know how to make bot responding to another whitelisted bot when using @commands.command() decorator? i'm using discordpy

lyric mountain
#

I might be mistaken since I'm not a djs bot dev

zenith terrace
#

@quartz kindle ey, instead of await a bunch of times

return return return return tim.send("bla bla bla")```
quartz kindle
lyric mountain
#

Noooo

quartz kindle
#

multiple awaits work tho

#

returns do not, sadly

zenith terrace
#

sad

#

imagine if it did

#

my github would be fulled with returns

lyric mountain
#

That reminds me of that English phrase

#

Buffalo buffalo buffalo Buffalo buffalo buffalo

#

"Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo" is a grammatically correct sentence in English, often presented as an example of how homonyms and homophones can be used to create complicated linguistic constructs through lexical ambiguity. It has been discussed in literature in various forms since 1967, when it appeared in Dmit...

quartz kindle
#

100% grammatically correct

earnest phoenix
#

English is a meme

quartz kindle
#

english is not a language

#

its 3 languages wearing a trench coat pretending to be one

lyric mountain
#

It's js

quartz kindle
#

i go slep nao kthxbye

lyric mountain
#

Kthxbye

earnest phoenix
#

Gn then kthxbye

#

lmao

#

howwwwwwwwwwwww

#

@opal plank it worked thank u

hasty mulch
#

How do I check if a person has a specific role via ID in Python inside of a command?

sudden geyser
#

Wikipedia articles are satisfying.

hasty mulch
#

I got it already

earnest phoenix
#

welp

west pewter
jolly ether
west pewter
#

..

#

Dont ping me kthx

#

and i just put it here

blissful coral
#

He was replying to your message. Not a big deal about him pinging you

#

And its best not to randomly put things not related to the conversation

hasty mulch
slender thistle
#

Maybe

hasty mulch
#

Ah

hasty mulch
slender thistle
earnest phoenix
#

it's for internal use tbh

slender thistle
#

Ya, it's a dict, ain't it

pale vessel
#

d.js has that too, they're just an array of IDs instead of objects

earnest phoenix
#

but it's faster since we don't instantiate the role

#

it's a list actually

slender thistle
#

Oh wait I'm not too awake or smart

#

Aye can see

earnest phoenix
earnest phoenix
#

How do i fix the status of my bot? My bot is in 77 guilds but the status of the bot is 76

#

It is interval

gilded olive
#

Sounds like a cache issue

earnest phoenix
#

Should i update mydiscord.js package?

opal plank
earnest phoenix
#

you're probably using the same string you declared when you had 76 guilds

#

instead of updating it

chilly veldt
#

Mention when u reply

#

Thanks

lament cradle
#

hi

#

How do I adjust the different positions between the handphone and the PC? because I coded css on the PC and when I saw it on the handphone the results were messy and didn't fit on the PC

slender thistle
#

I thought I gave that guy the link to docs for creating roles

dusky sundial
#

You can make a separate css file for mobile screens and do something like this

<link rel="stylesheet" media="screen and (min-device-width: 800px)" href="style_mobile.css" />
slender thistle
#

Yeah

#

Or that

dusky sundial
#

I find that way to be more neat, but yeah, media queries inside of your already existing css can also work

slender thistle
#

Preferences I guess πŸ˜›

dusky sundial
opal plank
earnest phoenix
#

be sure to also add a viewport meta tag

#

<meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no" /> works the best for me

dusky sundial
#

You can also simulate a phone screen in the inspect element menu, at the top left there's a button that looks like a phone/tablet

#

Or ctrl-shift-M

late osprey
#

I need some help please can anyone help me???

slender thistle
#

-ask2ask

gilded plankBOT
#

Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.

Please read https://dontasktoask.com/ for an explanation on why this is an issue.

slender thistle
late osprey
dusky sundial
#

Your bot grew suspiciously fast

late osprey
#

Yes

#

"I need help"

late osprey
rustic nova
#

what is there to help, wait a month or so and let it organically grow

dusky sundial
#

You can't do much other than wait

late osprey
dusky sundial
#

I'm sorry?

late osprey
rustic nova
#

no it's not

late osprey
dusky sundial
#

I-

#

huh?

rustic nova
#

Just

#

be

#

patient

#

for now

slender thistle
#

Patience is key πŸ™

rustic nova
late osprey
#

Just wait

earnest phoenix
#

isn't inorganic growth having too many guilds from the same user

rustic nova
#

just click on join

late osprey
modern sable
#

You cant verify your bot if you only have 10 servers

rustic nova
#

then you wouldn't be able to verify smart5

late osprey
solemn latch
#

what happened to 90 of them

late osprey
modern sable
rustic nova
#

100

#

but as marco said, ask in discord-developers

late osprey
#

Ok

late osprey
#

There are I already asked

#

But not reply

earnest phoenix
#

people did reply

#

said the same thing as i did

#

you have too many guilds that are owned by the same user

#

third time you're being told now

late osprey
#

I have only 10 Server

lament cradle
#

can I change the color of the top.gg logo in the top right corner?

craggy pine
#

using css, yes.

opal plank
rustic nova
#

i made mine spin spinningGamer

lament cradle
#

how?

opal plank
#

do you mean 10 as in 10 servers are owned by the same person^?

opal plank
#

thats 15% of all of your guilds being owned by 1 user, thats sus

#

prob a bit more

#

just wait a month for that to go away

late osprey
rustic nova
# lament cradle how?

You could filter the colors to be able to choose a different color. can't Remember how i did it once

opal plank
#

wait for a month

earnest phoenix
#

uh

#

no...?

#

leave guilds that are owned by the same user

late osprey
earnest phoenix
opal plank
earnest phoenix
#

Every 1m??

opal plank
#

it takes time to get rid of that

earnest phoenix
#

just remake the string everytime @earnest phoenix

opal plank
#

couple days iirc

dusky sundial
#

He would still need to get rid of the inorganic guilds though, no?

opal plank
#

as cry suggested, leaving severs that are owned by the same person might help, but there isnt much that can be done for suspicious growth

earnest phoenix
#

suspicious != inorganic

opal plank
#

yeah, my bad

dusky sundial
#

Yeah, I just assumed that it might re-trigger if it's still just in the same guilds

rustic nova
#

orange logo through css for example

#

just with filters

craggy pine
#

Quick question, I'm doing some funky web scrapping shanigans.

So I'm using .replace(/\s+/g, '-') to replace all to - for URL purposes.
Additionally, after the fact, I'm checking the item in the URL for special characters and replacing them to - as needed as the URL uses the - character for quite literally everything special.

Lets say item 1 is named miyuka's I will .replace the ' to - for it to become miyuka-s but another item would be named some' thing making it become some--thing causing the URL to not like it since it's looking for some-thing.

What would be the easiest way to kinda prevent the -- since I by default replace spaces with a single -

Apologies if the way I explained is a tad confusing LUL

dusky sundial
#

I'd probably loop through the string, check if two - appear after each other, and remove one of them. Might be ineffective though, dunno

craggy pine
#

Hmmm, that could possibly work.

earnest phoenix
#

Can't you regex again to replace 2 or more occurences of - with single -? Or would that be slow

craggy pine
#

I'll give it a try, wasn't really thinking about that.

#
            if (url.includes('--')) {
              url = url.replace('--', '-')
            }
#

Basically just do this mexShrug

opal plank
#

why not encodeURIComponent() ?

craggy pine
opal plank
craggy pine
#

thx

opal plank
#

no preblomo

craggy pine
#

Oh I see. So I can define the characters I would be replacing and do a encodeURIComponent(whateverHere).replace()

opal plank
#

erm, what?

#

you said you were manipulating url's manually right?

slender thistle
#

Nah, just encode technically

craggy pine
#

I suppose I am ya.

opal plank
#

encodeURIComponent() just encodes it

#

so you dont have to do any manipulation at all

craggy pine
#

I see. I'll play around with it.

opal plank
#

you didnt specify what exactly you are trying to do with URL, so im assuming its encoding

craggy pine
#

I mean idm sharing code.

opal plank
#

i just need to see some example of that in practice

#

whats your source and whats the desired output

#

for example, that miyuka's thing

craggy pine
#

It wont make 100% sense but.

 url = 'https://www.ge-tracker.com/item/' + itemStuff.itemData[indexOfItem[x]].item.name.replace(/\s+/g, '-').toLocaleLowerCase()

Ignore the incredibly ugly array thing after the URL but it's just grabbing the name of an item in a json array I have saved.

So an example URL after everything would be https://www.ge-tracker.com/item/twisted-bow and the item name is twisted bow

opal plank
#

this is stuff for parameters, if you're adding paths, then you'd want to continue using replace()

lament cradle
rustic nova
#

post your css

craggy pine
#

^

lament cradle
#

uhh

opal plank
opal plank
#

let me get a regex rq for you, this should be a good remember for me

craggy pine
#

Ah sure.

opal plank
#

gimme a test string

#

with spaces n all that shit

craggy pine
#

I'll just chose a random item in my list for you.

#

Since the URL is above.

opal plank
#

aight

craggy pine
#

Premade w'm crun'

#

is one that would 100% give me an error due to my regex

opal plank
#

output would be those being replaced by -'s

pearl trail
opal plank
#

Premade-w-m-crun-

#

this is the output

#

let me get snippet rq

craggy pine
#

and that would be the URL that they want

#

see how it can be rather annoying since the end - wouldn't be accepted.

pearl trail
#

oh, and your bot is in that servers? yes you can't

slender thistle
#

You can't verify your bot if it's only in 10 servers. You owning 10 servers out of a hundred means 10% of the servers is yours, which Discord has a problem with.

opal plank
#

actually

#

the end you'd have to remove

craggy pine
#

probably using endswith

#

or whatever

slender thistle
#

.strip gang

opal plank
#

while() prob best here

#

while(string.endsWith('-')) string = string.slice(0,-1)

craggy pine
#

i see.

#

Makes sense.

pearl trail
#

uh, he got that verification page so i think he mean he have 10 server that is the bot in, idk Β―_(ツ)_/Β―

#

bruh reply not working

craggy pine
#

You've certainly giving me some tools to mess with and some better insite on this. As a beginner in JS, I've chosen a weird path to get better at it kittyLOL

opal plank
#

@craggy pine gimme 3 more random strings

#

just to test it

craggy pine
#

ah sure.

pale vessel
#

slice(0, -1)

opal plank
#

that, yes

craggy pine
#

Black d'hide chaps wouls be Black-d-hide-chaps.
Black platelegs (g) - the (g) would be Black-platelegs-g on the site
Black dart(p++) would be Black-dart-p-2 since ++ = 2 for whatever reason

I picked out some more odd ones in my list

opal plank
#

you didnt tell me about brackets

craggy pine
#

I mean, true I didn't because I did get that on my own using if's

opal plank
#

then that should be fine, here

craggy pine
#

but those would be the only exeptions on my list

#

for regex i the rest are just spaces = -

opal plank
#
    message.channel.send(args.join(' ').replace(/[ *'*]/gm, '-'));
#

thats all there is to it

#

[] is a capture group

#
  • is greedy, so it can pull as many as possible
craggy pine
#

ya I use [] for some of my stuff.

opal plank
#

g is global, so it wont stop at first search

#

m is multiline tag, so it runs on all lines you provide

craggy pine
#

Basically what I've used b4 I asked here

            if (url.includes('(p)')) {
              url = url.replace(/\(/g, "-").replace(/\)/g, "")
             }
              else if (url.includes('(u)')) {
              url = url.replace(/\(|\)/g, "")
             }
             else if (url.includes('\' ')) {
              url = url.replace(/\'/g, "")
             }
             else if (url.includes('\'')) {
              url = url.replace(/\'/g, "-")
             }
              else if (url.includes('(p+)')) {
              url = url.replace(/\(|\)/g, "-").replace('+', "1")
             }
              else if (url.includes('(p++)')) {
              url = url.replace(/\(|\)/g, "-").replace('++', "2")
            }
opal plank
#

its a basic regex, but should do the job fine

craggy pine
#

check for certain ways the item is named

opal plank
#

also, bad

craggy pine
#

bonk me

opal plank
#

what if theres (u) and (p+)?

craggy pine
#

The the way the game works is there are these.
(p), (p+), (p++)

#

(u) is just that no ++ because poison is p and + or ++ is its power

opal plank
#

i mean, if it falls under one of those, since you have an ELSE, it wouldnt fall on others

#

so if it has multiple, it wont fall on the others

#

it'll fall on one first, and then not be checked on others

#

so idk if thats how you do it or what shape the data comes with

craggy pine
#

ah i see what u mean

opal plank
#

also iirc indexOf() is the most performant

#

let me check rq

#

hmmm i didnt test includes

#

nvm then, i dont have data to say if its faster or not

craggy pine
#

It's certainly possible that it is.

#

But to go off of what you said above, I just realistically check ++ first bec if it exists it'll skip the +

#

the way I have it it'll check + first if ++ is what im checking for so it does extra stuff

opal plank
#

but theres no chance there'd be 2 tags right?

#

(p) and (u) for example

craggy pine
#

ya exactly.

#

It's just (p) and (u) by itself

#

but p is the execption since p has + and ++

#

for some things

opal plank
#

then else if should work, just make sure you dont use else if if you have multiples, otherwise it'll stop at the first one it finds and not run the rest

craggy pine
#

ya i gotcha

opal plank
#

i'd probably run a slice and switch tbh

craggy pine
#

I'm always checking a single item with the code I'm working with because it's a page system if a user searches an item and multiples are found with the word they type

pale vessel
craggy pine
#

It'll be faster as I perfect the regex shit

#

the webscraping is the slow part

opal plank
#
let str = 'test';
let ending = str.slice(str.indexOf('('), str.length);
switch(ending) {
  case '(p)': {
    //struff
   } break;
  case '(p+)': {
  //stuffs
   } break;
//etc
}

#

rather than all those checks

craggy pine
#

i see.

opal plank
#

let me just check this rq

craggy pine
#

sure.

pale vessel
craggy pine
#

Totally missed that my b

opal plank
#
    message.channel.send(args.join(' ').replace(/[ *'*]/gm, '-'));
    let ending = args
      .join(' ')
      .slice(args.join(' ').indexOf('('), args.join(' ').length);
    switch (ending) {
      case '(p)':
        {
          message.channel.send('String ends with (p)');
        }
        break;
      case '(p+)':
        {
          message.channel.send('String ends with (p+)');
        }
        break;
      //etc
    }
#

probably the most performant

craggy pine
#

I appreciate the information

opal plank
#

no preblomo

cinder patio
#

why do you join the args like 5 times

opal plank
#

they would have a string

cinder patio
#

join it once and store it in a variable

opal plank
#

its a test variable feud

#

im lazy

craggy pine
opal plank
cinder patio
#

ikik

opal plank
pale vessel
#

sometimes regex is just the way to go

rustic nova
cinder patio
#

oh dear. I hate refactoring

opal plank
pale vessel
#

it's not overusing in this case

opal plank
pale vessel
#

it's making your code more simpler

opal plank
#

and less performant

pale vessel
#

not really

opal plank
#

avoid using regex whenever possible

#

the bigger the string you provide, the worse it gets

#

rule of the thumb: avoid regex unless necessary

#

its powerful tool but its also really shit

cinder patio
#

I agree

opal plank
#

indexOf vs regex

#

and thats inputting a very small string

tame pike
#

is that correct?

if(message.content.startsWith(";verifyrole")){
  if(message.member.hasPermission("ADMINISTRATOR")){
    let verifyrole = message.role.id.first()
    if(!verifyrole) message.channel.send("Try sending the command again, but tell me which role ID to set as Verify role!")
    else {
      message.channel.send("I set the verified role!")
    }
  }
}```
cinder patio
#

message.role.id.first() that's not correct

tame pike
#

oh

#

how do I change it?

cinder patio
#

you want that to be a role ID, right?

tame pike
#

yes

cinder patio
#

Well do you have a command handler? If you don't, then it'd be better to use mentions instead of ids

#

you can get the id from the mention

tame pike
#

ehm

#

what is a command handler? 🀣

#

oh I forgot that

#

I can make mention

#

with <@...>

lament rock
#

Lol no. Role mentions would be a terrible idea. Imagine having to at a role and every user be mentioned just to set it as a verification role

cinder patio
#

actually yeah

tame pike
lament rock
#

Always assume the end user is retarded

tame pike
#

thats true

#

and if they want a verification role, members will note have it

#

bcs they just created it

lament rock
#

Perhaps they didn't just create it

tame pike
#

true

#

Tell me how to add it as a mention

#

and I will change it

#

later

lament rock
#

you gotta account for "what if"
really, the best way to go about things is to make a filter function which filters over if the ID equals what the user passed or if the role name includes what the user passed

#

You could accept role mentions as well and just replace the < and the & and the >

But you shouldn't encourage role mentions because admins will always have permissions to mention every member in that role and there is no way to suppress that mention from their end

cinder patio
#

You could also use slash commands when they come out officially for discord.js

cinder patio
#

wew

lament cradle
# rustic nova post your css

You just send the code ._. , because I don't know how to correct the code. one more thing, what is the code for a menu with a three-line symbol?

rustic nova
#

You just send the code ._.
spoonfeed I don't spoonfeed

lament cradle
#

uhh

#

come on. I'm no expert in css coding ._.

dusky sundial
#

You will never become an expert if you have people do it for you either smart

slender thistle
#

aiya this

#

"We learn from our mistakes" applies here tbh

lament cradle
#

uhh

pale vessel
#

That would be #menu-trigger

lament cradle
#

can not. I tried changing the color, but the color didn't change

spare goblet
#

db: mysql
error: (node:26356) UnhandledPromiseRejectionWarning: Error: Operand should contain 1 column(s)
query: SELECT (total_paid_cents, user_id) FROM donators WHERE patron_id=?
followed by an array with the patron id for the prepped statement

#

any help appreciated, pls ping if you can help ty

pale vessel
#
  • background-color
spare goblet
#

oh found my issue nvm 😳

lament cradle
#

okay wait

earnest phoenix
#

dammit i am using a tokenizer for cutom command

lament cradle
pale vessel
#

What did you try?

lament cradle
#

change the menu button color

pale vessel
lament cradle
#

you can't know

pale vessel
#

Huh

#

All right then

lament cradle
#

gimme the codeeeeeeee... ææææ

#

hello?

delicate shore
#

I have never made domain based API

#

Like if someone does api.pgamerx.com?content=Hello+boi
Then it returns a response saying your content was Hello boi

#

How can I make something like that, where do I start learning

earnest phoenix
#

that isn't a valid url in the first place

#

a domain is just a pointer to an ip

#

they exist because we memorize words better than numbers

#

find a webserver for your language and start with the docs

lament cradle
#

"very unsettling coding"

#

hoi

earnest phoenix
#

how to uptime our bot in google script?

#

...huh?

silver lintel
#

how do i check if a message has reactions?

warm marsh
#

message.reactions?

#

Although depending on what language you're using and lib that might be completely different.

fiery locust
#

Anyone her good at ka

#

Js*

#

I need help lmao

fluid basin
#

don't ask to ask, just ask

lament cradle
#

How to change the color of the menu button whose symbol is three lines. pleaseeeeee aaaaaaaaa

pale vessel
tired panther
#
 fetchusers.lb.sort((a, b) => {
              return a.level - b.level;
            });;
``` It is not sorting the array
cinder patio
#

it doesn't sort it in place, it creates a new array

#

that gets returned

tired panther
#

ah okay wait trying

pale vessel
cinder patio
#

wait whaaat since when

pale vessel
#

It sorts it and return a new array

cinder patio
#

welp it should work fine then

earnest phoenix
#

that's the thing i'll never understand

#

instead of creating a copy it sorts the origin

cinder patio
#

I always thought it creates a copy

#

that's dumb

slender thistle
#

I mean, makes sense if you work with big amounts of data?

dusky sundial
#

It's probably to avoid stackoverflows

earnest phoenix
#

Why isn’t it showing a reply? When I ping it

#

The bot

#

No errors

quartz kindle
#

user mentions can be either <@ or <@!

#

because discord is weird

#

so you have to check for both mention types

earnest phoenix
#

So what can I do?

#

Add a β€œ!”?

#

@quartz kindle

summer torrent
#

isn't <@! for members who has nickname

solemn helm
#

Hello

quartz kindle
#

it used to be, but then someone proved it wrong when mobile started sending <@! also for those who didnt have nicknames

#

so now i dont even know

earnest phoenix
#

LOL

quartz kindle
earnest phoenix
#

Hmm I’ll try to add !

earnest phoenix
earnest phoenix
quartz kindle
#

if a === "<@" || a === "<@!"

earnest phoenix
#

try except

#

Ohh Alr

#

Let’s try

earnest phoenix
solemn helm
#

How to get friends <@&510453552418783242> I know?

summer torrent
#

use regex

quartz kindle
#

what does try except have to do with this?

earnest phoenix
#

lol

earnest phoenix
#

something

#

idk

quartz kindle
#

no?

earnest phoenix
#

lol

#

Both aren’t working @quartz kindle

quartz kindle
#

try except is for catching errors

solemn helm
#

How to get friends <@&510453552418783242> I know?

quartz kindle
#

there are no errors here

earnest phoenix
#

What the shit

quartz kindle
quartz kindle
earnest phoenix
#

I removed the ! And then tried and then tried after with !

solemn helm
#

I want to get approval from my bot DΔ±scord

quartz kindle
earnest phoenix
quartz kindle
#

is your bot even receiving messages?

#

put a console.log(message.content) before the if

solemn helm
quartz kindle
summer torrent
#

verification server limit is 250 iirc

solemn helm
#

Yes

earnest phoenix
#

Isn't 100

quartz kindle
#

then follow the link in the DM

#

and apply for verification

solemn helm
#

I Already Filled In The Form

quartz kindle
#

then wait

solemn helm
#

Approval granted

quartz kindle
#

then its done

#

what are you asking for then?

solemn helm
#

Approved Developer Role

quartz kindle
#

you already have

solemn helm
#

Ok

quartz kindle
solemn helm
#

Yes

quartz kindle
#

then you already have everything you can get

solemn helm
#

Ok

cerulean ingot
#

i’m going to say the same thing here i said in general

#

you guys know what really sucks? when you bot isn’t verified because of a growth flag and is at the max guilds and is on the front page and has 2k people trying to invite it

rocky hearth
#

Tim are you aware of this character? \x1Bc

quartz kindle
misty sigil
#

what the shite is that

rocky hearth
#

it clears the, node terminal when logged

quartz kindle
#

oh its char code 33

#

ESC char

earnest phoenix
#

there's more fun characters, try out carriage return

misty sigil
#

so what’s the most fun character

earnest phoenix
#

a bullet point

#

beeeeeeeeeeep

quartz kindle
#

i use the EOT char as a string delimiter lul

lament rock
#

there's one referred to as the bell iirc

#

makes windows prompt noises when logged

#

only in windows that is

quartz kindle
#

these are all the fun ones

lament rock
#

tf is an ACK character

quartz kindle
#

probably something you would send to acknowledge a transmission

#

with old modems and serial connections

solemn helm
#

...

lament rock
#

Ah. That would make sense. Depends on if it takes less data to send that than some other arbitrary symbol

frosty valve
#

do someone know how I can send command errors to a webhook that sends that in a channel?

earnest phoenix
#

you should probably not log errors to discord but rather to something like sentry

quartz kindle
#

but if you really want to, just catch the error and send to the webhook

frosty valve
#

ok, thanks!

lament rock
#

You can send messages from any shard to any channel, just some libs might hate you because they want the channel to be cached and only the shard that is assigned to that guild gets it sent from Discord.

#

A webhook isn't exactly necessary

earnest phoenix
#

technically there is no sharding in the first place for rest requests

#

right?

lament rock
#

Correct

misty sigil
#

i prefer webhooks

#

your bot doesn’t get ratelimited if something sets off a chain reaction

lament rock
#

Webhooks are cool in their own regard, but I prefer standard rest methods

#

Just have good logic 4Head

#

Also, pretty sure Discord doesn't like it if you try to bypass rate limits via webhooks

#

I forget what exactly they do if they even do anything. All I know is someone told me they do something

#

Also, message buckets are per channel

misty sigil
#

just don’t spam the webhook lol

lament rock
#

just dont spam rest message create lol

misty sigil
#

shit

#

got me there

lament rock
#

Lmao. We out here

cinder patio
#

A good reason to use webhooks is that they don't require any authorization other than a webhook id and a webhook token. You can only listen to errors in your master process and use a webhook to send them to a channel instead of using one of your shards to send to a specific channel.

dusky sundial
#

I mean, if it's supposed to send command error you'd better hope it doesn't happen too often :)

cinder patio
#

don't ask to ask, just ask

#

Do you host a server on there, or just your html files?

eternal osprey
#

hey

eternal osprey
#
  const data4 = fs.readFileSync("./cases4.json", "utf8")
    if(data4 == "Enabled"){
     
      const myArray = [
        "vase","cat","dog","duck","aww","meme","dankmeme","facepalm","hpmeme","wholesome","art","deadinside"
      ];
      message.delete();
      const randomItem = myArray[Math.floor(Math.random()*myArray.length)]
      const pingperson1 = message.author.id
      pingperson1.setNickname(`${randomItem}`)
      
      ``` TypeError: pingperson1.setNickname is not a function
#

bascially just trying to change the nickname of all people sending a message

warm marsh
#

id is a string

misty sigil
#

string.setNickname lmfao

cinder patio
lament rock
#

You don't need to broadcast any eval

#

you can call the rest manager's methods and it'll work. Or just use a lib that isn't shit

cinder patio
#

you can't do that using discord.js and that's the most mainstream lib out there, I'm saying that for discord.js

lament rock
#

You can call discord.js' rest manager's methods

cinder patio
#

how?

lament rock
#

iirc, it's very jank internally and it uses a Proxy. Let me try to find an old commit from when I used v12

cinder patio
#

Without having a client instance, there isn't a documented way of doing it

eternal osprey
#

it worked btw!

#

But i tried deleting all incoming messages, so i set message.delete() in the message handler

#

but it does not delete anything?

lament rock
#
client.api.channels[channelID].messages.post(Discord.APIMessage.create({ id: channelID, client: client }, content).resolveData())
#

client.api.channels is not ArrayLike btw. It's a Proxy

cinder patio
#

But in your master process which spawns all the shards you don't have access to client

lament rock
#

then you can use a modular rest interface like Snowtransfer or make the request payload manually

eternal osprey
#

ah i see what my problem was: DiscordAPIError: Missing Permissions

lament rock
#

Shards should be catching the errors, not the master

cinder patio
#

shards should be catching the errors and sending them back to the master

lament rock
#

Perhaps for your method when it comes down to sending through a webhook, but there is no need to do that when the shards can just send to channel directly

eternal osprey
#
     const randomItem = myArray[Math.floor(Math.random()*myArray.length)]
      message.member.setNickname(randomItem)
       
DiscordAPIError: Missing Permissions
#

any help?

lament rock
#

Your client needs to have a role higher than the member you're trying to manage and also manage nickname permissions

eternal osprey
#

my bot has administrator rights for anyone wondering

eternal osprey
lament rock
#

Yeah. Can't set nick for guild owner iirc

eternal osprey
#

aha thanks!

rocky hearth
#

hwo can i convert a Map to a object?

umbral zealot
#

use a foreach loop and make a new object from it

cinder patio
#
const map = new Map();
map.set("A", 1);
console.log(Object.fromEntries(map));
umbral zealot
#

or that

rocky hearth
#

OhCool!

#

I thought, fromEntries only accept array of tuples

eternal osprey
#
  if(data4 == "Enabled"){
      if(message.member.id === !client.user.id){
      message.delete()
      .then(message.channel.send("CHAOS BITCHESSS! WITH THIS MODE ON THE BEAST WILL RULE THESE CHANNELS :smiling_imp: :rage: "))
    }
      const myArray = [
        "vase","cat","dog","duck","aww","meme","dancing queen","gayboy","i suck dick","i am a retard","asshole","fucker", "dumbass"
      ];
      
      const randomItem = myArray[Math.floor(Math.random()*myArray.length)]
      if(message.member.id === !client.user.id){
      message.member.setNickname(randomItem)
      
      }```why is my bot not deleting my message, nor changing my nickname?
cinder patio
eternal osprey
#

oowh it should be !==

#

right

cinder patio
#

mhm

rocky hearth
#

in ts, I want to have a object that has keys of type Name and values to be Name[]

#
type Name: 'a' | 'b';
const moves:{[key: Name]: Name[]} = {};
#

I tried that, but it didnt work

cinder patio
#

That's not possible in regular js

#

either

crimson vapor
#

you should use a type iirc

cinder patio
#

object keys can only be strings

#

use a map

rocky hearth
#

Name is string

cinder patio
#

oh, then just use string?

#

yeah object keys cannot be union types

rocky hearth
#

y though?

cinder patio
umbral zealot
#

there's no index.html in that folder. You need index.html

#

That's how web servers usually work

#

I can't make an index.html file for you

#

Right-click, "New", "File", name it index.html, save

#

Well you need to have content in it of course

rocky hearth
umbral zealot
#

Look, move your files from provider/ to the root

#

and then rename home.html to index.html

#

that should do it

cinder patio
umbral zealot
#

like, not in the provider folder

#

y'know, like... not in a folder >.<

#

dude no

#

just fucking move the files

#

it's not hard

#

From the provider folder

#

to NOT in the provider folder

#

remove. the. files. from. the. provider. folder.

#

yes

#

Finally!

#

yes.

#

yeah ok so you're one step closer

#

now figure out the rest. looks like a CSS issue

#

what

#

Yeah ok sure

#

you move the files, you might have some relative paths to change

#

You did all this and you can`t figure out how to use paths? C'mon.

rocky hearth
umbral zealot
#

So you basically shoveled code from a tutorial to your editor and you have no idea how any of this works.

cinder patio
umbral zealot
#

Maybe you should consider actually doing a real web dev tutorial to learn how all this works

rocky hearth
pale vessel
#

Where did you get this site "template"?

eternal osprey
#

how do i find a channel by name?

eternal osprey
rocky hearth
#

channels.cache.find(c=> c.name=='name')

eternal osprey
#

channels is undefined

crimson vapor
#

bruh

rocky hearth
#

😨

pale vessel
crimson vapor
crimson vapor
#

CF8 made it

quartz kindle
crimson vapor
#

LOL

slender wagon
#

or just use client.channels

#

that would work wouldn't it?

quartz kindle
#

yes, thats implied in what Basant said (if you know a minimum of javascript)

eternal osprey
#

it worked already but i made a typo.

crimson vapor
#

where did you get the html?

slender wagon
#

So Tim i am working on a Giveaway bot and it needs SERVER MEMBERS INTENT in order to work, my bot is already verified will it be able to work or should i call discord admins for help or another verifying process

pale vessel
crimson vapor
#

you know what

#

how the fuck do people even get that html

#

you would have to save the site

#

then edit it

pale vessel
#

Yes, there are services for that

crimson vapor
#

bruh

#

thats fucked

pale vessel
#

yea

#

it downloads all assets that the site use so that you can host them yourself

quartz kindle
#

what are you gonna use the intent for?

slender wagon
#

you know when the bot chooses the winners?

quartz kindle
#

yes, but are you gonna select the winners from all members? or only members who react to the giveaway message?

slender wagon
#

I've noticed it runs on errors if i don't have it enabled

quartz kindle
#

then you dont need the intent

slender wagon
#

oh

#

I'll have to review that

#

thank you!

quartz kindle
#

on reaction store their ids

#

then chose a random id

#

and fetch it

slender wagon
#

i am currently using a package called discord-giveaways

#

idk if u have any clue of it

quartz kindle
#

if the error coming from the package?

slender wagon
#

yes

quartz kindle
#

can you show the error?

slender wagon
#

i can't sadly i am at work rn

#

I'll review it later and ask here if i need help

quartz kindle
#

look into the package's source code, if they use guild.members.cache.get() then they're incompatible with intents (and quite honestly badly designed)

slender wagon
#

oh okay

#

what about a starboard would i need the intent too?

#

since it looks for reactions

quartz kindle
#

also not

slender wagon
#

oh okay

misty sigil
#

you'd need the reaction intent but its not privileged

quartz kindle
#

the only thing you need the guild members intent for is if you want to list all guild members, or if you want to do something when a member joins/leaves/changes

slender wagon
#

oh damn so no welcome

quartz kindle
#

yes, no welcomes

slender wagon
#

also I've noticed that the userinfo doesn't show the online offline or anything like that

#

that has to do with the intent too?

quartz kindle
#

that requires the presences intent

#

which is also priviledged

slender wagon
#

what does priviledged means exactly?

quartz kindle
#

means you need to apply for them when verifying your bot

#

and explain why you need them

#

and be separately approved for them

slender wagon
#

oh okay

quartz kindle
#

and if your bot is already verified, you need to contact discord for them

slender wagon
#

yeah i'll need to contact them then

quartz kindle
#

they are only allowing it for bots who have good use cases for them

#

i dont think they are accepting welcomes and status commands

slender wagon
#

so the welcoming is not a good cause?

#

oh okay

slender wagon
#

and the xp stuff too?

quartz kindle
#

xp stuff doesnt require them

slender wagon
#

wait no i don't think there will be a problem with that

#

yeah

quartz kindle
#

i've seen people being denied tho

slender wagon
#

I'll give it a try

slim umbra
#

yah it depends

slender wagon
#

made a good welcoming system and i don't wanna throw it

slim umbra
#

just email them nicely

slender wagon
#

yeah

#

kady did help me alot so i'll ask her

#

lol

shadow zenith
#

Hello guys do i enable requires oauth2 code grant ?

quartz kindle
#

no

misty sigil
#

unless you need it

pale vessel
#

Where?

shadow zenith
#

ok thanks

pale vessel
#

Can you send me the URL?

#

All right

umbral zealot
pale vessel
#

I just want to know who cloned it

misty sigil
#

the site

#

the one you posted

earnest phoenix
#

PepegaBlind

umbral zealot
misty sigil
#

NO

pale vessel
#

Oh my

misty sigil
#

you copied someone elses site

earnest phoenix
#

Omegalul

misty sigil
pale vessel
#

Right

misty sigil
#

this sounds very illegal

#

where did you find it

earnest phoenix
#

"Template" sure man

misty sigil
#

where on github

#

or did you just steal it

lyric mountain
#

lul everything is the same

misty sigil
#

just give us the gh link

#

will ye?

rocky hearth
#

For React Reducer: Can I read values from the state?

function reducer(state, action) {
  // I want to log the state content from here. Is it possible?
}
earnest phoenix
#

How does it matter

#

You can still send links in mobile

umbral zealot
#

just log it

rocky hearth
#

this is what, state is logging out

lyric mountain
#

state is an object

earnest phoenix
#

hi need some help

lyric mountain
#

what are u trying to extract?

lyric mountain
earnest phoenix
#

why undefined?

rocky hearth
#

Well, how do we know?

lyric mountain
#

like, what's the desired result?

earnest phoenix
#

```if (message.content.startsWith(${prefix}ping)) {
message.channel.send("Pinging...").then(m =>{
var ping = m.createdTimestamp - message.createdTimestamp;
let embed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setTitle("Ping Info")
.setDescription('Gives the ping of the bot')
.addField(Your ping is ${ping}ms πŸ“ )
.addField(Websocket heartbeat πŸ“³: ${client.ws.ping}ms.)

         m.edit(embed)
              });```
lyric mountain
#

don't use message creation times for ping

earnest phoenix
misty sigil
#

i think maest o us do tho

lyric mountain
#

also, it's saying undefined because fields have 2 args

misty sigil
earnest phoenix
#

ok

#

and how i provide

#

it?

rocky hearth
#

.addField is required a second parameter

earnest phoenix
#

ok

#

oh yes

misty sigil
#

'your ping is', ${thing}ms

lyric mountain
#

well, I mean, noone will notice the difference actually

misty sigil
#

thats the rest ping

#

and is different fae gateway and does effect other things too

earnest phoenix
#

ok

zenith terrace
placid iron
pale vessel
#

Welp

#

That was disappointing

zenith terrace
#

I was there when they asked this as well

#

so ofc I would remember

lyric mountain
#

view page source code -> ctrl + C

zenith terrace
#

time to copy and paste mee6

misty sigil
#

how are people bigger twats than me

#

wtf

misty sigil
#

view source

zenith terrace
#

yes

misty sigil
#

ctrl c ctrl v

#

πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘ functioning dashboard πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘

zenith terrace
earnest phoenix
#

any suggestions for user-info command

#

what else can be added?

#

other than

#

id name nick roles etc

lyric mountain
#

roles might give u some headache because the sheer amount of roles some people like to create

earnest phoenix
#

yes

rocky hearth
earnest phoenix
#

discord.js right?

lyric mountain
#

just remember you're limited to 25 fields per embed and 2048 (1024 for fields) characters maximum

earnest phoenix
#

ok

lyric mountain
#

don't remember the exact number, but you also have a global char limit per ember

rocky hearth
solemn leaf
#

my member wont work anymore if you do the users display name

message.guild.members.cache.find(c => c.displayName.toLowerCase() === args.join(" ").toLowerCase())

I dont really know why

cinder patio
#

Do you have the GUILD_MEMBERS intent enabled?

twilit rapids
#

@umbral zealot did C3z4r#7339 share anything from where they got my website? Or do you think that they cloned it themselves

#

They left this server so I can't threaten them with a DMCA directly PepeHands

quartz kindle
pale vessel
#

"if you do the users display name" made it sound like it works if they didn't use displayName

solemn leaf
#

I mean I did

#

aki

#

when I was nicked aki

#

and it didnt do

pale vessel
#

So displayName didn't work but γ€β†œπ’œπ“€π’Ύβ†γ€‘ did?

solemn leaf
#

I didnt try that

#

it kinda works

#

but only full names

#

can I do match

opal plank
#

match?

solemn leaf
#

includes

#

ec

opal plank
#

wouldnt it be better to use fuzzy match? specially when there are names similar to urs, where its impossible to type?

#

but yes, you could use string.includes() if you wanted to

#
message.guild.members.cache.find(c => c.displayName.toLowerCase().includes(args.join(" ").toLowerCase()))```
#

=== is perfect match

#

includes() will try to match what you provided

#

if you were to search Not Er it would match me for example

solemn leaf
#

k

#

ok

quartz kindle
#

that will match the first thing that includes tho

#

like if you search for "a" it will return the first user with "a" in their names

#

even if its something like "uhgoeurhgouehoeuhoua"

opal plank
#

filter() would be the proper method, no?

quartz kindle
#

if you want proper fuzzy search that accounts for similarity

#

do filter + levenshtein

opal plank
#

thats what i was suggesting

#

levensthein?

#

oh, i see

quartz kindle
#

levenshtein distance, a popular string similarity comparison algorithm

#

it accounts for string length and character substitution count

opal plank
#

i just looked into it

#

no thanks

#

too early for math

quartz kindle
#

plenty of libs

opal plank
#

correct

#

i prefer something a bit more complex though

#

i use fuse

#

though fuse is a bit harder to get into based on what you sent

quartz kindle
#

fuse uses the bitap algorithm which itself uses levenshtein apparently

opal plank
#

assumed as much

#

but as far as lib goes, i'd much rather go for fuse

#

its really powerful

#

though, at the same time, its use case

#

comparing their sizes, urs would be the better options if you wanted something simple to not bloat the app

#

second is fuse

quartz kindle
#

xD

#

im more concerned about performance

opal plank
#

1.3gb node_modules folder

#

actually, im curious

#

wew

#

thats quite a big module folder

cinder patio
#

what do you do with so much pasta

opal plank
#

cmon, that was a good pun

#

why did nobody giggle?

mellow kelp
#

Sans rapidly approaching

earnest phoenix
#

Why isn’t it replying?

pale vessel
#
message.content === `<@${client.user.id}>` || message.content === `<@!${client.user.id}>`
#

Check for <@! as well

odd stratus
#

On PC its usually ! yeah

lyric mountain
#

there's actually no pattern on whether it has ! or not, ig they're slowly migrating to <@!> for compatibility issues

pale vessel
#

It's <@! if the member has a nickname

dusky sundial
#

^^

restive furnace
#

/<!?{ID}>/ should work or smth

dusky sundial
#

The exclamation mark in the <@!userID> means they have a nickname set in that server.

pale vessel
#

If you want it dynamic you can use template literals with || or new RegExp()

dusky sundial
#

dpy has client.user.mention, is that not a thing in js?

restive furnace
#

js == ...?

#

what lib

dusky sundial
#

well, discord.js

earnest phoenix
#

You can do <Client>.user.toString()

pale vessel
#

client.user.toString() yeah

dusky sundial
#

kewl

pale vessel
#

even so it still needs to check for <@!

earnest phoenix
#

there's Message.raw_mentions where it returns the ids, so you can check if the id is in the list instead. While mention property is mostly used to mention(?)

#

<@! Is for discord desktop mentions

#

Man

cinder patio
#

the thing is that they want to check if the message only includes a mention

earnest phoenix
#

You can literally use <Collection>.has() on <Message>.mentions

#

To check for the mentions

cinder patio
#

ONLY a mention

#

nothing else

earnest phoenix
#

So content being entirely a mention?

#

right

#

K

#

Well they could use RegExp() constructor and pass in ^<@!?${<Client>.user.id}>$ to easily check for it using <RegExp>.test(), but whatever

pale vessel
#

yea but it's just two statements using ||

#

technically one

#

why bother using regex

earnest phoenix
#

Yea

steel arch
#

Someone can tell me a good free host?

dusky sundial
#

Check the pins, but if you're looking for a cheap one I recommend GlaxyGate

earnest phoenix
#

There's no "good" free host

mellow kelp
#

good !== free

restive furnace
#

Contabo is another good almost freeβ„’ host

steel arch
#

I know, i just one a cool host for free

mellow kelp
#

idk, i used to host my bot on heroku at first

#

then switched to google cloud

steel arch
#

I use that too

restive furnace
#

Library of Code is one free though

lyric mountain
#

libs aren't free, you just borrow them

dusky sundial
#

Leaving your pc on 24/7 can also be free, depending on who pays the bills :)

mellow kelp
wicked sapphire
#

Any idea what the member count a bot is expected to be across 75 guilds?

lyric mountain
#

anywhere between 75 and infinity

sage bobcat
#

One message removed from a suspended account.

crimson vapor
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

lethal trout
#

I am making a leadboard command using mongodb and it is not show the usernames

sage bobcat
#

One message removed from a suspended account.

pale vessel
#

bruh

lethal trout
pale vessel
#

Can you show your code?

lethal trout
#
const lead = require('../../models/thank')
const Discord = require('discord.js');


module.exports = {
    name: 'thanklead',
    run: async (client, message, args) => {
        lead.find()

        let data = await lead.find({ guildID: message.guild.id })
        console.log(data)

        data = data.sort((a, b) => b.received - a.received)
        const lb = data.map(e => `${e.position}. **${e.username}#${e.discriminator}**\nThanks: \`${data}\``);
        const embed = new Discord.MessageEmbed()
        .setTitle('Thank\'s Leaderboard')
        .setColor('#FF0000')
        .setDescription(lb)
        for (let i = 0; i < 5; i++) { if (!data[i]) break; embed.addField(data[i].userId, data[i].received)}
        message.channel.send(embed)
    }
}```
crimson vapor
sage bobcat
#

One message removed from a suspended account.

crimson vapor
#

lmao