#development

1 messages · Page 1601 of 1

drifting wedge
#

and that instance wouldnt be sharded

#

okay

modest maple
#

you know when i said clustering for the sake of clustering is a bad idea 🤣

#

welcome to just the start of why

drifting wedge
#

well then what can i do?

modest maple
#

make your own system

flat pelican
#

Clustering is scary tho

drifting wedge
#

@modest maple okay

#

so lets say i wont cluster

#

i will eventually have to

modest maple
#

only about 1-2% of all bots on discord even need clustering ever

flat pelican
#

that's why I don't want to start clustering mine for now lul

drifting wedge
#

and when that happens would i need to do?

#

setup webservers?

flat pelican
#

I really don't think 20k is enough to cluster

drifting wedge
#

50k?

modest maple
#

well that point you'll likely be more experienced with python and understand how to set it up

drifting wedge
#

@slim heart when did u start clustering?

modest maple
drifting wedge
#

okay

modest maple
#

if you have presence enabled as a intent you'll generally need to start by then unless you have a high clockspeed

dire obsidian
#

ok so, is there a way to align this?

drifting wedge
#

why?

flat pelican
#

I don't have the presence intent yet personally

modest maple
flat pelican
#

Discord declined my intent request

drifting wedge
#

a lot of cache?

flat pelican
#

it's good if you can get the presence intent tho

modest maple
#

because presence makes up about 90% of all the websocket events you get

#

Spooderfy went from taking up about 50% cpu usage on a 8 core to 5% when we cut presence mmLol

drifting wedge
#

if i do get presence intents/

#

then i need clustering or can i get away without?

modest maple
#

bro ngl i wouldnt worry about it till you actually need it

#

chance are you're never going to need it

#

thats just a reality

modest maple
#

Spotfiy's old code bad without presence

solemn latch
#

which imo a majority of bots dont need presences

modest maple
#

very few need it

flat pelican
#

I mean you can cache/chunk your members as how it was previously

#

before the indents update

modest maple
#

you can do that without presence

flat pelican
#

not really

modest maple
#

Mmm yes really

drifting wedge
#

ok ty

#

so im trying to do ipc

#
NameError: name 'client' is not defined```
#

and im getting this erorr

modest maple
#

client is not defined mmLol

slim heart
#

lib?

drifting wedge
#

ye ik

#

py

slim heart
#

no clue

drifting wedge
#

discord.ext.ipc

modest maple
#

well we cant guess your error

drifting wedge
#

ik ik

modest maple
#

well we dont need to guess

#

we have your error

drifting wedge
#

like what ckuebt us ut>

modest maple
#

we cant guess your code

drifting wedge
#

is it the bot client or class?

#

it says my_bot

#

but mybot is the bot client and class

modest maple
#

well read the example code

#

what is the custom class inheriting

drifting wedge
#

ye bot client

flat pelican
# modest maple Mmm yes really

I was referring to this

Why does on_ready take so long to fire?

As part of the API change regarding intents, Discord also changed how members are loaded in the beginning. Originally the library could request 75 guilds at once and only request members from guilds that have the Guild.large attribute set to True. With the new intent changes, Discord mandates that we can only send 1 guild per request. This causes a 75x slowdown which is further compounded by the fact that all guilds, not just large guilds are being requested.

There are a few solutions to fix this.

The first solution is to request the privileged presences intent along with the privileged members intent and enable both of them. This allows the initial member list to contain online members just like the old gateway. Note that we’re still limited to 1 guild per request but the number of guilds we request is significantly reduced.

modest maple
#

ah yeah

#

you cant get a similar system though now we can manually control the chunking

#

in some ways its a bit nicer because you can lazily chunk members

brittle fable
#

The upvote webhook thingy is still giving me a 500 error

drifting wedge
#

@modest maple

class Bot(commands.AutoShardedBot):
    def __init__(self):

        self.ipc = ipc.Server(self, secret_key="ipc key")

        super().__init__(command_prefix = prefix, shard_count = shard_count, shard_ids=shards_to_run, owner_ids=OWNER_IDS, help_command=None, activity=discord.Activity(type=discord.ActivityType.playing, name=f".help | bot website"), intents=discord.Intents.all())

...
if __name__== "__main__":
    client.ipc.start()

    client = Bot()
    client.run("1.0.0", "token")```
#

this is the code

#

from discord.ext import commands, ipc relevant imports

copper cradle
#

are you

#

omg

modest maple
#

okay so where do you plan on getting client from before you define it mmLol

drifting wedge
#

oh lol

copper cradle
#

this is what happens when you copy & paste code

drifting wedge
#

didnt add that in

#

wdym?

copper cradle
#

how couldn't you see that was the problem

drifting wedge
#

no this is parts of my code

copper cradle
#

I know

modest maple
#

the point he's making is that its very obviously just copied from the example before you even attempted to understand it

drifting wedge
#

i just cant get it to work?

modest maple
#

erm well i do hate to break it to you but your error clearly proves otherwise

copper cradle
drifting wedge
copper cradle
#

you're trying to acess client before defining it

#

check the code inside that if statement

drifting wedge
#

oh

#

lol

#

LOL

#

@copper cradle @modest maple ty

earnest phoenix
copper cradle
dark axle
#

one a question

#

where i put max uses at this

#
  msg.react('✔')
  
  msg.react('❌')

  msg.awaitReactions((reaction, user) =>{
    if(message.author.id !== user.id) return;
    if(reaction.emoji.name === '❌'){
      msg.edit(notlike)
    }     

  if(reaction.emoji.name === '✔'){
      message.channel.send('Im glad you like this meme')
    }
lyric mountain
#

max uses?

rose warren
#

Question: my bot doesn't have presence perms. Can I get an un-cached user's username from the API by doing client.users.fetch("USER_ID") instead of getting it from my database? If so, the only drawback of doing this is if that user doesn't have any mutual servers with my bot, the bot won't be able to fetch the username?

dusky sundial
odd stratus
#

Mine doesn’t have presence intents but it was able to get this

#

(Your user ID)

rose warren
#

Yep

#

Just did some further digging thanks 👍

odd stratus
rose warren
#

My only worry is hitting the API so often

odd stratus
#

How often are you doing it?

rose warren
#

It's probably not too bad tbh. Every time a user calls their bot profile.

odd stratus
#

It should be fine

#

It’s not like it’s happening every 1 second

rose warren
#

The profile command isn't in my top 10 most-used commands so should be ok

#

Lol I've been storing usernames in my db since October to be able to look them up facepalm

odd stratus
rose warren
placid iron
dusky sundial
sturdy dock
#
const express = require("express")
const bodyParser = require("body-parser")

// Initialize express and define a port
const app = express()
const PORT = 3000

// Tell express to use body-parser's JSON parsing
app.use(bodyParser.json())


app.post("/", (req, res) => {
    if(req.headers.authorization == "peepee") {
        message.channel.send("Request recieved!");
    }
    console.log(req)
  console.log(req.body) // Call your action on the request here
  res.status(200).end() // Responding is important
})

// Start express on the defined port
app.listen(PORT, () => console.log(`🚀 Server running on port ${PORT}`))```
Hey could someone take a look as to why my webserver isn't recieving any post requests? Thanks :)
#

I tried using an API tester online and it worked when I pointed it to my webserver so not sure why it's not working with top.gg

dusky sundial
sturdy dock
#

hmm maybe, i usually use the API to poll for votes and it went down today

#

but i tried using webhooks earlier, same issue

lyric mountain
#

try using apitester to send a post request

sturdy dock
#

so probably not topgg

sturdy dock
lyric mountain
#

so it's not an issue on ur side

sturdy dock
#

does the code look okay?

lyric mountain
#

idk, but if u did receive apitester you're fine

sturdy dock
#

hmm ok

#

topgg supports ports right?

#

that aren't 80/8080

solemn latch
#

yeah?

sturdy dock
#

weird...

solemn latch
#

why is that weird

sturdy dock
#

apitester works, but not top.gg

#

on my express server

#

i posted code above

mighty ember
#

how would i have my bot send a message when someone votes?

opal plank
rose warren
#

my command call logs db is 1.5 million rows 😂

opal plank
rose warren
#

Oh nice

opal plank
#

14 mil in db

rose warren
#

lmao

opal plank
#

lol

rose warren
#

Why do you store them?

opal plank
#

identification

rose warren
#

Why not use fetch?

opal plank
#

cuz its not discord

#

its twitch

rose warren
#

Ah

opal plank
#

my bot works on both platforms

#

well, one of them at least

#

twitch doesnt have any sort of user info

stark abyss
#

I have a question, I need to make a "reset command" lets say. I want to change everyone's x variable to 0. This is like 100ish users and would probably grow more, so should I just use a for loop or set interval and do it because it's too many request for database to handle?

opal plank
#

you can just let the database handle

#

no need for loops

#

sql would be easy

#

UPDATE table SET X = 0 WHERE id IS NOT NULL

#

that'll run on all entries

stark abyss
#

oh

opal plank
#

¯_(ツ)_/¯

#

thats SQL/PG syntax btw

#

so you gotta check your own db

stark abyss
#

lol my dumbass was gonna set all user's one by one

opal plank
#

yeah, dont

stark abyss
#

ok

rose warren
#

You don't want to do all 14mil 1 by 1 @opal plank? 🤔

opal plank
#

wdym?

rose warren
#

jk

stark abyss
#

lol

opal plank
#

oh, hell naw

#

the identificaiton table ALONE is almost 3GB

#

the user objects are massive

thorny flume
#

Listening to events on the Db class has been deprecated and will be removed in the next major version.

opal plank
#

i store a SHIT TON of data

thorny flume
#

help

rose warren
#

What VPS specs are you running?

opal plank
#

1 sec

rose warren
#

Mine struggles sometimes

opal plank
#

i pulled about 94% of twitch's globall traffic with this bad boy

#

around 4 million viewers chatting at once

rose warren
#

Where do you host?

opal plank
#

let me check if i have some old gifs

#

good question

#

dunno the host name

#

i think its googles

thorny flume
#

Listening to events on the Db class has been deprecated and will be removed in the next major version.

opal plank
#

server costs about 450 per month iirc

thorny flume
#

help .-.

opal plank
#

for me its free cuz im not the one who pays for it

#

¯_(ツ)_/¯

#

its true tho

rose warren
#

Mysql eats up my CPU

opal plank
#

this is about 2.7 million users logged at once chatting

#

this is 3.6 million

rose warren
#

💀

opal plank
#

@earnest phoenix can tell you how much that shit abused twitch with the connections

#

he was in voice chat here watching this bad boy legit login 100k channels in over 30 seconds

placid iron
#

how do you log the messages?

#

is it web scraping or with the api

opal plank
#

me?

placid iron
#

yes

opal plank
#

API

#

twitch has what i consider possible some of the worst apis i ever seen

placid iron
#

i assume not with eventsub because that has a limit of 10,000 subscriptions and 100k channels is more than 10k lmaocry

opal plank
#

not quite

#

i clustered it

#

what you see there is 87 different tokens

#

all clustered via my custom IPC cluster

placid iron
#

oh lmao

stark abyss
#

Okay how do I do this in postgres:
Update set clanusers donation = 0
WHERE claninfo due = 2
I want to set all users (in clanusers) donation to 0 if the due (in claninfo) is 2

placid iron
#

is it one twitch app though?

placid iron
#

UPDATE clanusers SET donation = 0 WHERE claninfo = 2

opal plank
#

no

#

all this was done in typescript

#

using a custom lib i made for caching

stark abyss
#

oh i see

placid iron
#

mmm. so how did you get the 87 different tokens?

stark abyss
#

except the due variable in the claninfo table

opal plank
#

multiple accounts

placid iron
#

oh lol

#

did you have to create those manually?

opal plank
#

theres nothing in TOS that says i cant have multiple bots to split the workload and cluster/shard it

#

yeah, you cant automate creation of accounts

#

THATS against tos

placid iron
#

i assumed so lol

opal plank
#

they were all proxied too

placid iron
#

damn, that is a lot of work i guess OmegaKEKW

opal plank
#

so it wasnt all being done in a single IP

#

cuz otherwise that'd fuck up good time

#

yeah, that was one of my biggest projects

#

being able to fetch legit 95% of twitchs global viewers is an insane task

#

was one hell of an experience for clustering and large scale development though

#

i learned a lot

stark abyss
#

UPDATE clanusers SET donation = 0 WHERE claninfo.due = 1
ERROR: syntax error at or near "0"

placid iron
#

definitely, and better you than me. i dont think i could do that with my current experience cry

opal plank
#

you're trying to squeeze every single bit of performance when you get at this scale, cuz it stacks, and QUICK

placid iron
#

oh yeah

opal plank
#

i used a promisifed IPC pipe between all slaves(processes) to assign channels to eachother

#

one central controller managing all of them and dispatching events

mighty ember
#

who would i have my bot send a message when someone votes?

placid iron
mighty ember
#

😕

opal plank
#

do you even have an approved bot?

placid iron
#

@opal plank those words just go over my head tbh cry

stark abyss
#

yeah

#

bigInt

opal plank
#

its complicated stuff trust me, i had a rough time

mighty ember
placid iron
#

lmao

mighty ember
#

not who

lyric mountain
#

how what

opal plank
mighty ember
#

nope

lyric mountain
#

ah, webhooks then

opal plank
#

then you cant

mighty ember
#

why not?

lyric mountain
#

because u need the token

opal plank
#

you need a bot approved to be able to recieve events

#

not even token

mighty ember
#

i mean when someone votes for the server

opal plank
#

webhooks dont need token

lyric mountain
#

oh, yeah

placid iron
#

@stark abyss hmmm, im not sure why there is a syntax error then

lyric mountain
#

forgot that

opal plank
#

you dont have access to the webhooks tab

#

nor can anyone vote for ur bot

#

cuz, yknow, not approved

#

oh, servers

opal plank
stark abyss
#

@placid iron to like use a different table you go <tablename>.<variable> right?

opal plank
#

check channel topic

placid iron
#

ive never used foreign tables unfortunately so i cant help you there

stark abyss
#

okay ty

mighty ember
opal plank
#

you NEED programming to do it, or pay someone to do it for you

mighty ember
#

i know how to program, but not how to make a webhook

opal plank
#

then i can foward you the docs

mighty ember
#

okay

opal plank
#

use this

#

and

#

this

mighty ember
#

can webhooks give roles?

opal plank
#

not without a bot

#

no

lyric mountain
#

no, webhooks will only send u "X dude just voted"

#

nothing more

opal plank
#

you can have a bot give roles when the webhook triggers tho

#

you'd host the bot WITH the webhook

mighty ember
#

what's node-sdk?

opal plank
#

both together

stable nimbus
#

me who uses the deprecated since it still works

opal plank
#

its the package to use

#

you dont NEED it, but its good to use it

#

technically you just need express or some other webserver module

mighty ember
#

i thought that was java

humble rampart
#

Hi

opal plank
#

nah, its javascript

#

but theres a java module iirc

mighty ember
#

i only know how to program python

opal plank
#

theres that too

#

flask and something else

#

let me grab it rq

placid iron
#

use aiohttp smh

mighty ember
#

PM me for it

opal plank
#

here

mighty ember
#

thanks

opal plank
#

np

mighty ember
#

what happens when the bot is approved that allows me to use top.gg things?

#

i really do not want to try to make a webhook

sage bobcat
#

One message removed from a suspended account.

opal plank
opal plank
#

the role thing you dont need an approved bot

#

you can have a private bot for just your server

mighty ember
#

what is the difference of a webhook and bot?

#

why won't a bot work?

opal plank
#

webhook is something LISTENING for incoming events (aka, in this case, votes)

#

a bot is a robot that reacts and does stuff, basically commands or something in that regard

stark abyss
#

webhook can't send messages right is that what you said?

opal plank
#

it can yeah, but for simplicity sake, im explaining it very curdely

mighty ember
#

which could check for stuff

opal plank
#

indeed, but thats beyond the point

stark abyss
#

oh i see

mighty ember
#

i just can't make a webhook

opal plank
#

u can

#

u just dont want to

mighty ember
#

you need a website or something

opal plank
#

you dont

#

the examples in the docs literally give you an example

#

you can use your home adress

#

and host the bot yourself

#

or, webhook*

placid iron
#

yeah but if you have a dynamic ip then things gonna be annoying

outer perch
#

I can't seem to find on the internet, how do I use the built-in embed builders?

lyric mountain
#

in the docs...

earnest phoenix
#

g

mighty ember
lyric mountain
#

after the beginning and before the end

#

like, just read it as a whole

mighty ember
opal plank
lyric mountain
#

but since ur starting from scratch, u should

mighty ember
stark abyss
#
UPDATE clanusers 
SET clanusers.donation = 45 
FROM claninfo 
WHERE claninfo.due = 2

ERROR: column "clanusers" of relation "clanusers" does not exist
LINE 2: SET clanusers.donation = 45
would relation be something that both table has?

lyric mountain
opaque seal
#

Can I pass an async function to .call ?

shardsManager.broadcastEval(`(${sendRegisteredVoteNotification}).call(this, ...args)`)

async function sendRegisteredVoteNotification...

mighty ember
placid iron
mighty ember
#

i didn't really get much help here, bye

stark abyss
placid iron
#

np 👌

lyric mountain
#

literally java bible

#

about 4kg of paper

stark abyss
#

fr let me look it up

#

literally the core so makes sense

outer perch
#

can someone freaking tell me how do I use the embed builders?

solemn latch
#

djs?

drifting wedge
#
with open('config.json', 'r') as config:
    botStatus = config["botStatus"]
    token = config["token"]
    ipcKey = config["ipcKey"]
    shard_count = config["shard_count"]```
#

says object not scriptable

outer perch
# solemn latch djs?

no, I think it was Not Erwin who said you could do it another way without using D.js'

solemn latch
#

yeah, using objects, not the embed builder

outer perch
#

AH, that

#

how to?

solemn latch
#

I dont remember most of the formatting tbh

earnest phoenix
outer perch
#

@opal plank how to Embed through objects?

drifting wedge
#

mhm

#

got it

#

ty

solemn latch
earnest phoenix
#

there is no sign up button

solemn latch
#

its just an object with various properties

opal plank
outer perch
#

k

drifting wedge
#
    ipc = ipc.Server(secret_key=ipcKey)
TypeError: __init__() missing 1 required positional argument: 'bot'``` error with running discord.ext.ipc
#

am not running it in a class

solemn latch
opal plank
#

{embed: {
description: '',
image: {url: ''},
fields: [{value:'', name:'', inline: true}]
}}

#

like that

outer perch
#

ty

#

hehe, new interface

#

wait, Embed's a type, right?

#

so maybe I don't need an interface

slate oyster
#

Let's all have a SYNTAX HIGHLIGHTING PARTY!

earnest phoenix
drifting wedge
earnest phoenix
#

no what

#

the bot object itself

drifting wedge
#

lol

#

uhh

#

in the params?

earnest phoenix
#
class Bot(commands.Bot):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs):
        self.ipc = ipc.Server(self, ...)  # self is the bot instance

# or

bot = commands.Bot(...)
bot.ipc = ipc.Server(bot, ...)
drifting wedge
#

OHHHHHHHHHHHH

#

alr

#

in the docs their example is in a class

#

so thats why

#

ty

#

tysm @earnest phoenix

lyric mountain
#

It explains to minimal details everything

#

With examples, images, etc

#

Sadly it's paid

#

I once borrowed it from my teacher to research for my graduation proj

stark abyss
#
UPDATE clanusers 
SET donation = 0
FROM claninfo 
WHERE claninfo.due = 2```
So this doesn't return an error but but all donation is set to 0 even if claninfo due isn't 2
#

nice

lyric mountain
stark abyss
#

what does that mean nephehL

lyric mountain
#

UPDATE c.clanusers SET c.donation = 0 FROM claninfo c WHERE c.due = 2

opal plank
misty sigil
#

ok erwin’t

lyric mountain
#

Erlose

quartz kindle
stark abyss
#

oh okay let me try that

quartz kindle
#

because that query is literally doing "update a where b = c" but b and c have no relation to a

#

so it gets all from a

lyric mountain
#

I believe those are all fields of claninfo

#

Like, please

stark abyss
#

i haven't linked it to anything

lyric mountain
#

Don't tell me those are individual tables

stark abyss
#

nephehL i see that's my problem

#

they are

lyric mountain
quartz kindle
#

clanusers is one table, claninfo is another table right?

stark abyss
#

yes

quartz kindle
#

you want to update donations of a specific user based on what?

#

how is the user linked to the clan?

stark abyss
#

with var "clan"

quartz kindle
#

no like

lyric mountain
#

Column, plz

quartz kindle
#

how do you know which user belongs to which clan

#

does clan have something like an owner id? does a user own a clan?

#

or does the user have a clan id?

stark abyss
#

there is clan id

#

and users belong to that primary key called "clan"

#

does that make any sense?

quartz kindle
#

nope

stark abyss
lament rock
#

I'd have indexed user ID's as primary key unless users can be in multiple clans and then have the clan ID be a secondary key so that you can get user clan relationships quickly and also filter by all users in a clan.

Anyways, you're supposed to join the two tables on the clan ID

stark abyss
#

clanusers id is discord user id, and clan is a clan id

lyric mountain
#

No, please no

quartz kindle
#

ok so thats user

lyric mountain
#

Don't tell me that's mysql

stark abyss
#

postgres?

lyric mountain
#

Oh thank u

lament rock
#

There's nothing wrong with MySQL?

quartz kindle
#

so a user can only have 1 clan right?

stark abyss
#

yes

quartz kindle
#

and you want to check if that clan is due

lyric mountain
#

What's that manager btw?

quartz kindle
#

so you would do something like ```sql
UPDATE
clanusers,
claninfo
SET
clanusers.donation = 0
WHERE
claninfo.id = clanusers.clan
AND
claninfo.due = 2

#

idk the exact syntax for postgres

stark abyss
#

oh

lyric mountain
#

Ah, pgadmin4

stark abyss
#

okay thank you

lyric mountain
#

It's kinda niche I'd say

lament rock
#

Go on, then. Explain why I shouldn't use it

quartz kindle
#

there are a few articles about it

lyric mountain
#

Nah, too lazy

#

Those kind of discussions take too much time

quartz kindle
#

something about collations, data loss, error swallowing, allowing unsafe operations

#

etc

#

not being RFC compliant by default

#

requiring additional configuration to behave like a "normal" database

gilded olive
# lament rock Go on, then. Explain why I shouldn't use it

Stole from an tag but

TL;DR: MySQL is a bad database. Don't use it unless you have literally no other option.

Why shouldn't I use MySQL?

 - MySQL has no transactional DDL. This means that if you fuck up creating a table in the middle of a migration, you cannot rollback easily.
 - MySQL has a lot of security issues. New zero-day vulnerabilities are found regularly.
 - MySQL is owned by Oracle.
 - MySQL is slow. It beats Postgres etc at some things, but once you move beyond basic queries it begins to slog.
 - MySQL disconnects you randomly. Unless you setup your connection specially, it will break regularly.
 - MySQL allows all kinds of insane data to be inserted. '0000-00-00' is valid in MySQL.
 - MySQL is not ANSI compliant. You have to turn it on; even then it isn't fully compliant.
 - MySQL has no feature advantage over other databases; PostgreSQL has many more useful features (such as RETURNs).

There is no reason to use MySQL over PostgreSQL, or even sqlite3. See also:
https://blog.ionelmc.ro/2014/12/28/terrible-choices-mysql/
https://grimoire.ca/mysql/choose-something-else```
quartz kindle
#

yeah those were the two articles i've read

lyric mountain
#

Erwin iirc, right?

lament rock
#

data loss is concerning and valid. I still believe people shouldn't be told the database they're using isn't a valid option considering there isn't a good way to discern the difference between MariaDB and MySQL

#

Proprietary and closed source software also doesn't mean that it's bad

lyric mountain
#

Plus you can import mysql ddl into postgre

#

So migrating is kinda easy

quartz kindle
#

there was also some complaint about it having multiple storage engines and how that made it all fucked up

earnest phoenix
lament rock
#

Tell that to a bunch of professional work places and educational establishments who unironically use java aEyeRoll

lyric mountain
#

Java is good, oracle is bad

lament rock
#

Debatable

quartz kindle
#

oraculus rift, java the hutt

lyric mountain
#

Not at all, oracle could've been such a good name

#

But they threw it to the mud

lament rock
#

I'd say the only thing java has going for it is type safety. Even then, most langs have that

earnest phoenix
lament rock
#

24hz HideThePain

earnest phoenix
#

you also have to provide your social security number and your DNA sample before buying

blissful coral
#

So for some reason, my express is being stinky and not logging anything to console on this POST request

rose warren
#

PostgreSQL more efficient than MYSQL?

blissful coral
#

nothing in console

lyric mountain
#

Isn't site having issues?

blissful coral
#

Not for testing webhooks

#

I asked staff

lament rock
#

make sure the req method you're using in postman/whatever is actually using post

blissful coral
#

It has worked before I had a problem with mongo and had to redo it

#

But it is probably a site error right?

#

the mongo problem happened around the same time as the site went down^

lament rock
#

idk too much about nginx. If the rest of the site served by express works, idk

blissful coral
#

Idk what is going on

#

The button used to like make a little push when it was clicked right?

quartz kindle
blissful coral
#

Hm

#

Inspect is getting a can't read content 'textContent' of null

lament rock
#

BREAKING NEWS: Oculus, Microsoft, HTC and Valve all push a firmware update limiting headset refresh rates to 24Hz. In an interview with them, they all said: "We wanted to give our users a 'cinematic' and 'immersive' experience."

quartz kindle
#

ex dee

lament rock
#

Guess I should have also tossed in nolo but whatever

broken matrix
#

I cant edit my bot page did they move the button

#

this is all i see

quartz kindle
#

they are working on many changes

#

so just wait a day or two for things to be normal again

broken matrix
#

Alright thank you

stark abyss
#
UPDATE clanusers 
SET donation = 0 
FROM claninfo
WHERE claninfo.due = 2
AND
claninfo.clan = clanusers.clan```
in case anybody wanted to know, ^this worked
quartz kindle
#

yes, now it makes sense

mighty ember
#

is anyone willing to give me a sample bot program to do something when someone votes for the server?

#

the docs are very weird

snow urchin
lyric mountain
#

Node version?

empty vault
#

hmmm

#

i guess..uh

#

there is command which is error you may have to fix it

stark abyss
#

Table clanusers - clan, id, donation
Tabel claninfo - clan, due, fee
I want to subtract fee from donation each user (id) has.

UPDATE clanusers 
SET donation = 0 
FROM claninfo
WHERE claninfo.due = 2
AND
claninfo.clan = clanusers.clan```

This is how it sets the donation value on all `id` ig. Would I have to do this one by one, or is there a convenient way to do it?
empty vault
#

@stark abyss i dont know exactly but i guess u have to do this one by one..idk maybe

stark abyss
#

that's what I am guessing as well

empty vault
#

did u try by using one by one

stark abyss
#

no weird

empty vault
#

hmmm

stark abyss
#

wait no there must be some way

blissful coral
#

Anyone know how to fix?

#

tried ```sudo chown -R mongodb:mongodb /var/lib/mongodb
sudo chown mongodb:mongodb /tmp/mongodb-27017.sock

sudo service mongod restart```

#

Didn't work

crimson vapor
#

bro

limber flume
#

bro

crimson vapor
#

sudo servicectl status mongodb

#

@blissful coral

blissful coral
#

command not found

crimson vapor
#

sudo service status mongodb

#

then

blissful coral
#

your linux knowledge is off

crimson vapor
#

shhh

blissful coral
#

its sudo service mongod status

crimson vapor
#

sec

blissful coral
#

lmao

crimson vapor
#

what the fuck

blissful coral
#

yea

crimson vapor
#

I swear wtf

#

fuck

#

sudo systemctl

#

im just dumb

stark abyss
#

ya all ever just feel so useless and want to quit coding

crimson vapor
#

no

stark abyss
#

dang I am the only one nephehL

crimson vapor
#

probably not

blissful coral
crimson vapor
#

honestly a reason why it failed

#

bad config or can't bind to port are common

blissful coral
#

then you have wrong command

crimson vapor
#

no you need to add the status mongod

blissful coral
#

or do that

crimson vapor
#

bro im just so bad at linux

blissful coral
#

LMFAO

crimson vapor
#

you don't understand

blissful coral
#

L

#

it isn't too hard

#

to learn

#

lmfao

crimson vapor
#

run the mongod command the same way

#

that the thing does

#

and see if it errors

drifting wedge
#

i literally have the file in the folder

lyric mountain
#

Do you?

drifting wedge
#

i just said i did?

lyric mountain
#

Remember ./ is "in the same folder", while ../ is "in parent folder"

drifting wedge
#

ye ik

lyric mountain
#

Why does it have ...?

drifting wedge
drifting wedge
#

the file directory

blissful coral
#
Feb 17 19:35:56 ExtremeDevelopments systemd[1]: mongod.service: Main process exited, code=exited, status=14/n/a
Feb 17 19:35:56 ExtremeDevelopments systemd[1]: mongod.service: Failed with result 'exit-code'.```
#

@crimson vapor

lyric mountain
#

Hm

blissful coral
#

That's it

stark abyss
lyric mountain
#

Try without ./

drifting wedge
#

i did already

lyric mountain
#

Weird

drifting wedge
#

same thing

#

has happened a lOT

#

dealing with json files

lyric mountain
#

If u list all files in the folder what does it output?

drifting wedge
#

wdym all the folders?

lyric mountain
#

Not folders, files

#

Like, get all files in the folder

drifting wedge
#

ls?

lyric mountain
#

And print

drifting wedge
#

whats the code for files?

placid iron
#

Uh

#

How do you run the script

drifting wedge
#

Ls gives folders

#

what about files?

placid iron
#

Ls gives files

lyric mountain
tribal siren
lyric mountain
#

Why go up one folder?

placid iron
#

Your python is mostly just not in the same directory at run time

tribal siren
#

well how many folders are there

drifting wedge
#

ls doesnt show the config file

placid iron
#

Just set the environment path to the files location

lyric mountain
#

Then it's changing structure during runtime

drifting wedge
#

so what can i do?

placid iron
#

This is pog

#

Then just have everything relative to that files location

#

Which is probably what you got airway

#

Already

#

You don't need the name == main part

blissful coral
#
chown -R mongodb:mongodb /var/lib/mongodb
chown mongodb:mongodb /tmp/mongodb-27017.sock
#

Tried this

#

Didn't work

drifting wedge
#

?

#

u talking to me>

blissful coral
#

no million

#

wherever he went

#

@crimson vapor come back boy

drifting wedge
#

how can i like get it to see the config file?

placid iron
#

Read my messages

drifting wedge
#

i did

#

i didnt understand u

#

its in the same folder as the file calling it

placid iron
#

You literally have to copy one line of code

#

Just do it

#

Explaining is hard

drifting wedge
#

which line lol

#

i doNT KNOW WHAT u MEAN

placid iron
#

Omfg

drifting wedge
#

oh

#

i see

placid iron
#

I'm going

drifting wedge
#

i got it

placid iron
#

Cya

drifting wedge
#

i undersTOOOD

#

it says none

#

@placid iron

stark abyss
#
UPDATE clanusers
SET donation = clanusers.donation - claninfo.fee
FROM claninfo
WHERE claninfo.due = 2
AND
claninfo.clan = clanusers.clan```
figured it out ![RapSmiles](https://cdn.discordapp.com/emojis/777329570213920828.webp?size=128 "RapSmiles") wasn't all complicated as i thought
blissful coral
#

Lasted a lil bit...

#

LMAO

latent heron
crystal wigeon
#

hey umm

#

my bot isnt starting even with the right credentials

#

it suddenly went down a while ago

#

and its not coming back up

lyric mountain
#

Discord is down

crystal wigeon
#

but other bots are working?

lyric mountain
#

Not at all

crystal wigeon
#

i tried to lift my test bot and it worked

lyric mountain
#

Some seem to work, but some can't respond

#

Get used to it, happens from time to time

crystal wigeon
#

yo

#

lol

lyric mountain
#

Just connected successfully

latent heron
#

What do you guys think about this? Trying to find a more user-friendly method of getting help for bot commands.

#

Instead of having to force a user to type the name of a command, I could present them with a list of types of commands and then if they choose, it gives them more details.

#

Is this a good route, or should I stick to making the user type the command name through the help command instead?

opal plank
#

@delicate zephyr @earnest phoenix dudes

#

i've got an announcement

#

the dashboard has been upscaled

blissful coral
#

I need luke rn lmfao

crystal wigeon
opal plank
#

theres now metrics to compare the local test bot with the prod version for stability comparison/testing

latent heron
#

oh wow

#

how did you get it to look like this?

opal plank
#

made it

latent heron
#

that's a little obvious..

opal plank
#

grafana

latent heron
#

eng?

opal plank
#

huh?

latent heron
#

thank

#

it looks very clean

drifting wedge
#

@lyric mountain any ideas to fix it?

crystal wigeon
#

so bots are eworking fine?

drifting wedge
#

Like python not finding the file

earnest phoenix
#

@opal plank clean as always

opal plank
#

SO

#

MCUH

#

DATAAAA

round cove
opal plank
latent heron
crystal wigeon
#

yoo

#

someone help

latent heron
#

i want to know if it's easier for people to do

round cove
#

I think it is since it pops up the options.

latent heron
#

besides doing some stupid weird shit like /help [command name] [command arg]

#

that would drive people crazy imo

round cove
#

Right right

lament rock
#

I thought cf banned my IP CVRchanSweat

drifting wedge
lament ruin
#

how would i get the header value of a post req in aiohttp? i tried .header() doesnt seem to be an attribute though

uncut swallow
#

/help

opal plank
crystal wigeon
uncut swallow
#

lol

opal plank
#

theres like 5 different sources there

#

this dual one is nice as fuck

#

it added so much to what i had

lament ruin
opal plank
#

i've been looking at it for the past 20 minutes nonstop

crystal wigeon
#

ye

#

ig i'll wait

uncut swallow
#

How can I subtract numbers in meowdb?
Thonk

stark abyss
#

postgres documentation is almost 2.8k pages nephehL

crystal wigeon
stark abyss
#

NephehR thx

#

UPDATE clanusers SET donation = clanusers.donation - claninfo.fee FROM claninfo WHERE claninfo.due = 2 AND claninfo.clan = clanusers.clan
this one line took me like 5 hours but then new to sql and postgres

uncut swallow
#

lol

crystal wigeon
#

;-;

earnest phoenix
#

Well you just gotta wait i guess

uncut swallow
#

..

lament rock
#

This is gonna be a pain. Moving from Maria to Postgres and queries by default lowercase table names and column names. Imported my old DB and everything got lowercased. Guess I'll just have to rename everything to snake case and change all of my client code which uses sql.

snow urchin
quiet badger
#

How long does it take for a bot to be accepted?

quiet badger
#

thanks

mighty ember
#

could someone give an example of a python code that sends a message when someone votes for my server?

earnest phoenix
#

Hello-

mighty ember
snow urchin
#

🤷‍♂️

thorn vine
#

hello

mighty ember
crystal wigeon
#

what status should be looking for on cloudflare?

#

im still not able to connect

hearty island
#

yey

calm salmon
#

hey where will i get information of chess bot

drifting wedge
#

Yo

#

Python says a folder doesn't exist

#

Any ideas?

#

File*

#

It's in the same folder

earnest phoenix
#

Try printing os.getcwd()

ornate otter
#
    at Api._request (/home/container/node_modules/@top-gg/sdk/dist/structs/Api.js:74:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Api.postStats (/home/container/node_modules/@top-gg/sdk/dist/structs/Api.js:94:9)
(node:26) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:26) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
shell pivot
silver lintel
#

does mongodb handle large collectrions well?

#

for finding docs

#

and how long it takes

latent heron
#

what kind of size is your project?

#

is your bot going to be doing small DB stuff or is it going to need scalability/large-end tasks?

#

the database type you use will be really dependent on the size and scope of your project

silver lintel
#

not that big

#

only a few hundred docs

ornate otter
crystal wigeon
#

ok

#

im still not able to connect

#

its been more than an hour ig?

hoary crown
earnest phoenix
blazing sage
#

yes u can

#

u mean da bot page ryt?

#

or do u?

earnest phoenix
blazing sage
#

IDK

#

sry

uncut swallow
#
    at Api._request (D:\DATA.C\Documents\bot_sandwich\node_modules\topgg-autoposter\node_modules\@top-gg\sdk\dist\structs\Api.js:74:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Api.postStats (D:\DATA.C\Documents\bot_sandwich\node_modules\topgg-autoposter\node_modules\@top-gg\sdk\dist\structs\Api.js:94:9) {
  response: '<!DOCTYPE html>\n' +``` gg
earnest phoenix
#

i want to change description to this

#

it is not verified yet

blazing sage
#

aha so wats da problem

#

just change it

#

and in bottom, click submit

earnest phoenix
blazing sage
#

Hmmm

snow urchin
#

You cant change any info that was submitted wait i forgot u can shhh

blazing sage
#

I could LOL

zenith terrace
#

you can change the description...

blazing sage
#

ikr

zenith terrace
#

go to your bot page, edit and go to description

blazing sage
uncut swallow
#

how change it?

blazing sage
#

just change it

#

and then resubmit

uncut swallow
#

ok

blazing sage
#

👍🏿

#

👍

earnest phoenix
blazing sage
#

hmmmm

#

do u hv another form on top.gg wit same bot id

earnest phoenix
#

i want to say that

blazing sage
#

dats y LOL

earnest phoenix
#

i want t o edit that form

blazing sage
#

Delete the second one

#

delete one of them

#

not necessarily second

earnest phoenix
blazing sage
#

dat idk

#

there is a delete

#

button

earnest phoenix
blazing sage
#

Just paste it and click on submit

#

paste info in dat description

#

then submit

snow urchin
stark abyss
#

What is source.pause() supposed to do? @snow urchin

snow urchin
#

idk, its what data.append is doin ig

uncut swallow
#

The ad in English says: my stepmom is horny and says: it's time to teach my stepson how to be a man .
wtf!!!

stark abyss
#

Probably based on what you searched or something

uncut swallow
#

trolled

stark abyss
#

Don’t get me wrong it’s pretty nice I read it pogGod

uncut swallow
stark abyss
snow urchin
#

source.pause is a function from data.append

stark abyss
#

It’s saying it’s not

#

If you actually read the error

#

If you are 100% sure it is an function you are likely not using it right

uncut swallow
#

what is shards??

stark abyss
#

I don’t know much about them, but i think it’s like a server. I think of it as a server if you have like 10000 server you are going to have to get more shards in order to have the bot be efficient. This is what I personally understand it as I could be wrong

lusty quest
uncut swallow
#

oh

stark abyss
#

I wasn’t sure about the number that’s why I just made it 10k

tribal siren
uncut swallow
#

ohh

lusty quest
#

not really into more bots, into mutiple processes

stark abyss
#

Yeah I was gonna say like copy

#

Invisible copy

uncut swallow
#

but the shards is good or not?

stark abyss
#

They are good if you have large amount of servers

lusty quest
#

if you are at 2000 guilds yes otherwise no

stark abyss
#

If you don’t have large amount of server u don’t need it

empty vault
#

hmmm

elfin shadow
#

need help with discord py, how do you use is_on_cooldown when checking the cooldown of a different command?

command a displays the cooldown of command b

snow urchin
#

how can I fetch an uncached user by their username?

pale vessel
#

you can only do that with members

#

by using the ws

plush bay
#

Hola

pale vessel
#

where is norizon when we need him

plush bay
#

Hola

lusty quest
barren solstice
#
    at C:\Users\Acer\desktop\rr\node_modules\node-fetch\lib\index.js:272:32
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Random.getMeme (C:\Users\Acer\desktop\rr\node_modules\random-discord\src\random.js:10:17)
    at async meme (C:\Users\Acer\desktop\rr\commands\memes.js:10:17)
(node:20024) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:20024) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.``` this error is popping up :( im using random-discord
tardy hornet
#
case 'lb':
  var money = db.startsWith(`money_${message.guild.id}`)
  let content8 = "";

  for (let i = 0; i < money.length; i++) {
    let user8 = bot.users.get(money[i].ID.split('_')[2]).username

    content8 += `${i+1}. ${user8} ~ ${money[i].data}$\n`
  }
    const leaderboardembed = new Discord.MessageEmbed()
    .setAuthor(`${message.guild.name} - Leaderboard!`, message.guild.iconURL)
    .setDescription(content8)
    .setColor(bsc)

  
message.channel.send(leaderboardembed)
break;

i have that leaderboard command, its doing it for all users, i want it to show only the top 10 that are in the server that the message (command) was sent.

barren solstice
#

discord.js ?

tardy hornet
#

yes

barren solstice
#

ight lemme see

pale vessel
#

then do i < 10?

barren solstice
#

what NPM library u using

#

you forgot semi columns

pale vessel
#

what

tardy hornet
pale vessel
#

@tardy hornet if you want to limit it to ten then use i < 10 instead of i < money.length

tardy hornet
#

?

pale vessel
#

Yes

tardy hornet
#

oki, now i want it not to send the top 10 of all

lusty quest
tardy hornet
#

just the top 01 in the server

barren solstice
#
        const money = db.startsWith(`money_${message.guild.id}`);
        let content8 = '';

        for (let i = 0; i < money.length; i++) {
            const user8 = bot.users.get(money[i].ID.split('_')[2]).username;

            content8 += `${i < 1}. ${user8} ~ ${money[i].data}$\n`;
        }
        const leaderboardembed = new Discord.MessageEmbed()
            .setAuthor(`${message.guild.name} - Leaderboard!`, message.guild.iconURL)
            .setDescription(content8)
            .setColor(bsc);

        message.channel.send(leaderboardembed);
break;```
pale vessel
#

then money[0]?

barren solstice
lusty quest
pale vessel
#

you need to make sure that money is already sorted though

tardy hornet
earnest phoenix
#

Hey i have an object in my guild config model with some properties inside it. I would like to delete it and its properties from all documents. Note: on some documents it doesn't exist. How would i do that use mongoose?

dreamy yoke
#

rare question but can webhooks post in announcements channel and still get published (as in channels following that channel will still get posts from the webhook)

lusty quest
#

or did you just want to delete all documents including certain stuff?

earnest phoenix
#

Yeah i tried to updateMany and made that object null. But it still remains in the document. Is there a way to completely it?

lusty quest
#

wait nvm this is for sub documents

#

look into deleteMany() it might be the correct way

earnest phoenix
#

ill try to explain a bit more. I have this object in my guildconfig documents. I want it to be removed from all of the documents. Only this object called automod not the documents.

#

I think i can .find all of them. Then delete the objects with node and update them 🤔

lusty quest
#

just use updateMany instead

barren solstice
lusty quest
#

strange, ive get this errors sometimes from one API bcs the API decides to shit itself

earnest phoenix
lusty quest
#

is automod not inside an array?

#

did you tryed $unset?

earnest phoenix
#

Unset seems to work, tysm 😄

amber quiver
#

Im getting errors that I cant send empty message... why?

#

yhe var should be const?

#

I tried and it says: const is not a valid token

#

w

near stratus
amber quiver
#

8

amber quiver
near stratus
#

k

amber quiver
#

I cant find what is wrong

#

thiis is the error

#

@near stratus

#

??

#

someone

#

?

near stratus
#

hol on
JS allows unblocked if ?

amber quiver
#

wdym

near stratus
#

if(true)
//do this
instead of ```js
if(true){
//do this
}

amber quiver
#

ah yes

#

it alloes

#

I think

#

allows

near stratus
#

lemme test it myself

amber quiver
#

ok

#

coz I think its worked in my other bot project

#

I didnt knew this too

#

I saw it on stack overdlow I think

#

and I think its actually worked on my other bot... so weird

near stratus
#

It works on my test too

amber quiver
#

so why it isnt working

#

in my code?

barren solstice
amber quiver
#

I think so

barren solstice
#
            .setColor('#0099ff')
            .setTitle('text')
            .setDescription('text')
            .setThumbnail('')
            .addFields(
                { name: 'name' },
                { name: 'name' },
                { name: 'name' },
            )
            .setTimestamp();
        message.author.send(testembed);```
#

here

amber quiver
#

I dont need reaction

barren solstice
#

just delete it then

amber quiver
#

but still' I want my code to work coz its very weird

#

I cant find the problem

near stratus
#

@amber quiver could you send the code

near stratus
#

like paste here

amber quiver
#
client.on("message", message => {
  if (message.content === `${prefix}clear`) {
     if (!message.member.hasPermission("MANAGE_MESSAGES")) 
      var embedMessageError = new Discord.MessageEmbed()
      .setColor('#FF0000')
      .setTitle('ERROR')
      .addField('OOPS', 'It\'s look like you have no permission to do that!')
      message.channel.send(embedMessageError)
      .then(msg => {
    msg.delete({ timeout: 5000 })
   })
   if (message.member.hasPermission("MANAGE_MESSAGES")) 
   var embedMessagesuccesful = new Discord.MessageEmbed()
     .setColor('#FF5800')
     .setTitle('succesful command')
     .addField('a^clear', 'the messages got deleted!')
       message.channel.send(embedMessagesuccesful)
       .then(msg => {
     msg.delete({ timeout: 5000 })
    })
  }
})```
#

here

near stratus
#

k

#

lemme see

amber quiver
#

and also, when Im trying to catch errors in the code, the bot is still stopping

#

even tho Im using .catch(console.error) or try and catch

near stratus
#

When I write your code manually I don't get any error but when I copy it it shows error

amber quiver
#

wow

#

what

#

how

#

when you wrote the code'=, it didnt show any errors?

#

and when you wrote it manually, it shows error

near stratus
#

yeah

#

lol

amber quiver
#

why

#

wth

near stratus
#

lemme modify it little bit

cinder patio
#

You need to put the code in the if statement in a code block

cinder patio
#
  ...
}```
amber quiver
#

look closely

cinder patio
#

You don't