#development
1 messages · Page 1866 of 1
Bcuz you're not making much sense, better see if someone can help u in your main language
Bot secret can be found on discord developer portal
Integrate your service with Discord â whether it's a bot or a game or whatever your wildest imagination can come up with.
That's not what they're looking for
Bruh
are u trying to login to a bot as a person
then cry ABOUT IT
Cause I got to know that it's against ToS
Ah yeah please don't break our tos
trying to steal accs
u can tell me in dms đ
How can i delete slash cmd ?
client.application.commands.delete
Where should the cmd name be ?
With a guild ID as option or not (for a global one)
No i need for global
Itâs an option of this method
I think I sent u a link yesterday already, didnât I?
No
module.exports = {
name: "verifymsg",
description: "verification msg",
run: async ( client, message, args, prefix ) => {
const embed = new Discord.MessageEmbed()
.setDescription(">  `to verify` please react  \n> **To get access to the server and meet our amazing community.** ")
.setColor("#070707")
const msg = await message.channel.send(embed)
await msg.react("")
let role = message.guild.roles.cache.get(r => r.id === "877780413785989131")
const filter = (reaction, user) => {
return (
[''].includes(reaction.emoji.name)
);
};
msg
.awaitReactions(filter)
.then(async (collected) => {
const reaction = collected.first()
if (reaction.emoji.name == '') {
await user.roles.add(role)
}
});
}
}``` :p its not giving role or maybe what I did is just dumb ;-; idk
ok
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?
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
.some returns a boolean. also that's very verbose
how do i have to do it then?
like if u originlly drag a card with a bug tag
like a critical tag appears
then in another col. another tag shows up
You should .find the word, which will return the word.
Save that to a variable and use it
okay thanks
But a message can contain multiple banned words
So you should really be filtering
Then replacing each occurrence
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
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.
let words = [censorList.whitelist.find(word => message.content.toLowerCase().includes(word)).join(", )] like this?
noop
how then? sorry i suck
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.
@sudden geyser js let words = censorList.whitelist; let content = message.content; for (const block of words) { newContent = content.replaceAll(block, ""); }
replaceAll requires node v15+
And what if i dont have?
use replace with regex
Or how do I update
Iâm confused about the whitelist array
Thought he wanna filter words out his content which is a blacklist 
Thats the error
lord save us all

from discord_slash import SlashCommand
You can't have a space in a module name
Now this error is show
This is a certified mobile IDE moment
Bruh
Aye
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
Nah that's valid syntax from what I see
Also be patient regarding an answer
let newContent=censorList.whitelist.filter(v=>message.content.includes(v)).reduce((a,v)=>a.split(v).join(''),message.content)```
this code will remove all words from whitelist array existing in the content
and idk why you call it whitelist đ
God thanks you guys arenât dealing with firewalls
There seems to be an invalid character after the SlashCommand
Without even knowing what a whitelist or blacklist is 
@earnest phoenix this is code
Yes and there is an invalid whitespace character after SlashCommand triggering the error
Okie
Not a space
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
What?
One message removed from a suspended account.
One message removed from a suspended account.
I already did it
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.
@earnest phoenix
Take ban give ban
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.
When you copy from GitHub, StackOverFlow and other people's suggestions
One message removed from a suspended account.
lmao
One message removed from a suspended account.
Iâm sure you just have to enter some code and python magically converts it into something useful
Thatâs how it works
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}`);
});
What's the error ?
oh i fixed it. the channel id was wrong lol, thank you though
nice phishing links
these people are so annoyin
for real lol
Can I be mod
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?
You invited without application.commands maybe
Guild commands require the application.commands scope
Do only guild commands need that?
thank you, they don't have the applications.command
one of the many problems with slash commands
Global application commands will be available in all the guilds your application has the applications.commands scope authorized, as well as in DMs.
// Delete a command
guild.commands.delete('123456789012345678')
.then(console.log)
.catch(console.error);
How to delete it from global ?
Cause all the whitelisted words have to be filtered out and after that check if there are more blacklisted words , thanks for your help
so what happens to already existing servers
they won't be able to use slash commands or normal commands
message content intent poggers
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
another discord problem:
people pay more attention to the problems than the fixes
But I missed that, too as it was back in march, which means I had to force all guilds to reinvite my bot
nobody told me i didn't need to reinvite
And I kicked out my bot of any guild before somebody told me a reinvite can overwrtite permissions

?
like, for me all guilds that had her automatically received slash scope
English not good, no no
it was, is, and always will be a bad docs issue that is the root of all discord problems
Most have joined after that date without the adjusted invite scope
ohh
just because u didn't inform me in march
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
!array.includes ?
can you explain more
uhh
I did this to make it look with js
but it didnt work..
like when u type
```js```
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>"}
ping in replies
You're sure the language syntax is right behind the quotes? ```js
It will not work if it's in the 1st line
```
js
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
but I didnt skip a single line after ```
ohh
wait is it bc of the space
prob
So how can I do it so that after args.slice(1) the content can only include either A or B?
regex?
actually A & B are URL links
still, regex
or use 2 checks
like (message.content.includes("A") || message.content.includes("B"))
but if someone sends A and C the code will still run as true
and it shouldn't as C is not A nor B
it'll not run since it'll not pass that check
lemme try it out then
can i have a question bout abandonware?
what about it?
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():__ "
what does that have to do with abandonware?
is. from a week is
can i create/edite text files with github api ?
ey why don't events don't work sometime
why specifically with the api?
ikr? but i just got a weirdo bug...]
anyways - im gonna run it on my pc... and then i'll see if its sometimes isnt bug in replit...
just edit the file locally and push it to origin
lul
im making log files
i thought there's something like node fs in github
anyone know why events might not respond?
ty
It sometimes happens a guild isn't available
(with the event)
it doesn't work as expected...
I'm trying to find a ".includesOtherThan()"-like method... Is there anything similar to it?
!message.content.includes() doesn't work either
!message.content.includes("A") && !message.content.includes("B")
I think the issue is logical
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
also thanks, will try it out
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 ?
if i do
!args.slice(1).includes("A")
it should start checking after the first argument, right?
the issue, if i'm not wrong you are checking if it's from domain name
like if user input https://discord.com/x/y
it should check if domain is discord.com right?
Haven't really understood anything but okay 
any human i just wanted to check if that obj is null after 30s
make it wait for 30s xD
with something like
await new Promise(r=>setTimeout(r,30000))
yes!
but if A = discord.com and the content includes A and "B" (B=anything that is not discord.com); by using !message.content.includes("discord.com"), the bot will still run it as true, but it shouldn't, because even though the message.content includes discord.com, the fact that it also contains B should automatically make the bot read is as false
#am dumb and i dont get it
i'm assuming
var obj = rev(hash, [opts])
takes 30s?
well, actually ur answer is not direct .includes
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
indeed, includes doesn't work for me, I'm rather trying to find a "if message includes something that is not either A nor B, do something"
!message.content.includes("A") && !message.content.includes("B")
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
}
NOT || NOT doesn't make any sense
yup sometimes not always cuz its a hash and it is searching for results
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
Logical nonsense
yup sometimes not always cuz its a hash and it is searching for results
and i only want it to stop and send a message if obj is nothing after 30s because i dont want it to kill my vps
I'll show you in DMs why this doesn't work
Just show it here, you can't DM me anyways
it's not the one he wants,
because this will be true if both exists
but he only want A or B not both
NOT || NOT is logical nonsense
HELPP
@low bonecan u check this please
if(NOT)
else if(NOT)
else
would be want u want if I understood what the fuck you want to do anyway
promise will be the answer i think
await new Promise(resolve => setTimeout(resolve, 30000));
u mean this?
idk where to put it on my code
You possibly forgot to name the event dragdrop instead of just drop?
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"
oh well it's obvious why
why???
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)
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
so how do i run it again?
Why do you set item as null btw?
how so?
@boreal iron I was able to DM you, check your inbox
asap question. someone know how to fastly change python from 3.x to 3.9 ? async def returns errors
i use arch btw
virtual envs probably
download it?
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
so when you drag another item it uses the new item
the issue is now, how do i re-bind it
-_-

was for me or 0Exe ?
Also remember that open source software is about you and not the user
same
@coarse topaz
replace url with args.slice(1).join(' ')
HOW DO I REBIND IT
;-; again...
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
if (skill.issue == true) solveSkillIssue()
If you don't want to just give up on it
TOO MUCH
Discord loves to pull stuff out of their ass every day or week
didnt work
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
I gave up on discord bots
And no, I'm not succumbing to Erwin's words
good choice
too much mental stress
me almost too
: not =
it didnt work i get no errors and it doesnt return the message
show me ur current code
Sorry quickly loosing the overview in this chat
Finding collaborators is hard tbh
bye
I used to work with someone, but they stopped for college. Fair enough
You could use Tim's Library , its a barebone, but very powerful.
Especially one that you can actually trust and knows what they're doing
No. Stop. I don't wanna use ditritus
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)
};}
tim didn't make detritus lmao
var 
for real.
Not detritus đ , tiny-discord
lmao
wait what
Mate are you sure you're using Python
Having to migrate my code base for the 5th time 
wdym bro?
Isnt it a lot of work, changing the whole code?
There are some good forks for py (epy...)
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
var is hoisted to the function scope
var more like cringe
;-; i didnt get a shit
True -> true, you may want to learn JS fundamentals
are you sure
Just dont use it xD
discordjs is very annoying to maintain
what should i use instead
prefer let instead
no?
yes
can you console.log before await new Promise
because it should send something either "TOOK TO LONG" or an embed or an error
they keep releasing breaking changes
log what
console.log("TOOK TO LONG")
??
what did you just say
anything just to make sure the bot is reaching this place to begin with
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
i tried to log test and it works
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
I'm talking about
because it's hoisted on top of the global scope
Which is not the same as the function scope. If I define
function identity(x) {
var y = x;
return y;
}
I can't access y outside of that function, so the first one
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
Oh that's what you're talking about, didn't realize
weird, is something catching error in the main event handler?
Nope
its so weird that he don't give anything
no error
no reply
even tho it executed that part
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
what does rev return?
he says rev return reverse-hash of a hash
and it takes lot of time
let rev = ReverseMd5(opts)
ok but what does it actually return
does it return a promise?
or a value?
is it synchronous or asynchronous?
if u dont know
just console.log this rev(hash, [opts])
its array
Can you try logging your col variable in the dragDrop() function?
if the function is synchronous, you cannot cancel it
you mean setTimeout when executed and resolve, won't be able to leave this block?
then what should i do
if the main thread is blocked, the event loop cant continue, so the timers never run
aha
its so strange but log-message file runs everytime i delete or edit messages and bot crash everytime!
Promisify the function
where does this function come from?
an npm package?
show it
Couldn't it just be evaluated in a worker_thread
how
yea, either promisify it or run it in a worker thread to stop it from blocking the main thread
does util.promisify make functions non blocking?
he ignored me 
;-; pls my brain am so dumb
return ur code to original, my approach was wrong
since rev won't allow setTimeout to run which will be just useless
Not entirely, but may work for some functions; it attempts to promisify the function so some operations wouldn't be blocking, however I don't think this way is recommended
It calls an internal function dedicated to this but shrug
sounds jank
that thing is 6 years old lol
ik ;-;
thats gonna burn your cpu cores like there's no tomorrow
there is no other way
lmao
1: make the function yourself and make it async
2: run it in a worker thread
well, you could brute-force it
that's the other way
am doing that
I'd say that running in a worker thread is preferable
WHY I DONT GET ANYTHING U SAYING
because you're not as sweaty as us
remember the bios always shuts the machine down automatically if the cpu gets too hot:)
also, what's the reason for doing that in first place?
not that anyone would use it
some useless information since it'll never reach that point
â
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
if ur making a bot that encode decode hash it needs to unhash
nobody know why ?
unhashing is not a thing tho
hashes are not supposed to be unhashed, its not an encryption
but the very reason to use hash is due to its one-way nature
if you don't need it just use base64
;-;
https://www.section.io/engineering-education/nodejs-worker-thread/
might let you understand
one-way encryption yah
i mean i dont even really know what the issue is, what i THINK it is is that its not not "running again"
hmm so hashing is enough ?
Strange, you may want to make a function that adds the event listeners to the nodes everytime the dragDrop() function is called
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
exacly
people wants đ
actually, if you save raw passwords in your db you're liable for lack of security
people should just reset their password through some verification method
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
You're not even calling it
yes i am?
can you explain what people want exactly?
addListeners()?
At the dragDrop() function
in the drag start
unhash MD5
but why they want it?
and how many people actually want it?
if it's just 1 dude among 21649124 it's not feasible to make it
yea
the only reason you can even unhash/brute force md5 is beacuse md5 is flawed and weak
nobody uses md5 anymore for passwords because of that
fact
idk what other encode types i should add
yeah it just works sometimes now
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..
i have base 64 and binary and morce
Hi, I have another question
How do I check if an array contains something specific
its 6years old
array.contains("")?
Try getting the cards and columns inside of the addListeners() function
all those aren't encription but encoding
Depends on what programming language you're using
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;
}```
discord.js
..
ik
discord.js is a library, not a programming language; seems like you're using JavaScript so you can use <Array>.includes()
ik i wanted to add new category
Array.includes('something')
btw discord.js is a library not a lang lol
wdym
@drifting wedge
do ciphers
i mean like what
i think i alrwady have that no?
just as an example, base64 is just text but using 64 as base
đ
ciphers are just character replacement, you can easily reverse them
discord.js might as well be a language.
You're getting all the cards and columns using the document.querySelectorAll() method, do that in your addListeners() function
well base64 is the most common
also, you can encode the text as hex, which will look quite like hashes but without the one-way thing
uhm
no?
how will u know the correct character
Forgot to add /s

just follow the specifications
ok so it works
there are tons of ciphers
but u have to do it twice"
pick one, see how it works
like u have to drag it twice
discord.tim when
timy-discord
let me see
Show your current code
kind of already a thing? idk
What lib?
Okay. .tim language when then
ew no
1 sec
pain. Wanted to try something different than js
alternative is finding competent people to collaborate on my projects, but that's proving to be quite difficult
functim Tim() {
letim var = Matim.Rantim();
}
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
pro
Try calling the addListeners() function at the end of the dragDrop() function
credits to stack for that unpack method
đ
red heart > blue heart
there are better ways of getting byte value of a string tho
I'm just too lazy to write one
everyone is lazy
but basically, all characters have an unicode value, just convert characters to it and use toString(16) to encode int as hex
also
the last update of discord js
can the bot join a stage channel
no, don't think so
F
it is in v13
Bots can't join stage channels or instances yet
wait
is v13 released?
although I'd not try to anger youtube even more 
Don't you love it when lib devs are screaming in agony whenever Discord pulls a new feature out of their ass
Gotta add it before users scream at you for not implementing this new feature that came out 0.1 seconds ago
dpy was the first to WO
ayo
i cant see join stage
Bots can't join stage channels or their instances yet
Thanks! And how to check if an element of the array is not equal to, let's say, "A"?
i can only get the info]\
;-;
JSArray[<Index>] !== JSAny, or for all elements specifically; look below
That C++ style -> doe
I hate fat arrows

=~-]}>
horrifying
fat arrows are so heavy they cant even fly
thanks a lot
How can I insert a query string into my url using Express?
?thing=value&otherthing=someothervalue
ok
@drifting wedge Not sure if you still response to DMs
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
make sure to urlencode it first
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;
...
}
@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
You should try to focus interactions as soon as possible as your current system will be obsolete in the future anyways
In that case I won't update my d.js version
Wont help you if you can't receive the message content any longer
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);
message.mentions.users returns a collection
Just map it
If I remember right array() isn't a valid method in djsv13 anymore
message.mentions.users.first(message.mentions.users.size)[index]
i think first() return an array
yea, need to do something like
[...<Collection>.values()]
to turn it to array
how do I use writeFile with fs as I keep getting an error telling me callback needs to be a function
you should pass a callback where you need to
how
like in the example https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback
ok
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']
}
],
});
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?
Any font that supports emojis?
Just post the error in here, please
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 }));
});```
3
collectors dont have a create event
oh they do
yes they do
what about it is not working?
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
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);
I'm not getting any errors in the console btw
why not message.createReactionCollector()?
I just followed this example
I didn't add "options" because according to the docs it's optional
Hm, so I should put .createReactionCollector() right after message.channel.send("") ?
Like this
message.channel.send("").createReactionCollector()
no lol
where then lmao
createReactionCollector is a method (function) to use on your message object
so just writing message.createReactionCollector() will do the job?
yeah, but it needs a bit more to actually do what you need
I mean the link I mentioned above does explain the method and include examples
message.createReactionCollector is a shortcut for new ReactionCollector(message)
techincally you dont need it
ah bruh moment then
but its kinda the proper way to do it
then it's not what's causing the code not to work?
did you check if the event fires?
like if it's actually called when it's supposed to work?
just tried... it doesn't
will try something else really quick give me a min
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);
});
}```
m.createReactionCollector()
UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on undefined, which is a undefined and not a function
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?
m.reactions..
^^
ah my bad lol, i edited it to m.createReactionCollector() as Waffle suggested and now i'm changing the rest of "messages" to "m"
because that error you showed makes no sense according to the code you said you did
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);
});
}```
you redefined m twice
what is the full error?
That error probably came from catch of undefined
I don't think there's something called reactions.remove
But I don't want to apply any filter
also it's optional isn't it
you could try () => true to see if it's the issue
try this
Change m.reactions.remove(..)
To reaction.remove()
still getting the same error when a reaction is added to the message
Then add filter as well
where should I exactly place it
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
99% sure that reaction collectors require a filter of some sort
m.createReactionCollector(()=>true)
v13 requires an options object
I'm using v12
update your js engine to v9
It's not catching any errors now, but still doesn't remove the reaction I added and sends the message it's supposed to send in the chat
not even the console.log
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);
});
}```
a
You will need to modify your code
To only remove other reactions except the four you want
i can simply update my d.js version and that's it though
good luck lmao
Hahaha you will face another errors in mass
There's a big change from the two versions
So think carefully
such as? is there a changelog or such?
practically the whole library brother
just rewrite your bot at that point
uh lmao i'm better not updating for now then
I'll think of something like that then, will get back to here if I need help
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
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
wdym passed process
Ask that question in Google you will get step-by-step guide
^^^^^
download the executable or the zip archive, done
Check if the node path is in your system environment on your pc
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?
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.
Did you check the docs?
couldnt find anything
like the installer stuff when u open the .exe file
may have looked in the wrong place
google wierd
Should be in the ClientUser class section
ait ty
Np, let me know if it isn't there
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.
What's so complicated to run the installer?
restart your terminal after you install it
i did run it
I did
then you'll want to check the dir node installed to to see if a binary was installed there
Is the node path in your PATH system environment?
Go and check
and my file i am attempting to run is in onather folder
Add the executable to your environment vars
^^
? what does that mean..
If it's not in that Path variable, then it doesn't know what you are talking about
OS environment vars act the same as code environment vars
They're accessable system wide
Without the need to specify the path
ye I added it to the path..
Then open your command prompt and call node.exe or just node
no
seems like I do
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
command prompt, not PS environment
Did the path you added point to the bin folder?
command promt works..
zero
restart your pc
Did his node path he added point to the bin folder?
wtf is that command prompt
Probably integrated terminal
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
hello
That won't work. You need to fix your if statement
ah it works thanks đ
Prefect
what fucking windows version are u using?
that has such a command prompt
That's window 10
Did you check the version
Ps was executed probably in command prompt
Lol did you figure it out?
looks the same to me. But like I said it's probably a integrated terminal, or a different application like window terminal 
it's the win10 cmd prompt
shhh
Lol
don't forget that this exists
wut
Ah yes the power of customization is real
saw thaat the first time in my life
right click the cmd window top bar then click properties
damn cheats
Make a filter instead of a massive if statement, plus your if statement isn't in a valid format
ok
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?
Do you know how conditional statements work?
y-yes?
Ok, then you will know that before or after an AND/OR operators it needs to result in a boolean value
Ofc
Then what type is whitelistedReaction[1]?
true?
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?
I think I quite do
Isn't it what I want though?
If the user reacted with an emoji that is not in the whitelistedReaction array, the bot would delete their reaction and send the message I put on the code
if (![array, of, ids].includes(reaction.id)) reaction.delete();
^^
how can i use: "client.user.status.presence" in discord.js v13
Are you trying to change your client's presence or just read it
read
trying to read just your client's or other users'?
other user's
Do you have the presence intent enabled on your app page and in your code
yes
it's now GuildMember.presence since presences are on a per guild basis
wtf this worked inversely
if the user reacted with any of the whitelisted reactions, the bot removes it and sends the "don't use that reaction" embed
ok
remove the ! then
How many slash commands can you make?
Did it and now it doesn't do anything
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
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
is this a good way to do settings or should i make one settings command that has optional inputs for each setting?
you should have 1 command with an input which accepts any setting
Ah, so I actually should remove the " " from the IDs to make them not-strings
nvm i misread your message
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
got it
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
Bruh it's still removing all reactions
@proven lantern You'd have to parse values manually from strings though if they accept different primitives as options. If they're only 1 primitive type, then that makes your life so much easier
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
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);
}
});
}```
use && instead of ||
|| can short stop everything in front of it whenever something returns true
how many sub options can you have
Still removing every single reaction 
that's a good question. hopefully 25

looks like we can use an infinite number of options
There's a max of 25
Integrate your service with Discord â whether it's a bot or a game or whatever your wildest imagination can come up with.
The limit is probably applied recursively as well
I thought the sub-commands could only have a depth of 1
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?
Nah they are working on nesting them as far as I know
more api changes. ffs
This change is regarding the client
if you don't replace the reference, then the changes should appear in the Array
ok
If someone knows what I may be doing wrong, I'd really appreciate if you tell me what it is
const obj = {
cool: true
}
const arr = [obj];
obj.cool = false;
arr[0] // { cool: false }
Yeah got it
I've just fixed it!
Just changed reaction.id to reaction.emoji.id
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
check for if the message reaction cache for a specific reaction includes a user
Your choice of formatting is...weird
is there anyway to localize the slash command names, options, and descriptions?
this stuff
wdym localize?
like change the language. ie. us_en => color en_gb => colour
No.
i started translating to gb
they put in random vowels in places
should we make different bots for different languages?
keep them separate
I wouldn't recommend it.
everyone should speak american english anyways
Localization has been brought up in the past but rejected at the time.
https://github.com/discord/discord-api-docs/issues/2313#issuecomment-761126291
good point
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
i'll just make a bot for each language
You gotta use guild based and whenever a user switches languages, u need to delete guild commands and then register the same commands in that guild again with the other laguage
that could work
But also remember, 200 registers per guild per day
that's probably enough
per guild
id have to have 1 global command that registers the guild level commands
Yeah, but it would still be better to add like a cooldown to commands which might involve in registering commands to an extent
/register locale: en_us
Yep
im not sure what the better ux is
But still, in my opinion too much work đ everyone would speak english for the most part tbh
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
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.
.nickname
There is no property .name. Its .displayName
This might help
ty
yes
discord shows subcommands before you even select the main command for some reason
ux pros
Integrate your service with Discord â whether it's a bot or a game or whatever your wildest imagination can come up with.
this doesn't show me the json structure
UX pros and Discord don't match
type 2 was user command
is the type 2 description currently used anywhere?
nope
only 1 supports description
others don't but they support capitalized letters and spaces for name
You didn't close your string literal with a }


