#development

1 messages ยท Page 169 of 1

rustic nova
#

literally trying to get my own, not published, skill to work

green kestrel
#

currently working on this, the nuclear option against people pasting screenshots of code on the D++ discord

#

its called Yeet and it'll Yeet the images and mute repeat offenders

#

i dont know if i want to make it a public bot yet, as it will potentially eat TONS of resources

grim aspen
#

add a nuke bomb gif

late magnet
#

hya im trying to make a bot for my own server can someone help me please

grim aspen
#

that's.... really vague. what library are you using?

rustic nova
#

sure, what knowledge do you already have about bots

late magnet
frosty gale
#

this is the worst captcha i have ever gazed my eyes upon

#

its a government website as well ๐Ÿ’€

#

might as well just not have one at all

#

save the attackers a few seconds

novel snow
#

Anyone worked on the new Modals here yet?
Trying to get a ChannelSelectMenu in the modal but having odd issues and cannot find much documentation about adding other inputs than just text inputs, this is my current approach:

  const channelInput = new ChannelSelectMenuBuilder()
    .setCustomId("channelInput")
    .setPlaceholder("Select a channel, preferably a good-lookin' one")
    .setMinValues(1)
    .setMaxValues(1)
    .setChannelTypes(ChannelType.GuildText);
eternal osprey
#

Does anyone know a good transition between the image above and the footer

#

i know that the footer needs to be moved to the top lmao. But still idk this transition between footer and image is looking hella bad.

quartz kindle
#

just reduce the size of the white space

#

and increase the spacing of the footer elements

#

for example push the middle column more to the right, to give the left column more space

#

reduce the font size of the lft column

#

and bring the image closer, ideally you would aim for equal distance from text to image and from text to page end

green kestrel
craggy pine
novel snow
craggy pine
#

I think it's a to-do to add support for other things in the modal thing, but knowing discord it'll probably come out in like 5 years.

earnest phoenix
#

Thanks heaps guys , appreciate it ๐Ÿค™๐Ÿป๐Ÿค™๐Ÿป

green kestrel
radiant kraken
#

why

green kestrel
#

but it can be configured to delete images with any specific content in

#

because, screenshots of code are against our rules on our server

#

they're supposed to paste the code itself not a screenshot of it

#

screenshots aren't searchable, are unfriendly for those with a screen readers etc

#

plus they often lack context

radiant kraken
green kestrel
# radiant kraken inb4 wall of text

for programming help a wall of text is far more useful... you can't paste a screenshot into your editor to replicate a programming problem...

#

I mean you can always use the scrollback

radiant kraken
green kestrel
#

no

radiant kraken
#

what if someone pasted a code and said "why this not work"

green kestrel
#

you can copy and paste it

#

but they do that with screenshots too

#

and you're even less able to help with a screenshot

#

oh and then there's mobile users where the screenshot is beyond useless

#

and the people who take photos of their monitor with their phone

#

the interesting thing though is the words it detects in images are configurable, so you could for example block images with racist memes

#

it's pattern matching, not AI

#

means it's much easier for a server admin to control and set up and ready to go quicker without a long training phase

radiant kraken
#

fairs

civic locust
#

I have an doubt my freind account geted ban

#

He needed to apply

#

For approving the bot what do?

#

He can apply with this discird account

deft wolf
#

Do you mean "approving" the bot on top.gg or on discord

#

Because these are two different things and since you're asking on this server, I assume it's the first one

civic locust
#

Bro gotit

neon leaf
#

should I make a vote perk 1.25x xp or something

#

idk what else to add that isnt totally unfair

lyric mountain
#

I mean, it's not exactly "unfair" if it's available for everyone is it?

neon leaf
#

its not for some people in my server

#

they got banned on topgg and cant vote lmao

lyric mountain
#

well, skill issue KEKW

neon leaf
#

no but I dont like op vote rewards

deft wolf
#

It depends a bit on your approach. Such a bonus is not much, but it is always something in exchange for a vote, but will it be so profitable to vote for a bot?

neon leaf
#

It should be worth it but not a big advantage

lyric mountain
#

thing is, if you give too little there'll be no incentive to vote

deft wolf
#

Yea, you need to find balance

neon leaf
#

I dont have any global features is the thing

#

everything is bound to servers

#

wait

#

I have an idea

#

what if I make a vote shop where u can decide on which server to claim reward

lyric mountain
#

for my bot I give a sum of currency + a stack of vote

neon leaf
#

then I could add more

lyric mountain
#

with 7 stacks u can exchange for an exclusive currency, which can be used in the shop

neon leaf
#

my economy is very work in progress currently

#

I dont even have a shop yet lmao

#

yeah I think im gonna make a vote shop

lyric mountain
#

I'd not worry much about people banned from topgg, it's a consequence for their actions

#

if they want they can appeal for an unban

#

later on if you add your bot to more lists you can integrate with them, if there's an api at all

#

if they get banned from them too, well, they're forcing the bar

deft wolf
#

Personally, I'm a fan of expanding the bot's functions rather than completely blocking it behind a vote wall

#

Same for pay walls

neon leaf
#

yea

dense cipher
#

how to add no prefix in discord bot js

solemn latch
#

Looks like you already did

const args

previously

#

oh okay, just delete the question ๐Ÿ‘€

dense cipher
#

@solemn latch

solemn latch
#

I cant answer that sorry ๐Ÿ˜”

dense cipher
#

its ok

deft wolf
#

What do you mean "no prefix"?

#

Like slash commands?

lyric mountain
#

especially if one of the commands happens to be a commonly said word

dense cipher
#

on js

lyric mountain
#

store the timestamp of the last time a command was used by that user

#

then compare with the timestamp of when they try to use it again

#

if it's less tha X millis show an error message

surreal sage
#

im fixing a diff dev's stuff and he's using postgres with user password "password"
how do i create a user without getting "peer authentication failed"

lyric mountain
#

well, ur getting auth error because either the user or the pass dont match

#

or they're using an ssh key for authentication

quartz kindle
#

password best password

surreal sage
#

firewall is turned off on the server

lyric mountain
#

careful not to enable it before doing ufw allow ssh

surreal sage
#

duh

#

i need to make an acc with a password that won't error

#

I copy pasted the passwords

#

and it no worky

#

CREATE USER xxx WITH PASSWORD yyy CREATEDB

#

and when i put xxx yyy in node, it errs

lyric mountain
#

does it work with the existing user?

deft wolf
lyric mountain
neon leaf
#

my bycicle lock pin is 1024

deft wolf
#

My phone pin is 2001

#

Which is the year when i was born

neon leaf
#

my sim pin is 2048

quartz kindle
#

mine is 2000 for no reason lmao

#

just because the number sounds cool

neon leaf
#

I either use 2^10, 2^11, 2^12 or 2^13

surreal sage
#

@lyric mountain

#

idk postgres pass

#

it isnt my server

lyric mountain
#

not what I mean

#

are u able to connect normally through the existing user?

#

or does it error too?

surreal sage
#

there are none

#

or existing user as in

#

system user

lyric mountain
#

this user with "password" as password, is it able to connect?

surreal sage
surreal sage
#

๐Ÿ˜„

lyric mountain
surreal sage
#

there are no users anymore

#

at least tmk

lyric mountain
#

I'm asking because you had to check whether they're using an ssh key or not

surreal sage
#

yes it was using password

lyric mountain
#

if it did error when connecting, then that'd be the reason

surreal sage
#

"username": "xxx"
"password": "password"

#

no ssh keys either

lyric mountain
#

u can use pass AND ssh key

surreal sage
#

idk what to answer mate

#

idk postgres

#

never will

lyric mountain
#

ur in quite a risky situation then

surreal sage
#

there is no data

lyric mountain
#

replace theuser with whatever user u created

surreal sage
lyric mountain
#

when u ran CREATE USER theuser WITH PASSWORD thepass CREATEDDB, did u put ; after it?

surreal sage
#

no fear

lyric mountain
#

that's the reason then

surreal sage
#

fuckin hell

lyric mountain
#

u never finished the statement

#

psql cmdline allows multiline statements, so it'll only execute when u finish it

surreal sage
#

ERROR: syntax error at or near "CREATE"

#

๐Ÿ—ฃ๏ธ ๐Ÿ’ฏ

lyric mountain
#

what did u run?

surreal sage
#

all g

#

thanks mate

lyric mountain
#

yw

surreal sage
#

christ

#

mate

#

thanks

#

im never using postgres

#

what a mess

lyric mountain
#

not really

surreal sage
#

let me think it's a mess

#

pls

lyric mountain
#

it's actually much better and safer this way, plus iirc mysql does this too

#

postgres always give u an output when u run a command, like > CREATE or smth

#

if u see nothing, it's because it's still awaiting a semi

surreal sage
lyric mountain
#

if the cli didn't support multiline you'd be forced to write statements in a single line which...would be horrible

neon leaf
#

I dont know why I switched to postgres, I dont know what it does better but
๐Ÿ’ฏ Postgres best !!

quartz kindle
#

i still love my sqlite

#

huehuehue

frosty gale
#

postgres users dropping their entire database by accident

rustic nova
#

the gitlab incident

solemn latch
#

That must have been a long day

surreal sage
#

was using mongodb for collections of 600k+ docs

deft wolf
#

What are you keeping in this database?

#

Probably not a list of all games on Steam

lyric mountain
#

Couldn't imagine myself using nosql, maybe for cache or random data but not for complex systems

#

Idk, I'm too used to relationships

neon leaf
#

im using postgres for random data sometimes

#

just an id + maybe unique identifier and just random jsonb data

lyric mountain
#

Ironically, that's still not random, as all data within that table is grouped by some purpose

#

For example, I have a table called dynamic_properties

#

Which are basically variables that are to be persisted and manipulated during runtime

#

The grouping purpose is that all of them are variables

#

Even tho the value they hold is seemingly unrelated

lament rock
#

๐Ÿ’€

pale vessel
#

did ya get divorced

stray shell
#

asd

eternal osprey
#

how do i create this in djs?

lyric mountain
#

that's generated by discord no?

lament rock
neon leaf
#

discord formats it that way

frosty gale
radiant kraken
quartz vector
fringe python
#

Lol

surreal sage
#

i've been trying to do this for a few days but i cant make sense of it

i want to make a proxy server in node that logs all requests where the responses' content type starts with application/vnd
with https support

(and then start chrome with the proxy server flag)

#

the target should be anything for me

flat copper
#

hello im using tailwind for my website but the classes are not working on vs code , like absolute bg-white etc

pale vessel
#

you mean autocomplete or whatever?

#

if the classes arent working it wouldn't be the editor's fault

flat copper
#

nope , like css classes

pale vessel
#

that wouldn't be vsc's issue

rustic nova
#

also vsc does not do that by default

#

you need a snippet extension for example

surreal sage
#

what's a way to download thousands of files with threading in node?

#

bluebird

wraith pilot
#

Do anyone developed website?

#

Here

#

Im having a problem

wheat mesa
#

Ask your question, someone will respond if they know an answer

wraith pilot
#

Like in my mobile the website is working fine

#

Like this

#

But whenever i switch my website to desktop mode some white space appears on below the footer

#

How to fix this issue

wheat mesa
#

Did you make this yourself or did you just copy paste it from the internet

wraith pilot
#

I didn't make it , it was a sample code

#

So why is the issue occuring

wheat mesa
#

Something is probably wrong with the CSS targeting your body/container element

surreal sage
#

tried ```js
import * as Promise from "bluebird";

// and

import {Promise} from "bluebird";```

wheat mesa
#

Well, I donโ€™t know, you need to show some code

#

Keep in mind that itโ€™s going to be hard to help if you didnโ€™t write the code yourself

earnest phoenix
surreal sage
#

Promise.map

wraith pilot
wraith pilot
#

Do i send the code here or in dm?

wheat mesa
#

Here

wraith pilot
wheat mesa
#

Whatever is relevant to the issue, so probably the CSS and some HTML

earnest phoenix
# surreal sage Promise.map

Use the built-in Promise.all() method by passing it an array of promises (or mapping to promises, using <Array>.map())

wraith pilot
#

Ok let me send the css

surreal sage
#

I'm looking for the concurrency option though

wraith pilot
# wheat mesa Whatever is relevant to the issue, so probably the CSS and some HTML
ul {
    margin:  0px;
    padding: 0px;
}
.footer-section {
  background: #151414;
  position: relative;
  overflow: hidden;
  word-wrap: break-word;
}
.footer-cta {
  border-bottom: 1px solid #373636;
}
.single-cta i {
  color: #ff5e14;
  font-size: 30px;
  float: left;
  margin-top: 0px;
  padding-left: 15px;
}
.cta-text {
  padding-left: 15px;
  display: inline-block;
}
.cta-text h4 {
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 0px;
  padding-left: 0px;
}
.cta-text span {
  color: #757575;
  font-size: 15px;
  padding-left: 15px;
}
#

This is the half code

#

Send the rest

#
footer-content {
  position: relative;
  z-index: 2;
  padding-left: 15px;
}
.footer-pattern img {
  position: absolute;
  top: 0;
  left: 0;
  height: 330px;
  background-size: cover;
  background-position: 100% 100%;
}
.footer-logo {
  margin-bottom: 30px;
}
.footer-logo img {
    max-width: 200px;
}
.footer-text p {
  margin-bottom: 14px;
  font-size: 14px;
      color: #7e7e7e;
  line-height: 28px;
}
.footer-social-icon span {
  color: #fff;
  display: block;
  font-size: 20px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 20px;
}
.footer-social-icon a {
  color: #fff;
  font-size: 16px;
  margin-right: 15px;
}
.footer-social-icon i {
  height: 40px;
  width: 40px;
  text-align: center;
  line-height: 38px;
  border-radius: 50%;
}
.facebook-bg{
  background: #3B5998;
}
.twitter-bg{
  background: #55ACEE;
}
.google-bg{
  background: #DD4B39;
}
.footer-widget-heading h3 {
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 40px;
  position: relative;
}
surreal sage
#

got it all g

wheat mesa
#

Now youโ€™re gonna have to wait for a CSS wizard to come help :^)

wraith pilot
#
footer-widget-heading h3::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -15px;
  height: 2px;
  width: 50px;
  background: #ff5e14;
}
.footer-widget ul li {
  display: inline-block;
  float: left;
  width: 50%;
  margin-bottom: 12px;
}
.footer-widget ul li a:hover{
  color: #ff5e14;
}
.footer-widget ul li a {
  color: #878787;
  text-transform: capitalize;
}
.subscribe-form {
  position: relative;
  overflow: hidden;
}
.subscribe-form input {
  width: 100%;
  padding: 14px 28px;
  background: #2E2E2E;
  border: 1px solid #2E2E2E;
  color: #fff;
}
.subscribe-form button {
    position: absolute;
    right: 0;
    background: #ff5e14;
    padding: 13px 20px;
    border: 1px solid #ff5e14;
    top: 0;
}
.subscribe-form button i {
  color: #fff;
  font-size: 22px;
  transform: rotate(-6deg);
}
.copyright-area{
  background: #202020;
  padding: 25px 0;
  padding-left: 15px;
}
.copyright-text p {
  margin: 0;
  font-size: 14px;
  color: #878787;
}
.copyright-text p a{
  color: #ff5e14;
}
.footer-menu li {
  display: inline-block;
  margin-left: 20px;
}
.footer-menu li:hover a{
  color: #ff5e14;
}
.footer-menu li a {
  font-size: 14px;
  color: #878787;
}
#

Full css code for that part

wheat mesa
#

Idk, someone will eventually help

#

Iโ€™m just not very good with CSS so I canโ€™t give a very good answer

wraith pilot
#

Ok waiting

#

Hope someone will ping me

earnest phoenix
surreal sage
#

Bluebird works for me now, do you hate it? is it bad? wsp

earnest phoenix
#

Bluebird is gigantic for such a simple purpose, but if you don't care about that then keep using it

surreal sage
#

wont be a package

#

so

surreal sage
#

ok hai

#

im using fluent-ffmpeg

#

with this version of a commnad
ffmpeg -allowed_extensions ALL -i ".m3u8" -y -threads 4 -c copy -bsf:a aac_adtstoasc ".mp4"
when i run this cmd in my terminal, it works just fine
but if i run it with fluent-ffmpeg, it says invalid data found

lyric mountain
#

what's the diff between Promise.map and Promise.then?

quartz kindle
#

Promise.map is not a thing, so i assume its some lib like bluebird

#

should be the same as Promise.all(array).then(array => array.map())

lyric mountain
lament rock
wraith pilot
wraith pilot
#

How do i fix this space

#

For desktop mode

lyric mountain
#

F12, inspect element

#

see what's taking that space

wraith pilot
lyric mountain
#

well, that'll be hard then

wraith pilot
#

Or i can send you the website link if it helps

lyric mountain
#

the link would be helpful yes

wraith pilot
lyric mountain
#

well, already saw the issue

wraith pilot
#

what?

lyric mountain
#

there's nothing in the site

#

so the site height is less than the viewport

wraith pilot
#

Yeah I didn't add anything

lyric mountain
#

that's the issue

wraith pilot
lyric mountain
#

add stuff

wraith pilot
#

Adding stuff will fix it?

lyric mountain
#

yes because it'll add height to it

wraith pilot
#

like long paragraphs

wraith pilot
#

or something

lyric mountain
#

you can, but that'll solve nothing

#

it'll still be a huge white area in an empty site

#

just that the footer will be on the bottom

wraith pilot
#

let me try

lyric mountain
#

add content and it'll be solved naturally

wraith pilot
#

and add content

wraith pilot
#

I added some contents and it got fixed

wraith pilot
lyric mountain
#

yw

quartz kindle
#

anyone good with htaccess rewrites? i need help

#

i have a website on a cpanel hosting service and shit, and recently changed the primary domain so everything about this shit changed

#

what i had before was like this:
root

  • vendor
  • includes
  • domainfolder
  • index.php
  • .htaccess
#

the domain's root folder was domainfolder, and from there index.php accesses the includes folder, and htaccess has a bunch of standard rewrites, basically all paths should be handled by php

#

but now after the change its like this:

#
  • public_html
  • vendor
  • includes
  • domainfolder
    • index.php
    • .htaccess
  • .htaccess
#

and the primary domain's root folder is public_html and cannot be changed

#

so i need to rewrite everything to domainfolder

#

all my attempts so far are failing miserably

surreal sage
#

i hate how windows file deletions take so long

#

like on a linux system, its basically near instant

#

but nah, windows is like: brb gotta look around for a bit, come back in 10 min

#

shift delete

green kestrel
#

only explorer is so slow

surreal sage
lament rock
#

Make your own

surreal sage
#

directory opus

wraith pilot
#

My font is not working for my website do you know why?

#

Im using custom font but it is not working

crystal wigeon
#

wtf is this discordjs non sense

#

This shit is not letting docker build at all, idc if its deprecated, im not using it

#

but it like hangs the docker build

#

wtf

#

?

rustic nova
#

give it some time

neon leaf
#

is there any reasonable way to loop over all discordjs interaction options? I tried using <CommandInteraction>.options.data but its structured very weirdly

deft wolf
#

Why do you need to loop over them?

neon leaf
#

to get all values

#

its a global function so I dont know which exist beforehand

#

nvm I think I understand the structure

#

yeah its nested with the subcommandgroup / subcommand

#

weird

wraith pilot
#

Hey

#

Can anyone help me

#

If i use margin-bottom: -20px;

#

My text is going down the footer

#

How do i fix this

quartz kindle
wraith pilot
#

The text is going down the footer

#

How do i make it not go down

neon leaf
#

by not using a negative margin

wraith pilot
neon leaf
#

then use margin top with positive margin...?

wraith pilot
#

Down side

real rose
#

what class are you adding the negative margin to

#

just add the opposite margin with a positive value

wraith pilot
real rose
#

i seriously cant help you here with so little information

#

provide the relevant css

quartz kindle
wraith pilot
#

That space between the image and the text

#

@quartz kindle @real rose

deft wolf
#

Do you want it to be bigger?

real rose
wraith pilot
#

Or that part

#
<div class="centered-text">
    <p style="text-align: left; padding-left: 10px; margin: 1rem 0;">"Teasing Master Takagi-san" Final Chapter promo art by Souichirou Yamamoto.</p>
</div>
#

@real rose

quartz kindle
wraith pilot
wraith pilot
#

My fonts are not changing for the website

#

๐Ÿ’€

#

@quartz kindle

#

Can you help

quartz kindle
#

did they load before and now they dont?

#

or you just added them and they dont work?

wraith pilot
#

But i want to change so i change it

#

But the same shows

#

Not the new one

quartz kindle
#

open dev tools (F12)

#

go to network tab

#

disable caching

#

reload the page

neon leaf
rustic nova
#

look swag

real rose
#

tbf

eternal osprey
#
 const estTimezoneOffset = -5 * 60; // EST timezone offset is UTC-5

          const currentDate1 = new Date();
          const utcTimestamp = currentDate1.getTime();
          const estTimestamp = utcTimestamp + estTimezoneOffset * 60 * 1000;
          const estDate = new Date(estTimestamp);
          let currentDay = estDate
            .toLocaleString("en-US", {
              weekday: "long",
              timeZone: "America/New_York",

              hour12: true,
            })
            .toLowerCase();```
does anyone know why my currentDay is not working properly for the est timezone?
#

For some reason if i try it out at 12 am the bot gets confused or sumthing. Look at this:

#

if i convert the discord timestamp to the est time, it shows that it happened on thursday rather than on friday..

#

i am reetarded af. My vps is running on some server in north america so the date.now() -5 is specified to convert from cest to est lmao

lyric mountain
#

lmao

radiant kraken
#

but the discord icon is a bit wack though

#

there are also two donate buttons in the mobile page

pale vessel
#

really goofy

neon leaf
#

Yeah I gotta find a new one

quartz kindle
#

use twitter

#

ffs lmao

#

im pretty sure nobody out there actually calls it X

deft wolf
#

I saw some articles when I was looking for something recently, they called it Twitter but added an X in brackets

#

I don't know why but it's quite funny

spark flint
#

BBC news puts "X (Formally Twitter)"

#

also that discord icon yeah

quartz kindle
radiant kraken
quartz kindle
rustic nova
#

So they have to mention X

surreal sage
#

what's this in node/js?

eternal osprey
#

in data analytics does anyone know why we tend to use n-1 when calculating the covariance rather than n?

#

My textbook for some reason tells me to just use n, but the whole internet is using n-1..?

surreal sage
#

uhm

#

fs-extra fixed it

quartz kindle
#

ew fs-extra

earnest phoenix
surreal sage
#

lem get

#

v18.18.0

earnest phoenix
# surreal sage

This is not where the error occurs, the screenshot you showed of the error is telling you that you're using fs.rmdir() or fs.rmdirSync() somewhere on a non-empty directory without the appropriate options

surreal sage
#

will check

#

middle is a file

#

@earnest phoenix

#

there is no rmdir

earnest phoenix
#

Can you show the full error then?

surreal sage
#

okay

surreal sage
earnest phoenix
# surreal sage

Then not sure, your system is either using a Node.js version that doesn't recognize those options, or something is going completely wrong somewhere

surreal sage
#

node issue!!!

earnest phoenix
#

I absolutely can't reproduce your issue

neon leaf
#

is it possible to send a message where the mentions dont actually ping but are still there?

earnest phoenix
#

yes

neon leaf
#

like the same effect when adding after an edit

#

how?

earnest phoenix
#

copy the role id, bot id. i dont think you can do it with members though. it usually WORKS when you dont have permission to mention roles, but im not sure if there isa solution for administrative users

earnest phoenix
neon leaf
#

discord.js

earnest phoenix
neon leaf
#

oh thats great

#

so does it still look like the normal mention

earnest phoenix
#

For example, if you do <TextBasedChannel>.send({ ..., allowedMentions: { parse: [] } }), it'll mention anything but not actually ping

#

Yes it does look like a regular mention

neon leaf
#

alr great

#

thank you so much

earnest phoenix
#

You're welcome

neon leaf
#

ok I actually found an issue with that, can I like only make 1 of the mentions ping? a specific id?

#

oh yeah nvm

#

just add it to the parse array right

earnest phoenix
#

Correct, as many as you want

#

You can also pass an empty array for none

neon leaf
#

ignore typo

earnest phoenix
#

Yes

neon leaf
#

alr, thanks

earnest phoenix
#

You're welcome

neon leaf
#

are message edit ratelimits per token or per ip? Ive been having message edit ratelimit issues on one of my bots but not the rest (all running same codebase on same ip)

deft wolf
#

Rather per token

#

I host 3 bots at the same time and I had no problem sending or editing messages

neon leaf
#

I mean it may also be my code, since I have a button that is in a queue so im deferring it but because of that I need to edit the original message when its my turn out of the interactions scope so it counts towards ratelimits

#

this basically

import Button from "@/bot/button"
import { ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js"

const button: (giveawayId: number) => string = new Button()
    .setName('giveaway')
    .listen(async(ctx, giveawayId: number) => {
        await ctx.interaction.deferReply({ ephemeral: true })

        await ctx.queues.giveawayEnter.addAndWaitForFinish(async() => {
            let entries = await ctx.database.giveawayEntry.count({
                where: {
                    giveawayId
                }
            })

            const entered = await ctx.database.giveawayEntry.findUnique({
                where: {
                    giveawayId_serverUserId: {
                        giveawayId,
                        serverUserId: ctx.metadata.serverUserId
                    }
                }, select: {
                    id: true
                }
            })

            if (entered) entries--
            else entries++

            await ctx.interaction.message.edit({
                components: [
                    new ActionRowBuilder()
                        .setComponents(
                            new ButtonBuilder()
                                .setEmoji('1163537482063818823')
                                .setLabel(entries.toString())
                                .setCustomId(button(giveawayId))
                                .setStyle(ButtonStyle.Primary)
                        ) as any
                ]
            })

            if (entered) {
                await ctx.database.giveawayEntry.delete({
                    where: {
                        id: entered.id
                    }, select: null
                })
            } else {
                await ctx.database.giveawayEntry.create({
                    data: {
                        giveawayId,
                        serverUserId: ctx.metadata.serverUserId
                    }, select: null
                })
            }

            if (entered) return ctx.interaction.editReply('`๐ŸŽ‰` Successfully left the giveaway. *on accident?*')
            else return ctx.interaction.editReply('`๐ŸŽ‰` Successfully joined the giveaway. *good luck!*')
        })
    })
    .export()

export default button```
#

I tried using update & followUp but that just errors that ive already replied

quartz kindle
#

what type of ratelimit are you getting?

#

edit share limits with send, so 5 per 5 per channel

neon leaf
#

I don't even know, I looked at sentry and it's just full of 429 requests for patching a message

quartz kindle
#

and 50 global per second

#

does the 429 have the full error message?

neon leaf
#

Uh lemme check

#

Nope, sentry doesn't show me the content

#

I mean it could just be random issue that's magically fixed tomorrow

#

Because like it works fine on my test bot and in prod on another token

quartz kindle
#

check how many of those PATCH requests are being made to the same channel

#

and what is the time frame

#

if there are 5 of those within 5 seconds for the same channel id, then youre hitting the channel rate limit

neon leaf
#

22 requests

quartz kindle
#

within 5 seconds?

neon leaf
#

About 1-2 sec from another

#

OH

#

Is it maybe because it's an announcement channel

#

And I crossposted the message

green kestrel
#

hmm, what would you think is the nicest way to let the user edit and show a list of potentially hundreds of items via slash commands?

#

im thinking a list command, with pagination with buttons, and a separate add/delete command

#

this is how i'd usually do it, im wondering if theres a nicer way

green kestrel
#

perhaps

lyric mountain
#

The best option would be a site tho

craggy pine
#

Its funny that autocomplete could accomplish that ^ but it only allows 25 out of the 26 alphabetical letters. Basically a menu system via the autocompletes. Would be very messy though.

interaction.options?._hoistedOptions[0].name === 'whatever' && interaction.options?._hoistedOptions[0].value === '' //if value === '' then a choice hasn't been selected yet.
proven lantern
#

what's the best way to instruct a user to allow DMs from my bot? if they DM my bot will that enable DMs? do they need to allow DMs from everyone on the server?

slim void
proven lantern
slim void
#

You can not add bots as a friend

proven lantern
#

i guess the user could make a private server and install the bot there. then they could keep DMs disabled on the public server.

slim void
#

Well let me ask u this

#

What does the bot do?

#

Like why do they need to set it up

#

@proven lantern

neon leaf
#

Alr I finally have my first vote reward, longer reminder and giveaways. Personally I like it because it doesn't take away any actual functionality

proven lantern
# slim void <@92436985859293184>

it a matchmaking bot. normally it at mentions players in channel message when a match has started showing the players on each team. for games like Among Us the teams need to be hidden so the message cant be in a public channel. so i plan to message each player and tell them their team privately

slim void
#

Or make the bot make a channel for setup then delete the channel after?

proven lantern
#

the way the bot works is that a large gaming community installs the bot on their public server. the server owner runs a command that creates a "host" button. when players click the host button it puts a message in that channel showing someone is hosting a match. players join the match and choose which team they want to be on

slim void
#

ah

#

I like that idea tbh very smart

proven lantern
#

ty

thorn spruce
#

With that

        let value_from_autocomplete = interactionCreate?.options.getFocused().toLowerCase()
        let sub = interactionCreate.options.getFocused(true);
        let a = await AppInstance.Commands.get(command).autocomplete[sub.name](LanguageDictio[lang.toLowerCase()] ?? "en", interactionCreate.user.id)
            let dictio = []
            let base_dictio = []
                for(let i = 0; Object.keys(a).length-1 >= i; i++) {
                    if(base_dictio.length != 25) {base_dictio.push(a[i]);} 
                    let c = a[i]?.name?.toLowerCase();
                    if((c.startsWith(value_from_autocomplete) && ~c.indexOf(value_from_autocomplete)) || (value_from_autocomplete.length >= 2 && ~c.indexOf(value_from_autocomplete)) ) {
                        dictio.push(a[i])
                        if(c == value_from_autocomplete) {break}
                    }
                    if(dictio.length == 25) {break}
                }
        a = a = dictio.length <= 0 ? base_dictio : dictio
        interactionCreate.respond(a)
#

And it works but yes it's limited to 25 choices

lyric mountain
#

that's a lot of cases

surreal sage
#
  • I'm on win
#

buckarooski

queen needle
quartz kindle
#

@earnest phoenix excuse me what the fac

#
31 verbose stack TypeError: Class extends value #<Object> is not a constructor or null
31 verbose stack     at Object.<anonymous> (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\tar\node_modules\minizlib\index.js:57:20)
31 verbose stack     at Module._compile (node:internal/modules/cjs/loader:1241:14)
31 verbose stack     at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
31 verbose stack     at Module.load (node:internal/modules/cjs/loader:1091:32)
31 verbose stack     at Module._load (node:internal/modules/cjs/loader:938:12)
31 verbose stack     at Module.require (node:internal/modules/cjs/loader:1115:19)
31 verbose stack     at require (node:internal/modules/helpers:130:18)
31 verbose stack     at Object.<anonymous> (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\tar\lib\pack.js:26:14)
31 verbose stack     at Module._compile (node:internal/modules/cjs/loader:1241:14)
31 verbose stack     at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
32 verbose cwd C:\Users\hmanjarrez\Downloads\tim
33 verbose Windows_NT 10.0.19044
34 verbose node v20.8.1
35 verbose npm  v10.1.0
earnest phoenix
earnest phoenix
quartz kindle
#

they tried running my repo, and got that

#

its comming from npm itself

#

on a fresh installation

#

i told them to try uninstalling and reinstalling node lol

earnest phoenix
#

Looking at minizlib, there's nothing wrong

quartz kindle
#

its very weird tho, that they said its a fresh installation

#

they are a .net dev, never used node before

earnest phoenix
#

ยฏ_(ใƒ„)_/ยฏ

wheat mesa
#

If they arenโ€™t already, maybe try installing through nvm?

slim void
#

What is this "shapes" bot bc I don't see how it's a bot it just has u join their discord ๐Ÿค”

deft wolf
#

There is an article on medium.com about this but for some reason automod has blocked this link

rustic nova
#

This is intentional

#

Suffer

#

You can directly post the link

#

But not hyperlink it

real rose
#

yeah

#

what aurel said

#

suffer

deft wolf
#

Ah, okey

rustic nova
deft wolf
slim void
#

Is it bad this is the first time I've heard of this "bot"

neon leaf
rustic nova
#

a

spark flint
#

days without discord downtime:

strange orbit
#

Hi

#

@modern sable

#

Pls Look

#

My Discord Bot Development Pls Rol

lyric mountain
#

absolutely no context

rustic nova
#

Normal

tulip ledge
#

Any clue about these two erros?

Unhandled Rejection: Response: Bad Gateway
    at RequestHandler.execute (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:357:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async RequestHandler.push (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
    at async MessageManager.edit (/home/container/node_modules/discord.js/src/managers/MessageManager.js:132:15) {
  code: 502,
  method: 'patch',
  path: '/channels/729825643482841089/messages/1162817333786591252',
  requestData: {
    json: {
      content: undefined,
      tts: false,
      nonce: undefined,
      embeds: [Array],
      components: [Array],
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: 0,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined,
      thread_name: undefined
    },
    files: []
  }
}
Unhandled Rejection: HTTPError [AbortError]: The user aborted a request.
    at RequestHandler.execute (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:201:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async RequestHandler.push (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
    at async MessageManager.edit (/home/container/node_modules/discord.js/src/managers/MessageManager.js:132:15) {
  code: 500,
  method: 'patch',
  path: '/channels/993318267622019093/messages/1162136661124194325',
  requestData: {
    json: {
      content: undefined,
      tts: false,
      nonce: undefined,
      embeds: [Array],
      components: [Array],
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: 0,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined,
      thread_name: undefined
    },
    files: []
  }
}
deft wolf
#

Scroll up

#

There is discordstatus page

tulip ledge
#

ah it was down

#

Bad Gateway is also from the api being down?

deft wolf
#

Well, it's 503 error code so i guess it's discord side error

#

Very possible that it is related

lyric mountain
#

damn found the secret github page

#

appears when a repo takes too long to load

eternal osprey
#

hey i have a question about data analysis. "The number of patients in a hospital" can this be considered as interval data?

#

I mean there's no real zero point, even 0 patients in a hospital is still 0 patients, and not a complete abscence of the number of patients.

eternal osprey
#

yeah it is can't lie.

#

but i know the answer know

lyric mountain
#

because for example, if you had 10 patients on day 1, and 0 on day 2 and 3, you can't have a linear chart

eternal osprey
#

it's ratio instead of interval.

lyric mountain
#

because you didn't have 5 on day 2 nor 2 on day 3

#

regarding such data it's better to use absolute values

eternal osprey
#

it HAS a true zero. 0 Patients means a complete absence of patients.

eternal osprey
#

but i had to classify them

lyric mountain
eternal osprey
#

yeah true it's really vague but they just told me to classify it so i had no choice but to pick the nearest label it belonged to

#

its for sure not nominal, nor ordinal

#

and ig ratio would be the only label that would fit the data representation ig

lyric mountain
#

why not nominal?

eternal osprey
#

because you can't really categorize it.

lyric mountain
#

in a hospital? u can

eternal osprey
#

hmm

#

yeah okay i see where you're going

lyric mountain
#

severe case, light injury, male, female, broken bone, illness, etc

eternal osprey
#

yeah then it could but that's not what they meant

#

they rather meant just the NUMBER of patients, not their injuries.

#

or etc.

lyric mountain
#

yes, but u can categorize those patients into cases

eternal osprey
#

yeah but this book of pearson about data mining is rather concrete. It exactly tells you what to label

#

so else he would have written the injuries of patients in a hospital

lyric mountain
#

what I mean is, they did specify patients, so whole entities

#

could've been any other entity, unless they didn't think about it too much

#

like, u cant have half a patient

#

and intervals are usually continuous no?

eternal osprey
#

yeah indeed they are

#

hmm

#

idk this guy says it's ratio but i think it can be ambigious

#

could be either one of thse

surreal sage
#

nah mate

#

github doing me dirty

#

callin me out like that

#

jeez

pale vessel
#

bad commit

frosty gale
#

if you ever wanna be humbled as a developer go on leetcode 150 interview questions

quartz kindle
#

also leetcode benchmarking js solutions be like

worn sonnet
#

Hi, in nextcord I can use presistent_view:custom_id to receive interactions of buttons between different runs
But how can I achieve same with discord.js?

tulip ledge
#

I'm working on a dashboard, but if I log in I want to have a couple extra options that other peopl don't have, how do I do this securely?

#

Could I just use the oauth?

#

And check for id?

queen needle
#

You could use id or password protect them

lofty ginkgo
#

When will my bot be verified?

slim void
#

When they get too it

elfin tulip
#

Hey, is it possible somehow to stop the awaitMessages() in discord.js?

deft wolf
#

It depends on what you need it for. Generally, if you only need one message, you can set max: 1

elfin tulip
deft wolf
#

You can set a time limit for which your bot will wait for a message

#

After this time has passed, the bot will no longer wait for messages

#

Or you can use collector and use collector.stop() directly

earnest phoenix
#

However you can do so to a collector as mentioned

bitter heart
#
const { SlashCommandBuilder } = require("@discordjs/builders");
const { Database } = require("nukleon");
const db = new Database("./database/kayitnormal.json")
const db2 = new Database("./database/sunucukayitlari.json");

module.exports = {
  data: new SlashCommandBuilder()
    .setName("kayฤฑt-normal")
    .setDescription("Kullanฤฑcฤฑyฤฑ kaydeder. (normal)")
    .addUserOption(option =>
      option.setName("kullanฤฑcฤฑ")
      .setDescription("Kullanฤฑcฤฑyฤฑ etiketleyiniz.")
      .setRequired(true))
    .addStringOption(option =>
      option.setName('isim')
      .setDescription('KiลŸinin ismini yazฤฑnฤฑz.')
      .setRequired(true))
    .addNumberOption(option =>
      option.setName('yaลŸ')
      .setDescription("KiลŸinin yaลŸฤฑnฤฑ yazฤฑnฤฑz.")
      .setRequired(true)),
    run: async (client, interaction) => {
      if (!interaction.member.permissions.has("ADMINISTRATOR") && !interaction.member.roles.cache.has(db.get(interaction.guild.id + "kayityetkilisi"))) {
        return interaction.reply({ content: "Bu Komutu Kullanmak ฤฐรงin Yetkiniz Yok.", ephemeral: true });
      }
        const member = interaction.options.getMember('kullanฤฑcฤฑ');
        try {
        await member.roles.add(db.get(interaction.guild.id+"otorol"))
        await member.roles.remove(db.get(interaction.guild.id+"kayitsiz"))
        await member.setNickname(`${interaction.options.getString("isim")} | ${interaction.options.getNumber("yas")}`)
        console.log(interaction.guild)
        let yenikayitsayisi;
        if(db2.get(interaction.guild.id+interaction.user.id)) {
          yenikayitsayisi = db2.get(interaction.guild.id+interaction.user.id) + 1;
        } else {
          yenikayitsayisi = 1;
        }
        const exampleEmbed = new EmbedBuilder()
        .setColor(0x0099FF)
          .setAuthor({ name: 'Kayฤฑt Yapฤฑldฤฑ!', iconURL: interaction.guild.iconURL() || "https://cdn.discordapp.com/attachments/1158837680306655315/1163173769750253608/standard.gif?ex=653e9cfd&is=652c27fd&hm=9f86d65a146d7a1d4acc9181dd2b788c50894506e74df274e6297cd75c313162&" })
          .setDescription(`> **Kayฤฑt Bilgileri**
        **ใƒปKayฤฑt Edilen Kullanฤฑcฤฑ:** <@${member.id}>
        **ใƒปKayฤฑt Eden Kullanฤฑcฤฑ:** <@${interaction.user.id}>
        **ใƒปVerilen Roller:** <@&${db.get(interaction.guild.id+"otorol")}>
        **ใƒปYeni ฤฐsim:** \`${interaction.options.getString("isim")} | ${interaction.options.getNumber("yas")}\` 
        **ใƒปKayฤฑt Tรผrรผ:** \`Normal\` `)
          .setThumbnail(member.avatarURL() || "https://cdn.discordapp.com/attachments/1158837680306655315/1163173769750253608/standard.gif?ex=653e9cfd&is=652c27fd&hm=9f86d65a146d7a1d4acc9181dd2b788c50894506e74df274e6297cd75c313162&")
          .setFooter({ text: `ใƒป${interaction.user.username}, kayฤฑt sayฤฑsฤฑ: ${yenikayitsayisi}` });
        await db2.set(interaction.guild.id+interaction.user.id, yenikayitsayisi);
        await interaction.reply({ embeds: [exampleEmbed] })
      } catch (error) {
        interaction.reply({
          content: "Kullanฤฑcฤฑyฤฑ dรผzenlerken bir hata oluลŸtu. Muhtemelen eksik izinleriniz var.",
          ephemeral: true,
        });
        console.error("Error while processing the command:", error);
      }
    }
    
 };
deft wolf
#

Thanks for the code

earnest phoenix
#

In discord.js v14 you have to do:

const { PermissionFlagsBits } = require('discord.js');

...

interaction.member.permissions.has(PermissionFlagsBits.Administrator);
bitter heart
#

okay im fix

#

So how can I test it?

earnest phoenix
bitter heart
#

For some reason it gives an error when I say something, I wonder if my bot has a love for me ๐Ÿ˜„

earnest phoenix
bitter heart
#
const { SlashCommandBuilder } = require("@discordjs/builders");
const { Database } = require("nukleon");
const db = new Database("./database/kayitnormal.json")
const db2 = new Database("./database/sunucukayitlari.json");
const { PermissionFlagBits } = require('discord.js');

module.exports = {
  data: new SlashCommandBuilder()
    .setName("kayฤฑt-normal")
    .setDescription("Kullanฤฑcฤฑyฤฑ kaydeder. (normal)")
    .addUserOption(option =>
      option.setName("kullanฤฑcฤฑ")
      .setDescription("Kullanฤฑcฤฑyฤฑ etiketleyiniz.")
      .setRequired(true))
    .addStringOption(option =>
      option.setName('isim')
      .setDescription('KiลŸinin ismini yazฤฑnฤฑz.')
      .setRequired(true))
    .addNumberOption(option =>
      option.setName('yaลŸ')
      .setDescription("KiลŸinin yaลŸฤฑnฤฑ yazฤฑnฤฑz.")
      .setRequired(true)),
    run: async (client, interaction) => {
      if (!interaction.member.permissions.has(PermissionFlagBits.Administrator) && !interaction.member.roles.cache.has(db.get(interaction.guild.id + "kayityetkilisi"))) {
        return interaction.reply({ content: "Bu Komutu Kullanmak ฤฐรงin Yetkiniz Yok.", ephemeral: true });
      }
        const member = interaction.options.getMember('kullanฤฑcฤฑ');
        try {
        await member.roles.add(db.get(interaction.guild.id+"otorol"))
        await member.roles.remove(db.get(interaction.guild.id+"kayitsiz"))
        await member.setNickname(`${interaction.options.getString("isim")} | ${interaction.options.getNumber("yas")}`)
        console.log(interaction.guild)
        let yenikayitsayisi;
        if(db2.get(interaction.guild.id+interaction.user.id)) {
          yenikayitsayisi = db2.get(interaction.guild.id+interaction.user.id) + 1;
        } else {
          yenikayitsayisi = 1;
        }
        const exampleEmbed = new EmbedBuilder()
        .setColor(0x0099FF)
          .setAuthor({ name: 'Kayฤฑt Yapฤฑldฤฑ!', iconURL: interaction.guild.iconURL() || "https://cdn.discordapp.com/attachments/1158837680306655315/1163173769750253608/standard.gif?ex=653e9cfd&is=652c27fd&hm=9f86d65a146d7a1d4acc9181dd2b788c50894506e74df274e6297cd75c313162&" })
          .setDescription(`> **Kayฤฑt Bilgileri**
        **ใƒปKayฤฑt Edilen Kullanฤฑcฤฑ:** <@${member.id}>
        **ใƒปKayฤฑt Eden Kullanฤฑcฤฑ:** <@${interaction.user.id}>
        **ใƒปVerilen Roller:** <@&${db.get(interaction.guild.id+"otorol")}>
        **ใƒปYeni ฤฐsim:** \`${interaction.options.getString("isim")} | ${interaction.options.getNumber("yas")}\` 
        **ใƒปKayฤฑt Tรผrรผ:** \`Normal\` `)
          .setThumbnail(member.avatarURL() || "https://cdn.discordapp.com/attachments/1158837680306655315/1163173769750253608/standard.gif?ex=653e9cfd&is=652c27fd&hm=9f86d65a146d7a1d4acc9181dd2b788c50894506e74df274e6297cd75c313162&")
          .setFooter({ text: `ใƒป${interaction.user.username}, kayฤฑt sayฤฑsฤฑ: ${yenikayitsayisi}` });
        await db2.set(interaction.guild.id+interaction.user.id, yenikayitsayisi);
        await interaction.reply({ embeds: [exampleEmbed] })
      } catch (error) {
        interaction.reply({
          content: "Kullanฤฑcฤฑyฤฑ dรผzenlerken bir hata oluลŸtu. Muhtemelen eksik izinleriniz var.",
          ephemeral: true,
        });
        console.error("Error while processing the command:", error);
      }
    }
    
 };
earnest phoenix
#

It's PermissionFlagsBits, typo

bitter heart
#

okay im fix but

#
    at SequentialHandler.runRequest (C:\Users\Emir\Desktop\discord-bot-v14-bos-altyapi-discord-bot-v14\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.cjs:287:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SequentialHandler.queueRequest (C:\Users\Emir\Desktop\discord-bot-v14-bos-altyapi-discord-bot-v14\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.cjs:99:14)
    at async REST.request (C:\Users\Emir\Desktop\discord-bot-v14-bos-altyapi-discord-bot-v14\node_modules\@discordjs\rest\dist\lib\REST.cjs:52:22)
    at async ChatInputCommandInteraction.reply (C:\Users\Emir\Desktop\discord-bot-v14-bos-altyapi-discord-bot-v14\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:110:5) {
  rawError: { message: 'Unknown interaction', code: 10062 },
  code: 10062,
  status: 404,
  method: 'POST',
  url: 'https://discord.com/api/v10/interactions/1164252869051039805/aW50ZXJhY3Rpb246MTE2NDI1Mjg2OTA1MTAzOTgwNTpnVWJhVnpnZHZrVktqbFcwczVMS2tLdkhuaEh3aWh5djFINU14ZGNzbGUwbVc0dTM2R0ZXaUZDRFRma0FaZVA5MGVzTlpoMGg4ZUZ3WDk1QkJjQ0hvQmlFTEVYZ2dNRWplckVhYkxnQTJlUHdpcGJwdmtnWVNBQUE2UzJuSDBjQw/callback',
  requestBody: {
    files: [],
    json: {
      type: 4,
      data: {
        content: 'Kullanฤฑcฤฑyฤฑ dรผzenlerken bir hata oluลŸtu. Muhtemelen eksik izinleriniz var.',
        tts: false,
        nonce: undefined,
        embeds: undefined,
        components: undefined,
        username: undefined,
        avatar_url: undefined,
        allowed_mentions: undefined,
        flags: 64,
        message_reference: undefined,
        attachments: undefined,
        sticker_ids: undefined
      }
    }
  }
}```
earnest phoenix
#

That most likely means that you're responding to the interaction a bit too late, the response time frame is 3 seconds

bitter heart
#
const { SlashCommandBuilder } = require("@discordjs/builders");
const { Database } = require("nukleon");
const db = new Database("./database/kayitnormal.json")
const db2 = new Database("./database/sunucukayitlari.json");
const { PermissionFlagBits } = require('discord.js');

module.exports = {
  data: new SlashCommandBuilder()
    .setName("kayฤฑt-normal")
    .setDescription("Kullanฤฑcฤฑyฤฑ kaydeder. (normal)")
    .addUserOption(option =>
      option.setName("kullanฤฑcฤฑ")
      .setDescription("Kullanฤฑcฤฑyฤฑ etiketleyiniz.")
      .setRequired(true))
    .addStringOption(option =>
      option.setName('isim')
      .setDescription('KiลŸinin ismini yazฤฑnฤฑz.')
      .setRequired(true))
    .addNumberOption(option =>
      option.setName('yaลŸ')
      .setDescription("KiลŸinin yaลŸฤฑnฤฑ yazฤฑnฤฑz.")
      .setRequired(true)),
    run: async (client, interaction) => {
      if (!interaction.member.permissions.has(PermissionsBitField.Administrator) && !interaction.member.roles.cache.has(db.get(interaction.guild.id + "kayityetkilisi"))) {
        return interaction.reply({ content: "Bu Komutu Kullanmak ฤฐรงin Yetkiniz Yok.", ephemeral: true });
      }
        const member = interaction.options.getMember('kullanฤฑcฤฑ');
        try {
        await member.roles.add(db.get(interaction.guild.id+"otorol"))
        await member.roles.remove(db.get(interaction.guild.id+"kayitsiz"))
        await member.setNickname(`${interaction.options.getString("isim")} | ${interaction.options.getNumber("yas")}`)
        console.log(interaction.guild)
        let yenikayitsayisi;
        if(db2.get(interaction.guild.id+interaction.user.id)) {
          yenikayitsayisi = db2.get(interaction.guild.id+interaction.user.id) + 1;
        } else {
          yenikayitsayisi = 1;
        }
        const exampleEmbed = new EmbedBuilder()
        .setColor(0x0099FF)
          .setAuthor({ name: 'Kayฤฑt Yapฤฑldฤฑ!', iconURL: interaction.guild.iconURL() || "https://cdn.discordapp.com/attachments/1158837680306655315/1163173769750253608/standard.gif?ex=653e9cfd&is=652c27fd&hm=9f86d65a146d7a1d4acc9181dd2b788c50894506e74df274e6297cd75c313162&" })
          .setDescription(`> **Kayฤฑt Bilgileri**
        **ใƒปKayฤฑt Edilen Kullanฤฑcฤฑ:** <@${member.id}>
        **ใƒปKayฤฑt Eden Kullanฤฑcฤฑ:** <@${interaction.user.id}>
        **ใƒปVerilen Roller:** <@&${db.get(interaction.guild.id+"otorol")}>
        **ใƒปYeni ฤฐsim:** \`${interaction.options.getString("isim")} | ${interaction.options.getNumber("yas")}\` 
        **ใƒปKayฤฑt Tรผrรผ:** \`Normal\` `)
          .setThumbnail(member.avatarURL() || "https://cdn.discordapp.com/attachments/1158837680306655315/1163173769750253608/standard.gif?ex=653e9cfd&is=652c27fd&hm=9f86d65a146d7a1d4acc9181dd2b788c50894506e74df274e6297cd75c313162&")
          .setFooter({ text: `ใƒป${interaction.user.username}, kayฤฑt sayฤฑsฤฑ: ${yenikayitsayisi}` });
        await db2.set(interaction.guild.id+interaction.user.id, yenikayitsayisi);
        await interaction.reply({ embeds: [exampleEmbed] })
      } catch (error) {
        interaction.reply({
          content: "Kullanฤฑcฤฑyฤฑ dรผzenlerken bir hata oluลŸtu. Muhtemelen eksik izinleriniz var.",
          ephemeral: true,
        });
        console.error("Error while processing the command:", error);
      }
    }
    
 };
#

how do i fix it

earnest phoenix
#

If you don't want that to happen, defer the response by calling interaction.deferReply() at the top

bitter heart
#

can you write the corrected version?

earnest phoenix
#

We don't do that here, that's considered spoon-feeding which is discouraged

#

It's best to write it yourself and learn the how and why

bitter heart
tulip ledge
#

How do I make an invite link for a specific server? So like on my dashboard for the servers the user doesn't have the bot in you press add to server and it just goes to the invite page for that server, I've seen Mee6 do it

earnest phoenix
# bitter heart

That most likely means that you're trying to add/remove roles to/from a member that has a role higher than the bot's highest role

bitter heart
earnest phoenix
#

Or the role(s) it's trying to add/remove are the ones higher than the bot's highest role

bitter heart
#

I also need to fix this error: If there is no record, run the record command.

green kestrel
#

python devs be like: "why is pytesseract so slow and eat tons of ram"
pytesseract devs be like: "because it saves the file to disk, then spawns tesseract, grabs the output, turns it into a dict, and deletes the temp file"
meanwhile C++ devs be like:

#

really proud of that tiny memory size.... literally zero cache

radiant kraken
#

python is like the thiccest language ever

green kestrel
#

thicccccccc

radiant kraken
#

@green kestrel btw

#

can you teach me about C++20 coroutines

green kestrel
#

no but i know someone who can (the person that did most of the coro stuff in D++)

radiant kraken
#

i don't understand any online examples about it

green kestrel
#

on dpp server speak to miuna (windows defender) shes the expert

radiant kraken
#

did she wrote co_request?

green kestrel
#

im still getting my head round it, part of the downside of a project getting bigger is parts of it arent your own work any more ๐Ÿ˜„

#

yes

radiant kraken
#

i mean i haven't used C++ since November 2021 lol

#

still takes time for me to rewrap my head around things

tulip ledge
#

that redirects to a url

#

I need it so a user gets to invite it directly for a specific server, so they don't have to select the server anymore

bitter heart
#

I don't quite understand how, can you explain it to me step by step?

tulip ledge
#

x.x

#

When inviting a bot you need to select a server

#

I know there is a way to have an invite link for a specific server of which the user is an owner

#

you know what I'll figure it out

lyric mountain
#

add the scope for the oauth

bitter heart
#

aga biri bunu bana tรผrkรงe รงevirsin WQEHQWOI

#

ingilizce bilgim kalmadฤฑ

#

รงevri bile adam akฤฑllฤฑ sonuรง vermiyor

tulip ledge
#

the oauth token from the user?

lyric mountain
#

not on the invite

tulip ledge
#

wait I don't get it

lyric mountain
#

if you're making a dashboard I suppose u have an oauth url with identify scope, correct?

#

like, when the user logins on the site

tulip ledge
#

yes

#

and guilds aswell

lyric mountain
#

add guild.join to it too

tulip ledge
#

ok

lyric mountain
#

this is all you need

tulip ledge
lyric mountain
#

?

#

guilds scope isn't guild.join

#

the former is merely informative

#

the latter allows adding the user to servers without asking

#

I mean, u technically ask once, but dont need approval once authorized

tulip ledge
#

wait I still don't get it

#

I'm getting the oauth token from the user

#

right

#

using that I can get the data of the user and his guilds

lyric mountain
#

that's guilds scope specifically

tulip ledge
#

yes

#

how do I use the guild.join scope then?

lyric mountain
tulip ledge
#

ah

#

ty

#

wait this makes the user join a guild?

deft wolf
#

You to need to make request to specific url with access token provided

lyric mountain
#

it gives you approval for adding that user to any server you can invite people to

tulip ledge
#

no no, I want my bot to join their server

lyric mountain
#

there's no scope for that

tulip ledge
#

mmmhhh, but how does mee6 do it then?

#

I click this setup button

#

and I don't have to select the server from the dropdown

#

it gives me a pop up to add mee6 to that server

lyric mountain
#

does it redirect u to an oauth screen?

tulip ledge
#

Opens this window but it's not loading rn

green kestrel
#

the docs are a better reference than that file

earnest phoenix
tulip ledge
#

I can just drop guild_id in there?

#

๐Ÿ’€

lyric mountain
tulip ledge
#

alright ty very much

radiant kraken
earnest phoenix
#

cppreference is very advanced, it's not meant for average users

green kestrel
#

your request is placed into the queue and the callback is called once the request completes, and the response is marshalled back to a separate thread

#

in the case of a callback you then receive that call in a callback, but with coro the promise is fulfilled by the callback and the result returned

#

in short requests to the same URL and path are guaranteed to be executed in order you request them

earnest phoenix
#

Btw Brain which Top.gg SDK do you maintain?

radiant kraken
#

he maintains the C++ one obviously

earnest phoenix
#

They're not a collaborator of it, nor have any commits on it, so eh...

green kestrel
#

someone else did it

quartz kindle
#

does it suck? xD

radiant kraken
#

buffer worked on it but the code is currently broken and messy

#

and missing on a lot of features too

slim void
#

Whats the best way to loop a ban in js?

lament rock
#

wdym "loop a ban"

slim void
#

I figured it out

#

Trying to make a bot where anyone who's banned in X server is added to a database so when I execute X command it automatically bans

lament rock
#

Oh so you mean global bans

slim void
#

Ye

#

I wanna make it public but like I'm not that good at coding

deft wolf
#

I have had very bad experiences with global bans

#

For some reason, there was always abuse and people who disagreed with the developer of a given bot were global banned

lament rock
#

Way more vectors for bad actors

#

if server mods/admins could agree to bans on a per case basis and be provided with info of why a user was banned, that'd be better than just auto syncing bans

wheat mesa
#

Global bans are troubling. They make sense for servers that have staff/owners in common, or for servers with โ€œpartnerโ€ servers, but fully global bans are definitely just asking for abuse

river wing
#

hi idk if i shld ask here but how do i get my bot profile picture onto my top.gg page?

deft wolf
#

Click "refresh data" button

#

Then "edit" and "save"

#

Refresh data button fetches the bot's avatar directly from the discord API

river wing
#

oo okayy thankss

deft wolf
#

Editing and saving refreshes the website cache from what I understand

crystal wigeon
#

Blame the bug

#

Lmaooo the most developer thing you can do kekcry XD

slim void
#

Oof

crystal wigeon
#

Wife: divorces
Developers: it was a bug

slim void
#

๐Ÿคฃ

lyric mountain
bitter heart
#

I have a question: I'm using NodeJS, how can I print a text to the console when a person votes?

lyric mountain
#

using topgg webhook

bitter heart
#

thanks

grim aspen
slim void
#

Pretty much

magic cliff
#

Hello im new here

deft wolf
#

Hello, I'm not

quartz kindle
#

Hello, im old here

green kestrel
#

i'm making a discord bot that scans images for abusive content. im composing a whitelist of urls that it will never ever scan. obviously needs to be pretty tightly controlled. heres what i got so far.

inline constexpr const char* whitelist[] = {
    "https://*.tenor.com/*",
    " bots own url ",
    nullptr,
};

anyone can offer any other wildcards to add (serious suggestions only pls) ping me with it

bitter heart
#

How do I send a DM message with discord v14 nodejs?

#

Can you write a sample code?

deft wolf
#

Can't you just google it if you want sample code?

bitter heart
#

I tried them all, it doesn't work, it gives an error

deft wolf
#

What if this channel is simply not in the cache?

bitter heart
#

I'm trying to send a DM message, how can I do it?

#

only google has this

lofty ginkgo
#

hello

#

When will my bot be verified?

deft wolf
#

Hello, we don't know

lofty ginkgo
#

ok

deft wolf
#

It should take them a few days

lofty ginkgo
#

noooooo

bitter heart
lofty ginkgo
lofty ginkgo
bitter heart
bitter heart
lofty ginkgo
bitter heart
#

Turkey

lofty ginkgo
bitter heart
#

qouweghqwoฤฑ

#

biz neden

#

mal gibi

#

ingilizce konuลŸuyoz

#

yarฤฑm saatir

lofty ginkgo
#

bende bilmiyorum herkes ingilizce konuลŸuyor

bitter heart
#

insan bi yazar

#

tรผrkรงe ลŸeyler

#

๐Ÿ˜„

lyric mountain
lofty ginkgo
lofty ginkgo
#

๐Ÿ™‚

bitter heart
#

aga valla senin isminde tรผrkรงe bir ลŸey yok diye

#

dikkat etmedim ๐Ÿ˜„

lofty ginkgo
#

๐Ÿ™‚

lofty ginkgo
bitter heart
#

aga nodejs ilemi kodluyorsun sen botlarฤฑ

#

yoksa python flnmฤฑ

lofty ginkgo
#

EฤŸitimini aldฤฑm

bitter heart
#

zor olmuyormu

lofty ginkgo
#

evet nodejs dekinin nerdeyse 3 katฤฑ kod yazฤฑyorsun ama alฤฑลŸtฤฑm

bitter heart
#

nodejs direk yaz

#

niye uraลŸฤฑyorsunki

#

o kadar

#

๐Ÿ˜„

lofty ginkgo
#

sฤฑkฤฑlฤฑyorum yapฤฑcak birลŸey yok okula gidiyim desem gidemem รผniversite sฤฑnavฤฑna hazฤฑrlanฤฑyorum.

bitter heart
#

nodejs direk kodla

lofty ginkgo
#

nodejs de yazarsam รงok kolay oluyor

bitter heart
#

zaten

#

bรผtรผn herkes nodejs kodluyor

#

direk nodejs kodla bence

#

tรผrkiye geleni bir bot รงฤฑkart

#

hatta dรผnya geneli

lofty ginkgo
#

ok

bitter heart
#

sonra botunu onaylattฤฑr

#

zaten bรผtรผn dillere uyarlamaya denerken

#

sฤฑkฤฑntฤฑn geรงer ๐Ÿ˜„

lofty ginkgo
#

bekle c++ la yazฤฑlmฤฑลŸ bir bot รถrneฤŸim var onun baลŸvurusunu yaptฤฑrdฤฑm

bitter heart
#

botun

lofty ginkgo
#

dmden davet atฤฑyฤฑm mฤฑ?,

bitter heart
#

yardฤฑm komutu varmฤฑ

#

olur

lofty ginkgo
#

var

#

bekle

fierce sequoia
#

hi

deft wolf
#

Just to be sure, because I read the documentation: if I fetch channels using /guilds/{guild.id}/channels, is this ratelimit assigned only to a given server and is not global?

#

I've been working on a primitive dashboard for some time and I wanted to add the option to select a channel via dropdown and I'm wondering if fetching channels when opening the page in this way is a good idea

#

Because if they do not share a ratelimit, there is probably no problem with it because then these channels will go to the cache and I will have access to them

rustic nova
#

you have a global one and a endpoint one, so yes and no

#

the global one is higher than the endpoint /channels one

#

or /guilds

shut socket
#

hi

magic cliff
#

Can anyone help to make a bot using Python?

deft wolf
#

I doubt anyone would want to "help" you like that (of course, it depends on what you mean by "help")

bitter heart
#

How can we update the webhook url on top.gg via Nodejs? Is there a specific API or something?

craggy pine
#

Only help we can provide is references on how to learn python. Should always start with the basics first, then move on to something larger like a bot.

lyric mountain
bitter heart
# lyric mountain u cant update the url dynamically

Well, let me ask you something. Now, we cannot open ports across Turkey. That's why we get support from companies like ngrok, but for example, when you close and open ngrok, that link is automatically renewed. For example, if mydiscordbot is my link, when I close and open it, it can happen like this: myawaysomediscordbot. I wanted to change the incoming link automatically to prevent this. Is there another method?

lyric mountain
#

sadly that means you cant use webhooks then

#

not only topgg's, any webhook

#

as those rely on fixed urls

real phoenix
#

I'm making a button that has an embed. The button's code is below. Its wrapped in a class and appears correctly. However when I click the button, it returns an error,

@discord.ui.button(label="Commands", style=discord.ButtonStyle.green)
  async def commands(self, button: discord.ui.Button, interaction: discord.Interaction):
    await interaction.response.send_message("Button Pressed!")

Error:

await interaction.response.send_message("Button Pressed!")
AttributeError: 'Button' object has no attribute 'send_message'
craggy pine
#

Print out "Button" and see what attributes it has

real phoenix
craggy pine
#

so button is clearly wrong

real phoenix
#

Button is not present in the code

craggy pine
#

๐Ÿคทโ€โ™€๏ธ

real phoenix
#

Could it be because there are multiple of them?

craggy pine
#

A lot of us including me use Discord.js so unfortunately I can not help really regarding Python

real phoenix
#

damn

#

thanks anyways

lyric mountain
#

actually

#

ur not showing the whole context

#

something is calling button.send_message()

#

but your code says otherwise

#

did you save the file?

earnest phoenix
#

do you know how i can use python requests to get bot avatar and name?

civic scroll
#

i have this rotation logic for my 2d matrix

  # class Matrix2D(list[list])
  def rotate_90(self, cw = True):
    w = len(self)
    h = len(self[0])
    w_range = range(w)
    return Matrix2D(
      [self[y][h - 1 - x]  for y in w_range] if cw
      else [self[w - 1 - y][x] for y in w_range]
      for x in range(h)
    )

in running it feels a bit slow on common-sized images (i used a 920 x 560 image)
is there any way i can optimise this to speed things up?
[note: i must only use default python list]

earnest phoenix
civic scroll
real rose
#

numpy pandas ๐Ÿค“ โ˜๏ธ

#

numpy vectorise those loops cuh

sage bobcat
#

One message removed from a suspended account.

real rose
sage bobcat
#

One message removed from a suspended account.

sharp geyser
#

np undefined

civic scroll
#

I HAVE IT ALL THE TIME AND I DIDN'T KNOW

real rose
#

that coloring is nice af actually

earnest phoenix
#

Though the performance difference is the same as in the screenshot

quartz kindle
#

python syntax

#

๐Ÿคฎ

lyric mountain
#

me when npy.cumsum

civic scroll
#

i found another solution that involves tiling which is faster, but having some bugs atm

earnest phoenix
#

You're welcome love

earnest phoenix
lofty ginkgo
#

@bitter granite When will my bot be verified?

rustic nova
#

-upto

gilded plankBOT
#

topgg When will my bot be reviewed?

Currently our average bot reviewal time is a few days or more.

Because of this โ€” and because some bots take longer to review than others due to their features โ€” we can't guarantee your bot will be reviewed as quickly as someone else's in the past and we also can't guarantee your bot will be reviewed within that timeframe. There is no exact time for how long bot approval can take. There is no way to check your bot's position in our reviewal queue, but remember you're not first and you're not last!

You may edit your bot's page as much as you like both before and after it's reviewed and this will have no impact on its place in queue.

You can read more about our bot reviewal process in this support article: How the Bot Reviewal Process Works.

topgg_ico_bulb In the meantime, please make sure your bot follows all of our Bot Guidelines for a quick and smooth approval!

quartz kindle
#

and fights with buddha

lofty ginkgo
#

Noooooooooo

quartz kindle
#

at WWE

#

featuring john cena, big show and the undertaker

earnest phoenix
#

Jesus ballin'

quartz kindle
#

special participation from rey mysterio

sharp geyser
#

What would be the easiest way to send sms messages or even an email of some sort?

lyric mountain
#

for email, use a headless client

#

for sms you'll have some cost issues depending on how many you want to send, and there's the coverage problem

sharp geyser
lyric mountain
#

hmm well, I currently use for my bot an external client

#

I simply call it through command line

#

Mutt

#

it also has an "interface" (it's console-based" if u want to use it normally too

#

a little annoying to setup, but works wonders

bitter granite
sharp geyser
#

so I wanted to use sms/emails to alert me

lyric mountain
#

u can use mutt as a client by calling the cli commands

#

there are probably libraries for that tho

radiant kraken
sage bobcat
#

One message removed from a suspended account.

radiant kraken
#

its okay iaraHug

sage bobcat
bitter granite
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

radiant kraken
#

what counts as too much tho

bitter granite
bitter granite
sage bobcat
#

One message removed from a suspended account.

radiant kraken
#

no need to be mad over pings

bitter granite
#

Some need to be said like that to understand

radiant kraken
#

i mean it's probably something you have to endure since you're hoisted

bitter granite
#

||Also finally I am lose the hoisted next mo||

radiant kraken
#

are you sure

bitter granite
radiant kraken
#

how can you tell

bitter granite
bitter granite
sharp geyser
bitter granite
#

Atleast 155000 second

sharp geyser
#

Aww man

bitter granite
#

310592

#

Damn so hard to do mental math

#

Trying to count 3 days 14 hour 15 minute 92 second (so pi respond time)