#development

1 messages · Page 1872 of 1

static trench
#

it may be a path issue

#

idk

brittle oyster
#

are you running with python3?

proven lantern
#

should i make another lambda and call it asynchronously before returning the ACK response?

terse flume
#

what package include defer()`?

#

wanna do interaction.defer()

calm stone
#

<@&695153281105920070>

#

how can i get my bot webhook auth

modern sable
#

dont ping the role thanks

calm stone
boreal iron
#

On the edit page you can see another input for Authorization. Here you can provide a shared secret that you can check for on the server side.

#

To verify requests are coming from us, look for the value in the Authorization header and make sure it is the same as the value you provided in the form.

outer perch
#

so much fun

#

I just installed a desktop and rn I am RDPing into my VPS

#

I think sacrificing 2 to 3 GB from 50GB NVMe isn't bad

grim aspen
#

@sinful belfry

#

jnvm

sinful belfry
#

oops im slow KEKW

drifting shell
#

can anyone help me with setting up prometheus
ive got all my counters and histograms up and whatever
i just dont know how to get prometheus to record/scrape it

#

im using java to record it btw as my app is written in java

modest maple
#

You just add the url to the prometheus config to scrape

woeful pike
#

smh imagine using pull based metrics

outer perch
#

how can I decrease response time?

#

it's taking between 100 and 600 ms

sudden geyser
#

You'll need to figure out what's causing your response time to be slow.

outer perch
#

big fart

#

I don't even know how can I see that

#

cuz debugging won't help for sure

#

it'll probably send off an unreal value for the response time

wheat mesa
#

Well, you can look at some possible issues

#

Are your commands taking long to respond because they’re computationally expensive?

#

Etc

#

Connection issues, host far away from the servers, slow host

limber mica
#

How do I make my bot react to a specific message in a specific guild in a specific channel

sudden geyser
#

What library are you using

limber mica
#

Forgot to say XD

sudden geyser
#

You need the message to react on (https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=react), but you can obviously filter it down like checking the channel ID (<Message>.channel.id === ...). In Discord's API, all you need is the channel, message, and emoji (https://discord.com/developers/docs/resources/channel#create-reaction)

Discord Developer Portal

Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.

#

For example, if you had the message and channel ID, you could do <Guild>.channels.get(...).messages.get(...).react(...)

limber mica
#

Ok! Thank you!

deep mantle
#

Wow, on this topic i am trying to create a reaction on a message, I am doing the put request to https://discord.com/api/v8/applications/773725697776549888/channels/842441853726228540/messages/885656702245040128/reactions/crate:885655992505860147/@me. I also tried to URL encode it with https://discord.com/api/v8/applications/773725697776549888/channels/842441853726228540/messages/885656702245040128/reactions/crate%3A885655992505860147/@me but it keeps returning a 404. Am I doing the request wrong?

sudden geyser
deep mantle
#

ok thank you

valid frigate
#

did the thread permission update change anything in the v9 api

proven lantern
#

i am getting a 400 error with this request

#

anyone see an issue with it?

quartz kindle
#

pretty sure field name is required

#

you have two fields with no name

proven lantern
#

oh dang

#

how did that happen

earnest phoenix
woeful pike
#

what are u doing dude

earnest phoenix
#

Hm?

#

Me?

quaint wasp
#

ping in replies

#

also open the file with the toold as file viewer on pc if on pone then RIP

errant flax
quaint wasp
#

😑

errant flax
#

i aint gonna download a file to help u

#

whats the prob with it?

lyric mountain
#

Hatebin easier and faster

plain talon
#

props if you remember md-5 from mc

earnest phoenix
#

@boreal iron so the problem wasnt in the code, it was the invite link I was using and the mobile app not working properly until used on pc

alpine pendant
#

Hello everyone can you please someone help me my bot there is not join stage channel can someone help me about that after new update discord this is happen 💐

boreal iron
# earnest phoenix <@!243443167704121344> so the problem wasnt in the code, it was the invite link ...

Well yeah you need the application.commands scope in order to use slash commands.
Thought I did mention that but probably not.

It doesn’t change the fact you’re registering the commands over and over again which is API spam.
A proper handler to register/edit/delete commands still is important.

Your method you’re currently using also provides no way to remove a global command.

Considering switching to slash commands at all (because we all need to) should also include a proper setup how to handle and deal with them but not just a few code snippets thrown together in order to get things to work somehow.

#

Just how I see things…

foggy zinc
#

how do i get the message that caused an error when using oncommanderror (discord.py)

proven lantern
#

do unverified bots have a lower rate limit than verified bots?

earnest phoenix
#

So i just continued programming again after 8 months and i see many changes on discord.js but whys this??

#

Anyone??

lyric mountain
earnest phoenix
#

But how do i update it to latest version

feral skiff
lyric mountain
#

For replit you'll need tim's hack

#

Since repl can't update to latest node normally

earnest phoenix
#

Tim’s hack??

earnest phoenix
#

Cause maybe im using repl

pale vessel
old cliff
#

npm install node@16.x

lyric mountain
old cliff
#

worked for me earlier this month

lyric mountain
#

Maybe repl finally added support for v16 then

old cliff
#

nah doesnt work... let me recall what exactly I used

earnest phoenix
lyric mountain
#

Use tim hack

earnest phoenix
#

I really dont remember what i did back then

lyric mountain
#

Instructions are there

earnest phoenix
#

I already unistalled the bettersqlite3 thing

#

Whys still that

#

Oh got it

#

Oh shit sorry i leaked my token

#

Dumb shit

lyric mountain
#

Regen it asap

lament rock
#

already got access to all of their "homework" servers SataniaEvil

earnest phoenix
#
dan.channels.cache.get('885726031615508500').send('test')

Send is undefined

lament rock
#

the get returned undefined

earnest phoenix
#

I used this method back v12 idk if it still works on v13

#

Wait what

#

But its the valid id of the channel

lament rock
#

are you trying to get the channel before the client reaches the ready state?

earnest phoenix
#

Yeah maybe lemme fix

#

What are those

lament rock
#

don't you have to enable a flag to allow es module loading? Pretty sure cjs statements work inside es modules

earnest phoenix
#
        if (i.customId === 'yes') {
          embed.setDescription(`Yay!, <@${user.id}> and <@${interaction.user.id}> are now married couple!`)
          database[interaction.user.id] = {
            partner: user.id,
            time: Date.now()
          }

          database[user.id] = {
            partner: interaction.user.id,
            time: Date.now()
          }

          fs.writeFileSync("./database.json", JSON.stringify(database, null, 2)```
#

this correct?

#

How?? Undefined?? Like its right over there

delicate shore
#
const method = // user input
const img1 = // image provided by user
const list = ["affect", "beautiful", "wanted", "delete", "triggered", "facepalm", "blur", "hitler", "kiss", "jail", "invert", "jokeOverHead"]  
if(list.includes(method)){
  let response_buffer = canvacord.Canvas[method](img1)   
}

My code

#
| TypeError: canvacord.Canvas[method] is not a function
#

my error

earnest phoenix
#
 python main.py
COOLYOPBRUH
sh: 1: cls: not found
#

What is that error

#

Anyone is here?

errant flax
#

how do i display something in js using ejs?
like for eg.

<script>
function hey(){
console.log(secret)
}
</script>

i want to log secret from res.render(fileName,{secret:"abc123"})

#

how do i do that?

crimson pike
#

<%= secret%> or <%- secret %>

errant flax
#

example?

crimson pike
#

not now i need to go school

errant flax
#
<script>
function hey(){
console.log(<%= secret%>)
}
</script>
#

like this?

quartz kindle
#

you can use the dynamic import instead

#

await import("module")

#

from esm you can import commonjs but you cant use named exports because they rely on static analysis before being run, which commonjs doesnt support

frail totem
#

@wide we HisnulMuslim#0556

earnest phoenix
earnest phoenix
carmine magnet
#

<%= variable %>

#

Look at the ejs documentation

errant flax
#

will the work with JavaScript?
(wrapped around with the script tag)

carmine magnet
#

Yeah

#

I think you need to add a space between secret and %>

errant flax
#

ah thx

carmine magnet
#
boreal iron
#

There are no ejs tags, those are called ASP-style tags btw.

earnest phoenix
outer perch
#

does anyone know any lightweight DB?

#

I am looking to move my DB out of Firestore

near stratus
# outer perch does anyone know any lightweight DB?

depends
If you have huge data + want performance use psql (not lightweight at all)
if you don't care about losing your data use mongo (idk if lightweight or not)
if you have little data but want high data read speed use SQLite (lightweight but in storage)
if you don't fucking care about losing your data every time you reload the app use redis (in memory - not suggested at all)
you like Microsoft - use Microsoft sql server (idk anything about it)

outer perch
earnest phoenix
#

not a good idea

#

because you can fuck up if you selfhost

rose warren
#

Only if you don't know what you're doing. And if you don't know what you're doing you can fuck up a hosted db too. In any case, you should always make regular db backups.

quartz kindle
#

sqlite is best

#

spews russian gibberish

rose warren
#

Best is storing data in message content in a Discord channel :^)

quartz kindle
#

yes

#

discorddb

#

someone actually made that a thing

#

rather someone made a discord file system

#

shows up as a networj drive on your windows

rose warren
#

Free unlimited storage

rose warren
quartz kindle
#

stores data on discord mrssages

rose warren
#

Lmao

quartz kindle
#

write speed is 10kbps

rose warren
quartz kindle
#

do updateOne with the money too

#

you can do one with both updates inside

outer perch
#

not sure if MySQL has differences in the SQL language

#

or if it's all the same

old cliff
#

Is it ok to re-register slash commands when ever the process is restarted for every guild?

#

Or can it cause ratelimits?

boreal iron
outer perch
quartz kindle
#

there are differences

boreal iron
#

The difference is in between the database engines itself

quartz kindle
#

sqlite does not support all the features of mysql, so its sql language is also slightly different

boreal iron
#

He’s probably speaking about the syntax

outer perch
#

I am talking about syntax

boreal iron
quartz kindle
#

yes but some mysql syntaxes are invalid in sqlite due to it not supporting some features

outer perch
#

haha, I knew it

quartz kindle
#

its kinda like using an older version of nodejs

#

99% of js is the same, but some newer features are not supported

boreal iron
#

And yeah if my cars doesn’t have lights, I can’t turn on the lights

quartz kindle
boreal iron
#

Yes I’m aware but those features are NOT available but this doesn’t mean the SQL syntax is different

#

You just can’t use this features

quartz kindle
#

thats what i meant, i mean its a feature of the sql language, not of mysql

cinder patio
#

ORM gang

outer perch
#

anyways. how so "huge data"?

#

complex tables, or quantity?

boreal iron
#

I need a psychiatrist

#

Tim’s a complicated person smirk

outer perch
#

nah, seen worse lmao3d

quartz kindle
#

sorry i didnt express myself correctly

#

you are right

boreal iron
#

Haha lmao KEKW

quartz kindle
boreal iron
#

I feel better now, thanks

#

Let’s say we both are right but I’m at 51%

outer perch
quartz kindle
#

xd

outer perch
#

wait

#

I have even less omegaLUL

boreal iron
#

Well then SQLite is the right choice for you

outer perch
boreal iron
#

Supporting most features BUT not all freerealestate

outer perch
#

what u guys storin'? I only store critical shit

#

like profiles, vip status, inventories and server settings

boreal iron
#

Wut means critical shit for you?

#

Nvm

outer perch
#

things that are really, really needed for the bot to function correctly on a guild

boreal iron
#

Your bank data, personal data or addresses are critical

outer perch
boreal iron
#

Yeah I got what you mean

#

Still SQLite is the right choice as Tim already said

outer perch
#

the bot's in 141 guilds though 😔

#

that's why it's not much of a big DB

boreal iron
#

Also SQLite backups can’t be easier to do

outer perch
#

noice, gonna set that up

quartz kindle
#

this is a fun read

timber fractal
#

can someone help?

outer perch
#

no acceptable C compiler found in $PATH
I know how to fix this in Windows, but not in Linux sadKekw

#

k, it's done

boreal iron
# quartz kindle this is a fun read

Aye it is.

For example, if a column has a datatype of "INTEGER" and the application inserts a text string into that column, SQLite will first try to convert the text string into an integer, just like every other SQL database engine. Thus, if one inserts '1234' into an INTEGER column, that value is converted into an integer 1234 and stored. But, if you insert a non-numeric string like 'wxyz' into an INTEGER column, unlike other SQL databases, SQLite does not throw an error. Instead, SQLite stores the actual string value in the column.

#

Okay I see there are differences.
Didn’t even know some of the mentioned ones.

boreal iron
#

You actually can convert both to lowercase

#

message.content.toLowerCase().includes(v.toLowerCase())

earnest phoenix
#

String.prototype.includes is a thing?

boreal iron
#

Your censor list you call whitelist for what reason so ever and the message content

boreal iron
earnest phoenix
cinder patio
#

ew

earnest phoenix
#

I've never messed with prototype of primitives before

raw gust
#

Is it possible to get someone's info just by ID?. Where that ID is not in the server the bot joins

earnest phoenix
#

@raw gust there are some discord endpoints for fetching public user data

raw gust
#

ah yes thank you so much

errant flax
#

wonder if ejs suppoets "optional chaining"

#

supports*

earnest phoenix
#

@errant flax that's a browser issue

outer perch
#

-.-

earnest phoenix
#

I'm using OAuth2 for my NextJS website
Is this a good idea?

const [data, updateData] = useState(null);
useEffect(async () => {
  // when component mounts
  let resp = await fetch(`/api/getUserData?token=${encodeURIComponent(context.tokenPassedBySSR)}`);
  resp = await resp.json();
  if (resp) updateData(resp);
});
#

problems: token is hardcoded into the app

#

if i use a cookie it'll have to be non http only

pale vessel
#

localstorage :troll:

earnest phoenix
#

lmao

errant flax
#

whats NextJs

earnest phoenix
#

how do you access localStorage on server side

earnest phoenix
errant flax
#

ah

earnest phoenix
#

it supports SSR which is just rendering the page on the server and adding interactivity on the client side

errant flax
#

i dont understand ur code lel

earnest phoenix
#

I changed its name just few mins ago

errant flax
#

just fork the repl ig

#

then delete the old one

earnest phoenix
#

Damn

#

Alrightt

#

my god you leaked your IP

#

delete that screenshot

#

quick

#

OH SHIT THANKY YOU im dumb

#

I thought the repl was off

#

And forgot to delete that code

#

it's not a good idea to literally display the user's IP especially if people are going to stream it

stray seal
#

On replit, since .env is gone on it, how do i make my Token Hidden? What is the file i need to make and code i need to run?

lyric mountain
#

use secrets

near stratus
stray seal
earnest phoenix
earnest phoenix
#

process.env.TOKEN

stray seal
stray seal
stray seal
earnest phoenix
earnest phoenix
#

use the token in the old way

stray seal
#

I am newer to coding

earnest phoenix
#

idk how python works

#

read the replit docs

slender thistle
#

os.getenv

earnest phoenix
#

^^

errant flax
#

but its tedious

#

and i like it

stray seal
quartz kindle
#

how did you do it before?

#

with the env file

narrow sedge
#

Need help with an error , this is the code

quartz kindle
#

nice code

#

ive seen that before lel

stray seal
#

But, i used secrets. I just dont know to run this time...

quartz kindle
#

look at py examples for replit

slender thistle
#

Secrets:

TOKEN
Owoq9w8uhbeb.juU6t2.GGy6w6yqgvva

Code:
client.run(os.getenv("TOKEN"))

#

If that doesn't work then your token might be incorrect

quartz kindle
#

apparently py injects it as a global var

slender thistle
#

That's not correct

#

It's not supposed to

#

That's dumb if it's true

quartz kindle
#

its replit

#

they do whatever the fuck they want

slender thistle
#

Time to try it out I guess

earnest phoenix
slender thistle
#

Replit are ballsy in a way

near stratus
outer perch
#

how can I ssh into my VPS without writing the IP itself, like a domain name?

quartz kindle
#

buy a domain

outer perch
#

only way? isn't there a way to locally store the name

quartz kindle
#

nope

outer perch
#

so when I mention the name it convert to the ip

#

sad

slender thistle
quartz kindle
#

when you mention the name, your service provider has to resolve it

#

so the name must be public and known

slender thistle
#

They allow you to keep your repls running 24/7

quartz kindle
#

otherwise they wont find it

outer perch
#

but Contabo has this vmi[somenumbers].contaboserver.net

quartz kindle
#

thats a subdomain

outer perch
#

and I can do ssh root@[that thing]

slender thistle
#

So technically they're not liars

quartz kindle
#

you can create subdomains if you own the domain

near stratus
lyric mountain
#

help, code is not running for some reason

quartz kindle
#

you can use subdomains just like primary domains

outer perch
quartz kindle
#

if youre fine with a subdomain from someone else, no you dont

near stratus
outer perch
#

I am for starters

quartz kindle
outer perch
#

but I have these DNS Zone Management and Reverse DNS Management

#

I'm new to this

quartz kindle
#

yes, you can use dns zone management

#

create an A record that points to your ip address

slender thistle
#

The price could probably be lowered a bit but generally imo if you want a full-on VPS just get one from another company

outer perch
#

but creating the records is enough?

quartz kindle
#

what records?

#

everything other than A and AAAA you can ignore

steel anvil
#

hello , i have a button that do a function but it works in servers , and the others not

#

the error

#

the line error

lyric mountain
#

user isn't cached yet

steel anvil
#
        const user = await button.guild.members.cache.get(button.clicker.user.id);  // ther error from this line

steel anvil
lyric mountain
#

actually, is button.clicker a thing?

steel anvil
#

yea

#

its from the new discord buttons library

lyric mountain
#

what lib is that?

steel anvil
#

discord-buttons

zenith terrace
#

bleh

rose warren
#

It's already in v13 though

lyric mountain
#

also, don't name a variable "user" when it holds a member

steel anvil
lyric mountain
#

and ye, djs 13 already has built-in button support

steel anvil
#

mmm

lyric mountain
#

regarding your question, somehow clicker is returning a null user

steel anvil
#

@lyric mountain Any Suggestions 523172768381009921

lyric mountain
#

try to use djs buttons

steel anvil
earnest phoenix
#

Use discord collections for cooldowns

earnest phoenix
stray seal
earnest phoenix
earnest phoenix
#

yeah

#

you can use their api to update your server count and all that

stray seal
earnest phoenix
#

On your bot page

#

How many servers your bot is in

stray seal
#

How do you do that?

earnest phoenix
#

You can use their API

stray seal
earnest phoenix
#

idk

#

never used it

#

Read the docs

bright thorn
#
const config = require(`../../botconfig/config.json`);
const Topgg = require("@top-gg/sdk")
const topgg = new Topgg.Api(config.DBL_TOKEN)
var ee = require(`../../botconfig/embed.json`);
const emoji = require(`../../botconfig/emojis.json`);
const {
  MessageButton,
  MessageActionRow,
  MessageEmbed
} = require(`discord.js`);
module.exports = {
    name: `check`,
    category: `Info`,
    aliases: [`votecheck`, `vc`],
    description: `Check yourself if you voted me`,
    usage: `check`,
    run: async (client, message) => {
        let es = client.settings.get(message.guild.id, "embed")

      let button_invite1 = new MessageButton().setStyle('url').setLabel('Topgg').setURL("https://top.gg/bot/802812378558889994/vote")
      let button_invite2 = new MessageButton().setStyle('url').setLabel('Topgg').setURL(`https://top.gg/bot/802812378558889994/vote`) .setDisabled()
      //array of all buttons
      let voted = await topgg.hasVoted(message.author.id);
      const row = new MessageActionRow().addComponents([button_invite1, button_invite2]);
     if(!voted) {
       let embed = new MessageEmbed()
       .setDescription(`You Didn't vote me!🤬  \n\n vote me now `) 
       .setColor(ee.color)
        return message.reply({
            embeds: [embed], components: [row]})
      } else {
        let embed2 = new MessageEmbed()
        .setDescription(`You voted me \n **Now you can use [Grab, volume, Adddj, Embed, Playlist] Commands**`) 
        .setColor(ee.color)
        return message.reply({
            embeds: [embed2], components:[row]})
      }
}} 
#

components[0].components[0].style: This field is required
components[0].components[1].style: This field is required

#

?

#

anyone can tell me this error

#

why i can see

quartz kindle
#

button style is required

#

url is not a valid style

#

it should be LINK

worn sonnet
#

hi

#

i encountered some problem here

#

related to combinations

bright thorn
#

yeah

earnest phoenix
#

nvm i thought you had a problem with topgg

worn sonnet
#

I've a first_name and last_name

earnest phoenix
#

ok and?

worn sonnet
#

i want to make all the possible combinations with them including sperators such as _, .,-

outer perch
earnest phoenix
#

use a regex

worn sonnet
#

like {first_name}{last_name)

bright thorn
#

sorry but i got the solution

earnest phoenix
worn sonnet
earnest phoenix
#

python has regex

worn sonnet
#

yes but i dunno how....

#

I'll try googling it

earnest phoenix
#

idk how you create regex but the regex should be like this: first name here[allseperatorswithoutspaces]lastname

worn sonnet
#

no not like that

#

combinations such as

{first}{last}
{last}{first}
{first}_{last}
..... so on```
outer perch
#
npm ERR! code 127
npm ERR! path /root/.nvm/versions/node/v16.9.0/lib/node_modules/node-firestore-import-export/node_modules/protobufjs
npm ERR! command failed
npm ERR! command sh -c node scripts/postinstall
npm ERR! sh: 1: node: Permission denied

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-09-10T14_41_46_768Z-debug.log

after running npm install -g node-firestore-import-export

earnest phoenix
#

put a ? After the square bracket

#

¯\_(ツ)_/¯

worn sonnet
#

more ore less i'm trying to deduce emails

earnest phoenix
outer perch
#

I am root on my VPS @earnest phoenix

worn sonnet
#

based on first and last

earnest phoenix
worn sonnet
earnest phoenix
worn sonnet
#

and that's where i'm stuck

earnest phoenix
#

you should've just asked your original problem

worn sonnet
#

well instead of getting spoon feed i wanted to know how i can do it

outer perch
#

how can root not have permission to install globally?

earnest phoenix
worn sonnet
quartz kindle
#

thats a scam website

#

well not really

#

just an add filled random code scrapper

outer perch
#

@quartz kindle !!! root has no perms to install packages globally

earnest phoenix
#

probably has coinimp mintme miner too

quartz kindle
#

they use black hat seo tricks to make google think its relevant to your search

worn sonnet
#

for anyone who's looking for code for their discord bots code grepper is good for it

quartz kindle
#

then just show you random code copied from somewhere

#

and make money with ads

worn sonnet
outer perch
#

yea

quartz kindle
#

did you use sudo anywhere?

outer perch
#

I don't remember

#

😦

#

maybe on apt install nvm

quartz kindle
#

nvm is not on apt?

outer perch
rose warren
earnest phoenix
#

The error is throwing when hey try to install a sus package

quartz kindle
#

nvm is installed via curl/wget script

#

not apt

outer perch
#

yeah, I did curl

earnest phoenix
#

node scripts/postinstall says permissions denied

quartz kindle
#

uninstall everything

#

and install again nornally

#

without sudo

earnest phoenix
#

it's pronounced soodoo by the way

quartz kindle
#

not to me :^)

spark flint
#

so informative too

rose warren
earnest phoenix
#

What method should I use to get an emoji because when I do getString it returns me null

split hazel
#

discord js moment

earnest phoenix
#

what ?

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

which class is that even?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

@quartz kindle SlashCommandBuilder

quartz kindle
#

show code

earnest phoenix
#

ok

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

faithity

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

ew no

#

rather go to c++

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

:^)

earnest phoenix
quartz kindle
#

but you said you want to get an emoji? youre setting options there, not getting

coarse topaz
#

Hi, if I set a time filter for my reactions collector (e.g. createReactionCollector({filter, time: 15000 })), will the collector fire the "end" event when the set time has been reached?
I basically want to make it so that the collector stops collecting if there haven't been any received reaction after 15s

discord.js btw

earnest phoenix
#

uh yes wait

#

Line 35 - he log me null @quartz kindle

#

same problem for getString

#

so how can i do ?

#

Hi,
I am using apache2 and having problems
My sites:
mydomain.com

  • has a https redirect rule
  • virtualhost express server
    sub.mydomain.com
  • has a https redirect rule
  • virtual host Document root /var/www/html/
    My problem:
    if i go to sub.mydomain.com:
    I come to the correct page
    else if i use https://sub.mydomain.com
    I come to the page of mydomain.com
split hazel
#

why is apache so complicated

cinder patio
#

don't do me like that

outer perch
#

ok, @quartz kindle I can install globbally, but for node-firestore-import-export I can't

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
earnest phoenix
#

js nerds are cool

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
outer perch
#

yeah

coarse topaz
#

I don't understand why I'm getting this error:
(node:24) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cache' of undefined

if (message.content === `${prefix}removereactions`) {
if (!message.author.roles.cache.has(moderatorsRole)) return;
}```
Can someone help me, please?
wheat mesa
#

Message.author returns a user object, not a member object.

#

User objects don’t have a property of roles since they’re not associated with a guild

coarse topaz
#

So I gotta get the member object from the author's id and then do the check

wheat mesa
#

Yes

coarse topaz
#

Thank you

wheat mesa
#

Np

pale vessel
wheat mesa
#

I forgor 💀

pallid jungle
#
TypeError: channel.id is not a function
    async execute(client, message, [channel='']) {

    const channelID = (channel.match(/\d{17,19}/)||[])[0];
    channel = message.guild.channels.cache.get(channelID);

    data.greeter.welcome.channel = channel.id;
wheat mesa
#

...what

#

Show the code for your command handler

#

(Also can you even use parameters like that in a function? I’ve never seen that before)

lyric mountain
#

whathehell is supposed to be (channel.match(/\d{17,19}/)||[])

#

regex already return an empty array if it doesn't match anything

#

that takes us to my second question

#

whythehell use regex?

wheat mesa
#

Very very very very odd

boreal iron
#

Show the virtual host setup, Apache isn’t complicated oldEyes

#

Without the domain name

raw gust
#

Anyone doing blackjack orders?

boreal iron
#

Can't u just copy and paste the config?

#

I'm too lazy to type anything, since your setup is fucked up as hell

earnest phoenix
#

Mobile :(.I will send it 2mrw then

boreal iron
#

Gonna send u an example how to set it up correctly

#

First VH doesn't need the SSL engine tho, port 80 and redirect to VH @ *443

earnest phoenix
#

Note:
Main domain is a express server
Sub domain is a directory
must support https

coarse topaz
#

Btw, how can I iterate through the messages of a channel?

coarse topaz
# coarse topaz Btw, how can I iterate through the messages of a channel?

This's the error I'm getting:
(node:24) UnhandledPromiseRejectionWarning: TypeError: wwwGamesChannel is not iterable

And this's what I'm basically trying to dojs for (const messageFoundGamesWWW of wwwGamesChannel) { setTimeout(function(){ messageFoundGamesWWW.reactions.removeAll() }, 500) }

boreal iron
# earnest phoenix Note: Main domain is a express server Sub domain is a directory must support htt...

Requiring HTTPS for the first VH:

<VirtualHost *:80>

    ServerName something.example.org

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
    
</VirtualHost>

The actual VH (for SSL):

<VirtualHost *:443>

    ServerName something.example.org
    
    SSLEngine on
    SSLCertificateFile "path/to/cert.crt"
    SSLCertificateKeyFile "path/to/cert.key"

    DocumentRoot "/var/www/dist"

    <Directory "/var/www/dist">

        Options Indexes FollowSymLinks
        AllowOverride None
        
        Require all granted

    </Directory>
    
</VirtualHost>
earnest phoenix
#

thx ❤️

boreal iron
#

<VirtualHost *:80> doesn't require any docroot etc, port 80 isn't SSL and is a straight redirect only

#

Second VH is the same issue as the first one

#

If you enforce a RewriteRule nother further config params are required

boreal iron
# earnest phoenix Here

Regarding your second picture:

<VirtualHost *:80>

    ServerName other.example.org

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
    
</VirtualHost>

<VirtualHost *:443>

    ServerName other.example.org
    
    SSLEngine on
    SSLCertificateFile "path/to/cert.crt"
    SSLCertificateKeyFile "path/to/cert.key"
    
    ProxyPreserveHost On
    ProxyPass / http://10.0.0.1:25568/ retry=0
    ProxyPassReverse / http://10.0.0.1:25568/
    
</VirtualHost>
earnest phoenix
#

The second one uses the main domain but it should same ig

boreal iron
#

Don't forget to restart/reload apache

boreal iron
boreal iron
earnest phoenix
#

i don't use www ,so not needed

boreal iron
#

Which would look like (for both virtual hosts):

#
<VirtualHost *:80>
    ServerName www.example.org
    ServerAlias example.org
    ...

<VirtualHost *:443>
    ServerName www.example.org
    ServerAlias example.org
    ...
#

This can include multiple hostnames (subdomains) as well

#

ServerAlias example.org docs.example.org test.example.org whatever.example.org

earnest phoenix
#

tysm topggLaugh

boreal iron
#

another useful tip

#

At the end of your VH file(s) make sure to "handle" hostnames which aren't finded as virtual host

#
<VirtualHost *:80 *:443>
    
    ServerAlias *.example.com
    
    RewriteEngine On
    RewriteCond %{HTTPS} =on
    RewriteRule ^/?(.*) http://%{SERVER_NAME}/$1 [R,L]
    
    Redirect 404 /
    
</VirtualHost>
#

Which will rewrite each connection on port 80 or 443 (SSL) back to http and will return a 404

#

ServerAlias *.example.com stands for ANY hostname you have not configured as virtual host

#

The rewrite from 443 to 80 is important to get rid of unsupported SSL cert errors in your browser if a client tries to enter your domain via (HTTPS) for a non setup hostname

#

Like if https://fatduck.example.com isn't a virtal host you have setup (incl. a valid SSL cert), it will cause a cert error in the client's browser

earnest phoenix
#

1.learn how to code
2.search <your coding language> discord library
3.Read and Study the docs
4.build your bot

earnest phoenix
wheat mesa
#

Uh

#

Interesting contradiction in that sentence

boreal iron
#

It's not, you're listening to guild member events, check if it's a bot who joined, remove the permissions

earnest phoenix
#

Ye

boreal iron
#

remove the permissions

fetch the member roles, loop through the member roles, overwrite the permissions you need, to be a little more detailed

split hazel
#

of course the apache sweat says its easy 😔

boreal iron
#

Apache is far more easier than NGINX

split hazel
#

ngl barely used both lmao

boreal iron
#

But yeah already dealing with it for many, many years tho

split hazel
#

only got the bare minimum config to work with php

boreal iron
#

PHP
❤️

split hazel
#

they be hatin on php

#

it's really fun

boreal iron
#

Because people are too young to understand it’s superior leading position

#

At a time we had nothing else than PHP, you know

limber mica
#

in js how do I play an audio file in VC connection? (discord.js V12)

quartz kindle
#

the most annoying thing about php is the excessive functional ways they do things

#

and how they cant agree on parameter order

limber mica
#

I've never used VC controls before

boreal iron
quartz kindle
#

somefunc(array, key)
someotherfunc(key, array)

#

php does that a lot

#

lmao

boreal iron
#

Oh you mean regarding existing functions

#

Yeah

quartz kindle
#

ye the built in global methods

#

they mix up a ton of conventions lmao

boreal iron
#

But once you know then, you know them lol

quartz kindle
#

i have to look up the docs again everytime

#

xD

boreal iron
#

That’s what you need to do learning any program language anyways

#

That’s why I said… once you know…

quartz kindle
#

once you know docs, you know every lang

#

:^)

limber mica
#

How do i stream an audio file to a VC?

#

discord.js v12

quartz kindle
#

pretty sure djs has built in support for files

boreal iron
quartz kindle
#

something.play("file.mp3")

proven lantern
#

why are aws lambdas so much faster than firebase functions?

#

i uploaded some of my slash commands to firebase and they took ~30seconds to return

#

aws <1second

split hazel
#

slash commands in cloud functions

#

never seen that one before

#

but its a great idea

proven lantern
#

my setup is perfect now that we have slash commands

#

once i finish moving all the code over

#

i can get rid of the vps

#

is there a way to make the bot appear online without having an open connection?

boreal iron
#

What’s the purpose? Upscaling?

proven lantern
#

i am not going to have a vpc after i move to serverless

boreal iron
#

No you can’t keep it online yet without a gateway connection

#

But I read somewhere that’s on the list of things to do

proven lantern
#

nice

boreal iron
#

That’s why I still enforce the bot and commands scope

proven lantern
#

it would be funny to make the bot go online every time a command runs and then instantly go back offline

boreal iron
#

I wonder how they will do it anyway

proven lantern
#

theywill just use the pings built into slash commands

#

{type:1}

boreal iron
#

Sending post requests to the bot isn’t an active connection, how do they wanna say if it’s online or not

#

Online isn’t even a right term for this

#

Oh

proven lantern
#

once the bot stops responding

#

offline

boreal iron
#

Continues requests being send

#

Damn

proven lantern
#

i'm guessing they ease off the requests

#

like once ever couple hours after its trusted

boreal iron
#

Hmm maybe

#

Nvm requiring the bot scope and keep a gateway connection isn’t an issue for me

#

But yeah moving fully to slash commands without a socket connection will require them to do some work

proven lantern
#

i can do it now, but the bot appears offline

#

everything works though

boreal iron
#

Yeah that’s what I meant

proven lantern
#

gotcha

#

im going to keep both the slash commands and old commands working until they cut it off

boreal iron
#

Let’s see how fast Discord develops their new system in terms of forcing anybody to use it soon

proven lantern
#

April 2022 is what i heard

split hazel
boreal iron
wheat mesa
#

You got ratelimited

proven lantern
#

yep, that's my plan too

#

first i need to finish like 11 more commands

pallid jungle
#

The bot just send a embed with 2 reactions

wheat mesa
#

I don’t know, you tell me

pallid jungle
#

1 embed didn't spam or anything

proven lantern
#

if someone can tell you why then they are on your computer

wheat mesa
#

If it’s a ratelimit by discord, you sent more than 120 requests in one second (that’s the limit, right?)

split hazel
#

are aws lambdas on free tier btw

#

wanna test them out

wheat mesa
#

¯_(ツ)_/¯

boreal iron
#

The rest of code does probably

#

Somewhere

wheat mesa
#

But I don’t like AWS, their billing tactics are kinda sketchy

proven lantern
split hazel
#

allegedly

#

pretty nice of them

#

i'll try not to get billed lmao

#

i know these cloud companies hope you slip up

wheat mesa
#

Yeah

proven lantern
#

you need an api gateway too

#

i dont know if those are free

#

12 month free

#

then

#

who knows

wheat mesa
#

AWS billing looks like it’s trying to make you not realize you fucked up and slap you with a bill at the end of the month

split hazel
#

you pae

#

of course none of them have auto shut offs only warnings

proven lantern
#

elastic beanstalk is the worst. it just makes random resources and then doesn't have as way to clean them up

#

you have to search through each one individually in each region to find it

split hazel
#

im gonna fucking strangle someone in a second

#

these captchas are getting to a point not even humans can solve them

boreal iron
#

lmao

sudden geyser
#

stuff like that makes me want to use google cloud

boreal iron
#

bbxb2d

wheat mesa
#

Type the characters shown in the image below

shows a fucking acid trip with some letters

#

I had to do the AWS captcha about 5 times before I got it right

boreal iron
#

Imagine posting captchas in Discord to let others solve them

sudden geyser
#

a bot is more likely to complete the captcha than a human

proven lantern
#

are captcha getting harder or am i becoming a bot?

wheat mesa
boreal iron
#

At least less annoying than the captchas to select images with special things in it

wheat mesa
split hazel
wheat mesa
#

If anything a bot could solve that easier than a human

#

Photomath

boreal iron
#

Aye

boreal iron
wheat mesa
#

Big brain

boreal iron
#

Aye, nothing a bot would be able to "think" of

#

Ha!

proven lantern
#

i bet there wont be many math professors using that website

sudden geyser
wheat mesa
#

Rock

boreal iron
#

lmao

#

The red text is cool tho, filling out all form fields, then reloading the page to get an easier question and poop the form is empty again smirk

#

The 'net is a scary place.

split hazel
#

throwback to primary school presentations from police talking about online safety

boreal iron
#

Hmm back at a time the internet wasn’t even a thing

#

Damn getting old sucks

split hazel
#

i'm not that old

boreal iron
#

good for you

#

Imagine how Tim feels as grandpa

split hazel
#

tim is something else

boreal iron
#

Within his midlife crisis

boreal iron
tulip ledge
#

Right so I have a matrix that looks like this:

matrix = [
  [a, b, c, d],
  [e, f, g, h],
  [i, j, k, l],
  [m, n, o, p]
]

The entries of the matrix n is always equal to the length of each index of the matrix so the matrix can be of any size: 1, 4, 9, 25, 36
Now I need to get a square out of the matrix for example:
Square 1 of the example above would look like this: [a, b, e, f] and square 2 would look like [c, d, g, h] I already know how to do it for a 4x4 matrix but I have no clue how to make it work with any of the size listed above

#

Language is python btw but I also accept javascript answers as I can translate it if needed, still prefer if you just tell me what to do tho so I can figure it out myself

limber mica
#

Bruh that token logger got me banned from didcord.js

wheat mesa
#

then don't use a token logger

blissful coral
#

fr KEKW

limber mica
#

My friend sent it to me

#

:(

blissful coral
#

Clearly not a friend lul

wheat mesa
#

can't keep using that excuse man

limber mica
wheat mesa
#

you keep saying "a friend sent it to me" when in reality it's your fault for running the script

limber mica
#

Like a day ago

#

Oh

#

Hmm

#

Yeah

#

:/

wheat mesa
#

Plus that friend gave you a script before that that clearly selfbotted

#

I suggest not running scripts he sends you

#

Cus servers will continue to ban you

limber mica
#

Well he got my token then put it in a selfbot

#

Also related to my current client

#

Making me make a bot that logs on a client account

#

50 dollars cash

#

Not bad

proven lantern
#

what is selfbotted

#

selfbot

limber mica
#

Not a bot account

proven lantern
#

naughty naughty

limber mica
#

Im not doing it

#

My client is

#

Im just making it

quiet topaz
#

how can I define EventTarget

blissful coral
#

is that in a node module or what

earnest phoenix
#

The vid doesnt play

#

<!DOCTYPE html>
<html>
<body>
<center>
<video class="tab" controls>Your browser does not support the &lt;video&gt; tag.
  <source src="vid1.mov"/>
</video>
</center>
</body>
</html>

Code from stackoverfl

wheat mesa
#

thats the problem with copy pasting code

quiet topaz
wheat mesa
#

Not you, was talking about zed

quiet topaz
#

ok

earnest phoenix
#

And i made my own code using video tag and didnt work either

#

It just been like that

wheat mesa
#

Doesn't support mov files from what it looks like

earnest phoenix
#

Wait what i tried changing it to mp4 yesterday and it just doesnt show up

#

Like its full blank website

quiet topaz
#

how did you change it to mp4

pallid jungle
#

await sentEmbed.react("812104211386728498")
^^^^^

SyntaxError: await is only valid in async functions and the top level bodies of modules

#
.then(sentEmbed => {
        await sentEmbed.react("812104211386728498")
        await sentEmbed.react("812104211361693696")
    })
tulip ledge
#

you need to make the function async

#

like the error sais

proven lantern
#
        await sentEmbed.react("812104211386728498")
        await sentEmbed.react("812104211361693696")
    })```
pallid jungle
#

ok

lyric mountain
proven lantern
#

is there a risk to someones discord account if they make a bot and share the bot token?

lyric mountain
#

also yeah, mov has very little compatibility with anything

lyric mountain
#

it's yours responsability to choose who you deem trustable enough to share the token

#

if the bot is punished so are you

proven lantern
#

i am thinking about letting people create their own bots and register it with my bot and it basically make it a clone of my bot

rose warren
proven lantern
#

but they can choose the avatar

rose warren
#

For the hijacker, that's a zero risk way of causing damage since the bot owner holds all the liability.

lyric mountain
#

you share the fate of ur bot

proven lantern
#

people will trust my bot

lyric mountain
#

I wouldn't KEKW

rose warren
#

Hence also why I always suggest never asking for admin perms / perms it doesn't need. Because if your bot / account gets compromised then the attacker can literally nuke every server if they want to.

lyric mountain
proven lantern
#

my bots perms

rose warren
#

Sadly, I ran a test on mine (doesn't require admin and never asks for it) and 20% of servers have given it a role with admin permissions. They must just have a "Bot" role with admin perms they slap on every bot they add to their server. As far as I'm concerned, if my bot gets compromised and nukes their server one day that'll kinda be their fault too for giving it the permissions to do that dog_Joy

#

Badly built servers 👌

coarse topaz
#

Hi, could someone help me debug my code, please?

let wwwGamesChannelFetchedMessages = await wwwGamesChannel.messages.fetch({limit: 100})
let wwwGamesChannelLastMessage = wwwGamesChannelFetchedMessages.last();
        wwwGamesChannelFetchedMessages.then(messages => {
          messages.forEach(messageFound => {
              setTimeout(async function(){
              messageFound.reactions.removeAll()
    }, 500);
  });
});``` This's the error I'm getting
`(node:25) UnhandledPromiseRejectionWarning: TypeError: wwwGamesChannelFetchedMessages.then is not a function`

If that's not a function how should I actually set it up
proven lantern
#

since my bot has manage roles permissions can it make a role with more permissions and add it to itself? hopefully not

spark flint
blissful coral
#

No

#

They don't

#

Ever

coarse topaz
blissful coral
#

You NEVER need admin

spark flint
#

my bot for example uses it so that it can see when members join and flag them up if deemed suspicious

spark flint
#

i meant its NOT needed

#

but some just don't function without it

#

like the bot owner made it not function without admin

rose warren
spark flint
blissful coral
#

Yeah lmao

#

Bot's never need admin period

rose warren
#

No bot needs admin nor should ever be given it

spark flint
#

Why do most music bots ask for it lol

rose warren
#

Because they're lazy

blissful coral
#

Because most music bots are clones

#

Or just don't read the rules

spark flint
#

Groovy used to ask for admin

proven lantern
blissful coral
#

Groovy doesn't anymore

#

Doesn't even exist anymore

spark flint
#

sad 😦

#

but it used to

quartz kindle
#

savage

blissful coral
#

lulw

rose warren
#

They don't want to have to explain to noobs how to set up perms in their support server (or the bot dev is inexperienced and doesn't know how to choose or set up the right perms for their bot so they ask for admin because "everything will work")

coarse topaz
proven lantern
#

await and .then do the same thing

#

await is the new syntax

blissful coral
#

yeah lmao

rose warren
#

Guess what else will work? 👀
||Nuking your server||

blissful coral
blissful coral
boreal iron
#

forEach() oldEyes

blissful coral
#

That's what they were doing so

#

Yk what

#

Screw it

wheat mesa
#

Foreach

#

Ew

boreal iron
#

And people blame me for suggesting to use CSS2 not 3 tho

blissful coral
#

Better code

coarse topaz
#

Thanks a lot! Why aren't you including forEach though

#

@blissful coral

wheat mesa
#

forEach is yucky in js

#

It’s slow

boreal iron
#

Not only in JS

quartz kindle
#

foreach is pretty good in php

boreal iron
#

Aye, but for is still faster

coarse topaz
#

btw that line const foundMessage = wwwGamesChannelFetchedMessages.last() is not supposed to look like that; it was previously as "let wwwGamesChannelLastMessage = wwwGamesChannelFetchedMessages.last();"
because later in the code I do a check, like, if the foundMessage was the last one, then "do something else" (in this case, go to another channel and repeat the same forEach loop)

wheat mesa
#

goto mmulu

split hazel
#

by the way your variable names make my eyes hurt

wheat mesa
#

Very long

coarse topaz
boreal iron
#

for of

wheat mesa
#

Replace foreach with for...of

coarse topaz
wheat mesa
#

At least they’re descriptive

coarse topaz
wheat mesa
#

And not just like x or y

coarse topaz
#

Because there're like 4 kind of different variables with similar names

#

so for the code not to mix any of them, I describe them very well

coarse topaz
boreal iron
#

I wonder how long a module can be if you have issues mixing vars

split hazel
#

actually funnily enough

#

i just test foreach iterated a 50k element array

#

it was 4ms faster than for of

#

i guess it depends on the use case

quartz kindle
#

for of is also slower than most others

split hazel
#

yeah

#

a lot of people think its just syntactical sugar for "for i"

#

i think a lot more happens in the background

wheat mesa
#

I was always told for of is faster than foreach

boreal iron
#

Maybe just because it has to get the elements size?

split hazel
#

checks slow it down most likely

quartz kindle
#

for of uses iterators

#

depends on the object for how it implements its iterator

#

so different objects can have different for of performance

boreal iron
#

Tim the walking lexicon okeh

quartz kindle
#

lmao

blissful coral
#

Thought it was just the last one oops

coarse topaz
#

Now I got this a lot of times when trying to run the command lol
(node:24) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'removeAll' of undefined

          let wwwGamesChannelFetchedMessages = await wwwGamesChannel.messages.fetch({limit: 100})
          let wwwGamesChannelLastMessage = wwwGamesChannelFetchedMessages.last();
        for (const messageFound of wwwGamesChannelFetchedMessages) {
              setTimeout(async function(){
              messageFound.reactions.removeAll()
  }, 500);
}```
#

Does it mean that the message didn't contain any reaction?

split hazel
#

maybe you came across a system message and those dont have the reaction object? idk i dont djs anymore#

coarse topaz
#

nah, all the messages in those channels have been sent by non-bot users nor by the Discord system

split hazel
#

by the way that settimeout is useless since they'll all run pretty much at the same time anyways

coarse topaz
#

I read somewhere that 500 is a good time to not be rate limited

split hazel
#

djs handles that automatically

#

what you are doing is setting all of those removal requests to happen in 500ms

#

they dont queue

#

they run at the same time

coarse topaz
#

a

split hazel
#

anyways

#

what if you try with the limit being a smaller amount

coarse topaz
#

Thought they were being queued tbh lol

And ok will do

split hazel
#

if you want to queue them you need to await settimeout

#

for loops will wait for async operations to finish inside it before continuing

coarse topaz
split hazel
#

man i was thinking something like 5 lmao

coarse topaz
#

But like, a lot of times

coarse topaz
split hazel
#

were just testing

coarse topaz
coarse topaz
split hazel
#

then you should console log the messages

#

classic

coarse topaz
coarse topaz
split hazel
#

that feeling when you dont even know

earnest phoenix
split hazel
#

since when-

#

i swear it was always the value

#

did they change something again

coarse topaz
coarse topaz
split hazel
#

should work

#

i dont like this library anymore

quartz kindle
#

const m of collection.values()

#

otherwise it iterates over entries by default

boreal iron
#

const [id, values] of collection

quartz kindle
#

ye

#

just entries are more expensive

boreal iron
#

Somehow prefer that style

pallid jungle
#

How can i add timer on mongo like mute with time i know how to use mongo but this thing i don't know how can i make it or give me an idea how it will be

lament rock
#

Just store times in which something is supposed to happen and then on start, query that and create timeouts

boreal iron
#

It’s always a good idea to store the time in the database and in the cache.
If your bot restarts you can load the timestamps back into your cache but nothing can be lost.

#

But keeping that stuff in the cache will reduce the amount of calls you need to do to the database.

coarse topaz
# quartz kindle const m of collection.values()

(node:25) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'values' of undefined

                let wwwGamesChannelFetchedMessages = await wwwGamesChannel.messages.fetch({limit: 100})
              let wwwGamesChannelLastMessage = wwwGamesChannelFetchedMessages.last();
        for (const messageFound of wwwGamesChannelFetchedMessages.collection.values()) {
            await setTimeout(async function(){
              messageFound.reactions.removeAll()
  });
}```
![Michal_Pensive](https://cdn.discordapp.com/emojis/870727091769995334.webp?size=128 "Michal_Pensive")
boreal iron
#

why tho collection.values?

#

Your var is a collection

coarse topaz
#

as wwwGamesChannelFetchedMessages is a collection and Tim suggested it that way, I tried it out

boreal iron
#

The property .collection doesn’t exist

coarse topaz
#

I could just try wwwGamesChannelFetchedMessages.values() though

coarse topaz
boreal iron
#

Tim said for(const something of <collection>.values())

#

Not .collection as property

#

But collection.values()

#

Collections represents the data type, a collection

#

Like if I would say array.includes()

#

Array is an array not .array as property

coarse topaz
#

yeah now that I think of it, it totally makes sense

boreal iron
#

alright

coarse topaz
# boreal iron alright

omg it almost worked from beginning to end but I have no idea why it stopped at the last one

#

Any idea? The code repeats, so there shouldn't be any bug

#

No errors in the console either

#

here's the code involved```js
let brAvatarsChannelFetchedMessages = await brAvatarsChannel.messages.fetch({limit: 100})
let brAvatarsChannelLastMessage = brAvatarsChannelFetchedMessages.last();
for (const messageFound of brAvatarsChannelFetchedMessages.values()) {
await setTimeout(async function(){
messageFound.reactions.removeAll()
if (messageFound === brAvatarsChannelLastMessage) {
confirmationEmbed.fields[1] = {name: **${brCreationsCategory.name} Category**, value: <#${brGamesChannel.id}> - Cleaned! \n<#${brModelsChannel.id}> - Cleaned! \n<#${brAvatarsChannel.id}> - Cleaned!}
confirmationEmbed.fields[2] = {name: **${videosCategory.name} Category**, value: <#${videosChannel.id}> - Cleaning. . .}
m.edit(confirmationEmbed);

    let videosChannelFetchedMessages = await videosChannel.messages.fetch({limit: 100})
      let videosChannelLastMessage = videosChannelFetchedMessages.last();
    for (const messageFound of videosChannelFetchedMessages.values()) {
          await setTimeout(async function(){
          messageFound.reactions.removeAll()
    if (messageFound === videosChannelLastMessage) {
    confirmationEmbed.fields[2] = {name: `**${videosCategory.name} Category**`, value: `<#${videosChannel.id}> - Cleaned!`}
    m.edit(confirmationEmbed);
    const successfullyExecutedActionEmbed = new Discord.MessageEmbed()
    .setTitle(`**Reactions Deletion Successfully Completed**`)
    .setDescription(`All the reactions from every single message in the channels from the **${liveCreationsCategory.name}**, **${brCreationsCategory.name}** and **${videosCategory.name}** categories have been successfully removed.`)
    .setColor("GREEN")
    .setFooter(`Reactions deletion hosted by: ${message.author.tag} (${message.author.id})`, message.author.displayAvatarURL())
    .setTimestamp()
    message.channel.send(successfullyExecutedActionEmbed);```
boreal iron
#

God damn have you ever tried to look over such a code block on mobile?

coarse topaz
boreal iron
#

It might do so but I’m on mobile atm KEKW

pallid jungle
boreal iron
#

It’s the right time to send a request to the database and fetch your timestamps for the clients who are muted

#

If the timestamps are > than the current time, you add them to your cache (for example a map) and work with it

#

At the moment you mute somebody or remove a mute you need to update the cache and the database of course

pallid jungle
#

Okay thx

lyric mountain
#

Your variable names are WAY too descriptive

#

Go easy on names, use comments if you must

wheat mesa
boreal iron
#

Yeah we figured that out via DM already

#

I hate Discord’s code blocks especially on mobile

coarse topaz
coarse topaz
#

It's not rate limit

#

So the error is in the code but I don't know exactly where

lyric mountain
#

Are you really fetching every single message?

#

That sounds like api abuse unless it takes like 1 day to complete

coarse topaz
# lyric mountain Are you really fetching every single message?

Yeah but the limit is 100 and those channels have less than 100 messages for sure
Also I already tested it and it's not something about rate limit/API abuse

I literally tried skipping a whole category and it's still stopping working when it reaches "cleaning #community-videos"

lyric mountain
#

No error?

coarse topaz
#

No error

lyric mountain
#

Are you suppressing any?

coarse topaz
#

I'm not - Better check the sourceb.in link I've shared with you in DMs

lyric mountain
#

Mobile atm

#

Try running with debugger attached

coarse topaz
#

do you mean .catch()?

bright thorn
#
root@ip-125-249:/home/ubuntu/real# npm i discord.js
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/distubejs/prism-media.git
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-09-10T15_41_32_696Z-debug.log