#development

1 messages ยท Page 83 of 1

sharp geyser
#

especially if you plan on looping through that array and doing anything with those webhooks

earnest phoenix
#

๐Ÿ

hasty mulch
#

It's empty because I don't want to reveal the webhook I'm using, which would open the door to it getting abused

sharp geyser
#

Okay

#

Question 2

#

Why are you saving it as an array of strings

#

Are there more than just one webhook url?

#

Cause it seems like you are just hardcoding only one

hasty mulch
#

It's not meant to be used in a bot

#

It's meant to be used with Google

sharp geyser
#

That's besides the point

#

Just seems inefficient to store a single webhook url to an array

#

just keep it as a normal string

hasty mulch
#

My friend sent it to me

sharp geyser
#

makes sense

wheat mesa
#

I don't even know what the question is at this point

#

the original question was answered so idk

sharp geyser
#

I was just confused on why the code is the way it is

wheat mesa
#

man the spaghetti here

sharp geyser
wheat mesa
#

empty arrays

sharp geyser
#

so that is redudant

#

lovely

radiant kraken
#

@wheat mesa should i rewrite my Rust project in C

#

i was originally planning to make a C binding, but then i realised why not make the core in C

#

or should i not make a C binding, and leave the project as is (the core in Rust, with bindings in JavaScript and Python)

knotty quartz
#

How can I make a command cooldown?

#

So only one user has to wait xx:xx time before using the command again.

craggy pine
#

When a user uses a command you could stick their name and command in an array and empty the array every x seconds. If their name is in the array throw a cooldown error message.

craggy pine
knotty quartz
craggy pine
#

mk

knotty quartz
#
//top of script
const talkedRecently = new Set();

//execution details below.

  // Your command here.

        talkedRecently.add(interaction.user.id);
        setTimeout(() => {
          talkedRecently.delete(interaction.user.id);
        }, 60000);
    }

craggy pine
#

I never worked with Set() before so I wouldn't exactly know how it works. But the bottom part is similar to what I did in regards to my cooldown

deft wolf
#

You still need to check if the user is in this collection

#

Because you have add and remove

knotty quartz
craggy pine
#
    //cooldown check

    let coolDownArray = []
    let cooldown

    command.config.cooldown
    ? cooldown = command.config.cooldown
    : cooldown = 3000

    if (coolDownArray.includes(`${command.name} - ${message.guild.id}`)) {
      const reply = client.extends.errorEmbed(`${message.author}, \`${client.capitalizeFirstLetter(command.name)}\` was ran too much in a short period of time!\nI need \`${moment.duration(cooldown).asSeconds()}\` seconds inbetween uses!`)
        .setFooter(`${message.author.tag}`, message.author.avatarURL())
        let msg = await message.channel.send({
          embeds: [reply]
        })
        .catch(e => console.log(e))
        setTimeout(() => {if(message.channel.messages.cache.find(m => m.id === msg.id)) msg.delete()}, 5000)
      return
    }

    coolDownArray.push(`${command.name} - ${message.guild.id}`);

    setTimeout(() => {
      coolDownArray.splice(coolDownArray.indexOf(`${command.name} - ${message.guild.id}`), 1)
    }, cooldown);
#

Is what I did, but your using interactions so my code wouldn't work for you.

deft wolf
#

No, just

if(talkedRecently.has(interaction.user.id)) {
//Code when user has active cooldown
} else {
//Command
}
craggy pine
#

Also, are cooldowns really necessary for slash commands? Like I get it for prefix'd ones but running a slash command can normally take longer to even type out than a single slash

knotty quartz
#

I need a 24hr cooldown

craggy pine
#

Use a database for that

deft wolf
knotty quartz
#

I am linking it to a database.

craggy pine
#

what I mean is.

#

put the time they ran the command into the database

#

and just check it

#
if(balance[0] && balance[0].daily_time < Date.now() && balance[0].currency <= 2147483647) {}

What I used for mariadb

#

and I update the time

await client.extends.database(`UPDATE user SET currency = ?, daily_time = ? WHERE userid = ${message.author.id}`, [newBal, new Date(Date.now() + 1 * 24*60*60*1000).getTime()], false)
#

if the 24hrs is up

knotty quartz
#

Oh ok

craggy pine
#

Not saying your method won't work.

#

But I feel like this might be the better solution

knotty quartz
#

I was gonna tie it into the database anyways, so it send the message with a message on how long is left

craggy pine
#

https://scs.twilightgamez.net/fUw64.png
So like Date.now() is in milis so if their time is not in the database just run a simple database.time < Date.now() and realistically that should always check if it's been 24 hrs.

knotty quartz
#

Ty

craggy pine
#

new Date(Date.now() + 1 * 24*60*60*1000).getTime() this parts takes the current time and adds an additional 24 hours to it

knotty quartz
#

I'm having an issue. Whenever I restart the bot you have to use a command that adds/takes money from your balance. To show up on the leaderboard.

How could I store the leaderboard, without it glitching like this?

const {Op} = require('sequelize');
const {SlashCommandBuilder, Client, Collection, Events, codeBlock, GatewayIntentBits} = require('discord.js');
const {Users, CurrencyShop} = require('../dbObjects.js');


module.exports = {
    data: new SlashCommandBuilder()
        .setName('leaderboard')
        .setDescription('Test'),
    async execute(interaction, client) {
        return interaction.reply(
                client.currency.sort((a, b) => b.balance - a.balance)
                    .filter(user => client.users.cache.has(user.user_id))
                    .first(10)
                    .map((user, position) => `(${position + 1}) ${(client.users.cache.get(user.user_id).tag)}: ${user.balance}๐Ÿ’ฐ`)
                    .join('\n'),
            )
    },
};```
maiden gazelle
#
const Discord = require("discord.js");

exports.run = async (bot, message) => {
    const msg = bot.snipes.get(message.channel.id)
    let embed = new Discord.EmbedBuilder()
    .setAuthor(msg.author, msg.member.user.displayAvatarURL())
    .setDescription(msg.content)
    .setFooter('Get Sniped lol')
    .setTimestamp();
        message.channel.send({ embeds: [embed] });
    }

exports.help = {
    name: 'snipe', 
    aliases: []
    }
``` does somebody know why the error is saying that author is not defined im new with prefix commands so i dont really know
maiden gazelle
#

this is the entire error

#

i am making a snipe command

solemn latch
#

author isnt undefined, the thing you're using author on is undefined.

which is msg in this case

#

the 'get' isnt finding a message by that channel id

maiden gazelle
#

how can i fix it

solemn latch
#

assuming bot.snipes is a collection/map
and you're properly setting the message on delete

Then the error is that no deleted messages occurred since the bot started.
Which you'll want to have a check for.
ie, if(msg === undefined) return message.send('nothing to snipe!');

maiden gazelle
#

okay

fallen holly
#

how do i change the person i mentioned nickname

#

like if i mentioned Mac i want to change his name

slender wagon
#

so i decompiled an android app, got the dll and everything inside it looks something like this

public static bool pIsMember
    {
        [Token(Token = "0x60035A0")]
        [Address(RVA = "0xCCC174", Offset = "0xCCC174", VA = "0xCCC174")]
        get
        {
            return default(bool);
        }
    }

anyone has a clue what's happening or how could i go through this

bright thorn
#

i feel some time

#
    /**
  * @param {{ client: import("../../../Structures/Client"), interaction: import("discord.js").CommandInteraction, player: import("poru").Player }}
  */
~```
#

not working

#

is we need any extention for that?

lyric mountain
#

Also, what are u even trying to do?

slender wagon
lyric mountain
#

But Linux doesn't use dlls

slender wagon
#

it's a game

#

i got the apk

lyric mountain
#

Yes

slender wagon
#

used il2cpp

#

got the .dll file

#

but it looks encoded or something

lyric mountain
#

I mean, u can't decompile anything in a way that allows u to see the og source code

earnest phoenix
#

Hey I have a question I need a bot that would it deletes invite-link when the discord invite-link are at the maximum because there is a maximum that is very low recently filtered by date of creation and then the second factor is the number of use of this invite

lyric mountain
#

What

slender wagon
earnest phoenix
#

to revoke invite link

lyric mountain
#

Yes u can

earnest phoenix
#

do you think it's possible to make a discord bot?

slender wagon
earnest phoenix
#

Do you think you could?

lyric mountain
#

Already said yes

lyric mountain
slender wagon
#

๐Ÿค”

earnest phoenix
#

But I mean could you do it?

lyric mountain
#

A lot of optimization happens, much of the code gets inlined

lyric mountain
last tapir
#

what's a better way to summarize this code or make it shorter

{KEY_SKILLS.map((skill, idx) => {
    return (
        <li key={idx}>
            {htmr(skill, { transform: { a: (props) => <UnderlineLink href={props.href ?? ''}>{props.children}</UnderlineLink> } })}
        </li>
    );
})}
earnest phoenix
#

But I mean could you do it for me?

lyric mountain
#

No, i could but I won't

earnest phoenix
#

even if it's against something?

slender wagon
#

hahahahhaha

sudden geyser
#

unless it never changes

lyric mountain
earnest phoenix
lyric mountain
#

We can put you on the way, but we'll not give copy-ready code

#

Capitalism has nothing to do with this

earnest phoenix
#

It is people don't want to waste their time doing free things

#

everything has a prize

lyric mountain
#

Yes, but this isn't the correct place to hire programmers

earnest phoenix
#

Ah, sorry then I just couldn't find a place do you know one by any chance

#

My bad

lyric mountain
#

And everyone who ever offers money like that is seriously underestimating the price of code

shell echoBOT
#

You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.

lyric mountain
#

Be aware, coding is expensive, even for simple things

earnest phoenix
#

Yeah but I do not have time to learn :/

lyric mountain
#

You definitely have

clear granite
#

bottom.nogg

lyric mountain
#

2 hours per day won't kill anyone

sudden geyser
#

why are you trying to figure out what decompiled code does anyway

earnest phoenix
#

no am really too busy with exams and managing discord-servers adding coding will kill me

earnest phoenix
#

it's like breaking bad you know

#

walter white

#

isn't walter white without saul godman

#

you see what I mean

lyric mountain
earnest phoenix
#

every business man need a lawyer

#

it's the same for discord every ... need a dev

lyric mountain
#

Also, if you need to manage a server so actively you'd already have made a management team

earnest phoenix
#

Nah am new to this I just came last weeks and made a new server but I didn't knew that discord changed so many things

clear granite
#

what even is coding lol

lyric mountain
#

You're not busy, u just want the easy way

#

Take 1 hour off everyday to study coding, it won't kill anyone

earnest phoenix
#

I could but it would take me much longer than 1 hours to do a bot like that

lyric mountain
#

You have 16 hours awake every day

#

Yes, you won't be making a bot so early

#

You first need to learn how to program

#

Also I doubt you know how much maintenance a bot takes

#

Even if you bought a bot, they usually give the sourcecode as-is, if something ever breaks you'd need to hire someone to fix it for you

clear granite
#

program some bitches

earnest phoenix
#

so how i do it asap

lyric mountain
#

Well, you hire someone to do it

#

Which will hurt your wallet a lot

#

Tho I doubt it's THAT important, u probably just allowed everyone to create invites and people started spamming it

earnest phoenix
#

Nah it's something that create the maximum of invites

#

in 1 days

#

so it's unmanagable

#

without a bot

lyric mountain
#

Can't u just remove that "something"?

earnest phoenix
#

A server

#

like a type of server

#

Yeah I could

ancient wedge
#

hi, why is StringSelectMenuBuilder not available DJs 14.6.0

lyric mountain
#

It says it's not a constructor, not that it isn't available

#

Check docs to see how to properly use it

ancient wedge
#

i copy pasted it from docs lol

earnest phoenix
lyric mountain
earnest phoenix
lyric mountain
#

Try typing without new and () to see if something pops

earnest phoenix
#

it is a metaphor

#

that is comparable in our life that is why it is a series literally me

lyric mountain
#

Like ...Builder.<ctrl + space>

#

Perhaps it's a static class

lyric mountain
#

Already told u, either hire someone, learn it yourself or remove the issue entirely

earnest phoenix
#

no I'm not lazy I just want to delegate and not do everything myself except that there is a beginning for this and here I am

lyric mountain
#

Make sure ur seeing the correct version of the docs

earnest phoenix
#

Rome was not built in a day

lyric mountain
#

Isn't v14 the newest version?

earnest phoenix
#

it was build in 2 day

lyric mountain
#

No, it was built over centuries

neon leaf
lyric mountain
#

You're the one wanting it built in 1 day

earnest phoenix
#

Yes, but the more you advance the more money you make

#

exponential curve

#

so isn't it worth

#

to all in

#

like a business who makes loans

lyric mountain
#

Yes, but u don't get to "advanced" without starting at "simple"

#

Programming is a skill, i can't try to climb the everest in ur first day

#

I mean, u can, but you'll die

earnest phoenix
#

that's why am not trying to program

#

I already code but it's java

#

you think it is similar?

lyric mountain
#

Java eh? Mind to explain to me what inheritance is?

earnest phoenix
#

if you do a business in marketing

#

and you start a new one

#

about informatic

#

the one that you built in marketing will be useful

lyric mountain
#

Yes yes, but what is inheritance?

earnest phoenix
#

Similar code pathern

lyric mountain
#

U said ur in v13, isn't v14 released?

lyric mountain
earnest phoenix
#

Not yet sadly maybe soon

#

good music choice

#

tho

lyric mountain
#

Inheritance is when one or multiple classes inherit properties and method from a parent class, like animal and dog

earnest phoenix
#

HAHAHA

earnest phoenix
lyric mountain
#

Which is one of the most basic things u learn when starting java

earnest phoenix
#

I see thanks

#

???

#

Ah fuck

lyric mountain
#

If u knew how to code in java you'd definitely know it

earnest phoenix
#

am learning it in college too

#

and it's french

#

so maybe they used another word

lyric mountain
#

French, russian, vulkan, doesn't matter

earnest phoenix
#

that is not similar as inheritance

lyric mountain
#

Concepts are the same worldwide

neon leaf
earnest phoenix
#

I see

lyric mountain
#

Despite what people say, it's still a major backbone of corporate world

sudden geyser
earnest phoenix
#

Bro I swear am not crazy, we agree that when you manage discord servers it's imperative to have a developer it's like being a businessman without a lawyer right??

sudden geyser
#

I wouldn't compare JS/TS/Rust with Java since they're trying to solve different problems

lyric mountain
#

If you got money for it, simply hire a programmer

earnest phoenix
#

but as jesse said

#

you don't need a criminal lawyer

#

you need A CRIMINAL LAWYER

#

so how do I find

#

my criminal dev

lyric mountain
neon leaf
earnest phoenix
#

on fiverr there's only brokie bro

#
  • they have big ego
#

most of them

sudden geyser
#

Java's main use is its wide use, as you're bound to run into large systems developed around it.

neon leaf
#

saul was also broke and had a big ego

earnest phoenix
#

Saul is a true sigma

lyric mountain
earnest phoenix
#

he wouldn't have started in fiver

sudden geyser
#

I wouldn't say that Java itself is a "good" language (in quotes since it's hard to explain), but it's one you can expect to do a lot with.

lyric mountain
#

Usually the client is much worse than the contractee

neon leaf
earnest phoenix
#

DAMNNN

#

GIVE ME HIS FIVER

lyric mountain
sudden geyser
#

If you had to pick between Java and Kotlin, however, choose Java, as Java is the base of Kotlin, and Kotlin is really just trying to be a more tolerable Java.

neon leaf
#

I think his gig doesnt exist anymore

earnest phoenix
#

๐Ÿ˜

#

Yeah

#

I see

#

but you see the difference

#

between

#

a criminal

#

lawyer and a CRMINAL LAWYER

sudden geyser
#

It doesn't really change the paradigm

neon leaf
earnest phoenix
#

Ah the reference

ancient nova
#

๐Ÿ—ฟ

earnest phoenix
#

can i send you a link so you'll have more culture after this?

#

a vid link

lyric mountain
neon leaf
#

I did watch the show

ancient nova
#

do u guys think adding custom commands worth doing

lyric mountain
#

If u want something solved either solve it yourself or hire someone who does

lyric mountain
sudden geyser
earnest phoenix
sudden geyser
#

crime boss

ancient nova
#

people can add their own commands to my bot, exclusive to their servers only

sudden geyser
#

yes but what does it do

earnest phoenix
#

The hell are these conversations

sudden geyser
#

how does it work

earnest phoenix
sudden geyser
#

random guy whose been going off about random stuff for an hour

ancient nova
#

people can write their own js to act as a custom command

lyric mountain
ancient nova
#

or will create a custom language

earnest phoenix
ancient nova
#

that will translate to js

sudden geyser
#

so a dsl

lyric mountain
#

And has jesse complex

ancient nova
#

hire me

#

i need moneeee

sudden geyser
#

If you think users can benefit from it, go ahead, but I don't see an advantage

#

I'd just create a command that mimic certain aspects of custom commands, like a snippets command

lyric mountain
ancient nova
#

well a friend just asked me to add a command that is exclusive to his server so i thought why not make it a thing

lyric mountain
#

And there's always the chance of ur custom lang cracking your bot open

earnest phoenix
#

Small world, you don't have that many opportunities in life

earnest phoenix
neon leaf
ancient nova
#

might be worth a shot

lyric mountain
#

Make sure it's not a public shot

ancient nova
#

so for example a person will do

lyric mountain
#

Also prepare to halt your bot development for at least 1 month

earnest phoenix
lyric mountain
#

Lmao

#

Tackled at making a custom lang before, it was hell

earnest phoenix
#

guys if you forget one time

#

remind yourself

sudden geyser
#

you're not 60

earnest phoenix
#

that you don't need a criminal lawyer you need a criminal lawyer

#

okay sorry last sentence am go now

ancient nova
#

CreateEmbedTitle "Title Here"

and something along these lines will parse it

if (CustomScript.includes("CreateEmbedTitle"))
... etc etc 
lyric mountain
#

You'll go the yandev route?

ancient nova
#

and repeat that for every thing i want to add

ancient nova
earnest phoenix
#

At least make a proper parser for it instead of going that route

ancient nova
#

with regex ๐Ÿ—ฟ

#

i can do thst

lyric mountain
ancient nova
#

alright alright i get it

#

i can make a custom regex parser

lyric mountain
#

A custom language parser

sudden geyser
#

oh no

lyric mountain
#

Not regex parser

#

All parsers use regex in some way

ancient nova
#

i will make it divide the command into 2 points.
(Command, Value)

sudden geyser
#

use a context-free grammar or something

#

just make it simple

ancient nova
lyric mountain
#

Tbh the "simple" way is already complicated lul

ancient nova
#

not rly tbh

lyric mountain
ancient nova
#

just check the text for command name and get whatever is after as the value

lyric mountain
#

Yes, but how far do u think u can go with predefined blocks?

sudden geyser
#

If you learn something like BNF or EBNF you can build a lot of simple parsers

lyric mountain
#

Anytime someone wants something not possible you'll need to add new blocks

#

Which snowball quickly

lyric mountain
earnest phoenix
fallen holly
#

how do i change the person i mentioned nickname
like if i mentioned Mac i want to change his name

earnest phoenix
fallen holly
#

Yep

earnest phoenix
ancient nova
sharp geyser
#

pegjs

earnest phoenix
sharp geyser
#

interesting name choice

sudden geyser
#

peg it

earnest phoenix
#

Yeah troll

ancient nova
#

guys

#

u have a URL right

sharp geyser
#

what

wheat mesa
#

enjoy learning how to parse languages ๐Ÿ˜‰

sharp geyser
#

waffle arent you supposed to be in school rn

ancient nova
wheat mesa
#

if you want to go down that route, make sure it's a simple syntax for your first lang please

#

no

ancient nova
#

what would "this" be called

wheat mesa
#

I have off today

#

tomorrow is when I go back

sharp geyser
#

they aren't making a lang I dont think

ancient nova
#

does it have a specific name

wheat mesa
#

not many other reasons to be using a parser combinator

earnest phoenix
ancient nova
#

oh yh

#

ty

sharp geyser
wheat mesa
#

wha

#

for what tho

sharp geyser
#

parsing regex obviously

wheat mesa
#

that can't be right

sharp geyser
#

thats what they said

earnest phoenix
#

They're trying to parse a language using regex only

wheat mesa
#

I don't think that's what they said

#

yeah

earnest phoenix
#

Bad idea

wheat mesa
#

that's what I was thinking

ancient nova
#

basically my friend asked me to add a custom command for him to my bot so i thought might as well let people add custom commands

wheat mesa
#

you're never going to be able to write a full language parser with ONLY regex, feasibly at least

viral badge
#

gotta try every method ๐Ÿ˜

sharp geyser
#

but thats all they know how to use

wheat mesa
#

parser combinators make life easier but usually only if you have experience with the raw parsing algorithms first

#

personally I prefer using the raw algorithms anyways

#

recursive descent parsers are fun

earnest phoenix
#

Parsing is just fun

#

Until it makes you rip your hair out for missing a single statement that broke the entire parser

wheat mesa
#

yeah lmao

#

the worst part is when you have a parser that compiles and runs, but gives the wrong result somewhere along the way

#

very difficult to debug sometimes because it's all intertwined together

earnest phoenix
#

Yeah

fallen holly
earnest phoenix
# fallen holly discord.js

The <Message>.mentions property contains all the mentions in the message, if you want to change the nickname of the member you just mentioned, you can access the <Message>.mentions.members property which is a collection of all the members mentioned, and get the member you want, and use the <GuildMember>.setNickname() method to change their nickname

fallen holly
#

k

fallen holly
#

bruh remove the <>

earnest phoenix
sudden geyser
#

show us the 28 other lines

compact pier
#

mhmm a france ip

earnest phoenix
#

@real rose

real rose
#

cringe roblox talk

earnest phoenix
#

much yes

surreal sage
#
for (x) {
    console.log("something here, e.g fetching an api endpoint");
    continue;
    console.log("some result");
}```
Would "some result" still log whilst a new 'iteration' started?
earnest phoenix
wheat mesa
#

Continue goes to the next iteration of the loop, it skips everything beneath it

surreal sage
#

Same functionality as return without "adding parameters"?

wheat mesa
#

What?

#

Like returning nothing? No

#

Continue just skips the rest of the iteration of that loop

viral badge
earnest phoenix
#

Any normal IDE would gray out console.log("some result") with the notice

Unreachable code

deft wolf
#

True

compact pier
#

I can't believe it, when I read my old source code

#

I actually had written a function

#

and then convert it to string and then save it in database

#

:0

sudden geyser
#

code in the database?

#

some projects do that actually

earnest phoenix
#

It's not an IDE

sharp geyser
#

exactly

sudden geyser
#

it practically is

sharp geyser
#

but people still call it one

#

Not really

earnest phoenix
#

It's not an IDE

sudden geyser
#

it has all the components of an ide

earnest phoenix
#

You can interpret it how you wish, it's not an IDE

sudden geyser
#

that's just dogmatic

earnest phoenix
#

Its default installation doesn't even have core components of an IDE in the first place

#

Hence it's already failed to be defined as an IDE

sudden geyser
#

source editor, build automation, testing, even deployment to some extent

earnest phoenix
#

That's definitely not what qualifies an IDE at all...

sudden geyser
#

then what counts as an ide

earnest phoenix
#

Debugger, proper intellisense, proper preconfigured compilers, etc.

sudden geyser
#

intellij pretty much does the same thing as vsc except bundles a bunch of plugins (extensions) when installing

#

yeah vsc has all of that

earnest phoenix
#

Everything in VSC has to be downloaded via extensions, that's not an IDE

earnest phoenix
sudden geyser
#

then prove it

#

literally open the plugins panel and it's a bunch of pre-installed plugins with intellij

earnest phoenix
#

That's not an IDE if you need to download a crap-ton of extensions to get features of an IDE

#

And IDE has IDE features out of the box

sudden geyser
#

oh so if you have to click a few more buttons when installing it's no longer an ide

#

that's a bad take

#

things are defined by attributes, not by names

earnest phoenix
#

VSC is a code editor or source code editor, that has IDE-like features.

sudden geyser
#

ergo it's an ide

earnest phoenix
#

Leads absolutely no where, no point on continuing.

sudden geyser
#

ergo means therefore

earnest phoenix
#

Read VSC's own documentation as well as Wikipedia and other sources, they clearly mention VSC as a code editor.

sudden geyser
#

again, those are namesโ€”not attributes

#

vsc has the attributes of an ide

#

but this is getting no where

#

so I'm not going to waste more time on this

velvet stream
#

Hello guys, can I integrate two different commands prefixes in same bot?

earnest phoenix
#

Yes

deft wolf
#

Of course

velvet stream
#

obvious but wanted to check, thank you guys

flat copper
#
<div class="parent">
  <div class="child">1</div>
  <div class="child">2</div>
  <div class="child">3</div>
</div>
.parent {
  display: flex;
  flex-direction: column;
}

.child {
  position: relative
}

how do i display childs in row?

rustic nova
#

get rid of relative

#

on the c1 selector

maiden gazelle
#
const Discord = require("discord.js");

exports.run = async (bot, message) => {
    
    const embed2 = new Discord.EmbedBuilder()
    .setDescription(`nothing to snipe!`)
    embed2.setColor("#2E3192")
    
    const msg = bot.snipes.get(message.channel.id)
    if(msg === undefined) return message.channel.send({ embeds: [embed2] });
    
    let embed = new Discord.EmbedBuilder()
    .setAuthor(msg.author, msg.member.user.displayAvatarURL())
    .setDescription(msg.content)
    .setFooter('Get Sniped lol')
    .setTimestamp();
        message.channel.send({ embeds: [embed] });
    }

exports.help = {
    name: 'snipe', 
    aliases: []
    }
``` does somebody know why it everytime says "there are no messages to snipe" in my snipe command
deft wolf
#

Maybe because you don't have any messages to snipe? pogey

maiden gazelle
#

no i deleted a message and then i use the command and it always says there are no messages to snipe

deft wolf
#

Do you save deleted messages somewhere?

maiden gazelle
#

yes

pearl trail
#

how do you save it

deft wolf
#

I was going to ask about it

#

Because if you save them wrong, then reading them correctly won't help you

#

Always try to include all possible necessary information in the question

sharp geyser
#

Okay question

maiden gazelle
#

wdym save it

sharp geyser
#

What is msg exactly

#

is it a string or?

maiden gazelle
#

message

#

string ig

sharp geyser
#

So have you checked to see if msg actuallycontains something

solemn latch
#

those are two separate things entirely though ๐Ÿ‘€

sharp geyser
#

He says it keeps telling him there is no messages to snipe

#

so msg has to be null/undefined

solemn latch
#

thats the if statement, yeah

#

checks if its undefined

sharp geyser
#

Thats all that matters right now

#

Cause that is where its stopping

#

So msg is probably undefined/not what he thinks it is to begin with

deft wolf
#

Let him just send the code that is used to save these messages

#

Everything should be clear

maiden gazelle
deft wolf
#

Okay, the command doesn't work as it should

maiden gazelle
#

yup

deft wolf
#

How do you save deleted messages?

sharp geyser
#

WE kind of already know that...

maiden gazelle
#

idk

deft wolf
#

There is no way to access deleted messages using the discord api

#

You need to save them somewhere when they are deleted

#

And then read them using the command

maiden gazelle
#

what do i need to do to fix it

deft wolf
#

Show us the code that is responsible for saving deleted messages

sharp geyser
#

ok this code definitely isn't yours

deft wolf
#

If this code is missing, then the entire command is missing

#

Because you can't read messages out of thin air

#

Deleted of course

maiden gazelle
#

ill look

deft wolf
lament rock
#

Do any of you know a good place to ask for people to translate your app for a fair price

solemn latch
#

there are plenty of companies that do that

lament rock
#

Been browsing and have asked a few friends who were kind enough, but I only have so many friends who may or may not all be imaginary

#

dunno if anyone went with a specific one and could vouch

craggy pine
#

Would having a loop weather it being a while loop or a setInterval that goes on indefenitly to keep an eye on members who join via patreon membership be fine on resources? I would assume because the patreon bot that is basically an auto role bot for patreon roles would cause the guildMemberadd event to not always see the role the user joins with correct?

lament rock
#

you'd be better using a setInterval as loops block the thread

craggy pine
#

Fair.

lament rock
#

The best way to do it for free is basically just having the bot in your guild and people join there with their patreon linked to get the benefits that way it's just a filter by members with role.

But if you have people that refuse to join your guild but still expect benefits, then that may be the way. Both ways are limited to if the user has their Discord account linked and they can link/unlink at their own will and I personally find it gross polling an api

craggy pine
#

Ya. I also considered making a /activate command or something so the user has to atleast send 1 command to recieve benefits.

#

But to be fair, if I were to limit them always having to have an active subscription I feel like a loop would be needed somewhere to check every for example hour changes in tier status

#

Like I can do all of this fine, more looking for suggestions in what someone would do ๐Ÿ™‚

lament rock
#

Just having the bot in your guild and filtering by roles

#

The changes propagate immediately with the bot anyways iirc

craggy pine
#

I would just feel kind bad forcing them to be in the server if they don't want to be

solemn latch
#

IIRC topgg considered using one of these services not using free labor

craggy pine
#

I might go the setInterval route with idk a 30 minute timer and it just checks active and nonactive users and copaires it to my database and apply changes there.

sharp geyser
lament rock
#

I already have
German, English UK, English US, Spanish, Dutch, Polish, Brazilian Portuguese and Russian.

#

some from not so free labor

lament rock
#

@ Voltrex

dry imp
lament rock
#

hey pal hey buddy

#

:)

rustic nova
#

anybody ever had any issues with hosts blocking ports? Been recently experiencing it on hetzner regarding mail ports

#

hetzner does say they do it to avoid abuse, though seems like contabo does too

#

also hetzner has a straight forward process on unlocking these by being trusted on them through both paying invoices (which i haven't yet since i used them recently for testing) and case-for-case decisions. How would that work on contabo?

earnest phoenix
#

You may need to prove that you won't abuse it

lament rock
#

me: Contabo, give port 25. Contabo: for sending emails to users?
me: yes. also me: sends unsolicited ads about people's cars' extended warranties like a boss amandasunglasses

earnest phoenix
#

At least you don't send emails containing unsolicited ads of your NFTs

#

Pretty often that VPS close some ports

#

Usually just sending a support request to open a specific port should work out with no additional costs

rustic nova
#

is it just mainly on VPS or do they unlock that port directly on dedicated servers

rustic nova
#

telnet basically times out so im certain its blocked

earnest phoenix
#

Though I doubt there is one that has all ports open, wouldn't make too much sense

#

But yeah usually just a support ticket and you get it opened

rustic nova
#

well my mailbox is going to be filled with these until then lol

earnest phoenix
#

LMAO

boreal iron
#

What's the reason to use the insecure protocol at all?
Unless you're in a business for example with a closed network using a mail service for internal communication I don't see any reason nowadays to use it.

#

Not even for testing purposes

#

Issue your certificate, configure the mail server and use the secure protocol

#

Nowadays not even hosters blocking these ports, also ISPs do to prevent spam by compromised PCs of their customers

#

As well as routers including such options to block outgoing traffic on port 25

#

Also in order to host a "legitimate" mail server you will have to do a lot of things to prevent your mails being flagged as spam

#

For example making sure the dns records are valid, rdns does resolve your hostname correctly, SPF, DKIM and DMARC is set up correctly

#

etc

#

Even after this it can be a hard process to get your IP whitelisted for any big mail service provider

#

Or get it removed from any of the existing block lists

#

etc

#

FakE out.

#

@rustic nova

rustic nova
#

they're blocking either 465 and/or 587 lol

gleaming bolt
rustic nova
#

its not even 25 thats blocked

#

lmao

#

nvm they blocked 25 too now

#

bru

boreal iron
#

Well im a customer of both providers

#

Non of these ports is blocked for me

rustic nova
#

or am I actually just dum

boreal iron
rustic nova
#

can you telnet these ports?

boreal iron
rustic nova
#

Yeah I have, literally DKIM, DMARC everything setup

#

I can send emails, just not receive any

boreal iron
#

As I don't know anything about your setup, configuration, records etc

#

hostname and rdns set up correctly?

#

It's google most likely don't wanna send mails to your server

#

Tried a different mail service?

rustic nova
#

its just google that times out, the IP is actually the mailserver

#

the rdns might be set to my main domain, though shouldn't affect delivery as thats related to DMARC/DKIM

boreal iron
#

Will get back to it later on

#

Gotta need to do some work real quick

rustic nova
#

though this seems like port blocking from the provider side, since all of these ports are used within a docker container, including 80

#

but ye

#

also the SMTP test dies too, just times out

boreal iron
#

To see if you can get around that

#

Im still not aware they block those ports by default

#

At least I got no issues

#

Not for dedicated nor cloud server

rustic nova
#

they have a cloud firewall?

boreal iron
#

Yes

#

But you gotta enable it

#

Or "create" it and assign it to the server of your choice

rustic nova
#

dont think contabo has cloud firewalls

#

unless am blind

boreal iron
#

Oh I didn't check this, was speaking about Hetzner

#

Just expected them to have one too

rustic nova
#

hetzner does require unlocking the port by requesting it

#

contabo doesnt have it noted down anywhere

boreal iron
#

The ones for unencrypted connections?

rustic nova
#

apparently all of the above now

#

it did previously work on the sending one

#

that ones blocked too now lol

#

so I'm taking a fair guess too that they're blocking that on me

boreal iron
#

Can't test it atm unfortunately but there shouldn't be any restriction on incoming connections

#

Outgoing yes, maybe

rustic nova
#

nah its just incoming

boreal iron
#

Nah impossible

#

If you can show me where this is written down please

#

Because it doesn't seem to apply for me

#

No according to the docs they block outgoing connections on these ports

#

Nothing else would make sense tho as restriction

rustic nova
#

its not written down anywhere, thats the thing

boreal iron
#

It is

#

Literally read it 1 min ago

rustic nova
#

so its only outgoing, not both?

#

ohhhhhhhhhhhhhhhhhhhh

#

wait

#

think I figured it out, I hate docker networking

boreal iron
#

No just outgoing

rustic nova
#

either im stupid with setting up my dockers

boreal iron
#

To prevent compromised systems or bot customers to send spam mail form server using unencrypted connections

earnest phoenix
#

Making own mail server, what an awesome idea /s MA_codm_thisisfine

rustic nova
#

I'm taking a fair guess I did forget to properly firewall the ports

boreal iron
#

We can get to it later on

#

Have to work once again

#

Sadly

rustic nova
#

now it works

boreal iron
#

๐Ÿ‘

rustic nova
#

I forgot to fucking route the docker ports to the interface

#

fml

#

rip that contabo support ticket lol

boreal iron
#

lmao

#

Write another ticket

#

To ask for closing the ticket

rustic nova
#

contabo's ticket system is wack

boreal iron
rustic nova
#

yeah fuck now it comes through

#

thanks docker for being pain when firewalling

boreal iron
#

Glad I'm not using docker

rustic nova
#

I am cuz im stupid

#

but keeps me from bricking my whole server when trying to install something while frustrated

earnest phoenix
#

Hi does anyone know how I can fetch users current guilds?

fetch('https://discord.com/api/users/@me/guilds', {
headers: {
'Authorization': `Bearer ${localCode}`,
},
.then(result => result.json())
.then(response => {
//do something with data
})
.catch(
//error handling
)
})

The bearer token is retireved from succesful login with Discord, and if I change it to Bot and use any of my bot's tokens it retrieves their guilds. Trying to get data from specific guild but guilds/${guild_id} is always 403

quartz kindle
surreal sage
#

/api/v10/guilds/:id

#

Most api endpoints are functional for clients

#

Basically all

earnest phoenix
earnest phoenix
earnest phoenix
surreal sage
#

yeah mb I sent fetch guild

earnest phoenix
#

still returns 401 tho

ancient nova
#

can anyone help ๐Ÿ—ฟ

#

trying to change a python script to js

#
response = requests.post(urls['BAN'], data = {
        'type_device': int(random.random() * 15//1),
        'id': userid
        }).text
    if strictEquals(response, chr(32), '1'):
        return True
    else:
        return False
``` this works
#

this always returns false

#

even when is supposed to be true

#

anyone know whats wrong

compact pier
#

I tried to craw a web, but it just return some small tag

#

How can I craw a website, that is ssr?

boreal iron
#

Looks like a crawler protection for me or to specify it once the client doesn't accept cookies you won't see the site

#

Actually I don't see any JS file import

#

Or script except the existing one

#

I wonder how it checks if the cookie is set then

#

Probably in the backend

#

Which might be the reason the site is enforcing a reload

sudden geyser
#

Yeah

#

Probably setting the cookie then being sent by the browser

#

Could easily store the cookie and send it

#

but doing that on arbitrary pages? good luck

boreal iron
#

Yeah I don't see why this is required at all

#

Must be unbelievable unique and import content nobody should have access to

sudden geyser
#

really doesn't make sense

#

just generate the cookie and send it in the response in one go

#

not generate, give it back, send it back, get stuff

boreal iron
#

Depends what's been used in the backend

#

php for example has no access before the site will be reloaded as the headers are already sent

sudden geyser
#

that's weird

boreal iron
#

Why tho? This code sets the cookies after the header has been sent

#

How should php notice this client sided change when it's only server sided?

sudden geyser
#

no like

#

eh too hard to explain

boreal iron
#

lol

viral badge
#

as a person who played around with webserver on socket level I can tell you how headers and cookies work but you probably already know

sudden geyser
#

on my server I just send it in the response headers

#

and expect the browser to save it

#

just don't understand why the site would go through the extra ceremony

ancient nova
#

so nobody can help me

#

:/

sudden geyser
#

is data meant to be sent as a header / body or something

#

oh yes it's for the body

ancient nova
ancient nova
viral badge
ancient nova
viral badge
#

js (the non-working version)

ancient nova
#

one sec

ancient nova
viral badge
#

ggrip

ancient nova
#

but basically fetch is node-fetch and i'm trying to make a command to check if an account is banned in certain game by using their servers open api

#

but their api is a bit weird

#

i'm quite sure i need to make a post request with ID ans device type

#

but i'm not sure why it always returns 0

#

when in python it works well

viral badge
ancient nova
#

yeah i already done that obviously

#

was just thinking i could try using GET

#

since POST did nkt work

#

tried to send it both as body and by itself

viral badge
#

welp let's hope somebody knows soon or you'll figure it out ๐Ÿ˜Ž

wheat mesa
#

Can you post a pastebin for me @ancient nova

#

On mobile

#

For the js and python maybe

ancient nova
#

apparently my host is down for maintenance cuz someone was abusing their servers or sumn

viral badge
#

probably abuse as in used for ddos ๐Ÿ’€ common nowadays

ancient nova
#

most probable ๐Ÿ’€

lament rock
#

nicovideo's way to prevent people from streaming their content is annoying. This code doesn't work, but they have you recursively fetch m3u8 playlists which all have to be formatted very specifically.

quartz kindle
#

sounds like standard video protection, there are apps that can download that

#

they do exactly what you said

ancient nova
#

u guys need anything else?

#

i can send the python script which works if it helps any

viral badge
ancient nova
#

someone suggested i double then cause if i use .text() it returns 2 promises even though i awaited it

#

which is weird because it already returns something

#

but 0

#

wbich is not valid

wheat mesa
#
const data = await fetch(โ€ฆ);
const json = await data.json();
#

Thatโ€™s what I do

ancient nova
#

just have problem sending in id maybe

wheat mesa
#

What exactly isnโ€™t working?

idle coral
#

Hey guys I'm using Discord.js V13, and I stumbled across an issue that popped up really out of nowhere, it was working fine. I didn't change anything with the callback. Anyways, here is the error:

TypeError: feature.run is not a function
    at Object.<anonymous> (/home/runner/Gage/index.js:68:13)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)

And here is the full code, if you'd like to examine and possibly help/give me an explanation?

client.features = new Collection()
client.featureFiles = walkSync(path.join(__dirname, '/features'))

for (const file of client.featureFiles) {
    const feature = require(`${file}`);
    client.features.set(feature.name, feature)
    feature.run(client);
}

The features folder is basically my modules for commands. Lockdowns, verification, aichat, ect.

solemn latch
#

Do any files in /features not have a run method?

idle coral
#

Working fine!! Thanks!

idle coral
#

Sorry to bother AGAIN, yet I got one more issue. I tried using interaction.create, and interaction.defer which basically are the same thing as they both TECHNICALLY mean any. Could someone help me better understand/help me fix this quickly as I cannot use any command on my bot.

        await interaction.defer({ ephemeral: true }).catch(() => {});
                          ^

TypeError: interaction.defer is not a function
wheat mesa
#

Well, first off, they are not the same thing, and second off, are you sure interaction is what you think it is?

idle coral
#

I think so, but now you're making me think otherwise ๐Ÿคฃ

#

interaction is the callback.

wheat mesa
#

Log it or send your command handler and your command function signature

idle coral
#
client.on('interactionCreate', async (interaction) => {
    if(interaction.isCommand()) {
        await interaction.defer({ ephemeral: true }).catch(() => {});

        const cmd = client.slashCommands.get(interaction.commandName);
        if(!cmd) return interaction.followUp({ content: 'An error has occured'});

        if(!interaction.guild) return

        //Permission requirement
        if(cmd.reqPerm == "BOT_ADMIN" && !client.ADMINS.find(admin => admin.ID === interaction.user.id)) return interaction.editReply("This command is reserved for bot admins only.")
#

This is where it's happening.

#

3rd line.

wheat mesa
#

Oh I see

idle coral
#

What do you notice?

#

interaction is my callback. I used it properly after await and just .defer could be the issue?

wheat mesa
#

.defer doesnโ€™t exist

#

Thatโ€™s not a real function

#

deferReply is the function youโ€™re looking for

#

Make sure to look at the docs for CommandInteraction to see what all of the functions are

idle coral
#

Oh shoot it is.

#

Thank you!!

open falcon
#

Hello

#

nvm I just had to make the object in in setup_hook

sharp geyser
#
public class CuiButton
    {
        public CuiButtonComponent Button { get; } = new CuiButtonComponent();
        public CuiRectTransformComponent RectTransform { get; } = new CuiRectTransformComponent();
        public CuiTextComponent Text { get; } = new CuiTextComponent();
        public float FadeOut { get; set; }
    }

by default if set is not mentioned it means its a private setter right?

#

So you can't do it externally?

earnest phoenix
#

iirc it has none

sharp geyser
#

such as

CuiButton button = new CuiButton
{
  Button = new CuiButtonComponent() {...},
  Text = new CuiTextCompoent() {}
}
earnest phoenix
#

You'd need private set iirc

sharp geyser
#

So this isn't possible?

#

I thought C# interpreted as it being a private setter by default

lament rock
#

there are readonly attributes so

sharp geyser
#

So what I just did above isn't possible?

lament rock
#

beyond just nooping

earnest phoenix
sharp geyser
#

I am only asking cause I am looking at the source code for something since there is no actual documentation on how shit is

earnest phoenix
#

Will then be a private setter

lament rock
#

Welcome to the internet

#

developers make the worst choices for every reason possible

earnest phoenix
#

Though C# is absolute madness

#

Why do you use it painful_existance

sharp geyser
#

This isn't for me

lament rock
#

TypeScript was inspired by C# so I let it slide. Unity is C# and that's fun to dev in

sharp geyser
#

I saw some kid ask a question and wanted to verify if I was correct before helping

lament rock
sharp geyser
#

but it gets boring looking at a almost finished product with no models

earnest phoenix
#

Let them the hassle of finding that one line in a hidden documentation about it based

sharp geyser
lament rock
#

I'm trying to make a VR version of Dinkum/Animal Crossing in Unity

#

not 1:1, but my own spin

sharp geyser
#

That sounds like fun

#

I wish I had the equipment to do that kind of shit

lament rock
#

It is a lot of fun and a learning experience. Trying to figure out procedural terrain manipulation that's optimized and isn't marching cubes

#

vr is expensive to get into for sure

#

but its worth it to me (3k+ hours)

sharp geyser
#

perlin noise is such an interesting algo

lament rock
#

Generation I have the concept of, but any manipulation sounds egregious and shitty for performance if I just have a non static mesh

sharp geyser
#

Unity's terrain stuff is confusing asf

#

I can get it working in roblox tho trollface

lament rock
#

you have committed a sin touching lua

sharp geyser
#

Hey I was trying it out ight

#

I at least know now what I have to do to get it to work

#

I just don't know how to use terrain in unity

lament rock
#

Unity terrain is really cool

sharp geyser
#

I don't get it

lament rock
#

I hope they move away from flat billboards at some point for speed trees and foliage and just do what unreal does with nanite LODs

#

considered trying to get into VR dev more on Unreal since now lumen and nanite are supported in VR

#

but cpp and the editor are so foreign to me and really difficult to do what I want

sharp geyser
#

cpp is also very foreign to me

#

Its nice tho

lament rock
#

I tried it out a bit and did some crude number testing against js and memory and cpu time are very formiddable and almost makes me want to force myself to learn it more

#

but js is good to me. I love js

sharp geyser
#

lol

#

js is a safe language

#

Its a lot of people's first

earnest phoenix
#

i love js

sharp geyser
rustic nova
#

So I'd say nicovideo isnt future proof

viral badge
#

cease n desist?

rustic nova
#

yeah

#

if thats against their tos, they can do that

#

like what youtube did

worn grotto
#

Hey, I am implementing Oauth atm for the website of my bot.

I do not want to use a IP address with http as a redirect uri.

I tried different things with https and setting up a domain in my server settings but I get the Oauth not work properly.

I already have setup a https website which is accessible and the ports are opened. I tested it with the IP and HTTP redirect and it worked.

#

Do you have any thoughts are ideas what I need to consider?

viral badge
#

did you add the url in your application settings?

worn grotto
#

yes. But I ended up with that the url is not available (the url defined in the auth.get("/api/auth/discord/redirect", async (req, res) => {)

#

const auth = express();
const httpsOptions = {
key: fs.readFileSync(
"/etc/letsencrypt/live/test/privkey.pem"
),
cert: fs.readFileSync(
"/etc/letsencrypt/live/test/fullchain.pem"
),
};
const server = https
.createServer(httpsOptions, auth)
.listen(3001)
.on("listening", () => {
console.log(time() + "Auth server listening on port 3001");
});

That is the relevant code. But of course there is much more things causing the problem. Like the apache2 setup or anything else

rustic nova
#

what url is your redirect one? change your domain with example.com

#

exact url

worn grotto
rustic nova
#

your https server is running on 3001, so you need to append that to your url

#

https:// is by default 443, if no port is provided

#

otherwise, the port needs to be provided aswell, so https://oauth.example.com:3001

spark flint
bright thorn
#

how can we get a boolean value if bot is muted or timeout in a guild

rustic nova
earnest phoenix
#

I think they mean muted in general, not just in a voice channel

rustic nova
#

well then you'd need to check the bots roles no?

#

ohhh

earnest phoenix
#

Not necessarily

#

You can be muted in a channel without having a role

bright thorn
#

can we update the interaction if the interaction is already replied

compact pier
rustic nova
#

but depends on what you mean with update

#

editing the interaction response is possible, but you cant just say "oh I wanna revert my response to the interaction"

south kiln
#

cannot read property of undefined (reading "add') when i try to use target.roles.add(role) any one know how to fix this

rustic nova
#

roles is undefined

#

either the target or roles

#

target is undefined

south kiln
#

if you come my dm i wil snd the code

#

can u

rustic nova
#

no

neon leaf
eternal osprey
#

how would i fix this constraint?

#

I know that my tables both have a shared isbn that i connected to each other using the primary and foreingn key

#

However now i am trying to either update or delete the tables but it's always giving me this constraint?

signal lance
#

does topgg support autoplay for iframes?

eternal osprey
#

Must i use ALTER TABLE Book DROP CONSTRAINT isbn?

karmic vector
# eternal osprey Must i use ALTER TABLE Book DROP CONSTRAINT isbn?

TheALTER TABLE Book DROP CONSTRAINT isbn statement is used to remove the isbn constraint from the Book table in a database.

Whether or not you need to use this statement depends on your specific requirements and the structure of your database. If you have an isbn constraint on the Book table and you want to remove it, then you would use this statement to do so. However, if you do not have an isbn constraint on the Book table, or if you do not want to remove the constraint, then you would not need to use this statement.

It is always a good idea to carefully consider the impact of any database changes before making them, as they can have unintended consequences on the data and the structure of your database.

I hope this helps to clarify the purpose and use of the ALTER TABLE Book DROP CONSTRAINT isbn statement. Let me know if you have any further questions.

karmic vector
rustic nova
#

You need to allow the site to use autoplay, also within iframes

#

which is dependant on thr Browser

fresh stone
#

Hello, I'm working on a discord bot I want to make sure it'd ready for public "consumption", I use mysql geting and updating in 99% of commands and this probably isn't a good way to do it for a large bot. Should I create a cache then update the mysql every 5 minutes? How do I make it so the bot can handle having commands run spontaneously. This runs on discord.py.

signal lance
karmic vector
#
import asyncio
from discord.ext import commands
from discord.ext.commands import AsyncQueue

bot = commands.Bot(command_prefix='!')
queue = AsyncQueue()

@bot.command()
async def command(ctx):
    await queue.put(ctx)

async def process_queue():
    while True:
        ctx = await queue.get()
        # Process the command here
        await queue.task_done()

bot.loop.create_task(process_queue())
bot.run('TOKEN')
#

ou can use the AsyncQueue class to create a queue for processing commands asynchronously. Like this โ˜๏ธ

earnest phoenix
#

Why using bot.loop.create_task

karmic vector
earnest phoenix
#
from discord.ext import tasks

@tasks.loop(seconds=1)
async def yes():
  print("yes")

yes.start()
#

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

earnest phoenix
#

This can help to prevent commands from being blocked or delayed when there are many requests being made simultaneously.
Pretty sure discord.py is an asynchronous library by design. Big bots work perfectly fine with the way the library handles the commands by design and by default.

lament rock
#

Oh yes. I love putting all of my logic on the main thread and taking as much time as possible in a single tick of the event loop

#

please give me more synchronized event loops on all threads. Parking a thread is the greatest

idle coral
#

Last time I checked, which was a while ago. Emojis are setup like this, right?

#

It doesn't work.

#

It's the correct ID and name.

deft wolf
#

Did bot has access to them?

viral badge
#

<a: if its animated, however i've encountered a similar issue with one emoji not showing but it shows in other messages the bot sends

idle coral
#

Yeah. They're from my server.

idle coral
#

I don't even think it needs that permission.

deft wolf
#

That's weird then

idle coral
#

It's just messages.

#

I feel as if a toggle doesn't need an embed though.

#

So I'd like to keep it a message, but is there a way I could fix it? Was there a change?

#

Just for kicks, laughs and giggles let me add the a in front even though they aren't animated.

#

Nope.

viral badge
# idle coral Did you have a fix for it?

well the only permission it would need is to use external emojis (which admin includes ofc)
I still have a issue that when my bot edits its message, in some servers, it doesn't turn into the emote

idle coral
#

Would the way it's called have something to do with it?

viral badge
#

i have no idea

idle coral
#

Here is a snippet from one of my commands:

interaction.followUp({ content: `${client.emotes.success} Successfully deleted the alt identifier channel!` })
#

I exported the .json file as a module in the discord.js client.

#

So I can call it in any channel.

#

But I feel like that wouldn't alter the emoji.

viral badge
#

(animated emoji) works
When edited, the non-animated emoji doesn't work in this (this = one server it doesn't work in) server
However in the next message (non-interaction though) it shows up
But in one of my other servers, the emoji works in that same place where it didn't in the other server

neither of those servers have the emoji in them

idle coral
#

Administrator bypasses channel permissions, right?

viral badge
#

administrator contains all permissions yes

idle coral
#

No like channel overrides

viral badge
#

yeah its almost like having ownership i'm pretty sure

idle coral
#

Alright thought so.

#

Because those channels that I'm testing it in don't allow external emoji for @ everyone.

#

But the bot has an administrator role.

#

Temporarily I guess I can use default emojis.

viral badge
deft wolf
#

Maybe it's worth checking and changing this setting for @ everyone?

viral badge
#

yeeah often worth testing the easy things first ๐Ÿ˜ต

idle coral
#

Default emojis work ofc.

viral badge
#

well yes

idle coral
#

The channel already had the permissions on for external emojis.

viral badge
#

you got any eval command or some other test command to test it live with?

idle coral
#

Working on an eval command.

#

I'm revamping the bot, started from scratch yesterday.

viral badge
#

nice

idle coral
#

Just getting the client things, models, handlers and main bot features down first.

#

Like a captcha system, which is the verification thing you're seeing.

deft wolf
idle coral
#

I use interaction.followUp.

deft wolf
#

Because from what I read on the internet, interaction.followUp() cannot display custom emoticons

idle coral
#

What is the difference?

deft wolf
idle coral
#

Oh wow huh. Is there a difference between reply and followUp?

deft wolf
#

Apparently

idle coral
#

What are those differences?

#

Every command I've made so far has .followUp.

lyric mountain
#

reply is replying to the original message, followup is a normal message no?

deft wolf
#

Interaction.followUp() seems to be sent via some kind of webhook

#

Or something

idle coral
#

In two commands.

lyric mountain
#

that means nothing

#

u can reply messages with embeds too

idle coral
#

I know.

idle coral
#

Nevermind.

lyric mountain
#

by normal I mean a non-reply message

idle coral
#

Oh.

viral badge
#

i however use reply and the editReply fails the emote in some cases

lyric mountain
#

I don't know if that's the case tho, tim would be able to answer it better

idle coral
#

Alright.

#

Default emojis obviously work, so I'll temporarily stick with those.

viral badge
#

ye

deft wolf
#

Both editReply() and followUp() use some kind of webhook, most likely it is responsible for these problems

#

But I'm not 100% sure, it's just a guess

viral badge
#

weird

idle coral
viral badge
#

well i have the issue on editReply btw

idle coral
#

I switched to online for notifs.

idle coral
viral badge
#

nah reply works finee

idle coral
#

I current don't use the edit feature right now so I'll switch to .reply.

viral badge
#

should I use like fetchReply option or something or just gotta do something else?

boreal iron
#

It's basically your interactively webhook token you can use until it times out

boreal iron
#

Once you didn't defer it you can't use this method

boreal iron
#

Also worth to mention that this method can throw an error once the token becomes invalid or the initial response (for example the deferring status) has been deleted

#

The reply() method makes sense only once you can respond immediately

#

As the webhook token is valid for 3s only without deferring

idle coral
#

Alright so I'm back again with an issue I've been trying to fix since I last spoke here.

This is to do with reloading slash commands as I've globally deleted all of my old slash commands. Now trying to reload my new commands, I am having issues.

Here is my code:

const commands = [];
let commandFiles
let commandsFolders

if (guildId == guildId & clientId == clientId) {
    commandsFolders = fs.readdirSync(`./SlashCommands`); // All command folders & files
}

for (const folder of commandsFolders) {
    commandFiles = fs.readdirSync(`./SlashCommands/${folder}`).filter(file => file.endsWith('.js'));

    // Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
    for (const file of commandFiles) {
        const command = require(`./SlashCommands/${folder}/${file}`);
        commands.push(command.data.toJSON());
    }
}

// Deploying commands
(async () => {
    try {
        console.log(`Started refreshing ${commands.length} application (/) commands.`);

        // Use the put method to fully refresh all commands in the guild with the current set
        const data = await rest.put(
            Routes.applicationGuildCommands(clientId), // Guild Commands
            // Routes.applicationCommands(clientId), // Global Commands
            { body: commands },
        );

        console.log(`Successfully reloaded ${data.length} application (/) commands.`);
    } catch (error) {
        console.error(error);
    }
})();

I keep getting this error stating that command.data.toJSON is not a function, what would the cause be?

I didn't have anything with "data", so I had to rewrite my command to look like this:

boreal iron
#

Unfortunately I have to sleep rn

#

But some tips real quick

sharp geyser
#

dont use djs

boreal iron
#

Since you don't use the slash command builder - thank god - make sure your command structure actually follows the api expectations

#

The properties cooldown, regPerm or args are not part of the command structure as the api expects it

#

Also don't import and use the rest methods manually

#

client.application.commands.set/create/edit() are inbuilt methods in djs

#

You simply provide the command array as argument