#development
1 messages · Page 17 of 1
check the settings menu
a combination of both
on your website?
ye
change the language, enable full intro, and reload the site
wait isn't the markdown view disable iframes as well
a cloudflare worker was taking the home path over 👀 stink
you can't use iframe now what?
don't think so, iframes do work on longdesc
hover over it
I cant print the warning message cuz it disappears when I printscreen
i thought the sanitization disabled that
what does it say? it doesn't say anything for me
didn't know that was needed
try adding it
ah wait
maybe it doesn't allow http
yep, it works for mine
u might need to enable ssl on ur site
I must be doing something wrong
olá
ssl
it didn't work when I tried my http route
bonjour
what do you mean?
I haven't done a ssl my website can't be secure I don't even have cloudflare
cloudflare isn't needed, it's just an easy and free way to get an ssl cert
and using https doesn't mean it's secure, just means it's encrypted
okay then how do I get that certificate, like I said I never actually made a secure website before
you don't change the website at all
all you need to do is add your site to cloudflare, download the public and private keys, add both to their respective folders and point your webserver to the PUBLIC certificate
then route http to https so people get redirected if they try to access with the missing "s"
easier done than said tbh
I'm so confused
I just realized that I can't
I've got a subdomain (butler.only-fans.club) not a domain (only-fans.club)
only-fans.club isn't even a thing that is just a empty proxy
?
that shouldn't matter at all
my api site is also a subdomain and has ssl enabled
Does the nodejs process somehow store the current package.json version of the app?
on the runtime?
when I try adding it cloudflare says I can't, because it's a subdomain
do you own the main domain?
I changed the domain to a different one it's secure now
A fast, refined, and cleanly written all multi-purpose discord bot.
...did u buy another domain or are u borrowing it from someone?
scarlex.org is borrowed
but it works so ig it's fine for now
yk domains are dirt cheap right?
I tried looking on freenom for one, they cost a couple hundred dollars
how is that cheap
freenom is never yours
huh wdym
freenom domains can only be borrowed (in a sense), the ownership is always of freenom
hmm nvm just imported it from the package.json
if you look at the source code of the site, your site is ran inside a page-sized iframe
it also includes a bunch of trackers and wacky metadata that prevents it from working when embedded in 99% of sites
plus most services straight out blacklist it since it has a loooooooooong history of scam and phishing sites
then how am it supposed to code it lmao
after u refresh the page it'll go hidden again
aah okay got it, let say i lost the token can i still reset it again tho?
yes
alright ty
ye just wanted to make sure
smh
yep
damn ok anyway how do you do that then?
check the docs (if ur lib already supports it)
You either respond with a modal to a command interaction, button interaction or other interactions
Not sure if you can respond with a modal to a modal interaction but in theory it should work
Not sure if discord restricts that
I see
I think I'll do that without the modal actually..
I need a little help getting that set up though
if a text is like this
"hello this is a text"
can I just take it. Use .splice(" ").
and then join it like text.join("%20");
to be
"hello%20this%20is%20a%20text"
Replacing using a regex makes more sense
To let double spaces or other whitespaces be replaced by one space (URL encoded) only
Also you can simply URL encode the entire string
If you don’t need to replace special chars anyways
const textToDisplay = await awaitResponse(
message,
"What mesage would you like to display?"
).catch((err) => {});
if (!textToDisplay || textToDisplay.length >= 1024)) {
return message.reply({
content: `You have not written a valid text.\nRemember that the text limit is 1024 letters!`
});
}
``` basically I'm getting text like this, and I would want to replace it to work with an URL like you said
wdym?
URL encoding
That’s a native thing in like any programming language I know
you're telling me, my whole life I've been doing this shit wrong 😭
in every language too
bruhh 💀
D# is the library ur looking for
I mean, almost all langs have some sort of http support, so at some point someone had to encode strings into url-compatible, so logically there HAS to be some sort of urlencoder somewhere
No respectable language would force u to write ur own urlencoder
There's no guarantee the feature comes native to the language.
It could be provided by the host/underlying language used.
(if the language even allows you to interface with it)
those aren't respectable languages 
encodeURIComponent("space: string");
So if we are thinking of what a "collector" is, isn't it just a listen to a specific event and added x amount of what is collected to a "collection" and stopping once it reaches that amount?
So going through with the api on my own, how would I make grouped commands e.g /player setup (player being the parent and setup the child command)
I'd read the documentation but I won't lie I am too lazy today to read through discord's docs

{
name: "playlists",
description: "Manage and play playlists",
category: "audio",
options: [
{
name: "meta",
description: "Metadata commands",
type: 1,
required: false,
options: [
{
name: "show",
description: "Shows all playlists. True to only show yourself",
type: 5,
required: false
},
{
name: "info",
description: "Shows info for a playlist",
type: 3,
required: false
},
{
name: "create",
description: "Creates a playlist",
type: 3,
required: false
},
{
name: "delete",
description: "Deletes a playlist",
type: 3,
required: false
}
]
},
...
The category prop is arbitrary on my end. Does not apply
Thank you for this
This is in my pom.xml:
<dependency>
<groupId>org.discordbots</groupId>
<artifactId>DBL-Java-Library</artifactId>
<version>2.1.1</version>
</dependency>
I get a Missing artifact error.
Yes, this is inside <dependencies></dependencies>
Try the first pin in #topgg-api
Thanks, it worked
guys, firebase > mongoose or mongoose < firebase?
or SQLite wins them all

I'm not going to follow anyone's opinion, it's just for asking.
Postgres
Sounds like a- sorry

i blame bit.io
The fastest way to get a database.
i gave up because its confusing
What is this? 
postgres hosting
Just self host
Switching to postgres from mysql was super easy. I self-hosted both
better way to do this
let commands = [];
bot.commands.filter(command => {
commands.push(command.config.name);
commands.push(command.config.aliases);
});
console.log(commands);
kinda long
also, the aliases are arrays so is there a way to concatenate its content to the array above
what are you trying to do
put the list of commands and its aliases in an array
ah ok
bot.commands.filter(command => commands.push(command.config.name, ...command.config.aliases));
You can do that.
let commands = []
bot.commands.map(command => {
commands.push(command.config.name, command.config.aliases)
});```
was gonna suggest that lmao
And the spread operator.
You don't want nested arrays.
ay it works
that won;t make a nested array though will it?
let arr = ['a'];
arr = [...arr, 'b', 'c', 'd'];
console.log(arr); // 👉️ ['a', 'b', 'c', 'd']``` example
wait wrong example
Yes, but his aliases are arrays.
ah yeah good point 🗿
If we do your example, it will be:
['a', 'b', ['c'], 'd', ['e'], 'f'];
Supposedly, c and e being aliases.
We use ... to spread the arguments and put them on the top array, instead.
whut why are you using filter to iterate through the array
v12 uuhh
By doing the REST request yourself then
Just send an empty array
And all application commands are gone
Most not to say all bots usually ignore if their commands being executed by another bot
Also not possible with slash commands
At least not in a way without breaking the TOS
I wanted by prefix
Server settings, intergnation scroll down your bot and remove
That does only remove ‘em from your guild
Only from your guild
It has no effect on the registered commands
They will still be pushed to new guilds
Well my does like this:
The question why do you respond?
The dude asked for how to delete global commands using djs v12 and not how to remove them from your (own) guild.
if (toLower === "&&help") {
return message.chanel("HI")
}
Well you technically just send a message to a channel containing the command as message content
But the bot will most likely not respond
Most not to say all bots usually ignore if their commands being executed by another bot
ok
I was told that bots cannot interact with each other
is that true?
Depends on the bots code
Technically they can
If you don’t check and ignore your commands being executed by a bot then other bots can
(except application commands aka slash commands)
and how could this be done
What exactly?
Executing commands of other bots or blocking bots from executing commands?
my bot can send text messages from shortcodes now like from "55461" imagine getting a message one day
"Moderna Labs LLC
You have been detected as Patient Zero for the Covid-19 pandemic virus
You are ordered to stay where you are
We are coming to collect you, do not leave your home"
lul
no
the bot just sends a code for verification, i was saying "as a funny example" 😛
i mean yes it is possible if i coded it to do that, sure, but im never going to do that
uhm hi
MAN LMAO
@rose warren can you say more about it?

or not
it's busy
@sharp saddle This exits?
man using replit for hosting 🗿
LOL
is have problem?
This doesn’t make any sense. Firebase is a database service (firestore). Mongoose is a module used to interact with MongoDB.
It’s like if you said: Chair or Table? They’re two different things that can’t compare…
But a chair can be used table and vise versa

😳
You're right.
Ill try sitting on my table and eating on the chair when I have dinner tonight
why do you of in the cold food of out eat the hot food? Just doesn't make sense to me
I really think my ffmpeg code is broken
It's entirely possible I may be doing something horribly wrong. Should the concern come down to the Buffer being flushed because I'm "reading" the stream, removing the on("data"... does not change anything.
The voice library I use internally is able to spawn FFmpeg and it works as it should, should it need to transcode
For hahas, I removed any checks for waiting for the track to start to see if it would ever start and it doesn't
Relevant Code:
logger.info(toApply);
stream.on("data", () => logger.info("stream data"));
// Managing my own pipeline to avoid double ffmpeg spawns
// toApply equals the PCM arguments voice uses internally
return resolve(new Discord.AudioResource([], [stream, new prism.FFmpeg({ args: toApply }), new prism.VolumeTransformer({ type: "s16le" }), new prism.opus.Encoder({ rate: 48000, channels: 2, frameSize: 960 })], decoded, 5));
Output (duplicate frames have been omitted and replaced with ...):
2022-08-06 08:00:38.346 INFO 6260 --- [ main] index.ts:411:3 : "Got request to load for identifier "ytsearch:XT1zqRzH1AM""
2022-08-06 08:00:38.831 INFO 6260 --- [ main] index.ts:526:51 : "Loaded track C418 - axolotl ( Minecraft 1.13 music )"
2022-08-06 08:00:38.836 INFO 6260 --- [ main] index.ts:246:2 : {"track":"QAAAgQIAJ0M0MTggLSBheG9sb3RsICggTWluZWNyYWZ0IDEuMTMgbXVzaWMgKQAENTEwawAAAAAABJ+YAAtYVDF6cVJ6SDFBTQABACdodHRwczovL3lvdXR1YmUuY29tL3dhdGNoP3Y9WFQxenFSekgxQU0AB3lvdXR1YmUAAAAAAAAAAA==","op":"play","guildId":"497159726455455754"}
2022-08-06 08:00:50.588 INFO 6260 --- [ main] index.ts:246:2 : {"timescale":{"pitch":0.8908987181403393},"op":"filters","guildId":"497159726455455754"}
2022-08-06 08:00:51.225 INFO 6260 --- [ main] worker.ts:219:13 : ["-analyzeduration","0","-loglevel","0","-f","s16le","-ar","48000","-ac","2"]
2022-08-06 08:00:51.516 INFO 6260 --- [ main] worker.ts:220:37 : "stream data"
2022-08-06 08:00:51.548 INFO 6260 --- [ main] worker.ts:220:37 : "stream data"
2022-08-06 08:00:51.553 INFO 6260 --- [ main] worker.ts:220:37 : "stream data"
...
2022-08-06 08:01:01.265 WARN 6260 --- [ main] worker.ts:296:11 : "C418 - axolotl ( Minecraft 1.13 music ) got stuck! Threshold surpassed: 10000"
what the codes for custom activity in python 😉
its on the docs
can i have the links?
.io?
check around multiple registrars (and the registry itself)
the price can vary by hundreds of dollars
the funny thing is .io is actually a ccTLD (country code)
for the Indian Ocean Territory
but all the tech goblins register it for reasons unrelated to the country
that's beautiful
is this a xnx* link ?
Wdym
Oh
Waffle and his dirty mind…
The timing
lmao
Lmfao
Not my dirty mind, I could think of no other possibilities for why else he would “censor” the last thing
The price usually depends on the length and popularity of the name you’re using
is this your anti phish thing?
ik
You aren't wrong though
I thought the same thing
dirty boys are all around
I feel like you are blind to the younger generation
Let alone what we just said you got thots out there on tiktok posting thirst traps
Okay so I am messing around with decorators in typescript right now, and so far I got it to partially work. I can assign data to a class with it, but when going to access that data later it says Property 'x' does not exist on type 'x'
import {
ApplicationCommandOptionData,
ApplicationCommandType,
Snowflake,
} from 'discord.js';
export function SlashCommand(options: SlashCommandOptions) {
return function (constructor: Function) {
constructor.prototype.name = options.name;
constructor.prototype.description = options.description;
constructor.prototype.options = options.options;
constructor.prototype.name_localizations = options.name_localizations;
constructor.prototype.description_localizations =
options.description_localizations;
constructor.prototype.type = options.type ?? 1;
constructor.prototype.guildIds = options.guildIds;
};
}
interface SlashCommandOptions {
name: string;
type?: ApplicationCommandType;
name_localizations?: Array<string>;
description: string;
description_localizations?: Array<string>;
options?: Array<ApplicationCommandOptionData>;
guildIds?: Array<Snowflake>;
}
This is how I currently do my decorator (properly a bad way but idk any other way)
In rare circumstances you may need to use //@ts-ignore on the line above the logic checking for that property.
import { Command } from '../extendables';
import { CommandInteraction, Interaction } from 'discord.js';
import { SlashCommand } from '../decorators/SlashCommand';
@SlashCommand({
name: 'test',
description: 'something to test',
guildIds: ['957867801119449109'],
})
export default class TestCommand extends Command {
constructor() {
super();
}
async execute(ctx: CommandInteraction) {
await ctx.reply({ content: 'Hello World!' });
}
}
This is how I use it
I won't ever use it unless absolutely necessary
There has to be a way to let intellisense recognize it exists
Seeing as I don't see x anywhere, not sure where that's coming from, sorry.
one thing I could probably do is outline them on the Command class but have the values be null by default
'x' is a placeholder
For example if I were to make an instance of TestCommand and try and access .name
it would say it doesn't exist on type Command
Actually I might have a fix for it
Yea found one
import {
ApplicationCommandOptionData,
ApplicationCommandType,
Snowflake,
} from 'discord.js';
export abstract class Command {
declare name: string;
declare type?: ApplicationCommandType;
declare name_localizations?: Array<string>;
declare description: string;
declare description_localizations?: Array<string>;
declare options?: Array<ApplicationCommandOptionData>;
declare guildIds?: Array<Snowflake>;
}
Idk if this is the most proper fix but it works
[Error: ENOENT: no such file or directory, open '://cdn.discordapp.com/avatars/554553279003099146/51b5f150e4686c7ab.png'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '://cdn.discordapp.com/avatars/554553279003099146/51b5f150e4686c7ab.png',
methodName: 'constructor'
}
Anyone know where the error is?
how long should i retry the discord api endpoint for deferred interactions? Sometimes the call to the token endpoint fails with a 404 error, but it will be successful after a few attempts. this is my current retry logic.
const retry = require('retry');
const sendWithRetry = axiosCall => new Promise((resolve, reject) => {
const operation = retry.operation({
retries: 5,
factor: 3,
minTimeout: 1000,
maxTimeout: 10 * 1000,
randomize: true,
});
operation.attempt(async (currentAttemptNumber) => {
try {
await axiosCall;
resolve();
} catch (e) {
if (operation.retry(e)) {
console.log(e)
return;
}
resolve();
}
}, reject);
});
module.exports = sendWithRetry;
are there cases where discord just doesn't make the endpoint available?
this looks like you are trying to open a url as a local file
The code was working for me on Djs v13
Without errors when updating to v14 I found this error when typing the profile . command
i dont use discordjs so i cant help there. many they have some upgrade docs somewhere
Ok, ty
maybe the setting forceStatic:true will fix it
https://discordjs.guide/additional-info/changes-in-v14.html#cdn
:// is not a valid url start
should i bump the timeout to 30s from 10s? Sometimes I dont get a response and this is retrying only for 10s
careful with 404 errors
let url = getvalueof.displayAvatarURL().endsWith(".webp") ? getvalueof.displayAvatarURL().slice(5, -20) + ".png" : getvalueof.displayAvatarURL();
I didn't specify url or :// until ?
i use the npm lib retry with these configs.
{
retries: 5,
factor: 3,
minTimeout: 1000,
maxTimeout: 10 * 1000,
randomize: true,
}```
so it'll only retry 5 times over 10 seconds
and tf is getvalueof
What is correct?
not found and unauthorized errors are VERY dangerous regarding discord api
since they're elligible fro 1-day ratelimit from cloudflare
not doing anything?
what are u doing exactly?
if ur showing the avatar in an embed, discord does accept webp
oh dang, where are there rules?
go to discord dev portal -> api documentation -> search for 404
there are 3 statuses that are elligible for CF ratelimit
The code is for a friend of mine who was working with me on this project, but now it is separate and does not open the Internet
But let me tell you it's economy and now I'm trying to call up an avatar for the person in the profile picture
In addition, you are expected to reasonably account for other invalid statuses. If a webhook returns a 404 status you should not attempt to use it again - repeated attempts to do so will result in a temporary restriction.
just show the avatar directly
but if u must, the first argument in slice is starting character
so 5 will cut the first 5 characters in the url
making it invalid cuz it'll be https
When you put it to 0 an error occurs?
so how ?
Error: Could not find MIME for Buffer <null>
at Jimp.parseBitmap (/rbd/pnpm-volume/7463f4f6-bceb-4163-9dd8-0f0318676fb5/node_modules/@jimp/core/dist/utils/image-bitmap.js:187:15)
at Jimp.parseBitmap (/rbd/pnpm-volume/7463f4f6-bceb-4163-9dd8-0f0318676fb5/node_modules/@jimp/core/dist/index.js:431:32)
at /rbd/pnpm-volume/7463f4f6-bceb-4163-9dd8-0f0318676fb5/node_modules/@jimp/core/dist/index.js:373:15
at /rbd/pnpm-volume/7463f4f6-bceb-4163-9dd8-0f0318676fb5/node_modules/@jimp/core/dist/index.js:115:14
at /rbd/pnpm-volume/7463f4f6-bceb-4163-9dd8-0f0318676fb5/node_modules/@jimp/core/dist/request.js:48:9
at IncomingMessage.<anonymous> (/rbd/pnpm-volume/7463f4f6-bceb-4163-9dd8-0f0318676fb5/node_modules/phin/lib/phin.compiled.js:1:2100)
at IncomingMessage.emit (node:events:538:35)
at endReadableNT (node:internal/streams/readable:1345:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
methodName: 'constructor'
}
Do you know about this?
explain to me what ur doing
Your mother
damn great argument, unfortunately 172.257.0.123
Thanks!!
HA! IP leaked, you're done
I can't delete the whole line so I selected slice 0 I tried ways to get this error
ava.getBuffer(jimp.MIME_PNG, async( err, buf) => {if (err) return console.log();
from this line
explain to me WHAT ur doing, the actual goal
it makes zero sense from what I can see
I don't understand you exactly tell me what you want to know and I will answer you
I want u to explain to me what is the goal of that command
or whatever is that line used for
Which command?
probably this one
But I told him that the code is not I the owner or programmer for it, I don't know? Also I'm not good enough at djs

I'm not sure how you expect us to help if you dont understand the goal.

I don't know 
is the owner/programmer here?
on this server,! no
But he is my friend and he can't open the internet because he is in exams time
don't think you should be handling the code then, bad things can happen if you don't know what you're doing
Are these errors complicated?
not really, but it's impossible to help if I don't know what I'm dealing with
you are right
slice(5, -20) makes no sense tbh, I know js allows negative indexes but that'd solve nothing
IF it is what I think it is, your friend is trying to process the image in some way (like resizing), but idk
in such case you could just append ?size=XXX to the url and let discord handle it
let Image = Canvas.Image,canvas = Canvas.createCanvas(307, 300),ctx = canvas.getContext('2d');
const rg = ["./defaultBACKGROUND.png"];
fs.readFile(`${rg[Math.floor(Math.random() * rg.length)]}`, function (err, Background) {
if (err) return console.log(err);let BG = Canvas.Image;let ground = new Image;ground.src = Background;ctx.drawImage(ground, 0, 0, 307, 300);})/// PHOTO SIZE
let url = getvalueof.displayAvatarURL().endsWith(".webp") ? getvalueof.displayAvatarURL().slice(0, -20) + ".png" : getvalueof.displayAvatarURL();
jimp.read(url, (err, ava) => {if (err) return console.log(err);
ava.getBuffer(jimp.MIME_PNG, async( err, buf) => {if (err) return console.log();
how does slice with a positive start and negative end even work?
it would just remove the first characters right?
if it is like arrays, it'd reverse everything
like https://google.com would become sptthmoc.elgoog
god save my eyes
so it is adding some sort of overlay to the pfp
or I think
probably a profile command
removes everything before the start number and removes x off the end
thats so strange
I found the solution!!!
Not that I delete a line
The solution is that I have completely deleted the code
it is inclusive and exclusive
so yea
I'm sure its useful in some weird way
invert message command
at least the ONLY reason I could think of
https://paste.gg/p/anonymous/7b9af4c7ae84496b98608c0a7e92866b So I am working on making a slash cmd handler and I am running into some issues with type mismatching I am unclear of what the issues are as the type defined on the docs are exactly the types I am using. https://hastebin.com/hazomugedu.typescript here is how I am doing it, These type mismatch errors are annoying asf
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
No idea but other's make it not wrap
so

TS2345: Argument of type '{ type: ApplicationCommandType | undefined; description: string; descriptionLocalizations: Partial<Record<Locale, string>> | undefined; name: string; nameLocalizations: Partial<...> | undefined; options: ApplicationCommandOptionData[] | undefined; }[]' is not assignable to parameter of type 'ApplicationCommandDataResolvable[]'. Type '{ type: ApplicationCommandType | undefined; description: string; descriptionLocalizations: Partial<Record<Locale, string>> | undefined; name: string; nameLocalizations: Partial<...> | undefined; options: ApplicationCommandOptionData[] | undefined; }' is not assignable to type 'ApplicationCommandDataResolvable'. Type '{ type: ApplicationCommandType | undefined; description: string; descriptionLocalizations: Partial<Record<Locale, string>> | undefined; name: string; nameLocalizations: Partial<...> | undefined; options: ApplicationCommandOptionData[] | undefined; }' is not assignable to type 'ChatInputApplicationCommandData'. Types of property 'type' are incompatible. Type 'ApplicationCommandType | undefined' is not assignable to type 'ApplicationCommandType.ChatInput | undefined'. Type 'ApplicationCommandType.User' is not assignable to type 'ApplicationCommandType.ChatInput'.
that error message is as useful as c++'s
Do you have any idea what this means
Types of property 'type' are incompatible. Type 'ApplicationCommandType | undefined' is not assignable to type 'ApplicationCommandType.ChatInput | undefined'. Type 'ApplicationCommandType.User' is not assignable to type 'ApplicationCommandType.ChatInput'.
This is the actual important part
The stuff above is typically useless junk
don't think undefined can have a type so...
Well it is an optional prarm
so it will accept it being undefined
or at least that is what discord and djs docs say
idk then
actually you are right
djs for some reason is treating something that can be undefined as not being allowed to be undefined
for optional params, doesn't it just use null?
Mmmm maybe
how to hackban?
ban with ID
Good evening, is there anyone here who knows a little bit about GitHub that can help me?
ask your question right away
lol
where do I find the codes of these emojis to put in the GitHub script?

this is just an example
What do you mean?
What is a Github script?
And where do these emojis come from?
fontawesome
similar to the replica only on the GitHub platform
GitHub code
have fun ;)
Do tell me if you notice anything bad
Except for all of it being bad
There is no such thing as "Github Code". Github stores files and other things through a version control software known as Git. You can push any type of file to Github with Git.
Do you want to display it in a README.md file? Is that what you mean?
can you even change the font in a readme?
Not sure...
But you could use images 🤷♂️
Its on github, you should be able to just read the readme.md and see what they are doing.

typical fake
how to hackban codewise? I already can ban by ID but it never works
does that work even exists
Exist
I want to on this site
does it register 'em, too and/or update/delete them if needed?
by hackban I mean banning someone that isn't in your server
I can never get that to work
or do you rely on doing that by hand?
:Sadge:
yoo how can i do something similar to arg.join("_") but for the string of a slash command?
for the string of a slash command
for which string?
a command option you provide?
it's a string, not an array, so join() won't work here
I am trying to hackban not ban by ID
hackban is banning someone who IS NOT in ur guild
and guild manager isn't a thing then
hmmm...but isn't hackban the same as banning by id?
guildmanager is required since to ban you need a guild
But you want the person to be banned in the guild
And guild always has guild member manager
So far it only adds to the collection and on ready registers them
Always register them in the ready event?
Also if I post again but with different description and or name will it auto update the same one or make a dupe?
I always register on ready yes
I always add and register on ready
Oh that’s bad
How come?
Yes even if that shouldn’t happen it still does
Ima make a function that check and uploads
if it already exists it won't upload those commands
but if it does exist and there is changes in the data it just updates it
tf am I talking about command
I meant function

I’m fetching the application commands once the client is ready then compare ‘em to my loaded ones and register/update/delete em to the API
Hmm how can I share a private file on GitHub?
You could invite me to the repo
Other than making it public or inviting to the repo there is no way as far as I know
Or a private gist
oh yea gist is a thing
Yeah that's the gist of it
any idea why? pretty sure i have the correct path
see
that is not how you traverse files
Hmm can’t find that on mobile
thats how i always do it and it work?
what should i do then
I have never seen someone do it that way
ever
are you coming from the mywallet.js file?
always worked like that, moved it a little far and boom
yes
../../../channels/blah
sounds good, thanks man
you can't just do ..../channels/blah
every 2 dots separate with a / and onlyy do it however many times you need to go back a dir
ah now ik my problem lol, max number i can go is 1 file with the dots
Literally says right there, "create secret gist"
understandable, thanks @sharp geyser
no problem
No… I meant to publish a file or access to it
An already existing one
You said a file so pasting it is quite simple bro
Click raw
Hold, select all, and copy
Hold the text area and select paste
Publish
???
Profit
Ya fucking disgus
// First of all, let's try fetching our member
const hackBan = false, member = message.mentions.members.first()
|| message.guild.members.cache.get(args[0])
|| message.guild.members.cache.find(r => r.user.username.toLowerCase() === args.join(' ').toLocaleLowerCase())
|| message.guild.members.cache.find(r => r.displayName.toLowerCase() === args.join(' ').toLocaleLowerCase())
|| await client.users.fetch(args[0]).then(() => { hackBan = true }).catch((err) => { hackBan = false }); if (!member) {
return message.reply({
content: `I was unable to fetch the mentioned member.`
});
};
``` idk what I'm doing
is this even going to work?
I'm adding a 5th option to fetch the user by the API in order o try hack banning
but should I be doing client.api.users.fetch?
I don't see why hackbanning is an isseue tbh
if (!member.bannable && !hackBan) {
const unableToBanEmbed = new MessageEmbed();
unableToBanEmbed.setColor(commandColor);
unableToBanEmbed.setTitle("Unsuccessful Operation");
unableToBanEmbed.addField(
"Mentioned Member",
`${member?.user.tag ?? `${member.username}#${member.discriminator}`} (${member.id})`
); unableToBanEmbed.addField(
"Perpetrator",
`${message.author.tag} (${message.author.id})`
); unableToBanEmbed.addField(
"Reason",
`You are not able to ban that person, because they're immune/ are the staff of this server.`
); return message.channel.send({ embeds: [unableToBanEmbed] });
};
cause then bannable isn't a property
Then just alert the user they can't be banned
😎
hack ban is a dumb concept to begin with
Where tf is that? Can’t find that site
what if you know someone will raid? why not ban them before they even join ur server?
Banning is really meant to be done in the server
dyno has that, mee6 has that
so there not being a bannable prop is understandable
wick has that and every other slightly larger bot I know
Either way you are being redundant with your checks.
and I changed my bot to advertise as a auto-mod anti-raid bot
rather than multipurpose
Oh, gist is kinda separated from GitHub, I just went to gist.github.com manually
You are checking cache but then you have to think about what if they aren't cached
I upgraded my entire moderation system
huh what
You are checking cache for the user dingus
If they don't exist in cache you won't find em
So you will eventually run into a problem there
I let them come 
okay but I literally have to make that work
Also this is stupid
every bot I know has a hackban feature
whether it's built into the command or they have 2 separate commands
then it's simply not a moderator bot
it is

every big bot I know has that
groovy doesn't 
Mm yes I can't implement this feature properly, but it makes my bot creative so I'll keep it at that
yea gl
groovy isn't a mod bot 😠
okay let me repeat what I said
Wasn't really the point
every big moderator bot has that command
The point was, if you try and be like every other bot your bot will fail
you don't have to
you want to
yea
hackban is supposed to be a blind ban, you CANT know for certain if the id is valid or who's it
I'd just create that command and make it send a message that says "use discord's moderation feature ya dingus"
That's quite creative if I do say so myself
and at the end of the day, copying big bots is just a dumb decision
like trying to make a copy of coke
if you fight in their arena you WONT win
they were there first, they already have their loyal users
some of the store brand cokes around my area aren't bad
What’s the issue of banning an user by his ID?
tbh, I rank coke at like 5th place regarding taste
I just did await client.api.users.fetch and my bot isn't responding at all
many local colas are way better
😭
but coke has brand so...
I'm just going to ask wick devs how they do it
you simply can't fetch a user YOU CANT SEE
you can only fetch users your bot knows, but hackban is supposed to work when your bot doesn't knows the user
Also that is not how you use it
It's supposed to resemble a path with an http method last
I can do client.users.fetch and it returns some info about the user
only username id and discim
How are you getting the id
you gotta fetch a member if you wanna ban them
You don't
copy it from a user in another server
You can just provide id
What?
It's a user resolvable
the issue with multipurpose bots isn't that they're multipurpose, but because people try to make them similar to big bots and get overshadowed hard at that
guild.members.ban(id)
I see
bro I just want to add a feature every bot has before trying to add something that's "innovative"
That makes sense
that's a feature that's needed, especially for mod bots
This thou
Idek what you guys are talking about
He wants to be able to ban a user that isn't in the server
or has never joined the server
Yeah just give id
Can you ban just anyone though?
I mean … either you ban the user ID on the guild UI or simply by using the command
discord has an id?
I thought they had to have been at least in the server piror
Yeah they have an id
I don’t see any difference
643945264868098049
Ban!!
Oh, your bot doesn't have hackban? Unfortunate


I mean somebody being able to ban users actually don’t ban random IDs he got provided by anyone
At least I hope so
Unless they have some kind of a grudge against that person
Well yeah but do you need a bot command for banning just an user ID or can this be done in the guild settings, too?
Could use your own user token and make a request yourself but maybe that's not a good idea
You can't ban a user, only members in the official client
As far as I know
I can tell you a good case of how hackban can be useful
_uses alt and a VPN _
a person joins your server, spams weird shit and then you ban them.
You know they have 6 alt accounts and you ask someone to give you their IDs
you get a bot like dyno and easily ban their alts, now they can't spam weird shit anymore
congrats
Nice hackban!!
you ask someone to give you theirs IDs
This all assumes you have their IDs
Without the ID hackban is useless
But they'd most likely create new accounts
I'm starting to think people only look for the hackban feature to ban the discord system for the maymays

And then proceeds to kick the mod bot after that
I didn't even know you could ban the discord system
Didn’t even know that’s an user which is part of your server
can just make a antispam system
I dont think there's ANY realistic scenario where hackban is the only option
I already have an anti spam system
hackban is USEFUL
I used it like a lot
I had my server raided >6 times
it's useful for banning raiders alt accounts
I don't know why you're still messaging
and so on
Do you try to change other people’s opinion about it?
I banned over 100 people in my server with that command
We can't convince you
I mean if you like it then use it
Yeah that's all fine and dandy
I want to use it, but I also want to have that command in my own bot
I just want to make sure he understands that if there is no ID to be used hackbanning will become useless
He can use it all he likes
Well then add it as command
but as long as he knows that much
EXACTLY
it is fine
okay but if you have the ID then it isn't useless wtf
Ima go watch anime
Eww
why
Cause I can
wouldn't a antiraid be more useful at that?

Poor man
I dunno, I think they came here to get help on how to ban a user by id in a guild, not to be lectured
Isn’t that always the same result?
I only lecture fake
Then we will have to put you down
Go on… and I will reduce your daily TV time to 0
Tbh I don’t even have time to watch TV
Well I guess I should finish this thing
Okay so how do you recommend I validate commands?
I can easily get the already registered commands and the ones loaded in the collection
My first thought was to make a nested loop and compare ids and then compare the different fields and do the appropriate action
but that will likely end up leading to more code than needed
I compare the fetched command name, description and options with the loaded ones
Then react to that
Really dunno how to get this GitHub shit working
Not sure if that works tho
Okay so you are doing it differently than how i was about to
Do you mind if I copy the parts I need?
I am mainly just copying the parts where I check if there is any commands in the guild/globally and then if there is I compare the fields to make sure if they need to be updated or not
else I just create them
That guild check just utilizes my command module structure
inheritance
where there’s an array of guilds storing the IDs or not
make a middleman class that has that check ran before the main scope
then make all your commands inherit that class
Loading the commands shouldn’t really be different to yours
But instead of spreading the entire module handler in parts I let most of it be written inside the event listener
That copy / paste gist shit is cancer
I am just making a method called checkAndUploadCommands that will check the differences of the registered and loaded commands and do the appropriate action
Yeah first trouble I had with that was comparing the possible options
Since they can be nested as fucked
So Ben actually helped me with that neat flat method
And the easiest sort of comparison then was to turn the entire flattened options into a JSON string then compare em with the fetched one
But that’s just needed for the command options of course
Name and description as well as localization can be compared easily
But I feel like the entire command initialization is obsolete now
Since bulk command updates to the API are actually instant
(now)
So checking for command to register or update them might be nonsense now
Just bulk overwriting your commands on a startup might be enough
I created the working hackban command
you guys wanna go over my shitty code 
I just merged the hackban with the ban command tho
Not really, I’m sure you made it 100% more complicated than it needs to be
that nullifies some checks such as member.bannable

we'll see
should I send the snippets 
// First of all, let's try fetching our member
let memberHackBanned = true, member = message.mentions.members.first()
|| message.guild.members.cache.get(args[0])
|| message.guild.members.cache.find(r => r.user.username.toLowerCase() === args.join(' ').toLocaleLowerCase())
|| message.guild.members.cache.find(r => r.displayName.toLowerCase() === args.join(' ').toLocaleLowerCase())
|| await client.users.fetch(args[0]).catch((err) => { memberHackBanned = false }); if (!member) {
return message.reply({
content: `I was unable to fetch the mentioned member.`
});
}; const hackBannedMemberTag = memberHackBanned
? `${member.username}#${member.discriminator}`
: member.user.tag;
``` this is how I fetch the user
Not like it’s complicated at all to call the guild member ban method and pass an ID
I also want to fetch the user details such as the username and discrim
had to nullify some checks, but I'm sure it's fine since hack ban only executes if the user is not in the guild

Oh no… I’m on mobile
I first fetch the registered commands and loop through the commands loaded in the collection. I then loop through the guild ids if there are any and update the commands in the guild and then I do the same with global commands
What are you even talking about
Like I said I haven’t touched that code in a while but should have done it
you were hating on hastebin a couple days ago
saying it's bad after toptal bought it?
Well just from looking at the code it looks correct
I am the one who dislikes hastebin
was that not you?
Untrue
ohhh
hatebin >>>
really?
Half the time it doesn't even save the paste
damn, gotta find a new bin now
Lines like if(!guild || !guild.available) can be shorter
if(!guild?.available) for example
pastebin is my second go to
Just make your own
pastebin is the worst of all worlds
🤨
True
I dislike using ? if I can help it tho

oh jeez
Hmm dunno why optional chaining is a bad thing?!
you made thing optional
Cause sometimes it fucks intellisense up
you boomer man may not rely on intellisense with your notepad++ coding
but I myself do
Anyway I am bored from working on this
so Ima take a break today
never had issues with intellisense at groovy
Line 48 Misty
but anyway if you do guild?.avail available won't pop up as a suggested property
ik what u mean, ts inherits most js issues regarding intellisense
just not those related to types
dementia
I clicked send and it disappeared
the numbers Mason, what do they mean?
I didn't think anyone still remembered blackops
I literally wrote, you wanna add name localizations to the filter as I saw u using them
Same for global commands
such a brilliant storyline
Ah apparently that message never sent

I clicked send and it disappeared
damn
the message, is it here in this room?
No I can’t see it
the message is not real, it cannot hurt you
Wtf stop confusing me
I feel like I should rewrite the entire command initialization
you have a locale file right?
Well right now I am not really supporting localization in the bot yet
but I will in the future
when you do, just do a reverse check
like, retrieve by value instead of key
if anything changed like the name ,description or option
it doesn't update client side
guildCommands.find(
(cmd) => cmd.name === loadedCommand.name || loadedCommand.localeNane.includes(cmd.name)
);
Wow
You can keep the typos

👀 ya see it would be smart
if I had it setup like that
I currently abide by discord's structure
and just have an object of name/description localizations
oh btw
The entire thing is strongly written for utilizing my structure of course
Well yea
don't let localization for tomorrow, do it while the bot's still fresh
But shouldn’t be hard to adapt
It isn't
trust me, you DONT want to localize a finished project
// First of all, let's try fetching our member
let memberHackBanned = false, member = message.mentions.members.first()
|| message.guild.members.cache.get(args[0])
|| message.guild.members.cache.find(r => r.user.username.toLowerCase() === args.join(' ').toLocaleLowerCase())
|| message.guild.members.cache.find(r => r.displayName.toLowerCase() === args.join(' ').toLocaleLowerCase())
|| await client.users.fetch(args[0]).then((member) => { memberHackBanned = true }).catch((err) => { memberHackBanned = false }); if (!member) {
return message.reply({
content: `I was unable to fetch the mentioned member.`
});
}; const hackBannedMemberTag = memberHackBanned
? `${member?.username}#${member?.discriminator}`
: member?.user.tag;
``` I changed it a little bit because it started hack banning on mention which made permission checks such as member.bannable not work
But like I said it really needs an update
it's fixed now
Wanna do translations in Portuguese for me
;)
now it works properly
I am probably going to update it myself
hackban and normal ban in one command
While description localizations and responses are okay I totally stay away from name localizations
What a mess
I just let people define aliases themselves
Aliases wtf
open a crowdin project
I am about to do the same as well tbh
I’m talking about app commands
This is getting to be a headache
Matter of fact
fuck them people
just read the name in english and description in whatever
you can still make aliases for app commands
guild slashes
Yeah I wanna keep the names in the same language to be consistent anywhere the bot is as well as in DMs
While descriptions can of course be localized
But localizing the command name somehow is confusing as not everyone in guilds usually uses that set up language
or does discord not allow you
Errr
I think that requires you to register that new command (name)
You can also update commands by using its application command ID
what is crowdin
Probably
github for localization
We can do it another time
Ok
Maybe I’m going to improve it before that

I am only sad
cause they didn't give me more hours

mfs only gave me 20
still roughly 1-1.2k a month
Keep my mine in mind


