#development

1 messages · Page 1940 of 1

wooden ember
#

its comming form here

#

the function connecttochannel runs fine since one it doen't through any errors and two its almost a complete coppy of the player example on the docs

#

the only trouble is im trying to use it to fix my original thing from v12 and its not going to well

earnest phoenix
#

i am getting error like "the user aborted a request" how can i fix this

solemn latch
#

Djs?

#

That error is thrown when a request takes too long to be handled.
Such as uploading images on a slow connection(such as home networks, or maybe even replit, or super budget vps providers). Or just slow networks in general.
It can happen randomly sometimes due to discord too, but is pretty uncommon.

If you're getting this error commonly I would suggest try another hosting provider temporarily if possible.

earnest phoenix
#

i am using d.js v13

#

And i am using vps

#

I've been getting this error for 3 days

#

I think it has to do with hosting because i live in Turkey and my vps in the Turkey

#

Like 150 ms

solemn latch
#

Is it happening on specific things? Or just on random things every time?

Might help to get a vps closer to discord servers, which are in the US iirc.

#

You could also increase your timeout duration, but thats not a good method imo

earnest phoenix
#

i have 6,000 guilds and happens when too many people use the bot at the same time

solemn latch
#

Yeah likely vps issues then.

spark flint
#

Try a better VPS

#

What are the specs of the VPS and where do you get it from?

#

And what is your budget?

lament rock
#

Unity C# is a journey.

timber fractal
#

how do i add my html document to an email and also make it work, not like this smh

earnest phoenix
spark flint
#

what budget do you have

earnest phoenix
#

The amount I paid comes to 4 dollars, so 50 TL, but for me it's like 50 dollars 😄

#

I can't buy a vps from abroad because Turkey economy like a monopoly lmao

spark flint
#

so $4 a month basically?

earnest phoenix
#

yea

#

Turkish lira vs shiba inu coin

timber fractal
earnest phoenix
#

If im being honest I didn't know you could use html in emails

#

try dogecoin

#

try eth ;)

earnest phoenix
#

trick question

#

I dont use replit

#

nerd

earnest phoenix
#

pfft

north hull
#

does client.on("clickButton", async i => { }) is still working on djs v13? i've trying to use that code but not working (i want to make button still working when bot restarted)

earnest phoenix
#

didnt know clickButton was an event

earnest phoenix
#

you should check for the event from inside the command itself

#

global event listeners are terrible

#

saying from experience in fucking up my react code

north hull
#

oh ok

earnest phoenix
#

is it just me or is clickButton not even an event

earnest phoenix
#

I see

#

yea

#

with the type set to button's code

#

it is

#

mhm

#

it's probably 913

earnest phoenix
timber fractal
#

bruh

#

why can other emails do

earnest phoenix
#

idk

#

try googling it

timber fractal
#

i did, useless

#

other emails can do it:

earnest phoenix
#

you probably have to do it through code

timber fractal
earnest phoenix
#

gmail changes your <> and / to < > and (escape character for /)

#

so it isn't actually html

earnest phoenix
timber fractal
#

but i just have a webmail provider

#

with autoresponse

#

i want to use that

spark flint
#

You need something like Sendgrid or Sendinblue

earnest phoenix
spark flint
#

Or use roundmail client which supports it

earnest phoenix
#

diagnosis: provider issue

spark flint
#

Webmail client issue

earnest phoenix
#

plain skill issue

lyric mountain
outer zenith
#

quick question

#

if i wanna add stuff to a queue object

#

but the queue object is in the main bot file

#

but the place im adding stuff to the queue from is in another class in another file

#

can i just pass the queue object into the bot file and add items into it and itll update the original queue object

#

(python)

feral aspen
#

Anyone who could tell me what 2PG is?

whole glen
earnest phoenix
#

you can't use node from the console

#

change the run command with the .replit file

tired panther
#

I need some help for the regex again.
I have some md files and want to parse out everything in the custom tags <command />

sudden geyser
#

Maybe you want a formal Markdown parser

#

A regex is naive

#

For example, <.+?> will gladly match all HTML tags, including those where it doesn't make sense in context (e.g. a comment)

#

But comments would've been matched anyway

tired panther
#

found one

#

which is not good 😓 , adding more props in the tags does not match it anymore

whole glen
#

my bot is still running while my codes off and it's using the old code from a while ago that i delted

sudden geyser
#

You have some host still running your bot

#

Try finding and turning it off

proven lantern
#

What's the best way to refactor common logic used across different lambdas? Should i move the logic to a npm module or move the logic to different lambdas?

#

also what are some good private npm hosting options?

whole glen
whole glen
neat ingot
#

how to do that?

#

i cannot see any options on the developer portal to allow for anything metnioned there

spark flint
#

Discord dev portal

#

under Oauth2

#

then select perms

proven lantern
neat ingot
#

eeeyy sweet! tyvm mr big ❤️

spark flint
earnest phoenix
#

I wonder if linux centos 7 or 8 is better for discord bot?

#

or ubuntu?

quartz kindle
#

doesnt really matter

#

i like debian, some like ubuntu, some like centos

solemn latch
#

Centos is considered more stable and secure iirc, but likely doesn't matter for a bot

earnest phoenix
solemn latch
#

Ubuntu has no issues running for months though

quartz kindle
#

if you like it and feel comfortable with it just stay with it, but generally linux is considered more stable

earnest phoenix
#

there is no problem in the 2012 R2 but my bot has 6,000 servers i wonder which one os will be more performant

quartz kindle
#

os performance will likely be irrelevant

#

but i dare say linux would likely be more performant

earnest phoenix
#

I understand thanks

proven lantern
#

what's the best way to refactor common logic used across different lambdas Tim?

#

refactoring to npm or another lambda?

#

i'm thinking refactoring it into another lambda might be best

gloomy vessel
#

how can i set this up for global commands i just need to change the "MainGuild"

lyric mountain
#

Differently to windows with focuses on end-user experience

#

Not that it's a good experience either

earnest phoenix
#
(node:696) UnhandledPromiseRejectionWarning: TypeError: args[0].toLowercase is not a function
``` ._.
lyric mountain
#

You sure args[0] exists?

woeful pike
#

#920530847944278047 message
@trail orchid If you're struggling with centering stuff I think you might be missing fundamentals of how css + html build on top of each other. Have you looked at how the box model works? https://web.dev/learn/css/box-model/

web.dev

Everything displayed by CSS is a box. Understanding how the CSS Box Model works is therefore a core foundation of CSS.

earnest phoenix
lyric mountain
#

Console log it

earnest phoenix
#

exists and exported it too

earnest phoenix
#

args[0] is "cardchange"

lyric mountain
#

Idk then

solemn latch
#

can you show the part of the code which you log, then use toLowerCase?

earnest phoenix
#

bruh moment

solemn latch
#

I mean all together, as args may not be defined the same way in two separate positions

earnest phoenix
#

i console args?

gloomy vessel
earnest phoenix
#

ye

#

it wasn't in args[0] now that i check, it was in a args[1] so probably because i didn't provided a args[1] so i'll make it conditional so if there ain't any args[1], it won't set cards to args[1].toLowerCase()

#

i'll check when it loads

whole glen
#

Trying to use embeds with slash commands ```console.log("NodeJS Version: " + process.version)
const express = require('express');
const app = express();
const port = 3001;

app.get('/', (req, res) => res.send('Hello World!'));

app.listen(port, () => console.log(Server is up));

const { Client, Intents } = require('discord.js');

const client = new Client({ intents: [Intents.FLAGS.GUILDS] });

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

client.once('ready', () => {
console.log('Ready!');
});

client.on('interactionCreate', async interaction => {
if (!interaction.isCommand()) return;

const { commandName } = interaction;

if (interaction.commandName === 'meme') {
const embed = new MessageEmbed().setTitle('testing');

    await interaction.reply({ embeds: [ embed ] });
}
if (interaction.commandName === 'help') {
    await interaction.reply({ content: 'coming to your discord soon', ephemeral: true });
}   

});

client.login(process.env.TOKEN)```

#

but it does not work ``` throw new DiscordAPIError(data, res.status, request);
^

DiscordAPIError: Unknown interaction

icy marlin
#

Can't get this to work ...

spark flint
#

what is your url amt

#

atm

river star
#

a

icy marlin
#

I can ss @spark flint

spark flint
#

sure

icy marlin
spark flint
#

what is your callback url

#

probs /callback

icy marlin
#

...

#

I'm in dev call :/

spark flint
whole glen
#

u ok

river star
#

nvm

whole glen
#

no it has ! infront

river star
#

do

console.log(interaction)
#

see what it says

earnest phoenix
#
 const roleID = '920868198717456384'
 const inviteLink = '.gg/solodev'

 client.on('presenceUpdate', (_oldPresence, newPresence) => {
  const member = newPresence.member
  if (member) {
    if (!member.roles.cache.has(roleID)) {
      const customStatus = newPresence.activites
        .find(activity => activity.type === 'CUSTOM_STATUS')
        ?.state
      if (customStatus) {
        if (customStatus.includes(inviteLink)) {
          member.roles.add(roleID)
            .catch(console.error)
        }
      }```
How come this doesn't work?
#

A friend asked for help and idek this one 🤣 haven't used presenceUpdate in a while.

river star
#

does he have presence intent enabled

whole glen
earnest phoenix
#

everything is on.

river star
#

even in the new Discord.Client?

river star
earnest phoenix
#
const { Client, Intents, Collection, MessageEmbed, G } = require('discord.js');
const discord = require('discord.js');

 const client = new Client({
    partials: ['MESSAGE', 'CHANNEL', 'REACTION' ],
    allowedMentions: { parse: ["users", "roles"] },
    intents: [
        Intents.FLAGS.GUILDS,
        Intents.FLAGS.GUILD_MESSAGES,
       // Intents.FLAGS.GUILD_MEMBERS,
        //Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
       // Intents.FLAGS.GUILD_WEBHOOKS,
       // Intents.FLAGS.GUILD_INVITES,
        Intents.FLAGS.GUILD_PRESENCES,
    ],
});```
#

Yes, it has everything on.

#

Would they need the GUILD_MEMBERS intent enabled tho?

#

Since it is looking for members w/a status?

#

Just a thought I had.

main trench
#

Just need some clarification so you can only fetch webhooks by their ID and token? You can't by their name?

river star
earnest phoenix
river star
#

@earnest phoenix tell him to do intents: 32767

#

(all intents)

main trench
#

All intents is kinda bad 💀

main trench
river star
#

if it works then its a issue with your intents

main trench
#

I'm making it so it looks for a specific webhook and if it's not there then have it make that webhook. But I don't want the user to provide anything token wise as I want it to be dynamic

earnest phoenix
#

Ahh, makes sense.

main trench
#

Yeah

#

I've got the making part down

#

I just need the fetching

earnest phoenix
#

Well

#

Tbh, you could just use a command to create one.

#

Fetch that and use it as such..?

main trench
#

Kinda ruins the dynamic part though sadly

earnest phoenix
#

It would yeah. :/

whole glen
# river star

wait for some reason that fixed it maybe code didn't update idk

earnest phoenix
#

What is the issue?

whole glen
#

im sad

earnest phoenix
#

k

sudden geyser
#

just be happy

main trench
#

Just fetch all webhooks in the channel and sort by name

#

Should definitely work with no issues 💀

river star
earnest phoenix
#

why post that here

main trench
river star
main trench
#

I can tell

earnest phoenix
#
client.on('presenceUpdate', (_oldPresence, newPresence) => {
  const member = newPresence.member
  if (member) {
    // Ignore members who already have the role
    if (!member.roles.cache.has(roleID)) {
      const customStatus = newPresence.activites.cache.get(activity => activity.type === 'CUSTOM_STATUS')

      if (customStatus) {
        if (customStatus.includes(inviteLink)) {
          member.roles.add(roleID)
            .catch(console.error)
        }
      }
    }
  }
 })

Error::

TypeError: Cannot read properties of undefined (reading 'cache')

#

should I do .find??

#

even then its still undefined.

#

well 1

#

you are using get wrong anyway

#

🤣 knew that

river star
earnest phoenix
#

then why do it

river star
#

you cant index anything with it

#

try console logging member.roles

earnest phoenix
#

Now its just

#

TypeError: Cannot read properties of undefined (reading 'find')

river star
#

bro u cant index a undefined value

earnest phoenix
#

newPrecense is probably undefined

#

or activities

river star
#

how do i check if server has application.commands enabled for the client dead

earnest phoenix
#

you can't I dont think

#

It isn't actually a permission

main trench
#

Just have the invite link make the commands

earnest phoenix
#

it is just one of the scopes

river star
earnest phoenix
river star
main trench
#

Well

earnest phoenix
#

Tell them to reinvite the bot ig

river star
#

im tryna make a message like "reinvite cuz no slash commands"

main trench
#

When I did my bot and added slash it pushed to the servers it was already in so idk

river star
#

only if application.commands is disabled

main trench
#

I guess just have the message send no matter what

#

And remove it after some time

#

Or use a db on when it rejoins the server to log something and if it's not in the db then send the message

earnest phoenix
#

waste of database space even though it doesn't matter

river star
#

^

main trench
#

True true

#

Defo not the best but about all that I could think of working

earnest phoenix
#

Not like the amount it takes up will be anywhere near worrisome

#

it just doesn't make sense

main trench
#

How I explained it or it itself?

earnest phoenix
#

The idea in itself

river star
#

im pretty sure discord will remove the application.commands thing in april

earnest phoenix
#

Using a db to send a error message

#

pfft

river star
#

since its gonna be the default for all bots

main trench
earnest phoenix
#

You could wait until april then

river star
earnest phoenix
#

Honestly

#

Just dont worry about it

#

those who actually care will join your support server

#

and just tell em there

#

ez

#

So am I doing something wrong here?

client.guild.channels.cache.find('920873655515377688').send({ content: `<@${member.id}> Added \`.gg/solodev\` to their status. ` })

#

I tried .get and stuff but nope.

river star
#

whats the error

earnest phoenix
solemn latch
#

Client.channels

#

Not client.guilds.channels

#

Then get should work

#

If you use find you'll need to pass a function not just an id

river star
#

client.channels.cache.get('920873655515377688')

earnest phoenix
river star
#
client.channels.cache.get('920873655515377688')
earnest phoenix
#

you are mixing up get and find

#

Worked, tyty

#

get requires an ID find you can do that wonky shit with

earnest phoenix
#

yes please do

#

Will do lol

solemn latch
earnest phoenix
#

loving typescript rn

river star
earnest phoenix
#

means exactly what it says

main trench
#

yo big issue so im trying to fetch a webhook by its name like this

let find = await interaction.channel.fetchWebhooks().then(hook => hook.find("webhook")) 
              
              if(find) {
                console.log("found")
              }

and i get this random error

TypeError: e is not a function
    at Map.find (C:\Users\dezja\Desktop\Goot\node_modules\@discordjs\collection\dist\index.js:1:1708)
    at C:\Users\dezja\Desktop\Goot\slashCommands\invite.js:28:83
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.execute (C:\Users\dezja\Desktop\Goot\slashCommands\invite.js:28:23)
    at async module.exports (C:\Users\dezja\Desktop\Goot\events\interactionCreate.js:12:3)

anyone undertand it?

#

e is nowhere in this file btw

earnest phoenix
#

Okay another one

#
if (activities && (activities.state.includes('.gg/solodev') || activities.state.includes('discord.gg/solodev'))) {
main trench
#

try "state?.includes"

earnest phoenix
#

Like 3 red dots

#

Nice replit, you no longer actually show whats wrong 👍 mad

main trench
#

repl issue i guess

main trench
#

the code i sent is line 28

#

its just map issues

#

guess how im doing it isnt right

earnest phoenix
#

I'll try to fork it ig

main trench
#

hmm weird

#

logging "hook" provides the entire webhook info

#

oh wait

#

nvm

earnest phoenix
#

Nope, it's just saying

TypeError: Cannot read properties of null (reading 'includes')``` the whole time `o-o`
#

its null

#

whenever it says of null it means whatever before is null

#
client.on('presenceUpdate', (_oldPresence, newPresence) => {
  const member = newPresence.member
const activities = member.presence.activities[0]

  
if (activities && (activities.state.includes('') || activities.state?.includes(' '))) {
  
 client.channels.cache.get('920885277042556968').send({ content: `<@${member.id}> Added \`.gg/\` to their status. ` })
#

make sure you log stuff to see if it is undefined/null

#

It's my status.

#

well thats cool and all but it could be an issue with the event not giving relevant data

quartz kindle
earnest phoenix
#

I already told them that but no one listens to me tim

#

😢

earnest phoenix
#

Nvm worked.

main trench
#

guess i could map it idfk

#

too tired for this

#

logging the name isnt important i just want fetching to work

main trench
quartz kindle
#

i just told you?

#

.find() expects a function, not a string

main trench
#

then why would d.js say to do this smh

quartz kindle
#

they dont?

#

where do hey say that

main trench
#

i asked someone

#

should have explained that

#

if i cant use find then how tf am i supposed to do this

quartz kindle
#

i didnt say you cant use find

#

i said you're using it wrong

main trench
#

guess i could try

#

honestly have no hopes of this working rn

quartz kindle
#

i mean, if you use the functions correctly it will work

main trench
#

i just use them how im told 🤷‍♂️

quartz kindle
#

whoever told you that was wrong lol

main trench
#

not suprised

#

main reason i dont go to that server for help kekw

#

guess it worked

#

nice

quartz kindle
#

there was a time, a few yeas ago, where discord.js's find used to accept a string like that

main trench
#

thanks as usual Tim

quartz kindle
#

but that was removed a long time ago

main trench
#

now i can get this feature to work

quartz kindle
#

because collection.find() is based on array.find(), and array.find() always required a function

#

discord.js was the one being weird when they accepted non-normal stuff

#

so it was a good thing to remove it

earnest phoenix
#

hey tim wanna see some hideous code?

#

that doesn't even work

quartz kindle
#

sure

earnest phoenix
#
        for(const a of minerals) {
            for(const b of a) {
                const item = user.items.find((r) => r.name === b.name)
                if(!item){
                    const i = new Items()
                    i.name = b.name;
                    i.value = b.value;
                    await i.save()

                    user.items = [...user.items, i]
                    await user.save()
                } else {
                    item.amount += a.length
                    await item.save()
                }
            }
        }
#

:)

#

2D array looping

#

I fucked up badly

#

Bot is still thinking

quartz kindle
#

hmm

#

idk what minerals is, but ideally you'd want to loop over everything, to whatever operations need to be done, but dont save anything

#

wait until the loop ends, then save everything at the end

earnest phoenix
#
[
  [
    { name: 'Cookie', value: 25 },
    { name: 'Cookie', value: 25 },
    { name: 'Cookie', value: 25 },
    { name: 'Cookie', value: 25 },
    { name: 'Cookie', value: 25 },
    { name: 'Cookie', value: 25 },
    { name: 'Cookie', value: 25 },
    { name: 'Cookie', value: 25 },
    { name: 'Cookie', value: 25 }
  ],
  [
    { name: 'Peppermint', value: 65 },
    { name: 'Peppermint', value: 65 },
    { name: 'Peppermint', value: 65 },
    { name: 'Peppermint', value: 65 }
  ],
  [
    { name: 'Truffles', value: 90 },
    { name: 'Truffles', value: 90 },
    { name: 'Truffles', value: 90 },
    { name: 'Truffles', value: 90 },
    { name: 'Truffles', value: 90 },
    { name: 'Truffles', value: 90 },
    { name: 'Truffles', value: 90 }
  ],
  [
    { name: 'Gingerbread', value: 40 },
    { name: 'Gingerbread', value: 40 },
    { name: 'Gingerbread', value: 40 },
    { name: 'Gingerbread', value: 40 },
    { name: 'Gingerbread', value: 40 }
  ]
]
quartz kindle
#

why are there so many duplicates?

sudden geyser
#

user.items = [...user.items, i]
whatever happened to using .push :(

earnest phoenix
#

I was using push

#

but idk if push would work here

#

so I am trying whatever

earnest phoenix
quartz kindle
#

i mean

#

why not have a count property?

earnest phoenix
#

Wdym

quartz kindle
#

{ name: 'Gingerbread', value: 40, count: 5 }

earnest phoenix
#

.....................................

#

Ya know what

#

I didn't think about that ima be honest with ya

#

But idk how to exactly do that

#
    private async mine(): Promise<ICandyInfo[]> {
        const candy: ICandyInfo[] = []
        for(let i = 0; i < 25; i++){
            const c = candies[Math.floor(Math.random() * candies.length)]
            candy.push(c)
        }

        return candy;
    }

This is how i currently mine things

#

candies being a array in a json file with candy

quartz kindle
#
[
  { name: 'Cookie', value: 25, count: 9 }
  { name: 'Peppermint', value: 65, count: 4 }
  { name: 'Truffles', value: 90, count: 7 }
  { name: 'Gingerbread', value: 40, count: 5 }
]```
earnest phoenix
#

uh

#

That isn't very helpful

#

I get what you mean or at least I thought I did

#

am I misunderstanding your intentions?

quartz kindle
#

what is this mining supposed to do?

earnest phoenix
#

mining is supposed to return you with a list of stuff you've mined

#

which you obv wont just mine 1 of everything

#

you'll get multiple of a resource

quartz kindle
#
const mined = {}
for(...) {
  const name = // get a random name somehow
  if(!mined[name]) { mined[name] = 0; }
  mined[name]++;
}
return minded;
#

the above will return something like this ```js
{
"Cookie": 3,
"Truffles": 6,
...
}

earnest phoenix
#

Not sure I follow how this can be used practically

#

Or are you saying

#
    private async sortMinerals(data: ICandyInfo[]): Promise<ICandyInfo[][]> {
        const sortingObj: Record<string, ICandyInfo[]> = {}

        for(const stack of data) {
            const { name } = stack
            if(name in sortingObj) sortingObj[name].push(stack);
            else sortingObj[name] = [stack]
        }

        const sortedMinerals = []

        for(const stacks of Object.values(sortingObj))
            sortedMinerals.push(stacks.sort((a,b) => b.value - a.value))

        return sortedMinerals
    }

Could I implement the count thing here somehow?

#

This method just returns a 2D array with the duplicates into their own arrays

#

But if I can implement counting them instead of sorting them int otheir own arrays I dont need to make a 2D array

quartz kindle
#

you want to sort them by count?

#

or what

earnest phoenix
#

Well

#

I wanna do what you suggested instead

#

I wanna instead of making them into a 2D array just implement that count thing

quartz kindle
#

then its easy

#

instead of creating a new array then push stuff to it, you create an object with a count property, and increase the count

#
if(name in sortingObj) sortingObj[name].count++;
else sortingObj[name] = { count: 0 }
#

for example

earnest phoenix
#

ah I see

#

So after I do that I won't really need a 2D array then

quartz kindle
#

you dont need arrays at all if all names are unique

#

just make an object

earnest phoenix
#

My only worry is

quartz kindle
#
{
  "Truffles": { value: 10, count: 5 },
  ...
}
earnest phoenix
#

I don't know how exactly after doing this, how ima save the items to the db

#

the whole point of the 2D array was so I can loop through and save the items like that

lyric mountain
#

Serialization is an option

earnest phoenix
#

I have a hard time explaining my thoughts sadly

quartz kindle
#

you should never need to individually save one thing at a time, thats very bad

earnest phoenix
#

😩

quartz kindle
#

you should always do everyting at once, then only save at the end

earnest phoenix
#

yea

#

so say I do have it like this:

  { name: 'Cookie', value: 25, count: 9 }
  { name: 'Peppermint', value: 65, count: 4 }
  { name: 'Truffles', value: 90, count: 7 }
  { name: 'Gingerbread', value: 40, count: 5 }

How would i then go in and save each of those items like that.

quartz kindle
#

for example, get a list of mined stuff with their counts, get the user's current list, update all the counts, then save the updated list at the end

earnest phoenix
#

Cause I would have to create the Cookie, Peppermint, Truffles and Gingerbread items for the user

lyric mountain
#

Serial it

quartz kindle
#

what db are you using?

earnest phoenix
#

postgres + typeorm

#
export class Items extends BaseEntity {
    @PrimaryColumn()
    id!: string;

    @Column({ name: 'name', type: 'text' })
    name!: string;

    @Column({ name: 'type', type: 'text' })
    type!: string;

    @Column({ name: 'amount', type: 'bigint', default: 1 })
    amount!: number;

    @Column({ name: 'value', type: 'bigint' })
    value!: number;

    @ManyToOne(() => User, user => user.items)
    user!: User

    @Column({ name: 'description', type: 'varchar', length: 150, nullable: true })
    description?: string;
}

If it is important here is how my table is setup for items

lyric mountain
#

That's very jpa

earnest phoenix
#

jpa?

lyric mountain
#

Im impressed

#

A java orm lib

quartz kindle
#

idk how typeorm works

#

but assuming each Item is stored in its own column

#

then yes, each item would need to be saved separately

earnest phoenix
#

yea

#

that is what my issue here is

quartz kindle
#

unless typeorm offers some kind of batch function

lyric mountain
#

You can bind foreign tables directly to lists and alikes

quartz kindle
#

yeah i know that much

#

but idk what is the structure its actually generating

lyric mountain
#

Basically whatever structure he set in the class

#

It'll try to replicate the class into the database

earnest phoenix
lyric mountain
#

In this case, he'll have

id STRING NOT NULL PRIMARY KEY
name TEXT
type TEXT
amount BIGINT DEFAULT 1
value BIGINT
description VARCHAR(150)
baseentity_id STRING NOT NULL
. 
.  Whatever fields user has
. 
quartz kindle
#

welp i g2g sleep, good luck

lyric mountain
#

Also I forgor how a foreing key is declared

earnest phoenix
#

I dont even remember in raw sql lol

#

My first issue is adding in the count

#

I am doing it wrong but I don't know what part of it is wrong

lyric mountain
#

Just update the item count directly

halcyon nebula
#

hey i have one query
when we use oauth to login with discord, most of the time we get a promt to click on authorize.

but i have seen somewhere that after clicking on login with discord, it just redirects to oauth link and redirects back to the site without any prompts. and i have been logged in

#

how to make that?

lyric mountain
#
UPDATE items 
SET amount = amount + :amount
WHERE name = :name
feral aspen
#

What does 1PG or 2PG mean?

tranquil knoll
#

Guys i m using topggpy and on my bot's beta instance get_user_vote() isn't working. no error or nothing, the function just isn't doing anything. Anyone can hepl?

cinder patio
feral aspen
#

1PG-Bot and 2PG-bot and something like that.

cinder patio
#

Maybe this?

#

Idk what PG stands for though

pale vessel
#

Parental Guidance

slender thistle
#

Poetic God

heavy stirrup
#

hi

#

hi

spark flint
heavy stirrup
#

me bot verivay top.gg@spark flint

slender wagon
#

is there a way i could use a inside a

#

mf

#

how tf do i do this

#

`

#

inside a

#

`

#

in javascript

lament rock
#

\`

slender wagon
#

thanks

copper wasp
#

how do I log the vote received for the server using webhooks?

spark flint
#

Or you can code your own solution

heavy stirrup
#

@big.bun#6969

halcyon nebula
wheat mesa
#

Pretty sure it’s something to do with cookies and the fact that the user has authorized oauth before

#

Otherwise I don’t think you can “make” oauth automatically accept

fervent tree
#

Hey guys!! so i am trying to make a dashboard for my discord bot in NextJS. I am using next auth for the authorization but i am having trouble getting all the informations like: guilds member has joined in, etc. Can anyone help me with it?

#

this is my pages/api/auth/[...nextauth].js:

import NextAuth from "next-auth";
import DiscordProvider from "next-auth/providers/discord";

export default NextAuth({
    providers: [
        DiscordProvider({
            clientId: process.env.DISCORD_CLIENT_ID,
            clientSecret: process.env.DISCORD_CLIENT_SECRET,
            authorization: {
                params: {
                    scope: "identify guilds email",
                },
            },
        }),
    ],
    secret: process.env.JWT_SECRET,
    pages: {
        signIn: "/login",
    },
});
spark flint
heavy stirrup
#

me bot top.gg and staf verivay @spark flint

wheat mesa
#

huh

earnest phoenix
#

-upto ig

spark flint
#

huh

copper wasp
spark flint
#

You could do that with a Vote Tracker bot

copper wasp
#

Then whats the point of using the webhook, i can just use that bot instead

#

: (

spark flint
#

The webhook just sends a post request to a discord webhook and sends to a channel

spark flint
#

the bot would use the webhook instead, so it knows what server was voted for and which user voted, and from there, giving the applicable user a role

copper wasp
#

...

solemn latch
#

the reason that site got recommended is because it does what you asked for originally.

Its only purpose is to send a message, for those who want that.

copper wasp
#

ok

#

Thanks guys

#

@spark flint hey dude btw can i use a bot to do this

#

the auto role stuff

spark flint
#

On join?

copper wasp
#

No no

#

the voted stuff

spark flint
#

Oh

#

The vote

#

Yeah

#

2 secs

copper wasp
#

I have a private bot of my server so

#

k

spark flint
#

That would work

copper wasp
#

: (

spark flint
#

wow

earnest phoenix
modest maple
#

idk if it works

earnest phoenix
#

i see

copper wasp
#

cool

earnest phoenix
#

as with everything on the site it's probably broken

copper wasp
#

bruh

wooden ember
#

so i made a bot that pings mc servers to see if they are online or not, and if its on it renames a channel and the same if its off however im using an array and the last of the values is always one off for example i have to put an extra value in it to that they synk up does anyone know why this happens?

spark flint
#

Values start at 0 in an array

#

Unless you use Lua

#

tom scott anger intensifies

wooden ember
#

yeah i know but the third row seams to start at 1

#

here is a snipit

restive willow
#

is anybody having issues with their bots not loading imgur pics? happens from multiple machines

wooden ember
#

i had to add another value "e" to make all of the values synk up

fervent tree
earnest phoenix
wooden ember
#

it logs "e"

#

however when it is used here so rename the channels it always skips "e"

wheat mesa
#

Are you incrementing i before renaming the channel?

wooden ember
#

nope its all the way at the bottom

#

of the set interval thing

wheat mesa
#

Can you show that snippet of code

earnest phoenix
#

can you show the entire list variable without e

wooden ember
#
    setInterval(() => {
        let server = list[0][i];
        if(!server) {
            i = 0;
            server = list[0];
        }
        
        let channel = bot.channels.cache.get(list[1][i]);
        if(!channel)return console.log("bruh")
        util.status(list[0][i], { port: 25565 }).then(data => {
            if (channel.name === `${list[2][i]}-🟢`) {
                return 
            }
            else {
            channel.edit({ name: `${list[2][i]}-🟢` })
            }
        }).catch((error) => {
            if (channel.name === `${list[2][i+1]}-🔴`) {
            }
            else {
                channel.edit({ name: `${list[2][i+1]}-🔴` })
            }
        })
        i++
    }, 10000);
wooden ember
wheat mesa
#

Channels aren’t guaranteed to be cached

wooden ember
#

i have i+1 in the botom half cuz when a server goes ofline it renames it the wrong name

wheat mesa
#

Your channel probably isn’t cached

earnest phoenix
#

skillissue skill issue

wheat mesa
#

Fetch it instead

wooden ember
#

but wouldnt that just give me an error though?

#

i mean ill try fetch

wheat mesa
#

No, it wouldn’t give an error because you have the if(!channel) return right after

wooden ember
#

but then it should log "bruh"

wheat mesa
#

Try logging the channel

#

I’m on mobile so it formatted weird, wasn’t sure if the console log was on the same line or not

earnest phoenix
#

Why is my context menu not detected? (I sent the commands including this one to discord, but I don't have the context menu available, I don't see it)

wooden ember
#

also i think i added the fetch thing wrong cuz now its saying channel.edit isnt a function do i have to add bot.channels.fetch and then bot.channels.cache.get? or am i being dumb

wheat mesa
#

You have to await fetching it

wooden ember
#

oooh

#

ok

wheat mesa
#

It’s a promise

wooden ember
#

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

wheat mesa
#

Because your setInterval isn’t async

inner helm
#

hi, because my bot page don't shows the bot logo?

wheat mesa
#

Make the function inside your setInterval async

wooden ember
#

wait you can async a set interval?

wheat mesa
#

Yes

solemn latch
#

The function yes

wooden ember
#

fair enounge

solemn latch
#

The interval itself I dont think so

wheat mesa
#

The function it takes as a parameter

wooden ember
#

wait what do you mean

wheat mesa
#

Put an async before these 2 parentheses

#

It’s an arrow function, you just need to make it async

wooden ember
#

ah fair enough

wheat mesa
#

setInterval takes a function as a parameter, and then a number of ms between loops

wooden ember
#

mm it works now but still names the channels starting with the second value and not "e"

wheat mesa
#

Log channel

#

What code are you using?

wooden ember
#

what do you mean

#

the same code i posted

#

but with fetch

wheat mesa
#

Like, what are you using to fetch the channel

#

You have to fetch channels by their id

#

You can’t fetch them by name

wooden ember
#

yeah thats what im doing

#

let channel = await bot.channels.fetch(list[1][i]);

#

and that row in the array is the ids

wheat mesa
#

Try logging channel, see what it logs

wooden ember
#

it logs the right one

wheat mesa
#

Uh

#

Are you sure you’re using the right ID then?

#

Is that the channel that it’s skipping over?

wooden ember
#

yup correct id, literally everything works fine exept without the "e" it gets named to the next value over with is 9b9t instead of 7b7t

#

and im compleatly baffeld by it

wheat mesa
#

does your bot have permissions to edit that channel ¯_(ツ)_/¯

wooden ember
#

yeah it edits the channel just to the wrong name

wheat mesa
#

Oh wait

#

Perhaps you need to await editing the channel

#

It might be going through the rest of your code

wooden ember
#

possibly

wheat mesa
#

Before finishing the edit

wooden ember
#

cuz when the server is offline it renames the channel to what it should be

#

mmm i cant async it cuz it just gives me that error again

wheat mesa
#

?

wooden ember
#

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

wheat mesa
#

Show your code

#

await has to be used within an async function

earnest phoenix
wooden ember
#
let channel = await bot.channels.fetch(list[1][i]);
if(!channel)return console.log("bruh")
util.status(list[0][i], { port: 25565 }).then(data => {
  if (channel.name === `${list[2][i]}-🟢`) {
    return
  }
  else {
    await channel.edit({ name: `${list[2][i]}-🟢` })
  }
}).catch((error) => {
  if (channel.name === `${list[2][i+1]}-🔴`) {
    return
  }
  else {
    channel.edit({ name: `${list[2][i+1]}-🔴` })
  }
})
``` this is it and this is all inside the set interval thing that i just changed to async
wheat mesa
#

Because you’re not using async inside your .then

#

async data =>

wooden ember
#

mmmm

wheat mesa
#

Although I’m not entirely sure why you’re using .then there

#

Since data is unused

#

async/await is much cleaner

#

So that you don’t have 30 nested async functions

wooden ember
#

data is used since i console log the player count i just removed that so i didnt upload a huge paragraph

wheat mesa
#

More recent additions to the JavaScript language are async functions and the await keyword, added in ECMAScript 2017. These features basically act as syntactic sugar on top of promises, making asynchronous code easier to write and to read afterwards. They make async code look more like old-school synchronous code, so they're well worth learning....

wooden ember
#

cuz this is what data is used for

wheat mesa
#

You can still change it to async/await

#

But it’s up to you

earnest phoenix
#

i unstalled unity ide and opened my script with it but vs still doesnt help me to codes

wooden ember
#

yeha i ddi

wheat mesa
#

If you want to have access to data you can just do let data = await howeverYouGotDataBefore()

wooden ember
#

yeah but then thats just extra code though

wheat mesa
#

...no?

#

Nested .then statements get really messy

#

For example if you wanted to await something inside your .then you’d have to change your .then function parameter to be async

#

Or you’d have to nest .then

wooden ember
#

i guess

wheat mesa
#

But it’s up to you

#

Backing up to the original problem though; did you await the channel edits?

wooden ember
#

yeah it didnt change anything

#

but then lemme test somthing

#

cuz it only renames the channel if its not the same as the mc server name and the status

#

nope it just renamed the channel to 7b instead of just "e" since thats the first value

wheat mesa
#

¯_(ツ)_/¯

wooden ember
#

bruh

#

i guess ima just leave the "e" in there and walk away

#

slowly

wheat mesa
#

I’d help more but it’s difficult on mobile

#

And I’ve got an exam in about an hour I need to study for

#

I wish you luck though

wooden ember
#

fair enough

#

i mean this is just a crapy project if slaped together with minimal knowledge of nodejs so idk

#

also why are you helping me go do your studying

#

i aprisiate the help but grades are more important than my random crap

#

also doog luck with your exams though

fervent dock
#

doog luck!

earnest phoenix
#

oh dog he misspelled

wooden ember
#

hahaha ogm

#

omg*

#

im laughing way to hard at this

earnest phoenix
#

discordjs builders supported context menu ?

wooden ember
#

idk

#

do you get an error when inporting it?

earnest phoenix
#

no but i doesn't see context menu but i have imported it to discord:

#

look

earnest phoenix
#

i have search to the discordjs/builders and i see context menu type etc...

earnest phoenix
#

i don't see the App menu

wooden ember
# wheat mesa I wish you luck though

i fixed it (yay)
so what it was is the fact that the feching the channel happens (almost) instantly so it gets the right channel however pinging the server takes a while but since the input was instant it gets the right ip to ping, however because its delayed "i" never actually = 0 cuz when i logged it it only starts with 1 after its pinged the server but before it starts with 0 so that means that the last bit of code is always out of sync with the rest of it meaning that i had to put the "e" there

#

anyway cheers for the help

earnest phoenix
#
Collection(2) [Map] {
  '921094146633109515' => <ref *1> Message {
    channelId: '920705538881372214',
    guildId: '920705538881372211',
    deleted: false,
    id: '921094146633109515',
    createdTimestamp: 1639676357659,
    type: 'CONTEXT_MENU_COMMAND',
    system: false,
    content: '❓ Vous avez **1 minute** pour indiquer la raison du bannissement de ce membre.',
    author: ClientUser {
      id: '920705378977730600',
      bot: true,
      system: false,
      flags: [UserFlags],
      username: 'M・Moon',
      discriminator: '5935',
      avatar: 'af4f502e1ebf71825495ebde68052db7',
      banner: undefined,
      accentColor: undefined,
      verified: true,
      mfaEnabled: false
    },
    pinned: false,
    tts: false,
    nonce: '921094141700472832',
    embeds: [],
    components: [],
    attachments: Collection(0) [Map] {},
    stickers: Collection(0) [Map] {},
    editedTimestamp: null,
    reactions: ReactionManager { message: [Circular *1] },
    mentions: MessageMentions {
      everyone: false,
      users: Collection(0) [Map] {},
      roles: Collection(0) [Map] {},
      _members: null,
      _channels: null,
      crosspostedChannels: Collection(0) [Map] {},
      repliedUser: null
    },
    webhookId: '920705378977730600',
    groupActivityApplication: null,
    applicationId: '920705378977730600',
    activity: null,
    flags: MessageFlags { bitfield: 0 },
    reference: null,
    interaction: {
      id: '921094144812785755',
      type: 'APPLICATION_COMMAND',
      commandName: 'Bannir',
      user: [User]
    }
  },
  '921094153503395851' => <ref *2> Message {
    channelId: '920705538881372214',
    guildId: '920705538881372211',
    deleted: false,
    id: '921094153503395851',
    createdTimestamp: 1639676359297,
    type: 'DEFAULT',
    system: false,
    content: 'qdezefqze',
    author: User {
      id: '605371484046884865',
      bot: false,
      system: false,
      flags: [UserFlags],
      username: 'VinxVinx',
      discriminator: '0001',
    applicationId: null,
    activity: null,
    flags: MessageFlags { bitfield: 0 },
    reference: null,
    interaction: null
  }
}```
#

how can i get only content: 'qdezefqze', please ?

#

in '921094153503395851' => <ref *2> Message {

wooden ember
#

bruh what did you log

boreal iron
boreal iron
#

The collection is “just” a map

#

expects critics

main trench
#

running into a issue. im trying to check for a webhook in a channel and if it can't find it then it makes the webhook however the "if not found then make" part for whatever reason isn't working and sending is being weird.

it logs "undefined" as the name as well

let isweb = message.channel.fetchWebhooks().then(hook => hook.find(webj => webj.name === cusbot.botname))

                if(!isweb) {
                    await message.channel.createWebhook(cusbot.botname, {
                        avatar: cusbot.botavatar,
                        reason: "Required for Goot's custom bot feature"
                    })
                }

                let webhook = message.channel.fetchWebhooks().then(hook => hook.find(webj => webj.name === cusbot.botname))

                console.log(webhook.name)
#

the fetch is only called twice because doing "isweb.send" wouldn't work but "webhook.send" doesn't work either 💀

proven lantern
#

let isweb = message.channel.fetchWebhooks().then(hook => hook.find(webj => webj.name === cusbot.botname))

#

this might be wrong, but im double checking

main trench
#

tim said to try this but ye it may be wrong

proven lantern
#

you need the await

#

just get rid of the .then()s and use await

main trench
#

the .then is needed but yeah should have used await kekw

proven lantern
#

nope

#

then is never needed anymore

#

it just makes your code nested

#

and harder to read

wheat mesa
#

async/await is much much much cleaner

main trench
#

without the .then it wouldnt fetch the webhook by its name

proven lantern
#
let isweb = message.channel.fetchWebhooks().then(hook => hook.find(webj => webj.name === cusbot.botname));

// change to this
const hooks = await message.channel.fetchWebhooks()
const hook = hooks.find(webj => webj.name === cusbot.botname)

main trench
#

Hmm

#

Could work

#
 const hooks = await message.channel.fetchWebhooks()
                const hook = hooks.find(webj => webj.name === cusbot.botname)

                if (!hook) {
                    await message.channel.createWebhook(cusbot.botname, {
                        avatar: cusbot.botavatar,
                        reason: "Required for Goot's custom bot feature"
                    })
                }
                
                hook.send("hi")
#

should work fine?

proven lantern
#

return inside the if

#

or make an else

main trench
#

ah yeah

#

forgor about that

#

Ay works nice thanks

earnest phoenix
#

Why line 11 my bot send me an error Cannot read proprety length of undefined but the table is exists, and the query line 7 it's worked...

#

so my bot have acces for all tables

proven lantern
#

madness is happening there

earnest phoenix
#

what ?

proven lantern
#

without seeing the left side of the code it looks crazy

#

but i see it now

#

i was just confused by it beign cutoff

earnest phoenix
#

ok wait

proven lantern
#

line 10 changes what result is

earnest phoenix
#

ok

proven lantern
#

if you need the result from line 6 and line 11 then you need to give them different names

earnest phoenix
#

i will try

#

D:\Commandes\mmoon\src\events\messageCreate.js:11
if(!result1[0].length) {
^

TypeError: Cannot read property 'length' of undefined

#

same err @proven lantern

#

but the table exists harold

proven lantern
#

i dont see any results in there

earnest phoenix
#

yes my bot will check

#

if(!result[0].length) is for that

#

verify if record exist

proven lantern
#

i'd log what result is

#

may result is []

earnest phoenix
#

undefined

#

when i log result1

proven lantern
#

so it's not getting anything

earnest phoenix
#

Looks like he doesn't access the table

proven lantern
#

idk what contract is, but maybe it returns undefined when there are no records

earnest phoenix
#

Yet all the other tables that I have, he gets there but this one he does not want ...

proven lantern
#

dont you need to put a record in there first

earnest phoenix
#

I have always done this method to check if there is a value in the table with the conditions I gave in the SQL request, it never caused any problems

#

I just tried to make a request in the table to enter some information and it succeeds, but to retrieve the whole, no @proven lantern

#

(with my bot)

proven lantern
#

can you try moving that query into a unit test and playing around with it until it works?

earnest phoenix
#

I found the problem, I replaced the ? in the request by the user ID and it works!

#

thx for your help bro 😉

nocturne dagger
#

message.guild.member(user).ban('Reached 20 points. | Autoban');

Discord API Error: Invalid form body

Anyone know why?

sudden geyser
#

.ban doesn't take a string.

nocturne dagger
#

Ah, haven't used this in a while I guess it changed.

#

Last time I worked on a project was v11

sudden geyser
#

If you end up migrating to v13, note that .member(...) has been removed.

outer zenith
#

what idle do yall js programmers code in, im switching over as i realized discord.py was discontinued 😔

solemn latch
#

vsc is common

delicate zephyr
spark flint
#

unlike nextcord

outer zenith
#

is it any gud

delicate zephyr
#

Try out both

#

see which one works

delicate zephyr
outer zenith
#

does next cord work the same way as discord py

delicate zephyr
#

if you swap out d.py for nextcord its gonna work

#

instantly

delicate zephyr
spark flint
#

same with pycord

outer zenith
#

but does nextcord have slash commands

#

thtats what im lookign for

spark flint
#

i think pycord does

#

nextcord i think does too

delicate zephyr
#

yea

#

idk if it has built-in tho

#

could always check out discord-interactions for that tho

outer zenith
#

it does?

#

i checked pycord

#

but i couldnt find it on nextcord docs

icy marlin
#

@spark flint u left yesterday CC_OyenGun

spark flint
#

left what

icy marlin
spark flint
#

oh that

#

send a ss of the callback code

icy marlin
spark flint
#

alr

#

the callback url

#

needs to be

icy marlin
spark flint
#

as that in discord panel

icy marlin
#

Nope

spark flint
#

oh

icy marlin
#

o.o

spark flint
#

is the url localhost:3000

icy marlin
#

no

spark flint
#

huh

#

this is confusing

icy marlin
#

I can change it to 3000

#

:/

spark flint
#

try that

icy marlin
#

Nope

#

Been on this problem for literally 4 days o.o

earnest phoenix
#

or is there a better way to do this

outer zenith
#

???

#

someone help plz im so confused 🙏

proven lantern
#

I have a code organization question. All my bot commands are in there own separate lambda applications. There is some common code that should be shared between the lambdas that is currently duplicated across the different projects. I'm planning to refactor those common functions into either one layer or many small layers. Layers are basically a way to create modules for lambda applications. My question is should i make a layer for each function or should i create one layer and put all the common functions in there?

quartz kindle
quartz kindle
#

or are they accessed over the web?

proven lantern
outer zenith
proven lantern
#

so they are invoked over the web

#

well inside aws datacenter

quartz kindle
#

well if they are invoked over the web, then that will introduce a latency in all your commands

#

do you need to use await when you call them?

proven lantern
quartz kindle
proven lantern
quartz kindle
proven lantern
#

i'm not 100% sure what is happening under the hood

#

probably a good thing to know to make the decision

quartz kindle
#

if it stays in memory then thats good, if every single function call makes a request, then thats bad

#

its easy to test

#

write some sync code, put it in the layer, then try using it

#

and measure the time it takes to execute

proven lantern
#

i think layers do the same cold start thing, but stay warm for 5 minutes after

#

if i put all the common code into one layer then the cold start will be longer, but there will be less cold starts

quartz kindle
#

still, measuring is the only way to make sure

proven lantern
#

i feel like the default way to think with lambdas is to split everything up into as many small pieces as possible

#

but i'll play with it

#

and i'm reading through some more docs now

#
When you invoke your function using one of the sam local commands, the layers package of your function is downloaded and cached on your local host.```
#

oh nm

#

that's sam local

outer zenith
#

17? i downloaded like 16.4 something

proven lantern
proven lantern
#

are you doing npm install and npm start from the same terminal?

quartz kindle
#

@absrage

outer zenith
#

o thx

#

is it breaking tos if for example

#

u have a command that takes an input and simply outputs it

quartz kindle
#

you can use 16 no problem, discord.js is compatible with 16

#

but your error was showing you had 14

#

did you manage to install 16 or 17?

outer zenith
#

o i havent gotten around to it rn but

#

ill do dat in a sec

#

like if someone uses my command like ~say <something against tos> and then the bot repeats is that allowed

quartz kindle
#

i believe you could get in trouble for that if people report you

outer zenith
#

oh

#

dam

quartz kindle
#

its a tricky thing, its not illegal but potentially dangerous

outer zenith
#

i see

quartz kindle
#

usually you can get away with it if you write a tos for your own bot and have it clearly state that the output of the say command is not your responsibility

outer zenith
#

i see

#

ok thanks

delicate zephyr
proven lantern
#

each lambda is limited to 5 layers so i can't make the layers too small

#

but layers can include other layers so i could still make them small and then have parent layers that includes all the sub layers needed

earnest phoenix
#

I am having css issues.

#

So I am trying to get this into the middle of the screen right.

#

I already have it centered and everything

#


.container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.welcome {
    position: absolute;
    top: 50%;
}
#

and here is my css

#
import './home.css'
function Home() {
    return (
        <>
            <div className="container">
                <div className="welcome">
                    <h1>Hello my name is Aaron Dye</h1>
                </div>
            </div>
        </>
    )
}

export default Home

and react/html

#

Unless I am remembering wrong this should work no?

proven lantern
#
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}```
proven lantern
earnest phoenix
#

Ah

#

adding height worked

#

thanks

proven lantern
# earnest phoenix thanks

np, if home is nested inside another component that is already 100vh then you should move the justify-content: center; to the parent component

lethal trout
#

how to check a channel permissions?
like i want to check if in a channel the SEND_MESSAGES is true or false or null

sudden geyser
#

for who

#

a user who issues a command?

#

with or without slash comamnds?

crystal wigeon
#

does embeds setImage support webp?

#

how can i add fallbacks? if webp doesnt load

#

is it possible?

lyric mountain
#

Convert to png

sly sierra
#

cloudconvert

placid phoenix
#

i saw the beta version of the fast alt switching thing; anyone know when it will come out fully?

earnest phoenix
#

Anyone know of an npmjs module that allows you to save a timer if a bot goes off?

#

@mention for answer please, thx 🙂

whole glen
#

Is this to many?

pale vessel
#

You don't need a module for that, a database is just fine

earnest phoenix
outer zenith
#

:(

#

up to date node js

#

one line of code

pale vessel
#

Because it's a POST request

#

You're supposed to provide a data to send a new message

#

Ah wait

#

Yeah

#

You're using fetch

#

It should be body and you have to stringify the object

cinder patio
#

how about no

spark flint
#

@zinc fable

#

When there are no mods online pain

#

Actually big brain moment

#

@rustic nova

rustic nova
#

@earnest phoenix let's not advertise

spark flint
#

cinder patio
spark flint
#

The mod said don’t advertise

#

You said no

#

Why?

#

@rustic nova

rustic nova
#

-b @earnest phoenix

gilded plankBOT
#

upvote holden for life#2268 was successfully ban

spark flint
#

Ty

earnest phoenix
#

what

boreal iron
earnest phoenix
#

I think you should delete this @rustic nova

rustic nova
#

Yup yup

spark flint
#

I get called that so much

earnest phoenix
#

is there a way to fully hide slash commands or can i just deny permission to run it?

#

no way yet to hide them

#

i'm successfully disabling dev commands but they still show up

#

yeah that's what i thought Sadge

#

if it's a guild command just don't register it

#

yeah

#

that's whack though

#

wish there was a way to fully hide them if users can't access them Sadge

small tangle
#

because of that im making devcommands as guildcommands, so that at least all the other guilds dont have them

cinder patio
#

What's the chakra equivalent of element:hover::before?

#

tried _hover_before but that did not work

cinder patio
#

":hover::before" is the answer

spark flint
#

@earnest phoenix you can define guild_id

#

Then it only appears in that guild

earnest phoenix
#

i'm aware of guild and global commands

#

i was looking to hide commands globally for everyone but devs for example

spark flint
#

Yeah

#

Ah ok

earnest phoenix
#

which hopefully will become a feature

spark flint
#

Yeah hopefully

earnest phoenix
#

i appreciate you for responding though! catKiss

spark flint
#

I need to start looking into using slash commands, they confusing me pain

earnest phoenix
#

they look intimidating, but they are super helpful

#

feel free to reach out with any questions

whole glen
maiden thicket
#

How to make this embed for economy system ?

tulip ledge
#

yeah me too lol

maiden thicket
#

😂

#

it's an embed from a bot's discord server

spark flint
#

same lol

maiden thicket
#

and I'm creating my bot

#

who can help me ?

tulip ledge
#

its just a normal embed

#

nothing special

maiden thicket
tulip ledge
#

markdown

hot star
#

I am getting slow download speed for youtube_dl

#

anyone with same issue?

solemn latch
#

Like slower than the playback of the video?

Iirc youtube caps download speeds for videos to their playback(touch above for buffering) speed.
As there's not a lot of reason for more for a video streaming service

hot star
#

I am using it download audio for music

#

I am having same issue 100 kbps

solemn latch
#

02shrug no idea then

spark flint
hot star
whole glen
#

why does it not send embed?

#

wait i cant send embeds with no embeds

pale vessel
#

Why are you concatenating a string to a class?

whole glen
#

it worked now that i moved the channel metion to own message

wheat mesa
#

You’re sending an embed object to them. You need to specify that it’s an embed

pale vessel
#

Yeah

lyric mountain
#

Also u can chain builder configs instead of repeating the variable each time

boreal iron
#

Or simply write the embed object yourself which results in less code…

lyric mountain
#

Judging by the length of his variable namrs tho...

#

let thisavariablethatssupposedtobeusedformath = 5

maiden thicket
tardy hornet
#

most times I use an interaction in my bot it returns an error, any idea why? (the interaction works)

jaunty dune
#

Hello. Can someone help make me feature?
I have this user and his flags is 393472: