#development

1 messages · Page 1866 of 1

warm prawn
#

It's kannadiga

#

:/

lyric mountain
#

Bcuz you're not making much sense, better see if someone can help u in your main language

warm prawn
#

Bruh

#

I speak fluent English

#

:/

rose warren
#

Or show a screenshot of what you mean then?

#

What do you need this "cookie" for?

warm prawn
#

:/

solemn latch
#

Bot secret can be found on discord developer portal

rose warren
#

That's not what they're looking for

warm prawn
#

Bruh

cobalt spruce
warm prawn
#

Nah

#

Bruh

#

I don't need those

#

I just don't want to talk about it

solemn latch
#

Are you trying to use the top.gg api?

cobalt spruce
warm prawn
#

Cause I got to know that it's against ToS

solemn latch
#

Ah yeah please don't break our tos

cobalt spruce
cobalt spruce
#

MOD ALERT

warm prawn
#

Not still

cobalt spruce
warm prawn
#

I fear

#

:/

#

I think Mac knows it

#

:/

pallid jungle
#

How can i delete slash cmd ?

boreal iron
#

client.application.commands.delete

pallid jungle
boreal iron
#

With a guild ID as option or not (for a global one)

pallid jungle
boreal iron
#

It’s an option of this method

#

I think I sent u a link yesterday already, didn’t I?

pallid jungle
#

No

boreal iron
#

I did

#

First parameter is your command

trail finch
#


module.exports = {
  name: "verifymsg",
  description: "verification msg",

  run: async ( client, message, args, prefix ) => {

   const embed = new Discord.MessageEmbed()
   .setDescription("> ![White_Arrow](https://cdn.discordapp.com/emojis/883698127167709205.webp?size=128 "White_Arrow") `to verify`  please react ![Black_Heart](https://cdn.discordapp.com/emojis/883691096859897857.webp?size=128 "Black_Heart") \n> **To get access to the server and meet our amazing community.** ![4A_Heart](https://cdn.discordapp.com/emojis/883704926084149258.webp?size=128 "4A_Heart")")
   .setColor("#070707")

    const msg = await message.channel.send(embed)
    
    await msg.react("![Black_Heart](https://cdn.discordapp.com/emojis/883691096859897857.webp?size=128 "Black_Heart")")
    let role = message.guild.roles.cache.get(r => r.id === "877780413785989131")

     const filter = (reaction, user) => {
      return (
       ['![Black_Heart](https://cdn.discordapp.com/emojis/883691096859897857.webp?size=128 "Black_Heart")'].includes(reaction.emoji.name)
      );
     };
    msg
    .awaitReactions(filter)
            .then(async (collected) => {

              const reaction = collected.first()
                if (reaction.emoji.name == '![Black_Heart](https://cdn.discordapp.com/emojis/883691096859897857.webp?size=128 "Black_Heart")') {
                   await user.roles.add(role)
                }
                    });
                 
  }
}``` :p its not giving role or maybe what I did is just dumb ;-; idk
boreal iron
#

Can be a snowflake or it’s whole object

pallid jungle
#

ok

timber fractal
#

so I have this as automoderation code to detect if it contains a blacklisted word: js if(censorList.autoModTrigger.some(word => message.content.toLowerCase().includes(word))){ //do something } and inside that I have this to check if it contains a whitelisted word: js if(censorList.whitelist.some(word => message.content.toLowerCase().includes(word))) { let newContent = message.content.replace(censorList.whitelist.some(word => message.content.toLowerCase().includes(word)), ""); if(censorList.autoModTrigger.some(word => newContent.toLowerCase().includes(word))){ console.log('Bad word detected after removing the whitelisted word\n' + newContent); } } but that doesnt work. I am very sure it doesnt work at the replace() cause it only checks if it contains a whitelisted word but doesnt say what it is so how could I fix that?

drifting wedge
#

gamers

#

help

#
const card = document.querySelectorAll('.card');
const col = document.querySelectorAll('.cards');

let item = null

// make card appear in the correct column

for (i of card) {
  i.addEventListener('dragstart', dragStart);
  i.addEventListener('dragend', dragEnd);
}

function dragStart() {
    this.classList.add('dragging');
    item = this;
    // delete element
}

function dragEnd() {
    //this.classList.remove('dragging');
    this.remove();
}

for (i of col) {
    i.addEventListener('dragover', dragOver);
    i.addEventListener('dragenter', dragEnter);
    i.addEventListener('dragleave', dragLeave);
    i.addEventListener('drop', dragDrop);
}

function dragDrop() {
    //this.classList.remove('over');
    this.innerHTML += `<div class="card" draggable="true">${item.innerHTML}</div>`
}

function dragOver(event) {
    event.preventDefault();
    //this.classList.add('over');
    //this.innerHTML += `<div class="card" draggable="true">${item}</div>`
}

function dragEnter(event) {
    event.preventDefault();
}

function dragLeave(event) {
    event.preventDefault();
    //this.classList.remove('over');
}```
#

when you drag some cars

#

the wrong tags appear

#

im very confused

sudden geyser
timber fractal
drifting wedge
#

like if u originlly drag a card with a bug tag

#

like a critical tag appears

#

then in another col. another tag shows up

sudden geyser
#

You should .find the word, which will return the word.

#

Save that to a variable and use it

timber fractal
#

okay thanks

sudden geyser
#

But a message can contain multiple banned words

#

So you should really be filtering

#

Then replacing each occurrence

timber fractal
#

how would i have to do that?

#
let foundWord = censorList.whitelist.find(word => message.content.toLowerCase().includes(word));
            let newContent = message.content.replace(foundWord, "");
            if(censorList.autoModTrigger.some(word => newContent.toLowerCase().includes(word))){
                console.log('Bad word detected after removing the whitelisted word\n' + newContent);
            }``` this still doesnt work and censor the whitelisted word
sudden geyser
#

A basic example:

let words = ["crest", "stars"];
let word = "crest of the stars";

for (const block of words) {
  word = word.replaceAll(block, "");
}

console.log(word); // => " of the "

Of course, there are other ways of doing this.

timber fractal
sudden geyser
#

noop

timber fractal
sudden geyser
#

censorList.whitelist is an array of whitelisted words.
message.content.toLowerCase() is the string you're trying to purify.

The point is you need to check the message content for each whitelisted word. Of course, the imperative loop example is an easier version of this, but you could've used .filter (many) instead of .find (one), removed the [] (filter returns an array), and removed the .join(...) (since you want a collection of words).

I'm only giving hints.

timber fractal
#

@sudden geyser js let words = censorList.whitelist; let content = message.content; for (const block of words) { newContent = content.replaceAll(block, ""); }

quartz kindle
#

replaceAll requires node v15+

timber fractal
#

And what if i dont have?

quartz kindle
#

use replace with regex

timber fractal
#

Or how do I update

boreal iron
earnest phoenix
#

Thats the error

split hazel
#

lord save us all

earnest phoenix
#
from discord_slash import SlashCommand
#

You can't have a space in a module name

earnest phoenix
#

Now this error is show

wheat mesa
#

This is a certified mobile IDE moment

earnest phoenix
#

Bruh

boreal iron
#

Aye

earnest phoenix
#
from discord.ext import commands, tasks
from discord_slash import SlashCommand 
from discord_slash.utils.manage_commands import create_option
#

This is code

#

@earnest phoenix

split hazel
#

probably because the , tasks

#

I'm no python expert

earnest phoenix
earnest phoenix
#

Also be patient regarding an answer

earnest phoenix
#

đŸ„Č

low bone
boreal iron
#

God thanks you guys aren’t dealing with firewalls

earnest phoenix
boreal iron
#

Without even knowing what a whitelist or blacklist is notlikenoot

earnest phoenix
#

Yes and there is an invalid whitespace character after SlashCommand triggering the error

#

Okie

wheat mesa
#

“Python is beginner friendly” they said

#

Extra space gives errors KEKW

earnest phoenix
#

It's a weird character that would trigger a syntax error in any lang

#

Thats the full code

#

If you refuse to listen to me I cannot help you

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

I already did it

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

near stratus
#

@earnest phoenix

lyric mountain
#

Take ban give ban

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

near stratus
sage bobcat
#

One message removed from a suspended account.

boreal iron
#

lmao

sage bobcat
#

One message removed from a suspended account.

boreal iron
#

I’m sure you just have to enter some code and python magically converts it into something useful

#

That’s how it works

echo blaze
#

im using discord.js v12 and this seems not to be working?

client.on("guildCreate", guild => {
    client.channels.cache.get('883131565746552882').send(`Joined new Server!: ${guild.name}`);
});
echo blaze
#

nice phishing links

low bone
#

these people are so annoyin

echo blaze
#

for real lol

earnest phoenix
#

Can I be mod

lyric mountain
#

ha haha hahahahahaha

#

too funny

deep mantle
#

I am trying to make guild slash commands with the http post request, ive been trying different bots i have, all of them reurn a 403 status code except for one, which actually creates the guild command. They are all in the same server and i are all using the same guild. Do you have any idea why this could be happening?

earnest phoenix
#

You invited without application.commands maybe

boreal iron
#

Guild commands require the application.commands scope

earnest phoenix
#

Do only guild commands need that?

deep mantle
#

thank you, they don't have the applications.command

earnest phoenix
#

one of the many problems with slash commands

boreal iron
pallid jungle
#
// Delete a command
guild.commands.delete('123456789012345678')
  .then(console.log)
  .catch(console.error);

How to delete it from global ?

timber fractal
earnest phoenix
#

they won't be able to use slash commands or normal commands

#

message content intent poggers

boreal iron
#

As Tim stated in the past, Discord automatically assigned this scope to all bots when interactions have been published

#

And it will happens once more as I know if the message content intent goes live

#

It will be required for all NEW guilds your applications joins after

earnest phoenix
#

another discord problem:
people pay more attention to the problems than the fixes

boreal iron
#

But I missed that, too as it was back in march, which means I had to force all guilds to reinvite my bot

earnest phoenix
#

nobody told me i didn't need to reinvite

boreal iron
#

And I kicked out my bot of any guild before somebody told me a reinvite can overwrtite permissions

lyric mountain
#

like, for me all guilds that had her automatically received slash scope

boreal iron
#

English not good, no no

earnest phoenix
#

it was, is, and always will be a bad docs issue that is the root of all discord problems

boreal iron
lyric mountain
#

ohh

boreal iron
#

just because u didn't inform me in march

coarse topaz
#

Hi, I'd like to check if message.content includes something different to "A" starting from args.slice(1). If so, do "something"

#

How can I do that

#

Something like !includes

near stratus
quaint wasp
#

uhh

#

I did this to make it look with js

#

but it didnt work..

#

like when u type

```js```
deep mantle
#

I am attempting to get the global slash commands of my bot. How do pass in the authorization? I found the way to do it with requests but not aiohttp
for the authorization im using

{"Authorization":"Bot <token here>"}
quaint wasp
#

ping in replies

boreal iron
#

You're sure the language syntax is right behind the quotes? ```js

#

It will not work if it's in the 1st line

#

```
js

coarse topaz
# low bone can you explain more
if (message.content.startsWith(`${prefix}gamevote`)){
let args = message.content.split(" ");
let text = args.join(" ");
if (!text||!message.content.includes("A"||"B")) {

some code here

} else {
some code here
  }
}```
My current problem is that if the user sends either "A" or "B" **but** apart of that sends "C" or/and "D", the code will still run... I want it so that starting from `args.slice(1)`, the message can only include either "A" or "B". If the condition isn't met, it sends an "Error Embed". If the condition is met, it goes to the next part of the code (after the `else {`)
quaint wasp
#

ohh

#

wait is it bc of the space

lyric mountain
#

prob

coarse topaz
lyric mountain
#

regex?

coarse topaz
#

actually A & B are URL links

lyric mountain
#

still, regex

#

or use 2 checks

#

like (message.content.includes("A") || message.content.includes("B"))

coarse topaz
#

and it shouldn't as C is not A nor B

lyric mountain
#

it'll not run since it'll not pass that check

coarse topaz
#

lemme try it out then

brave garnet
#

can i have a question bout abandonware?

lyric mountain
#

yes, you're still constrained by the license

#

for 20 years iirc

brave garnet
#

not license. im gonna talk bout d.py

lyric mountain
#

what about it?

brave garnet
#

no, just a weird but between python, replit and dpy. i just got this even if this look normal:

#

red wave on " async d__ef sfvikj():__ "

lyric mountain
#

what does that have to do with abandonware?

brave garnet
lyric mountain
#

d.py isn't abandonware

brave garnet
#

is. from a week is

hot sleet
#

can i create/edite text files with github api ?

ancient nova
#

ey why don't events don't work sometime

lyric mountain
lyric mountain
#

sadly, I can't help u with that

brave garnet
ancient nova
#

messageDelete work but guildDelete don't

#

y

hot sleet
#

in any way

brave garnet
lyric mountain
hot sleet
#

...

#

i got it

#

i don't know how i didn't think about this

lyric mountain
#

lul

hot sleet
#

im making log files
i thought there's something like node fs in github

ancient nova
#

anyone know why events might not respond?

hot sleet
#

ty

boreal iron
#

(with the event)

coarse topaz
boreal iron
#

!message.content.includes("A") && !message.content.includes("B")

lyric mountain
#

I think the issue is logical

boreal iron
#

I wonder why u need a check like that

coarse topaz
# boreal iron I wonder why u need a check like that

people might want to enter a different URL link or text than "A" or "B" + a URL link containing A's or B's domain, which shouldn't happen

URL links must only have the domain from A or B, if they don't, the bot will display an "Error" embed

coarse topaz
cobalt spruce
#
const BaseCommand = require('../../utils/structures/BaseCommand');
const Discord = require("discord.js");
var ReverseMd5 = require('reverse-md5');
module.exports = class TestCommand extends BaseCommand {
  constructor() {
    super('teste', 'testing', []);
  }

  async run(client, message, args) {
    const embed2 = new Discord.MessageEmbed()
    .setTitle("You Made A Mistake")
    .setDescription(`**Error:** You Need To Add Text`)
    .setColor('#033275')
    .setTimestamp()
    .setFooter(`Mistake By ${message.author.username}`, `${message.author.avatarURL({ dynamic: true })}`);
  
  var hash = args.slice(0).join(" ");
      if (!hash) return message.channel.send(embed2);

    var opts =   {lettersUpper: false, lettersLower: true, numbers: true, special: false, whitespace: true, maxLen: 32}
    var rev = ReverseMd5(opts)
    var obj = rev(hash, [opts])
   const embed = new Discord.MessageEmbed()
   .setTitle("MD5 Unhasher")
   .setDescription(`**Hash:** \`${hash}\` \n\n **UnHashed:** \`${obj.str}\` \n\n **Time:** \`${obj.elapsed}\``)
   .setColor('#033275')
   .setTimestamp()
   .setFooter(`Requested By ${message.author.username}`, `${message.author.avatarURL({ dynamic: true })}`);
       return message.channel.send(embed)
};}

so obj is the unhash resault and it takes the most 30s to unhash how i could add like a timer after 30s it sends a message that operation failed ?

coarse topaz
low bone
boreal iron
cobalt spruce
low bone
coarse topaz
low bone
#

i'm assuming

    var obj = rev(hash, [opts])

takes 30s?

low bone
#

lets use new URL() to parse the link first then u can know
what domain

#

new URL(YOUR URL)
will parse it, and provide some useful data
here we need to check host property

coarse topaz
boreal iron
#

!message.content.includes("A") && !message.content.includes("B")

low bone
#

so it will be like this

if(!["discord.com","top.gg"].includes(new URL(url)?.host??""))
{
//doesn't match code
}
else
{
//match either discord.com or top.gg
}
boreal iron
#

NOT || NOT doesn't make any sense

cobalt spruce
drifting wedge
#

ok so ```js
const card = document.querySelectorAll('.card');
const col = document.querySelectorAll('.cards');

let item = null;

for (i of card) {
i.addEventListener('dragstart', dragStart);
}

function dragStart() {
item = this;
}

for (i of col) {
i.addEventListener('dragover', dragOver);
i.addEventListener('dragenter', dragEnter);
i.addEventListener('dragleave', dragLeave);
i.addEventListener('drop', dragDrop);
}

function dragDrop() {
item.classList.add('dragging');
console.log(item.innerHTML);
this.innerHTML += <div class="card" draggable="true">${item.innerHTML}</div>
item = null;
}

function dragOver(event) {
event.preventDefault();
}

function dragEnter(event) {
event.preventDefault();
}

function dragLeave(event) {
event.preventDefault();
}``` i have this, but when i drag an item, and i try to drag another one after

boreal iron
#

Logical nonsense

drifting wedge
#

it says item is null

#

like why?

#

cant it redefine item?

cobalt spruce
coarse topaz
boreal iron
#

Just show it here, you can't DM me anyways

low bone
boreal iron
#

NOT || NOT is logical nonsense

cobalt spruce
boreal iron
#
if(NOT)
else if(NOT)
else
#

would be want u want if I understood what the fuck you want to do anyway

cobalt spruce
#

idk where to put it on my code

earnest phoenix
drifting wedge
#

it works the first time

#

then the issue is that item is null

#

i dont think its that

#

i think its just that when you pick it up, it doesnt redefine it

#

like it doesnt "run again"

boreal iron
#

oh well it's obvious why

drifting wedge
#

why???

low bone
# cobalt spruce await new Promise(resolve => setTimeout(resolve, 30000)); u mean this?

like this

let obj=await new Promise(r=>{
    setTimeout(()=>{r(false)},30000);
    let obj = rev(hash, [opts])
    r(obj)
})
if(obj===false)   return message.channel.send("TOOK TOO LONG!");

const embed = new Discord.MessageEmbed()
.setTitle("MD5 Unhasher")
.setDescription(`**Hash:** \`${hash}\` \n\n **UnHashed:** \`${obj.str}\` \n\n **Time:** \`${obj.elapsed}\``)
.setColor('#033275')
.setTimestamp()
.setFooter(`Requested By ${message.author.username}`, `${message.author.avatarURL({ dynamic: true })}`);
    return message.channel.send(embed)
boreal iron
#
for (i of card) {
  i.addEventListener('dragstart', dragStart);
}

you're running the loop once only binding the item using the method dragStart

#

by setting item = null; in your drop event, it's not defined anymore

drifting wedge
#

so how do i run it again?

boreal iron
#

Why do you set item as null btw?

drifting wedge
#

how so?

coarse topaz
#

@boreal iron I was able to DM you, check your inbox

brave garnet
#

asap question. someone know how to fastly change python from 3.x to 3.9 ? async def returns errors

#

i use arch btw

split hazel
#

virtual envs probably

sudden geyser
#

download it?

brave garnet
#

fast way?

#

pip or pacman...

#

or smth

lament rock
#

Some words of wisdom. Maintaining projects which have little usage or little collaboration is emotionally draining. Try to make something people other than you will use and try to find people to help you develop said projects. Personal experience. Working with people on something is more fun

drifting wedge
#

the issue is now, how do i re-bind it

brave garnet
#

-_-

brave garnet
#

was for me or 0Exe ?

drifting wedge
#

ok so basically

#

i dont know wtf is happening

sudden geyser
brave garnet
#

same

low bone
drifting wedge
#

HOW DO I REBIND IT

brave garnet
#

;-; again...

lament rock
#

I wonder if I should give up on trying to maintain some old modular Discord libs I forked, converted to TS and updated to V9.

#

Discord updates too much

split hazel
#

if (skill.issue == true) solveSkillIssue()

sudden geyser
#

If you don't want to just give up on it

brave garnet
earnest phoenix
#

Discord loves to pull stuff out of their ass every day or week

lament rock
#

Well. I personally use it for all of my projects just because ram gets monched by discord.js or eris too much.
And no, I'm not succumbing to Erwin's words

split hazel
#

I gave up on discord bots

sudden geyser
#

And no, I'm not succumbing to Erwin's words
good choice

split hazel
#

too much mental stress

brave garnet
#

me almost too

earnest phoenix
#

: not =

cobalt spruce
low bone
#

show me ur current code

boreal iron
lament rock
#

Finding collaborators is hard tbh

brave garnet
#

bye

lament rock
#

I used to work with someone, but they stopped for college. Fair enough

tired panther
earnest phoenix
lament rock
#

No. Stop. I don't wanna use ditritus

cobalt spruce
#
const BaseCommand = require('../../utils/structures/BaseCommand');
const Discord = require("discord.js");
var ReverseMd5 = require('reverse-md5');

module.exports = class TestCommand extends BaseCommand {
  constructor() {
    super('teste', 'testing', []);
  }

  async run(client, message, args) {
    const embed2 = new Discord.MessageEmbed()
    .setTitle("You Made A Mistake")
    .setDescription(`**Error:** You Need To Add Text`)
    .setColor('#033275')
    .setTimestamp()
    .setFooter(`Mistake By ${message.author.username}`, `${message.author.avatarURL({ dynamic: true })}`);
  
  var hash = args.slice(0).join(" ");
      if (!hash) return message.channel.send(embed2);

    var opts =   {lettersUpper: false, lettersLower: true, numbers: true, special: false, whitespace: true, maxLen: 32}
    var rev = ReverseMd5(opts)
    let obj=await new Promise(r=>{
      setTimeout(()=>{r(false)},5000);
      let obj = rev(hash, [opts])
      r(obj)
  })
  if(obj===false)   return message.channel.send("TOOK TOO LONG!");
  
  const embed = new Discord.MessageEmbed()
  .setTitle("MD5 Unhasher")
  .setDescription(`**Hash:** \`${hash}\` \n\n **UnHashed:** \`${obj.str}\` \n\n **Time:** \`${obj.elapsed}\``)
  .setColor('#033275')
  .setTimestamp()
  .setFooter(`Requested By ${message.author.username}`, `${message.author.avatarURL({ dynamic: true })}`);
      return message.channel.send(embed)

};}
split hazel
#

tim didn't make detritus lmao

tired panther
cobalt spruce
cobalt spruce
earnest phoenix
#

Mate are you sure you're using Python

lament rock
#

Having to migrate my code base for the 5th time MaikaDisgust

cobalt spruce
tired panther
#

Isnt it a lot of work, changing the whole code?
There are some good forks for py (epy...)

earnest phoenix
# cobalt spruce wdym bro?

The usage of the var keyword for variable declarations is discouraged because it's hoisted on top of the global scope just like normal functions and operate on a weird behavior, which can lead to hard to debug bugs in your codebase

sudden geyser
#

var is hoisted to the function scope

split hazel
#

var more like cringe

earnest phoenix
#

True -> true, you may want to learn JS fundamentals

split hazel
#

are you sure

tired panther
#

Just dont use it xD

split hazel
#

discordjs is very annoying to maintain

cobalt spruce
earnest phoenix
sudden geyser
#

yes

low bone
split hazel
#

they keep releasing breaking changes

cobalt spruce
split hazel
#

what did you just say

low bone
earnest phoenix
# sudden geyser yes

No idea what exactly you mean there, but if you're talking the scope outside of where the function is declared, then yea; if not then I don't think so

split hazel
#

example code? @low bone

#

but you can well log before awaiting a promise

cobalt spruce
#
   console.log("test");
    let obj=await new Promise(r=>{
      setTimeout(()=>{r(false)},5000);
      let obj = rev(hash, [opts])
      r(obj)
  })
  if(obj===false)   return message.channel.send("TOOK TOO LONG!");

log

PS C:\Users\Me\Desktop\File> node .
bot#4689 has logged in.
test
sudden geyser
drifting wedge
#
const card = document.querySelectorAll('.card');
const col = document.querySelectorAll('.cards');

let item = null;

for (i of card) {
  i.addEventListener('dragstart', dragStart);
}

for (i of col) {
    i.addEventListener('dragover', dragOver);
    i.addEventListener('dragenter', dragEnter);
    i.addEventListener('dragleave', dragLeave);
    i.addEventListener('drop', dragDrop);
}

function dragStart() {
    item = this;
}

function dragDrop() {
    item.classList.add('dragging');
    this.innerHTML += `<div class="card" draggable="true">${item.innerHTML}</div>`
    item = null;
}

function dragOver(event) {
    event.preventDefault();
}

function dragEnter(event) {
    event.preventDefault();
}

function dragLeave(event) {
    event.preventDefault();
}``` again, any ideas? it not re-running, like its not re-binding the listners
earnest phoenix
low bone
low bone
#

its so weird that he don't give anything
no error
no reply
even tho it executed that part

cobalt spruce
#
    let rev = ReverseMd5(opts) 
    let obj=await new Promise(r=>{
      setTimeout(()=>{r(false)},5000);
      let obj = rev(hash, [opts])
      r(obj)
  })
  if(obj===false)   return message.channel.send("TOOK TOO LONG!");
#

is there something wrong

quartz kindle
#

what does rev return?

low bone
#

he says rev return reverse-hash of a hash
and it takes lot of time

cobalt spruce
quartz kindle
#

ok but what does it actually return

#

does it return a promise?

#

or a value?

#

is it synchronous or asynchronous?

low bone
cobalt spruce
cobalt spruce
earnest phoenix
quartz kindle
low bone
#

you mean setTimeout when executed and resolve, won't be able to leave this block?

cobalt spruce
lyric mountain
#

btw, u don't need r(false) or if(obj===false)

#

just do r(null) and if(!obj)

quartz kindle
low bone
#

aha

hot sleet
#

its so strange but log-message file runs everytime i delete or edit messages and bot crash everytime!

earnest phoenix
quartz kindle
#

an npm package?

#

show it

cobalt spruce
lament rock
#

Couldn't it just be evaluated in a worker_thread

cobalt spruce
earnest phoenix
#

yea, either promisify it or run it in a worker thread to stop it from blocking the main thread

lament rock
#

does util.promisify make functions non blocking?

lyric mountain
#

he ignored me topggVeld

low bone
earnest phoenix
#

It calls an internal function dedicated to this but shrug

lament rock
#

sounds jank

quartz kindle
cobalt spruce
split hazel
cobalt spruce
quartz kindle
#

1: make the function yourself and make it async
2: run it in a worker thread

lyric mountain
#

that's the other way

cobalt spruce
lament rock
#

I'd say that running in a worker thread is preferable

cobalt spruce
#

WHY I DONT GET ANYTHING U SAYING

lament rock
split hazel
#

because you're not as sweaty as us

lyric mountain
#

although yeah, that's a good way of making CPU-heated sandwich

#

yum yum

split hazel
#

remember the bios always shuts the machine down automatically if the cpu gets too hot:)

lyric mountain
#

also, what's the reason for doing that in first place?

#

not that anyone would use it

split hazel
#

some useless information since it'll never reach that point

drifting wedge
#
​
0: <div id="Bugs" class="cards">
​
1: <div id="Ideas" class="cards">
​
2: <div id="Features" class="cards">
​
3: <div id="Complete" class="cards">
​
length: 4
​
<prototype>: NodeListPrototype { item: item(), keys: keys(), values: values(), 
 }
drag.js:4:9
#

@earnest phoenix

cobalt spruce
quartz kindle
#

hashes are not supposed to be unhashed, its not an encryption

lyric mountain
#

if you don't need it just use base64

cobalt spruce
low bone
cobalt spruce
drifting wedge
#

i mean i dont even really know what the issue is, what i THINK it is is that its not not "running again"

cobalt spruce
earnest phoenix
lyric mountain
# cobalt spruce one-way encryption yah

for example, consider the following:

  • my password is "abadabadu123321", which hashes to "awd75daw95v0pavw"
  • whenever I try to validate my password, I hash the input and compare both hashes (the one from input and the one saved on db)
  • if hashes are equal, that also means the password is the same
#

so you don't (and shouldn't) need to know what the actual pass is

cobalt spruce
lyric mountain
#

actually, if you save raw passwords in your db you're liable for lack of security

lament rock
#

people should just reset their password through some verification method

drifting wedge
#
const card = document.querySelectorAll('.card');
const col = document.querySelectorAll('.cards');

let item = null;

function addListeners() {

    for (i of card) {
        i.addEventListener('dragstart', dragStart);
    }

    for (i of col) {
        i.addEventListener('dragover', dragOver);
        i.addEventListener('dragenter', dragEnter);
        i.addEventListener('dragleave', dragLeave);
        i.addEventListener('drop', dragDrop);
    }
}

function dragStart() {
    addListeners();
    item = this;
}

function dragDrop() {
    item.classList.add('dragging');
    this.innerHTML += `<div class="card" draggable="true">${item.innerHTML}</div>`
    item = null;
}

function dragOver(event) {
    event.preventDefault();
}

function dragEnter(event) {
    event.preventDefault();
}

function dragLeave(event) {
    event.preventDefault();
}```
#

@earnest phoenix didnt do anything

#

still same issues

earnest phoenix
#

You're not even calling it

drifting wedge
#

yes i am?

quartz kindle
drifting wedge
#

addListeners()?

earnest phoenix
#

At the dragDrop() function

drifting wedge
#

in the drag start

cobalt spruce
drifting wedge
#

ohhh

#

read it wrong

lyric mountain
#

and how many people actually want it?

#

if it's just 1 dude among 21649124 it's not feasible to make it

drifting wedge
#

it doesnt work at all

#

i think i need to add it once before

earnest phoenix
#

yea

quartz kindle
#

nobody uses md5 anymore for passwords because of that

drifting wedge
#

now for some reason

#

it only works in the 2 middle columns

#

im so confused

drifting wedge
#

wait

#

it works

#

but only the first two cols

#

then the other two con

#

dont

cobalt spruce
#

idk what other encode types i should add

drifting wedge
#

yeah it just works sometimes now

low bone
#

reversing md5 work if we limiting the boundaries 😄
like giving him a lot of hints like the original is 4chr and so on
and lowercase, not numbers..

cobalt spruce
#

i have base 64 and binary and morce

coarse topaz
#

Hi, I have another question

How do I check if an array contains something specific

coarse topaz
#

array.contains("")?

earnest phoenix
lyric mountain
earnest phoenix
drifting wedge
#
function addListeners() {
    for (i of col) {
        i.addEventListener('dragover', dragOver);
        i.addEventListener('dragenter', dragEnter);
        i.addEventListener('dragleave', dragLeave);
        i.addEventListener('drop', dragDrop);
    }

    for (i of card) {
        i.addEventListener('dragstart', dragStart);
    }
}

addListeners();

function dragStart() {
    item = this;
}

function dragDrop() {
    addListeners();
    item.classList.add('dragging');
    this.innerHTML += `<div class="card" draggable="true">${item.innerHTML}</div>`
    item = null;
}```
coarse topaz
drifting wedge
#

rn i got this

#

of relevant code anywyas

cobalt spruce
cobalt spruce
earnest phoenix
# coarse topaz discord.js

discord.js is a library, not a programming language; seems like you're using JavaScript so you can use <Array>.includes()

lyric mountain
#

don't use hashes for that

#

if u really must, there are a ton of encoding options

cobalt spruce
hollow depot
drifting wedge
#

dont i have that?

#

ye

quartz kindle
cobalt spruce
drifting wedge
#

i think i alrwady have that no?

lyric mountain
#

just as an example, base64 is just text but using 64 as base

cobalt spruce
lyric mountain
#

so you can have base32, base1, base128, base4096

#

whatever

quartz kindle
#

ciphers are just character replacement, you can easily reverse them

lament rock
#

discord.js might as well be a language.

earnest phoenix
cobalt spruce
drifting wedge
#

ohhh

#

ok

lyric mountain
#

also, you can encode the text as hex, which will look quite like hashes but without the one-way thing

drifting wedge
#

yeah that might work

#

very smort volt

hollow depot
cobalt spruce
lament rock
#

Forgot to add /s

earnest phoenix
quartz kindle
drifting wedge
#

ok so it works

quartz kindle
#

there are tons of ciphers

drifting wedge
#

but u have to do it twice"

quartz kindle
#

pick one, see how it works

drifting wedge
#

like u have to drag it twice

lament rock
#

discord.tim when

earnest phoenix
#

discord.any

lament rock
#

timy-discord

cobalt spruce
earnest phoenix
quartz kindle
earnest phoenix
#

What lib?

lament rock
quartz kindle
drifting wedge
#

1 sec

lament rock
#

pain. Wanted to try something different than js

split hazel
#

don't ask

lament rock
#

alternative is finding competent people to collaborate on my projects, but that's proving to be quite difficult

solemn latch
#
functim Tim() {
 letim var = Matim.Rantim();
}
drifting wedge
#
function addListeners() {
    const card = document.querySelectorAll('.card');
    const col = document.querySelectorAll('.cards');
    
    for (i of col) {
        i.addEventListener('dragover', dragOver);
        i.addEventListener('dragenter', dragEnter);
        i.addEventListener('dragleave', dragLeave);
        i.addEventListener('drop', dragDrop);
    }

    for (i of card) {
        i.addEventListener('dragstart', dragStart);
    }
}

addListeners();

function dragStart() {
    item = this;
}

function dragDrop() {
    addListeners();
    item.classList.add('dragging');
    this.innerHTML += `<div class="card" draggable="true">${item.innerHTML}</div>`
    item = null;
}```
#

@earnest phoenix

lyric mountain
#

@cobalt spruce this for example

#

string to hex

#

and easily reverted

cobalt spruce
earnest phoenix
lyric mountain
drifting wedge
#

dude

#

ur a fucking genious

#

❀

earnest phoenix
#

💙

drifting wedge
#

red heart > blue heart

lyric mountain
#

there are better ways of getting byte value of a string tho

#

I'm just too lazy to write one

cobalt spruce
lyric mountain
#

but basically, all characters have an unicode value, just convert characters to it and use toString(16) to encode int as hex

cobalt spruce
#

also

lyric mountain
#

in java it's easier tho

#

just "amogus".getBytes()

cobalt spruce
#

the last update of discord js

earnest phoenix
cobalt spruce
#

can the bot join a stage channel

lyric mountain
#

no, don't think so

cobalt spruce
blissful coral
#

In v13 maybe

#

I think it can

#

I haven’t tried

cobalt spruce
earnest phoenix
#

Bots can't join stage channels or instances yet

cobalt spruce
#

wait

blissful coral
#

Ah

#

Nvm then

cobalt spruce
#

is v13 released?

lyric mountain
#

although I'd not try to anger youtube even more mmLol

blissful coral
#

Yes

#

It’s been released for almost a month now

#

Maybe longer

lament rock
#

I thought voice state update accepted a stage channel ID

earnest phoenix
#

Don't you love it when lib devs are screaming in agony whenever Discord pulls a new feature out of their ass

lament rock
#

fr

#

who asked for context menu stuff

earnest phoenix
#

Gotta add it before users scream at you for not implementing this new feature that came out 0.1 seconds ago

cobalt spruce
#

ayo

#

i cant see join stage

earnest phoenix
#

Bots can't join stage channels or their instances yet

coarse topaz
cobalt spruce
#

;-;

earnest phoenix
lyric mountain
#

!<Array>.some(v => v === <Value>)

#

below?

#

discord moment

earnest phoenix
#

That C++ style -> doe

lyric mountain
#

I hate fat arrows

earnest phoenix
lament rock
#

~>

#

Lawful good. Chaotic evil

earnest phoenix
#

=~-]}>

lament rock
#

horrifying

lyric mountain
#

fat arrows are so heavy they cant even fly

coarse topaz
thorny flume
#

How can I insert a query string into my url using Express?

lament rock
#

?thing=value&otherthing=someothervalue

thorny flume
#

ok

boreal iron
#

@drifting wedge Not sure if you still response to DMs

lyric mountain
boreal iron
#

Appending it to the current element will clone it, keep that in mind

#

If you're "dragzone" doesn't include other elements, then just define the innerHTML as your dragable item

#
function dragStop()
{
    this.innerHTML = drag_item.outerHTML;
    ...
}
coarse topaz
#

@lyric mountain @boreal iron I thought I'd have nightmares tonight about "A" and "B" but I'm excited to say that I finally fixed my code and now it totally works as expected 😌

thanks a lot for the help!

I'm now gonna focus on the next part of the code, about collecting reactions

boreal iron
#

You should try to focus interactions as soon as possible as your current system will be obsolete in the future anyways

coarse topaz
#

In that case I won't update my d.js version

boreal iron
#

Wont help you if you can't receive the message content any longer

simple stump
#

How would I get users mentioned in a message? I know there is message.mentions.users.first(), but I want to get the second user mentioned as well. Specifically, their ID.
Ex:

let mentions = message.mentions.users.array();
console.log(mentions[1].id);
boreal iron
#

message.mentions.users returns a collection

#

Just map it

#

If I remember right array() isn't a valid method in djsv13 anymore

low bone
#

message.mentions.users.first(message.mentions.users.size)[index]
i think first() return an array

low bone
boreal iron
#

Nope

#

Just map it

#

As he wants the IDs only

low bone
#

if id, then yea
<Collection>.map(u=>u.id)[index] is better

azure lark
#

how do I use writeFile with fs as I keep getting an error telling me callback needs to be a function

sudden geyser
#

you should pass a callback where you need to

azure lark
#

how

sudden geyser
azure lark
#

ok

simple stump
#

For some reason, when creating channels, the roles Staff and Scorer (the last two ID's) aren't able to view the channels created.

    message.guild.channels.create("game-" + games.length, {
      permissionOverwrites: [
           {
             id: message.guild.roles.everyone, //To make it be seen by a certain role, user an ID instead
             deny: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] //Deny permissions
           },
           {
                         // But allow the two users to view the channel, send messages, and read the message history.
             id: user.id,
             allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
           },
           {
             id: user2.id,
             allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
           },
           {
              id: '882750156905275402',
              allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
            },
            {
               id: '877309777741500487',
               allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
             },
             {
               id: '882754787580457012',
               allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
             }
        ],
    });
tribal crow
#

Hey! When trying to deploy global commands i get an error saying i'm not authorized to perform the action. Does anyone know why, and how to fix it?

earnest phoenix
#

Any font that supports emojis?

boreal iron
coarse topaz
#

My reactions collector is not working, what am I doing wrong?

gameVoteCollector.on('create', (reaction, user) => {
            message.reactions.remove(reaction);
            message.channel.send(`${user.mention} Don't add other reactions than the existing ones.`).then(message => message.delete({ timeout: 10000 }));
});```
earnest phoenix
#

3

quartz kindle
#

oh they do

coarse topaz
#

yes they do

quartz kindle
#

what about it is not working?

digital ibex
#

even if he does that he said hes not making an api request, without http or making an api call how else r u supposed to do it

coarse topaz
# quartz kindle what about it is not working?

When I add another reaction, it just doesn't run the code, like if it wasn't reading it

I created the collector this way btw
const gameVoteCollector = new Discord.ReactionCollector(message);

coarse topaz
quartz kindle
coarse topaz
#

I just followed this example

#

I didn't add "options" because according to the docs it's optional

boreal iron
#

Options are optional, that's correct

coarse topaz
#

Hm, so I should put .createReactionCollector() right after message.channel.send("") ?
Like this
message.channel.send("").createReactionCollector()

quartz kindle
#

no lol

boreal iron
coarse topaz
#

where then lmao

boreal iron
#

createReactionCollector is a method (function) to use on your message object

coarse topaz
#

so just writing message.createReactionCollector() will do the job?

slender hamlet
#

yeah, but it needs a bit more to actually do what you need

boreal iron
#

I mean the link I mentioned above does explain the method and include examples

quartz kindle
#

techincally you dont need it

coarse topaz
#

ah bruh moment then

quartz kindle
#

but its kinda the proper way to do it

coarse topaz
#

then it's not what's causing the code not to work?

quartz kindle
#

did you check if the event fires?

coarse topaz
#

like if it's actually called when it's supposed to work?

quartz kindle
#

yes

#

add a console.log to see if it does anything

coarse topaz
quartz kindle
#

then something else is wrong

#

show full code

coarse topaz
#

will try something else really quick give me a min

coarse topaz
# quartz kindle show full code

Ok, what I did didn't fix the code either; here's the full code ```js
for (const gameLink of gameLinksArray) {
const gameVoteEmbed = new Discord.MessageEmbed()
.setTitle(.)
.setDescription(.)
.setFooter(Vote started by: ${message.author.tag} (${message.author.id}), message.author.displayAvatarURL())
.setTimestamp()
.setColor("ORANGE")
const m = await message.channel.send(gameVoteEmbed);
m.react("698685773830029362");
m.react("860550880708657184");
m.react("698687788437995650");
m.react("698687435873452054");

            const gameVoteCollector = message.createReactionCollector()

    gameVoteCollector.on('create', (reaction, user) => {
        console.log("bro i worked");
        message.reactions.remove(reaction).catch(console.error);
        message.channel.send(`${user.mention} Don't add other reactions than the existing ones.`).then(message => message.delete({ timeout: 10000 })).catch(console.error);

});
}```

wheat mesa
#

m.createReactionCollector()

coarse topaz
#

UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on undefined, which is a undefined and not a function

quartz kindle
#

?

#

show what you did

coarse topaz
#

It didn't do anything regarding the reaction

#

I just added the thumbsup

#

maybe i should change message from message.reactions.remove(reaction) and message.channel.send(``) to m as well?

low bone
#

m.reactions..

wheat mesa
#

^^

quartz kindle
#

i said show what you did

#

your code

coarse topaz
# quartz kindle your code

ah my bad lol, i edited it to m.createReactionCollector() as Waffle suggested and now i'm changing the rest of "messages" to "m"

quartz kindle
#

because that error you showed makes no sense according to the code you said you did

coarse topaz
#

This is the code now, and it gives the error I said every time a new reaction is added to the message

for (const gameLink of gameLinksArray) {
            const gameVoteEmbed = new Discord.MessageEmbed()
            .setTitle(`.`)
            .setDescription(`.`)
            .setFooter(`Vote started by: ${message.author.tag} (${message.author.id})`,  message.author.displayAvatarURL())
            .setTimestamp()
            .setColor("ORANGE")
            const m = await message.channel.send(gameVoteEmbed);
            m.react("698685773830029362");
            m.react("860550880708657184");
            m.react("698687788437995650");
            m.react("698687435873452054");

        const gameVoteCollector = m.createReactionCollector()
                
        gameVoteCollector.on('create', (reaction, user) => {
            console.log("bro i worked");
            m.reactions.remove(reaction).catch(console.error);
            m.channel.send(`${user.mention} Don't add other reactions than the existing ones.`).then(m => m.delete({ timeout: 10000 })).catch(console.error);
});
        }```
lyric mountain
#

you redefined m twice

quartz kindle
#

what is the full error?

coarse topaz
low bone
#

That error probably came from catch of undefined

I don't think there's something called reactions.remove

quartz kindle
#

its likely the missing filter function

#

its trying to call it

coarse topaz
#

also it's optional isn't it

lyric mountain
#

you could try () => true to see if it's the issue

low bone
#

try this
Change m.reactions.remove(..)
To reaction.remove()

coarse topaz
low bone
#

Then add filter as well

coarse topaz
low bone
#

Wait, where is the collector?

#

gameVoteCollector??

coarse topaz
#

const gameVoteCollector = m.createReactionCollector()

Right below the m.react chain - I forgot to add it back when I was editing my message

#

I've just added it back to the message

wheat mesa
#

99% sure that reaction collectors require a filter of some sort

low bone
#

m.createReactionCollector(()=>true)

coarse topaz
quartz kindle
#

v13 requires an options object

coarse topaz
split hazel
#

update your js engine to v9

coarse topaz
low bone
#

Show us ur final code

coarse topaz
# low bone Show us ur final code
for (const gameLink of gameLinksArray) {
            const gameVoteEmbed = new Discord.MessageEmbed()
            .setTitle(`.`)
            .setDescription(`.`)
            .setFooter(`Vote started by: ${message.author.tag} (${message.author.id})`,  message.author.displayAvatarURL())
            .setTimestamp()
            .setColor("ORANGE")
            const m = await message.channel.send(gameVoteEmbed);
            m.react("698685773830029362");
            m.react("860550880708657184");
            m.react("698687788437995650");
            m.react("698687435873452054");
                
            const gameVoteCollector = m.createReactionCollector(()=>true)

        gameVoteCollector.on('create', (reaction, user) => {
            console.log("bro i worked");
            reaction.remove(reaction).catch(console.error);
            m.channel.send(`${user.mention} Don't add other reactions than the existing ones.`).then(message => message.delete({ timeout: 10000 })).catch(console.error);
});
        }```
wheat mesa
#

v12 reaction collectors don't have a create event

coarse topaz
#

a

low bone
#

You will need to modify your code
To only remove other reactions except the four you want

coarse topaz
#

i can simply update my d.js version and that's it though

quartz kindle
#

good luck lmao

split hazel
#

update your js engine to v9 bro

#

v3 is old

low bone
#

There's a big change from the two versions

So think carefully

coarse topaz
#

Block_Flushed such as? is there a changelog or such?

split hazel
#

practically the whole library brother

#

just rewrite your bot at that point

coarse topaz
#

uh lmao i'm better not updating for now then

split hazel
#

yeah I gave up moving my bot

#

im just abandoning it

coarse topaz
low bone
#

You can simply make a check inside the collector

#

If(['react1','react2'...].includes(reaction.emoji.id)) reaction.remove()

#

Wait reaction don't have id property
Edited

#

Or you can use the filter

quaint wasp
#

uhh

#

guys

#

as u may see in the memes I got new pc and now I forgot how to install node.js 😅

#

I installed it, passed procces

#

but cant use like node.

#

ping in replies

#

pllss

#

bc else I wont see u

quartz kindle
low bone
vernal rivet
#

^^^^^

boreal iron
#

download the executable or the zip archive, done

vernal rivet
#

Check if the node path is in your system environment on your pc

proven lantern
#

What's the best strategy to migrate users from old commands to slash commands? Should I update my old commands to warn about the deprecation and ask them to reinvite the bot so it has the slash commands?

tribal crow
#

With discord.js v13, how do i set my bots activity? The same way as i did in v12 doesnt seem to work any more.

tribal crow
#

couldnt find anything

quaint wasp
tribal crow
#

may have looked in the wrong place

quaint wasp
vernal rivet
#

Should be in the ClientUser class section

tribal crow
#

ait ty

vernal rivet
#

Np, let me know if it isn't there

quaint wasp
#

its like.. I didnt install node.js. But I did,..

#

error: node : The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

boreal iron
lament rock
#

restart your terminal after you install it

quaint wasp
#

i did run it

quaint wasp
lament rock
#

then you'll want to check the dir node installed to to see if a binary was installed there

vernal rivet
#

Is the node path in your PATH system environment?

quaint wasp
#

? idk

#

its in my program files

vernal rivet
#

Go and check

quaint wasp
#

and my file i am attempting to run is in onather folder

boreal iron
#

Add the executable to your environment vars

vernal rivet
#

^^

quaint wasp
vernal rivet
#

If it's not in that Path variable, then it doesn't know what you are talking about

quaint wasp
#

ah

#

alr

quartz kindle
boreal iron
#

OS environment vars act the same as code environment vars

#

They're accessable system wide

#

Without the need to specify the path

quaint wasp
boreal iron
#

Then open your command prompt and call node.exe or just node

quaint wasp
#

ah

#

now it does node

#

do I have to do it every time I wanna run node?

lament rock
#

no

quaint wasp
#

seems like I do

vernal rivet
#

No. It's only a shortcut for your machine. So when you say node, it knows that you want the node.exe, and will execute that for you

quaint wasp
#

still same tho

boreal iron
#

command prompt, not PS environment

vernal rivet
#

Did the path you added point to the bin folder?

quaint wasp
#

command promt works..

quartz kindle
#

did you restart powershell?

#

all powershells you have open

quaint wasp
#

zero

quartz kindle
#

restart your pc

quaint wasp
#

alr

#

brb soon

vernal rivet
#

Did his node path he added point to the bin folder?

boreal iron
#

wtf is that command prompt

vernal rivet
#

Probably integrated terminal

coarse topaz
# low bone ```If(['react1','react2'...].includes(reaction.emoji.id)) reaction.remove()```

I just made this

gameVoteCollector.on('collect', (reaction, user) => {
            if (reaction.emoji.id !== "698685773830029362"||"860550880708657184"||"698687788437995650"||"698687435873452054") {
           m.reactions.remove(reaction)
           m.channel.send(`${user.mention} Don't add other reactions than the existing ones.`).then(message => message.delete({ timeout: 10000 })).catch(console.error);
   }
});```
I'll check if it actually works
quaint wasp
#

hello

vernal rivet
#

That won't work. You need to fix your if statement

quaint wasp
#

ah it works thanks 🙂

vernal rivet
#

Prefect

boreal iron
#

that has such a command prompt

vernal rivet
#

That's window 10

boreal iron
#

no it's not

#

command prompt doesn't look like that

vernal rivet
#

Did you check the version

boreal iron
#

not even PS does

#

yeah that's why I ask, it's NO windows 10 command promt

vernal rivet
#

Ps was executed probably in command prompt

boreal iron
#

hmm maybe

#

nvm

vernal rivet
#

Lol did you figure it out?

boreal iron
#

well weird font tho, but doesn't matter

#

doesn't look like the original cmd

vernal rivet
#

shrugrainbow looks the same to me. But like I said it's probably a integrated terminal, or a different application like window terminal nomnomnom

lament rock
#

it's the win10 cmd prompt

boreal iron
#

shhh

vernal rivet
#

Lol

lament rock
#

don't forget that this exists

boreal iron
#

wut

vernal rivet
#

Ah yes the power of customization is real

boreal iron
#

saw thaat the first time in my life

lament rock
#

right click the cmd window top bar then click properties

boreal iron
#

damn cheats

wheat mesa
thorny flume
coarse topaz
# wheat mesa Make a filter instead of a massive if statement, plus your if statement isn't in...

I'm doing it this way now

gameVoteCollector.on('collect', (reaction, user) => {
            let whitelistedReaction = ["698685773830029362","860550880708657184","698687788437995650","698687435873452054"];
            if (reaction.emoji.id !== whitelistedReaction[0]||whitelistedReaction[1]||whitelistedReaction[2]||whitelistedReaction[3]) {
               m.reactions.get(reaction).remove(user);
               m.channel.send(`${user.mention} Don't add other reactions than the existing ones.`).then(message => message.delete({ timeout: 10000 })).catch(console.error);
}
        });``` I'm currently getting this error though:
`UnhandledPromiseRejectionWarning: TypeError: m.reactions.get is not a function`
So what's the actual right way of doing it?
vernal rivet
coarse topaz
#

y-yes?

vernal rivet
#

Ok, then you will know that before or after an AND/OR operators it needs to result in a boolean value

coarse topaz
#

Ofc

vernal rivet
#

Then what type is whitelistedReaction[1]?

coarse topaz
#

true?

vernal rivet
#

No

#

It's a string

coarse topaz
#

a

#

Makes sense, yes

vernal rivet
#

True is a boolean value, not type. So what you are doing in your if statement is

If ((reaction's emoji Id is not the first I'd in the whitelistedReaction), or (2nd whitelistedReaction), or (3rd whitelistedReaction)....)```

Do you see the issue now?
coarse topaz
#

I think I quite do

lament rock
#

true can be used as a type

#

any primitive value could be used as a type

coarse topaz
lament rock
#
if (![array, of, ids].includes(reaction.id)) reaction.delete();
wheat mesa
#

^^

thorny flume
#

how can i use: "client.user.status.presence" in discord.js v13

lament rock
#

wdym use it

#

what do you want to do with it

thorny flume
#

does not work

#

get user status

lament rock
#

Are you trying to change your client's presence or just read it

thorny flume
#

read

lament rock
#

trying to read just your client's or other users'?

thorny flume
#

other user's

lament rock
#

Do you have the presence intent enabled on your app page and in your code

thorny flume
#

yes

lament rock
#

it's now GuildMember.presence since presences are on a per guild basis

coarse topaz
thorny flume
#

ok

lament rock
#

remove the ! then

feral aspen
#

How many slash commands can you make?

coarse topaz
#

Did it and now it doesn't do anything

lament rock
#

Sounds like something is broken on your end then

coarse topaz
# lament rock Sounds like something is broken on your end then

Uh, I don't think so..
I've been testing for a while and I'm currently testing with this:

gameVoteCollector.on('collect', (reaction, user) => {
            if (reaction.id === "698685773830029362"||"860550880708657184"||"698687788437995650"||"698687435873452054") {
                reaction.remove();
                   m.channel.send(`<@${user.id}> Don't add other reactions than the existing ones.`).then(message => message.delete({ timeout: 10000 })).catch(console.error);
}
        });```

However, it's deleting the reaction and sending the message regardless of whether reaction.id is one of the whitelisted ones or not
lament rock
#

your if statement will always evaluate to true because the || checks for truthy value and non empty strings will always return true when checked for truthiness

proven lantern
#

is this a good way to do settings or should i make one settings command that has optional inputs for each setting?

lament rock
#

you should have 1 command with an input which accepts any setting

coarse topaz
#

nvm i misread your message

lament rock
#

No. ID's are strings globally.
You need to do this for example

reaction.id === id1 || reaction.id === id2 || reaction.id === id3
#

everything after a logical or/and to the end of the group needs to be an expression which returns a boolean

coarse topaz
#

got it

lament rock
#

My original way should have worked though and something must have been messed up on your end like the collector ending or your if statement didn't properly group your expressions or something. idk

coarse topaz
lament rock
#

So then it's an issue with your logic somewhere

#

show your code

lament rock
proven lantern
#

it's going to be all different types

#

roles, users, strings, numbers

lament rock
#

Painful. Not that big of a deal though

#

oh wait

#

Roles and Users might be impossible if it's from a string

#

since those get specially sent depending on the options

coarse topaz
# lament rock show your code
for (const gameLink of gameLinksArray) {
            const gameVoteEmbed = new Discord.MessageEmbed()
            .setTitle(`.`)
            .setDescription(`.`)
            .setFooter(`Vote started by: ${message.author.tag} (${message.author.id})`,  message.author.displayAvatarURL())
            .setTimestamp()
            .setColor("ORANGE")
            const m = await message.channel.send(gameVoteEmbed);
            m.react("698685773830029362");
            m.react("860550880708657184");
            m.react("698687788437995650");
            m.react("698687435873452054");
                
            const gameVoteCollector = m.createReactionCollector(()=>true)
        
        gameVoteCollector.on('collect', (reaction, user) => {
            if (reaction.id !== "698685773830029362"||reaction.id !== "860550880708657184"||reaction.id !== "698687788437995650"||reaction.id !== "698687435873452054") {
                reaction.remove();
                m.channel.send(`<@${user.id}> Don't add other reactions than the existing ones.`).then(message => message.delete({ timeout: 10000 })).catch(console.error);
      }
   });
}```
lament rock
#

use && instead of ||

#

|| can short stop everything in front of it whenever something returns true

proven lantern
#

that's what i have so far

lament rock
#

how many sub options can you have

coarse topaz
proven lantern
lament rock
proven lantern
#

looks like we can use an infinite number of options

lament rock
#

That doesn't sound right

#

I know that's not true

sudden geyser
#

There's a max of 25

#

The limit is probably applied recursively as well

lament rock
#

I thought the sub-commands could only have a depth of 1

mild agate
#

since nodejs has references of objects
if I have an array of objects and I set another variable as one of the objects of the array... and edit that variable... will the changes be also saved in the array?

boreal iron
lament rock
#

more api changes. ffs

boreal iron
#

This change is regarding the client

lament rock
mild agate
#

ok

coarse topaz
lament rock
#
const obj = {
   cool: true
}

const arr = [obj];
obj.cool = false;
arr[0] // { cool: false }
mild agate
#

Yeah got it

coarse topaz
#

Alright my next challenge is to figure out a way to check if the user reacted to the message with a second reaction... If it happens, then the bot should remove the first reaction and keep the second one

How can I check what's the order of the reactions given by the same user?

#

like if user.reaction.second do something

lament rock
#

check for if the message reaction cache for a specific reaction includes a user

lyric mountain
#

Your choice of formatting is...weird

proven lantern
#

is there anyway to localize the slash command names, options, and descriptions?

#

this stuff

hybrid cargo
#

wdym localize?

proven lantern
#

like change the language. ie. us_en => color en_gb => colour

sudden geyser
#

No.

proven lantern
#

i started translating to gb

#

they put in random vowels in places

#

should we make different bots for different languages?

#

keep them separate

sudden geyser
#

I wouldn't recommend it.

proven lantern
#

everyone should speak american english anyways

sudden geyser
proven lantern
#

good point

hybrid cargo
#

Your description can only have 100 characters length iirc

#

And if u need to make it as a multi language bot, u cant use global slash commands for it

proven lantern
#

i'll just make a bot for each language

hybrid cargo
proven lantern
#

that could work

hybrid cargo
proven lantern
#

that's probably enough

#

per guild

#

id have to have 1 global command that registers the guild level commands

hybrid cargo
#

Yeah, but it would still be better to add like a cooldown to commands which might involve in registering commands to an extent

proven lantern
#

/register locale: en_us

hybrid cargo
#

Yep

proven lantern
#

im not sure what the better ux is

hybrid cargo
#

But still, in my opinion too much work 😄 everyone would speak english for the most part tbh

proven lantern
#

i could skip the register step and just create a bot for each language and have the commands global

#

i think that would be a better ux

#

the bots will all use the same api

#

same INTERACTIONS ENDPOINT URL

#

another advantage of separating the bots by language is that multiple languages could be supported at the same

simple stump
#

How would I get an user's display name based on their ID? I'm trying this:

        var winnerName = message.guild.members.cache.get(id).name;
        var loserName = message.guild.members.cache.get(id2).name;

But it returns undefined.

hybrid cargo
#

.nickname

earnest phoenix
#
îș§ python main.py
START
sh: 1: cls: not found

#

this error is showing

hybrid cargo
#

This might help

simple stump
#

ty

proven lantern
#

how are there spaces in the slash command name?

#

is it the sub command thing

pale vessel
#

yes

#

discord shows subcommands before you even select the main command for some reason

proven lantern
#

ux pros

#

this doesn't show me the json structure

slender thistle
#

UX pros and Discord don't match

proven lantern
#

why doesn't it like it

#

fixed it

pale vessel
#

type 2 was user command

proven lantern
#

is the type 2 description currently used anywhere?

pale vessel
#

nope

#

only 1 supports description

#

others don't but they support capitalized letters and spaces for name

proven lantern
#

now i get to wait an hour to test it out

#

sweet

#

❀ discord

tulip marsh
#

anyone help please

blissful coral
#

You didn't close your string literal with a }

earnest phoenix
#

can someone help me with discord py please

#

I'll send the error in dm

hybrid cargo
earnest phoenix
#

Yesterday I created a basic slash command to see if it worked. Today I decided to remove it in my code to make two new slash commands. However, I still see the old command when I do / in my discord server when it is no longer in my lines of code

#

how can i do pls