#development
1 messages · Page 1309 of 1
have a timer (in js it's interval) run every few seconds checking if it's the time of the day that you want @earnest phoenix
for performance reasons you can run it every minute even
k thx
seems very xy problem
yup that's why im asking
@drifting wedge did you try converting it to rgb like i said?
in the line where you open it
that worked
but now i have another one
imaggg = output.open(fp).convert("RGB")
AttributeError: 'Image' object has no attribute 'open'```
```raw_image_data = await member.avatar_url.read()
fp = io.BytesIO(raw_image_data)
im = Image.open(fp)
im = im.resize((150, 150));
bigsize = (im.size[0] * 3, im.size[1] * 3)
mask = Image.new('L', bigsize, 0)
draw = ImageDraw.Draw(mask)
draw.ellipse((0, 0) + bigsize, fill=255)
mask = mask.resize(im.size, Image.ANTIALIAS)
im.putalpha(mask)
output = ImageOps.fit(im, mask.size, centering=(0.5, 0.5))
output.putalpha(mask)
imaggg = output.open(fp).convert("RGB")
imaggg.save('output.PNG')```
@earnest phoenix yeah try using __filename for file and __dirname for directory
It's apart of node's path module
has anyone here created and used a one node elasticsearch database?
then do the same thing on this one
i did tho
from the code above you didnt?
yeah try using __filename for file and __dirname for directory
that will not work, it will return the data of the command handler file
a more appropriate solution is to return some sort of a result object from your run function that contains the command data (plus you can integrate if the command failed or not, error messages etc.)
this is a more classical OOP approach
@earnest phoenix I'm pretty sure he just wanted the path information of whatever module he was working on
cron jobs can do the trick
they edited their question now but they were asking to get the file of a function they were calling
i just assumed they have the classical command-per-file structure
oh my bad then I must have misunderstood.
Are you trying to have people get matched when they react to your bots message?
try looking up Discord js Collectors, you can have a function run every time someone reacts to a message if you need it in the short term
if you need something more long term you can try looking at the Client#messageReactAdd event
my bot didn't open on node bot.js why
what
please stop asking questions like you're a caveman
@queen crescent oh I see, you're using setInterval to update the timer every 5 seconds?
Okay so iirc setInterval() returns a function you can use later on to stop it
Do you have a setInterval for each of the users?
okay can you show me the code that ends the timer?
is that the only place stopTimer is called?
Are you calling using the correct queueEmbedTimer? Maybe you aren't ending the correct one or something
how are you storing them?
Okay, put js console.log(JSON.stringify(timer))
inside stopTimer
and right after the queueEmbedTimer is initialized
and right after var queueEmbedTimer = await setInterval();
oh just do console.log(timer)
when you log them, the part where the timer is created and the part where it's called to end, are the properties the same?
Is this considered lazy?
public override string ToString() => JsonConvert.SerializeObject(this);
In this Article Stanislav Vishnevskiy elegantly discusses why Discord moved from MongoDB to Apache Cassandra, the challenges they faced, limitations of both Mongo & Cassandra. Well written article let us discuss
https://blog.discord.com/how-discord-stores-billions-of-messages...
@faint prism work smarter not harder 
not wrong
i have a generic get method set up to auto deserialize because im too lazy to do it myself
I can't be bothered to write out a really long string interpolation like:
$"MyProp: {MyProp}; AnotherOne: {AnotherOne}... etc"
sec imma find the method
I do have this though:
public override string ToString() =>
$"Count: {Count}; Sum: {Sum}; Average: {Average}; Std Deviation: {StdDeviation}; Std Error: {StdError}";
what language is that even? Java?
ah
the beauty of generics
I haven't seen the $"" form before
yoooo I'm actually doing stuff with StatusCodes rn lol
Writing a Performance Testing framework on top of a NUnit
i chose this approach because throwing and catching exceptions requires a bit more memory than just returning objects but i'm genuinely in love with generics in my code
I don't have a good concept of generics tbh... I wanted to use it with an interface so I could pass in some generic config file, but I may have just been misusing generics
public interface ILogic
{
public void Run<IConfig>(IConfig config);
}
Something like that
is there a way to acces the client in the ready event?
xyproblem, again
wtf are you doing
running erela
from my event handler
but need to pass a client through
would be nice
if you're going to listen to the ready event
you're going to already have the client
because you need to call on()
its in a different file.
pass the client through the arguments then i guess
developers are still debating that question to this day
private TimeSpan DoubleToTimeSpan(double d) => TimeSpan.FromTicks((long)Math.Floor(d));
This feels wrong
But it's an average so 🤷♂️
Don't think I've done that before. Although I think I've seen it used in some code I refactored
discord.py is what ur thinking
has anyone here ever spun up their own instance of elasticsearch?
@earnest phoenix Do you know any Reporting tools that work off of NUnit test run output?
unfortunately i don't, i rarely run unit tests
@proven lantern yes
Missing access error while trying to rename a channel, the bot does have the required permissions
Missing Access would mean it doesn't have permission to access the channel, not to modify it.
fix your promise chain too
Thing is, it does.
obviously not
It is a voice channel, and it does.
It has full admin, so don't tell me it doesn't mate
We don't have as much context as you do, so your best bet is to duck walk it through debugging.
I would try looking the channel up through the guild, not the bot
How can I make when I react to my bot message, it suppresses my reaction?
As in it removes it?
yes
What library are you using
js
Discord.js or Eris?
discord js
If you have an instance of MessageReaction, you can do <MessageReaction>.users.remove(...) to remove a specific user from the reaction.
thanks you 🙂
No problem
@prime spruce how much do you think i'll be able to do with about 4tbs of disk space and a 4GHz processor? i'm thinking about storing the names of the matchmaking games in there for searching. Things like "Counter Strike Dust Knives Only". I've heard the index grows pretty fast.
16gb enough for a decent size db?
100s to start with
16GB should get you into ~10m rows probably
nice
there are a lot of articles online about ES performance optimization
one node optimization?
I would also recommend looking at hosted ES, because security is important and they come pre-configured and distributed in an actual cluster
9000 lines of json used less than 1mb

exported from bson
but how long is each line 🤔
removing whitespace really saves a lot
thanks @prime spruce
np
so 16 is quite a bit
How do I store my commands in folders from the handler folder?
doing a category handler i think
You'd need to create your own command handler.
It involves creating each command in a separate folder than exporting the commands to then be imported/required by the command handler.
How you store and require those commands vary on your environment.
@sudden geyser Yes, but this is my command folder, and I create to try to adapt it
if (message.author.bot) return;
if (message.channel.type == 'dm') return;
if (!message.content.toLowerCase().startsWith(config.prefix.toLowerCase())) return;
if (message.content.startsWith(`<@!${client.user.id}>`) || message.content.startsWith(`<@${client.user.id}>`)) return;
const args = message.content
.trim().slice(config.prefix.length)
.split(/ +/g);
const command = args.shift().toLowerCase();
try {
const commandFile = require(`./commands/${command}.js`)
commandFile.run(client, message, args);
} catch (err) {
console.error('Erro:' + err);
}
});```
Then what issue are you currently facing.
@sudden geyser I wanted to try to store my commands in sub folders of commands, trying to organize the commands inside the project.
So like ./commands/general/ping.js for commands in the ping category and ./commands/system/eval.js for the eval command?
what do u mean
When you say "I want to try storing my commands in sub folders of commands", I am questioning if you want your commands to be split per category.
When you say "I want to try storing my commands in sub folders of commands", I am questioning if you want your commands to be split per category.
@sudden geyser yes
this is
for exemple, moderation, fun, info
etc..
what is the append in python?
Yeah, so you want what I said about about general/ping.js and system/eval.js
0Exe what are you referring to when you say append.
Append to a list? Append to a path? etc.
well im not sur
this is my context
self.giveaways.append((message.channel.id, message.id))
What is giveaways
hm
Then consult the video. It's probably a list though.
ok ty
Yeah, so you want what I said about about
general/ping.jsandsystem/eval.js
@sudden geyser so i will put this in replacing with.commands/${command}.js
have a question. So bot i made just says its offline and it wont respond to msgs. anyway to fix?
@drowsy kite if you want what I was talking about with ping and eval being in separate subfolders, you'd need to do a bit more work than what you're currently doing.
require(...) works when it's just a one-level directory, but as each command would be split into sub directories (./commands/.../), that won't work. You can easily solve this by storing your commands in a collection of some sort (array, object, map, collection, etc.)
When you start the program, have your command handler read the ./commands/ directory, then read each sub-directory (./commands/.../). You'll be using the fs module provided by Node.js to accomplish it. You then require each file and store it in a collection you keep, such as attaching it to your client instance.
It's quite complicated to explain how to write it, so reading this guide may be helpful: https://discordjs.guide/command-handling/#dynamically-reading-command-files
how can i make the bot run a function, after a certain amount of time?
like a command starts a timer, and after the timer, it runs a func (py_
a timeout? pretty sure py has those
anyone know how to fix bot always offline problem
run it?
like lets say bot says, "what is 1+1"?
and i respond 2
how does bot get that value?
Await messages
how
Don’t know how py works but pretty sure it is a thing there
k
can any1 with a brain and undersyands dns help me?
dont ask to ask
okkkkkkkk
I got a domain from get.tech (github student pack) and trying to connect it to my cpanel
currently my cpanel is using a friends subdomain
how can i make the domain the domain i got from get.tech?
Hey @quartz kindle, i want to get yes/no as an answer
how do i modify so it does that
look into the check part of the example
k
@drifting wedge does your cpanel have a section for "addon domains"?
yes
i think my intents work
add it there
my bot hasn't spewed 69 thousand errors yet
yet
why are people only turning on intents now
Just get into reaction panels and voice channel muting @misty sigil
Paired with databases
@quartz kindle because they are about to be required
if i didnt use intents 1 years ago, i would have needed a better vps by now lmao
what are intents
They were planned for yesterday but were pushed back for now
soemone tell
why are people only turning on intents now
@quartz kindle great question
they were not pushed back
We’re they not?
i would have used them
Oh
I need help from someone smart
I am on v7
v6/v7 are deprecated anyway
how do i update to v8
discord.js is still on v6/v7
so if my code works for v7
Because they are switching to v8 soon
it should work for v8
We all are lol
there are not a lot of changes in v8
v11 is in a grave now
what you mean by v8 then
but still, there are some changes that lib devs need to look at
API version
djs will probably make a v13 version for v8
and take the chance to implement other breaking changes while they're at it
Imagine switching from v11 to v12 and v13 is gonna be v11 again
Lol
why tho
It’s a joke
a joker joke
anyway intents were a god send
i've been using them ever since they were released
actually even before that
i was already using guild_subscriptions, which was what they had before intents
Yeah
I know how to use them I just don’t sadly
Gives me a advantage on the v8 change because I can actually help out instead of scrambling to fix my bots myself
a person who uses my lib complained that after he updated to the latest version his memory usage went from 50mb to 200mb
turns out they simply didnt enable intents in the latest version

presence updates really are stupid
I cant seem to do the yes/no thing
can someone send me a small snippet of the code?
@drifting wedge show your addon domains page
@earnest phoenix what are you not understanding about that example? everything is there
k
you create a function that checks if the received message matches what you're expecting from the user
ok
Tim what Lib?
discord.js-light
@drifting wedge what did you enter for domain, subdomain and root?
but i didnt do anything to the archbot.tech dns
{ ws: { intents: Intents.ALL } }
you can, but thats the same as not using intents
intents let you define what you want discord to send you
for example intents: "GUILD_MESSAGES"
you will receive ONLY guild messages, and nothing else
how much bandwidth did it save for you tim
85-90%
I need to mark that too?
@solemn leaf the reason for using intents is that discord sends you a LOT of shit that you dont need, which wastes cpu and bandwidth
especially presenceUpdates
@drifting wedge what does it autofill in subdomain when you input your domain?
archbot
so my 15GB a day bandwidth will drop
well i dont want it to be archbot.firfrfrfrggr.rgergerg.com
just archbot? not the full domain?
like i want the domain to be archbot.tech
whats the full subdomain that is autofilled
yes, archbot for the subdomain
wait, i just checked the second error message you posted
so the previous error about a subdomain already existing is not showing anymore?
i deleted it
@solemn leaf check here and chose which ones you need https://discord.com/developers/docs/topics/gateway#gateway-intents
do you have an account there? can you login there?
yes
archbot.archbot.tech?
oh yeah they give u a year of free domain
well i want it to be archbot.tech
so go in there and change the dns servers
to?
the dns that your server uses
my friend sent me the NS for his subdomains
I don't know what is happening.......
I asked my friend to join the server to test this code:
@client.event
async def on_member_join(member):
with open('users.json', 'r') as outfile:
data = json.load(outfile)
print(data.keys)
if str(member.id) in data.keys():
return
else:
data[str(member.id)] = 5
with open('users.json', 'w') as json_file:
json.dump(data, json_file)
It didn't work, so i edited the code slightly and he rejoined while this code was running:
@client.event
async def on_member_join(member):
print('hi')
with open('users.json', 'r') as outfile:
data = json.load(outfile)
print(data.keys)
if str(member.id) in data.keys():
return
else:
data[str(member.id)] = 5
with open('users.json', 'w') as json_file:
json.dump(data, json_file)
It didnt even print hi when my friend joined
then put the same NS as he uses
ok ok
const bot = new Discord.Client({ disableMentions: "everyone", ws:config.intents});
"ws": {
"intents": [
"GUILDS",
"GUILD_MESSAGES"
]
}
ok
yes
@quartz kindle done
now remove the ws from the config
should take a while tho
leave only the intents
do i HAVE to update dpy? or is it fine as it is?
idk, why do you have to?
the new presence update and intents?
I don't know what is happening.......
I asked my friend to join the server to test this code:
@client.event
async def on_member_join(member):
with open('users.json', 'r') as outfile:
data = json.load(outfile)
print(data.keys)
if str(member.id) in data.keys():
return
else:
data[str(member.id)] = 5
with open('users.json', 'w') as json_file:
json.dump(data, json_file)
It didn't work, so i edited the code slightly and he rejoined while this code was running:
@client.event
async def on_member_join(member):
print('hi')
with open('users.json', 'r') as outfile:
data = json.load(outfile)
print(data.keys)
if str(member.id) in data.keys():
return
else:
data[str(member.id)] = 5
with open('users.json', 'w') as json_file:
json.dump(data, json_file)
It didnt even print hi when my friend joined
@drifting wedge im pretty sure dpy already supported those for a long time
alr ig
everything else is working
@solemn leaf no it was right before, i was thinking about something else and didnt read it right
gr
help pls
@earnest phoenix what is that code supposed to do?
how much "skill" would you guys say is required to make a dashboard?
Not much
Aslong as you have the knowledge of a web framework, templating, databases and server side its fine
But depends what it is exactly
@drifting wedge I actually made a small example here https://github.com/Misly16/bot-dashboard
Never finished it but it shows how one works
how would i make my bot reply aa message if its pinged? (node, d.js, v12)
@honest perch u have screenshots?
I mean, just view the code?
Doesn't matter how shit the front end is, the backend would always be the same
how would i make my bot reply aa message if its pinged? (node, d.js, v12)
@obtuse wind check if the message contents is <@id>?
ik but like how does it look? or doesnt it have anything?
It looks like a dashboard
I tried that method but it is failing to return a reply
Any errors?
ik but like how does it look? or doesnt it have anything?
@drifting wedge the front end is literally html but in ejs
i.e.
if(message.content.toLowerCase().includes(`<@${bot.user.id}>`)){
@drifting wedge the front end is literally html but in ejs
@honest perch just a question
for the topcord website
is it still active
Yes but that's not relevant in here
ill try it without the tolowercase
My eyes hurt when I opened this channel and saw JSON database
GUILDS (1 << 0)
- GUILD_CREATE
- GUILD_UPDATE
- GUILD_DELETE
- GUILD_ROLE_CREATE
- GUILD_ROLE_UPDATE
- GUILD_ROLE_DELETE
- CHANNEL_CREATE
- CHANNEL_UPDATE
- CHANNEL_DELETE
- CHANNEL_PINS_UPDATE
GUILD_MEMBERS (1 << 1)
- GUILD_MEMBER_ADD
- GUILD_MEMBER_UPDATE
- GUILD_MEMBER_REMOVE
GUILD_BANS (1 << 2)
- GUILD_BAN_ADD
- GUILD_BAN_REMOVE
GUILD_EMOJIS (1 << 3)
- GUILD_EMOJIS_UPDATE
GUILD_INTEGRATIONS (1 << 4)
- GUILD_INTEGRATIONS_UPDATE
GUILD_WEBHOOKS (1 << 5)
- WEBHOOKS_UPDATE
GUILD_INVITES (1 << 6)
- INVITE_CREATE
- INVITE_DELETE
GUILD_VOICE_STATES (1 << 7)
- VOICE_STATE_UPDATE
GUILD_PRESENCES (1 << 8)
- PRESENCE_UPDATE
GUILD_MESSAGES (1 << 9)
- MESSAGE_CREATE
- MESSAGE_UPDATE
- MESSAGE_DELETE
- MESSAGE_DELETE_BULK
GUILD_MESSAGE_REACTIONS (1 << 10)
- MESSAGE_REACTION_ADD
- MESSAGE_REACTION_REMOVE
- MESSAGE_REACTION_REMOVE_ALL
- MESSAGE_REACTION_REMOVE_EMOJI
GUILD_MESSAGE_TYPING (1 << 11)
- TYPING_START
DIRECT_MESSAGES (1 << 12)
- MESSAGE_CREATE
- MESSAGE_UPDATE
- MESSAGE_DELETE
- CHANNEL_PINS_UPDATE
DIRECT_MESSAGE_REACTIONS (1 << 13)
- MESSAGE_REACTION_ADD
- MESSAGE_REACTION_REMOVE
- MESSAGE_REACTION_REMOVE_ALL
- MESSAGE_REACTION_REMOVE_EMOJI
DIRECT_MESSAGE_TYPING (1 << 14)
- TYPING_START
Looking at this for intent would I just add it
My eyes hurt when I opened this channel and saw JSON database
@slender thistle json best db
?
Can some one help me. when i want to setup a help command like for example b!help i haven't evern wrote out the code and it jsut says
what is the intent for vc
Can some one help me. when i want to setup a help command like for example b!help i haven't evern wrote out the code and it jsut says
@ocean pasture That's the default help command the commands extension provides
UnhandledPromiseRejectionWarning: Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.
from utils import lists, permissions, http, default, argparser how can i install these?
python*
@solemn leaf you using discord.js ?
Yeah?
What is the utils module supposed to be?
https://discord.js.org/#/docs/main/stable/class/Intents
here is a list of all the intents
here is a list of what each intent gives https://discord.com/developers/docs/topics/gateway#list-of-intents
so for vc i assume you want GUILD_VOICE_STATES
#development message
@earnest phoenix you can't async write to a file. You'll get access violations from the operating system. Don't use JSON to store data asynchronously
Thanks @oak cliff
Will any of my commands break
like my avatar command
or anything else?
uhhhh i dont know for certain, the only intents ive ever messed with are GUILDS and GUILD_MESSAGES
j
I don't wanna be declined bcs of something I barely understand
i believe for stuff like avatar you can fetch from the api not from the guild itself
but ive never done that myself
k
I know when I tried my music commands
it didnt work until I added the intent
"GUILD_VOICE_STATES"
I could make a guide for this
just the basics of what you need
but I think I can feel my internet speeding up who knows
@fiery canyon
or just for this
I know
let me think
Im trying to remebr
brain workie
@fiery canyon I think 30Sends:1Mins
something close to that
@drifting wedge round(a) takes a and returns a rounded value of it
it does not modify the original a in any way
How can I make my bot deafen itself
VoiceState#setSelfDeaf(true) - https://discord.js.org/#/docs/main/stable/class/VoiceState?scrollTo=setSelfDeaf
@quartz kindle the archbot.tech domain still isn’t doing anything
new Discord.VoiceState(message.guild#voice#setSelfDeaf);
not that
I haven’t connected it to cpanel yet, how do I do that?
not that>?
do you know your hosting nameservers?
or dns^
what did you set it to?
did you set an A record?
@solemn leaf you had it right - https://discordapp.com/channels/264445053596991498/272764566411149314/764290429528834058
message.guild.voice.setSelfDeaf(true) should work if the bot is in a vc
or something?
message.guild.voice.setSelfDeaf(true)should work if the bot is in a vc
You don't need the true I think
It does say so on the docs
but its setting it
like .setTimeStamp()
you dont need a true
did you actually read it?
seriously, i linked it to you
i'm sorry if i sound toxic but it's literally there
im wondering how to code a mute command in discord.py
such that the person cant talk
for some time
Temp mute?
temp and non temp
It'd be a server mute or a role that prohibits voice chat
So I'm trying to have the bot self deaf after joining the voice channel and this code worked on the old bot (without discord-akairo) and now it doesn't work :(. Code: https://srcb.in/f9fbd18cac Using discord-akairo
they have a cpanel license?
he sent me the vps domain servers
and i have a cpanel
idk but the cpanel works lol
that...would try to make the member deaf, which won't work since the method works for the member's voicestate and it makes the client deafsetSelfDeaf() is for the client

so
Well my script doesn't work for me
So I'm trying to have the bot self deaf after joining the voice channel and this code worked on the old bot (without discord-akairo) and now it doesn't work :(. Code: https://srcb.in/f9fbd18cac Using discord-akairo
it should work actually @solemn leaf
wait what @pale vessel , my script in discord-akairo doesn't work for some reason
😦

@pale vessel same cause it should work. It works in the old version of my bot :((((
v11?
flazepe#8587 same cause it should work. It works in the old version of my bot :((((
RaymondJiang1#5270
version v12 of d.js and node is absolutely required.
they are using v12
@compact echo so it plays everything just fine, just not deafened?
what's your domain registrar?
@pale vessel get.tech
@pale vessel yes
ye
@drifting wedge can you go to your registrar's panel?
is there an option to setup dns records?
so for intents, bots will go offline when it becomes mandatory? do ALL bots have to specify intents including the ones not over 100 guilds?
All
yeah they're mandatory
Just go ahead and enable them
ah shit ok
Why isnt this returning if there isnt args
if (!args[0]) {
message.channel.send("Need Args!")
return;
};
args[0]
!args
Lol
assuming args is an array, it is always truthy
^
is there an option to setup dns records?
@pale vessel 1 sec
^^^
check the first index or use !args.length
Also, anyone got a list of intents?
this?
there's more than 2?
Like the different ones
the 2 current NS are the vps's host ns
Thx sent twice
oh
off topic: flaze, great job with chip, i think you were the one who made it
haha, kyoso made it
I’ll
chip is really good though, yes
if i mention @paper bluff devs with the id, does it ping the,?
@blissful coral
If you don’t have perms it won’t
i think you might need to use the vps ip for an a record
Hi Aki
i think you might need to use the vps ip for an a record
@pale vessel well i have the servers ip
is there a way to use all intents bc uhh i kinda dont wanna list them all
(gotten by doing ping domain)
Yes
that works?
I think it is intents: all
you can try
yeah ig
Removing that presence update really helps
create an a record pointing to your vps's ip and try to add the domain again in cp
create an a record pointing to your vps's ip and try to add the domain again in cp
@pale vessel 1 sec
record in the registar?
yeah
do i need to do anything with the domain secret?
the new one?
create a new record
or the current sub domain from my buddy?
archbot.tech
i mean its pretty slick imo
@pale vessel
is it manage dns?
before that, is the ns ns1.eukserver.com or ns1.ukserver.com?
1 secccc
this is what it is set to currently
the ip should be your vps ip
like .archbot.tech
Should be instant for most
think i gotta add to cpanle
did you add it to cpanel after you changed the dns?
1 sec
in addon domains
i put this
maybe i can try zone editor
replace arch.eukserver.com
with archbot.tech?
the domain has not propagated properly yet
there is no A record anywhere, and NS records only partially propagated
@quartz kindle is it time related?
like something i did wrong?
or just waiting?
can you show how the get.tech domain configuration looks like?
is it this?
yes
and you went to name servers, right?
but thats the top
i went on the bottom
where is dns
this is the name servers
i think you should just let the ns propagate and if it still won't let you add the domain, try other records instead
alr
how long ya think
when i update dns it usually takes abour 4 hrs
or just tmr?
only one way to find out
@pale vessel it isnt client
do you guys like the design so far?
Love it
looks clean and smexy
@heady heron
once it gets updated in my region
irll work>
@compact echo Don't know if you figured it out
message.guild.me.voice.setSelfDeaf(true)
that's exactly what they used
do i need to wait for the tihing to update everything to update the cpanel?
or like some locations is good enuf?
everything just to be safe
@solemn leaf i figured it out, it’s fine
what fixed the issue?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
im so confused rn
One message removed from a suspended account.
const table = require('table');
client.commands = new Discord.Collection();
fs.readdir("./configuration/", (err, files) => {
if(err) console.error(err);
let jsfiles = files.filter(f => f.split(".").pop() === "js");
if(jsfiles.length <= 0) {
console.log("No Commands To Load!")
return;
}
console.log(`loading ${jsfiles.length} commands!`);
const header = [['Command', 'Status']];
jsfiles.forEach((f, i) => {
let props = require(`./configuration/${f}`);
header.push([`${+i + +1}. ${f}`, 'Loaded ✅']);
client.commands.set(props.help.name, props);
});
console.log(table.table(header))
});
That is the way it is setup @solemn leaf
For me
It is
I have 5 of those
Js
for each module
LOL
im gettign a npm
How does it work
I know all function xD
cool
jsfile.forEach((f, i) => {
let props = require(`./commands/${f}`)
header.push([`${+i + +1}. ${f}`, 'Loaded ✅']);
bot.commands.set(props.help.name, props);
});
console.log(table.table(header))
const header = [['Command', 'Status']];
jsfiles.forEach((f, i) => {
let props = require(`./configuration/${f}`);
header.push([`${+i + +1}. ${f}`, 'Loaded ✅']);
client.commands.set(props.help.name, props);
});
console.log(table.table(header))
Like it joines ur game
@blissful coral Auto-mute is not allowed from API, thats is not good work.
thats be removing or bad.
@manic osprey I removed it
?
what would header be
Like among us ai
So Like it is like a player
Oh
discord api doesnt allow it
thats so cool
@blissful coral send me file from mute and i go show it code
Maybe make it a application
how do you go about actually running your html/css files as a website? everything ive googled for the last few days has just brought up wordpress or google sites or some other nonsense i dont want
@manic osprey huh
oK
fs.readdir("./Commands/", async (err, files) => {
if (err) console.log(err);
let jsfile = files.filter(f => f.split(".").pop() === "js")
if (jsfile.length <= 0) {
console.log("No commands were found. . .")
return;
};
const header = [['Command', 'Status']];
jsfile.forEach((f, i) => {
let props = require(`./commands/${f}`)
header.push([`${+i + +1}. ${f}`, 'Loaded ✅']);
bot.commands.set(props.help.name, props);
});
console.log(table.table(header))
});
this looking right then?
would it be more efficient to use python instead of d.js? (talking about efficiency, not difficulty)
*discord.js
djs better
oK
just use what you prefer
kk
its a opinion
Define efficiency
@blissful coral what if it isn't loaded 
to put that?
how would it be loaded
my error handler broke
;(((
process.on('uncaughtException', async (err) => {
let me = await bot.users.fetch("485987127809671168")
let buf = new Buffer.from(err)
me.send({ files: [{ attachment: buf, name: 'file.txt' }] });
}).on('unhandledRejection', async (err) => {
let me = await bot.users.fetch("485987127809671168")
let buf = new Buffer.from(err)
me.send({ files: [{ attachment: buf, name: 'file.txt' }] });
})
?
Well what type of error is it?
I don't remember what it throws
wdym
Just make a file and don't have the .help
And see
Make a blank file
in the cmds folder
see what error you get
give me a error
?
bruh
send your full handler
?
fs.readdir("./Commands/", async (err, files) => {
if (err) console.log(err);
let jsfile = files.filter(f => f.split(".").pop() === "js")
if (jsfile.length <= 0) {
console.log("No commands were found. . .")
return;
};
const header = [['Command', 'Status']];
jsfile.forEach((f, i) => {
let props = require(`./commands/${f}`)
header.push([`${+i + +1}. ${f}`, 'Loaded ✅']);
bot.commands.set(props.help.name, props);
});
console.log(table.table(header))
});

fs.readdir("./Commands/", async (err, files) => {
if (err) console.log(err);
let jsfile = files.filter(f => f.split(".").pop() === "js")
if (jsfile.length <= 0) {
console.log("No commands were found. . .")
return;
};
const header = [['Command', 'Status']];
jsfile.forEach((f, i) => {
let props = require(`./commands/${f}`)
header.push([`${+i + +1}. ${f}`, 'Loaded ✅']);
bot.commands.set(props.help.name, props);
});
console.log(table.table(header));
});
fs.readdir("./Commands/", async (err, files) => {
if (err) console.log(err);
let jsfile = files.filter(f => f.split(".").pop() === "js")
if (jsfile.length <= 0) {
console.log("No commands were found. . .")
return;
};
const header = [['Command', 'Status']];
jsfile.forEach((f, i) => {
let props = require(`./Commands/${f}`)
header.push([`${+i + +1}. ${f}`, 'Loaded ✅']);
bot.commands.set(props.help.name, props);
});
console.log(table.table(header));
});
someone help me to do a cooldown in handler?
Try that
then change top one

@zenith pecan
@zenith pecan
@blissful coral I tried on that one but it didn't work
I need help saving data to a db in python for per server prefixes
https://discordjs.guide/command-handling/adding-features.html#a-dynamic-help-command
@blissful coral does this work?
How do you setup your commands @solemn leaf
Ok
Show me one of your commands
the same way you do
lmao
const Discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
}
module.exports.help = {
name: ""
}
mna isnt that funny
why even do that
If not it will error
just export all into a single object
@opal plank Honestly I did it for fun at first
And it looked cool
So he asked
lol
Idk why it isn't working
It was like this before the table btw
so yeah
hi
How may I help?
h need help
With?
h need play bot hn my siraver
BRO HE JUST NEEDS HELP WITH ADDING A BOT
that's related to bot #development
I dont understand
I am so confused
stop minimodding man
Ima just... Leave..
we just asked them to not ask to ask
thanks for coming, minimodding and going away
using an image




