#development
1 messages Β· Page 1595 of 1
ah ok
I'll make one too someday
I actually have GCP ready @solemn latch, maybe I should swap π€
welcomechannel.send(`Hey <@${guildMember.user.id}> , Welcome To The **Dogey Army**. Please Read The Dm You've Gotten By @jolly zephyr For Steps To Unlock The Server!`);```
I got this error
how do i fix this
welcomechannel is undefined
But isnt it a variable?
Doesn't matter
They can be undefined
guildMember.guild.channels.cache.find(channel => channel.name === ':blush:welcome:blush:') returned undefined
Because it didn't find the channel
There isn't a channel with that name
change channel.name to channel.id
ok
which type is vips? const vips = new Set();
If your searching for id
console.log(typeof vips)
ty
ty
Mhm
@blissful coral so this guildMember.guild.channels.cache.get(channel => channel.id === '675173793483980808')
?
It's Set
oh
guildMember.guild.channels.cache.get('675173793483980808')
pretty sure when using typeof it would be set not Set though right?
Set<TypeInside>
there's an error, I can't just see which type it is with that yet
ty
If you are using typeof t would be object, they're talking about typescript types
yea
object for me
*he
noted
π
omfg, I already asked around 50 questions here today
anyways, I need to ask at least once so I can learn
it looks like I'm already halfway through the process of rewriting to TS, even if there's a lot more left
but these little things will keep in my head so i can do the rewriting faster
o_O
is that after 'ready'?
and fetching instead
Yeah
Wait 2 instances of the client? You should always have 1 client
I am testing it rn
Ik
It isn't a bot client
It just is logged into the API as a bot
But the bot doesn't have anything but a ready event
hmmm
are you doing this in the ready event?
when I want to test my code I use the Dev version's client token
nope
guilds are not cached until the ready event
some things its okay to use the same bot(like a dashboard). things the user wont have access too at the moment either way its okay.
makes sense
yeah lol
so its logging after "bot is ready."?
Yes
π
bots not sharded?
welp
any fast script to change every file extension in a folder from .js to .ts?
it's pretty easy
client.guilds.cache.fetch
guilds is undefined
first make a function to recursively read a directory
get every path that ends with .js
and rename each of them to .ts
I don't know how to make a script π
k
Your skipping the cache and going to the API instead
k
function readFullDirSync(dir) {
const result = [];
const files = fs.readdirSync(dir);
for (const file of files) {
const path = path.join(dir, file);
if (fs.statSync(path).isDirectory()) {
result.push(...readFullDirSync(path));
} else {
result.push(path);
}
}
return result;
}

that's a function to recursively read an entire directory
it reads the base files of the directory first, and loops through them
if the file is a directory, the function calls itself to get the files inside that subdirectory
if the file is just a file it adds it to the results
But if I console.log() and use get() it finds it
how do i execute the function?
readFullDirSync('some_directory/')
but where
idk
insert it in the index?
you wanted a script to rename .js files to .ts
I do it the line above
It works
The line below
It doesn't
The hell is going on
atTim
@mellow kelp
if(a) b; c;
is the same as
if(a) b;
c;
@blissful coral
find -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;
cd to the folder u want
yeah that's the command
and execute this
both
are there any significant advantages/disadvantages
whatever you want
xD
besides js being native discord
any language can be used to code a bot
js is not native discord
?
guess not, both work the same way with different meanings
wdym
wtf
the web client uses js does it not?
Ye
and the app is electron
that doesn't matter at all
the desktop and browser clients are built with js
the android client is built with java
the ios client is probably built with swift
their servers are built with go, rust, python and probably more languages
But js isn't native discord lmao
just because it's on web, doesn't mean the real app is written in JS
hmm
they use electron + react
it's not like making a bot in js will inherently make it faster
but wtvr wasn't really the main point
pool.query(`UPDATE claninfo SET entryFee = ${entryFee}, due = ${due}, fee = ${fee}, role = ${role} WHERE clan = ${clanID}`, (err) => {
if(err) return console.log(err + " | setup clan exist query")
}) ```
so apparently `due = ${due}` is causing me error: column "daily" does not exist. I just don't understand why is that, and how to prevent it.
angular vs react, REEEEEEEEEEEEEEEEEEEEEEE
obviously not, i just meant
creation wise
ben awad rapidly approaching
aight cool
I FIXED IT
yes go with what you're more experienced
don't wanna start another civil war
is it because I called due text?
HE'S HERE, RUUUUUUN
Tim do you know?
I saw
It wasn't the problem tho
@outer perch vscode tinder is lit tho
wot
it was the reason it was logging guild not found
xD
ah xd
what is the value of the variable due?
Parameter 'undefined' implicitly has an 'any' type, but a better type may be inferred from usage. lmao
its "daily"
then it needs to be in quotes
hm
ah yes because you can totally do undefined = false
:^)
O_O
var due = "daily";
this is what its like tho
die
in the query
${"due"}?
no

quotes define a string literal, so "text" is a string, but if you put it inside another string, the quotes are removed, otherwise it would be stupid. for example ```js
a = "text"
b = abc ${a} xyz
b is equal to `abc text xyz` and not `abc "text" xyz`
however the sql query must be column = "text" and not column = text
hmm export default{ //command code } should do
okay I think I understand
arent you supposed to export bla in ts?
ππ»
if you do export function
then you get it with import function from
if you do export default
then you do import * as function from
or import default from
but
I am talking about the command handler
I need to export the code for index.js to read
full code
you dont export full code, not even in js
you export specific things
like module.exports = something
yes
so what are you exporting
module.exports = {
name: 'angry',
execute(bot, message, command, db, lang) {
const user = message.mentions.users.first();
const rnd = Math.floor(Math.random() * 6);
if (!user || user == message.author) {
return message.channel.send(`${message.author}${lang.angry.gotAngry}`, { files: [`img/actions/${command.name} (${rnd}).gif`] }).catch(err => { console.error(err); });
}
else if (user == bot.user) {
return message.channel.send(`${message.author}${lang.angry.gotAngryWithUs} π§`, { files: [`img/actions/${command.name} (${rnd}).gif`] }).catch(err => { console.error(err); });
}
else {
message.channel.send(`${message.author}${lang.angry.gotAngryWith}${user}!`, { files: [`img/actions/${command.name} (${rnd}).gif`] }).catch(err => { console.error(err); });
}
},
};
export const name = "angry"
export function execute(...) {}```
aha
and then you can import name from or import execute from
what about aliases
this one doesn't have any
but the others have
and
interface Cmd {
name: string;
aliases: string[];
execute(bot: Client, message: Message, command: Object, db: any, lang: Object, language: string, prefix: string, args: string[], serverSettings: Object): void;
}
as null?
for example yes
what If I don't export them
or make aliases optional in your interface
yes
~~(^o^)~~
Hello everyone. Can someone help me about Python? I have a little question π
How can I obfuscate my python codes safely? Is pyarmor safe method for it?
Why would you need to obfuscate
module.exports.test = function test(test) {...}
Idk, I use this
Everyone is asking this. Otherwise how can I protect my software? I dont know.
You dont really need to
python is server-side, there's no need for obfuscation
But ok
i guess you could rename variables to random letters
but you can't really obfuscate the code, since python relies on indent and that sort of stuff
DIE
I just noticed that ESLint isn't working on TS o_O
Argosa i have only seen obfuscated code in like lua
f
crap
Thanks for helping π Sorry, I'm just curious.
For example; I develop online trade bot and will sell it. Will this be safe when I don't obfuscate the codes?
You can change the encoding
And maybe compress to a executable
Other then that I dont know
You have been very helpful. Thanks a lot.
As far as I researched best way for obfuscation in python is cython and pyinstaller to make .exe files.
Yep so I thought
oh yeah exe files
I think you can chnage the encoding of the py files
Say to like some random encoding
Then just decode it once you run it
I'd like to decode Sonic.exe
lmao
Thats a good idea. Lastly which programming language is the best for obfuscation? I think c++
@outer perch there id a windows terminal command for that
i guess pretty much anything that doesn't rely on indentation or spacing
Why every programmers asks me; why would you need to obfuscate?
obfuscation is mostly used on frontend
its not common to need to
to prevent people from reverse-engineering javascript code
obfuscating games
Oh okay copy that π
wait a minute
obfuscation is not needed unless your program has some kind of trade secret in it
or an anti-crack/anti-cheat
if you just want to hide your source-code for copyright reasons, look into compiling to native code, if your language supports it
why didn't Scott Cawthon hide the variables from the FNaF games?
you can change those to get further in the game without actually playing the game
when it comes to videogames, having them cracked can actually help you
a question, anyone ever worked with terminalservers aka windows server distro?
it gives you more exposure and popularity, and also more interest
Tim there is something I don't understand. Aren't developers afraid of their program being stolen by others?
there have been many game developers going on thepiratebay and thank users for liking their game so much they even cracked it
and the result was that more and more people started buying it
mods 
yes, many are afraid
Garry after creating a fake bug for GMod pirates
So why don't they need obfuscate?
if your code is compiled, you already have a decent protection
source code cannot be easily decompiled, not to the same code as it was
you can decompile it in many different ways but it will not be the same
programs are evolving to WebApps
decompiled code looks like a bunch of weird functions and variables with weird names
unless you're using jar files π
so u don't have to download anything
and to avoid those things
u can't decompile if u can't access
js is one of the languages that is very hard to protect
I understood properly now. Thanks π
but not impossible
uhh, block IPs outside the developers'?
then the browser can't load it
that is more readable than i expected
yes, its readable
where are the brackets!?!?
but there is no context
yup
thats just c in general tho
weird
oof lol
it depends on the language as well
for sure
some languages produce more complex compiled code than others
and also depends on the compiler
makes sense
@mellow kelp I installed eslint for TS, but it's not saying shit about those extra tabs
if you make a game in a compiled language like c++ or similar, and distribute the exe, people will be able to reverse engineer many things, but they wont be able to extract the exact source code nor clone the entire project
@quartz kindle Which software languages do you know?
Is c++ good for desktop apps?
yes
if you want your code to be 100% reverse-enginnering-proof you can always use movfuscator :^)
wonder what number the variable c is now, with everyone incrementing it with c++
lmao
didn't change a thing, yet
I think I cant use it with Python
no idea then
it was a joke
{
"extends": "eslint:recommended",
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2021
},
"rules": {
"brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": "error",
"comma-style": "error",
"curly": ["error", "multi-line", "consistent"],
"dot-location": ["error", "property"],
"handle-callback-err": "off",
"indent": ["error", "tab"],
"max-nested-callbacks": ["error", { "max": 5 }],
"max-statements-per-line": ["error", { "max": 3 }],
"no-console": "off",
"no-empty-function": "error",
"no-floating-decimal": "error",
"no-lonely-if": "error",
"no-multi-spaces": "error",
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }],
"no-shadow": ["error", { "allow": ["err", "resolve", "reject"] }],
"no-trailing-spaces": ["error"],
"no-var": "error",
"object-curly-spacing": ["error", "always"],
"prefer-const": "error",
"quotes": ["error", "single"],
"semi": ["error", "always"],
"space-before-blocks": "error",
"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": "error",
"yoda": "error"
}
}
Ohh hahahh π
movfuscator makes your code 9999x slower
xDD
its still brilliant
read about it
I laughed.
.NET is a pain to protect
any tips for lint config?
i just use googles eslint config
lmao xD
Lol
this is what i love about programming
asduifghpaudifgh
you can do whatever the fuck you want, no matter how stupid
tim i have code for you tomorrow cause it aint working
so... it works today but it wont work tomorrow?
yesnt
what does the flag --save-dev do?
things that work today, but not tomorrow suck
saves it as a developer dependency
you can also use -D
on messageUpdate event the parameters are oldMessage and newMessage, right?
what if I don't flag anything on npm i
oh right.
ππ»
these comments
welcome to eslint
it's an interface!!!
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
should I remove no-shadow and no-unused-vars?
those didn't override the rules
maybe I should delete the rules
another answer from SO
{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"no-unused-vars": "off"
}
}
what's SO, @quartz kindle?
How do I use this https://www.npmjs.com/package/translate
I tried
const newMessage = await translate(message.content, { to: "en", engine: "libre" });
read the docs
stackoverflow
the default is from english
okay
you need to specify what from, and what to if the from isnt english
could someone help me out with what im trying to do here
cause it keep crashing everytime a user doesnt have a nickname set
what
can I make it translate from all languages to en
it needs a from if its not en
it says it right in the page
from: the string of the language to translate to. It can be in any of the two ISO 639 (1 or 2) or the full name in English like Spanish. Also defaults to en.

best translator
how do you make a gif like that?
how do I reload VSC without closing it?
why?
you don't need to reload VSC, if you mean the terminal you can do Ctrl + C
for eslint to reset
open command prompt and type eslint there should be a restart eslint one
sometimes only after closing the properties take effect
but what cant you close and reopen?
you have a process running in the terminal?
you can try reload window from the command palette
laziness
lol
and a low-spec pc
but all your open tabs will still be open
VSC takes around 20 secs to open
it's taking you way longer than 20 seconds to find a better option 
40, take it or leave it
you guys close vsc?
wish i didn't need to so i could just ctrl-z my way back to an empty workspace whenever i need to
but if i don't close vscode for a while it just starts to die because my pc bad
20 secs is longer than it takes me to start pycharm 
is it just me or are most windows programs named very literally by what they do?
firewall is not a flaming wall
linux and mac for example have very creative names for many apps
steam does not provide steam
cortana 
chrome is red blue yellow
internet explorer is not named chrome downloader
xD
Twitch does not twitch
i couldnt imagine developing on a pc that takes 20 seconds to open VSC though 
Discord does create discord, so i guess they named that one right, shit goes down every 2 days
2 days is an understatement

anyone going to watch the rover landing on thursday
i'll probably be drunk on thrusday.
and tomorrow
and later today
and prob the rest of the week tbh, hail jaggermeister! Buzz coding ftw
bot
mars again?
yeah
spacex?
nasa
meh
I wanna see a tesla wandering on mars
where will they land the rover this time?
iirc they were interested in the ice deposits near the poles
gonna scare those water molecules off
Watch an epic journey unfold on Thursday, Feb. 18 as our Perseverance rover lands on Mars. To reach the surface of the Red Planet, the rover has to survive the harrowing final phase known as Entry, Descent, and Landing.
Only then can the rover β the biggest, heaviest, cleanest, and most sophisticated six-wheeled robot ever launched into space ...
very development
totally not paying attention
dont warn me hope π¦
So I'm trying to get my bot to respond to both @mentions and custom prefixes (discord.py)
Here's the code for the assignment of the bot object:
bot = commands.Bot(command_prefix= getPrefix, owner_id = int(ownerID), case_insensitive = True)
And here's the code for that function it calls:
async def getPrefix(bot, message):
guild = message.guild
if guild and ("database" not in disabled):
server = await fetchServerEntry(message.guild.id)
serverPrefix = server[1]
return commands.when_mentioned_or(serverPrefix)
else:
return commands.when_mentioned_or("!")
Whenever this is ran, this error occurs:
TypeError: command_prefix must be plain string, iterable of strings, or callable returning either of these, not function
fetchServerEntry always returns a list, and server[1] is the column which contains the prefix for the specified server, which is always a string. I don't see why it's complaining about the type, can anyone spot it?
I should note that @mentions work, but custom prefixes don't
Also custom prefixes were working before I made this change
Code:
app.use(passport.initialize());
app.use(passport.session());
app.get("/auth/login", passport.authenticate("discord", { scope: scopes, prompt: prompt }), (req, res) => {});
app.get("/auth/callback",
passport.authenticate("discord", {
failureRedirect: "/"
}), (req, res) => {
res.redirect("/")
}
);
app.get("/auth/logout", (req, res) => {
req.logout();
res.redirect("/");
});
app.get("/", (req, res, profile) => {
if(req.user){
let datoServidores = req.user.guilds.filter(p => (p.permissions & 2146958591) === 2146958591);
res.redirect("/server")
} else {
res.redirect("/auth/login")
}
});
After clicking authorize i get this error:
https://media.discordapp.net/attachments/579346890357866507/811365536666877962/unknown.png
Someone knows what error i have?
someone hacked my music bot and have no clue on who did it
someone could have your token
reset your token in the discord developer portal
i did and aking anyone that ik who did
an Error
Error objects are thrown when runtime errors occur. The Error object can also be used as a base objectΒ for user-defined exceptions. See below for standard built-in error types.
oh, so Error's a type
Someone knows the solution? #development message
what options do i have to import json correctly into TS?
or the only way is through require?
I can't
says it cannot find module
but with require it can
do you have resolveJsonModule enabled?
yes
hmm
what's the command to execute Ts with node?
I use npx ts-node index.ts
yeah that works
should it be just ts-node index.ts?
but I'm sure it's not
but typescript isn't sure
use instanceof to check that the channel isn't a dmchannel
woah
typescript will know that channel isn't a DMChannel from now on
but...
you sure its just not message.guild?
well, never knew that
if(!message.guild.me.hasPermission('permission'))```
you can use ts-node directly if you installed it globaly
otherwise you have to use npx
in heroku I need npx
I guess
maybe not, since .gitignore has node_modules
also
if you know the channel type
typecast it
channel = message.channel as TextChannel
or (message.channel as TextChannel).guild
yeah you can also do that
you might want to check if the channel is a DMChannel if there are no previous checks before tho
does message?.guild or whatever not exist in ts?
pretty sure it does
since it supports esnext features
but in order to use message.guild?.name you would have to declare guild as an optional property on message
and i dont know if union types with missing fields count as optional there
i think guild is optional
I did a check like that in index
any time I look up about typescript all it shows it discord.js
if (message.channel.type === 'dm' || message.author.bot) return;
I have this in index
should work
works for js, but doesnt tell ts what type is it
as far as ts is concerned, message.channel is still DM | Text | News
because djs has wack typings
because channel.type exists in all 3 of them
but channel.guild doesnt
js and djs-light, which is basically djs
because its a pain to setup
xD
@outer perch instead of this, if you 100% know its not a dm channel, just cast it as GuildBasedChannel
for example, i have all my commands be guild only
they cant be executed in dm's
in index
if you're case is the same, theres no need to add extra logic on runtime
it has been working forever
lies and deciet
xD
how would you cast it to avoid runtime logic?
like cast it only once
assign it to a variable?
instance of is the same as if() something
you adding extra logic knowing the variable type
theres no need
its the same as this tim
how do you stop the code from continuing with casting only then?
client.on('message', message => {
if(!message.channel.guild) return;
command.run(message);
})
// and then adding this to your command
if(!message.channel.guild) return;
well that works if you previously checked that the message has a guild
types are only used in ts
its redudant to check it twice if you already know its type
yes but how does type casting prevent the code from executing in this case
what is the logic behind it
thats a question i've had an answer too, but never got the answer for it
nor did i check
hey just curious is it possible to add other bots using discord.js? this wont be a public bot dw
should be fairly simple though
show a ts snippet
let me get a test config rq
like how would you replace the if in ts
if you do x as y, does the code not execute if x cannot be y?
instanceof is a js thing
wouldn't be just !message.guild?
@outer perch both works
with !message.channel.guild, TS will point at that
cuz it can be 3 types where .guild doesn't exist in 2
how to running some sort of program that communicates with discord's API on this website : https://discord.com/developers/applications/802347256917262336/information
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
@quartz kindle oh, its js
you said there is no need for extra logic at runtime
thats what im confused about, how can do execute an IF with ts casting only?
it uses instanceof which is a javascript thing
what i meant is this #development message
thats not what i mean
you're checking types twice
show me a ts snippet that works without an IF
wdym?
you said that an if was not necessary
what you mean ?
and to typecast it instead
and if they didnt?
this
then you would need it, yes
ah
i thought you said they didnt need that if
well it cna be one of the 3
so you need to do some logic to remove the ones you dont want
yes
i got confused because it sounded like you could to ```js
X as Y
like the casting would replace an IF check
yes thats what i thought
checking with instanceof is smart, but in this case is redudant since they already know all messages are coming from guilds
and iirc you can remove dm message intents too
so technically speaking you wouldnt even need that in the index
is there a way to cast something without assigning it to a variable and without having to repeatedly cast inline again?
hmmm
well you could replace the variable itself no?
if its a function you could cast it in the function parameter
otherwise, i dont think so
message.channel = message.channel as TextChannel?
let me check something, i think i might be able to merge it
import {Message, TextBasedChannel } from 'discord.js';
interface _Message extends Message {
channel!: TextBasedChannel
}
module.exports = {
run: (message: _Message) {
//logic
}
}
you might be able to fly with this
! means must?
it means its always present
ah, k
well thats a way i guess
but at that point just reassign it lol
you could also destructure it
run: ({ channel: TextChannel }) {
channel.guild
}
k
Ah yeah, that too but then i dont think you'd be able to call message again
You could pass both tho
And use channel instead of message.channel
this one got me
you dont usually call message anyway, usually just content and channel, so you can just desctructure both
Same deal, cast it
just tell me something
why are we doing this?
we can just work on something else you know
we can ride our bikes
or maybe
run
No
or something
REEEEEEEEE
cast means what? maybe I know what it means in my language, but explain anyways
cats means you're saying, okay, this variable is of this type
I'm trying to help my STuPid friend @slim stag
say, this
:,
transforming one type to another type, as long as they are compatible
can sombody help me
;-;
ho to run the bot
I can help you ;-;
let a:string = 'bla';
let b:number = a as number
Several people are typing...
You can't "run" a bot
bruh why on dms you cant but on here can
Bots are programs that run somewhere
i mena online it with command
even though a is a string, you're casting it and saying: okay, a is now a number
yep
aight
You need to code it
mhm
for example in a language like c++, where you have multiple types of integers, you can cast a signed int to an unsigned int, or cast an int32 to int16, or even cast a char to an int and vice versa
yeha but what
But what what?
since there are 3 of them
I told you last time @slim stag
Like, you need to write the code from scratch
let msg = message.channel as TextChannel;
msg.bulkDelete(number, true).then(deleted => {
//logic
});
``` like this innit?
Or use some sketchy bloated maker like bdfd or dbd
pun intended
thats one option yes
that would work, yeah
ye
Learn the basics of a programming language and then get into the discord library for that lang
another option is (message.channel as TextChannel).bulkDelete
^^
I prefer that one ngl
i prefer that one for single cases
if you use more than once, use a variable
wtf
another is (<TextChannel>message.channel).bulkDelete
otherwise you're gonna be having more and more code unecessarily
though theres no harm
why is msg message.channel?
type are only used in ts
as is more readable
o_O
which already used <> for something else
I hate when TS says this maybe converted to that
I never know if I have to put it like that already
or keep as is
well, you DID copy my settings, which is a lot strict
does anyone know how to fix this im really confused https://av.likes-throwing.rocks/lZm2nh.gif
which is good, you're learning the hard way just once
I followed this guide but it doesn't work https://discordjs.guide/sharding/extended.html#using-functions-continued
I'm unable to react with an emoji from another shard, but I'm able to use it in a message
Does anyone know how to do that?
not anymore
did you make it more lax?
wait no
your following a .js guide but using .py?
I meant eslintrc, oof
No I'm using d.js
well i am using eslint too
do you know the emoji id?
then you can react using the id
no it doesn't work
let me know one thing
it works across shards
it says Unknown emoji
show code
is it reading?
Well if reactiing with ID it's simple msg.react('ID')
But here it is an example
Command
const emojis = require('../../../core/aesthetics/emojis')
const vcManager = require('../../../core/utils/vcManager')
module.exports = {
name: 'lock',
aliases: ['l', 'close'],
description: 'Locks your VC so that no one has access to it (besides moderators)',
reqArgs: false,
usage: null,
exampleUsage: null,
category: 'VC',
reqVoting: false,
reqChoice: null,
reqRole: false,
reqServerPerms: true,
reqOwner: true,
cooldown: 3,
async execute (ctx) {
const vc = ctx.member.voice.channel
vc.permissionOverwrites.each(async perm => {
if (perm.id !== ctx.guildSchema.role && perm.id !== ctx.member.guild.me.id) await perm.update({ CONNECT: false })
})
await vc.updateOverwrite(ctx.guildID(), { CONNECT: false })
const lockedName = ctx.genInfo.defaultLockedName
if (lockedName) await vcManager.changeName(vc, ctx.vcInfo, null, lockedName, ctx.member, ctx.guildSchema)
await ctx.react(emojis.accept)
}
}
no
hmmm
module.exports = {
accept: '717523612936175616',
reject: '717523612906684428',
acceptExtended: '',
rejectExtended: '',
arrowRight: '738133448593768560',
arrowLeft: '738133449021456406',
error: '',
ultimate: '',
lock: '752143594827284580',
unlock: '752143594361716777',
hide: '752140305574264912',
unhide: '752134135098769458',
chat: '752134135216078898'
}
emojis
let me restart my client
@quartz kindle
its showing Visual Studio instead
i wonder which is faster tho
requiring a json file or a .js one
cuz i have a similar thing on mine, but i use json
and around 100 emotes hardcoded lul
The issue here is not the speed unfortunately xD
do like this: react(":whatever:idhere")
okay
i know, just thinking out loud
Either way node.js caches it so I don't think there is any difference
maybe it's faster at caching json files
add a:, yes
ye
k
and without angular parenthesis right
im using 654mpbs, gimme a break, discord almost crashing cuz i put pirority on the other shit im downloading
lots of
no
prob every message ever sent in a guild
@quartz kindle Is there a lib similar to djs without all the caching bullshit - just the basic functionality?
iq isnt actually for smarts
discord.js-light
erwin's torrent rn:
(not sponsored)
similar to djs just djslight afaik
the other ones are not similar
tim explain to them the joke bliz
Other ones?
by default yes
yay
it caches what you want afaik
detritus
does it read my mind
its a hen, with a tie, if that explains better
yes
Hmm gonna take a look as soon as Iβm back home ty
detritus amazing
am i supposed to use the command client
they show it a lot in the examples but i feel like i need something else
i wanna use the shardclient
then you can use clusterClient option to amke it cluster
or shardClient for a single one
just do this
const commandClient = new CommandClient(config.token, {
useClusterClient: true,
}
detritus i can spoonfeed a bit more, their docs are a bit lacking
yeah
thats for when you want to use multiple shards
but seems simple enough
who wants to benchmark requiring json files vs requiring js files
tim
nah im gonna use either the shardclient or clusterclient
tim
time for your daily benchmark
i'd recommend clustering, but setting a single shard
that'd save you from the hassle of porting it later down the line
is there a difference?
source: dude, trust me
i don't fully get what the clusterclient does
legit
Glued glass cup
clusterClient is a client with lots of ShardClients inside
i mean my bot doesn't use sharding yet
keyword: yet
if you dont think it will EVER need to be sharded, dont bother
otherwise, better start soon
and use a single shard
better than taking your bot down for 2 months to rewrite it 
you get declarations for each file
like uh, a certain someone
poggers ascii text
its not required btw
that shouldnt prevent your code from compiling
Thanks Tim it works
thats cuz u didnt enable the json option deadly
doesn't prevent
what's your tsconfig.json
but my OCD's killing me
same as @opal plank's
quick benchmarksβ’οΈ
yeah but what is it actually
but without "strict" and "strictNullChecks"
certified funny man right here
xd
send the actual json
didn't even say anything and i got y'all laughing
lol
--resolveJsonModule use this @outer perch
{
"compilerOptions": {
"target": "ESNext",
"module": "CommonJS",
"moduleResolution": "node",
"outDir": "out",
"sourceMap": true,
"allowJs": true,
"esModuleInterop": true,
"importHelpers": true,
"resolveJsonModule": true,
"experimentalDecorators": true,
"noImplicitReturns": true,
"noImplicitAny": true,
"lib": ["ES2020"],
"declaration": true,
"watch": true,
"baseUrl": "."
},
"include": ["src/**/*.ts", "commands", "globals"],
"exclude": ["node_modules", ".vscode", ".env", ".eslintrc.json"]
}
unless requiring a json file does some optimizations under the hood, json and js should be loaded exacly the same



