#development

1 messages ยท Page 2046 of 1

wheat mesa
#

For an average (if not sub-average at this point) computer

lyric mountain
#

the entire story of ram is insane

#

you zap a piece of rock to make it store information

#

the entire thing about using a fuckin rock as storage is nuts

wheat mesa
#

And billions of transistors in a tiny cpu

#

That are all capable of performing calculations trillions of times faster than any human could

lyric mountain
#

I mean, human brain IS fast, we just make too many if checks do decide what to do

wheat mesa
#

Lol

#

Too advanced of a neural network, gotta pump through all of the different nodes before getting the best output

#

Fun fact, doing a basic arithmetic operation in registers takes about as long as it takes light to travel across a laptop monitor

quartz kindle
wheat mesa
#

if(true) return;

#

Actually no

quartz kindle
#

my doSomethingProductive() has too many conditions and ends up returning false if they dont all pass

lyric mountain
#
boolean isEven(int n) {
  if (!isEven(n)) return false;
  else if (isEven(n)) return true;

  return true;
}
wheat mesa
#
if(dayOfWeek == "Monday") {
    doAbsolutelyFuckingNothing();
} else {
    doAbsolutelyFuckingNothing();
}
radiant kraken
#

wow such a nice community

#

prob as nice as the language itself

wheat mesa
#

The rust community is genuinely great from what Iโ€™ve seen

#

Most loved language and most loving community

split hazel
#

the brain fucking sucks

wheat mesa
#

C++ support servers are like โ€œno fuck you do this complex production level bullshit and I will NOT explain to you whyโ€

split hazel
#

my toaster can do more computations than that

split hazel
#

ego is the single handed downfall of every c++ developer

radiant kraken
#

i never asked something for a development help in a support server, i always stick to googling

lyric mountain
#

7.5 bytes per second

#

not even an entire int

radiant kraken
split hazel
#

we're just short of being able to process a 64 bit integer in a second

#

32 bit ints we're fine though

radiant kraken
split hazel
quartz kindle
#

the human brain is a giga-bloated AI system

#

it can do a lot of things but its slow af

lyric mountain
split hazel
quartz kindle
#

latency sucks

lyric mountain
#

wait

#

that's literally half a signed int

split hazel
#

also do you know guys you rarely ever forget anything

#

you just cant recall it

lyric mountain
#

idk, I don't remember

split hazel
#

people experiencing near death experiences or dreams can recall things like faces and minute details that happened years and years ago

#

in childhood even

lyric mountain
#

I still remember my first nightmare

#

I was like 4yo

split hazel
#

for some reason some shit just sticks and is easily recallable and sometimes its not

#

psychology makes me have a midlife crisis

#

also most of you probably already know but trauma experiences usually stick forever because its how mammals evolved to remember and avoid danger

#

for example i have trauma from trying to read C source code

#

that has prevented me from reading anymore ever again

lyric mountain
#

I also remember my first english word

#

I was playing with hotwheels, word was "fast"

split hazel
#

bruh

#

also nah bro the rust community ๐Ÿ’€

#

bro just checked in on me

#

he asked "is it working for you?"

#

that never happens

#

im bout to cry

quartz kindle
#

T_T

radiant kraken
split hazel
#

thats different ๐Ÿ˜ 

lyric mountain
#

also it was proved that brain flushes useless structures and optimizes data during sleep

#

which replays all the data again and again during it

split hazel
#

thats the spirit

#

comparing the brain to a computer

#

does the brain have structs by any chance

#

how is memory stored

lyric mountain
#

that's why you sometimes go to sleep and awakens fully understanding what u were doing

split hazel
#

it must be inefficient because the brain must be storing an awful amount of dynamic data

#

not much static data

lyric mountain
#

and why sleeping solve more bugs than SO

split hazel
#

speaking of optimizing my database will soon have a query which optimizes the table

lyric mountain
#

dangerous stuff

split hazel
#

not as dangerous as the #dark-arts channel in the rust server

#

where people talk about unsafe code

radiant kraken
#

unsafe ๐Ÿ˜ฑ

#

do they really despise unsafe that much

lyric mountain
#

imagine ur making self-optimizing queries when suddenly

UPDATE users SET name = "Alex" WHERE name = name
split hazel
#

and yeah that sucks doesnt it

split hazel
#

they bully you for writing unsafe code

#

even tho in some cases its much better and easier than writing the "safe" alternative

#

ive noticed a massive flaw with rust which is why i wont replace c++ with it

#

for example i was wondering how would you read the contents of a file into a struct

#

people suggested using some library to do that

lyric mountain
#

u can use reflection

split hazel
#

it causes slowdowns and makes you use an external library tho

lyric mountain
#

reflection is internal

split hazel
#

when you can just write unsafe code to do it in one line

split hazel
radiant kraken
#

when i started Rust i added lots of unsafe blocks

#

because i came from a C background

spark flint
#

anyone know how to do vue transitions

radiant kraken
#

i hated working with strings, i would rather go on a char-by-char level sdForgor

split hazel
#

i feel you ๐Ÿ’€

#

strings are slow

spark flint
#
<template>
    <transition name="fade" mode="out-in">
      <router-view />
    </transition>
</template>

<style>
.fade-enter-active,
.fade-leave-active {
  transition-duration: 0.3s;
  transition-property: opacity;
  transition-timing-function: ease;
}

.fade-enter,
.fade-leave-active {
  opacity: 0
}
</style>```
split hazel
#

dynamically allocated on the heap, copied from a char pointer, class initialization etc

#

especially since you wont be using the features a string offers anyways

radiant kraken
#

true

#

i'm not really a fan of heap

split hazel
#

oh and it pains me having to allocate a TEMPORARY BUFFER on the heap instead of the stack ๐Ÿ˜ญ

#

for some reason my gcc allows it

#

but when passing the pointer to certain functions it segfaults

#

i know assembly it is 100% possible to allocate a dynamically sized buffer on the stack without problems

#

but it does get a little complicated when releasing the stack frame though

spark flint
#

how can I make those next to each other in tailwind

#

like the text centered

#

fixed

sacred aurora
#

is there an event when user get a timeout?

wheat mesa
#

rust is so satisfying to write but also really complex for my small brain

pale vessel
#

you'd have to save the old member object and compare though

upper moss
#

hey, i am trying to convert month to season in JS

let date = new Date();
let season;
let month = date.getMonth()+1;
if (3 <= month <= 5) {
  season = 'Spring';
}
else if (6 <= month <= 8) {
  season = 'Summer';
}
else if (9 <= month <= 11) {
  season = 'Fall';
} 
else {
  season = 'Winter';
}
console.log(month);
console.log(season);

but the output is something else

6
Spring

it should be summer..

wheat mesa
#

Are you certain that's exactly what you're doing

#

Oh wait

#

I'm blind

#

Yeah there's no such thing as if(3 <= month <= 5)

#

You'd have to write all of those like if(3 <= month && month <= 5)

craggy pine
#

I was wondering that. I didnt wana speak bec I didn't know if it existed or not.

wheat mesa
#

I have personally never seen a language that syntax works in. Not a js specific thing, just so you know :p

wheat mesa
#

python is a toy language can't change my mind

sharp geyser
#

take that baack!

#

python > *

dry imp
#

i always use the syntax that waffle showed even when im using python

slender thistle
#

Python is nice

sharp geyser
dry imp
#

but i do use and & or TE_TrollFace

sharp geyser
#

andor

#

it is a combination of the two

wheat mesa
#

That is logically impossible

#

I should make an esolang with terrible syntax but itโ€™s fast as fuck just to troll

rustic nova
#

fast as shit

wheat mesa
#

TrollAsm

#

Just 1:1 asm but with long and confusing names

#

Make eax jmp :troll:

boreal iron
#

python is a toy language can't change my mind

#

The Texan boy is about right, gentlemen

dry imp
#

you use php so ur opinion doesnt matter fake

boreal iron
#

You donโ€™t wanna compare something crap like py with php

#

Soo shhh and listen to the older people

sick agate
#

php is like nice but pain
py is pain sometimes

sharp geyser
raw sigil
#
  client.on("ready", () => {
    const channel = client.channels.get("961664136591335514");
    if (!channel) return console.error("Channel dosent exist!");
    channel.join().then(connection => {
      console.log("I am join on voice channel.");
    }).catch(e => {
      console.error(e);
    });
  });
#

it's correct this code

#

?

dry imp
radiant kraken
#

it's like py but faster

carmine talon
#

good morning guys, im trying to do a simple command for a discord bot and i can't do it, idk why this is giving me this error, this is my first creation :c
It's saying that cant find the module but i identified it well

earnest phoenix
#
Instead change the require of index.js in /home/runner/Zylem-slashcommand/SlashCommands/Utility/cat.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/home/runner/Zylem-slashcommand/SlashCommands/Utility/cat.js:2:15)
    at /home/runner/Zylem-slashcommand/Structures/slashCommand.js:16:34
    at Array.forEach (<anonymous>)
    at module.exports (/home/runner/Zylem-slashcommand/Structures/slashCommand.js:12:40)
    at Object.<anonymous> (/home/runner/Zylem-slashcommand/index.js:50:37)
    at /nix/store/13sxby28d6x7r98ggggp0gk5al4hdj9f-prybar-nodejs-0.0.0-7d40edb/prybar_assets/nodejs/module-context-hook.js:190:18
    at Module.mod._compile (/nix/store/13sxby28d6x7r98ggggp0gk5al4hdj9f-prybar-nodejs-0.0.0-7d40edb/prybar_assets/nodejs/module-context-hook.js:137:14)
    at Object.Module._extensions..js (/nix/store/13sxby28d6x7r98ggggp0gk5al4hdj9f-prybar-nodejs-0.0.0-7d40edb/prybar_assets/nodejs/module-context-hook.js:140:12)
    at runModule (/nix/store/13sxby28d6x7r98ggggp0gk5al4hdj9f-prybar-nodejs-0.0.0-7d40edb/prybar_assets/nodejs/module-context-hook.js:197:5)
    at Object.<anonymous> (/tmp/prybar-nodejs-935376718.js:200:5) {
  code: 'ERR_REQUIRE_ESM'
}```
#

why this error happen

#
const { MessageEmbed, CommandInteraction, Client, MessageAttachment  } = require("discord.js")
const fetch = require('node-fetch')
const apikey = "Not Yours"
module.exports = {
    name: "cat",
    description: "show some cat images",

    /**
     * 
     * @param {Client} client 
     * @param {CommandInteraction} interaction 
     */

    run: async (client, interaction) => {
    const fetch = await fetch(`https://api.thecatapi.com/v1/images/search`, {
      method: "GET",
      headers: {"x-api-key": apikey}
      
    })
      const jsonresp = await response.json()
      return await jsonresp[0].url;
      const embed = new MessageEmbed()
      .setColor("WHITE")
      .setTitle("Meow ๐Ÿฑ")
      embed.setImage(await fetch() )
      await interaction.reply({embeds: [embed]})
    }
}```
#

this the code

worldly yoke
#

or downgrade your node-fetch to 2.6.1

earnest phoenix
earnest phoenix
#

._.

worldly yoke
upper moss
#

@earnest phoenix

split hazel
fossil bone
#

anyone can guide me to a tutorial or something to how to have my bot do this?

#

it simplifiyes things for the users

boreal iron
#

Well, you're looking at slash commands

fossil bone
#

yea ik

boreal iron
#

While number_of_messages is just a command option

#

optional or required

fossil bone
#

i'm talking about that box where u put int() the number of messages u want to delete

#

i done the same trick with my bot but that box, it puzzled me to how to do it

boreal iron
#

You need to add that command option to the slash command, means you have to register that command with this option, either itโ€™s optional or required

#

Since the command already exists you just have to edit the already registered slash command

#

Doing so by doing an API request

fossil bone
#

oh i see

#

i'll check that out ty

boreal iron
#

Then the option is permanently shown in your discord client

#

"attached" to this command

earnest phoenix
#

probot use it to make you specify the number of messages

#

when you specify the messages

#

there is a code

#

like

#
interaction.channel.bulkDelete(number)
boreal iron
#

Regarding the fact itโ€™s a number I would assume the option is an integer and not a string

earnest phoenix
#
const { MessageEmbed, CommandInteraction, Client } = require("discord.js")

module.exports = {
    name: "clear",
    description: "clear number of message",
    options: [
      {
      name: "number_of_messages",
      description: "number of messages to delete",
      type: "INTEGER",
      required: true
      }
    ],

    /**
     * 
     * @param {Client} client 
     * @param {CommandInteraction} interaction 
     */

    run: async (client, interaction) => {
        let integer = interaction.options.getInteger(`number_of_messages`)
        if(!interaction.member.permissions.has(`MANAGE_CHANNELS`))return interaction.reply({content: `You don't have \`managechannels\` permissions :x:`, ephemeral: true});
      if(integer > 100) return interaction.reply({content: `**:x: | You can't delete more than 100 message**`, ephemeral: true})
    await interaction.channel.bulkDelete(integer)
    await interaction.reply({content: `SuccesFully Deleted \`${integer}\` :white_check_mark:`, ephemeral: true}) 
    }
}
rocky dagger
#

i keep getting this error here DiscordAPIError: Invalid Form Body 45.options[0].type: This field is required 45.options[1].type: This field is required 45.options[2].type: This field is required 45.options[3].type: This field is required with this code, can some1 help me?

lyric mountain
#

add the type for your fields

pine nova
#

types missing fr

#

๐Ÿ’€

boreal iron
#

Obviously itโ€™s a subcommand which IS the type

#

I feel like heโ€™s using an outdated djs version

lyric mountain
#

js devs when they need to specify a data type: topggLikeThis

split hazel
#

lmao

boreal iron
#

Noโ€ฆ the issue is that stupid and useless builder tool

boreal iron
#

So much fucking text and this ugly style instead of writing a simple object yourself

boreal iron
boreal iron
#

Your djs version might be outdated

rocky dagger
#

djs: 13.6.0

#

and builders ^0.6.0

boreal iron
#

addSubCommand() should already set the type to 1 aka. as SUB_COMMAND

#

Check if djs is stupid enough to require to define the sub command via the setType() method

rocky dagger
#

TypeError: (intermediate value).setName(...).setDescription(...).addSubcommand(...).setType is not a function

boreal iron
#

Yeah as I assumed the method already sets the right type

#

Please log data

#

I wanna see the structure after calling the builder tool

rocky dagger
#

the bot crashes upon launch

boreal iron
#

That doesnโ€™t prevent you from logging it?!

#

If it does you might wanna catch and handle your errors then

#

Somewhere youโ€™re calling the slash command data in your code

#

Log data before calling/executing it

#

If nothing works try getting rid of the builder bullshit

#

Define the slash command yourself (written as object)

rocky dagger
boreal iron
#

Wtf

#

Itโ€™s indeed missing the type on the subcommand

#

Thatโ€™s the reason you never use that trash builder tools

#

Use this structure and write the object yourself

#

{
name: "settings",
description: "โ€ฆ",
options:
[
{
name: "subcmd1",
description: "โ€ฆ",
type: 1
},
{
name: "subcmd2",
description: "โ€ฆ",
type: 1
}
]
}

#

My goshโ€ฆ

#

How can people write code on mobile

rocky dagger
#

so something like this?

boreal iron
#

Correct

#

It needs to be the data

#

If you wanna keep your structure

#

Registering/updating the slash command

rocky dagger
#
D:\programering\Coding\MyBots\discord.js\DJS v13\ark helper\src\events\ready.js:31
                client.commands.set(command.data.name, command);
                                                 ^

TypeError: Cannot read properties of undefined (reading 'name')
    at Object.execute (D:\programering\Coding\MyBots\discord.js\DJS v13\ark helper\src\events\ready.js:31:50)```
boreal iron
#

data: { โ€ฆ }

#

Keep your structure

#

Replace the SlashCommandBuilder() constructor with the object

sacred aurora
rocky dagger
boreal iron
#

np

earnest phoenix
boreal iron
#

still dunno why the builder doesn't set a type

#

but it's crap as I said

earnest phoenix
#

builder isn't really good

#

the normal handler is better

boreal iron
#

wtf you're talking about

#

there's no "handler"

#

you either use the builder or write the object yourself as the API expects

boreal iron
split hazel
#

how about you build some b

#

you know what nevermind

dry imp
boreal iron
#

Quiet py noooooooob

#

pepowot ๐Ÿ”ซ

dry imp
#

stay mad php noob

boreal iron
#

@.@

boreal iron
carmine talon
#

I dont get it i have everything good , the code should work, the error is when i do the command -s ping on discord server, i would apreciate some help

lyric mountain
#

you didn't install module commands

#

or actually, you're trying to use a module require instead of a file require

wheat mesa
#

This is most definitely not the right way to do a command handler

lyric mountain
#

I didn't event know require has 2 params

#

what is the other, callback?

wheat mesa
#

Idk, probably

dry imp
radiant kraken
#

it should work fine like normal ordinary python

#

it's basically python but JIT compiled instead of interpreted from byte-code

jovial sparrow
#

s

spark flint
#

HAPPY LEZ WRATH MONTH

radiant kraken
#

this is so cursed

#

imagine a class with overlapping members

split hazel
#

skull?

stable eagle
#

I want to draw png images on my canvas, but for some reason my canvas image is empty, this is what I have so far:

const puzzles = doPuzzle(4);
        const question = puzzles[0];
        const answer = puzzles[1];
        const puzzleSvgs = puzzles[2].map(p => p.svg);
        console.log(puzzles[2].map(p => p.data));
    // from the svgs, using the canvas to draw the puzzles
    const canvas = Canvas.createCanvas(1000, 500);
    const context = canvas.getContext('2d');
    // add the puzzles to the canvas
    puzzleSvgs.forEach(async (svg, i) => {
       await nodeHtmlToImage({
            output: `./${i}image.png`,
            html: svg
          });
        const puzzleImage = await readFile(`./${i}image.png`);
        const puzzle = new Canvas.Image();
        puzzle.src = Buffer.from(puzzleImage);
        context.drawImage(puzzle, 20, 20 + (i * 200));
      
    });
   const attachment = new MessageAttachment(canvas.toBuffer('image/png'), 'puzzle.png');
    interaction.reply({files: [attachment]});

Am I doing something wrong?

quartz kindle
#

use a for loop

stable eagle
quartz kindle
#

it clearly doesnt work if its empty

lyric mountain
#

classic skit

hidden gorge
#

TypeError: Cannot read property 'members' of undefined
    at /home/runner/Bot-with-Advanced-Dashboard-6/dashboard/dashboard.js:640:25
    at Layer.handle [as handle_request] (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/route.js:137:13)
    at checkAuth (/home/runner/Bot-with-Advanced-Dashboard-6/dashboard/dashboard.js:138:41)
    at Layer.handle [as handle_request] (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/layer.js:95:5)
    at /home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/index.js:335:12)
    at next (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/index.js:275:10)
    at urlencodedParser (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/body-parser/lib/types/urlencoded.js:91:7)
    at Layer.handle [as handle_request] (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/index.js:317:13)
    at /home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/index.js:335:12)
    at next (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/index.js:275:10)
    at jsonParser (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/body-parser/lib/types/json.js:110:7)
    at Layer.handle [as handle_request] (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/index.js:317:13)
    at /home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/index.js:335:12)
    at next (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/express/lib/router/index.js:275:10)
    at SessionStrategy.strategy.pass (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/passport/lib/middleware/authenticate.js:343:9)
    at /home/runner/Bot-with-Advanced-Dashboard-6/node_modules/passport/lib/strategies/session.js:69:12
    at pass (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/passport/lib/authenticator.js:337:31)
    at deserialized (/home/runner/Bot-with-Advanced-Dashboard-6/node_modules/passport/lib/authenticator.js:349:7)
    at /home/runner/Bot-with-Advanced-Dashboard-6/dashboard/dashboard.js:76:45```
#

sending code in a sec

#

line causing error ```js

let user = server.members.cache.has(req.user.id);```

#

how can i fix this?

ancient nova
#

can you get heartbeat ping of a discord bot without editing an embed

#

also what?

#

HTTPError [AbortError]: The user aborted a request.

quartz kindle
#

which means the client did not find that guild id in its cache

quartz kindle
#

editing a message is for obtianing the rest latency

#

not the heartbeat ping

hidden gorge
#

well server is defined

quartz kindle
#
const server = client.guilds.cache.get('939926270240768000');
let user = server.members.cache.has(req.user.id);
``` either that id is wrong, or the client is not ready
hidden gorge
#

k

#

ok itโ€™s not the id

#

i fixed it

ancient nova
#

so any way to obtain latency without editing a message?

quartz kindle
#

you need to make some type of operation to measure

#

can be sending a message or can be something else

proven lantern
#

discord only send member to the interaction handler if the command was invoked from a guild channel right? not DMs

lyric mountain
#

member doesn't exist without a guild yes

#

Member = User โˆช Guild

ember zephyr
#

should I replace all the "targets" with smth like:

target : {
  none(...) {
    return [...]
  }
  // ...
}
lyric mountain
#

what is that, discord.json?

pine nova
#

lmfao

ancient nova
#

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

if (message.member.roles.cache.has(finalCheck.id || message.member.roles.cache.find(role => role.name === finalCheck)?.id || finalCheck))
    return true;
else 
    return false;
#

this again?

spark flint
#

finalCheck?.id

ancient nova
#

why does it matter? isn't it suppoed to switch to the next if ID is undefined

boreal iron
#

If finalCheck is undefined then a property id can not exist

#

There arenโ€™t any properties of undefined or null

#

Therefore the error

ancient nova
#

I see

boreal iron
#

The optional chaining basically results in a check if finalCheck is null or undefined in the first place and if not it will continue with the property check

#

If one of the chain is null or undefined the condition is false

ancient nova
#

then how am I supposed to check that?

#

finalCheck.id is by mention, the second check is by name and the third is by plain ID

boreal iron
#

Exactly how bun wrote

spark flint
#

finalCheck?.id

#

literally that

#

one extra character to the code

ancient nova
#

won't that make the entire condition false like u said?

boreal iron
#

Yes

#

But you got multiple conditions separated by an OR operator

spark flint
#

why do you store the data more consistently

#

store just the ID

ancient nova
#

I can't

spark flint
#

why not?

ancient nova
#

I suppose I could but the code wouldn't be as nice, let me walk you through my code

boreal iron
#

Also when using optional chaining you can get rid of your last condition

#

Another check if finalCheck isnโ€™t null or undefined is not required

#

Itโ€™s already covered

ancient nova
#
const modRole = message.settings.modRole; //<-- user setting, can be either ID, mention or name of the role

// then I have a bunch of code changing the whatever user selected to the role variable
let finalCheck;
// then in the end this is the variable

// And I use this piece of code to check if the user has the role and based on that I state whether it should be true or false
if (message.member.roles.cache.has(finalCheck.id || message.member.roles.cache.find(role => role.name === finalCheck)?.id || finalCheck))
    return true;
else 
    return false;
#

also I have it in a if statement, because I want to expand on this later

boreal iron
#

Now add optional chaining for your first condition and remove the third one entirely

quartz kindle
#

if finalCheck is undefined, then all other conditions will also fail by default

#

so why not just add a if(!finalCheck) return false before that if even starts?

#

not to mention that if could be structured better, but it doesnt really metter

simple stump
#

In Chakra-UI, how can I append a function in native JavaScript? For example:

fetch(config.api_server + "/search", requestOptions).then(async res => {
  let json = await res.json();
  json.map((item, index) => {
    console.log(item);
    document.appendChild(<Feature title={item.title} link={item.id} path={item.path} views={item.views} likes={item.likes} cover={item.cover} />);
  })
}).catch(err => {
  console.error(err);
});

function Feature({ title, link, views, likes, cover }) {
  return (
    ...
  );
}

The request is called whenever the Search button is clicked. So basically:

<Button h='1.75rem' size='sm' onClick={(() => {
  ...
})} />
boreal iron
#

Might be missing a )

#

Idk on mobile

ancient nova
cinder patio
#

not related to your issue at all

simple stump
#

Yeah I just realized that. Whoops

cinder patio
#

Also why are you using React AND the document API like this??

#

That's not a good idea

#

at all

#

are you asking how to do that in react?

simple stump
#

I'm attempting to code in Express since I'm not used to React yet lmao. Originally I would just use jQuery to append data, but since React isn't like that it's a bit confusing for me

cinder patio
#
function Component() {
  const [features, setFeatures] = useState([]);

  // when you want to add a feature...
  setFeatures([...features, new_feature]);

  // To show all features...
  {features}
}
simple stump
simple stump
cinder patio
#

if not it's even cleaner

#
function Component() {
  const [data, setData] = useState([]);

  // when you want to add data...
  setFeatures([...data, new_data]);

  // To show all features...
  {data.map(feature => <Feature>...</Feature>)}
}
simple stump
#

๐Ÿ‘ I'll mess around with that. Thanks

crystal wigeon
#

anyone know how to animate svg sprites as svg? and not on canvas

quartz kindle
#

in html or where?

#

svg can be animated via css

#

some versions of svg also include built in animate tags

crystal wigeon
#

yeah in html, mm alr thanks

lyric mountain
#

project idea: .gitignore viewer (like regexr for regex, break down and explains what you've written)

#

I'm fuckin tired of gitignoring the wrong files and just noticing when it's too late

wheat mesa
#

Iโ€™m tired of accidentally forgetting to gitignore some files like auto genned Intellij garbage

lyric mountain
#

I'm actually surprised nobody made a visual gitignore builder yet

#

like, with explanations of what each line is doing

split hazel
#

make one

lyric mountain
#

I would, if I wasn't busy with language migration (job) and bot rewrite (personal)

split hazel
#

do it

ancient nova
#

in this line if (cmd && blacklistedGuildArray.includes(message.guild.id) && message.channel.type !== "DM") it says that the ID is undefined while trying to execute the command in DMs

#

any idea how to avoid that?

earnest phoenix
#

/*

ancient nova
#

?

earnest phoenix
#

Check for the channel type and assure it's not a DM channel before accessing the <Message>.guild property

ancient nova
earnest phoenix
#

Yes

ancient nova
#

oh

#

@earnest phoenix do you have any idea why setActivity dissapears after some time?

#

and if possible how to keep it alive?

earnest phoenix
lyric mountain
earnest phoenix
#

You can try setting the activity again on an interval to prevent it from disappearing

ancient nova
earnest phoenix
#

That's not true, and it depends on the task

ancient nova
#
const logger = require("../modules/logger.js");
const { getSettings } = require("../modules/functions.js");

const activities = [
    "hating {{showServers}}/100 servers.",
    "hating you.",
    "hating the {{prefix}}help command.",
];

module.exports = async client => {
    setInterval(() => {
        const updateStatus = activities[Math.floor(Math.random() * (activities.length - 1) + 1)];
        client.user.setActivity(updateStatus.replace("{{showServers}}", client.guilds.cache.size).replace("{{prefix}}", "-"), { type: "COMPETING" });
    }, 10000);
};
#

will that affect the performance?

earnest phoenix
#

I wouldn't recommend setting the activity every 10 seconds

ancient nova
#

then how long?

lyric mountain
#

5 minutes or so?

wheat mesa
#

About every 2 minutes is an acceptable interval for bots I believe

#

But I think 5 minutes is a good balance

hidden gorge
#

does setting the activity interval to 10 seconds cause bot performance to be down graded?

#

im just wondering

austere surge
#

might get ratelimited

wheat mesa
#

API abuse, discord doesnโ€™t like you spamming activity change requests

hidden gorge
#

ok thanks

#

whatโ€™s the minimum seconds to stop rate limits and abuse?

wheat mesa
#

I think the limit is 5 changes per 30 or 20 seconds, but itโ€™s not a good idea to change it that much anyways. Unnecessary

hidden gorge
#

so 300000?

wheat mesa
#

What?

hidden gorge
#

like 30000 for the interval

wheat mesa
#

The least I would ever change it is once every 45 seconds

solemn latch
#

topgg's general recommendation is 120 seconds

wheat mesa
#

So sure

hidden gorge
wheat mesa
#

120 seconds

hidden gorge
#

i have itโ€™s set to 10000

wheat mesa
#

Too frequent

#

Way too frequent

hidden gorge
#

12000?

wheat mesa
#

(Assuming 10000 is in milliseconds)

hidden gorge
#

yes

#

so 120 seconds in milliseconds is

#

idk

wheat mesa
#

Take 120, and multiply it by a thousand. Thatโ€™s your seconds in milliseconds

hidden gorge
#

120000

wheat mesa
#

There you go

hidden gorge
#

so how long is that in minutes?

#

2 minutes ok

wheat mesa
#

Yes, 120 seconds is two minutes

#

Lol

boreal iron
radiant kraken
simple stump
#

EDIT: cloudflare ๐Ÿ’€

austere surge
#

cloudflare

#

howd you fix your issue

simple stump
#

chhanging the firewalls

austere surge
#

ok

simple stump
#

I'm super confused. When I set up my React server and use nginx to open the port (https://anify.club is my website), the config is for some reason set to localhost:3060. Locally it's set to https://api.anify.club, but on the main website it's set to localhost. I have no clue why and it's extremely infuriating because for the past hour I've been trying to fix cors, because for some random reason it isn't working (I keep getting the cors blocked error even though I have cors enabled, but apparently it's a CloudFlare issue??). Is this an issue with React, or an issue with browser cookies?

earnest phoenix
#
 collector.on("collect", (collect) => {
        let(i.user.id === interaction.user.id)
        if(i.user.id != interaction.user.id){
          interaction.reply({content: `:x: | **This Menu in not for you**`, ephemeral: true})
        }```
will this code work or nope ?
split hazel
#

I don't know will it?

earnest phoenix
potent tiger
#

Guys. How i can add to my bot costum emojis?

#

I dont know how to do that

rose warren
#

How to use a custom emoji in a command response?

earnest phoenix
# potent tiger Guys. How i can add to my bot costum emojis?

steps
1- Make a new server and add your bot in the server
2- upload the emojis you want
3- do \[the emoji]
4- it will apper like the emoji name and an id
5- copy it
6- go to your bot code

client.on("message", msg => {
if(msg.content === "ping"){
msg.reply(`[paste the emoji text here] pong !!! `)
}
})
potent tiger
#

aaaaa

#

xD

#

Thanks

earnest phoenix
#

:verifyblue:

potent tiger
#

Ah

#

Thats my server emoji

#

๐Ÿ˜„

earnest phoenix
potent tiger
#

Yeah

#

Thanks

earnest phoenix
#

np

boreal iron
#

a: is been used for animated emojis only

potent tiger
#

oooo

#

OKay

#

๐Ÿ˜„

boreal iron
#

See general message formatting

potent tiger
#

O

#

I see

#

Thanks

sacred aurora
#

so.. it is possible to do something when a user is getting a timeout, but how can i get the reason for the timeout?

sacred aurora
#

nvm solved by fetching the audit log

fossil bone
#

why does this error message shows sometimes?

acoustic reef
#

what error message

#

are you typing it out manually or something

fossil bone
#

well it's a long error

acoustic reef
#

o

fossil bone
#

the code works perfectly fine

#

i close the bot server for a while

acoustic reef
#

what are you hosting the bot on

fossil bone
#

when i try to get it back up

#

this shows

acoustic reef
#

yeah but what are you hosting the bot on

fossil bone
#

it wait like an hour or two then the error disappears and everythings back to normal

fossil bone
acoustic reef
#

go to shell and type out kill 1

#

then try to restart the bot

fossil bone
#

ok

#

so it's a package issue from replit?

#

it works !!?

#

i didn't get it

acoustic reef
#

so is your issue fixed

fossil bone
#

yea but it still returns

acoustic reef
#

still returns the error?

fossil bone
#

i need to understand the issue in order to prevent that error from occuring

acoustic reef
#

since repl it uses shared IP addresses, someone else or maybe you flooded the Discord API (or thatโ€™s what I think what happened)

#

if you want to host your bot, maybe donโ€™t use replโ€ฆ

fossil bone
#

i see

#

makes sense

fossil bone
acoustic reef
#

you can probably get a cheap VPS somewhere

#

kill 1 is only a temporary solution, so yes as I said I recommend you donโ€™t use repl for Discord bots

fossil bone
#

i see thank you, that was really helpfull

pine nova
#

replit

#

๐Ÿ’€

fossil bone
#

i was excited when i got replit to be my bots free server host but i'll consider moving to vps

visual goblet
#

replit isn't a good idea for it

dry imp
# fossil bone i didn't get it

Replit is container-based so doing kill 1 is basically killing your current container and moving your repl to a new container with a new ip, hence the method works

earnest phoenix
#

eventEmitter
eventEmitter2
in nodejs
I would like to bind all events of them to
eventEmitter3
is there a method for it?

lyric mountain
#

Wasn't there a joke about the comical amount of eventemitters available on npm?

shrewd shell
#

I changed the name of my discord bot. How do I edit the bot's name from top.gg?

royal portal
#

refresh data

shrewd shell
royal portal
#

go to your bot page and press refresh data

shrewd shell
#

ok

shrewd shell
royal portal
shrewd shell
proven lantern
#

is there a way to do conditional returns without an if statement or assigning the result of the function to a variable?

const a1 = () => {
    if (a2() === 2) {
        return a2();    
    }
    return 1;
}
const a2 = () => {
    return 2;
}```

something like this ```js
const b1 = () => {
    b2() === 2 ? return b2() : undefined;
    return 1;
}
const b2 = () => {
    return 2;
}

or this ```js
const f1 = () => {
f2();
// do other stuff
return 1;
}

const f2 = () => {

// force invoking function to return 2
force return 2;

}

lyric mountain
#

what?

#

you can pretty much to return f2() ?? 1 no?

wheat mesa
#

You could do return b2() === 2 ? b2() : 1

#

For ternary return expressions the return needs to be in front of the ternary expression

proven lantern
#

i only want it to return if the function wants it to return

wheat mesa
#

Then no I donโ€™t think you can

proven lantern
#

i want other logic to run

#

dang

lyric mountain
#

just return null from the second function and use ??

wheat mesa
#

I think the idea is that if a function returns a certain value, he wants it to return in another function, but if it doesnโ€™t return that value, he wants it to continue running the calling function

lyric mountain
#

or if ur using java:

if (f2() instanceof Integer i) {
  return i;
}

return 1;
wheat mesa
#

If you want it on one line, you could do ```
if(b2() === 2) return b2();

// other stuff here```

proven lantern
lyric mountain
#

that is pretty much "built-in" no?

proven lantern
#
const a1 = () => {
    const thing = a2();
    if (thing === true) {
        return "found thing";
    }
    // keep searching
    return 1;
}```
#

there should be a shorthand for this

wheat mesa
#

Just if(a2()) return โ€œfound thingโ€

#

Iโ€™d say thatโ€™s pretty shorthand already

proven lantern
#
const a1 = () => {
    const thing1 = thing1();
    if (thingExists(thing1) === true) {
        return thing1;
    }
    analytics.track("thing1 not found")
    
    // keep searching
    const thing2 = thing2();
    if (thingExists(thing2) === true) {
        return thing2;
    }
    analytics.track("thing2 not found")
}```
wheat mesa
#

Again, no reason to be storing the function calls in variables there

#

Nor do you have to write the curly brackets if you donโ€™t want to

#

And comparing to === true can just be shortened to if(thing)

proven lantern
#

but you need to invokje the function twice to make it a one liner

proven lantern
#

i avoid truthy logic

wheat mesa
#

I know but Iโ€™m assuming that youโ€™re not returning an object in a function that returns a Boolean

proven lantern
#

i tried breaking switch statements and failed

lyric mountain
#

I did something like that once

#

put true inside switch () and conditionals in case

#

btw, u can technically use ```js
block: {
if (f2() == something) break block;
return aValue;
}

cinder patio
split hazel
#
try {
  these_hands();
} catch() {
  // hand caught
}
proven lantern
cinder patio
#

ye it should

proven lantern
#

lol

#

nice

lyric mountain
#

why cant u use a variable actually?

#

assignment?

proven lantern
#

i have duplicate code

#

idk

proven lantern
royal portal
#

how can you check if req.path includes stuff in an array?!?!1

if (req.path.includes(['/test','/something'])) {
#

it only checks for /test

lyric mountain
#

that's very wrong

#

you inverted it

#

oh wait

split hazel
#

that hurts to look at

#

but includes only takes one thing

wheat mesa
#

Assuming req.path is a string, itโ€™s .contains

#

Unless thatโ€™s not what you were asking

split hazel
#

(i think)

earnest phoenix
#

I have some doubt any one can help me

wheat mesa
#

And includes only takes one argument yeah

wheat mesa
wheat mesa
split hazel
#

im guessing they're using express

#

so probably string

earnest phoenix
#

process of bot verification

wheat mesa
#

Nevermind then, I suppose itโ€™s .includes()

#

I got confused with Java

split hazel
wheat mesa
#

Just seems odd to have it as .includes on something that isnโ€™t an array tbh

#

@earnest phoenix donโ€™t dm me about bot stuff, just ask in here please ๐Ÿ™‚

split hazel
#

what they're probably looking for is if (req.path.startsWith("/somepath"))

wheat mesa
#

Itโ€™s official, my laptop still works and can run intellij ๐Ÿ˜ˆ

split hazel
#

my laptop only has 4gb ram and running visual studio code + a wsl instance + a c++ intellisense + compiling makes it cry

#

it takes like 5 seconds for it to lint something every time i write a line of code

wheat mesa
#

This is a 2017 laptop and it still runs pretty good

#

16gb of ram because I upgraded it

split hazel
#

sorry

#

im very sorry

#

my laptop has SOLDERED ram chips

#

BETTER PERFORMANCE

wheat mesa
#

Mine has one stick soldered in, but I have 4 sodimm slots and it was only using 1

#

In theory you could upgrade it quite a bit, but Iโ€™ve had no reason to do that since this is the first time in about 3 years or so that Iโ€™ve used this laptop

#

Itโ€™ll make a good dev machine for when Iโ€™m not at home

earnest phoenix
#

Im new for these things @wheat mesa

manic basin
#

totally not running an old intel xeon processer with 52GB of ram

wheat mesa
wheat mesa
quartz kindle
#

something to eat i think

pine nova
#

๐Ÿ’€

earnest phoenix
#

here my bot is verified broh how i need to get bull tick beside of my bot like process when it recahed 75+ @wheat mesa

quartz kindle
#

oh, you want to know how to get this?

earnest phoenix
#

Acha thank you

#

How to keep emoji like this in setup @quartz kindle

lyric mountain
#

those are buttons

earnest phoenix
#

Yeah when i kept emojis in buttons it's came like this : โ–ถ๏ธ

lyric mountain
#

because those are entirely different emotes

#

they probably uploaded them to a private server for use

earnest phoenix
#

Where can I get it any idea ?

lyric mountain
#

google, then add them to your server

#

or any server u can add emtoes to, it doesnt matter

earnest phoenix
#

Yeah but I need transparent like this but I serached from google

lyric mountain
#

then get a transparent one

earnest phoenix
fringe jewel
#

Is there like a NPM package I can use for messages like: <t:1654387200:f>

wheat mesa
#

Formatting time?

fringe jewel
#

Mhm.

split hazel
#

welcome to the 2022 generation of javascript developers

fringe jewel
#

I've done a few searches, but failed.

split hazel
#

you 100% dont need a library to do it but i dont know how to do it either but someone else prob knows

lyric mountain
#

literally, just go to google and type "<name> icon transparent"

split hazel
#

just checking

fringe jewel
#

<t:1654387200:f>
<t:1654387200:f>

split hazel
#

yeah just plop that into your message in your bot and it will work

fringe jewel
#

I know, but I want it to like for example.

wheat mesa
#

that's just <t:unix_timestamp:f>

fringe jewel
#

If a user starts a giveaway and they want it to end in 12 hours.

#

It will make a format for 12 hours forward.

wheat mesa
#

use js's built in date API, or use moment

split hazel
fringe jewel
#

mk.

split hazel
#

sounds like you need relative time

fringe jewel
#

K

split hazel
#

<t:1:R>

#

first time doing it haha

#

<t:timestamp:R> is what you need

#

<t:1654376744795:R>

#

is this epoch time

winter pasture
#

Then just use JavaScript Date to add whatever future time to the current time and convert that to unix

fringe jewel
#

Alrighty, thanks to you all for the help :)

split hazel
#

<t:1654376813142:R>

#

is this not it?

wheat mesa
#

discord works in seconds

#

iirc

split hazel
#

oh right

#

quirky

#

divide by 1000 then

#

<t:1654376881:R>

#

i give up

wheat mesa
#

also this is kinda unrelated but does anyone know how to fix my stupid touchpad scrolling dogshit? It keeps scrolling almost as if I'm doing tab in discord

winter pasture
#

Math.floor(new Date().getTime() / 1000)
<t:1654376870:R>

split hazel
winter pasture
quartz kindle
#

or new Date().valueOf()

#

xD

winter pasture
#

Old habits still get me

split hazel
#

stop it tim

winter pasture
#

Or just hardcode the current time and update it manually galaxybrain

split hazel
#

<t:1654377100:R>

#

good stuff

fringe jewel
#

OMG! IT worked :D

quartz kindle
#
let time = Date.now();
setInterval(() => {
  time++
}, 1)
winter pasture
#

<t:1654377033:t> <t:1654377033:t>
<t:1654377033:T> <t:1654377033:T>
<t:1654377033:d> <t:1654377033:d>
<t:1654377033:D> <t:1654377033:D>
<t:1654377033:f> <t:1654377033:f>
<t:1654377033:R> <t:1654377033:R>

split hazel
#

i will go to bed <t:1654380039:R> to wake up at 6am for first shift

wheat mesa
#

holy shit my laptop is actually so dumb

#

it uses arrow keys to simulate scrolling with the touchpad

#

so it fucks up in discord

austere surge
#

was counting up the seconds

winter pasture
wheat mesa
#

or maybe it isn't I can't even tell, seems to work fine in intellij (just REALLY sensitive)

wheat mesa
#

there we go, had to fix it by going into the registry

#

stupid elantech

split hazel
#

good to know to never buy elantech

wheat mesa
#

lenovo laptop, elantech touchpad apparently

#

now I can actually scroll properly

#

I have no idea why anyone would ever want to use arrow keys to scroll

#

(when they're purposely using a touchpad already)

wheat mesa
#

rust crates are being stinky and stupid rn

wheat mesa
#

simple question, but can't seem to figure out a fast solution for this ```
The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of the number 600851475143 ?

#

I know the answer is 6857, but I don't know how to efficiently calculate that without blowing up my pc

#

I could just cheat and use a rust crate, but I want to solve it myself

#

Anyone have any ideas?

#

Nevermind, got it

#

my garbage rust code if anyone wants to look at it ```rs
pub fn largest_prime_factor() -> u64 {
*compute_primes(600851475143).unwrap().last().unwrap()
}

fn compute_primes(upper: i64) -> Option<Vec<u64>> {
if upper <= 1 {
return None;
}
let mut vec: Vec<u64> = vec![];
let mut copy = upper;
for a in 2..upper {
if copy % a == 0 {
vec.push(copy as u64);
copy /= a;
}

    if copy == 1 {
        return Some(vec);
    }
}

Some(vec)

}

#

surprised that worked tbh

#

that top function though KEKW

slender thistle
wheat mesa
#

Nah the source code for those prime factorization crates are extremely complex because math moment

wheat mesa
sharp geyser
#

I have a feeling I understand the basic concept of it but I already know I am completely wrong

wheat mesa
#

Itโ€™s just metaprogramming essentially

#

Using code to access code

sharp geyser
#

Seems to me it is just invoking something you need at runtime by grabbing it from the class

wheat mesa
#

Basically

#

Thereโ€™s lots of stuff that falls under the roof of reflection

#

One of which is doing that, yes

sharp geyser
#

I also read that it is also possible to invoke something that is possibly unknown?

wheat mesa
#

As far as I know itโ€™s basically accessing source code during runtime

sharp geyser
#

I have no fucking clue waffle it is just what I read

pale vessel
#

Unwrap abuse

wheat mesa
#

Reflection basically destroys type safety

#

Since itโ€™s all done at runtime

#

But it also allows you to do basically anything you want

sharp geyser
#

So reflection is a good way to do a cmd handler for a JDA bot then?

wheat mesa
#

Yes

#

That is the only way to do it essentially

sharp geyser
#

You basically just grab the class and invoke the execute method set when you need it

wheat mesa
#

You can look at the way kuuhaku does it for his bot

sharp geyser
#

I'd rather keep my sanity

#

๐Ÿ‘€

wheat mesa
#

What he does is basically look for any types in a certain directory annotated with the @Command() annotation, and then puts them into a HashSet and loads them into his bot from what I remember

#

Thereโ€™s some fancy stuff he does in there but thatโ€™s the basic concept

#

He uses a library called Reflections 8 (I think thatโ€™s what itโ€™s called) that offers a lot more features than just what native Java offers

split hazel
#

meanwhile in #rust-general

sharp geyser
#

Mushroom soup is mid

wheat mesa
#

The rust community has been very kind to me in recent days in regards to my stupid questions

#

Surprised at how patient they are

split hazel
#

and bro I never woke up at 6am purposefully and its hell

wheat mesa
#

That uses some concepts you have learned about quite yet

#

Like wildcard generics (I think thatโ€™s what itโ€™s called)

sharp geyser
#

Nice

#

Got a lot to learn it seems before I can even attempt a discord bot in java

woeful pike
#

i wish it existed in ts

vivid fulcrum
#

you have to recompile better sqlite

#

just uninstall and reinstall it

#

this is more than likely because you transferred node_modules to your vps instead of leaving it out and running npm install on the vps

earnest phoenix
#

is there a node library that i can use to receive emails?

solemn latch
#

receive emails in what way?
like an smtp server? or just imap?

rustic nova
#

i tried setting up a mailserver myself

#

gave up

#

bought microsoft business instead

spark flint
#

microsoft dev

boreal iron
fathom sonnet
#

hi guys, so im trying to make mute command, an now, i have two commands (slash commands):
mute-role <= create new role for muted members
mute <= mute members

now, in mute-create i should, create role, place it above other roles(my bot role position is highest, so new created role should be right under bots role).

so this is the code i wrote: ```js
const { SlashCommandBuilder } = require('@discordjs/builders')
const { Permissions } = require('discord.js');
const mute = require('./mute');

module.exports = {
data: new SlashCommandBuilder()
.setName('mute-role')
.setDescription('Create role which will be assigned to muted user.')
.addStringOption(option =>
option
.setName('role')
.setDescription('role name')
.setRequired(true)
),

    async execute(interaction, client, guild) {


        const mutedRole = interaction.options.getString('role')
        const HighestRole = guild.roles.highest
        interaction.guild.roles.create({ name: `${mutedRole}`, permissions:
            [
                Permissions.FLAGS.VIEW_CHANNEL
            ],
            color: '#fc6565',
        });
        mutedRole.setPosition(HighestRole.position - 1)

        interaction.reply(`${mutedRole} has been Successfully created !!!`)

    }

}
and this is error i getting:
TypeError: Cannot read properties of undefined (reading 'me')
at Object.execute (F:\discord_bot\Apolo\commands\moderation\createrole.js:20:39)
at Client.<anonymous> (F:\discord_bot\Apolo\index.js:87:23)
at Client.emit (node:events:527:28)
at InteractionCreateAction.handle (F:\discord_bot\Apolo\node_modules\discord.js\src\client\actions\InteractionCreate.js:83:12)
at Object.module.exports [as INTERACTION_CREATE] (F:\discord_bot\Apolo\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (F:\discord_bot\Apolo\node_modules\discord.js\src\client\websocket\WebSocketManager.js:351:31)
at WebSocketShard.onPacket (F:\discord_bot\Apolo\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (F:\discord_bot\Apolo\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (F:\discord_bot\Apolo\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:527:28)


if anyone know how i can fix this it would be great, also. in my mute file, i added: ```js
const mutedRole = require('./createrole')
```soo, with my logic, here i should be able to assign created role to selected user
royal portal
#

anyone know what cloudscale means and if i should use it?!?!1

solemn latch
solemn latch
#

(line 20 character 39)

fathom sonnet
#

yea i tried to doi it without .me since when i add it, it gives error of undefined .me

solemn latch
#

.me isnt undefined, guild is

#

you're reading me

so effectively undefined.me is what the error says

fathom sonnet
#

I tried adding guild in listener paramter and at execute() parameter, but yea, still undefined .me

solemn latch
#

function parameters are ordered in javascript

#

and the guild variable into nothing

#

so your guild variable is undefined anyway

split hazel
#

we all do

#

and sounds like you need to import it the old fashioned way

#

how are you importing it?

earnest phoenix
#

im trying to make a .json file thats connected to my blacklist.js so it scans every blacklisted links/words and automatically deletes them when someone sents an invite link or the blacklisted word

lyric mountain
#

const blacklist = require("blacklist.json")

#

do note, it might be desirable to have a per-server blacklist configuration

#

in which case you should be using a db

spark flint
#

wont it be const blacklist = require("./blacklist.json")

#

or is that the same thing

lyric mountain
#

idk, gotta test

earnest phoenix
#

like does anyone have a code for me cause im newbie to coding

craggy pine
#

we wont give you code.

split hazel
#

const discord = require("discord.js")
const client = new discord.Client();

client.on("message", m => {
if (m.content === "!ping") {
m.channel.send("Pong!")
}
});

client.login("ODQmMTAxNzMoNzIzMjAxMDQ1.GgARxC.OpiAO_gfNFaGlqTBwSGZi5yKuGsamovo91PBZj")

ancient nova
#

ayo??

#

hide the token?

still storm
#

Guys, how can i change my top.gg description background?

ancient nova
still storm
#

yes

split hazel
#

you wish

#

intents are mandatory now

still storm
split hazel
#

and message will still work because its deprecated

ancient nova
ancient nova
split hazel
#

no

ancient nova
split hazel
#

throwback to the time i sent a log file to the discord.js server which contained a token amongst the thousands of lines of logs and then an hour later someone logged into the bot, changed every channel name to something to do with goombas, spam sent images of goombas in every channel and sent ninja and forgor

ancient nova
# split hazel const discord = require("discord.js") const client = new discord.Client(); clie...

const Discord = require("discord.js");
const client = new Discord.Client({
intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MEMBERS, Discord.Intents.FLAGS.GUILD_BANS, Discord.Intents.FLAGS.GUILD_MESSAGES, Discord.Intents.FLAGS.DIRECT_MESSAGES]
});

client.on("messageCreate", m => {
if (m.content === "!ping") {
m.channel.send("Pong!")
}
});

client.login('ODQmMTAxNzMoNzIzMjAxMDQ1.GgARxC.OpiAO_gfNFaGlqTBwSGZi5yKuGsamovo91PBZj')

split hazel
#

fight the discord.js breaking change

#

use message

#

they cant stop us all

ancient nova
split hazel
#

except they dont care bc the only option is to move to another library if you dont like the changes

still storm
#

Reply me pls

pine nova
#

nice token

split hazel
#

thanks

ancient nova
still storm
#

Idk how to change bg

ancient nova
#

body {
background: url("link");
}

#

or something like that]

split hazel
#

one day i will send my discord account token in chat just to see what happens

pine nova
#

and dms u

split hazel
#

not your account token

pine nova
#

o

ancient nova
pine nova
#

wait account token

split hazel
#

only way to reset is to change password

ancient nova
#

Imma send mine rn

pine nova
#

i read bot token

#

๐Ÿ’€

#

mb

ancient nova
#

or discrimnator

pine nova
#

email

ancient nova
#

or anything

pine nova
#

๐Ÿ—ฟ

ancient nova
#

does anyone have command ideas or sumn

#

I'm boreddd

still storm
split hazel
#

make a command to command your waifu

split hazel
ancient nova
still storm
#

ik

pine nova
still storm
#

It doesnt work

ancient nova
#

<style> CSS_HERE </style>

pine nova
#

use jimp or canvas

ancient nova
#

have no more ideas

pine nova
#

damn

#

hmm

ancient nova
still storm
still storm
pine nova
#

main

ancient nova
#

main?

pine nova
#

๐Ÿ’€

ancient nova
#

I told u to use body

#

also if you wan to use color do

#

background-color: #fff;

still storm
#

it doesnt work as body too

split hazel
#

last time i saw someone use main in html was back when php was the node.js

pine nova
pine nova
#

ig

ancient nova
#

and remember to add the !important tag at the end

#

otherwise it won't update

#

if something else overrides it

still storm
ancient nova
#

u can't use main

#

use body

still storm
#

I do

pine nova
#

just see the background div class and select through class fr

#

๐Ÿ˜”

tawdry path
#

our people will have to wait another 2 weeks because I hadn't put him online 24 hours. sad

split hazel
#

dont think you should use body either

ancient nova
#
<style>
    body {
        background-color: black !important;
    }
</style>
split hazel
#

it will conflict with topgg

ancient nova
#

jesus christ that's not this hard

still storm
#

Its like that genius.

ancient nova
split hazel
#

ah

#

turkish flag as the background

ancient nova
pine nova
#

german flag fr ๐Ÿ‘ด

still storm
#

It still dont work :/

pine nova
#

man u gotta learn css fr ๐Ÿ’€

still storm
#

Ima watch yt tutorial

ancient nova
still storm
ancient nova
#

and paste the code I wrote

pine nova
#

bruh css is the most basic thing

#

to learn before js

split hazel
#

clear everything and just include his code

pine nova
#

๐Ÿ’€

slender thistle
#

Are you expecting everyone here to do everything for you while you procrastinate on learning CSS

split hazel
#

until you want to style something complex and the css conflicts in unexpected ways

still storm
pine nova
#

ig

pine nova
#

idk

ancient nova
pine nova
#

just a guess

ancient nova
#

website took too long to send a response

still storm
slender thistle
#

!important time inb4

ancient nova
#

I told you to include !important tag

split hazel
#

uh isnt the page background already black

sharp geyser
#

๐Ÿ‘€

#

sad day when you gotta use !important

split hazel
#

oh he changed it

#

bro this guy cant follow simple instructions

#

COPY PASTE THE CODE

still storm
#

Still nope

pine nova
#

๐Ÿ’€

ancient nova
#

๐Ÿ˜ญ

still storm
#

Important tag didnt do it

sharp geyser
#

Connection timed out

ancient nova
#

copy my code and try again

still storm
#

Ok

split hazel
#

does anyone have a bot page to test it on

#

i dont anymore

sharp geyser
#

Nope

ancient nova
#

mine

#

already got it working

split hazel
#

still have the bot dev role but we dont talk about that

sharp geyser
#

No they have 0 clue what they are talkin bout

still storm
#

Dont work

sharp geyser
#

It doesn't always have to be the website taking too long to respond

split hazel
#

show what you did

ancient nova
still storm
#

Im phone

sharp geyser
#

You didn't supply a required field

still storm
#

Wait it worked now

ancient nova
sharp geyser
#

Show ur code then

still storm
#

Ig preview broken

sharp geyser
#

I ain't a mind reader

slender thistle
#

Make sure all your fields are filled with data

slender thistle
#

(not)

sharp geyser
#

lovely

#

now what is thearray

#

lmfao

#

๐Ÿ‘€

slender thistle
#

What data does the array contain

sharp geyser
#

Never would of guessed that

earnest phoenix
#

something like this?

    blacklist.includes(word => {
        if (message.content.toLowerCase().includes(word)) message.delete() && message.author.send("Keep the use of Profanity out of our server!")
    })```
ancient nova
ancient nova
#

just use blacklist.includes why forEach

sharp geyser
#

type is a required field

#

for options

slender thistle
#

Doesn't SlashCommandBuilder already create the JSON you need?

split hazel
#

foreach performance ๐Ÿ“‰ ๐Ÿ“‰ ๐Ÿ“‰ ๐Ÿ“‰

sharp geyser
still storm
#

Recommend any color or background? Current color too bright

slender thistle
#

Yeah but why the e: shit

sharp geyser
#

The type of the data you want option to be

sharp geyser
sharp geyser
#

I don't fuck with djs anymore

slender thistle
#

Good boy Misty

still storm
sharp geyser
#

I am libless now

ancient nova
sharp geyser
split hazel
#

there is no perfect lib:(

still storm
#

Ima put image maybe