#development
1 messages · Page 1510 of 1
yeah, what's your question
so video previews from my website do not load onto discord
example:
did my internet just die
nvm
o
o
that does
that shows
and its exactly the same but different website
and different video
not really sure
and i am getting a request
"GET /assets/Videos/mercedes-aa-class.mp4 HTTP/1.1" 200 13763150 "-" "Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)"
How do i get the Bot Dev role?
by not speaking in this channel about it
and submitting a bot and getting it approved
Okay i just wanted to ask
Okay i understand
body: (new FormData()).append('file1', fs.readFileSync('./aFile.ext'))?
@slim heart eeeeeeeee
file
fuck I must be doing something wrong
https://million.is-a.computer/files/Pa5wPQFt334EQSZ3.png this worked in postman
@mellow kelp do you think you could help me with this?
send a file
local file am i right?
oh then you need the form-data package
fuck
lol
const FormData = require("form-data");
const fetch = require('node-fetch')
const fs = require('fs');
const formData = new FormData();
formData.append('file', fs.readFileSync('README.md'), 'README.md')
fetch('https://discordapp.com/api/v8/channels/731324778345922631/messages', {
method: 'POST',
headers: {
Authorization: 'Bot TOKEN',
"Content-Type": "multipart/form-data",
},
body: formData
}).then(e => e.json()).then(e => console.log(e))```
{ message: 'Cannot send an empty message', code: 50006 }```
@slim heart what did I do wrong?
u might need to convert it to a data uri instead of a buffer
idk i'm getting lost too
oh
you should ask in discord devs
@crimson vapor you wanna borrow my data uri thing?
does it work?
well yeah but it's a whole class thing
you can send files?
no i can make data uris tho
iirc formdata requires special headers
content-type: "multipart/form-data"
wha.
ima test this
yes but no
still didn't work
in the docs u also need like the Content-Disposition header for the file name
yes
it sends the data as form data
all you have to do is provide a data uri
the form-data package has an example for axios, just change it to use node fetch
axios.post( 'https://example.com/path/to/api',
form.getBuffer(),
form.getHeaders()
)
hmm weird, they have an example for node-fetch that doesnt use headers at all
lmao
might do it automatically in node fetch
perhaps
formdata headers are weird af
discord requires multipart/form-data
here's another example using node's http.request ```js
var form = new FormData();
form.append('image2.png', fs.readFileSync('./public/image2.png'));
res.set('Content-Type', 'multipart/form-data; boundary=' + form.getBoundary());
FUCK YES
TY TIM
const FormData = require("form-data");
const fetch = require('node-fetch')
const fs = require('fs');
const formData = new FormData();
formData.append('file', fs.readFileSync('README.md', 'utf8'), 'README.md')
console.log(formData.getHeaders());
fetch('https://discordapp.com/api/v8/channels/731324778345922631/messages', {
method: 'POST',
headers: {
...formData.getHeaders(),
Authorization: 'Bot NjkyMDI5MzIwNzc1ODYwMjQ1.Xnokhw.KEKW',
},
body: formData
}).then(e => e.json()).then(e => console.log(e))```
WORKED
ha
TY @quartz kindle
lmao
i mean, its already in their examples
btw, isnt google drive supposed to auto delete items from trash after 30 days?
iirc
my google drive was full of old ass trash
or maybe once your drive fills up
from a year ago
ye but like
my drive was 15gb used out of 15gb
i had to empty trash + reload + empty trash + reload a bunch of times
because shit's bugged af
now the trash is finally empty
and got 10gb free space back
@_@
lmao what
all my projects are inside the drive sync folder
so everything i do gets auto synced to drive
ah yes
what about node_module?
the only shitty thing is that google drive sync cant filter out stuff
UnhandledPromiseRejectionWarning: TypeError: source.on is not a function thank you so much formdata
so node_modules is included
object moment
JSON.stringify() should work
iirc this one is caused by shitty error handling
@slim heart how can I update the headers using your rest api lib?
but no file sent
fuck
const form = new fd()
form.append("payload_json", JSON.stringify(body))
form.append("file", file.baseString, file.filename)
res.body(form, "form")
res.header({
"User-Agent": "DiscordBot (https://discord.gg/coolinvite, v1)",
"Authorization": `Bot ${this.token}`,
// @ts-ignore
...form.getHeaders()
})
centra is fun
did it work for you?
nope
rip
client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)
using this code to count total guilds, in a command i'm using the same thing but with message. at the beginning. The text coommand has the right count but the bot status is stuck on an old number. Anyone know why that'd be happening?
are you updating the status? if you are show the code
@quartz kindle be my debugger
yes
client.on('ready', async () => {
const activityList = [
`${client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)} cuties!`,
`${client.guilds.cache.size} servers!`,
'niko help',
'niko | n! | にこ'
]
setInterval(() => {
const activityRandomizer = Math.floor(Math.random() * (activityList.length - 1) + 1);
client.user.setActivity(activityList[activityRandomizer], { type: 'WATCHING' });
}, 100000)
});
wait...
i gave wrong code... smh
i think i give up
thats what im using for guilds
is activityList static?
if it static it will only change on restart
const req = await fetch(this.#shard.client.options.api + `/channels/${this.id}/messages`, {
method: 'POST',
headers: {
...message.getHeaders(),
Authorization: `Bot ${this.#shard.client.token}`,
},
body: message
}).then(e => e.json())
if (req.code) throw new Error(req.message)``` @trim saddle this worked for me
message being FormData
well it changed earlier and i didn't restart... idk
i use centra for my stuff
whats centra?
a different requesting lib
i think so...
console log the response
} catch (err) {
throw err;
}``` I want to throw the error
how do i return a callback func? like im passing a func to node resque jobs but then i want a callback from this function
@umbral zealot
"returning a callback function" is... returning a variable that contains a function
that's it
return (a) => {blah};
anyone familiar with events and missing permissions on ready? thought i had this accounted for, one sec for code:
i know
so its like
im passing a func to my node resque jobs
inside there
im passing a func that has callback
I'd like to clarify, I have no idea how node-resque works, I've never used it, and I've never installed redis, so my assistance is very limited 😂
I can only speak in generalities of javascript
and its good
i know js lol
i mean the basic call func
jsut trying to get it from node resque
since idk the syntax
Right so what do you have now and what do you need to do?
there
try {
exports.invReady = client => {
client.guilds.cache.forEach(e =>{
if(e.me.hasPermission('SEND_MESSAGES')===false) {
return;
}
})
wait(1000);
client.guilds.cache.forEach(g => {
(doing stuff)
});
console.log('Loaded all invites in all guilds')
}
} catch (error) {
console.log('error')
}
what i have now is workers that'll pick a function that returns void
if i have a func that returns callback
CAn you show the code
idk how to do it syntactically
[jobName]: {
Plugins: [Plugins.JobLock],
PluginOptions: {
JobLock: { reEnqueue: true },
},
perform: () => {
jobsToComplete--;
// this.tryShutdown();
if (typeof jobFunc === "function") {
return jobFunc(funcParams);
}
return false;
},
},
}```
this is the job
and the error i keep getting on ready:
(node:23432) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
at RequestHandler.execute (c:\Users\PC4\Desktop\v2-new\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async RequestHandler.push (c:\Users\PC4\Desktop\v2-new\node_modules\discord.js\src\rest\RequestHandler.js:39:14)
Actually it doesn't
how do i access that
I mean, this returns the results of jobFunc(funcParams) so unless jobFunc returns a function, it's not "Returning a callback"
just to be clear: a callback is literally just a function we call by another name because it's cutesy.
Ok so, like, how do you call perform(), then?
then you can't access the return value, I'm pretty sure
i am using both try-catch for catching the error, and forEach looping each guild to check permissions. still comes up with the error on start. no commands used, just on ready. know where the error is just would like to catch it, but seems to be doing it at permission checks
yeah thats what i was thinking
your initial forEach does... literally nothing. Like, it... doesn't actually do anything useful
client.guilds.cache.forEach(e =>{
if(e.me.hasPermission('SEND_MESSAGES')===false) {
return;
}
})
This just... loop and does nothing. It's pointless.
lol
sometimes same
alright so that aside, not even this is doing anything
try {
exports.invReady = client => {
something something
}
} catch (error) {
console.log('error')
}```
.method({ headers: {...}, body: ... })
tho i think it might not work
ngl
I don't think it does
1s
got the proper json response
still exports. that's odd imo
pog
i'm cancelling this project
Why would you even export a function from within a try/catch that doesn't even make any sense
or just replace them?
and do
{ headers: {...}, body: formData, parser: (_) => _) }
I dunno it looks like button mashing to me
its cuz the parser is all messed
because i'm trying to catch missing permission "SEND_MESSAGES" from the getgo
so if options.parser is there itll just run it and return itself
you should do that catch inside the function itself
poggers
Anyways, what you need is filter() not forEach
like I said the foreach is 100% pointless as is
.filter() for each guild?
no
hmm
client.guilds.cache.filter
@slim heart can you like join a live share before my brain
so you want to filter on guilds where you have permissions to speak, right?
sure
o
u mean like code share
cant rn im like nap time but u can ask questions ig
naptime?
this is on the ready event, when the bot loads in, i'm not looking to filter guilds, because it needs to load each guilds' invites
whenever it restarts
it's 11 at night
So what are you trying to do
and you're a grown man
trying to catch missing permission "SEND_MESSAGES" from the getgo
nap time
"catch"
for what reason
what are you trying to do
what's the end game? I have literally no clue what you're trying to do
show?
if my bot is in 100 guilds and each guild denies send messages, it won't stop polluting the logs

const req = await this.#shard.client.api().channels[this.id].messages.post({
body: message,
headers: {
...message.getHeaders(),
Authorization: 'Bot NjkyMDI5MzIwNzc1ODYwMjQ1.KEKW',
},
parser: (_) => (_)
});
if (req.code !== undefined) throw new Error(req.message)
return new (require('./Message'))(req, this.#shard);```
no comprende amigo
Where is it failing
what problem are you trying to fix
Because this is clearly an X/Y problem. We need the why
What do you have to include in a say command for it to be allowed on top.gg? Sorry if this is the wrong chat
fails at this:
async push(request) {
await this.queue.wait();
try {
return await this.execute(request);
} finally {
this.queue.shift();
}
}
RequestHandler.push (c:\Users\PC4\Desktop\v2-new\node_modules\discord.js\src\rest\RequestHandler.js:39:14
say commands aren't monitored as long as they're used in the same channel/same server
the exact same code works with node-fetch @crimson vapor ?
say commands are a bad idea
No no. your code. not the discord.js code
lemme ctrlz to get code sec
what problem in your code are you trying to fix
mainly because people can use it to slander your bots image
try {
exports.invReady = client => {
something something
}
} catch (error) {
console.log('error')
}
Ok and what does that do
let req;
try {
req = await fetch(this.#shard.client.options.api + `/channels/${this.id}/messages`, {
method: 'POST',
headers: {
...message.getHeaders(),
Authorization: `Bot NjkyMDI5MzIwNzc1ODYwMjQ1.MMLOL`,
},
body: message
}).then(e => e.json())
} catch (err) {
throw err;
}```
AGain, what is your end goal here, what are you trying to write
guys how can i make my bot 24/7 online?
is it an invite tracker? a ping/pong command? scratch-your-ass-with-a-robot integration?
what the fuck are you doing
does that work million
fetches guild invites, if a guild is missing send messages it should return and not proceed for that guild. tracks invites on ready
guys?
ok so what is the fetch code. where's that code
Host it on a vps
yep it does berry
try {
exports.invReady = client => {
client.guilds.cache.forEach(e =>{
if(e.me.hasPermission('SEND_MESSAGES')===false) {
return;
}
})
wait(1000);
client.guilds.cache.forEach(g => {
g.fetchInvites().then(async guildInvites => {
invites[g.id] = guildInvites;
});
});
console.log('Loaded all invites in all guilds')
}
} catch (error) {
console.log('something')
}
Ok god
so again
client.guilds.cache.forEach(e =>{
if(e.me.hasPermission('SEND_MESSAGES')===false) {
return;
}
})
This does absolutely fuck-all
nothing
nada
it's pointless code
Why does it exist
what is its intended purpose

You did? Good, because I still have no goddamn clue what you're trying to do 😂
Because this... this makes sense. ```js
client.guilds.cache.forEach(g => {
g.fetchInvites().then(async guildInvites => {
invites[g.id] = guildInvites;
});
});
I know what this is. Looks like the AIG invite tracker code, somewhat.
But a shit version of it tbh
invites[] undefined
Cuz... I mean... it literally is ```js
// Initialize the invite cache
const invites = {};
// A pretty useful method to create a delay without blocking the whole script.
const wait = require('util').promisify(setTimeout);
client.on('ready', async () => {
// "ready" isn't really ready. We need to wait a spell.
await wait(1000);
// Load all invites for all guilds and save them to the cache.
client.guilds.cache.forEach(g => {
g.fetchInvites().then(guildInvites => {
invites[g.id] = guildInvites;
});
});
});
Straight-up from this <https://anidiots.guide/coding-guides/tracking-used-invites>
But your added loop is just... nothing
you just realised after I said it like 3 times, so... thanks for catching up to 20 minutes ago in the conversation, I guess?
ye ye, thanks for bearing with me. i would leave a tip for you if i could
Actually I'll give you a tip: when you want help it's a great idea to actually read the responses people are giving you, like, using your brain.
If you don't comprehend the answer, or you need more info, ask instead of ignoring it
3 times.
I don't
ngl yeah quite, been busy with work, probably shouldn't be working on this alsjdalksdj
but I can explain berry
I sleep whenever I get a really hard problem I can't solve
and I wake up when I solve it
stonks
Agreed. Go to bed, young man, you'll feel better in the morning. Drink some water too, it helps the brain.
all of my bots were continually coded over multiple moments before i fell asleep
Full 8 hours of sleep, doctor's order.
i go to sleep at 4am and wake up at 6am on work days and 8am on stinky days
is school stinky?
no weekends n shit
oh
well
I sleep till 12 on weekends
same
true
wow i am a dumbass. fixed it in the real code, now it's working perfectly; no more polluting logs. thanks to you all who watched me go through a moment of insanity and bared with me
i cant seem to understand the command to put insert in order for it to welcome members when they join, anyway someone couple help me?
guys can i make a glitch project 24/7 online?
bruh i found a way to host a bot
you can make 3gb servers
to host them
holy shit this is amazing
HOW
OK
let value = 250
if(!args[0]==code) return message.reply('Hmm.. The code entered is invalid.')
if(args[0]==code) {
let codeRedeem = db.fetch(`CODE2_${message.author.id}`)
if(codeRedeem ==null) {
db.add(`Cash_${message.author.id}`, value)
await message.channel.send(`Success! You have redeemed the code: ${code} and received ${value} coins!`)
return db.add(`CODE2_${message.author.id}`, 1);
}
} else {
message.reply('Code already redeemed.')
}```
But for whatever reason, It responds to any message as long as it starts with the prefix. Ideas? (it gives no errors)
d.js v12
did you use a Command Handler or is it a single file Bot?
Command handler
so this one command fires regardless of the command being valid or not
sounds like an issue with your command handler
Never seen this happen before
or your command
and whats the response?
probably the error
@agile lance, Code already redeemed.
oh
wait so it skips your entire logic?
Basically
i think
!args[0]==code
that is wrong
yea there is stuff wrong with your entire command
i never write it like that
he gets the first item from the array
try
args[0]!=code
instead
Okay
but this wont fix the issue that the command fires on every string that starts with the prefix
Now it automatically redeemed the code without any code being inputed
:v really
there is something broken in your logic somewhere either the Command handler or the command
other commands work fine?
then its probably this one command
does the code only "release"?
thats the only code yeah
i guess its a placeholder for Dev
why not make the command named "code"
and then make an array that contain all the code to be redeem
so the script check if args[0] included in the code array then it redeem it
something like _code [the code]
fuk or am i misunderstood the problem
hmm
i think this is something for later
currently the command fires without being called
eg every string that starts with the prefix triggers this command
oh
yea then why not made something like this
the _ is the prefix
instead of ${prefix}[code]
Oh i figured it out
umm is there an event that called when the bot leave a server?
so what is it
i never exported the ‘name’ module so it never knew the command name
hmmmmm
guildDelete iirc
guildMemberLeave
oh kay
Nope
nope
guildDelete is when the bot leaves a guild
guildMemberAdd and guildMemberDelete are for members i believe
dont trust me i that >.>
https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584 can recommend this spreadsheet
whoa thanks
client.on('guildCreate', async (guild) => {
console.log("Leaved a server named " + guild.name);
return Config.deleteOne({guildId: guild.id});
});
that should work right
it's guildDelete
Yes
is there any other problem
can someone help me pls?
ah aight
"create" doesn't mean the bot left a server lmao
yeah i know XD
@pale vessel how can i make my glitch porject bot 24/7 pls
you cant
you can't use ping services, they're against tos
exept with buying prem
but then i would get a proper VPS instead they are cheaper and less limited
can i download the project and make in visual studio code?
you have your bot on Github right?
no
how can i make it to github
ok
const moves = currentSquare.isFreezed ? this.freezedMove : this.vectorMove;
Is this a valid js? This statement is written in a method of the same class.
should be
But when I do moves().
It says this is undefined
I tried doing
const move = (currentSquare.isFreezed ? this.freezedMove : this.vectorMove).bind(this);
And then it worked fine!
@lusty quest i uploaded to github
then just clone the repo to your pc and edit the bot with VSC
maybe install Github desktop to manage it from your PC
did you define this
would also make sure to make the Code private if you dont want others to use it
well there is everything you need
how can i now open this with vsc
go to vsc...?
did you got vsc installed?
As I said, that statement is written in some other method of the same class.
do you have it
oh oooh
my bad my bad
@lusty quest yup
then go to it
rightclick in the folder and then use open in vsc (works for me)
well so you dont installed this integration
then do it the other way
open VSC and then open the project inside vsc
or click on the folder and press open with visual studio code
so now my problem uuh
if you see the screenshot above he doesnt installed the extension for it
how to make a bot find the first channel in the guild?
ok work its work
or simply drag and drop the folder in vsc
but i need now to make it 2477
get a VPS
24/7
if you dont know where check the pins in this channel
get a VPS
i cant found
then try better
I need a simple welcome messages but it won't show
And my welcome is like if someone joins a server where bot is it also says that
listen to the MemberAdd event
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
there is not really a best. you get what you pay, some hosters offer more for the value than others.
but iirc Vultr offers a 1GB VPS for 3$/Month
I pay $6/month for 1GB of RAM on Vultr, but with a high freq CPU as well
should i get the 512 gb $2.50 a month plan or a raspberry pi 3 b+
how far did you plan to Grow your Bot?
VPS is usually a better option than self hosting imo
hmm
VPS got its ups and downs,
Good:
Usually 99% of the time 24/7
no Hardware Maintaince required
Bad:
You are fucked if the hoster decides to Shutdown (yes this is a thing)
You have to Maintain the Software Side
Rapsberry Pi:
Good:
100% Access to the Hardware
No Fear of loosing access to it for some reason (like the Hoster shuts down)
Bad:
Passive Cost of Electicity
You Have to manage the Software and Hardware yourself (Good if you are good in linux/ Server Stuff)
Usually they boot of an SD Card, you have to add a 2nd storage or the SD card will degrade fast.
Affected by local poweroutages
thank you lol
there are ways to overcome the SD card limitations (there is now the ability to boot of an External Drive)
I used to host mine on a Raspberry Pi 3b+ and it worked fine with around 1k guilds. But as it grew I decided it was probably better to swap to a vps. I'm pretty sure Discord even said in their verification message that when the bot grows bigger a hosting service is usually better.
depends on the context, i could run my Bot of my NAS easy, until i reach around 3-4 Shards i guess
but i prefer the Reliability of an proper host and plan to switch to K8 anyways soon
Yeah, I just happened to have a raspberry lying around. I probably wouldn't buy one just for bot hosting tho
brain has a point--my bots do well, and honestly the electricity isn't too bad, they aren't big though, only thing with that is becoming familiar with raspbian. i will say, if your isp is unreliable or have network updates, it will boot your bot offline. i have suffered this a few times, due to updates on my network. my honest recommendation is if you plan on going 2k guilds or more, don't go with a pi
damn my typing is really slow tonight
i have an Raspberry also running, but there i have some stuff for my network running on (Pihole and UI Controller)
I'm gonna try the new Windows 10 thingie for Raspberry Pi just to see how it works lol
windows is Trash, if EA would not Ban Linux Users i would run now Probably Manjaro or popOS
do you have an older pi brain? my pi 2 b is still running strong, even after some stress testing hehe. still used for small projects :)
B3+
ahhh
i have even a Server lying around lol.
could throw in a few HDDs and run something on it, but the issue is it got an AMD Turion N40l Processor
how can i create a special cooldown with djs? like im using a normal discord.js command handler with example command like
module.exports = {
name: 'test',
aliases: [],
cooldown: 2,
description: 'test cmd',
type: 'hidden',
execute: (message, args) => {
//...
}
}
``` but how do i like change the cooldown depending on whether there are args or not
i where also thinking about to get a Turing Pi board. this thing is interestening, you can plug 6 Compute Modules in and form a K8 Cluster with them
you probably have to modify the command handler for it
but it will be probably annoying
since you have to somehow let your command handler known that there are arguments
hmmmm
true
could use humanize-duration if you don't want to modify the handler, but would probably get messy
did that a few times prior to redoing my handler
Oh right, any problem else?
guys i put my bot status as the no of servers in which my bot is in but it shows 0 always
i don't recommend going that route btw if you are going for lengthy cooldown times, just remembered. if your bot restarts at all it will remove the "cooldown" for everyone in the map
how did you get the Number of guilds?
just use redis to save the cooldowns
f'{len(bot.guilds)} servers'
py?
yea
idk then
say "owo" again and i'll put your head into a WC
say "uwu" again and i'll put your head into a WC
pop
That's better than "uwu" or "owo"
w
Thats what I said first time hearing it, now I use it as a joke
That's true, but if he uses a db to manage all cooldowns it should be fixed 😮
just saw this. i find it pretty interesting too tbh. always thought the little pi 3 clusters were pretty cool, just can get pretty expensive if you don't have the budget
the Turing Pi is fine price wise, you pay 180€ for the Board and then 60€ for each module
if you go with the conventional stack you either get some cable salad while running 2 cables to each RPI or use the POE board and get a more expensive POE switch

this here is probably the wrong place to look for this stuff
yea but in the end the Turing Pi board will be cheaper
since you have to get the POE Board for each RPI
yep yep, just checked it out. been a while since i've looked at their products
exept you have already a few RPI lying around
looks like they're limiting compute modules and out of stock for the turing pi
and ofc, there's a turing pi 2
not a bad price actually for it
py is one of the easyest to learn
Ya, this is probably the wrong place cause all people that talks here are making or already has a bot.
if you know py easy
Ik someone that says python sucks to make discord bots
py is ok but not the most efficent language
compared to js as example py is super slow
imo if you wanna go with least efficient c# is the way to go
The most efficent language for making bots is js with the library discord.js
Rust is way more Efficent
lmao

Programming always includes maths
Learn basic maths to make basic code
Probably not here
not here, and not sure where you could hire someone
I have a bot.. but I'm having nothing but problems.
And I'm not enjoying coding rn
I enjoy the creation. But not making it.
Ik someone that accept contracts to make bots but he speaks spanish

Coding is one form of the creating art
Teaching a machine how to do something
Creating beatiful systems
What the hell is musk
Oh
Nvm
Also, you don't need money to start creating your own bot
not really sure what to tell you tbh, learning programming doesn't cost money
neither does implementing your ideas into it
My bot doesn't generate money and i don't want to generate money with my bot
Also, i didn't spend money on my bot.
Suggest ideas to someone to implement in an existent bot
^^^
not really, i don't think contributing to a hobby/field/whatever that benefits everyone, whether you are credited or not is a waste of life
then all i can recommend is learning programming
if you want to create something that's yours
Bro
Imagine this:
"I got a big idea that will innovate everybody and someone else that i hired makes real my idea" your credits arn't too important cause you didn't make real that idea.
@slim void
Don't ping me pls, I'm busy.
i recommend learning programming as a start to your endeavors. as simple as that, but i don't think you're in the right spot for hiring people, and calling programmers on the low end isn't nice. wish you luck!
Yeah I have my own bot.
Custom suggestions, logs, huge database, just don't wanna go farther lol.
C# is more efficent than PY or JS, also supports multi threading
yea? C# is pretty efficent
hmmm, in regards to multi threading definitely
a compiled Language is usually always more efficent than non compiled
if i had to put discord.js vs discord.net for bot development, i'd still go for js personally
if you want more efficent langauage look into Rust
i'm a bit familiar, honestly i've been pretty curious about mercury though
in regards to machine learning even
got any thoughts on mercury?
never heard of it
looks fine, but i think i stick with Learning Rust
its fast AF
python collects garbage, rust collects 0
since it compiles to machine code, since its memory save you dont need to collect garbage
but Rust is also very restrictive and that's why i don't really like it.
hmmmm
i just started learning it yesterday, im about 1/4 throu the docs, also thanks to knowing other programing languages its relatively easy to pickup
Did you get through lifetimes?
cause that's when I just gave up
im already further with Rust than GO
well failed to Install a Enviroment for go. so i gave up
I prefer C++ over Rust and Go, but that's just me
Go is nice bcs of fast Compiling, but Rust on the other hand compiles to well optimized fast code
you can also make your own language if you aren't happy with any of the existing ones lol
It's actually pretty easy to create your own programming language, but it's really hard to make it good
finally its done
@lusty quest how tf did you fail to install go
idk had issues getting the enviroment working
for webhook in self._webhooks:
if webhook == "dbl":
func = self.dbl_vote_handler
else: # dsl
func = self.dsl_vote_handler
self.__app.router.add_post(self._webhooks[webhook]["path"], func)
``` there's definitely a better way to go about this but I'm really not sure what it is 

for some reason
mongoose is rounding userids
does anyone know why
for me it rounded 248692731163967498 to 248692731163967500
did you store them as an Int?
@lusty quest yes
dont do this
store them as a string
store them as a String. most Discord libs should be able to parse the ID from a string
Storing any ids as an integer is a nightmare because you get all kinds of weirdness, so in my experience most use strings
okay, thanks
Yw
Hello Im making warning system but I need to know what permissions should I make it require in order to warn someone?
there are 2 ways i guess. use Admin or manage Guild Permission or request that they set Roles that are allowed to do so
In rules I shouldnt make it require Admin
not the Bot, the User
the rules state for Bot
You cant kick without kick permissions
I want to know what permissions should user need to warn
There is no warning system built into discord - if you were to make your own it doesn't require any permissions from discord
So regular people warn admins???
I used KICK_MEMBERS and BAN_MEMBERS for my warn commands
Idk /:
If you want to limit who can warn who, you need to do that in your code. Discord doesn't have a warnings system so none of it's permissions are relevant
And yes if you want the user to receive a kick or ban at a certain amount of warnings you will need kick and ban members permissions from discord, but the actual warnings do not
Not the best option, but...
On the github integration thingy for vscode, how do I commit some changes with one message and others with a different message?
i think you can select what files to commit
I tried selecting them and then pressing commit but it just did all of them 
hmm then use Github Desktop and do it there. works for me
I'd rather be able to do everything from one program tbh
can you push them also to Origin with VSC?
Idk I only push to one branch and then merge when I'm happy with it
I assume so though
probably over a cmd then.
it closes on its own
What is the reason
Mongoose.connect("mongodb://localhost:port/db", {
useUnifiedTopology: true,
useNewUrlParser: true,
useFindAndModify: false
});
Your code looks fine to me, perhaps your mongodb server has some issues
I'm not sure as I used mongodb atlas where it is hosted and managed for me
I use MANAGE_MESSAGES
For warn
local mongodb
let activities = [
`Utilize ${config.prefix}help para obter ajuda`,
`${client.guilds.cache.size} servidores!`,
`${client.channels.cache.size} canais!`,
`${client.users.cache.size} usuários!`
],
i = 0;
setInterval( () => client.user.setActivity(`${activities[i++ % activities.length]}`, {
type: "WATCHING"
}), 1000 * 60);
client.user
.setStatus("online")
.catch(console.error);
console.log("Estou Online!")
});```
Yeah I can see that, I don't have any experience with that sorry
Code for status
Is this a bad sign? My CPU is always running lose close to 100%
You need to show your code for us to find out
Try const deletecount = parseInt(args[0]) instead
Alr, but won’t it be like this
Also, catch the errors.
message.channel.bulkDelete(deleteCount + 1).catch(error => message.reply(`Couldn't delete messages because of: ${error}`));
Yes. That's what I said 👀
You should do +1 on deletecount so it includes the command
Alr
And you don't need the ; in node. Doesn't make any difference here.
Oh alr
message.channel.bulkDelete(deleteCount + 1).catch(error => message.reply(Couldn't delete messages because of: ${error}));
Which line should this be in? Sorry I forgot
Alrighty

Check console
Oh you just need to add tick quotes
message.channel.bulkDelete(deleteCount + 1).catch(error => message.reply(`Couldn't delete messages because of: ${error}`));
I was also thinking that
My bad. Sorry. I'm on my phone.
No
you did ' instead of ` lol
and that
Please learn js syntax. There are lots of good free resources online
Copy/pasting tutorial code will only get you so far
and not that far
@zenith terrace I tried " first didn’t work neither...
you need to do ` .-.

well did it work?
Nope...
use python
no one cares about "use python" opinions, so let them code whichever language
Lol
and whats the error

If you get any errors they might contain a line number where something went wrong, if not use console.logs and see where they stop logging
Just on the response it’s saying there’s a bug..
What about on repl?
Hm just says successfully loaded
In that case try console logs
Lemme reload again
Put them at various stages and see which actually log
good job
It's saying about line 107, have a look there
Try looking for parts of the error referencing your code, and then see what it's on about
It says it's in index.js
Ohh
Hits home
Ah it is
is it just this that getting logged?
Yep


bruh
@true ravine so what ya see?
Yeah scroll up a bit in your logs from where you took that screenshot
now thats the problem
u define it with lower case c
you defined it as deletecount,
'deletecount'
bruh
If you can work out what the repl gods want then maybe you could write your variables names in that way so they don't change them
True
Also most IDEs show if a variable is not used or defined by changing the colour a bit - does repl do that?
Uh why does it do this before it didn’t, it said there was an error before weird..
The deleting it's own message thing?
Oh I see
change the code again then
I mean true
if(deleteCount <= 0) return blasdsadald
LOL
Look for the code where you tell it to delete messages, and see if something looks wrong
I’ll see what I can do
In theory shouldn't it throw an error if you try to delete 0 messages?
Or will it just do nothing
Idk
Yea it dosent
Perhaps you are adding 1 to your count then
I hate this idiotic cool down like every time I remove it, it shows 504 error
Yeah they have it directly in the bulk delete function lol
That's good
Purging messages is an async thing so unless you wait for it to finish it will say it was successful no matter what happens
For now though, just add an if statement to make sure deleteCount is greater than or equal to 1, and you'll be cookin
Ye you’re right
here's a question, is it bad to do await Promise.catch() ?
try/catch is usually the syntax i follow , even for single lines, but i was recently thinking if its a bad idea to do await .catch()
Anybody knows?
Is there any particular reason you want to do it that way?
declarations, mostly
let thing;
try {
thing = await something
} catch(e) {console.log(e)};
///////
let thing = await something.catch(e => console.log(e));
the usual format i follow is the top one, im used to not chaining .then() or .ctahc() with await, though recently i've been pondering about that
apart from the obviously shorter code, im not sure if there are any implications when using await with a catch
From my limited understanding, the promise.catch syntax and try{await promise}catch{oh no} syntax are two different methods of doing the same thing and don't really have any reason to mix if that makes any sense
Sa
thats the thing with mixing that im a bit curious about, clearly , most docs i visited state either one or another, and most of the times favouring try/catch other than .catch/.then, though im part i assume most of this is to accomodate and push towards using async code
there are plenty of stuff like this out there
where the phrasing suggests using .then/.catch is not recommended
Ngl this seems like a question for Tim, he'll have a big brain answer
Yeah like you say I've never seen them mixed
im aware both works, but im unaware of why they shouldnt, or more precisely, why they arent recommended
@quartz kindle timmy turner
feud or evie might be able to answer those too
True
destroy them
[...arr] should work
ye?
concat doesnt manipulate the original array
what is this method?
thats the descontruction operator
declare new arr
for i from 0 to arr length
for j from 0 to arr[i] length
do new arr push(arr[i][j])

damm
i wonder if i can make it shorter



