#development

1 messages · Page 32 of 1

quartz kindle
#
What does this do?
This tool redirects Top.gg webhooks to a discord webhook.
This tool does not give your bot an event to give a reward to the user. If you want to give a user a reward you'll want to create your own webhook. https://docs.top.gg/
#

This tool does not give your bot an event to give a reward to the user. If you want to give a user a reward you'll want to create your own webhook.

#

to make your own webhook, the webhook URL should be http://YOUR_VPS_IP_ADDRESS:YOUR_APP_PORT/YOUR_APP_POST_PATH

tawdry bridge
#

@quartz kindle Can u tell me how to log votes?

pine nova
#

💀

quartz kindle
tawdry bridge
quartz kindle
#

no

#

the webhook URL should be http://YOUR_VPS_IP_ADDRESS:YOUR_APP_PORT/YOUR_APP_POST_PATH

quartz kindle
#

?

tawdry bridge
quartz kindle
grim aspen
#

Poor Tim

rose mesa
#

Anyone know who to ask to re-invite bot? 🤔

grim aspen
#

You mean like a specific bot?

sharp geyser
quartz kindle
sharp geyser
quartz kindle
sharp geyser
#

same with a woman

quartz kindle
#

lmao

sharp geyser
#

Great convo

quartz kindle
#

the documentary was great

sharp geyser
#

We just debunked the entire argument on what a women is in a matter of seconds

quartz kindle
#

discord.js vs slash commands webhook server

sharp geyser
#

djs looks better

quartz kindle
#

lmao

rose mesa
graceful cobalt
#

How do I make a vote reminder?

lyric mountain
#

have an event fire every N minutes and check for users with lastVote distance higher than 12 hours

radiant kraken
ancient nova
#

I was able to get 2 out of 3 intents, I'm going to have to come up with something unique to get the presence intent

lyric mountain
#

why do you even need it?

sudden geyser
#

"Unfortunately, I am denying" sounds so off

frigid robin
#

Is this the only way to create a 2-word command like [botprefix] disable global

#

looks super weird to me

#

and I don't wanna read the message content for the commands - it's what I'm trying to avoid atm

lyric mountain
#

well, I guess

#

or you could make ur own command parser

frigid robin
#

how? not based on on_message()?

#

will slash commands allow to have multiple words? thinking_ezreal
though when I tried switching to slash I had some issues with my code

lyric mountain
#

slashes allow up to 3 levels of nesting

frigid robin
#

oh nice

lyric mountain
light ingot
lyric mountain
#

the command parser has to obviously be triggered from a message event

light ingot
frigid robin
#

that means basically a bunch of IFs, a switch case or a dictionary with mapped functions, all of which defeat the purpose of improving performance I believe, am I wrong?

#

I think that also answers @light ingot 's comment

light ingot
#

yeah tho

light ingot
#

involves if statements :/

lyric mountain
#

nope

#

I mean, maybe some for type checking, but zero for command checking

light ingot
#

at least in discord.js

lyric mountain
#

you're thinking about ```
if (command === "stuff") {
...
} else if (command === "otherstuff") {
...
} else if (command === "morestuff") {
...
} else if (command === "thatstuff") {
...
}
...

#

I absolutely don't mean that

light ingot
#

yeah

lyric mountain
#

that isn't a command handler

#

that's a shitty job

light ingot
#

yeah i know

lyric mountain
#

no you don't lmao

light ingot
#

that's just for a single command

frigid robin
#

the thing is that my on_message is unfortunately my most hungry function due to the nature of my bot, so I'd prefer to be able to fire any other events directly rather than go through it every time

#

how would u check the command with good performance KuuHaku?

lyric mountain
#

to properly make a command handler u won't be using if clauses to check if X is command Y

#

you'd use annotations coupled with reflection

light ingot
#

it only checks if the sent message starts by the prefix and is it an actual command or not

lyric mountain
#

that is pretty much unavoidable

quartz kindle
#

technically speaking, an if else chain will always be faster than reflection

#

but not worth the maintainability hell

light ingot
#

well my bot doesn't really lag tho
and i use tons of if else statements

#

basically everywhere in my bot

frigid robin
#

I guess changing to async postgres would also improve my performance, they claim by about 3 times

lyric mountain
#

ifs aren't a performance issue, they're the lowest level of conditional execution

quartz kindle
#

those are not the kind of things that actually matter in terms of performance, so its pretty much do whatever you prefer

light ingot
#

oh

#

i see

lyric mountain
#

because, as you see, python is monothread like js

frigid robin
#

btw just for my understanding, any blocking command blocks the current event loop (for example the event fired for the message that was just sent), or is it blocking any other incoming events?

#

yeah I thought about multiprocessing

lyric mountain
#

you can't

#

I mean, u can, but it'll be like in js where u spawn separate processes

quartz kindle
frigid robin
lyric mountain
#

is your database local?

frigid robin
#

it's not local but it's local relative to where its hosted

quartz kindle
#

if you connect to it via http/sockets, its already async

frigid robin
#

I use psycopg2

lyric mountain
quartz kindle
#

async is anything that needs to wait until it receives a response, it doesnt necessarily need the async keyword. for example, a callback can also be async

lyric mountain
quartz kindle
#

in js everything that connects to the internet or to your disk its async by default

frigid robin
lyric mountain
#

it's python tim

frigid robin
#

yeah its the python that blocks not the db

quartz kindle
#

python should be the same

lyric mountain
#

it is, they're probably awaiting the result

lament rock
#

python does have a lot of blocking things in it

quartz kindle
#

does python do blocking I/O?

frigid robin
lyric mountain
#

and use indexes

frigid robin
#

yep yep i do use an index

lyric mountain
#

if you see NATURAL anywhere ir ur EXPLAIN PLAN that's something to worry

frigid robin
#

since I literally run Levenshtein distance query on every message unless it would be a command now

lyric mountain
#

now wtf

frigid robin
#

it's inevitable

lyric mountain
#

levenshtein is HEAVY depending on whether ur doing it for every message

frigid robin
#

well messages less than 255 chars

#

I know u hate DMs but I can't explain here exactly what I'm doing or what because it would be a great idea for people to steal

#

despite the heavy resource usage

lyric mountain
#

a thing u could do to lighten the processing is checking if message.length >= shortestCommand.length and message.length <= longestCommand.length

lament rock
#

dammit. There goes my chance at another bot idea

#

thwarted again!

frigid robin
#

haha

quartz kindle
#

lol wut

lyric mountain
#

levenshtein can halt your process easily, especially on python/js

lament rock
#

jk my vms are already stuffed to capacity

frigid robin
#

the levenshtein runs on the databable

quartz kindle
#

depends, levenshtein can be quite fast

#

i use it a lot as well

lyric mountain
#

not if ur checking for every single message

frigid robin
#

the query takes about 200/300ms

quartz kindle
#

depends what you're checking it against

lyric mountain
#

all commands

quartz kindle
#

if you have 50+ commands then yeah lol

frigid robin
#

not all commands

#

no it's much worse

#

it runs against thousands of messages

quartz kindle
#

why lol

lyric mountain
#

ok so, here's the first bottleneck

frigid robin
#

well the bot it not yet slow

#

but i hope it wouldn't become slow so fast

lyric mountain
#

how many servers?

frigid robin
#

but if it does I can basically tell it to look at the first X messages

#

not many, 113

#

not really advertising it

quartz kindle
#

what exactly does you bot do?

lyric mountain
#

you should be worried if it's already presenting performance issues at 113 guilds

lament rock
#

The workflow could probably be optimized

frigid robin
#

it tries to mimic a human in the server

#

it can be taught to say specific things

lyric mountain
#

ah so a chatbot

frigid robin
#

yes

#

but the users can teach it stuff

#

u tell it what to reply to which message

#

now levenshtein is used to check if ur msg has typos

lyric mountain
#

well, there's a reason "neural networks" exist

lament rock
#

Trying to apply standard logic to "AI" doesn't work out well

lyric mountain
#

they were basically made for exactly that

lament rock
#

you need a workflow for pattern recognition

frigid robin
#

hmm

#

that is kind of a side project i have, i bet working with neural networks means i have to get a degree lol

lyric mountain
#

it's a veeeeeeeeery complex study to make something like that work

lament rock
#

python is a good language of choice for that since it's heavily math based, but how you're going about it isn't ideal

quartz kindle
lyric mountain
#

and you're constrained to a closed domain

lyric mountain
#

the cost in size will be, tho, O(n!)

frigid robin
#

you think it'd work better though? To have maybe hundreds of thousands of messages rather than thousands?

quartz kindle
#

depends what you're checking against

frigid robin
#

checking whether the message is similar to any other message

#

by a distance that I calculate based on how long the message is

#

so if ur message is 40 chars long i accommodate for more typos

lament rock
#

that's why you need pattern recognition because that falls apart if you word a sentence differently

quartz kindle
#

well, if you try to generate a table of all possible variations, and if this table gets bigger than a few thousands or tens of thousands of entries, then its not worth it

lyric mountain
quartz kindle
#

so yeah, depends on what you're matching

lyric mountain
#

that if we're only counting the characters inside the text

#

else u get 26 possible chars per char

frigid robin
#

well levenshtein simply checks how many character changes need to be done to make it like the word absolutely

quartz kindle
#

like i was thinking about the common censor filters people use, that match for common variations of fuck for example

#

which is not all permutations of the word, just the common ones

frigid robin
lyric mountain
#

leven is probably better, u just need to optimize it

#

you can also use heatmap-based analysis

#

like, store all typos and check the most common first

frigid robin
#

The distance is calculated as follows:
round(np.max(np.rint(np.nan_to_num((0, np.log10(msg_length - 2.5)*2.2)))))
this leads to a gradually growing allowance of typos for longer messages
Then the query is
SELECT reply FROM guildmessages WHERE guildid = %s::VARCHAR AND levenshtein(%s, message) <= %s::INTEGER ORDER BY RANDOM() LIMIT 1

lyric mountain
#

for example, use leven to compare, if it matches, add the matched message to the database

frigid robin
#

or u mean do it in the same query

frigid robin
#

I like that idea

lyric mountain
#

you'd have 2 tables: the main containing the actual triggers and the auxiliar (heatmap) containing the typos and their matches

#

check first the heatmap table (sorted by number of occurences, descending) to see if one matches

frigid robin
#

currently I first check if there's an exact match, then if there's a similar reply

lyric mountain
#

if it does, use the matched result, else levenshtein the main table

frigid robin
#

then if there are replies taught on other servers (could be enabled or disabled in the bot)

lyric mountain
#

that way u can have a list of common typos without having to populate it beforehand

fickle arch
#

bruh, how do I fix this, I haven't touch this project for like few months

lyric mountain
#

space before json

frigid robin
lyric mountain
#

I mean, the double space between token in gives it away

lament rock
#

Kuu lives here for support

fickle arch
#

I just open the project and not touching anything yet

frigid robin
#

Well I need to see how to store the heatmap with the rest of the real messages, because they are based on guild id, and then I'd have to store the typo ones for a specific guild, and that could create issues

lyric mountain
frigid robin
#

maybe the heatmap will be global to all guilds idk

lyric mountain
#

it'll be only used for lookup anyway

fickle arch
lyric mountain
#

still check for guild, but after you find a match

lyric mountain
#

that lib is outdated af

fickle arch
#

aaaa

#

That's why

lyric mountain
#

are u using erela.js btw?

fickle arch
#

yeh on some of the package

lyric mountain
#

that lib wasn't update since last year

#

you're the second person to come here with petitio + erela issues

fickle arch
#

I see

lyric mountain
#

there are probably alternatives to it, just give it a search like "node alternatives to erela.js"

lament rock
#

erela is still being maintained btw

lyric mountain
#

not the one in npm

lament rock
#
#

last pub was 1 year ago

lyric mountain
#

ah yes, I was in "erela" page

lament rock
#
#

Idk why people don't just use the built in http library. It literally has a simple interface

lyric mountain
#

i believe either youtube or spotify broke in erela.js, the last guy that came here was using both

lament rock
#

the spotify integration

#

I had some gremlin come to me regarding my LavaLink remake complaining about erela.js support

lyric mountain
#

lmao

fickle arch
lament rock
#

The solution is to not make a music bot

#

it isn't worth the hassle

#

I would know because I make my own - a lot of the software I integrate with is proprietary because the scalable music space sucks

lyric mountain
#

I did too, dropped the module after having to deal with constant issues

#

usually if your bot isn't entirely dedicated to music, you're not gonna go too far

lament rock
radiant kraken
#

we already have enough music bots

lament rock
#

We do, but I think the draw towards them is that the popular ones implement their interfaces in an ugly fashion

#

Rhythm's dash was laggy as fuck when the queue had more than 50 tracks and that was because of how it handled elements

#

The discord interface was also very bland

#

Most of the work had been cut out for it in lavalink

light ingot
#

they told me to use the developement build of erela.js

fickle arch
#

I swiitch the version to the build version

#

It works lmao

#

It's all because of 1 lib 💀

ancient nova
#

that's why I need to come up with something better to recieve that intent

lyric mountain
#

ok but for what (like, examples) you need those intents?

#

I can only see maybe an absolutely niche use for it

quartz kindle
#

"i want it just because i do, so im gonna invent something that needs it just so i can get it"

rose mesa
#

do explain me whats the need of music bots in the first place tho 🤔

#

how hard is it to use spotify, or just have youtube run somewhere ,-,|
lit adds up to the same thing, except discord quality being somehow lower ffs

quartz kindle
#

people want others to listen to whatever they're listening to because they dont listen for their enjoyment, they listen to show off

fickle arch
#

Ummm, so basically my bot make a new link for server invite but it make the link have infinite use and only 1 day expire time, how do I limit the user to 1 per invite

rose mesa
quartz kindle
#

but spotify requires the user to actually want to open your playlist

rose mesa
#

bot would lowkey take roughly same time if not more tho ll

quartz kindle
#

but people can kinda "force" someone to listen more easily lmao

rose mesa
#

Join channel > Search the song in the bots queue command > set it to paly

open spotify > search song > click play

#

or if spotify always open, even easier xD

quartz kindle
#

i dont even use spotify

#

:^)

rose mesa
#

topggThink I use it when I'm driving or in metro tbh

#

for work stuff usually got my youtube playlist xD

quartz kindle
#

i usually listen to youtube radio streams

#

but most of the time i dont really listen to anything

#

i enjoy the silence :^)

rose mesa
#

there's no silence here, just car noises 24.7 wwwww

#

so its either that, or some nice chill music

quartz kindle
#

xD

rose mesa
#

I'd honestly take the music during work

#

Tho back to topic, its even funnier when music bots support spotify playlists xD

#

like.... bruh.... if you're going to open it anyways.. why bother ,-,|

quartz kindle
#

its like bringing it home

rose mesa
quartz kindle
#

they dont want to simply open the window and listen, they want to take the song and drag it home

#

into their discord homes

fickle arch
#

How do I limit generated invite link only can be used once

quartz kindle
#

just as you would jail a bird because you want it to sing inside your home

rose mesa
fickle arch
#

discord.js ?

rose mesa
#

Has it documented already, or ask on official server xD

fickle arch
#

Pain wawa2

quartz kindle
#

guild.invites.create?

rose mesa
#

uhhh no idea in v14 but ik in v12 or 10 was
message.guild.createInvite({options})

fickle arch
#

I mean like limit it for 1 use, mine currently don't have limit aka unlimited but it timed for 24hr before it expired

quartz kindle
rose mesa
#

havent done so on new laptop yet ,-,

quartz kindle
#

nah

fickle arch
#

oohh maxuses

#

Aight ty

quartz kindle
#

i just open new tab and type "dis" and enter via autocomplete

rose mesa
#

ye but needs u to have visited it b4

#

i fr havent visited it once since i started my recode to djs v14 ,-,

quartz kindle
#

actually, i only need to type d

rose mesa
#

lit going off of update thing from v12-13 tehn adjusting to v14 xD

quartz kindle
rose mesa
fickle arch
rose mesa
#

btw @quartz kindle think i should just ask in #support later? topggThink

#

Cant even test anything here anyways, since moved most to slash -,-

quartz kindle
#

ask what?

rose mesa
#

thing's been sleeping here for maybe 2years? now while i was busy irl

quartz kindle
#

to this server?

#

bots are not invited here anymore

rose mesa
#

Ye, its already here anyways as far as i can tell 🤔

#

topggThink ah icic,

#

will run console to leave server later ig

quartz kindle
#

every now and then they make a poll, and only the most voted bots get added

#

all other thousands of bots here were already kicked

rose mesa
#

icic topggThink

#

no wonder bot still on dbl even after the 2 years i was away lel

quartz kindle
#

something about scalability issues or discord limiting the number of bots per server or something

rose mesa
#

all of the above i bet

quartz kindle
#

xD

sharp geyser
earnest phoenix
quartz kindle
#

only a web knows what a web is

lyric mountain
#

web means```
'W'eb
w'E'b
we'B'

quartz kindle
#

are you singing dubstep?

earnest phoenix
#

+++

#

`3

#

`

#

`

proven escarp
earnest phoenix
#

sorry i had my computer closed and stuff on my keyboard ;-;

dry imp
#

mood

rigid maple
#

How can I get the largeImage URL?

#

visual studio code largeImage

lyric mountain
#

see the docs on which url u need to fetch

uneven tartan
#

im not positive if im doing this correct

#

its always returning true

#

first one should be between 1 and 1, so 1. second one should be between 1 and 100

wheat mesa
#

(I recommend making a function for your random generation so it's easy)

uneven tartan
#

i figured out the issue

#

okay im using an array to display strings on new lines. how do i handle duplicates?
example:

item
item
item2```
i would like it to display something like

item (x2)
item2```

sharp geyser
#

leg1 = leg 2?

#

thats not comparison no?

#

thats assigning

wheat mesa
#

^

minor olive
#

Unless there is a built-in function to do it, I would create an embedded loop and just have it compare x to y and if they are the same, delete y from the list.

#

But why would there even be duplicates? Can you just stop it at the source?

minor olive
uneven tartan
#

yes

#

did that once i realized

uneven tartan
minor olive
#

Okay. Can you look into doing that embedded loop thing? That's the only think I can think of

wheat mesa
#

Loop over the array and assign each key to a value in an object

#
obj = {}
loop:
    obj[array[i]] = obj[array[i]] + 1 if exists, else obj[array[i]] = 1
``` pseudocode
minor olive
#

possibly. Again, I am not very fluent in js. So if you think that will work, go for it.

wheat mesa
#

It’s not a js only problem tbh

minor olive
#

oh, what is it?

wheat mesa
#

I’m sure there’s a better algorithm for this

#

This is very common

minor olive
#

oh, I see. Yeah, that's what I was thinking. Look it up I guess. I'll help.

#

const duplicates = numbers.filter((item, index) => index !== numbers.indexOf(item));

You can use this to find the duplicates

minor olive
#

Yeah, I can't find a better algorithm

wheat mesa
#

I don’t think that’s what he needs

uneven tartan
minor olive
#

yeah, me neither, but you can't just copy and paste it. You're going to have to do some work to get it right.

#

That was just an idea

#

Not actual copy and paste code

wheat mesa
#

It’s basically just a map

frigid robin
#

On one server my bot started throwing discord.errors.Forbidden: 403 Forbidden (error code: 160002): Cannot reply without permission to read message history.
The bot recently went offline.

  1. Can it crash due to those errors?
  2. Does this mean that they didn't grant it the read message history SCOPE, or that they denied the permission for the bot/channel?
frigid robin
#

Also a small question, why would the bot enter on_message event if I used the decorator

@discord.ext.commands.bot_has_permissions(read_message_history=True, read_messages=True, send_messages=True)

and denied those permissions from the bot

uneven tartan
#

not positive if it will cause a crash, so i would catch and return since that appears to be rare for you

frigid robin
#

thanks

#

Getting this error, can't find anything about that error (especially with Shard ID being None):
[WARNING ] discord.gateway: WebSocket in shard ID None is ratelimited, waiting 57.51 seconds
anyone knows what is causing this?

lyric mountain
lyric mountain
lyric mountain
clever shuttle
#

how do you add the preview of your website in your "Long description" in topgg?

earnest phoenix
clever shuttle
#

thanks

frigid robin
# lyric mountain you're doing something too fast

I wonder what it could be, it happened pretty fast after the bot was started:

Aug 25 08:25:03 2022-08-25 08:25:03 - INFO - Connected to Postgres database successfully!
Aug 25 09:17:35 [2022-08-25 09:17:35] [INFO    ] discord.client: logging in using static token
Aug 25 09:17:39 [2022-08-25 09:17:39] [INFO    ] discord.gateway: Shard ID None has connected to Gateway (Session ID: c90bd81628b978a6aa2ce20a5acadc29).
Aug 25 09:17:40 2022-08-25 09:17:40 - INFO - Deleted stale guild 1004919883387121664 from DB successfully.
Aug 25 09:17:40 2022-08-25 09:17:40 - INFO - Left a guild. Name: . ID: 1004919883387121664
Aug 25 09:17:40 [2022-08-25 09:17:40] [WARNING ] discord.gateway: WebSocket in shard ID None is ratelimited, waiting 57.51 seconds
frigid robin
frigid robin
lyric mountain
bright thorn
#

how can we check

#

how many messages bot seen

lyric mountain
#

...what?

#

you mean track how many messages were seen by the bot?

frigid robin
frigid robin
bright thorn
#

i have this but i want to seen by system

lyric mountain
#

Why do you both need to track message count?

bright thorn
lyric mountain
#

It's even more worthless than user count

bright thorn
#

for this

frigid robin
lyric mountain
bright thorn
#

😅

frigid robin
lyric mountain
#

Nobody cares about message count, plus you could simply fake that number and nobody would be able to prove

lyric mountain
#

Metrics can be stored sure, but you do it for analytics reasons

blazing drum
#

968503014849671188

ancient nova
#

what can I do with the guild presence intent kek

frigid robin
lyric mountain
#

No idea, check the docs

lyric mountain
#

Your bot is already having performance issues without presences being received, imagine with it

light ingot
#

@bright thorn hi there

#

you remember the erela.js issue

loud ore
#

looks like after removing 14 unused imports I'm done with updating the discord library

bright thorn
#

You solved it?

light ingot
#

yeah

#

they updated the dev build

#

and it works now

frigid robin
#

Can some1 help me understand what is the difference in between

bot.db = await asyncpg.create_pool(database=database_name....
selected_stuff = await bot.db.fetch("SELECT * FROM guilds...

And this:

connection = await asyncpg.connect(
                database=database_name, user=database_username, password=database_password, host=database_host_address, port=database_port
            )
c = connection.cursor()
c.execute('SELECT * FROM guilds...)

?

#

What is that weird implementation of setting a pool into the bot object O_o

sick agate
#

one has auth

#

aswell

frigid robin
#

which auth? where is it happening?

bright thorn
pale vessel
#

Bye bye

light ingot
#

me who just switched to heroku :

pine nova
cinder patio
#

bruh

feral aspen
#

Is it like from const Discord = require('discord.js'); to like import Discord from 'discord.js'; or something.

sudden geyser
#

CommonJS uses require + module.exports, ES Modules uses import + export

#

I think people prefer ESM today

#

I personally can't be bothered to learn it so I stick with require

light ingot
#

so is ESM any better than CommonJS

#

and if so, why

#

how i mean*

sudden geyser
lament rock
#

ESM is a bit more strict and the current ecosystem adopting ESM is either one or the other when it comes to CJS or ESM and often leaves a lot of improvements or bug fixes gated behind the transition from CJS to ESM. A lot of modules have already done so in my projects, so I am left with no choice but to drop them. Almost all of my projects support both

#

I think a lot of the paradigms it introduces like import/export default is useless requirements

#

The only good thing is top level await

#

I guess my heatsync module would receive more adoption because of its support for esm if more people used esm

rigid maple
#

How can I get sync user activity ?

#

I want to use frontend with websocket

ancient nova
lyric mountain
uneven heath
# pale vessel

Welp, time to migrate then.

I don't mind paid option but if I am moving I probably gonna move away from Heroku

Any suggestions for a good deployment workflow?

lyric mountain
#

heroku killing 12641248 bots with one move lmao

uneven heath
#

Lol

boreal iron
#

12641247 multi purpose bots

uneven heath
#

Great, now I have to think of a deployment solution.

quartz kindle
#

wait heroku wont offer free plans anymore? lmao

uneven heath
#

Where should I host the bot if I have to pay anyways :p

quartz kindle
#

depends on your needs

#

for small stuff, google has a free plan

uneven heath
#

I think I have exhausted every google option lmfao

quartz kindle
#

lmao

#

im currently using hetzner

#

its about 5 bucks per month

#

i also have one on galaxygate, 2.75 per month

uneven heath
#

I probably gonna need Postgresql option :p

#

I do have a Linode tbf

#

But for VPS mostly

quartz kindle
#

you can always install your own pg in a vps

uneven heath
#

I just want something where I can shove in and forget about it.
Rare situation I need to intervene is when I do backups

frigid robin
#

When using asyncpg and a connection pool, should I create a global connection pool and only acquire() from it in the other modules? Or should I keep creating a new pool? Looked at numerous examples and couldn't figure the right usage.
Also not sure when to release the acquired connection from the pool and when to close the pool itself. Seems that everywhere they close the pool but doesn't it defeat the purpose of it?

sudden geyser
quartz kindle
#

oh yeah let people use it and then randomly decide they are evil and sue them

#

:^)

quartz kindle
sudden geyser
#

imagine if some fang company had that deep as a dependency in their product

#

they'd get smited

quartz kindle
#

xDDDD

frigid robin
#

I wonder how you figured that out, I barely found normal docs for that library

quartz kindle
#

i mean, its largely common sense if you think about it

#

creating and destroying pools for no reason doesnt make much sense

#

the era of creating and destroying database connections comes from the old php world where every operation would run in its own separate script

quartz kindle
#

why, is the new php world still the same?

#

:^)

frigid robin
#

wtf asyncpg is impossible to use

winged linden
#

whats that error from? any idea

spark flint
#

got any code to help?

#

we kinda can't do much without it sobby

winged linden
#

what can cuz this?

summer vessel
#

@boreal iron

winged linden
#

it keeps crashing my code, was doing all good before

spark flint
#

something from your messageCreate event

summer vessel
spark flint
#

did you update to Discord.js v14 when your code is v13 etc?

spark flint
summer vessel
#

Nothing

spark flint
summer vessel
winged linden
#

from v12 to v13 though

summer vessel
spark flint
#

did you upgrade your code with it?

winged linden
#

it was doing all good yesterday

summer vessel
#

Wth

spark flint
#

what updates have you made since it last worked?

summer vessel
#

What is this

winged linden
spark flint
#

ahh ok

winged linden
#

bruh i really cant figure it out, it does that sometimes, crashes the bot then it stops

#

i use pm2, it start right away again but still

lyric mountain
#

smells like uncaught exceptions

winged linden
#

i got a webhook that sends the logs of my pm2 but yeah here you go

winged linden
lyric mountain
#

well, that error tells u exactly where it happens

#

ur trying to get cache of something that returned undefined

winged linden
#

whats "discord sent a typing packet..."

winged linden
spark flint
#

that

#

someone typin

spark flint
#
process.on('uncaughtException', err => {
   console.error(err)
});``` (https://nodejs.dev/en/learn/error-handling-in-nodejs#catching-uncaught-exceptions)
lyric mountain
winged linden
#

i guess i am gonna rewrite my wholes bot code, dont want it crashing at unknown times

lyric mountain
#

at least add a log there

winged linden
lyric mountain
#

at least add a log

#

never mute global exceptions like that

#

they made exceptions crash the runtime for this very reason

#

so many shitty js codes that were barely holding together because people simply didn't care

winged linden
#

cuz it literally happens at random times for like no reason

#

and was doing all good before

lyric mountain
#

catch the exceptions

spark flint
#

i accidentally deleted the console.error bit wahhh

winged linden
lyric mountain
winged linden
#

i will message back if it happens again

lyric mountain
#

so u can give proper treatment to the cases

winged linden
#

cuz i really cant know when it happens lmao

lyric mountain
#

u don't need to wait

#

the error gives exactly the location where it happens

winged linden
#

it doesnttt

#

node module pack ma man

lyric mountain
#

see the full error

#

that message does not replace a proper logfile

winged linden
lyric mountain
#

rip

winged linden
#

now bot doesnt crash but i am getting that error bruv

#

time to debug

#

i am gonna check smth

earnest phoenix
winged linden
#

for this bot 12.5.1

#

i am looking to upgrade anyways, rewriting the code is smth that i should do

earnest phoenix
#

Of course you're gonna get that error if you're using v12

#

That version doesn't know how to handle the newer API requests

winged linden
#

i am not using a new features though?

#

ah bruv

#

i am gonna update anyways soon. thanks for the help guys

summer vessel
winged linden
summer vessel
#

Epic command

pearl trail
#

more like epic error

winged linden
#

💀

vestal summit
#

for webhooks, how would i use a discord webhook? i put a discord webhook in the webhook url slot, but it doesnt send when i press send test

spark flint
#

oop

#

was writing a reply anyways lmao

hidden gorge
#

how can i stop this?

wheat mesa
#

don't spam requests to the discord api

lyric mountain
lyric mountain
#

Well, you see, channel ratelimit is VERY low compared to the rest

#

I think the only things that have lower ratelimit are name/avatar change and guild creation

#

Whatever you're doing, rethink whether it's really necessary

hidden gorge
#

i’m not doing it

#

it’s not my bot

#

i’m just helping a client

lyric mountain
#

A "client"?

hidden gorge
#

yes

lyric mountain
#

Wdym?

hidden gorge
#

a hosting client

lyric mountain
#

You're not renting your server are you?

hidden gorge
#

why

lyric mountain
#

That's against ToS of pretty much any provider I know

#

Could get you into legal issues

hidden gorge
#

i work at a bot hosting company

lyric mountain
#

Well, I'm not sure why exactly you're helping your clients codewise, but tell them channels shouldn't be created too fast, and if they're making a "guild backup" feature, it won't go very far

#

Especially since last year when discord added a template feature

hidden gorge
#

we use Pterodactyl

lyric mountain
#

The story only gets worse on each page 💀

hidden gorge
#

i’m only an administrator at the company and a client myself

lyric mountain
hidden gorge
#

ok

#

which i’ve been requested not to

#

i have to follow the clients requests

carmine summit
#

How do I turn my Promises in an object in an array into values?

#

currently have this, but it doesnt convert them to values

    await Promise.allSettled(results.flatMap((a) => a.episodes.map((b) => b.status)));
    console.log(results.flatMap((a) => a.episodes.map((b) => b.status)));
lyric mountain
#

Tf is Promise.allSettled?

wheat mesa
#

Yeah I've never seen that before

#

Isn't this just a use case for Promise.all?

carmine summit
#

Promise.all gives error if one of the promises fails

lyric mountain
#

Even then, the promise is not being awaited

#

So u can't map it

carmine summit
#

Promise.allSettled doesn't care if a promise is rejected

hidden gorge
wheat mesa
#

Why not just ```js
for(const prom of promises) {
array.push(await prom)
}

#

though I might be stupid and that probably doesn't work

carmine summit
#

well, that is too slow.

lyric mountain
#

...what

carmine summit
#

I want to send all the request at once then wait for all to be done

wheat mesa
#

how so? anything else will be literally doing the same thing

lyric mountain
#

No iterator is faster than crude loop

wheat mesa
#

you cannot do that really

carmine summit
#

rather than send, wait for the reply, send, wait for the reply

lyric mountain
#

It's like, the basemost iteration method

wheat mesa
#

I hate to burst your bubble but js is single threaded and what you're trying to do sounds like a ratelimit nightmare

carmine summit
#

Trust me, it works. but I cannot find a way to turn the Promises into values

wheat mesa
#

(Assuming there's some sort of fetching involved, that's usually the most common use case for async)

hidden gorge
# hidden gorge ok i need some help now
import discord
import os
from discord.ext import commands
bot = commands.Bot(command_prefix="!",intents=discord.Intents().all())


version='P&FS 1.1.0'

@bot.remove_command('help')

@bot.event
async def on_ready():
    log=bot.get_channel(1004452126916878436)
    embed=discord.Embed(title=f'{version} has started!', description=f'**Version:** {version}\n**Dev:** Lando the Tech Guy#7045\n**Hosted on:**, color=0xff0000)
    embed.set_thumbnail(url="")
    await log.send(embed=embed)
    print("------")
    print(f"{bot.user} | {bot.user.id} is connected to Discord!\nReady for all recipents!")
    print("------")
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print(' ')
    print('===================================================================DEV CONSOLE==================================================================')
    while True:
        await bot.change_presence(status=discord.Status.online, activity=discord.Activity(
    type=discord.ActivityType.watching, name="Pizza & Fries Submissions"))
    await asyncio.sleep(60)

for filename in os.listdir('./cogs'):
    if filename.endswith('.py'):
        bot.load_extension(f'cogs.{filename[:-3]}')
    print(f"Loaded: {filename}")
    
bot.run('')```
wheat mesa
#

oh my fucking god

#

someone tell this guy about loops please

hidden gorge
#

not my bot

wheat mesa
#

wanna know why you're getting ratelimited?

lyric mountain
#

You should stop attempting to fix your clients' codes if you're just a provider

hidden gorge
wheat mesa
#

60ms delay between each status

lyric mountain
#

It's like asking your ISP to win your game's match for you

wheat mesa
#

the limit is like 5 changes every 25 seconds or something like that

#

even then you shouldn't change it that often

hidden gorge
#

what should he set it to?

wheat mesa
#

...

#

not 60ms

hidden gorge
#

ok recommend?

wheat mesa
#

like once every 5-10 minutes

#

Even then it doesn't need to change that often

lyric mountain
hidden gorge
#

every 300 seconds?

wheat mesa
earnest phoenix
lyric mountain
#

So it returns a collection of results

wheat mesa
#

It does?

#

Python is garbage C:

carmine summit
lyric mountain
#

Don't map inside allSettled

#

First let it resolve the promises, THEN deal with the values

wheat mesa
#

Just do await Promise.allSettled(yourPromises) and the result will be an array of your promises

#

Just a heads up, it does the exact same thing as I suggested 😛

#

Oh wait I'm super dumb with this python thing

lyric mountain
#

Ye, it'll boil down to loops anyway

wheat mesa
#

You're changing the status IN the while true loop, and sleeping after the while true

#

you're stuck in an infinite loop spamming requests to the dapi

#

reason number 2 of why python is garbage: I can't tell where scopes begin or end easily

lyric mountain
#

Python is just turing-complete YAML

wheat mesa
somber stag
#

Hi 👋🏽

carmine summit
#

I'm currently doing it now using a for loop. Though I don't know how I can extract the values from there

dry imp
dry imp
#

oh yea just saw that

wheat mesa
#

You could try a traditional for loop like I said

#
for(let i = 0; i < array.length; i++) {
  array[i] = await array[i];
}
carmine summit
#
    for (let i = 0; i < results.length; i++) {
      for (let j = 0; j < results[i].episodes.length; j++) {
        results[i].episodes[j].status = //what do I put here? The value of this is `Promise { true }` I want to set this value to true
      }
    }
sudden geyser
#

looks like a worse version of promise.all

carmine summit
#

The promises are already .allSettled

wheat mesa
#

await results[i].episodes[j].status

carmine summit
wheat mesa
#

you're overcomplicating it

#

just make a new array

#

I don't see what's wrong with it

carmine summit
#

I'm done. This is what I've got```js
await Promise.allSettled(results.flatMap((a) => a.episodes.map((b) => b.status)));

for (let i = 0; i < results.length; i++) {
  for (let j = 0; j < results[i].episodes.length; j++) {
    results[i].episodes[j].status = (await results[i].episodes[j].status) ? 1 : 0;
  }
}
wheat mesa
#

the cpu cycles used by creating and filling an array is going to take far less time than awaiting the promises

#

I don't see why you're mapping here, just seems like a waste to me

#

no idea where the map is necessary

#

but if it works it works I suppose

#

may I ask why you have an array of promises of this size anyways?

carmine summit
wheat mesa
#

bruh...

carmine summit
#

I'm soon gonna cache it locally to not spam it

lyric mountain
#

You should instead make a batch request

wheat mesa
#

^^^

#

Your database will be much happier with batch requests than "fuck you I'm gonna hit you with 350 requests in 5.6 seconds"

carmine summit
#

Is it better to send 50x1kb(50kb total) request or 1x500kb(500kb total) request?

lyric mountain
#

The latter 100%

carmine summit
#

or should I be a good developer and ask the database to filter it for me

lyric mountain
#

Filters can allow more than 1 return value

#

Like, grab all the data you'll use at once, not the entire table

carmine summit
#

yeah, instead of requesting to get 50 values at a time, im just gonna request the entire database and cache it...

lyric mountain
#

That's pretty bad

#

Caches should only hold recently used values, not be a mirror of the entire database

#

Else u lose the "cache" benefit

carmine summit
#

well, how are you going to do it ?

#

cache everything that I've requested

#

but that's gonna result in 50 requests x 1 kb

lyric mountain
#

Request all 50 rows at once

#

SELECT * FROM stuff WHERE id IN (1, 2, 3, 4)

carmine summit
lyric mountain
#

No but there should be something akin to sql's IN

carmine summit
#

im just gonna cache the entire database. its not more than 10mb anyways

wheat mesa
#

that defeats the purpose of a database pretty much

wheat mesa
#

yeah I saw it

#

I think it's a good thing

vivid fulcrum
#

same here

sudden geyser
#

It'll be fun until November 28 rolls around in this chat

wheat mesa
#

Not as much fun as when September rolls around with message content intent 😉

sharp geyser
#

Doesn't that only affect verified people who use it

#

I haven't been keeping tabs on it tbh as I never use the message content anymore

quartz hill
#

have any new free server like heroku ?

rustic nova
#

screw the people who invented the iso week date

#

mfs telling me "yes if Thursday, week 53"

dry imp
light ingot
#

use heroku till it's free

#

coz replit isn't stable

supple shale
rustic nova
#

or

#

get this

#

use a vps

quartz hill
sharp geyser
civic aspen
#

what bot permission is required to change channel permissions?

#

my bot was declined for requiring the MANAGE_CHANNELS permission for it's lock command

wheat mesa
#

MANAGE_ROLES

#

iirc

civic aspen
#

Ah

#

thx

sharp geyser
#

smh

#

Imagine needing the manage roles permission to change channel specific perms

wheat mesa
#

I mean I’m not entirely sure if that’s the requirement

civic aspen
#

Its not clear on the dev docs

#

I would like one of the Bot Testers for their opinion

light ingot
#

just for a specific role

#

@‍everyone is also a role

frigid robin
#

What is wrong with this line?

is_paused = await bot.pool.fetch(sql_get_paused_status_for_guild, [guildid])

I seem to be getting an exception but it's not getting caught for some reason, probably related to the whole async shit. It's like nothing happens past that line.
the sql variable holds this:
""" SELECT ispaused::BOOLEAN FROM guilds WHERE guildid = $1::VARCHAR """

btw this one works fine:

ver = await bot.pool.fetch("SELECT version();")
        print(f"TEST: {ver}")
supple shale
#

have you tried (guildid, )

frigid robin
#

haven't. I did try , guildid

supple shale
#

also why is your guildid a varchar

frigid robin
#

it has no numeric meaning

#

why no varchar?

supple shale
#

ids are numbers

frigid robin
#

but they have no meanings as numbers, I read that it's recommended to keep it as text

supple shale
#

it isnt

frigid robin
#

you never calculate something based off of them

supple shale
#

that doesnt mean anything

frigid robin
#

they're just a collection of digits

supple shale
#

id they are numbers, store as numbers

#

indexing is slower on strings

frigid robin
#

hmm

#

in postgres as well?

#

btw gonna try ur suggestion

supple shale
#

if its a number, store it as a number

#

doesnt matter if youre going to do calculations or it or not

frigid robin
#

i dont understand why asyncpg parses query differently than psycopg2

supple shale
#

explain

frigid robin
#

I used to run conn.execute(sql_get_paused_status_for_guild, [guildid])
before switching to use asynpg

#

with the sql query having variables as %s

#

now they have to be $1, $2 etc, and the python execution is different too

#

and an exception is raised without being printed

supple shale
#

doubt it

#

do you have code consuming the error

frigid robin
#
    except Error as e:
        logger.error(f"Could not get paused status for guild {guildid}. Error: {e}.")
#

when I debug it does get to the except line but doesn't get past it

frigid robin
supple shale
#

except Error as e

#

uh

#

except Exception as e.

frigid robin
#

managed to show the error using raise

#

asyncpg.exceptions.DataError: invalid input for query argument $1: 1005891149342441572 (expected str, got int)

#

weird, i did cast it to varchar.. it worked with psycopg2

frigid robin
rigid maple
#

Can we check if the text in css fits there?

#

If it doesn't fit, I'll scroll the text, so I need to be able to control it.

rigid maple
pine nova
#

🤔??

#

change the overflow property of the parent div

supple shale
#

:is

#

lets ask what are you actually trying to do here

rigid maple
#

<marquee>text</marquee>

#

if i can find out if the text fits inside the div i can do that

supple shale
#

why marquee

#

what youd want is to make the text have an overflow scroll and control it maybe with js or smthn

rigid maple
#

not manually scrolling the text will automatically scroll if it doesn't fit in the div

#

like this

supple shale
#

marquee is deprecated and you probably want to achieve with css or js

rigid maple
#

but I want it to auto scroll only if the text doesn't fit in the div

lyric mountain
#

css animation

#

and js to calculate text size

rigid maple
#

how can i get the size of the text

#

Is there something like measueText like in canvas

harsh nova
rigid maple
#

String.length doesn't work very well because iiii and WWWW are not the same size

#

thanks

lyric mountain
feral aspen
#

I've pointed an A record towards the VPS (to configure a reverse proxy via NGINX) cause I want to host an express website app.

quartz kindle
#

if you already have nginx running, use the webroot option

lyric mountain
quartz kindle
#

thats not selfsigned is it?

spark flint
#

It’s certbot let’s encrypt

#

I hate that issue too

pearl needle
#

in python how do i get someones username and tag for example bot#0000

lyric mountain
#

user.tag if it exists

#

check the docs anyway

uneven tartan
#

kuu

#

haku

lyric mountain
#

ayo

uneven tartan
#

can i msg u

lyric mountain
#

sure

quartz kindle
#

@boreal iron since you're the php dude, i need some suggestions for an image resizing script, currely using gmagick extension, and it appears to be horribly slow (> 1 minute for 6 images)

#

basically im reading a folder of images and for each image store 2 different sizes

#
$image = new Gmagick("gallery/".$path[0]."/".$path[1]);
$image->thumbnailimage(0, 1080);
$image->writeimage("img-gallery/".$name);
$image->thumbnailimage(300, 0);
$image->writeimage("img-gallery/thumb_".$name);
lyric mountain
#

tim if I want to pull a git repo, keeping the local changes in case of a conflict, is it git pull -s ours?

quartz kindle
#

no idea, i dont use git cli

#

im noob

lyric mountain
#

nhe

quartz kindle
#

i use github desktop

#

:^)

lyric mountain
#

it's for my auto-sync script

rotund river
#

hello, i have a problem with my bot, specifically with mysql, i want to get the id in the database, but it give RowDataPacket { ID: 50 }, how can i extract the number 50?

lyric mountain
#

mysql topggLikeThis

#

but well, what wrapper are u using?

#

and what lang

rotund river
#
    const selectContent= `SELECT \`ID\` FROM \`shark_warn\` WHERE ID_Utente='${target.id}'`
    var SELECT = selectContent
    con.query(SELECT, function(err, result){
        if (err) throw err;
        var ArrayID = result[0]

        if(result[9] === undefined) {
        if (result[8] === undefined){
            if(result[7] === undefined){
                if(result[6] === undefined){
                    if(result[5] === undefined){
                        if(result[4] === undefined){
                            if(result[3] === undefined){
                                if(result[2] === undefined){
                                    if(result[1] === undefined){
                                        if(result[0] === undefined){
                                            
                                        } else {
                                            ArrayID = result[0]
                                        }
                                        }else {
                                            ArrayID = result[1]
                                        }
                                    }else {
                                        ArrayID = result[2]
                                    } 
                                }else {
                                    ArrayID = result[3]
                                }
                            }else {
                                ArrayID = result[4]
                            }
                        }else {
                            ArrayID = result[5]
                        }
                    }else {
                        ArrayID = result[6]
                    }
                }else {
                    ArrayID = result[7]
                }
            }else {
                ArrayID = result[8]
            }
        }else {
            ArrayID = result[9]
    }

    console.log(ArrayID)```
lyric mountain
#

WHAT THE FUCK

rotund river
#

this is my code

rotund river
rotund river
quartz kindle
#

LOL

#

what the hell is this lmao

lyric mountain
#

congratulations, u won the "worst code formatting" competition, bae gets the second place

rotund river
quartz kindle
lyric mountain
#

all that could be reduced to ```js
const selectContent = "SELECT ID FROM shark_warn WHERE ID_Utente = ?1";
con.query(selectContent, (err, result) => {
if (err) throw err;
const ArrayID = result[0].ID; // query returns a row list
// use ArrayID here
}, [target.id]);

quartz kindle
#

also, if you want only the last result, its much better to write it in the select query, but depends on what columns you have to filter with

#

or you can just do ORDER BY ID DESC LIMIT 1

rotund river
lyric mountain
#

see my code

quartz kindle
#

just add .ID lol

rotund river
rotund river
#

and give the last id

quartz kindle
#

@boreal iron nevermind lmao
for context, this takes almost 2 minutes on 6 images

$image = new Gmagick("gallery/".$path[0]."/".$path[1]);
$image->thumbnailimage(0, 1080);
$image->writeimage("img-gallery/".$name);
$image->thumbnailimage(300, 0);
$image->writeimage("img-gallery/thumb_".$name);

this takes 5 seconds ```php
$image = new Imagick();
$image->setOption("jpeg:size", '1080x1080');
$image->readImage("gallery/".$path[0]."/".$path[1]);
$image->thumbnailImage(1080, 1080, true);
$image->writeImage("img-gallery/".$name);
$image->thumbnailImage(300, 300, true);
$image->writeImage("img-gallery/thumb_".$name);

php is weird lmao
boreal iron
#

well depends on the lib ur using

#

I'm only using the GD lib

quartz kindle
#

i always hear people saying imagick/gmagick is much better than gd

#

no idea why gmagick is so slow in this situation

boreal iron
#

don't even know why you should pick gmagick in the first place

#

imagick provides far more possibilities and features and is known to not have any vulnerabilities

quartz kindle
#

some say gmagick is a better/improved imagick

boreal iron
#

well thing is GD is a very, very basic without many features

#

but I see you just creating a thumbnail

#

aka image resizing

#

which GD is totally enough for

boreal iron
#

without new features or anything else, which should be "more" optimized

#

but this is the status of like 10y ago

quartz kindle
#

yeah

boreal iron
#

who knows what changes imagick has made over the time gmagick is missing now

rotund river
#

for exemple, the select give this: [
RowDataPacket { ID: 5 },
RowDataPacket { ID: 6 },
RowDataPacket { ID: 7 },
RowDataPacket { ID: 8 },
RowDataPacket { ID: 9 }
]

quartz kindle
#

SELECT count(*) from shark_warn WHERE ID_Utente=...

rotund river
#

thanks

boreal iron
#

SELECT COUNT(*) AS total FROM shark_warn WHERE ID_Utente = ...

sudden geyser
boreal iron
#

physical pain

rustic nova
#

ahem I mean

#

Please use for loops using integers, that would clean up alot

#

or what tim etc said

boreal iron
#

damn... somebody telling aurel he's late to the party

ancient nova
#

would it be possible for anyone to ask the mods in microsoft community to unban me? or is there a way to appeal at all?

#

I need to ask something important 😭

lyric mountain
#

you lost your crown bae, get over it

ancient nova
#

but come on like almost a year has passed and I used to go there everytime I had a PC issue 😭

lyric mountain
#

your ban email should contain the reason

ancient nova
#

rn I have one and I can't get no help

#

do you know windows 10...maybe u can help lmao

lyric mountain
#

did u try searching if someone else had a similar issue?

ancient nova
lyric mountain
#

keep searching then

ancient nova
#

I changed my dedicated vram in regedit to around 2gb and now my gta v is having memory leaks

#

I jus wanna know how to change it back

lyric mountain
#

I changed ... in regedit
so, yeah buddy, you fucked up

#

you don't simply "change" regedit and expect to be able to revert stuff at any time

ancient nova
#

it worked well on all games just gta v seems to be having weird texture alloc glitches

#

from what I read that's the reason anyway

digital swan
lyric mountain
#

regedit is probably the deepest, most expert-ish place you can go to tweak windows

#

unless you know EXACTLY what you're doing (read: not following some random guy's comment), you shouldn't even open it

ancient nova
#

to be able to play games that require more than 2gb vram (I have only 1gb)

#

worked well, could play all of them easy on medium settings either way

#

but not gta v

digital swan
#

well that’s why gta doesn’t like it

#

it needs more

lyric mountain
#

if the game expects to be able to use 2gb vram, u can't simply dig a hole and say "here, more ram"

ancient nova
#

well yeah and it's allocating more than my specs can handle that's why

digital swan
#

i think that’s the closest you could get to downloading ram tho

lyric mountain
#

I can't really express how fckd up that idea even is

ancient nova
#

it did work tho

lyric mountain
#

clearly it didn't

ancient nova
#

gta is the only one that is having issues

#

out of all the games I tried

digital swan
#

probably because gta is a massive game that requires more than 1gb of vram

lyric mountain
#

it's like...putting water in your car's tank so the gauge goes up

ancient nova
#

the others also required more than that

lyric mountain
#

will it work? visibly, yes
is it a good idea? hell no

ancient nova
#

but ran smooth anyway

digital swan
#

well if u change something like that u can’t just expect stuff to work

ancient nova
#

I think found a fix

#

there is a commandline script that restricts gta v to specific memory

#

if I can restrict it to the amount of memory I got it should work I think

lyric mountain
# ancient nova but ran smooth anyway

so, lemme explain you why that's a messed up idea:

Imagine you have a table, you need to put your stuff in it to be able to use them.
One day, a guy tries to use your table, but he needs a bigger table because he uses more stuff at once

#

instead of buying a bigger table, you hypnotize him so he sees a table bigger than it is in reality

digital swan
lyric mountain
#

however, the moment he tries to put his stuff in the "table", it falls to the ground, he gets confused

#

he keeps trying, but for some reason, putting stuff in half the "table" makes it fall straight to the ground

#

he question: "If I can see a big table, why can't I put my stuff in it?"

why bae, why can't he?

lyric mountain
#

else better prepare a format usb stick for a near future

ancient nova
#

any backup I did is looong gone

ancient nova
#

even if not then I can just decrease the graphic settings

digital swan
solemn latch
#

people have run really old versions of gta 5 with 1gb of vram.
but its important to remember its been 7 years since then, gta 5 is a much larger game now. every new car, weapon, cosmetic, feature will bring the required vram up.

boreal iron
#

Theres a reason minimal system requirements exist

frigid robin
#

how do I make my bot stop processing the msg after command was invoked via await bot.process_commands(message)? It just continues the on_message event after already invoking the right command

lyric mountain
#

return

frigid robin
#

yeah but I return inside the commands

lyric mountain
#

no, return outside

frigid robin
#

how do I know whether the process_commands has done something?

lyric mountain
#

make it return something, like a boolean or the command class

#

use that to check

frigid robin
#

🆗

#

ty

#

ur the savior of top.gg do u even sleep?