#development

1 messages · Page 1838 of 1

rose warren
#

Do npm install -g n

winged juniper
#

Ok

rose warren
#

Then sudo n latest

#

Sorry I don't do it often 😅

winged juniper
rose warren
#

Yep

rose warren
#

sudo n latest

winged juniper
#

🥲

rose warren
#

Just n latest then

winged juniper
#

Ok

rose warren
#

This is heroku 😅

winged juniper
#

Yes

rose warren
#

Good memories

#

Or ptsd idk

winged juniper
#

Workedddd 😂 🤟 🤟

rose warren
#

Do node -v now

#

Should show you v16

winged juniper
#

Tes i do it

#

Thank you 😊

rose warren
#

No problem! 😊

winged juniper
brave garnet
#

🔥
fast question - is it possible to read users status in discordpy without being verified?

rose warren
#

Yeah that's because you're using heroku. I can't remember how to upgrade node on heroku... Maybe try a Google search?

winged juniper
#

Ok thank you 😊

wheat mesa
#

What OAuth2 scopes do I have to select for a slash command bot? bot and applications.commands?

brave garnet
#

only commands if you use only slashes, if it uses both slashes and commands, then both

modest maple
#

technically just applications.commands

#

rate my js code hahayes

    window.addEventListener('pollLogin', (event) => {
        console.debug("pollLogin", event.detail);

        if (timeoutHandle !== null) {
            clearTimeout(timeoutHandle);
        }

        console.debug("checking user")
        checkLogin(event.detail);
        attempt = 1;
    });

    function handleMessage(request, _sender, sendResponse) {
        console.debug(request);

        const event = new CustomEvent(request.eventType, {
            detail: {
                respond: sendResponse,
                data: request.data,
            },
        })

        window.dispatchEvent(event);
        return true;
    }

    browser.runtime.onMessage.addListener(handleMessage);
brave garnet
#

generally ok

vivid fulcrum
#

yes

#

just turn on the intent

#

also

#

verification != having the intent

brave garnet
#

ik. i just putted this bot to topgg and i heard that unverified bots which use topgg or other lists are excluded from intents =p

#

and from verification =p

#

and what now?

#

;-; @vivid fulcrum

wheat mesa
#

...what

brave garnet
#

that. if i put yet unverified bot on any list im excluded from verification and intents i heard (not tested YET)

wheat mesa
#

Who told you that?

brave garnet
#

someone. i forgor who =p

wheat mesa
#

Well it's definitely not true whatsoever

brave garnet
#

rilly?

quasi hearth
#

would reading messages from multiple channels and forwarding them to multiple other channels be considered api abuse?

brave garnet
#

maight be? idk

#

banning all the role is for example.

#

but bout messages idk

wheat mesa
#

API abuse is considered spamming an endpoint even past the ratelimits for it usually. If you're not getting ratelimited, it's usually not api abuse afaik

sudden geyser
#

Just because you aren't getting rate limited doesn't mean it isn't API abuse.

#

API requests that happen in a short interval being the most basic form of API abuse.

last tapir
#

Hey.

#
.setTitle(`${server.prefix}${command.name.charAt(0).toUpperCase + command.name.slice(1)} Help Command`)
sudden geyser
#

hi

brave garnet
#

hi also

sudden geyser
#

.toUpperCase is a function

#

You didn't call it

last tapir
#

OH

#

Thanks. 😂 (world record)

boreal iron
#

How can I fucking prevent JSON.parse() from returning an error if my STRING isn't a valid JSON string

#

typeof JSON.parse() will return an error, too

sudden geyser
#

How about a try and catch block

boreal iron
#

eww no, isn't there an easier way to check if a STRING has a valid JSON format?

#

god damn fucking complicated JS...

#

Probably, but no.

wheat mesa
#

you could make some clusterfuck of a function like isValidJSON() or something

#

if it catches an error, returns false

#

etc

sudden geyser
boreal iron
#

Guess I will need to create a function with try and catch block

#

lol nvm

sudden geyser
#

All your pain and suffering can be the function's problem

boreal iron
#

same idea

sudden geyser
#

I am you!

boreal iron
#

yee

#

Thought there would be an easier way but okay... damn PHP has like 1 billion predefined functions

quartz kindle
#

try catching it is the only sane way

brave garnet
#

someone know maybe a free database which could handle really many discord servers? and its roles?

sudden geyser
#

depends how much is many discord servers

brave garnet
#

very much as its listed =p

sudden geyser
#

how much

brave garnet
#

now i have 4 from topgg and idk how more from discord link on twitter. size of bot grows and im not gonna pay for anything for this bot =p (foss)

sudden geyser
#

so you have 4-12 servers?

brave garnet
#

but bot grows?

quasi hearth
#

what kind of things does your bot do?

brave garnet
#

its just a port of ubuntu in discord =p moderation, information and 2 cmds of fun =p

sudden geyser
#

I don't know how many servers your bot has, but the number of servers you have usually dictates the traffic your bot receives, which may dictate how much your database is used. Of course, it could be thousands of servers and could practically be unused.

You probably don't need to worry about what database you're using since they'll all work.

#

But if you just want some database, consider something light, like SQLite (pun) or some key-value store.

brave garnet
#

ok. now its 4 cause link posted on twiter was link to topgg =p

brave garnet
quasi hearth
#

Maybe check out firebase?

brave garnet
#

paid

sudden geyser
#

Is Firebase free?

quasi hearth
#

its free

brave garnet
#

nope

quasi hearth
#

unless you go over the free limits

#

I use firebase for many of my projects

brave garnet
#

and is it as safe as i can store passwords for discord servers roles (aka password roles)

quasi hearth
#

yeah. you can make the database only allow you to read and write to it

brave garnet
#

i know bout this, ye? im just searching for a free, with some space, encrypted online db.

#

noone?

quasi hearth
#

what do you mean by encrypted?

tulip ledge
#

You have to encrypt data yourself

#

You have to save encrypted data

brave garnet
#

generally to be allowed on discord. im gonna store passwords etc

#

(not users but discord forces all this type content)

rose warren
#

Databases don't encrypt the data you store in them. You encrypt the data you store in them.

brave garnet
#

ekh. im not best if bout security...

quasi hearth
#

by "encryption", are you trying to store password hashes in a database?

tulip ledge
rose warren
sudden geyser
#

Passwords suck anyway

tulip ledge
#

Ohhh interesting

#

Thank you

brave garnet
#

generally?

tulip ledge
#

Yes

#

Its a password

brave garnet
#

k thk

tulip ledge
#

All passwords are sensitive

rose warren
#

You could use the top.gg api too but it's just what I had open in my browser at the time. Or you could just store the server count in your db and get it from there.

boreal iron
brave garnet
#

anyways - most important commands are going byebye (sudo and passwd)

#

;-;

wheat mesa
#

Hashing passwords is easy

brave garnet
#

?

wheat mesa
#

Tons of libraries out there to use

brave garnet
#

i dont even know what is hash and what is salt lmao

#

for me hash is just # and salt is in the kitchen lol
😳

latent heron
#

hashing is an algorithmic method to encrypt data

brave garnet
#

eee

latent heron
#

salt is a set of serialized characters that you put with the original content of what you're hashing to make it "more secure"

brave garnet
#

with second message i again know nothing =p

#

thk

latent heron
#

do you know what MD5 is

brave garnet
#

i heard bout it but my last things where i was seeing "salt" was when i was trying to crack password on my pendrive... it was luks btw

latent heron
#

MD5 is a hashing algorithm

brave garnet
#

eee

earnest phoenix
#

and its only the best one

#

;)

latent heron
#

ignoring the bias there

earnest phoenix
#

Im kidding

brave garnet
#

?

earnest phoenix
#

MD5 is pretty weak

latent heron
#

what do you define as weak

rose warren
#

MD5 is not encryption.

brave garnet
#

my "encrypting" is only base64 for the now... 😳

latent heron
#

correct, it's an algorithmic hashing function

brave garnet
#

?

earnest phoenix
#

Ah right

latent heron
#

but it is used likewise to encrypt data

earnest phoenix
#

Got that mixed up

brave garnet
#

is it is or isnt?

latent heron
#

hashing just means you can't plug in the given result and get it deciphered

#

an encryption means you can cipher and decipher both ways

earnest phoenix
#

Once its hashed you can't unhash it right?

brave garnet
#

base 64 xan be encrypted and decrypted, yes

latent heron
#

correct

#

hashing is a one-way encrypting method

earnest phoenix
#

Only to crack a hash is to brute force it

#

well there are more ways I guess

#

but brute forcing is a common one

latent heron
#

there's more ways to break md5

earnest phoenix
#

Yea

#

Brute force is probably the easiest tho no?

latent heron
#

the most convenient way is checking an MD5 hash for an existing copy of it in a database

brave garnet
#

yea

latent heron
#

which is essentially what most MD5 "decipher" websites do

#

check some internal database

earnest phoenix
#

Ah I see

latent heron
#

the problem with MD5 is that two different contents can produce the same hashed value

#

that's the flaw

brave garnet
latent heron
#

if you want good encryption standards

#

follow SHA3 or AES256

brave garnet
#

?

earnest phoenix
#

Yea

#

I use argon2 when hashing things in typescript

latent heron
#

complex shit AES256 does with bit shifting

brave garnet
#

i understand 0%

earnest phoenix
#

I can't even read it

latent heron
#

that's normal

brave garnet
#

i can but im too dumb for it =p

latent heron
#

i took a cryptography class so i learned a fair amount of this

#

this kind of stuff is extremely difficult

tame kestrel
#

If you’re hashing text one way please consider using a system like bcrypt or something

rose warren
#

Sexy af

latent heron
#

they pay you huge fucking money to attempt developing an encrypting algorithm

#

it's big buck

tulip ledge
#

So I am working on this rpg bot and one of my testers managedto make a script that runs commands of cooldown so I implemented a captcha system, now I was wondering what would be the best way to “detect” if a user might be scripting to then prompt the captcha

latent heron
#

bcrypt is okay

#

imo

earnest phoenix
#

argon2 is just as good

tame kestrel
#

It’s the only package off the top of my head lol

brave garnet
#

anyways - bye

latent heron
#

just use md5

rose warren
latent heron
#

it's convenient and very common

earnest phoenix
#

Eh

latent heron
#

and the chances of an MD5 leak being possible are fairly low

earnest phoenix
#

Ima continue using argon2

latent heron
#

you could also just do MD5x3 or MD5x5

tame kestrel
#

But you want to use a system like that that beats the processor up a bit to stop reverse lookups as well as making it harder to decrypt

latent heron
#

some people hate the idea of stacked hashing but it works very well

latent heron
#

i don't see the need for people to reinvent the wheel

latent heron
earnest phoenix
latent heron
#

anything IT job in the digitech sector involving cybersecurity pays you very well

tulip ledge
#

Yeah

#

Basically

earnest phoenix
#

good luck

latent heron
#

it's stupidly good for a career path

rose warren
#

I'm pretty sure WordPress uses bcrypt. If it's good enough for 50% of the internet it's good enough for me.

earnest phoenix
#

Ahah

latent heron
#

because many employers are looking for cybsec experts atm

boreal iron
#

Shouldn't the Discord gateway send a GUILD_DELETE event if a guild (server) gets delete? The bot should get kicked, shouldn't it?

latent heron
#

i think pentesters still get paid a fair worthy amount of money?

earnest phoenix
#

I would assume so

tulip ledge
#

I’d just like a small push in the right direction as I have no clue where to start with that

#

I could just prompt it every x commands

earnest phoenix
#

Well making an anti cheat for a discord bot can be quite challenging

tulip ledge
#

I know that

#

Thats also why I want to attempt it

earnest phoenix
#

I mean, I wouldn't have a clue

#

You can't exactly stop them from using a "script" as you really have no way of knowing

rose warren
tulip ledge
#

I have a captcha system ready and a way to wipe/ban users from the bot

earnest phoenix
#

Well yea

tulip ledge
#

I just want to get an estimate on if they might be scripting

#

To then prompt them

earnest phoenix
#

But the problem is you have no way of knowing if they are making a script for this

#

Best you can do is add a cooldown

tulip ledge
#

I have cooldowns

earnest phoenix
#

Then idk what else you can do

tulip ledge
#

But my friend made a script that just ran 24/7

#

And did it off cooldown

rose warren
#

I'd say use a second cooldown for the captcha. If they run x amount of commands in x minutes, require a captcha to be solved.

#

As an extra level of security I guess

tulip ledge
#

Yeah that could work

earnest phoenix
#

Eh

#

I honestly don't really see the point

tulip ledge
#

Should I just make it prompt captchas at random then?

rose warren
#

Captchas could be annoying from a UX point of view

tulip ledge
#

Then what do I do vs people running scripts?

earnest phoenix
#

I honestly don't think you should at all

#

Well you truly can't do much

rose warren
#

Just cooldown

tulip ledge
#

So my game will be dominated by scripters then

sudden geyser
#

It should really be DIscord's job to detect if the user is scripting.

earnest phoenix
#

This isn't some game on steam where you could make an anti cheat at root access level

tulip ledge
#

I have cooldowns in place

rose warren
#

Maybe increase the cooldown if people hit it too many times

earnest phoenix
#

That's a better idea

rose warren
#

I don't know what's best without affecting the UX

tulip ledge
#

What’s UX, user experience?

rose warren
#

Yeah

earnest phoenix
#

Yea

#

Increasing the cooldown is better than a captcha

rose warren
#

But then there's nothing to stop a script user also using cooldowns so... 🤷‍♂️

#

Captcha is probably failsafe

tulip ledge
#

I’m just scared of people running scripts on multiple accounts then selling the items and transfering the money to their main

earnest phoenix
#

Best you can do really is just implement a report system

#

Captcha is just annoying

#

And will probably affect user base

tulip ledge
#

But how do I check reports then?

rose warren
#

Like, if I'm savvy enough to make a script to exploit the system, I'll include cooldowns in my own code to avoid getting rate-limited by your bot anyway.

sudden geyser
#

Who's going to report the offender anyway

tulip ledge
#

Like how would I detect if the reported player is scripting

rose warren
#

Maybe just have something that flags people in your system if they have suspicious activity on their account.

earnest phoenix
#

Trying to battle scripts on a discord bot is a useless battle

tulip ledge
#

So then I prompt a captcha

earnest phoenix
#

This isn't some steam game that makes use of an anti cheat with access to your PC

tulip ledge
#

But I dont know how to detect suspective behavior

rose warren
#

Captcha is fail-safe but most annoying for the user. So use them sparingly.

sudden geyser
#

This isn't a great channel for this question anyway

rose warren
#

Have you used OwO bot?

#

They have a captcha system

sudden geyser
#

You're just going to get a bunch of abstract answers

tulip ledge
rose warren
earnest phoenix
#

The best thing you can really do is to implement a system where it detects if the user is actually using an script to automate the process by some ways such as checking how many times they've used the command in a row (People aren't going to just sit there running commands 24/7 unless they got no life) and checking if they're running the commands right after the cooldowns are expired and similar stuff and just blacklist the user

sudden geyser
#

But why? It's always going to circle back to "use a captcha and figure out when to prompt it" where when is abstract

tulip ledge
earnest phoenix
#

Database?

#

Again

tulip ledge
#

Yes but how

earnest phoenix
#

This is a pointless battle

#

How what?

#

It's like the swear filter

#

You can bypass all this

#

And you can't account for everything

tulip ledge
#

Do I just save every time someone executes a command the timestamp?

earnest phoenix
#

yea

rose warren
#

Store the command calls in your logs with a timestamp attached to each

#

Yeah

tulip ledge
#

Yes I know

#

I meant what would be the most effective way of storing it

tulip ledge
rose warren
#

Yeah

earnest phoenix
#

No

rose warren
#

Database is your biggest problem scaling a bot

#

Those logs grow quickly

earnest phoenix
#

I doubt that would use much space at all

#

Not really, you don't need to save all of them to a new document, just save a few and update them each time

rose warren
#

They won't be huge but they'll be pretty big

earnest phoenix
#

Yea

rose warren
#

Just store the necessary information only

#

Keep it as light as possible

earnest phoenix
#

ID and timestamp is really all you need rbh

rose warren
#

Yep

earnest phoenix
#

Tbh*

#

And that's barely anything so you won't run out of space for a while

rose warren
#

Plus, you could auto-purge older logs once they've passed your cooldown limit if you wanted to keep it light

tulip ledge
#

I think I should just add a random captcha prompt

rose warren
#

Instead of storing them forever

tulip ledge
#

Or

#

Yeah

#

I could do that

#

I have an idea

earnest phoenix
#

Captcha just sucks so much

#

It's like they target me with the hardest ones to read

sudden geyser
#

Immutable databases should really be the norm of today

rose warren
#

Yeah but it depends how you use it. Owo bot uses captcha quite successfully. If it was too much of a pain it wouldn't be in 2 million servers.

tulip ledge
#

I’d just have this as a captcha ||Tg0Hyk9||

earnest phoenix
#

Captchas generated in an image would be a little more efficient

#

yea

tulip ledge
#

True

sudden geyser
#

those are still easy to beat

rose warren
sudden geyser
#

but to stop basic scripts they're fine

tulip ledge
#

I’ll just use canvas rhen

rose warren
#

Yeah

tulip ledge
#

I wont make them hard

earnest phoenix
#

Im just saying if you script at a discord bot game

rose warren
#

Pretty sure that's what Owo uses

tulip ledge
#

I just dont want people to make easy scripts

vivid fulcrum
#

people will still bypass it by using things like 2captcha

tulip ledge
#

If they want to script they have to put in effort

vivid fulcrum
#

effortlessly

rose warren
#

Owo's captchas are easy to read but in an image so no scripts

vivid fulcrum
#

i totally didn't make a selfbot that plays pokemeow and solves the captcha via 2captcha

sudden geyser
#

You all are really fighting a losing battle.

tulip ledge
#

Alright I’ll do that

rose warren
#

Get beaned

vivid fulcrum
#

hey i said i didnt mmLol

earnest phoenix
tulip ledge
#

Ty all for helping

sudden geyser
#

yuh

earnest phoenix
#

It'd be a better question if this was some kind of desktop game

rose warren
#

Glhf

earnest phoenix
#

ez anti cheat then

tulip ledge
#

I’ll also add a small and easy filter to try and see if the user is using a script or no

vivid fulcrum
earnest phoenix
#

I mean not easy

#

But a lot more doable to detect a script

#

EAC handles it pretty well

vivid fulcrum
#

sure but desktop games are even easier to cheat in

#

since you can directly access and edit memory

earnest phoenix
#

Which is why anti cheats are a better thing for desktop games

tulip ledge
#

Selfbots are against tos too right?

earnest phoenix
#

Yes

vivid fulcrum
#

yes

earnest phoenix
#

lolMm Bro the best way to detect if they're actually using an script to automate the process is to just monitor their messages and command usage 24/7 manually

#

Ever since the Bot api became a thing

vivid fulcrum
#

actually no

sudden geyser
vivid fulcrum
#

selfbots were still allowed after the official bot api came out

sudden geyser
#

except storing everything like a sane person

#

and making decisions on old data

earnest phoenix
#

Im glad selfbots aren't allowed though

vivid fulcrum
#

yeah unfortunately they banned selfbots because people kept using it with malicious intent

earnest phoenix
#

Yep

#

Which is why its better that way

tulip ledge
#

So discord will handle a part of my anticheat too right

earnest phoenix
#

At least with a bot account it has to be invited

#

I kind of doubt that but maybe

sudden geyser
tulip ledge
#

My bot uses slashcommands so other bots cant execute commands either

earnest phoenix
#

Mmm, are you sure bots can't execute slash commands

#

ive never really tried

brave garnet
#

as it is in permissions in dev site it can send. it just isnt yet implemented in js and py =p

tulip ledge
#

Well I can still detect if the author is a bot or not

#

And return if it is

earnest phoenix
brave garnet
#

bot can. here u have :

earnest phoenix
#

Can i edit my bot page?

brave garnet
#

it u use chrome - yes

earnest phoenix
#

That permission is meant for users, not bots; all the permissions were placed there no matter if it's related to a user or a bot

brave garnet
#

im gonna check api

#

nothing said nowhere. gimme next 15

earnest phoenix
#

yes

brave garnet
#

i think its might be possible after reading 10 tons of pages on github. just its not implemented =p

lyric mountain
#

bots can't execute slash cmds

#

slashes are a client-side trigger, not just a prefixed command

earnest phoenix
#

Yea ik

brave garnet
#

here ya have how : In your application in the Developer Portal, there is a field on the main page called "Interactions Endpoint URL". If you want to receive Interactions via outgoing webhook, you can set your URL in this field. In order for the URL to be valid, you must be prepared for two things ahead of time:

earnest phoenix
#

But what does it mean when it says the bot user doesn't need to be in the guild to use its slash commands

brave garnet
earnest phoenix
#

What?

brave garnet
#

that

earnest phoenix
#

What are you on about a modded user

brave garnet
earnest phoenix
#

nope, slash-commands are client-side

hot sleet
#

i know that my question is idiot.
how to check for permission in discord v1.13

brave garnet
earnest phoenix
#

Slash Commands and Interactions bring something entirely new to the table: the ability to interact with an application without needing a bot user in the guild. As you read through this documentation, you'll see that bot tokens are only referenced as a helpful alternative to doing a client credentials auth flow. Slash Commands do not depend on a bot user in the guild; responding to interactions does not require a bot token.
I don't get this, is this saying a bot doesn't need to be in the guild for its commands to be useable?

earnest phoenix
brave garnet
restive furnace
brave garnet
#

yep +1

earnest phoenix
#

How exactly does that work

earnest phoenix
#

How does that even work?

#

It just does

#

Oh wait

#

Nvm

#

I get what you meant now

#

I assumed it meant globally not guild specific

earnest phoenix
#

Kinda cool a bot doesn't actually need to be in a guild for its commands to be usable though

#

As long as its registered in that guild ig

brave garnet
#

thk. tomorrow it will be

earnest phoenix
#

I doubt this

#

very much

earnest phoenix
#

Everything is under a manager of sorts now right?

#

Perhaps

hot sleet
#

ty i was using message.author instead of message.member

#

my bad

earnest phoenix
#

Yea

#

always remember author is the user object and htye dont have ties to a guild

#

How to know how much members my bot is in

tired panther
#

Map the approx membercount and than reduce it, which library?

earnest phoenix
#

how much members bot is in

#

I almost got confused there

tired panther
#

true

boreal iron
#

what a dirty bot smirk

tired panther
#

lol 🙈

lyric mountain
boreal iron
#

Really thought the bot is dirty but no, your thoughts are

#

Damn… that interaction, button shit somehow is really cool to use

#

The global registered interactions are cached for 1 hour, right?

rose warren
#

Yep

boreal iron
#

They need to be registered on every startup?

rose warren
#

Good question...

boreal iron
#

Need to switch to global commands later and wanna know before

#

Guilds commands need to be registered on every startup

rose warren
#

Nothing on the docs page about that?

digital ibex
#

you only register them once

digital ibex
boreal iron
#

You have to

digital ibex
#

i dont remember seeing that but 🤷

boreal iron
#

They will be shown sometimes in the guild if the bot is offline if your browser still cached the script.
Reloading the site will clear all commands which means they need to be registered again on a startup.
Test this already

digital ibex
#

it doesnt say anything about guild commands needing to be reloaded

boreal iron
#

But I’m not sure about global ones yet

boreal iron
#

Nowhere. I experienced this the last days

digital ibex
#

guild commands only need to be registered once

#

and global

#

im 99% sure

boreal iron
#

Nope they won’t be shown if your bot restarts

#

Restarted the bots hundreds of times the last days til I ran into rate limiting

#

Anytime the same behavior

digital ibex
#

i've been implementing slash commands in my library and i've only had to register it once, maybe cuz there 2 processes of my bot running but that shouldnt change anything i doubt

boreal iron
#

Hmm weird need to investigate this again

rose warren
#

I haven't tried global commands yet. I'm still developing so I'm only using guild commands.

boreal iron
#

That lets me think of if there’s cache for guild commands, too?

digital ibex
rose warren
#

No cache on guild that's for sure

boreal iron
#

Well since my bot offline atm they shouldn’t appear at all

digital ibex
#

wym they dont appear

boreal iron
#

Doesn’t make much sense as websocket connection got closed

digital ibex
digital ibex
boreal iron
#

Therefore no interaction can happen anyways

rose warren
#

Yikes

#

Token leak

#

That's what's wrong

#

You're gonna want to regen that

digital ibex
digital ibex
boreal iron
#

Mixed bot scope with command scope

#

(aka. gateway and API)

#

nvm

#

Still need to investigate how long guild commands are cached

digital ibex
#

they arent

boreal iron
#

Don’t think they will last forever

digital ibex
#

they are instant

digital ibex
#

i dont think you understand what something being cached for a period of time means

boreal iron
#

Nah u didn’t get what I’m trying to say okeh

#

But doesn’t matter rn since I’m not able to test it now

tulip ledge
#

What would be the best way to turn custom images into links?

#

Do I just set up an express server and use my vps’s ip adress?

digital ibex
#

base64

tulip ledge
#

Can u use base64 urls in discord embeds?

digital ibex
#

its a topic im not too sure in but can kinda set u on the right path

digital ibex
tulip ledge
#

Yes, hence my question

rose warren
lean ivy
#

^^^ I like your bot

eternal osprey
#

hey

#
if (message.content == (prefix + "startservices1")) {
 setInterval(async () => {
              console.log("test1")
              }, 1000)
      }
if (message.content == (prefix + "startservices2")) {
 setInterval(async () => {
              console.log("test2")
              }, 1000)
      }```if i use both commands, why is only one of the two console.logging?
rose warren
#

Try ===

eternal osprey
#

yessir! Let me try

modest maple
#

how do i do exceptions in JS?

#

wel

#

other than throw

#

is there a general practice to follow?

eternal osprey
#

if i first use !startservices1

#

it starts the first interval

#

but after using !startservices2

#

it stops the first one

#

but i want them both to be starting

modest maple
#

since when did setInterval support async functions?

eternal osprey
#

wait can't i just put them under one common command lol

eternal osprey
#

it's not needed

#

was from my previous code

#

still the same issue

#

ffs

quartz kindle
#

it does support async functions

quartz kindle
modest maple
lusty nacelle
#

Help, I want to make a conditional that: if x role is above the bot role, it returns x, I already have it, all the code, but I don't know how to mention the bot role in the code
In other words, compare the mentioned role with the role of the bot, but I don't know how the role of the bot is defined

quartz kindle
#

show code

lusty nacelle
#

@quartz kindle

#

I want that when the role of the bot is below the mentioned role it returns x message

quartz kindle
#

mencionado is already a role

#

there is no role.highestRole

#

you want the highestRole of the bot member

earnest phoenix
#

-> <GuildMember>.roles.highest

quartz kindle
#

^ yes, depending on your discord.js version

lusty nacelle
#

v12

earnest phoenix
#

yep, you can use that on v12

#

I recommend updating your codebase to use v13 already

modest maple
quartz kindle
#

nice :)

lusty nacelle
#

oh, yes

modest maple
quartz kindle
#

hahaha

#

what browser is that?

earnest phoenix
#

Sounds like every JS project ever

modest maple
modest maple
quartz kindle
#

oh, they redesigned the ui again?

#

havent used it in a while

modest maple
#

nightly but yeah

#

I think some version 80+ or so

#

They redid the UI and seemly made it alot faster

#

was a noticeable speed increase going from like firefox 70 to nightly lol

quartz kindle
#

nice, just updated mine

eternal osprey
quartz kindle
#

what is the issue again?

eternal osprey
#

well, am facing.

quartz kindle
#

i didnt scroll too far back

eternal osprey
modest maple
#

well... if thats all of the code, then thats impossible

eternal osprey
#

just a snippet

modest maple
#

mmLol So i suspect you need to send more code

quartz kindle
#

yup

eternal osprey
#

okkiii one sec

quartz kindle
#

from that code alone, it should work

eternal osprey
#

it's a long code tho so i will just bin it

proper bolt
#

the interval shouldnt stop unless you run clearInterval or whatever right

quartz kindle
#

ye

modest maple
#

or you block the event loop

#

but js makes that reasonably difficultish

earnest phoenix
#

Or just crash the program, or it runs out of memory lolMm

quartz kindle
#

huehuehue

eternal osprey
lusty nacelle
eternal osprey
#

it;s a big code tho, but basically i can run two intervals: one !startpaid and one !startfree

quartz kindle
quartz kindle
#

its the same in all commands

eternal osprey
#

owh so that should be changed

earnest phoenix
#

That code be still using var

eternal osprey
#

hmm but if they are the same wouldn't it just time it at the same time

#

wow that was a sentence

eternal osprey
quartz kindle
#

you set an interval, and store it in timer

#

then in another command you clear it

#

and set another interval

#

so you're always clearing the existing interval

eternal osprey
#

owh but i am not clearing it

#

with the !stopfree or !stoppaid

#

i am just using the start commands in 2 different channels

lusty nacelle
eternal osprey
#

lol it worked

#

thanks tim

quartz kindle
#

how are you getting the role of the bot otherwise?

rose warren
#

Can't you just use .manageable off the guild member?

quartz kindle
#

i guess you can

rose warren
#

No need to compare role positions

quartz kindle
#

but i think he wants to mention a role directly, not a member

rose warren
#

Ah yes I didn't read up

eternal osprey
#

is someone here familiar with the facebook api?

#

I am trying to know how to log messages of a certain group: js FB.api('me/feed', 'get', {message}, async function (res) { console.log(res)}
the feed one already works, but i really would want to know how to get group messages.

lyric mountain
#

TIL Facebook has an api

quartz kindle
#

does it also collect and sell your data?

lyric mountain
#

Idk, maybe? ( ͡° ͜ʖ ͡°)

quartz kindle
#

:^)

eternal osprey
#

facebook has an api

#

but their api is so damn bad

#

you don't have much options to use

lyric mountain
#

Clearly you never used twitch's

earnest phoenix
#

Please

#

dont

#

bring up twitch's api

rose warren
#

What about Patreon? shudders

#

So glad I quit Patreon

earnest phoenix
#

What about paypal

lyric mountain
#

Patreon doesn't have an api

earnest phoenix
#

yes they do?

lyric mountain
#

They have a "here take this shit, now figure out yourself what each thing is"

earnest phoenix
#

Oh

#

it was sarcasm

#

so hard to tell on the internet fuck

lyric mountain
#

Well you didn't let me finish ¯\_(ツ)_/¯

earnest phoenix
lyric mountain
#

but seriously, I refuse to accept that as an api

earnest phoenix
#

Paypal is worse

lyric mountain
#

to this day I still can't figure out what am I supposed to look at

#

there are like, 35 objects named "pledge"

#

all look the same

earnest phoenix
#

Lmfao

rose warren
#

Yeah

#

It's why I quit Patreon altogether

earnest phoenix
#

kofi better

rose warren
#

I decided it was easier to convince 30 people to pay through my website than to figure out the API.

earnest phoenix
#

kofi is pog

rose warren
#

And Chargebee is pog and so easy

earnest phoenix
#

tho to this day no one has sent me money on it

#

;c

rose warren
#

What are the kofi fees like?

earnest phoenix
#

There are none iirc

rose warren
#

Nice

#

Chargebee has no fees either

#

You only pay for your payment processor fees (Stripe, PayPal etc)

earnest phoenix
#

Donations go directly to your PayPal or Stripe account. We just get a notification that the transaction was successful so we can update the creator's page, but we do not take a fee from donations.

rose warren
#

Nice

earnest phoenix
#

Same with kofi

rose warren
#

But they don't have subscriptions iirc?

#

It's like a one time thing

earnest phoenix
#

They do

rose warren
#

Oh nice

lyric mountain
#

hm, I can stay free until 100k USD

#

that's like, half a million reals

rose warren
#

But how do you integrate with Discord?

earnest phoenix
#

Kofi?

rose warren
#

Yeah

lyric mountain
#

gonna take a look at chargebee later

rose warren
#

How do you get the person's Discord ID?

#

To update your db

rose warren
lyric mountain
#

meh it doesn't have R$ option

quartz kindle
#

the user has to login with discod

earnest phoenix
#

There is probably a way Mac

#

I haven't used kofi to that extent

rose warren
#

User logs in but it gives a role 🤔 so it's like using the Patreon bot to manage subs?

earnest phoenix
#

Maybe

#

You can also use webhooks

rose warren
#

Ah ok

earnest phoenix
#

so I think when someone donates it sends a webhook

rose warren
#

That's good

earnest phoenix
#

let me see if I can find a post on that

rose warren
#

Chargebee does that too but there are a ton of events in the API. Really flexible. Good docs. Easy to use.

earnest phoenix
#

Yea

#

I just like kofi cause its fairly simple

#

and truth be told I dont need all that anyway

#

I am fine just sending a webhook and giving a role and calling it a day

#

lol

rose warren
#

I used to use the Patreon bot to give roles in my server, then detect role changes using another bot. It was hell. The Patreon bot was unreliable and sometimes didn't remove the roles from people who cancelled their subscriptions.

#

So it ended up being like managing the whole thing manually.

earnest phoenix
#

Sounds like patreon

rose warren
#

I had a spreadsheet with people's Patreon names and Discord IDs because there was no info on the site 🤦‍♂️ it was a pain. Now with Chargebee I don't need to do anything. It manages itself.

#

You can credit people's accounts, give out promo codes etc. It's good.

earnest phoenix
#

O noice

#

Can you use chargebee to help let others charge other people money?

#

Like an ecomerce site

rose warren
#

I don't know. I know you can sell products with it. It's not just subscriptions.

#

Never looked into that tbh

earnest phoenix
#

Ah

#

I need to find a thing to use for that kind of thing for my project

#

I don't wanna work with paypal and stripe directly

rose warren
#

I'm only interested in the SAAS side of it.

earnest phoenix
#

thats just pain

rose warren
#

I have another project I'll probably use it for too.

earnest phoenix
#

O nice

#

If you know anything or come across something like what i described lmk

rose warren
#

Take a look at the docs though. It has lots of good features. Built in analytics too. Worth your while if it works.

earnest phoenix
#

Yea im doing so rn

#

Chargebee has some pretty expensive plans wew

rose warren
#

Yeah but it's free for your first $90K or something

earnest phoenix
#

ye

rose warren
#

And then it's $250 or something

#

But if you're making over $90k in a year then $250 is reasonable

earnest phoenix
#

yea

final obsidian
#

Guys what is the best way to make a modmail? Any guides or tutorials that can help?

errant flax
#

i think u need an oauth2 for a modmail if it's public vvGFXRT_flushedspin

#

like to access the user's guilds

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

Tim is unavailable rn

split hazel
#

leave that man alone he needs a break lmao

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

If you would like me to take a message I can get it back to him

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

Kekw

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

Weird flex

summer torrent
#

uvuwevwevwe onyetenyev

earnest phoenix
#

the fact you copied that so fast scares me

summer torrent
#

@quartz kindle nice status

earnest phoenix
#

unless you clicked his profile that fast

summer torrent
#

i didn't

quartz kindle
#

lel

fair rampart
#

How to add here a specific role

#

like role name as Test or something

fallen holly
#

i don't want it to send different message each time. if someone chooses different option it will update the over message this is the code

long crow
#

interaction.channel.send({ embeds: [mod], components: [] }) change to interaction.update and with update, there is no need interaction.deferUpdate(). update will edit the original message instead of sending new one @fallen holly

young rune
long crow
#

I scared of python

young rune
#

why?

long crow
#

it bite

digital ibex
#

jus ask ur qestion

young rune
#

nvm i rather not ask anymore-

austere zealot
young rune
#

nice

#

same.

austere zealot
#

nice.

young rune
#

wanna work together?

earnest phoenix
young rune
#

also great

round cove
#

Hey nerds, anyone familiar with slash commands and how to remove old slash commands I made to replace with a newer version of that command?

long crow
#

either use .create with the same unique name

#

or if it many, use .set

earnest phoenix
flat copper
#

I got this error when I'm trying to start

sterile thicket
#

Message content: abcd @user1 --by @user2

I have collected args[1] when splited with "--by": const arg1 = message.content.replace(new RegExp('--by', 'gi'), '--by').split('--by')[1]

Now the mention I want to know the id of is in arg1, how do I grab it?

earnest phoenix
#

arg1 will always be <@user2 id>

#

@sterile thicket do you want the id of the first user?

#

I'll suggest using the yargs package for options like --by

burnt quarry
#

TypeError: Topgg.api is not a constructorwhy this comes?

near stratus
#

because Topgg.api is not a constructor

#

If I remember,
It was Topgg.Api

wheat mesa
#

Pretty straightforward error right there

burnt quarry
#

means?

near stratus
burnt quarry
#
client.topgg = new Topgg.api("my token")
near stratus
burnt quarry
#

ok

#

worked

#

thnks

near stratus
#

np

burnt quarry
#

@near stratus one more thing

#

ReferenceError: voted is not defined

#

comes

#

not for me my friend i was in class

#

i am verified bot developer

#

😅

#

yah

restive furnace
earnest phoenix
long crow
#

jsdoc intensify

pallid jungle
#
DiscordAPIError: Unknown interaction
2021-08-10T06:09:22.752455+00:00 app[Worker.1]:     at RequestHandler.execute (/app/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
2021-08-10T06:09:22.752456+00:00 app[Worker.1]:     at runMicrotasks (<anonymous>)
2021-08-10T06:09:22.752456+00:00 app[Worker.1]:     at processTicksAndRejections (internal/process/task_queues.js:95:5)
2021-08-10T06:09:22.752456+00:00 app[Worker.1]:     at async RequestHandler.push (/app/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
2021-08-10T06:09:22.752457+00:00 app[Worker.1]:     at async InteractionReply.think (/app/node_modules/discord-buttons/src/v12/Classes/managers/InteractionReply.js:80:5)
2021-08-10T06:09:22.752457+00:00 app[Worker.1]:     at async Client.<anonymous> (/app/commands/embeds/help.js:159:13)
2021-08-10T06:09:22.752507+00:00 app[Worker.1]: (node:4) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 11)

Why that

waxen bough
#

code

pallid jungle
#

Wait

long crow
#

¯_(ツ)_/¯

#

Look like need to limit the text in the code for now

waxen bough
#

damn i can upload whole contents of minecraft apk in that size

pallid jungle
#

@waxen bough So what is the problem

long crow
#

Are you using discord-button pacakge?

pallid jungle
long crow
#

Look like it, it is not compatible with v13, and the package itself not very familiar

restive furnace
#

upgrade.

pallid jungle
errant flax
#

npm update discord.js

#

or
npm uninstall discord.js
then
npm i discord.js@13.0.1

long crow
#

npm install discord.js@latest

earnest phoenix
#

Where to see approval for bot

long crow
# pallid jungle Link?

Just so you know beforehand, upgrading to v13, will require you nodejs version 16.6, and loads of breaking changes

pallid jungle
#

oh

pallid jungle
long crow
near stratus
tranquil steppe
#

Does anyone know why I can't download my bot into another server?

long crow
#

?? exist from node 15, so is optional chaining, so is ??=, AbortController iirc is in 15 too, timers/promise is introduce in 15 too

earnest phoenix
#

Who will dm me if my bot gets accepted

long crow
#

So that's that. What feature they gonna use on v16.6, i not very sure since on 16.6 only thing I see is array.at which kinda useless

tranquil steppe
#

the bot

near stratus
tranquil steppe
near stratus
earnest phoenix
#

[BITFIELD_INVALID]: Invalid bitfield flag or number: undefined.

#

When i try to require MANAGE_EMOJIS on djs v13

pale vessel
earnest phoenix
#

I readed couldnt find

pale vessel
#

Find it

#

Use keywords

#

CTRL+F

#

Otherwise you'll never learn

earnest phoenix
obsidian flint
earnest phoenix
#

Oh

#

They changed it as emojis and stickers

pale vessel
#

Yeah

earnest phoenix
sterile thicket
#

[ 'sadasd', '<@!userid1>', 'adad', '@!userid2>' ]

I have this array. I want to list out only those elements which has <@! and > in them.

Now it should show [ '<@!user1>', '<@!user2>' ]

How?

pale vessel
#

array.filter(), string.startsWith() and string.endsWith()

outer perch
#

how do I debug my bot with breakpoints and all that ?

lethal trout
outer perch
#

cuz I've been using console.log() for a long time

boreal iron
#

without breakpoints
?

slender thistle
#

with not without

#

You'd need an IDE that allows such debugging

outer perch
#

VS Code isn't executing the code

#

it's Node.JS

#

through bash

boreal iron
slender thistle
#

I'm not sure if VSC supports them

#

It doesn't run the shit by itself, but has some sort of debugger track your code and hence the breakpoints

outer perch
#

if I hit F5 and then select Node.JS it sends me this

#
Executing task: c:\Users\r.agsilva\Desktop\Gumball-and-Penny\node_modules\.bin\tsc.cmd -p c:\Users\r.agsilva\Desktop\Gumball-and-Penny\tsconfig.json <

/usr/bin/bash: c:Usersr.agsilvaDesktopGumball-and-Pennynode_modules.bintsc.cmd: command not found
The terminal process "C:\Program Files\Git\bin\bash.exe '-c', 'c:\Users\r.agsilva\Desktop\Gumball-and-Penny\node_modules\.bin\tsc.cmd -p c:\Users\r.agsilva\Desktop\Gumball-and-Penny\tsconfig.json'" terminated with exit code: 127.

Terminal will be reused by tasks, press any key to close it.
#

btw I am using TS

#

so I've been using ts-node to execute the code

eternal elbow
#

Does anyone know how to create Discord ids?

outer perch
#

ayy, idk if I want to update my bot to D.JS 13

eternal elbow
outer perch
#

would take a big while to rewrite the code probably

pale vessel
grim cairn
long crow
#

Just ask?

grim cairn
#

what is the difference between ctx.send and message.channel.send

digital ibex
#

ctx.send to send a dm to the author

#

message.channel.send send a message to the channel

grim cairn
#

message.author.send?

grim cairn
digital ibex
#

i forgot, i've not used dpy in like a year now. and even when i did use it i didnt use much

#

also, its in the documentation

grim cairn
#

ok, Thanks

quartz kindle
#

depends what ctx is in that context

#

most likely ctx == message.channel

sterile thicket
# eternal elbow Or filter

@eternal elbow @pale vessel
The thing is, I didn't go to programming school. I just do this as a hobby. And it's been a year or so when I last developed the bot. So now I forgot all the js functions I can use... Thanks.

pale vessel
#

So do I

sterile thicket
#

Lies

#

Big lie

#

Bigger than the universe

earnest phoenix
#

How to host bot?

sterile thicket
sterile thicket
earnest phoenix
sterile thicket
earnest phoenix
#

Im gonna search

sterile thicket
#

👍

earnest phoenix
#

Okay

grim cairn
earnest phoenix
#

How?

hollow depot
#

what library are you using?

#

@earnest phoenix

earnest phoenix
#

java

pale vessel
#

Are you sure?

earnest phoenix
#

Yes

earnest phoenix
#

I don't think that's a library

earnest phoenix
near stratus
earnest phoenix
#

Actually that's a package

#

Npm says so

#

;)

long crow
#

It a module

earnest phoenix
#

No it's a package

#

Npm says it's a package

long crow
near grotto
#

this is not working and not showing any error

near stratus
earnest phoenix
#

Yep

pale vessel
#

Get takes an ID

earnest phoenix
#

Well was just about to say what flazepe was going to day

#

Say*

near grotto
earnest phoenix
#

What version are you using

vivid fulcrum
#

debug your code

earnest phoenix
#

Cause createRole isn't a thing

vivid fulcrum
#

that

hollow depot
earnest phoenix
#

Help

vivid fulcrum
#

and you're calling it on a string

pale vessel
near stratus
earnest phoenix
earnest phoenix
pale vessel
#

Everything can go your way if you're delusional enough

earnest phoenix
#

True

near grotto
earnest phoenix
near stratus
earnest phoenix
#

No idea mate I haven't reached that part myself

earnest phoenix
#

I heard glitch was good trollge

near stratus
near stratus
#

Hosting bots are against Glitch tos

earnest phoenix
#

I know

near grotto
#

this one is not working and is not showing any error

earnest phoenix
#

Well we've already told you

#

But okay

near grotto
#

u told about the add role

#

not create role

earnest phoenix
#
  1. createRole doesn't exist
  2. Can't use it on a string even if it did exist
near grotto
#

k

digital ibex
#

message.content.split(' ')[1].createRole ??? what

pale vessel
#

string.prototype.createRole = function() {
return client.guilds.cache.get("272764566411149314").roles.create(this)
}

earnest phoenix
#

hidden feature of string prototype

earnest phoenix
near stratus
earnest phoenix
near stratus
#

oh no

earnest phoenix
#

Uncaught UncaughtError

near stratus
#

Uncaught @code9131Error

signal estuary
#

How can I downdate a node module to a lower version?

earnest phoenix
#

npm i modulename@version

near grotto
#

When I am trying to create a role, it's showing cannot read the property of create of undefined

crimson vapor
#

Show code

near stratus
#

many times already

near grotto
near stratus
#

You actually tried that lol

near grotto
#

what code should I write to create a role?

#

and display all the roles of a server?

near stratus
#

What your code does is

"some string".createRole({ name: "suqmad", color: "#000000", permissions: [ "ick" ]

Yea it shouldn't show any errors

#

you can't create a role of a string

near grotto
#

ik

near stratus
#

do something like

message.guild.roles.create({ name: "heeeeeeeeeeerrrrrrrrsssssshhhhhhhhuuuuuuuu" }).catch(console.error)
near grotto
signal estuary
#
msg.author.presence.status
TypeError: Cannot read property 'status' of undefined