#development
1 messages · Page 1932 of 1
hm
instead it fully removed the todos bit
instead of the indivudual todo
it removed the todos array
then you wanna do
users.updateOne({
_id: userId,
}, {
todos: {
$unset: {
todoId: todoId
}
}
})
cc @spark flint
ty
I mean
I think
users.updateOne({
_id: userId,
}, {
$unset: {
'todos.todoId': []
}
})
this should work
ok
what number
didn't do anything
lol
// { name: "book", tags: { words: ["abc", "123"], lat: 33, long: 22 } }
db.collection.updateMany({}, [{ $unset: ["tags.words"] }])
// { name: "book", tags: { lat: 33, long: 22 } }
so
blame @solemn elk, i would be using mysql if i wasn't working with others lol
users.updateOne({
_id: userId,
}, {
$unset: ['todos.todoId']
})
Leave me alone 
learn to use postgres
its not hard
I went from Mongo to pg
@spark flint lemme know if this works
hmmm
can you not just do
users.updateOne({
_id: userId,
}, {
todos: {
todoId: undefined
}
})```
sorry
there
copy pasting is bad
@spark flint
just logging in again lol
express-sessions 
users.updateOne({
_id: userId,
}, {
$set: {
todos: {
todoId: undefined
}
}
})```
there
ok
Oh?
which bit
i deleted the todos array and redid the command and it readded the todos array
users.updateOne({
_id: userId,
}, {
$pull: {
todos: {
todoId: todoId
}
}
})
this
its a strting
do
string
ah ok
// Value 1
console.log(typeof value)
// Value 2
console.log(typeof value2)
// Value comparison
console.log((typeof value) === (typeof value2))
users.updateOne({
_id: userId,
}, {
$pull: {
todos: {
todoId: Number(todoId)
}
}
})``` was the final code
alr
Number is a constructor
parseInt is a func
Number will cause a fatal error if passed wrong value
parseInt will return NaN
just for reference @spark flint
np
So asked tghis yesterday too but am kinda stoopid;
How can I delete guild specific commands? Still haven't found anything, Neither do I know how to find the ID of a command
GET Request To https://discord.com/api/v8/guilds/:id/applications/:appid/commands
DELETE Request To https://discord.com/api/v8/guilds/:id/applications/:appid/commands/:commandid
iirc
@novel snow ^^
no lol
it should be channel.nsfw
like I said
channel.guild.nsfwLevel is for the guild
NOT the channel
nsfw level how lewd the guild is
Tried that but still got this
Not really?
from what I remember, I'm tired
If you want to parse both integer and floats, use Number()
Otherwise parseInt() for integers and parseFloat() for floats
Yea
he wanted int
so
my reasoning was wrong
my logic was also wrong
but i gave the right answer
😎

@delicate zephyr daddy show me your ways
now does anyone know how to centre a button in tailwind
/applications/{application.id}/guilds/{guild.id}/commands
its that
sorry
Lemme check that
got it the wrong way round
y'all doing hour of code?
nah
aw
^
google doesn't help
Still got the 404 error
get rid of the/ at the end
Why not just use normal CSS
am special
and the entire rest of the dashboard uses tailwind
Tried that now and returns nothing, Which luckily isn't a 404, But also not optimal
if it returns nothing then theres no commands on that guild
if there are
check global
/applications/{application.id}/commands
I kid you not
You could probably use a grid and place it centered
oh god
I am dumb as hell
lmfao
In my project, I ended up using flex and growing the elements around it (I was placing an image between two dividers)
Can someone help me convert this to respond to all messages and not just guild messages?
client.on('messageCreate', (msg) => {
if (msg.author.bot) return;
if (msg.guild) {
if (msg.content.startsWith(`<@${msg.client.user.id}>`) || msg.content.startsWith(`<@!${msg.client.user.id}>`)) {
client.util.handleTalk(msg);
}
}
});
This is my code for converting my bot to V13 and it's hard to figure out DM messages, The flag is already in the intents.
you're checking if msg.guild but not doing anything If it's not
You need something in the else to handle dm
Yeah How would I check messages in DM?
But with msg.(what)
You don't need that if you just put it in the else
You can check the channel iirc to see if its a dm channel
Thanks I was gonna use Message.content
what's client.util is that something new with djs 
You can load a file into client and call it whatever you want
it's the utility file
I have a utils file full of functions
oh i thought it was a default thing for the client 
How would I go of putting this in, I never used a else statement
just if statements
make the E in Else lowercase?
Same error
learn basic js 
I did, It's just V13 is confusing
bad
dude
if you want your code to work on all messages
just remove the if in the first place?
like,
you're literally doing "if message is from a guild, do this"
just make it "do this"
lol
also for future reference, if else doesnt necessarily need another if
if(something) {
// do something
} else {
// do something else
}
if () {
^
SyntaxError: Unexpected token ')'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1031:15)
at Module._compile (node:internal/modules/cjs/loader:1065:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47
exit status 1
That's the error I got
you're just trying random shit without knowing what you're doing
i said remove it
do you understand what an if block does?
what would be the best way to convert seconds to hours / minutes
math
seconds/hours? minutes/hours?

You may have one in the future if the Temporal proposal gets accepted.
https://github.com/tc39/proposal-temporal
It'll have a Duration object which you can use.

For now, you're stuck with math (seconds * 60) or some library
yeah I just did the math for all of them lol
Yeah 60s * 60 = 3600 min
Sounds about right

Interesting new math methods been revealed in this channel
slow down there Pythagoras
seconds / 60 = minutes
Klay is just drunk
hey guys
Need a little help here.
How could I be creating these chats within a category? (V13)
if (search) return interaction.reply({ content: `**\❌ ${interaction.user} Você já possui um chat metas aberto: ${search}**`, ephemeral: true })
interaction.guild.channels.create(`meta-${interaction.user.tag}`, {
permissionOverwrites: [
{
id: interaction.guild.roles.everyone,
deny: ["VIEW_CHANNEL"],
},
{
id: interaction.user.id,
allow: ["VIEW_CHANNEL", "SEND_MESSAGES", 'READ_MESSAGE_HISTORY']
}
],
parent: <category channel or id>
in new V13
wdym?
like the right way to put a variable here?
interaction.guild.channels.create(`meta-${interaction.user.tag}`, {
permissionOverwrites: [
{
id: interaction.guild.roles.everyone,
parent: id_categoria_no_servidor ,
deny: ["VIEW_CHANNEL"],
},
{
id: interaction.user.id,
allow: ["VIEW_CHANNEL", "SEND_MESSAGES", 'READ_MESSAGE_HISTORY']
}
], ```
in parent
@quartz kindle
do you know which category you want to put it in?
do you have the category id?
or do you want to search by name?
no
the category id is inside "id_categoria_no_servidor"
I just want to know how to put the variable here correctly
just like that
.
but
you put it inside permissionOverwrites
you have to put it outside
{ parent: ..., permissionOverwrites: ... }
interaction.guild.channels.create(`meta-${interaction.user.tag}`, {
parent: id_categoria_no_servidor,
permissionOverwrites: [
{
id: interaction.guild.roles.everyone,
deny: ["VIEW_CHANNEL"],
},
{
id: interaction.user.id,
allow: ["VIEW_CHANNEL", "SEND_MESSAGES", 'READ_MESSAGE_HISTORY']
}
], ```
this way?
yes
de nada
can some one help me
i want my bot to show that Add to Server button
but i dont know how
can anyone help me
depends on how you want them to input the date ig.
You could have em do month/day/year (separated by slashes ofc)
and then split on slashes to get the individual values
that is one way to do it
or some people like month.day.year and simply split on the .
true, I can't think of any way to differentiate
I guess you could check if the first value is over 12 and if so its def referring to days and not months
but idk if that is the best option
developer portal > application > Oauth > general > set auth link there and "save"
it shall be visible then
or u can just add 3 options one for date , one month , one year ? (||code may get long but ok if u want to||)
What are you doing with the dates anyway?
is this for some kind of timer?
Ah
Well
Is it supposed to be of the current date ?
or when it should be done by
Ah mk, nvm then
If it was the current date you can just use a time module for whatever language you are usingg they usually have em built in
didn't know if you were using js or not
but Date.now() returns a timestamp
how can i put this variable here?
the variable ${role_membro_no_servidor}
let painel = new MessageActionRow().addComponents( new MessageSelectMenu()
.setCustomId('menu')
.setPlaceholder('Verifique as opções') // Mensagem estampada
.addOptions([
{
label: 'Painel Inicial',
description: 'Apenas o painel inicial da mensagem',
emoji: '📓',
value: 'painel_inicial_fac',
},
{
label: 'Promoção: ${role_membro_no_servidor}',
description: 'Promova este membro a ${role_membro_no_servidor}',
emoji: '🔥',
value: 'promomembro',
},```
unless that is what you'd want you can just do new Date() to get the current date
back ticks
fair enough
I usually like using timestamps as well so I can format it how I want later
Honestly
you could do something simple
well maybe not extremely simple
but you can give the option to supply the time you want it to be done in e.g /reminder feed dog 20m (this could work for days, months, or years)
Just a suggestion
thanks
I assume with a to do list of it being required to supply when it needs to be done you'd send a reminder at least right?
I see, some people send reminders at least I do kek
Well the thing is you don't need to constantly check
Yea
You can set a interval that uses the time provided to send a reminder when the time is up
setTimeout runs instantly
setInterval doesn't run until the time provided is up
At least I think that is how it went let me check I haven't used js in a while

wait no I am dumb setTimeout would work
I haven't used js in ages
lol
Anyway as for your original question, you can just do what you were originally doing and just have them provide days or whatever since you dont plan on sending a reminder it is just for show
Well, I am probably not the best to answer this. I just code I don't know the exact drawbacks to using multiple setTimeouts if there even is a big drawback
I think for now as long as the bot isn't big it should be fine before needing reworking.
Then again i've been wrong before 
hopefully someone who is savvy enough can answer this question.
no problem.
I might actually make a bot in go to do reminders and such 🤔
I haven't tried discordgo v9 stuff yet
yes
the pog lang
oh no here comes shiv
👀
probably going to roast me for using go
Instead of many timeouts you could run one cron job that runs through all reminders on an interval. Reminders could be pulled directly from the database or cache, choice is yours
Not sure why one cron job would
Having many timeouts however is a different story on larger scales, as @earnest phoenix mentioned
To put it simply, yup
Make a function that will go through them and do whatever and make it run at an interval like 1 minute
Instead of fucking up your CPU and RAM with lots of data to be calculated, you just have one function running every minute doing what you need
shiv you are a py dood right?
Not on a larger scale
thank u so muchj
Let me explain it
If you run many timeouts at once, my bet is that your CPU power is used to calculate the time when the reminder will go off. Multiply that by 1000 and you may not get pretty results.
Now, compare that to just one function that runs every minute and on each reminder, it checks if the timer has expired
It'll do it synchronously + not as bad
Yeah sort of
I mean, it'll be limited to one reminder at a time
You're practically barely using your CPU there
should I continue my py course in my cs class ?
I want someone to choose for me :p
k
You indecisive little bi-
Do you want to? What are your other options?

either py or continue learning a language I have already used for a few years even though I suck at it
Something new might be better although I don't have much hope for it
and might I add I wont really use that language again
Python then sure
Ight
then I will continue my py course
We have two courses going on now, py, and html +css +js
Yee ha
I wanna try some new languages in my free time, but my brain capacity and time is mostly dedicated to existing projects to rewrite and update with Discord
Sad
Get into PHP, bash and shell and continue my shit.
I need a break as well…
We all do at some point
Nvm I actually wrote batch and meant powershell lol
Give yourself a break...
... with KitKat!
Damn auto correct
Lol says the guy dealing with python
Eyo

Why you gotta do me like that sir
Because you need that hate to live
You devil!
Mwahahaha
Programmers
Hate
PHP
PHPHP

Hey is there a way I can add a custom method to message.channel? Something like message.channel.sendMessage() in typescript
yes there is. You can extend off of one of the channel classes (idk which one) and add your own method to it.
Not sure if you could do that anymore since they removed the ability to extend structures
oh right forgot about that
I think you still can as long as you declare the new class with the updated method right?
You have to modify the library itself probably
You can't make it use the class you extended
declare module 'discord.js' {
interface ClassName {
updatedMethod: functionHere
}
}
iirc
That's only the typings
Yeah I tried extending the Message class but I actually need to add the method to the Message.channel
And channel is readonly
You wouldn't wanna extend the message class anyway
You'd wanna extend one of the channel classes.
since you are accessing a channel at that point
but like flaze said idk how to do that anymore with structurres not being a thing
Yeah but how will I assign the channel to another variable
Since I can’t clone the channel
I need to inherit other methods and add this extra method
What?
I need to inherit all of the channel methods and props and add an additional custom method to it
I mean extends ig
That is the entire point of extending a class, it inherits all of the methods and props of the class you are extending. but either way I don't even know if extending the class will work the same way anymore since structures isn't a thing
Mmmmm let me try a couple of things
Blame this motherfucker https://github.com/discordjs/discord.js/pull/6027
"Wahh wahh it can break things" It's for people that know what they're doing
No shit it'll break if some dumbass tried to use it
But I understand, most people that use the library are dumb
cause most people who use it aren't exactly iCrawl or Tim

they are completely noob at coding
I personally didn't mind the structures I thought it was kinda cool
I've broken shit a few times trying to use it though I won't lie. I kinda fucked up on some stuff kek
welp, thats that
ClassName.prototype.sendMessage = () => { ... }
declare module 'discord.js' {
interface ClassName {
sendMessage: () => ...
}
}
That update was the nail in the coffin for discord development for me
because I did tons of extending before that because it just makes things easier but now suffering entails
yeah structures were my easy way of reverting stupid discordjs petty syntax and name updates
how to ts-node shard.ts? I keep getting the error "cannot use import outside of module" inside of my client.ts that gets called from shard.ts
my current folder sturcture
src/
server/
client.ts
shard.ts
.env```
https://discord.js.org/#/docs/main/stable/class/UserManager?scrollTo=fetch I guess this is what you are looking for
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Without
?
Did you read the docs they sent?
It's quite literally const user = await client.users.fetch(idFromDB);
rebuilding the whole prototype chain. Poggers

bsc.address = $(el).children("a").text();
do u guys know how i can filter the bsc address to not catch addresses longer than 42 characters
What's hard about using a function?
how do I let the users know that they dont have enough perms to run the command?
it just keeps thinking
no no
I meant
its a dm command, so if DMs are closed I can just catch error and send an error message
but in this case, I couldnt catch error
so how do I let the user know they dont have enough perms to run the command
add an else?
mm hmm will try that
selected wrong channel
Deleted
Anyone?
How do I start a shard file in typescript ;-;
try this
new ShardingManager(file, { execArgv: ["-r", "ts-node/register"] })
works, thanks a bunch
i've been using debian, but most linuxes are fine
debian is a bit smaller than ubuntu, doesnt have so many features included
ok now the client messageCreate event isnt being invoked
// handleGuildEvents(client, discord);
client.on("ready", async () => {
console.log("listening");
client?.user?.setPresence({
activities: [{
name: config.IZZI_WEBSITE,
type: 3
}],
});
try {
// handleMusicEvents(client, discord);
// client.music.init(client.user.id);
// client.musicQueue = new Map();
// erelajs for streaming music from lavalink service
if (client?.shard?.ids.includes(0)) {
// client.user.setAvatar("./izzi.jpeg")
console.log(`Logged in as ${client?.user?.tag}!`);
// setInterval(async () => {
// await redisClient.flushAll();
// }, 1000 * 60 * 60 * 2);
}
} catch (err) {
console.log(err);
return;
}
});
client.on("message", (message) => {
console.log("work pls");
message.channel.send("worked");
});
};
export default handleClient;```
I can see the "Logged in as botTag" but the message event isnt working at all. i tried messageCreate as well..... this worked with js
ahh, what am i supposed to specify? i think i specified 0
messageSweepInterval: 2,
messageCacheLifetime: 2,
retryLimit: 5,
intents: 0,```
what about for interactions? "guild interactions"?
i add this in index.d.ts right?
Thanks bro
declare module "discord.js" {
class BotChannel extends TextBasedChannels<CustomEmbedProps> {
sendMessage: (content: string | CustomEmbedProps) => BotChannel;
}
}``` Am i doing it right? i dont have access to any of the other channel methods...
```const newChannel = new BotChannel()
newChannel.sendMessage() // exists
newChannel.send() // doesn't exist```
i tried GuildBasedTextChannel class too.
and where do i do the implementation
new class?
well, i cant extend the Message class
TextBasedChannels and GuildBasedTextChannels are types
I’m using Node Canvas and have converted the current canvas to a buffered image using canvas.toBuffer(), but for testing I want to save the file as a .jpg. How would I do this? AKA how would I save a buffer
fs.writeFile
Oh mb thanks
C++
Is it possible to use cin on a variable of type int x [10]? If yes, how would the input be read?
Pretty sure it’s easier to just use a vec and use a for loop to push to the vec
This is gonna be fun as I've never worked with C++!
Thanks for the advice
Vectors are pointless here it seems, I only need 10 elements
Might be relevant https://stackoverflow.com/questions/16329074/how-do-i-assign-a-char-pointer-with-cin
you're in for a little shock
Seems helpful, thanks
How little are we talking?
what do i extend... to inherit all methods from message.channel
just enough to power a house
message.channel can be multiple different channel types
either extend the types you need, or extend the base types
mm
threads are a channel type yes
the base class for all channels is Discord.Channel
the base class for text channels is Discord.TextChannel
the base class for guild channels is Discord.GuildChannel
agent ??= new https.Agent({ ...this.client.options.http.agent, keepAlive: true });
I get this err on heroku, how can I fix it?
nope
I think bcs the node version in heroku is too old
how can I update it?
'cause I never got this err on the other host
Super confused why I am getting this error. I specified the commands and redeployed them, but when using the /user command the sub command option appears as “mentionable” instead of “user”.
Code:
https://sourceb.in/94LQXPMa8e
user is mentionable
ah nvm, it does show different for users nvm, u choose what it should show
did u upload the command again? also, is it global or server?
Yes I did. And it’s guild
that's the reason
the name of the property is "mentionable"
but the type is user
yw
Well the slash command appears correctly, but I still get the sub command error
welp, that one idk the cause
solution: use the other host
or ig you can just npx esbuild index.js --target=2015 | node
I dont want to pay anymore for and VPS for 32 servers
pov: your website uses the lamp web design
because of your "includes"
you're checking "does assistance have ass in there"
shrug, am not skilled in js
just not how to make it actually check if it has that word
possibly a regex that checks for the full word?
ass is tant
If you want a basic filter, split the string by a space and check if an individual word is equal to a word in your filter box
They're useful for certain communities
A$$
like that
everyone knows filters are exploitable
but we still use them since they're useful
particularly younger communities
but some filters are aggressive and build a worse experience
cough Roblox
words.forEach(w => "a text".toLowerCase().split(" ").includes(w))
although you'd probably be better saving the split text to a variable
and using a normal for instead of forEach
dangling }
format ur code to see where you're missing a {
also don't simply copypaste my example
Try using .some instead of .forEach
Personally, I'd rather write
"Lorem ipsum dolor sit amet, consectetur adipiscing elit.".split(" ").some((word) => array.includes(word.toLowerCase()))
When using the /user command this error below is thrown. I haven’t seen anything on Google related to getSubcommand throwing an error, so I’m not too sure what’s going on.
Code:
https://sourceb.in/94LQXPMa8e
issue is with a stray bracket somewhere
that's the thing, your code isn't properly formatted so I cant find it
always indent the code
show it
also, stop using var, it'll cause you more trouble than it's worth it
that's nowhere near formatted
//==============For Uptime Robot ============
const express = require("express");
const app = express();
app.use(express.static("public"));
app.get("/", (request, response) => {
response.sendFile(__dirname + "/views/index.html");
});
const listener = app.listen(process.env.PORT, () => {
console.log("Your app is listening on port " + listener.address().port);
});
const config = require('./config.json');
const token = config.token
const Discord = require('discord.js');
const client = new Discord.Client();
const ms = require('ms');
const fs = require('fs');
client.on('ready', () => {
console.log(1)
client.user.setActivity(`naughty words`, {type: "WATCHING"}).catch(console.error);
console.log('Bot is ready to read cmds!')
})
client.on('message', async (msg) => {
if (msg.author.bot) return;
if (!msg.guild) return;
if (msg.content.length >= 200) {
msg.delete();
var bulk = new Discord.MessageEmbed()
.setTitle('🚨 The Cops have arrived! 🚨')
.setDescription(`${msg.author}, you cannot send big messages in the server!`)
.setColor('RED')
.setTimestamp()
msg.channel.send(bulk)
}
var array = ['fuck', 'shit', 'bitch', 'ass', 'arse', 'dick', 'arsehole', 'asshole', 'cunt', 'wtf', 'pp', 'wank', 'whore', 'pussy', 'twat', 'specy', 'nonce', 'tosser', 'piss', 'vagina', 'penis', 'sex', 'testicles', 'balls', 'cum', 'nonny'];
array.some(w => "a text".toLowerCase().split(" ").includes(w))
msg.delete();
var embed = new Discord.MessageEmbed()
.setTitle('🚨 The Cops have arrived! 🚨')
.setDescription(`${msg.author}, please do not swear in ${msg.guild}!`)
.setColor('RED')
.setTimestamp()
msg.channel.send(embed)
try {
} catch (err) {
console.warn(err);
}
})
client.login(token);
this is formatted
also I did find the bracket
when you format the code, two brackets cant exist like that
aligned brackets = there you have it
well, that's bcuz you just copypasted our examples
both mine and Klay's have hardcoded strings
so it'll always trigger
So I'm having issues with some web development stuff. I made this typewriter effect but now everything under it moves along with it
I'm not sure if it's because everything is in the same div as the typewriter effect stuff
anyone do aoc day 3?
nice
part 2 is kinda confusing
but u get it after reading the example I think
it really helps if you know bitwise operators
it is a bit confusing
but it feels more like a sorting algorithm
I've been staying away from using bitwise operators. Instead, I just store them as strings and parse it with a radix of 2.
Why would you avoid using bitwise?
don't feel like using them
🤨
It's been much easier for me to say "for all the columns, if the number of 1s is greater than 0, x, else y. Then, parse with radix of two and multiply"
Does anyone here use the interactions endpoint url for receiving interactions? If -> Why?
kek
the websocket uses a lot more resources
And if all your bot does is interactions then there's no reason not to go with an HTTP server
Scales a lot easier
Makes sense, thanks for the answer!
?
nothing, hit tab and swapped from search to chat
typed half my search into chat, just was goofy ^_^
does anyone have the code for buttons on node.js and help implement them for me?
I can help you
nvm i fixed
could i use slash commands while still having per server languages?
how do i use discord oauth with express.js? can't find an easy and suitable solution online
In Addition to Feuds answer it’s also planned to support pings to your endpoint you have to acknowledge to have a full working intergrating (bot) like if you would use an active gateway connection.
Which only sends data (except pings) if an user starts an interaction in any way.
it's just i see this but I still do the old way for commands
I tried slash commands once before and i didn't like them
The commands need to be registered as well as their descriptions, means the command name and description will require a static language.
But any response in your code can still support multiple languages - why not.
Btw, localisation for slash commands is going to be a thing
so you can define multiple languages for slash commands
do slash commands still have that slow caching thing
can i enable and disable commands depending on the user, role, channel and server
is there a good way of calculating the ping time (for a ping command)
I thought the interaction endpoint has to already reply to pings?
Oh do you mean that they are not yet seen as a way to tell if I have a fully functional bot up and running?
Oh… regarding the development speed maybe in 2023 

Rolling out global commands does require up to an hour to be pushed into all guilds yes.
For specific dynamic commands you can still use guild commands to register a command for your needs and remove it after the user interaction for example
Does it already? Maybe I’m not up to date but yeah possible
At least it doesn’t support an online status of you app yet iirc
Based on that pings
But may I’m not up to date
Yeah it does, it does not allow you to have an interaction endpoint without it replying to pings. I found that out when we tried to debug my interaction receiving problems. I thought that I might setup the interaction receiving endpoint, but ended up deciding against it at least for now.
Yeah I think so too
what if im making a bot where you can use a web panel to enable and disable certain modules and commands and set role, channel or user based conditions for commands
I see you misunderstood what I mean.
I was speaking about ping acknowledging to check your app status, not ack interactionsY
It makes sense then to register the enabled commands as guild commands.
But for example use a few global commands like a /setup command or /help etc which is available globally
The guild commands would be available immediately
But respect the rate limits when being able to enable/disable specific commands
would making an action queue solve the rate limits?
No rate limits regarding how much commands you can register per guild per day
Disabling and reenabling commands will cause a rate limit quickly
yes, i will queue up the commands and do the ammount that can be done in a day and then save the rest for the next day
Or limit it in your panel
That looks like a bot token to me
Unless they didn't use the whole thing
I don't really know how to use whatever module they are using tho so I def can't help much here
If it is a self bot no one will help em
still selfbotting
Well Yes But Not Pub
dont ask for selfbotting help here
Self bot not good
its against TOS and nobody will help you do it
sure you didnt
well don't ask anywhere for selfbotting help 
well discord is very clear about selfbotting
Me cause I'm a good discord user
People may not read the full ToS since most of it is shit but at least know the fucking basic stuff like this
I read the bot guidelines normal guidelines and tos
i didn't read the whole tos but any halfwitted bot dev or general user will know
you should read the TOS on anything you use because otherwise you might get banned 
too lazy to read full ToS? no problem, use text summarizer https://www.paraphraser.io/text-summarizer
just use a regular bot

Xiuh quickly reading tos
A second must be a minute for you if you can read the ToS of anything.
actually ToS are pretty quick to read
will not might
the actual content is the mid of it
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
remember this chat is for development and should be chat about development 
One message removed from a suspended account.
ok new dev subject
day three of advent of code complete
it took me way too long to finish
any symbol? there's a lot of them
the main ones
how about a regular expression
Regex
/[ !@#$%^&*()_+\-=\[\]{};:"\\|,.<>\/?~]/
Yeah
New subject x3
How can I compile fancy letters like thîś to normal characters like this in discord.py or py
use some normalizing library
okay
actually python has the unicodedata module built-in
Check for a-z and 0-9 and negate the result since that has way more performance
so you may be able to use that
oh okay
Checking this cases, results in way less iterations of your regex than actually checking for each special char
yee @boreal iron don’t talk to yourself
… I know
Leave me alone sir!
Welcome to dealing with US businesses
Not that Snowden has already told us any shit
You can shorten that even more until this final result:
Our software - fuck you - we can do and keep what we want! Follow or fuck off.
"include but are limited to"
You agree (do not attempt) to use the Services for any purpose other than
(i) expressly permitted by these Terms.
(ii) Copy, conformity, modification, derivative creation, distribution, licensing, sale, broadcast, public display, public execution, broadcast, streaming, broadcast, source code discovery attempt, reverse engineering, decompilation , Disassembled Use This service or part of this service, unless expressly permitted in this Agreement.
"public execution"
the more you try to summarize the ToS the more it looks like a 7yo wrote it
but these classes dont have the send method
Yo can you help me with some logic stuff real quick
I'm asking you cause you've talked about it before and I had questions I never got around to asking (I'm talking about slash commands)
Just ask… as long as I answer means I haven’t hit a tree yet
where do you find sources to learn and understand things indepth :p and find out more
just google a topic and you will likely find stuff related to it that explains it
Hmm most things you deal have a documentation or manual these days
you should have asked that question 15y ago
Property 'sendMessage' does not exist on type 'Message<boolean>'. Getting this error```import { Message } from "discord.js";
import { CustomEmbedProps } from "./types/embed";
declare module "discord.js" {
interface Message {
sendMessage: (content: string | CustomEmbedProps) => Promise<Message>;
}
}
Message.prototype.sendMessage = (content) => {
return Message.prototype.channel.send(content);
};``` This the code
Where like nothing of this stuff exists and you had to read the source code to understand things and to try things yourself
Just wondering, but why not use a function?
function sendMessage(message, content) {
message.channel.send(content);
}
true. i still get into source code these days to understand things better. but my basics is surely out the window
you'd have to import that function when you wanna use it.
And what's wrong with that?
im actually trying to replace message.channel.send() with my custom message.channel.sendMessage
why
like I get the point of adding your own stuff onto the classes and such
but why with sending
i used message.channel.send() content the other way in djs12. where i could somply just send(embed)
now in djs13 I have to send({ embeds: [embed])
i cant change that everywhere in my project
so writing a wrapper
that way i could easily just replace the method being used
and not the way args are being passed
okay
so...?
but that makes no sense to me.
Anyway as for how to fix that problem I don't even know anymore
:p
I'd have to experiment since they removed structures
which I just so happen to be about to do so when I find an answer if no one has given you one I will help
ye sure
also, my question about slash commands is how I should handle loading em.
My thought was make a collection of sorts that loads the commands from their files and then loop through them to grab the metadata and load it using the d.js slash command thingy
but how should I check to make sure im not loading already loaded commands and will this effect me editing the slash commands?
Seems like a lot of work regarding the fact messages can now contain raw content, embeds, components etc.
To figure out any that by passing it to your new method instead of passing it as option which already defines which options it is (like an array of embeds, components etc)
lel but that would actually save a lot of time instead of changing how i send the embeds etc
so im willing to put some work and time now which would help me later on
Huh did you ask something? Hard to follow any message on mobile
imagine i change things everywhere now and later djs decides to change the way messages are sent again :>)
so better to have an abstraction on top of any 3rd party lib
atleast for the important ones
Hello!
I don’t think that syntax will change again as passing that as options seems to become the standard
Not only in JS
But I got what you mean
yeah but considering the way my project is alreayd structured, its better to put some time on the abstraction rather than changing things everywhere
ye
Ye I did right above your response to them
I would be more concerned about to adjust and rewrite your prototype replacement if the background changes in any djs update
Oh gimme a second
true, but for now I have to go down that path
Yeah sure I mean why not, your decision of course
I think if I were to loop through my collection and load my slash commands while also checking if I have already loaded that slash command might hinder me editing a slash command
Back to you
It seems you’re mixing loading commands into your apps cache and registering them
how do add that github connection on my profile?
The structure of the command files is mostly the same like common commands
You load any of that when initiating your code into the cache, yeah for example in a collection or map
That’s the first part
nvm about what i asked lol
Second part is to register the loaded commands and to check if they are already registered or if they need an update or need to be removed
Well idk much about GitHub anyways
yea my confusion is on how I should go about doing said thing
That’s actually less complicated than you think.
I wrote a function doing that shit which will be called in the READY event
actually I don't have to loop through the commands do i
the body can accept an array of commands
I am talking about doing it the rest way
I see
That function fetches the registered commands from Discord and loops through them and your loaded commands, compares names, descriptions and options to each other and registers/updates/removes commands if needed
mmm
let me make a function of what i'd think that would look like
Also do you think it'd be worth messing around with decorators?
Since anything is saved as map/collection you can easily check if a command exists on Discord or loaded from your files
One example:
I had the idea of making a decorator that would take the slash command metadata but then again it seems kinda dumb
The fetched command from Discord is called "ping"
Looping through your loaded command files checking if the map/collection has an item with the key "ping" (if the command name is the key)
If not remove the registered command from Discord (bc it doesn’t exists locally anymore)
If yes check if the description and options are the same - if not update them
I see
I will make an example function of what i'd think that look like in a sec
I might need help with it :p
I have shared an example in here already containing like a big part of this handler
If you’re good in searching give it a try
It sucks on mobile tbh
You basically need two loops after fetching the commands from Discord
// 1st loop
Loops through the fetched commands to check if it does contain a command which doesn’t exist locally anymore and removes it
// 2nd loop
Looping through your loaded command map/collection, get the item of the collection of the fetched commands from Discord to compare the description and options
or
interactionCommandClient.addMultipleIn("./commands");
what
detritus

No one uses detritus
tf
145 discord.js refugees
compared to djs
so its literally barely anyone
don't get me wrong tho detritus is still noice
I just don't like how some of it works with ts. then again that is just my personal preference
like svelte
and also ts is just weird to begin with so it isn't entirely detritus' fault
it's AMAZING but barely any community support
this tbh
is starboard working
my biggest complaint about detritus with ts from the last time i asked for support on this issue, it was me needing to use mixins to extend their classes to add my own stuff onto em. which isn't a giant issue if i can't get it to work but it would make stuff a lot easier
and I don't like the way it is done so I was like eh no thanks not worth the effort

"djs is easier"
the same reason you don't find quality content on top.gg
if im being honest
no you're not
detritus is actually fairly easier
You just proved my point
it is just I don't agree with ts a lot cause of how fucked some things has to be done
so I just dont use detritus
a lot of it has to do with me being a lazy boi
it's hard because it's just an api wrapper with the only helpers being slash commands and message components
yea
I'd like to use detritus it just confuses the shit out of me when I wanna do my own custom shit to it.
I can't overwrite the types and shit without it yelling at me
so I am forced to just go off of one of the examples even tho I wanna try my own stuff.
what is the inv link for detritus discord
check dms
don't open #lobby channel
ty
sucks I join on that channel

also the docs suck because they use typedoc
bookmark this link:
https://googlefeud.github.io/docs-demo
someone made better docs?
google feud did
nice
hopefully i can actually do what I wanna do and not get yelled at by detritus
I've only heard good things about ts
don't lie
Is it actually bad 
ts isn't bad
its just dumb sometimes
it has its moments where it can be an absolute dummy
That's js too ^_^
what are you trying to do
I've heard good things about php too
@earnest phoenix
import { InteractionCommandClient } from 'detritus-client'
import {Configuration} from "@sach1/dahlia";
declare module 'detritus-client' {
interface InteractionCommandClient {
config: Configuration
}
}
export class CandyClient extends InteractionCommandClient {
}
this is what I mean
TS2689: Cannot extend an interface 'InteractionCommandClient'. Did you mean 'implements'?
I am not entirely sure what to do here since this is what I am used to doing to overwrite types on something 
and when I asked for help in the support server erwin just said "use my example" instead of actually explaining the issue or helping
well, why are you trying to directly hit the api with node-fetch
can't u just use djs
well first you need your bots token to use as an authentication thingy then you'd look at discord's docs and find the endpoint to send a message and follow their example
you'd wanna use put
const resp = await fetch("someURL", {
method: "PUT",
headers: header,
body: {
content: "Some message"
}
})
I think
I can't exactly remember
yea
that looks correct
idk if you gotta stringify it probably not tho
no
let header = {
"Authorization": `Bot ${token}`
}
might even have to do "Content-Type": "application/json" i dont remember if you do or not
I don't really know how to explain it well
Just use CandyClient as a reference for types instead of InteractionCommandClient
Wdym
i dont understand ah
can someone explain how a library written in typescript doesn't work with typescript
this is why deno stopped using ts for internal code
what lib ?
Why do you need to type the new properties?
It won't complain if you use CandyClient.config since it's part of the class
I am trying to attach config onto interaction command client
and best wya I know how is to extend it with my own class
so I can use it anywhere in my code
You're already doing that by extending the class
since the command client will be accessable in all commands
I can use config when I need to
Yes, it's all instantiated by the extended InteractionCommandClient, assuming you use new CandyClient(...props)
The config property will be accessible
mmm
I see
So from what I am understanding from detritus is, you can make a shardclient and use it alongside the interactioncommandclient by supplying your shardclient to interactioncommandclient?
person went offline 
ikr 
the interaction client handles it for you
ye I figured it out :p
Hi developers I need some help if someone is free rn?
hi developers, can yall code me a bot for free?!?!??!
💀 ☠️

People who ask a question then go straight to general chat 3m later asking for help
fr
It's not even a question it's more of a statement
First of all ask a valid question don't just say you need help
We sadly can't read minds
Ok I am sorry
Problem is
I am making suggest command
It should go like
=suggesti suggestion
And then that suggestion go to my dms
Problem is
When someone type their suggestion
It doesn't send it all
Just a first word of what they said
AND I fixed it
Ok I am sorry. Problem is, I am making suggest command. It should go like =suggesti suggestion and then that suggestion go to my DMs but problem is, when someone type their suggestion, it doesn't send it all. Just a first word of what they said and AND I fixed it
Hey dude, interesting story. Anyways, in order to solve your issue, you may use let suggestion = args.slice(1).join(" ");.
I see a little spam here 💀
No dude, it was a story.
My popcorn finished before I even finished the story.
Damn, I need pop corn?
like at the cinema
Again, it finished. 💀
Sure, will.
Explaining a joke imagine
Where could I find a list of all bot related discord APIs implemented since early 2018 (an estimation of how dated my knowledge on bot development is) or could someone tell me?
Ok yes, definitely early 2018
Would phone bots against the rules or just unmoderated phone bots?
wdym by phone bots
bots made on mobile
i mean there are people who clone on mobile but they need to have 5 unique commands or more
but its best to be original and honest with work
No
Like one that allows you to talk between servers






