#development

1 messages · Page 1933 of 1

earnest mural
#

then again people can bypass it

#

so i wouldn't really think its a good idea

acoustic whale
#

I made it be before a while ago that let you have more than two channels in a call and I'm thinking of remaking it

#

Anyone know about my API list question?

acoustic whale
#

Anyway where could I find a list of discord APIs implemented since early 2018?

crystal wigeon
#

is there a way i can dockerize discord bot?? djs especially.. how do i shard in that case

#

any docs?

#

thanks

earnest mural
#

probably is one online

woeful pike
crystal wigeon
rocky nymph
#

Hello, can someone fix a bug on my discord bot? the bot is responding to any prefix

spark flint
#

show the code where you define a prefix

rocky nymph
spark flint
rocky nymph
#

give me a sec

spark flint
#

inviting random people to a replit is risky

rocky nymph
peak mason
#

turn || into &&

rocky nymph
rocky nymph
peak mason
#

and remove the ! in front of message.content.startWith

#

wait no

rocky nymph
#

the bot is dying

peak mason
#

if (!message.content.toLowerCase().startsWith(prefix) || message.author.bot) return

#

that

#

mybad

spark flint
#

<br> didn't work

peak mason
#

\n ?

spark flint
#

its html

#

so that wont work

earnest mural
#

://

peak mason
#

show your html

#

and css

spark flint
#

alr gimme a sec

spark flint
#
<form class="mt-2 flex" action="/changeuser" method="post">
                <input type="hidden" id="userid" name="userid" value="<%= user.id %>">
                <h1 class="mt-5">Embed line 1</h1>
                <div class="flex flex-col"></div><input class="p-4 border-t mr-0 border-b border-l text-gray-800 border-gray-200 bg-white" name="username" id="username" placeholder="<%= username %>"/>
                <button class="ml-5 bg-gray-700 hover:bg-gray-800 text-white font-bold py-2 px-4 rounded">Change</button>
</form>   ```
#

I got rid of <br> because it didn't work

peak mason
#

do you use bootstrap ?

spark flint
#

Tailwind

peak mason
#

ok

#

<form class="mt-2 flex" action="/changeuser" method="post">
    <input type="hidden" id="userid" name="userid" value="<%= user.id %>">
    <div class="flex flex-col">
        <h1 class="mt-5">Embed line 1</h1>
        <div>
            <input class="p-4 border-t mr-0 border-b border-l text-gray-800 border-gray-200 bg-white" name="username" id="username" placeholder="<%= username %>"/>
            <button class="ml-5 bg-gray-700 hover:bg-gray-800 text-white font-bold py-2 px-4 rounded">Change</button>  
        </div>
    </div>  
</form>  
#

should work

#

@spark flint

spark flint
#

Just found another fix as well

peak mason
#

you should round the input borders like the button

#

it looks weird

spark flint
#

i am going to

peak mason
lament rock
#

You can use regular expressions when you convert the timestamps to UTC format

spark flint
#

SyntaxError: Missing catch or finally after try in /root/site/views/image.ejs while compiling ejs

acoustic whale
#

Hello, does anyone know where I can fine a list of discord APIs implemented since early 2018?

acoustic whale
#

I'm talking about the APIs like slash commands and stuff

#

I want to know whats been added to discord apis since early 2018

sudden geyser
#

They have a change log page

#

But it's not super descriptive

acoustic whale
#

I don't want every single little change, I just want to find a list of new things

sudden geyser
spark flint
#

yeah

solemn latch
#

is there a catch{} after the closing bracket of the try?

#

it needs to be right after

#

nothing can be between it other than spacing

spark flint
#

it tries to

solemn latch
#

I would put that code in vsc and just double check that closing bracket is the one for the try{}.

spark flint
#

ok

distant cobalt
#
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '../../util/Collection'
Require stack:```

When I do `node .` this error appears.
lament rock
#

You omitted the require stack so that error is incomprehensible to us

distant cobalt
#

Wdym.

#

here's my code ```js
const { Client, Intents } = require('discord.js');
const Discord = require("discord.js")

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

const prefix = '.';

const fs = require('fs');

client.commands = new Discord.Collection();

const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
const command = require(./commands/${file});

client.commands.set(command.name, command);

}

client.once('ready', () => {
console.log('Mmm, good soup.');

client.user.setActivity('customers eat.', { type: "WATCHING" });

});

client.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();

// if(command === 'test'){
//     client.commands.get('test').execute(message, args);
// } 

});

client.login('token');```

lament rock
lament rock
#

but it seems like you're using an older version of Discord.js?

#

or someone did a fucky wucky

distant cobalt
#
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '../../util/Collection'
Require stack:
- /Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/client/actions/MessageDeleteBulk 2.js
- /Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/util/ModuleImporter.js
- /Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/client/actions/ActionsManager.js
- /Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/client/Client.js
- /Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/index.js
- /Users/user/Documents/Dino_and_Soup/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (/Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/client/actions/MessageDeleteBulk 2.js:4:20)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/client/actions/MessageDeleteBulk 2.js',
    '/Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/util/ModuleImporter.js',
    '/Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/client/actions/ActionsManager.js',
    '/Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/client/Client.js',
    '/Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/index.js',
    '/Users/user/Documents/Dino_and_Soup/index.js'
  ]
}```
quartz kindle
#

uninstall it and install it again

eternal osprey
#

ey!

raw nest
#

I have a problem with my HeadlessUI Modal. https://headlessui.dev/react/dialog
So, I map through an array and on every element I render an info table + a button to open the modal. Sometimes everything's working fine and suddenly I can't do anything anymore and I get spammed with Uncaught RangeError: Maximum call stack size exceeded

Completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.

quartz kindle
#

maximum call stack size exceeded means you have an infinite or near-infinite recursive function

#

meaning a function that calls itself, or mulltiple functions that call each other either infinitely or for too long of a time

raw nest
#

hmm but I don't know where...

quartz kindle
#

well neither do i, especially without the full error and the code lol

raw nest
#

wait 1 mom xD I'm on it

jolly notch
raw nest
#

bro... that's just random af...

quartz kindle
raw nest
# quartz kindle whats the full error?

tbh... I don't know but I don't get an error anymore.. I also don't have it anymore. But it could be that it just appears random again.. can I text you if I get it again?? I don't know why... 🤔

limber mica
earnest phoenix
#

Say I was making an rpg bot, and people could mine stuff

{
  "candies": [
    {
      "item": "Cookie",
      "value": "25"
    },
      {
        "item": "Gingerbread",
        "value": "40"
      },
      {
        "item": "Peppermint",
        "value": "65"
      },
      {
        "item": "Truffles",
        "value": "90"
      },
      {
        "item": "Candycane",
        "value": "150"
      }
  ]
}

this is the list of items they can mine and how much they can sell em for.
The thing is, I wanna make it so the higher the value of the item the less likely they will mine it from their mine. Though I don't wanna make it impossible to get any I just wanna make it so they don't mine more of a higher valued item than a lower value since its supposed to be rarer.

#

Any idea how to calculate this or a way of going about doing this?

split hazel
#

so you take all of them into account

#

the higher has a higher percentage the lower has a lower

#

and the percentages add up to 100%

#

this is called a softmax function its often used in machine learning

earnest phoenix
#

Wait what?

#

If the chances are equal then how do you make a higher valued item harder to get a lot of?

quartz kindle
#

if you only have those, you can use a simple if else chain with math random

#

if you have many items tho, it gets too much

earnest phoenix
split hazel
#

one sec i'll show a demo

earnest phoenix
#

So I wanna do something now that would be easier to scale

split hazel
#

but for a simplistic approach use tims 😂

earnest phoenix
#

it is indeed simple but if I go to add more items like tim said it will get to be too much

#

so I wanna do something now that will work no matter if I add more items or not

quartz kindle
#

another way to expand on it would be to add tiers

#

and then use math random on the selected tier

earnest phoenix
#

hm

#

I don't quite understand how that'd work though

#

Like wdym by tiers

quartz kindle
#

for example, lets say you have 3 tiers, common, rare epic

#

if math.random() retruns a value bigger than 0.4 for example, chose common, then get a random item from the common array

#

bigger than 0.4 would be 60% chance

earnest phoenix
#

I see so assign values from 0.1-1 for different tiers?

quartz kindle
#

if math random results a number between 0.1 and 0.4, which would be 30% chance, chose a random item from the rare array

#

yes

#

that way you cant control individual item's chances of obtaining it, but its easy to add/remove items from the list

earnest phoenix
#

does math.random() on its own only go up to 1?

quartz kindle
#

yes

earnest phoenix
#

oh nice

#

I thought it could be any number kek

earnest phoenix
lyric mountain
#

just multiply by any value u want

earnest phoenix
#

if I ever wanna control individual drop chances I can try and do that at a later point

lyric mountain
#

0...1 is enough to achieve any value u want

split hazel
#

looks a bit complicated but yeah probably not suited for your problem

#

in this case the higher value gets the higher percentage but there are ways to reverse that

#

and it works best if you have numerous items

lyric mountain
#

tf

#

just make a normalized array and roll a Math.random()

#

return the last item below rolled value

split hazel
#

or an inefficient way of doing it is to fill an array with the items, amount of a specific item depending on price and then choose a random item from the array

quartz kindle
#

its actually not as inefficient as it seems

#

unless you end up with thousands and thousands of items

earnest phoenix
quartz kindle
#

the definition of Math.random() is that it returns a pseudo-random number between 0 (inclusive) and 1 (exclusive)

#

so no, there is no bias or weighting

split hazel
#

wonder if theres a way to make something like this without having to push tons of duplicate items

earnest phoenix
#

What I am thinking is that if it hardly ever generates a number bigger than 0.4 wouldn't that make it so the rarer items should be gotten then?

quartz kindle
#

it doesnt

earnest phoenix
#

🤔

quartz kindle
#

the number is random between 0 and 1

#

there is no such thing as lower numbers showing up more often

earnest phoenix
#

I see

quartz kindle
#

you are taking the probability and dividing it in sections

#

you know that its 100% chance of being 0-1, so you also know that there is a 50% chance of being > 0.5 and < 0.5

lyric mountain
#

<= 0.5 actually

#

else it'll be 49-51

quartz kindle
#

likewise the chances of being lower than 0.4 are 40%, and the chances of being bigger than 0.4 are 60%

#

you can divide that into sections anyway you wish

earnest phoenix
#

mmmm I see

#

I should pay attention to math more often huh

quartz kindle
#

if you want a 10% chance you can do either < 0.1 or > 0.9, doesnt matter

#

or between 0.4 and 0.5

earnest phoenix
#

oh hello partner

lyric mountain
#

w<

split hazel
#

-b +- sqrt(b^2 - 4ac) / 2a

sudden geyser
earnest phoenix
#

uh

#

sir

#

I failed algebra

#

ranges are not my forte

jolly notch
split hazel
#

very nice equation

lyric mountain
#

you throw a rock, what are the odds of it landing before 2m?

earnest phoenix
#

why do you do this to me

#

I said I failed math

lyric mountain
#

it's easy, you just need to visualize it

#

also math will be fundamental in devving

earnest phoenix
#

Are the votes reset???

lyric mountain
#

probably

earnest phoenix
earnest phoenix
lyric mountain
#

the more you fight math the harder it'll bite u back

earnest phoenix
#

yea ik

earnest phoenix
sudden geyser
#

what numbers sit between 0 and 1

earnest phoenix
#

0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8 and 0.9 I would assume is the correct answer to that

sudden geyser
#

They do fit

#

but the answer is an infinite amount

#

as there's no limit to how many numbers past the decimal point there are

earnest phoenix
#

true

lyric mountain
#
  • infinite might be smaller due to double precision
sudden geyser
#

But we don't like infinite numbers. so if we say 0 < x < 0.5, that's 50% of our numbers

#

still infinite, but now we have a smaller range

split hazel
#

infinite is more of a concept its value doesnt matter:)

#

hold on i have nitro i can send 4k messages

sudden geyser
#

how are you guys good at css

#

how do you bare with css

split hazel
#

i have the same question

lyric mountain
#

devtools

#

nothing is better than throwing random css and seeing what they affect

split hazel
#

even using css frameworks like bootstrap the interactions are still random at times

lyric mountain
#

gotta be honest, I hate bootstrap

sudden geyser
#

same

earnest phoenix
#

bootstrap sucks

#

but I still use it

sudden geyser
#

I've only used Tailwind so far, but I like and don't like it

earnest phoenix
#

I prefer tailwindcss

sudden geyser
#

so I'm back for the search

split hazel
#

same thing with tailwind

lyric mountain
#

like, making a site responsive isn't that hard to justify having to deal with shitty bootstrap classnames

split hazel
#

i only find it quicker to use than css not exactly easier

#

because the underlying css interactions still stand

quartz kindle
#

why tailwind

#

why not asswind or buttwind

earnest phoenix
#

tim

#

I will use timwind soon

split hazel
#

tim

#

i am going to stalk your github for a second

#

tiny discord when

lyric mountain
quartz kindle
#

lmao

quartz kindle
#

but i will work more on it as april aproaches

#

since im gonna transition my bot to it

split hazel
#

😠

#

tim why do you have to have a life

quartz kindle
#

i dont

delicate zephyr
#

lmfao

quartz kindle
#

i procrastinate 24/7

delicate zephyr
#

hi tim

quartz kindle
delicate zephyr
#

how do

quartz kindle
#

do good

#

how do you

delicate zephyr
#

good good

#

and same

earnest phoenix
split hazel
#

i thought you were doing the maximum but you're doing the bare minimum

quartz kindle
#

always

#

thats why im broke af

boreal iron
#

i procrastinate 24/7

#

API release 2052

#

soon ™️

sudden geyser
#

procrastination as a service

spark flint
#

paas

lament rock
#

You pay me to procrastinate a project and I'll take all the blame!

viscid gale
boreal iron
earnest phoenix
#

not true

boreal iron
#

Pretty much!

quartz kindle
#

but yes you can override the prototypes if they are not native code

viscid gale
lyric mountain
#

don't think native code can be messed with

quartz kindle
#

well you can store the reference to it elsehwere and replace/middleware it

#

xD

rugged terrace
#

With button interactions, what’s the best practice with the collector? How long should I keep the collector going on for and is there a way to disable the button once the collector ends?

sudden geyser
#

They can run indefinitely

#

You'll get an interaction create event when a user clicks it

boreal iron
#

Just don’t use a collector at all since you receive an event if an interaction happens

sudden geyser
#

You can disable them as well

boreal iron
#

And yes you can disable the button by updating the message at any time

#

Wtf

sudden geyser
#

I am you.

#

And you are me.

boreal iron
earnest phoenix
#

hot

quartz kindle
#

like fake said, best practice is to avoid using collectors in the first place, unless your use case really warrants it

earnest phoenix
#

collectors?

#

like message and reaction?

rugged terrace
#

Ah ok yea I was tryna change the button after 15s with collector.on(“end”, () => {}); but yea I’ll just try with client.on

#

Thanks for the help

earnest phoenix
#

im asking a serious question tim cause im kinda curious why you say to avoid using em.

quartz kindle
#

collectors exist to fill a very niche use case, which is "waiting for multiple responses"

boreal iron
#

The better question is why I would you use them if you receive an event anyways?

quartz kindle
#

most times using awaitXXX will be a much easier and better option

earnest phoenix
#

true you receive an event

#

but it gets messy doing it in an event

#

if you use it for multiple purposes

quartz kindle
#

and the times where you need to process multiple inputs from the user, most times using the event directly will be better

#

so collectors sit in a very weird place

boreal iron
earnest phoenix
#

mm ig

#

I still prefer to use a collector if I need to collect stuff

boreal iron
#

🤷‍♂️

quartz kindle
#

just please dont use collectors for single response use cases, like question-answer

earnest phoenix
#

oh why not

#

that is the best

quartz kindle
#

it just looks ugly af

#

xD

earnest phoenix
#

I love asking one question and collecting it with a message collector

quartz kindle
#

ugly

earnest phoenix
#

rude

boreal iron
#

This channel is weird

earnest phoenix
#

what did you expect

boreal iron
#

Including the persons in it

earnest phoenix
#

you're in it

boreal iron
earnest phoenix
#

what does that say about you

boreal iron
#

That I should leave and sleep

earnest phoenix
#

yes

quartz kindle
#
let msg = await message.channel.send("question");
let answer = await msg.awaitMessages(options);
await message.channel.send(answer);
``` vs ```js
let msg = await message.channel.send("question");
let collector = msg.createMessageCollector(options);
collector.on("collect", async answer => {
  collector.end();
  await message.channel.send(answer);
});
#

i rest my case

earnest phoenix
#

yea awaitMessages is just better

#

but

#

who would use the message collector

#

if they do ew

pale vessel
#

let msg = await message.channel.send("question");let collector = msg.createMessageCollector(options);collector.on("collect", async answer => {collector.end();await message.channel.send(answer);});

#

beautiful

earnest phoenix
#

yes one line

#

do all your code on one line

quartz kindle
#

i mean, if you want a one liner...

#
(await message.channel.send("question")).channel.createMessageCollector(options).on("collect", message.channel.send)
earnest phoenix
#

not short enough

quartz kindle
#
await message.channel.send(await message.channel.send("question").then(m => m.channel.awaitMessages(options)));
sudden geyser
#
s=message.channel.send;s(await s("question").then(m=>m.channel.awaitMessages(options)))
quartz kindle
#

xD

pale vessel
#

()()())(

earnest phoenix
#

lol

#

what is that again

sudden geyser
#

pain.

quartz kindle
#

a fish

earnest phoenix
#

I like fish

tight scaffold
#

hey so im having a major issue with the description, can someone explain to me why its displaying like this despite me setting the border to 1px.

earnest phoenix
#

tasty tasty

tight scaffold
#

completely unintended

earnest phoenix
#

I think it looks good

tight scaffold
#

its not good, the text overflows and it looks like crap

errant flax
#

keep it that way it looks festive weirdsip

tight scaffold
#
<!DOCTYPE html>
<html>
    <style>
        .css-1332yn0{
            background-color: white !important;
        }
        .css-z4g4qj{
            background-color: white !important;
        }
        .css-1xyu927{
            color: black !important;
        }
        ul {
            list-style: inside;
        }
        *{
            text-align: center;
        }
        ul{
            list-style-type: none;
            padding: 0;
            margin: 0;
        }
        li{
            margin-top: 1px;
        }
    li:first-child {
        margin-top:0;
    }
    </style>
<body>
    <h1>Meet Mewdeko, the bot that is so customizable, and is so powerful, the only thing you'll say is damn.</h6>
        <br>
        <br>
    <h2>Feature List</h2>
    <h3>AFK</h3>
    <ul id="afklist">
        <strong><em>
        <li>Set your afk!</li>
        <li>See which users are afk!</li>
        <li>Limit the length of afk messages in your server!</li>
        <li>Remove afk for one or more users that may be abusing it!</li>
        <li>Set a completely custom embed to use when a user is mentioned!</li>
        <li>Set after how long an afk message deletes itself to reduce clutter in chat!</li>
        <li>Disable the showing of afk messages in certain channels to avoid annoying embeds when you don't need them!</li>
        <li>Set wether afk is disabled when a user types, sends a message, or if its not removed until they or a mod disables it!</li>
        <li>Set after how long a user is considered afk after they set their afk! This affects how the feature above works directly.</li>
        </em></strong>
    </ul>
    
</body>
</html>
#

that says 10 but i set it to 1

#

there

lyric mountain
#

Ye, the margin is there

earnest phoenix
#

yea

tight scaffold
#

now the issue is

earnest phoenix
#

I am confused

#

what is the issue

tight scaffold
#

it is not displaying correctly.

lyric mountain
#

Where is that?

tight scaffold
#

thats my own html file

lyric mountain
#

What abt the other?

tight scaffold
#

the other is topgg preview

lyric mountain
#

Ur structure is messed

quartz kindle
#

you are using global element selectors

lyric mountain
#

You need to put styles inside head

quartz kindle
#

you need to increase their specificity

tight scaffold
#

almost forgot about that part

quartz kindle
#

or create new classes/ids

tight scaffold
#

yeah

#

will try that

earnest phoenix
#

I should probably be doing my own website stuff but im like tim

#

im procrastinating

quartz kindle
#

nice

earnest phoenix
#

xD

quartz kindle
#

im reading manga

sudden geyser
#

which one

quartz kindle
#

berserk

sudden geyser
#

fuck yeah

earnest phoenix
#

berserk?

lyric mountain
#

I recommend claymore after that

quartz kindle
#

already read it

lyric mountain
#

Wish they did follow the manga for the anime version

earnest phoenix
#

I read manhuas

lyric mountain
#

It was perfect until pieta

earnest phoenix
#

I am reading this one manhua that is kinda weird

quartz kindle
#

is it an ero-manhua?

#

xD

earnest phoenix
#

Its an isekai

#

reincarnation type shit

quartz kindle
#

ah, more of those

earnest phoenix
#

but thats not what is weird about it

#

its like a different style entirely

#

ever read martial arts isekais or just anything that has a lot of fighting and death

quartz kindle
#

sure

earnest phoenix
#

well this one is different cause it is like a game

#

it has a "system" that is sort of like a game system

tight scaffold
#

right so it still does it

#

even though im now using my own classes

quartz kindle
#

show cod

#

codfish

tight scaffold
#
<!DOCTYPE html>
<html>
    <style>
        .css-1332yn0{
            background-color: white !important;
        }
        .css-z4g4qj{
            background-color: white !important;
        }
        .css-1xyu927{
            color: black !important;
        }
        .ulist {
            list-style: inside;
            text-align: center;
        }
        .ulist{
            list-style-type: none;
            padding: 0;
            margin: 0;
        }
        .dekolist{
            margin-top: 1px !important;
        }
        .dekoheader{
            text-align: center;
        }
    .dekolist:first-child {
        margin-top:0;
    }
    </style>
<body>
    <h1 class="dekoheader">Meet Mewdeko, the bot that is so customizable, and is so powerful, the only thing you'll say is damn.</h6>
        <br>
        <br>
    <h2 class="dekoheader">Feature List</h2>
    <h3 class="dekoheader">AFK</h3>
    <ul class="ulist">
        <strong><em>
        <li class="dekolist">Set your afk!</li>
        <li class="dekolist">See which users are afk!</li>
        <li class="dekolist">Limit the length of afk messages in your server!</li>
        <li class="dekolist">Remove afk for one or more users that may be abusing it!</li>
        <li class="dekolist">Set a completely custom embed to use when a user is mentioned!</li>
        <li class="dekolist">Set after how long an afk message deletes itself to reduce clutter in chat!</li>
        <li class="dekolist">Disable the showing of afk messages in certain channels to avoid annoying embeds when you don't need them!</li>
        <li class="dekolist">Set wether afk is disabled when a user types, sends a message, or if its not removed until they or a mod disables it!</li>
        <li class="dekolist">Set after how long a user is considered afk after they set their afk! This affects how the feature above works directly.</li>
        </em></strong>
    </ul>
    
</body>
</html>

earnest phoenix
#

nice cod

tight scaffold
#

prolly should name it dekolisitem

quartz kindle
#

you didnt need all that lol

earnest phoenix
#

inb4 you can just use dekolist on ul

tight scaffold
#

well still that should technically work

#

right

#

it has the same issue

quartz kindle
#

you are wrapping them in a strong and em, its possible they are overwriting it

#

but the li's should work

earnest phoenix
#

btw tim what does em even do?

tight scaffold
#

this

earnest phoenix
#

oh its itallics?

tight scaffold
#

ye

#

strong is bold

earnest phoenix
#

ye I knew strong was bold

#

I didn't know em was itallics tho

tight scaffold
#

ye

#

i just learned html yesterday KEKW

quartz kindle
#

<b> does the same thing

earnest phoenix
#

I learned html years ago and I still didn't know what em was

#

😩

tight scaffold
#

rip

#

also one thing that bothered me was topgg only sees <center> for centering images for some reason when not using css

earnest phoenix
#

should I read manhua or work on my portfolio site

#

🤔

sudden geyser
#

which one in particular

earnest phoenix
#

which manhua?

sudden geyser
#

ye

earnest phoenix
#

I don't remember the name as its in korean

#

but it is an isekai martial arts one

tight scaffold
#

so yeah making my own classes dont work

quartz kindle
#

how can you not know the name of what you're reading

earnest phoenix
#

do I look like i can speak korean

tight scaffold
#

same exact issue

quartz kindle
#

dont you read english translations?

earnest phoenix
#

the title is in korean

quartz kindle
#

wtf

earnest phoenix
#

but the actual manhua is in english

quartz kindle
#

where are you reading it?

#

who the f doesnt translate titles

tight scaffold
#

guess im on my own then.

earnest phoenix
#

I am using an android apk called mangazone

quartz kindle
#

ah

earnest phoenix
pale vessel
#

Ahaha yes let's just translate the whole work except the title

earnest phoenix
#

but they could care less about a title

pale vessel
#

👍

earnest phoenix
#

who needs to know the title

quartz kindle
earnest phoenix
#

idc about the title I care about the story

tight scaffold
#

rn its not updated but sec

quartz kindle
#

try saving it anyway

#

its possible the preview is shit

earnest phoenix
#

ima just not do work and read cya bois

tight scaffold
#

lemme just save my old stuff rq

sudden geyser
#

if you want to read something good how about song of the long march

earnest phoenix
#

just remove all css from your bot page

#

ez

#

no css looks the best

tight scaffold
#

@quartz kindle saved it

earnest phoenix
#

I think it looks fine tbh

tight scaffold
#

yeah no it does the same thing without it

quartz kindle
earnest phoenix
#

then again thats just me being lazy

tight scaffold
#

Ok. This has been legit pissing me off for a while. Why the fuck is it off centered

earnest phoenix
#

its mobile

quartz kindle
#

excessive margins and/or padding

earnest phoenix
#

everything on mobile sucks

tight scaffold
#

i dont even pad lol

#

well, only on the list

#

but everything else is still off center

quartz kindle
#

if you want to center stuff, using ul-li is not really ideal

tight scaffold
#

then?

quartz kindle
#

since those are made for bullet lists

#

which are inherently left aligned

tight scaffold
#

just do regular text?

quartz kindle
#

if you check dev tools, you'll see they have this css overriding yours:

.css-18r9pyf li {
    -webkit-margin-start: 1em;
    margin-inline-start: 1em;
}
white anvil
#

i'm pretty sure it's not centered because the actual div where your long description lives is not centered on mobile

#

i have noticed this even with my basic ass markdown description

tight scaffold
#

should i just use regular text then

quartz kindle
#

if i remove those 1em above, then it becomes centered for me

#

but its better to just use regular <p>s

tight scaffold
quartz kindle
#

try it

tight scaffold
#

alight

quartz kindle
#

you can always use dev tools in mobile mode for this kind of testing

tight scaffold
#

hmm neat

#

i think thats an issue on their end and needs to be fixed lol

quartz kindle
#

regardless, you can still fix it yourself

tight scaffold
#

ok i have no idea how to fic it

#

lol

#

why in the world are there two different class names for the buttons on mobile and desktop

earnest phoenix
#

const user = interaction.options.getMember('approveduser')

const accepted = new MessageEmbed()
//.setAuthor(interaction.guild.name, interaction.guild.iconURL())
.setDescription(`Your break was accepted!`)
.setFooter(`Enjoy your time off!`)

user.send({ emebds: [accepted] })

const logging = new MessageEmmbed()
//.setAuthor(interaction.member.tag, interaction.member.displayAvatarURL({ dynamic:true }))
.setDescription(`<@${user.id}>'s Break was Accepted by; <@${interaction.member.id}> | \`${interaction.member.id}\` for ${time} with reason: **${reason}** `)


    }  else {
  const staff = new MessageEmbed()
.setAuthor(interaction.guild.name, interaction.guild.iconURL())
.setDescription(`You need to have the <@&916913372291801128> role. `)

  interaction.reply({ ephemeral: true, embeds: [staff] })
  }



    }```

That gives me a : `Error; Can not send a empty message` `o-o`
pale vessel
#

You misspelled embeds

earnest phoenix
#

🤣 oml

#

Ty lmfao

tight scaffold
#

can someone tell me whats wrong here before i lose my god damn mind, preview shows literally nothing and the site doesnt show the box

#
<!DOCTYPE html>
<html>
    <style>
        .css-1332yn0{
            background-color: white !important;
        }
        .css-1aro6ms{
            background-color: white !important;
        }
        .css-z4g4qj{
            background-color: white !important;
        }
        .css-1xyu927{
            color: black !important;
        }

        @media (max-width: 1000px) {

        }
        .dekolist{
            text-align: center;
        }
        .dekotitle{
            text-align: center;
        }
        .mewdekodescription{
            width: 700px;
            background: #f5f5f5;
            padding: 10px;
            border: 5px solid #a7a409;
            border-radius: 15px;
            -moz-border-radius: 15px;
              text-align: center;
              margin: auto;
        }
    </style>
<body>
    <h2 class="dekotitle">Meet Mewdeko, the bot that is so customizable, and is so powerful, the only thing you'll say is damn.</h2>
        <br>
        <br>
            </head><body><br>
            <center><img alt="mewdekobanner" src="https://media.discordapp.net/attachments/915770282579484693/916912959169634334/monogatari-series-background-hd-1600x900-108924.jpg"></center>
            <br>
            <div class="mewdekodescription">
            <h1>Mewdeko</h1>
            <p><br><i>A bot that combines customization, moderation and others for nothing out of your wallet!</i>
            <br>
            <br> - Extremely customizable suggestions and afk system -
            <br> - Absolute control over how afk works and is used -
            <br> - Has a 99.9% uptime so you can rest assure your server is safe -
            <br> - Powerful moderation commands, in fact there are two separate warn systems! -
            <br> - Powerful tools to help against raids, and cleanup after raids -
            <br> - All features are completely free to use, no limitations! -
            <br><br></p></div><p></p>
</body>
</html>
#

wait i tyink i know

#

ok this is actually pissing me off can someone tell me whats wrong here

#

preview shows nothing and the regular site skips over my css for mewdekodescription

#

my head is actually hurting from this because this fucking works as a normal html file

#

anyone

earnest phoenix
#

patience is key young Padawan

gentle condor
#

hello iam trying to get a embed description content in discord py can someone send a simple code how to do it ,I searched it in Google i found i had to use message.embeds but couldn't find out how to get the description

earnest phoenix
gentle condor
#

yes

earnest phoenix
#

and I would assume you'd wanna get the first embed in the list which then returns an Embed

gentle condor
#

how to get the embed's description

earnest phoenix
#

which you can then grab the description

gentle condor
#

yes

#

how to?

earnest phoenix
#

idk python so idk how you get something from a list

#

that is something you gotta google

gentle condor
#

it sends a embed object

earnest phoenix
#

if you can get the embed from the list then you can also get the description somehow.

earnest phoenix
#

yea okay so it works how I thought I just wasn't too sure

rose warren
rancid python
#

anybody here know how to make a spotify bot in python? im trying to make it so i can play, skip, pause, change volume, and show currently playing song on my spotify account through discord

earnest mural
#

there are tutorials online you can find

hollow topaz
#

si papi

#

xd

distant torrent
#

Hi

#

How to make our own bot ?

distant torrent
#

No one's replying me

#

It's ok patience is the key to nothing

#

Lol

rose warren
distant torrent
slender thistle
#

patience is the key to nothing
With your attitude it is, that's what I can definitely say

rose warren
distant torrent
distant torrent
slender thistle
#

Sure thing

distant torrent
distant torrent
slender thistle
#

Anyhoo, a bot is a program running constantly and in case of Discord, listening to events and responding them with HTTP requests

rose warren
#

Nope. 99% of developers here started with Google too so I'm sure you can manage it.

slender thistle
#

That implies that in order to create one, you need to be able to program it

rose warren
#

There are links to useful resources in the pins here.

slender thistle
#

because here alot of verified developer are there
Sorry to disappoint you, but half of this community is immature kids

distant torrent
slender thistle
#

Only 15% of it is actually mature developer who can assist you

distant torrent
slender thistle
#

My English is struggling

#

My implication is more about their mental age, not physical

distant torrent
#

Community lead t-iara

slender thistle
#

But I digress. You'll need to learn a programming language and download necessary tools for it

distant torrent
slender thistle
#

... which also means learning it and following its syntax

sudden geyser
#

Sorry to disappoint you, but half of this community is immature kids
That's part of the chime of this server. Most developers here are inexperienced and gradually becoming better developers.

distant torrent
rose warren
#

You need to learn to code first. Check the pins for more resources.

slender thistle
slender thistle
sudden geyser
#

If you really want some language to start at, consider JavaScript or Python

rose warren
#

If you're starting out I'd recommend javascript just because it's the most documented lib you can find the most help for.

slender thistle
#

Those are considered the simplest out of all of them usually

distant torrent
#

I guess I need to search in yt to learn

hot slate
#

hi

sudden geyser
#

why hello there

distant torrent
#

Umm

#

?

tight scaffold
rose warren
rustic nova
#

Are you closing it aswell?

tight scaffold
#

752236274261426212

#

i am

rose warren
#

Seems to be rendering for me

tight scaffold
#

thats the old one, reload

#

im trying to rewrite it

rose warren
#

The preview shows the codeblock

tight scaffold
#

the preview renders html

#

like it did for my old one

#

on top of that, the body html and doctype tags are there on my old html description

#

and it renders proper

#

so either im blind and missing something or theres something else wrong

rose warren
#

Well that's bad practice and the stray closing </head> tag you had in your code was probably the reason for it breaking.

tight scaffold
#

now it doesnt render at all, preview shows nothing and it doesnt render my css on the site itself

#

on top of the fact that it works absolutely fine as a separate html document

#

preview renders nothing

#

what the regular site shows

#

what its supposed to look like

#

so everything at the moment points to the site being at fault

#

this is the third time ive said this

earnest phoenix
#
 if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role');
                           ^

TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.```

What does this mean?
#

not a User nor a Role.

Yeah, but I double and tripple checked my work, it always gives me this.

tight scaffold
#

it means that whatever you put is not a user or a role

earnest phoenix
#

It doesn't tell me where I put something wrong at tho

tight scaffold
#

giving just part of the code does nothing for us either

earnest phoenix
tight scaffold
#

might wanna refresh your token.

earnest phoenix
#

Alr done lol

tight scaffold
#

where exactly does this throw

earnest phoenix
#

Wym?

#
    "guild": "916911511157481513",
    "log": "917048604131221585",
    "prefix": "!",
    "roles": {
        "bot": "917046932596219956",
        "mod": ["916913101528522823"]
    },
    "ticketCategory": "917048587836338247",
    "dmUsers": true,
    "deleteTicketOnLeave": true
}```
That's the settings.
tight scaffold
#

well where does it throw? did you try breakpointing to find where?

#

ah

earnest phoenix
#

All those are right, I checked em over 4 times.

tight scaffold
#

hmm

#

can you add a breakpoint around where it gets the role and tell me where exactly it fails

earnest phoenix
#

A "breakpoint"?

tight scaffold
#

oh god what are you using to code

earnest phoenix
#

Replit lmfao

#

I use that to test before I transfer to my VPS.

pearl trail
#

also, isn't it supposed to be the id

feral aspen
#

How to switch a specific user from a voice chat to another?

tight scaffold
earnest phoenix
tight scaffold
pearl trail
#

the id

#

guild.roles.everyone.id, guild.roles.everyone returns Role

solemn jolt
#

hello i need a host for wesite that support discord bot

solemn latch
#

Any vps provider

solemn latch
#

Library?

tight scaffold
#

seriously tho can someone help me with my html issue

pearl trail
tight scaffold
#

ye

#

sec lemme send my html file

tight scaffold
#

it renders absolutely fine standalone

solemn latch
#

You dont need html or body tags on topgg, also note your css cannot be the same between standalone and topgg

quartz kindle
#

^

solemn latch
#

As topgg has its own css

tight scaffold
#

yeah my old code has html and body tags and it works fine

quartz kindle
#

yes it will work, but its not correct

pearl trail
tight scaffold
#

this renders fine

pearl trail
#

also that's not the ID too

quartz kindle
#

its not semantically correct to have multiple heads and bodies in the same page

#

even if it doesnt actually break anything

earnest phoenix
tight scaffold
#

true, however why would it not render at all in the preview and break in the site itself

pearl trail
#

if config.roles.mod is already the id, just put it there

#

instead of fetching again

quartz kindle
#

the preview is broken, i've had the same experience with it, so dont rely on it

#

but the page itself should work

#

i've never had anything not work there

#

its just a matter of finding the right way to do it

tight scaffold
#

well thing is im using my own classes

#

so there shouldnt be an issue

quartz kindle
#

you can check with the dev tools

#

is your page updated?

tight scaffold
#

yeah

#

ok so i check dev tools and the style stuff just dissapears

#

wtf?

quartz kindle
#

yea the style is being removed for some reason

tight scaffold
#

i dont see why either

#

im dead sure its something on top.gg side

quartz kindle
#

did you remove the html body and doctype?

tight scaffold
#

especially since removing the html tag and bidy tag etc causes it to render as plaintext

pearl trail
#

how about removing <!DOCTYPE html> <html> </html>

tight scaffold
#

ok so preview is unreliable

#

kek

#

that did it

quartz kindle
#

yes preview is unreliable

pearl trail
#

ah

tight scaffold
#

however preview showed it as plaintext

pearl trail
#

that code works here

tight scaffold
#

also

pearl trail
solemn jolt
tight scaffold
#

for whatever <center> works, and doing style:text-align center doesnt work for images

#

why is that?

#

seems like something is outdated

solemn latch
#

does text align work on images 🤔

#

thought it only aligned text

pearl trail
#

yeah

tight scaffold
#

yeah, if used in a parent element

quartz kindle
#

text-align:center works on inline elements

solemn latch
#

ah

quartz kindle
#

so you have to declare the image as inline-block

#

and have it contained in a div with 100% width

solemn latch
#

css skills op, i have a ton i swear! /s

tight scaffold
#

ah

#

also, why in the world does it render weird as hell on mobile

#

its off center and its ticking me off lol

#

Uh oh.

pearl trail
#

image width 100vw try

#

or 100%

quartz kindle
#

horizontal padding and fixed widths can make it overflow

tight scaffold
#

ok i just had to change the width of the description to auto

#

however its still off center and its messing me up

#

this happens with text too

pearl trail
#

you can do display flex and both align-items + justify-content to center on a parent div if you want

#

that's literally how i center things lmao

earnest phoenix
tight scaffold
#

rem?

#

ah

earnest phoenix
#

so it changes based on screen size

tight scaffold
#

im using headers

#

lol

earnest phoenix
#

also don't use h1-6 for font size

tight scaffold
#

headings

crisp crescent
#

Night

feral aspen
#

React.JS or Bootstrap.

sudden geyser
#

but you can use react with bootstrap

earnest phoenix
#

Yes I was about to say

cinder patio
#

those 2 are different things

quartz kindle
#

its like saying windows vs firefox

feral aspen
#

I think I'll go with Bootstrap since web hosting these days don't support Node.JS unless you host it on a Virtual Private Server.

quartz kindle
#

look at me, im highlighting cool words, im so smart

earnest phoenix
#

my brain is trying and failing to comprehend what you just said

quartz kindle
#

:^)

feral aspen
#

Never intended that?

quartz kindle
#

just talk like a normal person xD

feral aspen
earnest phoenix
#

bootstrap is a css framework

feral aspen
#

I'm aware.

earnest phoenix
feral aspen
#

What's wrong with using bold text?

#

I never think using it makes me smarter.

earnest phoenix
#

the text itself is wrong

feral aspen
#

I use it to highlight words, only.

feral aspen
earnest phoenix
#
  1. bootstrap and react are different things
  2. almost every web host supports nodejs
  3. a vps is just a web host?????
quartz kindle
#

he means shared hosting

#

like cpanel php etc

#

many of them now have built in support for nodejs, but not all

feral aspen
earnest phoenix
#

did he mention specifically that tho

feral aspen
#

Okay, I should've been more specific.

#

😂

earnest phoenix
feral aspen
#

Although, isn't what cPanel powers most.

feral aspen
earnest phoenix
#

YESSSS

feral aspen
#

Interesting, that's an animal. lmao

quartz kindle
#

theres lots of them here in brazil

earnest phoenix
#

tim went to brazil

feral aspen
#

We have no idea what they are, I'm scared to tell my biology teacher and she goes null/undefined.

earnest phoenix
#

boohoo

#

ight imma head out bye weeb

feral aspen
#

Pce.

quartz kindle
#

yes im no longer an EU boi

#

rip fast internet

feral aspen
#

Who's waiting for the events of Top.GG?

#

.. cause I'm not. lmao

quartz kindle
#

not me

sudden geyser
#

not me

#

especially not the meme event

earnest phoenix
#

Error:

  const hash = this.hashes.get(`${request.method}:${routeID.bucketRoute}`) ?? `Global(${request.method}:${routeID.bucketRoute})`;
                                                                                  ^

SyntaxError: Unexpected token '?'

client.once('ready', () => {
    console.log('Ready!');
    const CLIENT_ID = client.user.id;
    const rest = new REST({
        version: '9'
    }).setToken(token);
    (async () => {
        try {
            if (!715157246480482324) {
              
                await rest.put(
                    Routes.applicationGuildCommands(CLIENT_ID, '916911511157481513'), {
                        body: commands
                    },
                );
                console.log('Successfully registered application commands for development guild');
            }
        } catch (error) {
            if (error) console.error(error);
        }
    })})```
marble zephyr
#

Heya,

I have a little Issue with my Slash Commands in Discord.js. When i add new Slash Commands and restart the bot it doesnt add the slash commands to the existing guilds unless reauthorized. Is there a way to sort of "fix" that?

earnest phoenix
marble zephyr
sudden geyser
#

Is there a way to sort of "fix" that?
@marble zephyr you can create the command as a guild command rather than global

#

So it appears immediately.

marble zephyr
#

thx

quaint rampart
#

anyone have a santa api? i remember seeing one last year but i forgot it (just an api that places a santa hat over an avatar)

quartz kindle
boreal iron
cinder patio
#

Also what do you need react for? Because bootstrap and react do not have the same purpose

#

if you're making a static site then I wouldn't really recommend react

lyric mountain
#

Like, iirc to install react u use npm

cinder patio
#

on the server you don't need node.js

#

during development yes

#

Actually you don't need it during development either, you can get react via a CDN

modest maple
#

omg omg

#

@zinc fable for you!

eternal osprey
#

ow do i check the client ping in djs v12?

#

is that property removed?

earnest phoenix
earnest phoenix
earnest phoenix
#

v12 😔

bitter adder
#

whats the code for watching users in kotlin

#

i cant find it

#

🥲

earnest phoenix
sudden geyser
#

Like an activity status?

#

And what library are you using? JDA? Kord?

earnest phoenix
#

feel free to reply to this with a roast for my bot's roast command, you will receive credit as a contributor

bitter adder
crystal void
#

Hello

worn plume
#

How to I get my bot to work?

cinder patio
#

idk

earnest phoenix
#
const auditlog = async function({
  guild,
  type     
}) {
  const fetchedLogs = await guild.fetchAuditLogs({
        limit: 1,
        type: type,
    });

    const log = fetchedLogs.entries.first();

    if (!log)  throw new TypeError(`Something went wrong!`);

    return log;
}
//----------------------------------------------\\
client.on("guildBanAdd", async(guild, user) => {
  
  const log = await auditlog({
    guild: guild,
    type: "GUILD_BAN_ADD"
  })
#

guild.fetchAuditLogs is not a function

sudden geyser
#

The first parameter of guildBanAdd is a GuildBan instance.

#

Not a guild

#

You could use guild.guild.fetchAuditLogs(...)

#

There's no second parameter by the way, so specifying user is redundant.

sharp kayak
#

.

proven lantern
#

my components just started giving me 400 errors

#

is it too big?

earnest mural
proven lantern
#

maybe it grew too much

#

that should be a 413 error

#

or something like that

#

i'm getting a 400 error

earnest phoenix
#

Does anyone have the Disocrd.js Docs link for creating slash commands in your main index.js file?

#

Instead of Command Handling.

proven lantern
#

why is my request being so bad?

jolly notch
jolly notch
earnest phoenix
#

Ah alr

proven lantern
#

it's too big

#

too many options under one dropdown thingy

split hazel
#

sorry

proven lantern
#

it was actually one description that was 101 characters long

#

that was fun to find

boreal iron
#

Yee had that issue in the beginning, too

#

Couldn’t figure it out until I read the fucking error message

proven lantern
#

i was too lazy to expand the error message

boreal iron
#

Yeah KEKW

proven lantern
#

JSON.stringify

#

too difficult

lament rock
#

Who does that

proven lantern
#

when is this going to be released

#

i want it now

exotic vigil
#

Greetings, do you help with bot command issues?

lyric mountain
#

airspeed of a binladen swallow

spark flint
#

Lol

exotic vigil
#
C:\Users\Administrator\Desktop\Kral-Botlar\Kral-VampirK1-BOT\node_modules\discord.js\src\rest\RequestHandler.js:154
      throw new DiscordAPIError(request.path, data, request.method, res.status);
            ^

DiscordAPIError: Missing Permissions
    at RequestHandler.execute (C:\Users\Administrator\Desktop\Kral-Botlar\Kral-VampirK1-BOT\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (C:\Users\Administrator\Desktop\Kral-Botlar\Kral-VampirK1-BOT\node_modules\discord.js\src\rest\RequestHandler.js:39:14) {
  method: 'post',
  path: '/channels/907998176131297301/messages',
  code: 50013,
  httpStatus: 403
}
lyric mountain
#

missing perm

sudden geyser
#

aka you don't have permission to do something

proven lantern
#

posting a message to a channel channels/907998176131297301/messages

exotic vigil
#

Error getting the bot from the server roles, so is there a command like message.channel.send(error?

#

Sorry my English is bad.

lyric mountain
#

you don't have SEND_MESSAGES perm

proven lantern
#

the channel might be locked down

lyric mountain
#

you need to check if you can send before sending

proven lantern
#

or just send the message and handle the error

#

the lazy way

sudden geyser
#

or some not listed

lyric mountain
exotic vigil
#

Thanks, the bot is giving an error because its role is not taken over.
So, is it possible for the bot to log an error accordingly?

proven lantern
#

errors go into the void

exotic vigil
#

The bot is constantly rebooting. But what I want is for it not to reset.

#

If it logs the error to a specific channel and there is no reset. If I set the command accordingly, will the problem be solved?

lyric mountain
#

handle the error

#

.catch(() => {})

#

since u can't send "Not enough perms" message

earnest phoenix
#

Just use if () for perms

lyric mountain
#

are you even reading what we are saying?

earnest phoenix
exotic vigil
#

Reading.,

lyric mountain
#

and for god's sake, indent your code

#

the complete lack of any formatting is disturbing

earnest phoenix
boreal iron
#

Guild commands?!

earnest phoenix
#

😎

earnest phoenix
boreal iron
#

It’s an event so associated to servers

lyric mountain
earnest phoenix
earnest phoenix
boreal iron
#

Whatever you wanna do sounds weird

exotic vigil
#

Thanks for the help guys, have a nice day.

earnest phoenix
lyric mountain
#

use guild slashes

earnest phoenix
#

Got any good docs links?

#

what lib are you using

#

uh no shush

#

that is disgusting

#

Discord.js?

#

Yeah^

#

if else sucks tho if you are doing multiple things

#

It's with a messageCreate thing tho.

#

just use switch/case ez

#

It's a ModMail bot with Slash Commands.

#

switch/case > if/else

#

Why not just use if else?

#

else if

#

Idek how to use that.

#

switch/case ignores everything and goes straight to the correct result based on the expression

#

whereas if/else will go through every single if statement until it finds the right one

#

so switch/case is generally faster

#

unless it's been changed

solemn latch
#

just a note, its like microseconds faster unless you have thousands of if statements

#

so whatever works for you is generally better

earnest phoenix
#

I mean yea woo, but on a larger scale I would prefer to use the faster method

#

but maybe my thinking is wrong

#

Imma stick to else if

solemn latch
earnest phoenix
#

plus switch/case just looks better

earnest phoenix
#

;c

#

From the explanation I got switch/case will ignore everything that is false to the expression given and just go for the correct one.

#

I might be phrasing what I am trying to say wrong tho

#

so :p

sudden geyser
#

don't optimize what the compiler should be optimizing

earnest phoenix
#

I like using switch/case

sudden geyser
#

not you specifically

earnest phoenix
#

o

#

ok

sudden geyser
#

just optimization in general

solemn latch
#

I like switch case too, but imo its preference in these types of cases

earnest phoenix
#

honestly when it comes down to it

rustic nova
#

I smell a yanderedev comment incoming

earnest phoenix
#

Can we get back to my question please? o-o

#

if/else vs switch case is a matter of preference in some cases

#

but it comes to a point where switch/case is just obv better cause it looks better

#

kthxbai

#

Enough with this else if, switch/case, case closed.

earnest phoenix
#

o-o

#

someone really likes their switch/case's

#

its a dev conversation

earnest phoenix
#

which is what this channel is for

#

yanderedev made a good game

#

it just sucks it was made poorly

sudden geyser
#

it's so good we haven't been able to play it yet

earnest phoenix
#

lmao

#

I mean like

#

the concept behind the game is good

#

it just sucks it was made by that dood

#

someone who took one unity class and was like ye game time

#

didn't he basically do everything in unity's Update method

#

which updates stuff every 1s

#

He made a game that no matter how good your pc was

#

instant 5fps

#

No idea I didn't see the full code

#

I just noticed a lot of stuff was being done in the update method that makes no sense to update every 1s

#

there is a video on the code breakdown on yt

boreal iron
#

Not responding to an interaction will also cause an interaction failed warning

earnest phoenix
earnest phoenix
#

I have my bot already in prefix commands but I want to replace it all with Slash Commands, with that being said, it has args such as ; const args = interaction.content.slice(prefix.length).trim().split(/ +/g); //splitting args in which I need to convert to a slash command.

boreal iron
#

You will have to register it as guild command then

earnest phoenix
#

Yep, which is what I want.

#

Not sure how to do that.

#
else {
                await rest.put(
                    Routes.applicationGuildCommands(CLIENT_ID, TEST_GUILD_ID), {
                        body: commands
                    },
                );
                console.log('Successfully registered application commands for development guild');
            }```
#

I could do something like that.

#

using @discordjs/rest

#

What I am confused about is using a optionSring within a intial file.

boreal iron
#

There are no arguments parsed by the content of slash commands

#

The event doesn’t include a message content

#

You have to define each parameter you want - they are called options or components

#

Also don’t copy that guide trash

#

client.application.commands is the base to work with

#

There are the associated methods to register/update or remove commands

wheat mesa
#

Idk why they have that in the guide when they literally made helper methods for working with the rest client

earnest phoenix
#

Well, my bot is a ModMail. So they need to message the bot too.

boreal iron
boreal iron
earnest phoenix
#

Well, can I send my code as is with just normal commands, and can you not do it for me ofc, but give me a rough guess on what I need to add?

boreal iron
#

If an event is fired you can check it’s options to get what the user entered as paramters

boreal iron
earnest phoenix
#

So none of my code will work as is?

#

That's the entire thing rn.

#

Works with commands.

#

So confused if I need to add a ``interactionCreateinsidemessageCreate` orrr?

#

You have to build a completely new commands handler, dealing with registering/updating the slash commands and with your command files
For someone who knows djs v13 very easy, for someone who is just learning, sounds like a far strech.

boreal iron
#

At least the basic structure of your command files doesn’t change.
Slash commands also have a name and a description.
Anything’s else is optional like options the user needs to use etc

#

I can’t download or open txt files on mobile, just to say

earnest phoenix
#

Well, on my other bot, I use @discordjs/rest, so couldn't I use this:

module.exports = {
    data: new SlashCommandBuilder()
        .setName('ping')
        .setDescription('Replies with Pong!'),
    async execute(interaction, message) {```

and then add options there accordingly in a index.js file?
#

`} else if(slashCommand === blah blah blaj)`{
module.exports = {
    data: new SlashCommandBuilder()
        .setName('ping')
        .setDescription('Replies with Pong!'),
    async execute(interaction, message) {
#

or something as such?

#

Okay that's 2 commands in 1 command, I am confusing myself o-o

#

you are confusing us as well

boreal iron
earnest phoenix
#

if you are too lazy to make your own slash command handler you can always look at frameworks or smth

earnest phoenix
earnest phoenix
#

It's not that I can't make one, given the correct resources and guides I could, but there is no basis or grounds that show me how.

#

Documentation

#

There are the djs docs