#development

1 messages · Page 1479 of 1

earnest phoenix
#

😬

ancient crow
#

<a href='https://google.com' class="button";>INVITE</a>

lyric mountain
#

Semi

#

Colon

ancient crow
#

from class?~

lyric mountain
#

Html is not javascript

#

Or java

#

You don't use semicolons

ancient crow
#

ohh oki

#

yesssssss worked thanksssssss

earnest phoenix
#

wait till they discover JSX

lyric mountain
#

Also if it's for long description just use markdown

ancient crow
earnest phoenix
solemn latch
#

In style tags

earnest phoenix
#

bruh

#

markdown still allows html to be used

#

the question is if top.gg is properly parsing it lmfao

#

that's exactly what i meant

#

btw im making a smol markdown lib to test my ts and regex skilz

quartz kindle
#

top.gg does not allow anchor links for some reason

#

all hyperlinks are converted to about="_blank"

hasty mulch
#
@commands.command(name="npwd", aliases=['newphonewhodis'])
@commands.is_owner()
async def test(self, ctx, arg=None):
    if arg == None:
        inboxselect = random.choice(inbox)
        replyselect = random.choice(reply)
        print(f'''Chose the following:
INBOX:
{inboxselect}
REPLY:
{replyselect}
''')
        embed = discord.Embed(
            title='NEW PHONE, WHO DIS?',
            type='rich',
            description=f'''
INOBX:
{inboxselect}


REPLY:
{replyselect}
''')
        embed.set_author(name=ctx.author, icon_url=str(ctx.author.avatar_url))
        embed.set_footer(text="What Do You Meme? | Coded by LIPD Productions Inc.#1205", icon_url=str(ctx.guild.icon_url))
        embed.timestamp=datetime.datetime.utcnow()
        await ctx.send(embed=embed)
    elif arg == 'nsfw':
        if isinstance(ctx.author, discord.Member) and discord.TextChannel.is_nsfw == True:
            await ctx.send('Success!')
#

Language: Python
Issue: No output from nsfw arg

misty sigil
#

could it be the fact that arg=None

#

or am i just an idiot

earnest phoenix
#

it's just a default value and there's handling for it

misty sigil
#

wait no that'd be a default val

hasty mulch
#

Correct

#

When I have no arg, it runs fine

misty sigil
#

have you tried logging arg

hasty mulch
#

print(arg)?

misty sigil
#

i guess yea

earnest phoenix
#

you should also test which if it enters

misty sigil
#

test everything lmao

earnest phoenix
#

pretty much

mellow kelp
#

sad debugger noises

earnest phoenix
#

you haven't experienced true debugging hell until you debug a CI/CD

hasty mulch
#

Yeah, it sees the arg as nsfw

sterile lantern
#

does keyv have issues loading on repl.it / glitch?

misty sigil
#

is it Nsfw NSfw or something similar

#

that might be causing it idk

earnest phoenix
#

isn't discord referencing the package and the classes directly

#

you need a reference to the instance of the object

#

not the class

gilded olive
#

you can check if ctx.channel

#

and why are you using isinstance

#

also is_nsfw either returns True or False

#

.is_nsfw == True => .is_nsfw:

#

oops gotta revers that

#

also you can simply pass embed.timestamp= . . . into the embed constructor as timestamp= . . .

hasty mulch
blissful coral
#

is there a message type returned by the message object that says it is a reply? in discord.js v12

gilded olive
#

what error gets thrown at you

hasty mulch
hasty mulch
earnest phoenix
#

does anyone know how to set library?

gilded olive
#

http requests

earnest phoenix
#

how

gilded olive
#

on_command_error anywhere?

earnest phoenix
#

what do you mean by set library

#

like Discord.js

#

yes but what about it

hasty mulch
earnest phoenix
#

explain what you're thinking of, we can't read your mind

blissful coral
#

^

gilded olive
#

it may be eating up an error that's popping up

unborn berry
#

Anyone wanna play among us?

earnest phoenix
#

no

gilded olive
earnest phoenix
#

fuck off

unborn berry
#

@everyone who wanna play among us

hasty mulch
#

@modern sable

gilded olive
#

@hasty mulch Show me your on_command_error

modern sable
gilded olive
#

Hmmm tryna figure out why no error isnt popping up

hasty mulch
gilded olive
#

holy shit what the fuck

unborn berry
#

I just wanna play sum among us man

gilded olive
unborn berry
#

😂

hasty mulch
mellow kelp
#

don't ask here

hasty mulch
#

@gilded olive You know what would help?

gilded olive
#

what's up

hasty mulch
#

If I did is_nsfw() instead of is_nsfw

gilded olive
#

that would work yea lmfaoooo

#

tho i still wanna see your error handler

hasty mulch
pure lion
#

i have a class client that has a property Gateway which is a socket.io-client socket. I want to extend the Socket class to have my custom events but im not sure how to do this (it doesnt throw an error but doesnt work either)

crimson vapor
#

ourcord?

#

is the issue that no new events are being called?

pure lion
crimson vapor
#

oh

pure lion
#

wait ill send code

#
export interface Client {
  gateway: {
    on(EventName: Events): a type
  }
}```
```sh
All declarations of 'gateway' must have identical modifiers.ts(2687)

Subsequent property declarations must have the same type.  Property 'gateway' must be of type 'Socket', but here has type '{ on(EventName: Events): any; }'.ts(2717)```i know that this is basically self explanatory but i still want a solution; how can i add events with custom intellisense like this
earnest phoenix
#

Anyone know how to get my bot to:
Automatically detects users who use selfbot eg when it sends an embed its blacklist automatically, so if it streams its blacklist too, mention me if you know.

#

no

earnest phoenix
#

you can't identify a selfbot

#

only discord themselves can

#

FTNL do it

#

He blacklist a user if he send a embed

mellow kelp
#
interface Something {
  on(event: 'ready', listener: () => void): this;
  on(event: 'message', listener: (message: Message) => void): this;
  on(event: 'guildCreate', listener: (guild: Guild) => void): this;
}

@pure lion

earnest phoenix
#

users can send embeds without a selfbot

#

But generally when users send embeds it means that they have a selfbot

#

it doesn't

#

does this mean i'm a selfbot now?

mellow kelp
earnest phoenix
quartz kindle
#

you can check the embed type

#

bots will send embeds of type:rich

earnest phoenix
#

rich embeds

#

yeah

#

ah yeah sorry

#

x)

pure lion
earnest phoenix
#

Im french

#

x)

#

read what tim sent

#

but most selfbots won't send embeds

quartz kindle
#

afaik, users cant send embeds of type rich

#

so you can check that

#

but also

#

Embed types are "loosely defined" and, for the most part, are not used by our clients for rendering. Embed attributes power what is rendered. Embed types should be considered deprecated and might be removed in a future API version.

#

they dont recommend using it

crimson vapor
#

I think users can but not without client mods

#

but idk

earnest phoenix
#

I will search on google, I already did it but hey

kindred niche
#

I need help pls

#

When i use the quick.db

#

And run node . in the console

#

The console logs this error:

#

Error: Could not locate the bindings file. Tried:

earnest phoenix
#

you didn't follow the installation guide

kindred niche
#

Oh, what guide?

earnest phoenix
kindred niche
#

oh thank you

sterile lantern
#

how do i make it so it checks this, then ignores if it isnt

#

so

#

if(command.config.premiumOnly = "true") {
db.fetch(premium, user)
if(!premium) return msg.c.send("no work");
}

#

something like that

earnest phoenix
#

huh?

sterile lantern
#

oh wait wrote the wrong thing

#

basically

#

make premiumOnly an optional thing in config

#

so if there's premiumOnly, do something about it. if not, just ignore

earnest phoenix
#

why are you storing it as a string

#

just use a boolean

#

and you can use nullable, i think that's in js

sterile lantern
#

o

#

ok

earnest phoenix
#

nevermind

#

it's a typescript thing

#

it's optional by default

#

everything is optional by default

sterile lantern
#

o

#

ok

mellow kelp
#

why u using 'true' instead of true tho?

#

or is it some display thing

bitter badger
#

Does anyone know what fuzzy matching implementation would be best if I want to fuzzy match longer phrases with short queries? Levenshtein (edit distance) doesn't seem to be too good for that

sterile lantern
#

i changed it to true

#

also

mellow kelp
#

o

sterile lantern
#

if i were to have something like a profile, let's say,

a user has item one but does not have item 2

in their profile:
User's Items:
Item one

a user has item one and has item 2 but does not have item 3
User's Items:
Item One
Item Two

#

rn i have it check for each thing

#

like this

#
if (devbadge === "true" && premiumuser === null) badges = "**__User Badges:__** \n\n![devcheck](https://cdn.discordapp.com/emojis/786290977207877652.webp?size=128 "devcheck") Bot Developer"
    if (premiumuser === "true" && devbadge === null) badges = "**__User Badges:__** \n\n![devcheck](https://cdn.discordapp.com/emojis/786290977207877652.webp?size=128 "devcheck") Premium User"```
#

so maybe like if this condition is true, add something to the embed

bitter badger
#

You're doing the "true" thing again

#

Unless that's what you want

sterile lantern
#

its a DB

#

value

mellow kelp
#

does the db not allow booleans?

cinder patio
#

you can still use booleans

mellow kelp
#

if so i'd say just use 1 and 0

cinder patio
#

or integers

sterile lantern
#

i mean i have it saved as "true"

bitter badger
#

Are you not parsing it as a boolean from the db?

#

Like when you read it in

sterile lantern
#

well regardless, how would u do what i said above

bitter badger
#

By items are you referring to badges?

sterile lantern
#

well yes items and badges

earnest phoenix
#

you might want to look into bit flags

sterile lantern
#

basically if they own a badge/item, add it to their profile

#

hmm

#

okay

kindred niche
#

im still having problems with my bindings

#

i followed the guide and the console logs an error

sterile lantern
#

hm, so would i use bit flags for the profile

#

isnt there a different way

kindred niche
#

i have node v14

#

all tools installed

#

python

#

visual studio

earnest phoenix
#

you will save space with bit flags and it's a proper way to do something like badges

lusty quest
#

also windows build tools installed?

kindred niche
#

yes

lusty quest
#

what exact error did you get?

kindred niche
#

Error: Could not find the bindings file. Tried:

#

I have the bindings in the node modules

#

and the quick.db

#

may the bot doesnt have enough permissions in the server

bitter badger
#

Depends on what you're trying to do. Pretty sure you will always get that warning when trying to edit anything for the server owner. Otherwise, if you're trying to edit a user (nickname or role) while the bot ranks lower than them in roles, you'll also get that warning.

thin flame
#

what?

bitter badger
#

What do you mean what?

#

Are you trying to edit roles or nicknames?

#

Are you trying to edit those for the server owner?

#

If you're trying to error handle it, then you probably need to check if the user is the server owner first because you can't manage them. I'm not completely sure about discord.py but for discord.js there's a property of the user called isManageable and you can check that instead

#

If you're trying to do other server-related things like managing channels, then I think there's another way to check if you have the permissions before you try to do it

gilded olive
#

You're missing the entire point of what he is saying @bitter badger

#

He is trying to handle BotMissingPermissions

#

Which raises from the decorator
@bot_has_guild_permissions() or @bot_has_permissions()

#

example if he passed the ban_members=True kwarg in and it was False

#

BotMissingPermissions would be raised

#

And you can handle them in an event called on_command_error

thin flame
#

no

#

even if the bot has a permission like manage messages it doesn't work if the channel has overwrites

#

figured it our after way too long >_<
apparently I needed to use commands.bot_has_permissions decorator on my commands

fierce ether
#
if(currentqueue.players.length >= 2) {
  let playerone = reaction.message.guild.members.cache.get(currentqueue.players[0])
  let playertwo = reaction.message.guild.members.cache.get(currentqueue.players[1])
   const queue = await Queue.findOneAndUpdate({id: reaction.message.guild.id}, { $pull: { players: [ playerone.id , playertwo.id ] } }, { multi: true })``` never pulls the users
ancient crow
#

anyone have any idea about yaml ? i wanna do // and my message such as js u do this // it doesn't mark it as a code , anyone knows how to do it with yaml

earnest phoenix
#

it takes a single google search

tender steppe
#

would it be my server my bot is hosted on making it respond slowish?

fierce ether
#

its possible @tender steppe, create a ping time using client.ws to check

tender steppe
#

its hosted in France

#

so could be why

fierce ether
#

where are you based?

tender steppe
#

Canada

fierce ether
#

more then likely

tender steppe
#

purchased a Montreal one last night

#

so hopefully it will improve

solemn latch
#

Under 200ms is perfectly fine for a bot.
Under 400ms is okay, most users won't notice.
500-1000ms is starting to get kinda bad.

tender steppe
#

alright

eternal osprey
#

why is this error occuring?

#
    });
}
if(message.content == "!product19")
    //product 19
    const product19 = new Discord.MessageEmbed()```
#

i am not even using typescript but javascript

hollow sedge
#

Do you need brackets around that if

haughty mirage
#

Shouldn't the ! Be the other side of the =?? Or am I misunderstood your function

eternal osprey
#

hardcoded.

eternal osprey
grizzled raven
mellow kelp
#

wdym "this happens"?

grizzled raven
#

partial user comes from the reaction add event, but they are all the same user

#

so first of all a new user is created with no data, which shouldnt ever happen
then its created again with proper data
but the one that goes off with the event emit is the one with no data

earnest phoenix
#

does anyone know how to Make bot Reply if you mention him

#

bruh who changed my name

quiet arch
#

i just noticed my bot was down. so i logged on heroku and deployed, everyting works no errors i have my worker: node index.js but my bot doesnt go online

kindred niche
#

I need help pls
When i use the quick.db
And run node . in the console
The console logs this error:
Error: Could not locate the bindings file. Tried:

#

I followed the instalation guide two times and re installed everything again

quiet arch
#

is your file in your bot files ?@kindred niche

kindred niche
#

what file

quiet arch
#

the bindings file.

kindred niche
#

the bindings file is into the node modules

mellow kelp
#

check if the message mentions the bot

#

ez

kindred niche
#

Ummm any error?

quiet arch
#

nope

kindred niche
#

Are you using a host right

quiet arch
mellow kelp
#

check the logs

quiet arch
#

ok

#

-----> Node.js app detected

-----> Creating runtime environment

   NPM_CONFIG_LOGLEVEL=error
   NODE_ENV=production
   NODE_MODULES_CACHE=true
   NODE_VERBOSE=false

-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)

   Resolving node version 12.x...
   Downloading and installing node 12.20.0...
   Using default npm version: 6.14.8

-----> Restoring cache
- node_modules

-----> Installing dependencies
Installing node modules

@discordjs/opus@0.3.3 install /tmp/build_2b36b7cd_/node_modules/@discordjs/opus
node-pre-gyp install --fallback-to-build

   [@discordjs/opus] Success: "/tmp/build_2b36b7cd_/node_modules/@discordjs/opus/prebuild/node-v72-napi-v3-linux-x64-glibc-2.27/opus.node" is installed via remote
   added 145 packages in 3.472s

-----> Build

-----> Caching build
- node_modules

-----> Pruning devDependencies
audited 145 packages in 1.199s

   9 packages are looking for funding
     run `npm fund` for details
   
   found 0 vulnerabilities

-----> Build succeeded!
-----> Discovering process types
Procfile declares types -> worker
Default types for buildpack -> web
-----> Compressing...
Done: 26.7M
-----> Launching...
Released v22
https://yarobot.herokuapp.com/ deployed to Heroku

mellow kelp
#

didn't tell you to paste your entire logs but ok

#

and i meant the actual logs

#

not the build logs

quiet arch
#

o

#

hahha

lament rock
#

Just because a build succeeded doesn't mean your bot would totally work logically. We don't need build logs. Console output is very important

quiet arch
#

where do i find my logs?

mellow kelp
#

More -> View logs

quiet arch
#

2020-12-25T22:00:32.497311+00:00 heroku[worker.1]: Starting process with command `node index.js` 2020-12-25T22:00:33.118648+00:00 heroku[worker.1]: State changed from starting to up 2020-12-25T22:00:33.123172+00:00 heroku[worker.1]: Idling 2020-12-25T22:00:33.128171+00:00 heroku[worker.1]: State changed from up to down 2020-12-25T22:00:33.133245+00:00 heroku[worker.1]: Idling because quota is exhausted 2020-12-25T22:00:40.684136+00:00 app[worker.1]: Error waiting for network: Resource temporarily unavailable 2020-12-25T22:05:44.116611+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=yarobot.herokuapp.com request_id=0cb92dd0-ed9a-413f-82e7-4369a85bac14 fwd="80.60.49.118" dyno= connect= service= status=503 bytes= protocol=https 2020-12-25T22:05:44.499934+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=yarobot.herokuapp.com request_id=2992433d-bc24-46e8-aa39-6ec031b211a6 fwd="80.60.49.118" dyno= connect= service= status=503 bytes= protocol=https 2020-12-25T22:05:54.883369+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=yarobot.herokuapp.com request_id=0ed1965e-5768-42d2-b0b2-cab0f6f1a5c8 fwd="35.237.4.214" dyno= connect= service= status=503 bytes= protocol=https 2020-12-25T22:05:55.164792+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=yarobot.herokuapp.com request_id=e4f85c73-04ee-459c-9979-f2e26ba3fc2b fwd="35.237.4.214" dyno= connect= service= status=503 bytes= protocol=https

mellow kelp
#

you must have the wrong dyno on

#

check the resources tab

#

and refresh just in case

quiet arch
mellow kelp
#

um

#

oh

#

you ran out of dynos for the rest of the month

quiet arch
#

o

rustic nova
quiet arch
#

what do i do now?

mellow kelp
#

wait 5 days

quiet arch
#

nooooooooooooo

#

sad hahha

mellow kelp
#

or verify your account with a credit card to get 450 more dynos

quiet arch
#

but when do i lose dyno's?

mellow kelp
#

when your app is running

#

you have a monthly quota

kindred niche
#

i use something.host

quiet arch
#

so it cant run for a full month?

mellow kelp
#

it could

#

but you probably had other stuff running i think

quiet arch
#

o maybe i have 2 apps for 1 bot

hollow sedge
quiet arch
#

i had some issues so i made anotherone

mellow kelp
#

wait really

#

its been some time since i last logged into heroku KEKW

hollow sedge
#

Dynos are like the servers

quiet arch
#

o

earnest phoenix
#

What does Quick.db do?

#

database?

mellow kelp
#

heroku isn't the best option for bot hosting anyways tho

earnest phoenix
#

i never used database i want try it

quiet arch
quiet arch
earnest phoenix
mellow kelp
#

i recently switched to google cloud compute engine

earnest phoenix
#

yeah but free

quiet arch
mellow kelp
#

its not completely free depending on the location

#

but im pretty sure theres a free tier

quiet arch
#

tell me more about it

mellow kelp
#

basically you get your own virtual machine

quiet arch
#

wow

mellow kelp
#

you can access its shell and do stuff there

kindred niche
#

I need help pls
When i use the quick.db
And run node . in the console
The console logs this error:
Error: Could not locate the bindings file. Tried:

quiet arch
#

whott

#

what is the site?

mellow kelp
#

idk

quiet arch
#

breh

mellow kelp
#

search google cloud platform or something

hollow sedge
quiet arch
kindred niche
#

Read the pin messages

#

"3. Get your data/token stolen
a. This issue is practically removed when getting from a trusted source (e.g. AWS / Google Cloud (the free (trials) are relatively bad for hosting bots))"

hollow sedge
#

What's your point

quiet arch
#

i am gonna use heroku then heheheh

kindred niche
#

Idk the top.gg team says google cloud is bad for hosting bots

hollow sedge
#

I'd say they're relatively good

#

That's not from the top.gg team

kindred niche
#

What is not from the top.gg team?

hollow sedge
#

The pinned message

kindred niche
#

Who wrote it?

hollow sedge
#

A bot developer

quiet arch
#

how do i delete my app on heroku?

kindred niche
#

Oh but the top.gg team pinned it

#

not him

mellow kelp
hollow sedge
#

Being a moderator doesn't mean you're on the team

quiet arch
#

ok thx

hollow sedge
#

Also that doesn't mean they agree with every single part of it

kindred niche
#

We dont know who pinned it

earnest phoenix
#

ok then can someone tell me Basics Code of Quick.db

kindred niche
#

i have tryed 3 days to do quick.db

#

i always have errors with bindings

#

im trying to get help

earnest phoenix
#

i never used Quick.db

#

well yeah i am Trash on it

hollow sedge
#

Oh so google cloud isn't good, but quick.db is?

kindred niche
#

Me too, im trying but i have alot of errors in console

lament rock
#

quick.db is just an sql ORM of sorts. SQLite is the actual database, which is very good for structured data storage. quick.db more closely resembles a JS Map than sqlite which makes it decent for beginners.

kindred niche
#

So, how can i get another data base?

mellow kelp
#

search for it

hollow sedge
#

quick.db isn't a database

kindred niche
#

But can save values

earnest phoenix
#

Well Quick.db is what

mellow kelp
#

for example, you can use mysql, mongodb, postgresql, etc

earnest phoenix
#

Mongoose is database

#

Mobgodb

hollow sedge
#

It just simplifies working with SQLite

earnest phoenix
#

npm install mongoose

#

and download Mongodb

mellow kelp
#

mongoose isn't a database

earnest phoenix
#

bruh

kindred niche
#

if i want to save a prefix

#

or a welcome channel id

earnest phoenix
#

t

hollow sedge
#

Ask them to look into databases and find one that fits instead of just saying "install MongoDB"

lament rock
#

Depends on what you're comfortable with. I'd recommend using sqlite, mysql or some other sql database like MariaDB (I would personally recommend over MySQL) but "non file based" databases require additional setup which may be a turn off

quiet arch
mellow kelp
#

refresh the page

quiet arch
#

i did

mellow kelp
#

sometimes that works

hollow sedge
#

What is your procfile

quiet arch
#

worker

hollow sedge
#

(what's inside)

#

Is that it?

#

Just "worker"?

quiet arch
#

worker: node index.js

#

o

#

i just had to w8

#

it works now thx

kindred niche
#

is mongodb a good database?

mellow kelp
#

yea

#

but whether it's practical or not depends on what you're using it with

kindred niche
#

ill use to save discord server data

#

like channel ids or prefixes

mellow kelp
#

well that's fine ig

#

i also use mongodb for my bot

kindred niche
#

oh nice, ill try it!

quiet arch
#

so i wanna check if a user has a role and if yes then add another role

#

i have some code but i dont know in what order to put it in

#
else if (command === "check roles"){
    let role2 = message.member.guild.roles.cache.find(role => role.name === "-------------------colors--------------------");
    let role = message.member.guild.roles.cache.find(role => role.name === "Red");
        if (role) message.guild.members.cache.get(message.author.id).roles.add(role2);
        if (message.member.roles.has(role) {```
mellow kelp
#

godzilla had a stroke reading this and died

quiet arch
#

hehe

#

ok so

#

is there a way that i run a command then it checks for every member in my server if they have a role (in my case ''red'') then give all the people who have that role another role

lucid prawn
#

not sending error

function catchErr (error, message) {
client.users.get("390690088348024843").send () ("There was an error at channel" + message.channel + "in guild" + message.guild);
client.users.get("390690088348024843").send ("ERROR" + error)
}
if (Error) {
console.error(Error, message);
message.author.send(Error)
}```
mellow kelp
#

client.users doesn't have a get() method

#

you're probably looking for client.users.cache.get('user-id') or client.users.fetch('user-id')

#

and Error is a global class, the condition will always be true

lucid prawn
mellow kelp
#

wdym?

lucid prawn
#

on my alt
i get dm
when a do the command and my main get dm too

mellow kelp
#

maybe you got an outdated version?

mellow kelp
lucid prawn
#

yes

mellow kelp
#

there are some bad placed parenthesis somewhere over there

lucid prawn
#

btw that code is connect to my other bot

#

@mellow kelp

lucid prawn
#

this right
const guild = client.guilds.cache.get("id");
?

pale vessel
#

tias

dusky sundial
#

Anyone attempted discord bot development in Julia?

#

Just curious if it's something worth getting into

gilded olive
#

you could check out discords api server

#

Theres a lib there for julia

#

Bruh

lucid prawn
#
function catchErr (error, message) {
client.users.fetch("390690088348024843").send("ERROR" + error) ("There was an error at channel" + message.channel + "in guild" + message.guild);
client.users.get("390690088348024843").send ("ERROR" + error)
catchErr (error) 
console.error(error, message);
message.author.send(error)
}

why is my bot going offline

dusky sundial
#

Is that the code that causes it to go offline?

lucid prawn
#

not really
but that code stop the bot from going offline but is not working
btw it a error handler

#

@dusky sundial

quartz kindle
#

fetch is a promise

#

you have to await it

lucid prawn
#

await is undefind

quartz kindle
#

also, isnt that function an infinite loop?

earnest phoenix
#

make the function async

#

then await for the promise

quartz kindle
#

at the minimum yes

#

you still have to fix the other things

earnest phoenix
#
async function catchErr (error, message) {
    await client.users.fetch("390690088348024843").send("ERROR" + error) ("There was an error at channel" + message.channel + "in guild" + message.guild);
    await client.users.get("390690088348024843").send ("ERROR" + error)
    console.error(error, message);
    message.author.send(error)
}
quartz kindle
#

that still wont work

lucid prawn
#

?

lucid prawn
dusky sundial
#

Also, are you sure you want the bot to send the error message to whoever wrote the command that caused the error?

#

I'm pretty sure you need a way for users to disable that feature, if you want the bot to be approved by top.gg but I might be wrong.

lucid prawn
dusky sundial
#

Cool, just making sure. Can't help too much with the code, I'm not that good at js

#

but I think that message.author.send needs to be awaited aswell

lament rock
#

Promise<User>.send is not a function

#

Promise<Message> is not a function

sterile lantern
#

never used a vps before so ya

#

how would I setup sqlite with it rather

carmine summit
#

@lament rock await it

quartz kindle
#

or using whatever package manager

sterile lantern
#

yeah but I wanna edit sqlite ok it

#

on

#

the db I mean

lament rock
#

Errors wont tell you the resolve type

lucid prawn
carmine summit
#

The promise

lucid prawn
#

message.author.send?

quartz kindle
#

the fetch

#

if you do await a.b.c.d you are basically doing await d

#

but you have a promise in the middle

#

so you need to await it separately

earnest phoenix
quartz kindle
#

for example, imagine that c from a.b.c.d is a promise

lucid prawn
#
async function catchErr (error, message) {
    await client.users.fetch("390690088348024843").send("ERROR" + error) ("There was an error at channel" + message.channel + "in guild" + message.guild);
    await client.users.get("390690088348024843").send ("ERROR" + error)
    console.error(error, message);
    await message.author.send(error)
}
#

😕

quartz kindle
#

you need to either js result = await a.b.c; result.d; or ```js
(await a.b.c).d

lucid prawn
#

ok

quartz kindle
lyric mountain
#

Editing it via terminal is kinda messy

sterile lantern
#

ik I have browser for it but

#

I’ll maybe just switch to mongo

#

mongo seems x10 faster

gilded olive
#

sqlite has a built in browser not so? I use it sometimes

sudden geyser
#

sounds prone to corruption

lyric mountain
#

How would it corrupt? Just do a hash check before and after

#

Never had issues with scp

lucid prawn
# quartz kindle you can await chained promises, thats a different thing

what i need to fix now

async function catchErr (error, message) {
    await client.users.fetch("id").send("ERROR" + error) ("There was an error at channel" + message.channel + "in guild" + message.guild);
    await client.users.get("id").send ("ERROR" + error)
    console.error(error, message);
    await message.author.send(error)
}
quartz kindle
#

you just broke it even more lol

pale vessel
#

nice

lucid prawn
#

how

#

@quartz kindle

wicked sapphire
#

Is there a way to increase the rate at which your bot can react to messages with multiple reactions?

earnest phoenix
#

You can use await functions or .then functions.

wicked sapphire
#

When I ran the help command for some bots, they react with a series of reactions with a delay between each less then half a second.

lyric mountain
#

I mean, you could probably fine tune the time between requests and sacrifice overall reactions/min

#

Some libs add a delay between each request

lament rock
#

Discord has it's own rate limit buckets per route and also global. To avoid tokens being reset, you should never attempt to circumvent rate limit buckets

wicked sapphire
#

I think I found out how to react them faster.

      msg.react('🛡')
      setTimeout(() => msg.react('🐱'), 400)
      setTimeout(() => msg.react('⚔'), 800)
      setTimeout(() => {msg.react('💙')}, 1200)

Using setTimeout(), and by increasing the delay by the same amount, giving me faster reaction times.

lament rock
#

You run the possibility that reactions will appear out of order by race conditions that way

pale vessel
mellow kelp
#

is it recommended?

#

or should i just leave it as the default value

pale vessel
#

I put 200

mellow kelp
#

o

pale vessel
#

It should be fine unless you have a bad connection

mellow kelp
#

well, guess setting it to 300 should be fine

summer torrent
#

same

wicked sapphire
sterile lantern
rustic nova
#

depends on what your bot does

sterile lantern
#

so what would the above be suitable for

#

my bot does economy (takes db values changes them etc) and some logs

lament rock
#

You'll wanna run some local tests to see just how much you are actually consuming in testing then perhaps do some testing under the live token to populate caches (if you have any). If your bot doesn't have any user search functionality, you can cut down on a LOT of memory and cpu usage by disabling some intents you really do not need and also potentially switching to modular libraries so that you can control your cache

stuck pike
#

whats wrong

#
const db = require('quick.db');
const rs = require('randomstring');

module.exports = {
  name: "setup",
  description: "info",

  async run (client, message, args){
 

    let permcheck = new Discord.MessageEmbed()
    .setColor('#e64b0e')
    .setDescription(`You Don't Have Permission To Do This`)

    if(!message.member.hasPermission('ADMINISTRATOR')) return message.channel.send(permcheck)

    let setupcheck2 = new Discord.MessageEmbed()
    .setColor('#e64b0e')
    .setDescription(`This Server Has Already Been Setup`)


  message.guild.roles.create({
    name: 'Support Team',
    color: 'BLUE',
    permissions: ['MANAGE_MESSAGES', 'KICK_MEMBERS']
  })
    .then(role => console.log(`Created new role with name ${role.name} and color ${role.color}`))
    .catch(console.error)

    let categorycreate = new Discord.MessageEmbed()
    .setColor('#e64b0e')
    .setTitle(`Server Setup Successfully`)
    .setDescription(`Support Team Role: **Support Team** | Open Ticket Category: **Tickets** | Closed Ticket Category: **Closed Tickets**`)

    var name = `Tickets`;
    message.guild.channels.create(name, { type: "category" })

    var name = `Closed Tickets`;
    message.guild.channels.create(name, { type: "category" }).then(
      (chan2) => {
        chan2.overwritePermissions(message.guild.roles.cache.find('name', '@everyone'), {
          'SEND_MESSAGES': false
        }
        )})
#

    var name = `ticket-logs`;
    message.guild.channels.create(name, { type: "text" }).then(
      (chan) => {
      chan.overwritePermissions(message.guild.roles.cache.find('name', '@everyone'), {
         'VIEW_CHANNEL': false
      })
      chan.overwritePermissions(message.guild.roles.cache.find('name', 'Support Team'), {
          'VIEW_CHANNEL': true
      })
        let category = message.guild.channels.find(c => c.name == "Tickets" && c.type == "category");
  
      chan.setParent(category.id)
      chan.setTopic('Ticket Logs Channel For Support Tickets Bot')

      
    })
}
}```
sudden geyser
#

Show line 42

stuck pike
#
          'SEND_MESSAGES': false
        }
        )})```
#

this

mellow kelp
#

sad src folder noises

sudden geyser
#

.find takes a function

#

You’re using a removed version of the method’s syntax

stuck pike
#

o so how to fix it

#

i spend a lot of timr fixing iy;-;

mellow kelp
#

pass a function instead

stuck pike
#

lemme see

mellow kelp
#

which must return true for the value you want to find

sudden geyser
stuck pike
#
module.exports = {
  name: "rolesetup",
  description: "info",

  async run (client, message, args){

   message.guild.roles.create({
      name: 'Support Team',
      color: 'BLUE',
      permissions: ['MANAGE_MESSAGES', 'KICK_MEMBERS']
    })
      .then(role => console.log(`Created new role with name ${role.name} and color ${role.color}`))
      .catch(console.error)```




  }}
#

it doesnt show an error

#

but doesnt make the role as well

clear marlin
#

Hierarchy error maybe

#

No sorry.

#

Oof, I didn't read the whole thing.

stuck pike
#

wdym

clear marlin
#

I thought you were giving a role.

#

So, in that case it must've been an hierarchy error i.e., the bot role is at a position below the role which is to be given.

stuck pike
#

it has the highest role lol

clear marlin
#

Oof

stuck pike
#

it makes the channel but doesnt set permissions

crimson vapor
stuck pike
#

everyone role

#

i made a const

crimson vapor
#

oh right I didn't see that

#

check if everyone is undefined

stuck pike
#

const everyone = message.guild.roles.cache.find(r => r.name === '@earnest phoenixryone');

#

@crimson vapor

crimson vapor
#

yeah but if it is coming back undefined that could cause the error

lament rock
#

the everyone role's ID is always the guild's ID

#

:)

crimson vapor
#

im not too good on roles

#

but it should be

pale vessel
#

You can just put the guild id if you don't need the role

earnest phoenix
#

Hi I want to keep meme in different section what name should i keep for that section? any suggestions

clear marlin
#

mems and media

#

but again, this aint the right place to ask about that

earnest phoenix
#

It doesn't comes under development?

clear marlin
#

Are you talking about bots, or about your server?

old cliff
#

owerwritePermissions is from djs 11

stuck pike
#

aaaah thanks a lot

old cliff
#

also find takes a function

stuck pike
old cliff
#

make it ```js
message.guild.roles.cache.find(r => r.name == '@everyone')

earnest phoenix
#

I would like to know how to check if server ID is valid or not?

near stratus
earnest phoenix
#

got it

lament rock
#

message.guild.roles.everyone

wheat valve
#

Whats the main differences between discord.js and discord.js-light? What would you have to change when switching? And last question, is there any sort of guides/docs for discord.js-light? Ping me with any responses, please.

earnest phoenix
#

I want to hide a addfield in embed if the user is bot else display that addfiled.

#

How to do? Any idea?

pale vessel
#
const embed = new MessageEmbed();

embed.addField();
if (!user.bot) embed.addField();
embed.addField();

send(embed);```
honest perch
#

I suggest actually reading the readme

wheat valve
#

Alright, thank you

humble rock
#

I'm doing a discord dashboard, But when i tried to use button "authorize" in the redirect page, the console logged this: (sorry for my english)

TokenError: Invalid "redirect_uri" in request.
#

pls

boreal pewter
#

uhm

#

i have a working bot with dashboard

#

u need to supply more info but in general its probably a mismatch between the configured redirect urlk

marble juniper
#

read what the error says

#

lol

clear marlin
#

Ello

#

Ello

boreal pewter
#

between the configured redirect urll and the url u actually redirected to

humble rock
boreal pewter
#

i have a working bot with django backend dashboard that calls db via django orm, if anyone is interested lemme know (took me some time to find out the best practices)

clear marlin
#

Woah, a bot with a dashboard.

#

Must be in python?

marble juniper
#

no

boreal pewter
#

yep

clear marlin
#

Cause you are using django

boreal pewter
#

its nice too cause django comes with built in admin panel

clear marlin
#

I have no experience with python, tbh. I tried a dashboard with express but failed miserably

marble juniper
#

read

#

the

#

error

honest perch
#

You need to add the redirect to your app on discord

#

How hard is it

marble juniper
#

smh

boreal pewter
# humble rock eeehm.... help me pls

it seems you arent followin the docs properly, i used a 3rd party lib in my project to handle what u are trying to accomplish so i cant really help u

humble rock
boreal pewter
#

because you have sync to async issues

humble rock
clear marlin
honest perch
#

Make sure its actually redirecting to that then

humble rock
#

is ok

#

i saw now

clear marlin
#

Oof, I can't even read the error

#

On your terminal

humble rock
#

@clear marlin like this

TokenError: Invalid "redirect_uri" in request.
    at Strategy.OAuth2Strategy.parseErrorResponse (C:\Users\federica\Desktop\Dashboard\Dashboard\node_modules\passport-oauth2\lib\strategy.js:358:12)
    at Strategy.OAuth2Strategy._createOAuthError (C:\Users\federica\Desktop\Dashboard\Dashboard\node_modules\passport-oauth2\lib\strategy.js:405:16)
    at C:\Users\federica\Desktop\Dashboard\Dashboard\node_modules\passport-oauth2\lib\strategy.js:175:45
    at C:\Users\federica\Desktop\Dashboard\Dashboard\node_modules\oauth\lib\oauth2.js:191:18
    at passBackControl (C:\Users\federica\Desktop\Dashboard\Dashboard\node_modules\oauth\lib\oauth2.js:132:9)
    at IncomingMessage.<anonymous> (C:\Users\federica\Desktop\Dashboard\Dashboard\node_modules\oauth\lib\oauth2.js:157:7)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1224:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
#

noice

#

i fix it

boreal pewter
#

gj m8 glad 2 hear

clear marlin
#

Yeah

earnest phoenix
#

Do you guys know a good platform I can use to deploy quick test instances of nodejs?

#

and ability to edit files

#

preferably free

#

just need to run it 10-15 mins at a time

#

Wont be used for prod

split hazel
#

visual studio code? lol

#

it has a run npm script feature via gui and a command line with an editor + proprietary ssh support so yeah

summer torrent
earnest phoenix
#

@split hazel I need it to be accessible by internet

#

dont wanna portforward on my network

split hazel
#

It's really best you install the plugin onto your visual studio code, it will then launch a separate version with all your plugins and themes launched from the server but if you really insist it being available over http (with a password) https://github.com/cdr/code-server

GitHub

VS Code in the browser. Contribute to cdr/code-server development by creating an account on GitHub.

earnest phoenix
#

AH, glitch

summer torrent
earnest phoenix
#

I was looking for glitch

cinder reef
#

have you guys tried the slash feature?

earnest phoenix
#

djs doesnt support yet

#

so i havent

split hazel
#

glitch isn't great because it has no intellisense but I'm guessing that's fine

cinder reef
#

no api support it

earnest phoenix
#

Dont need intellisense

cinder reef
#

i've made my own api for now

summer torrent
cinder reef
#

and it's so good

cinder reef
split hazel
#

yes I tried it and it's extremely basic

#

we have to wait until more gets added to it

summer torrent
cinder reef
#

yeah it's basic but it's better than before

#

a step in the right direction

#

tbh i'm probably too hype for that

summer torrent
split hazel
#

I'll still add it to my mod bot rewrite but I'll only consider using it if they add something like silent commands

summer torrent
#

silent?

split hazel
#

yes no trigger message or response

cinder reef
summer torrent
#

discord.js doesn't support yet

cinder reef
#

yes

split hazel
#

discord js has tons of contributers looming over the repo waiting for discord to release a new feature

cinder reef
#

at least someone did something on it

summer torrent
#

^

summer torrent
#

(private property of client)

cinder reef
#

discord.net and dsharpplus don't have the reply feature yet :/

pulsar bone
#

hey how to make bot react to message that is sended after the command message by someone else in python

earnest phoenix
#

Guys how to rename channel after lockdown

#

And remove when unlocked.

#

Any help is appreciated.

tribal siren
#

i tried doing member.user.presence.game

#

it didn't work :c

elder loom
#

what library are you using? @tribal siren

cinder reef
#

@zinc fable ?

tribal siren
#

?

#

ex dee

#

why do people spam lol

#

mute him

cinder reef
#

@weak parrot ?

tribal siren
#

type a message and you gay

#

@proud folio

cinder reef
#

banned

weak parrot
#

Nice

cinder reef
#

so, @tribal siren

#

wait what?

tribal siren
#

oh

#

ye that's better

tribal siren
elder loom
tribal siren
#

xyes

cinder reef
tribal siren
#

bruh lol yes

cinder reef
tribal siren
#

ill try

cinder reef
#

then you eval the member.user.presence.activity what do you get?

tribal siren
#

let's look

#

oops sorry

#

@cinder reef

cinder reef
#

and message.author.presence ?

tribal siren
cinder reef
#

you don't have the presence, wierd

#

it's in the activities anyways

pulsar bone
#

hey how to make bot react to message that is sended after the command message by someone else in python

tribal siren
#

there is such a thing called documentation

#

read it, it's cool Like

pale vessel
#

what is that

earnest phoenix
#

Guys how to show moderation bot in all channels? including private?

#

ping

#

my trial bot has all perms except administrator

obtuse niche
#

Wdym

earnest phoenix
#

my demo bot is not showing in channel which has permission for few.

#

better to say private

toxic jolt
#

i how to fix pls help

cinder reef
earnest phoenix
#

as can u see glitch

#

idrk why

toxic jolt
#

i using glitch

cinder reef
cinder reef
earnest phoenix
old cliff
#

hmm my nitro still exists

#

idk why

#

wtf HTTPError [FetchError]: request to https://discord.com/api/v7/gateway/bot failed, reason: getaddrinfo EAI_AGAIN discord.com at RequestHandler.execute (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:93:15) at processTicksAndRejections (internal/process/task_queues.js:93:5) { name: 'FetchError', code: 500, method: 'get', path: '/gateway/bot' }

#

wtf does this error mean ?

modern sable
#

pretty sure v7 isnt a thing

old cliff
#

omg my discord.js broken

modern sable
#

probably just update it

old cliff
#

its 12.4.0

#

maybe 12.5.1 will work

flint aspen
#

How does ln get this message in blue to add our bot?

#

@modern sable please help me

modern sable
#

[text](link)

young flame
lusty quest
#

did you made this manually?

tribal siren
#

it's moon chan ofc he did

earnest phoenix
#

hi

tribal siren
#

hello

#

so i got one problem

lusty quest
#

well i would rather make it dynamic

tribal siren
#

how to get the nickname of a user?

#

message.author.nickname doesn't seem to be corret

lusty quest
#

per server or global?

tribal siren
#

per server

earnest phoenix
#

@tribal siren it's a User object

lusty quest
#

user.username

tribal siren
#

it's username

#

i need nickname

earnest phoenix
#

you need to get the GuildMember object of the message to get the nickname

#

(nicknames don't exist outside guilds)

tribal siren
#

ye

earnest phoenix
#

message.member.nickname or smth i dont remember

gusty quest
#

how can i make filter so i maded like command with reactions and whenver someone press it works? here is part of the code ```const filter = (reaction, user) => user.id !== message.client.user.id;
var collector = playingMessage.createReactionCollector(filter, {
time: 8.64e+7
});
collector.on("collect", (reaction, user) => {
const member = message.guild.member(user);

    switch (reaction.emoji.name) {
        case "🔇":
            reaction.users.remove(user).catch(console.error);
      // code
        break;
        case '🔈':
        reaction.users.remove(user).catch(console.error);
    // code
        break;

        case '❌':
        reaction.users.remove(user).catch(console.error);
        // code
        break;
    }
#

i want to make it only who send message command works

#

do u get me 😄

#

not for everyone

tribal siren
#

imagine making a bot that replies with h when you say h and getting a whole bot developer role

earnest phoenix
tribal siren
#

ok thanks

gusty quest
#

help :{

tribal siren
gusty quest
#

no

#
        var playingMessage = await message.channel.send(embed);
        await playingMessage.react("🔇");
        await playingMessage.react("🔈");
        await playingMessage.react("❌");
    } catch (err) {
        console.log(err)
    }
    const filter = (reaction, user) => user.id !== message.client.user.id;
    var collector = playingMessage.createReactionCollector(filter, {
        time: 8.64e+7
    });
    collector.on("collect", (reaction, user) => {
        const member = message.guild.member(user);

        switch (reaction.emoji.name) {
            case "🔇":
            reaction.users.remove(user).catch(console.error);
            // some random text here
            break;
            case '🔈':
            reaction.users.remove(user).catch(console.error);
            // some random text here
            break;

            case '❌':
            reaction.users.remove(user).catch(console.error);
            // some random text here
            break;
        }
    })
}

}```
#

@tribal siren

#

i can share u entire cmd

#

in dms

tribal siren
#

that's not how it works

gusty quest
#

?

#

code is working

tribal siren
#

and i think it's not break, it's return

gusty quest
#

i jsut want to make ti

#

code is working

#

dont worry for that

#

i dont want that

tribal siren
#

if it is working then why do you ask for help

gusty quest
#

i want to make only who send message

#

i asked for help

#

So you see

tribal siren
gusty quest
#

when bot sends message and u someone random react to it

#

its working

#

i want to make

#

only who send message to work

#

do you understand me
?

earnest phoenix
tribal siren
#

oh it's a collector

#

sorry didn't see

gusty quest
#

yes

#

there is an collector

tribal siren
#

well i do not know much about collectors so

#

¯_(ツ)_/¯

#

bye

gusty quest
#

i just want to make filter

#

only the one who sends the messages code will work

#

any ideas how to do that D:

toxic jolt
#

im getting a ddos?

marble juniper
#

lol

#

no

#

a ddos is

#

something different

ancient crow
#

Hi

tribal siren
ancient crow
#

does anyone knows about yaml?

#

in js // this is for ignore the code how to do it on yaml?

tribal siren
#

idk

ivory seal
#

is there a limit on .cache

tribal siren
#

let pinn = message.guild.messages.cache.get(args[0])

#

how to fix this

summer torrent
#

there is no message.guild.messages

#

messages are caching per channel

tribal siren
#

how to do it properly then?

ivory seal
#

message.channel ig

#

can u get all the guild members with .fetch?

#

cause cache returns

#

invalid many times

#

i think there's a limit or smth

tribal siren
#

i think it should work with cache

#

something's actually wrong

ivory seal
#

nope it returns with undefined

#

in a 300k server

pale vessel
#

if you want to cache all members just set fetchAllMembers to true in ClientOptions if you have the guild members intent

ivory seal
#

oooo ok thanks a ton

#

and once i do that

#

i can use

#

message.guild.members.cache.forall

#

right?

sand condor
#

?

ivory seal
#

once i enable the fetchallMembers then i can do message.guild.members.cahce.forEach

#

sorry put forall on accident

quartz kindle
#

yes

pale vessel
#

cahce yes

#

lul

quartz kindle
#

cahce > cache

#

its the same but faster :^)

ivory seal
#

lol

#

sorry spelling mistake

crystal wigeon
#

hey guys

#

umm

#

quick question

misty sigil
#

what is it

crystal wigeon
#

how do you scale your discord bot for 100k users? like i cant put it behind a load balancer can i?

misty sigil
#

100k users?

crystal wigeon
#

yeah

misty sigil
#

thats like nothing

gusty quest
#

i want to make this to only who send message emojis should work, so if someone react to this message when bots sends it will work so i want to make it to not do that i want it only for message sender ```try {
var playingMessage = await message.channel.send(embed);
await playingMessage.react("🔇");
await playingMessage.react("🔈");
await playingMessage.react("❌");
} catch (err) {
console.log(err)
}
const filter = (reaction, user) => user.id !== message.client.user.id;
var collector = playingMessage.createReactionCollector(filter, {
time: 8.64e+7
});
collector.on("collect", (reaction, user) => {
const member = message.guild.member(user);

    switch (reaction.emoji.name) {
        case "🔇":
        reaction.users.remove(user).catch(console.error);
        // some random text here
        break;
        case '🔈':
        reaction.users.remove(user).catch(console.error);
        // some random text here
        break;

        case '❌':
        reaction.users.remove(user).catch(console.error);
        // some random text here
        break;
    }
})

}

}```

crystal wigeon
#

i have a basic VM tho 3.75GB RAM 1 CPU on GCP

misty sigil
#

same and i have like 200k users

#

with loads of space to grow

crystal wigeon
#

ohw

#

but i also have postgres on the same VM

#

so i feel like it'll slow down?

misty sigil
#

i've got mongo, a lavalink node, another bot and a few other things

crystal wigeon
#

woah okay lets see if my bot lags

misty sigil
#

should be good

crystal wigeon
#

i got lavalink too btw forgot to mention it

#

but even tho if i wanted it to scale

#

i cant spawn multiple instances because i can only have 1 bot instance

misty sigil
#

shards?

crystal wigeon
#

idk about it, im checking

#

i learnt a lot of new stuff creating a discord bot 😄

crystal wigeon
gusty quest
#

Okay

lusty quest
#

i start to hate frontend work even more. started to get into react but then you realize that you also probably want to know how to properly use oauth2 for discord login, when you got this set in the backend you still have to figure out how to deal with the stuff like seasons frontend (to protect certain routes to get accesses without an active season) and a lot of other stuff.
additional i suck at frontend

crystal wigeon
#

i recommend nextjs, it goes well with express and react, plus it gives you that dynamic filename routing which you can easily restrict by cookies and your own auth logic.with discords login

lyric mountain
#

You'll most likely never ever have all 100k users cached

#

The issue is servers actually

lusty quest
#

yea

#

100k users are easy to handle

crystal wigeon
#

i see

lusty quest
#

if you use js and are still worried i can recomend d.js-light, with this you can disable caching of users for the most part

lyric mountain
#

I use sqlite for profile caching, it makes tens of thousands of transactions per second and didn't feel a thing

#

Databases are monsters when it comes to io

crystal wigeon
#

yeah SQL is way more faster than NoSQL i had to redesign everything because i migrated from mongoDB ;-; the computations were so slow

#

15x faster i'd say

lyric mountain
#

Depends actually

stuck pike
#

bot dashboard?

lyric mountain
#

The thing is that sql is made for server-side computations and complex relationships

stuck pike
#

any idea how it works

lusty quest
#

use MERN stack as example for a Dashboard @stuck pike

crystal wigeon
#

well maybe its because i was using free version of mongoDB where ihad like 100k documents but the size it showed me was like 100kb bruh but it still took like 2mins to execute a query where as postgres took 2secs max also i was dealing with relations a lot so using mongo was a bad idea for me

lusty quest
lusty quest
stuck pike
#

k

#

is it hard lmao

#

never went in web side

crystal wigeon
#

you tryna build a dashboard for your bot?

pale vessel
#

but you have at least went in the weeb side

crystal wigeon
#

xD

lyric mountain
#

For me I used react + websockets

stuck pike
#

uff

#

seems hard

lusty quest
#

i started making a dashboard a few days ago, and i hate frontent its so annoying to be forced to make something look good

lyric mountain
#

Yeah

pale vessel
#

ahem CSS

stuck pike
#

ik a bit off css and ract.js

lyric mountain
#

That's one issue I faced

stuck pike
lyric mountain
#

I'm horrible at designing stuff that look cool

pale vessel
#

Cascading Stupid Shit

crystal wigeon
#

the worst issue i faced was designing cross platform compatible frontend 😂

#

bruh like it looks good on android but if i open safari

#

all jacked up

pale vessel
#

Eh, I won't mind

lyric mountain
#

Safari is not a browser

#

It's bullshit

stuck pike
#

chrome is home

pale vessel
#

safari is shit anyway

stuck pike
#

yea

pale vessel
#

You just have to support chromium based and firefox

crystal wigeon
#

yeah

lusty quest
#

firefox is now chromium based

crystal wigeon
#

but the suffering tho

pale vessel
#

oh fuck

crystal wigeon
#

safari legit didnt support grids

stuck pike
#

lemme waste my time in dashboard uff

crystal wigeon
#

css grids

mighty quiver
#

how to make a bot respond to me only.... on python

pale vessel
#

I mean top.gg's site doesn't even work on safari for some iPhones

lyric mountain
mighty quiver
#

i dont want it to respond to others

sudden geyser
pale vessel
stuck pike
#

in js we pass our id

mighty quiver
#

return

pale vessel
#

yes

mighty quiver
#

ok ty...

lyric mountain
#

Dot dot dot

stuck pike
#

lawl

flint aspen
#

How i make this fort à link un message ?

summer torrent
mighty quiver
#

it didnt work..... fml..... can someone pls dumb it down for me again?

#

@client.command()
async def de(ctx,*,args):
await ctx.send(args)

#

i want this

#

to

#

work for me only

sudden geyser
#

There’s a check decorator provided by the library to restrict a command to yourself only

mighty quiver
#

oh

earnest phoenix
mighty quiver
#

im not the owner in this case

#

but ill be back after i read what youve sent me

#

brb

earnest phoenix
#

but you code the bot?

mighty quiver
#

no

#

i figured i could just pass my id instead

#

async def is_owner(ctx):
return ctx.author.id == 316026178463072268

@client.command()
@client.check(is_owner)
async def de(ctx,*,args):
await ctx.send(args)

lyric mountain
#

Wait

mighty quiver
#

this isnt working

#

yes?

lyric mountain
#

You're not the owner

#

But you want to lock a command to u

earnest phoenix
#

how are you not the owner of the bot?

lyric mountain
#

What are u doing exactly? Self-destruct button?

mighty quiver
mighty quiver
lyric mountain
#

Weird use-case but ok