#development
1 messages · Page 1637 of 1
oh right, god I'm so tired lmao
pm2 can restart on file change, but last time ive used it it where quite whacky
tells you suggested methods/properties and also gives you type info and comments made on the methods/properties. VSCode uses TypeScript internally
how? never seen that before
probably bcs of a sqlite database
when i start the bot it looks fine but if i dm him i get this error
PS C:\Users\justi\Downloads\modmailbot-master\modmailbot-master> node src/index.js
Starting Modmail v3.3.0 (1047528) on Node.js 14.15.4 (x64)
Loading configuration from config.ini...
Configuration ok!
Using an SQLite database:
C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\db\data.sqlite
Preparing plugins...
Connecting to Discord...
Connected! Waiting for servers to become available...
Initializing...
Loading plugins...
Loaded 16 plugins (16 built-in plugins, 0 external plugins)
Done! Now listening to DMs.
Error 50001: DiscordRESTError [50001]: Missing Access
at RequestHandler.request (C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\node_modules\eris\lib\rest\RequestHandler.js:61:15)
at Client.createMessage (C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\node_modules\eris\lib\Client.js:550:36)
at Thread._postToThreadChannel (C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\src\data\Thread.js:101:25)
at Thread.receiveUserReply (C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\src\data\Thread.js:405:37)
at async C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\src\main.js:168:9
at async C:\Users\justi\Downloads\modmailbot-master\modmailbot-master\src\queue.js:10:9
PS C:\Users\justi\Downloads\modmailbot-master\modmailbot-master>
did you made the bot?
help me
no
then better ask in the github repo you got the bot from
what if I just use github actions to get into my vps and just git pull -> restart app
hovering over something usually tells you its type and other info.
In this screen shot, I was hovering over .cache
oh, I never hover over things lmao, good to know
when you're typing, a "window" will also pop up and give you suggestions
I mean, I hate dealing with types tbh but for this project I'm willing to do it the right way I guess
In the long term types are very helpful
i give up, i was on page 32 of dapi looking for that shit
simply cant find it
anyway
point being
there are blacklisted discriminators
that you cant get normall
practically every other coding language is statically typed. JS is a weird exception. TypeScript is very helpful since static types lead to predictable and less flawed logic
yeah some people say that and some don't, so I just stop listening to them and if I ever needed I'll use them
should probably hit them with the TS in 100 seconds
so far I've had 0 need for it, so 
It really depends on who you ask
not using types is shooting yourself in the foot
seen it, and still don't care to use it
a good comparison is saying you should code in notepadd++ instead of vsc
types are there to help you catch bugs
see typescript users say that but I've never run into issues
if you dont use it, its on you
I'm fond of typehinting my code since it helps with autocompletion and my IDE yells at me whenever I get incompatible types. In small scripts, though, I don't bother
autocompletion, catching bugs, intellisense, it all comes together
For the record, I'm a Python dev, so my typehints don't mean jack crap to the interpreter
if you dont use it, like i said, its the same as using notepad++ to code instead of an IDE
its a helping tool
Reading the docs and seeing that guild.members is a GuildMemberManager and that it has a property .cache which is a Collection<string, GuildMember> is helpful info.
The docs for any app is based on static types
if you dont want it, its on you, but nobody can argue its not useful
It's helpful but when you're doing small stuff it's understandable if you're not gonna bother with types
yeah I use js and python primarily, last time I used something like c# and c++ was before dropping out of college cause I found it awfully boring and tedious
in small projects, like shiv said, its fine
the more you get, the more complicated it gets
thats why its there
to catch bugs FOR you
its a helping tool
Just be thankful you're not trying to make a Minecraft Forge mod. There are no docs. They literally just tell you to use your IDE and look at the suggestions
small investment upfront, big reap endgame
idk, I've worked in big projects (not developed just by me) and I have yet to encounter typescript
I'm not saying it can't be useful
I know it is
I just never had the need for it
when I do, I'll learn it
People can use it independently of other project members
@opal plank
dude, chillax
the fuck is that related to either here or me?
so, for the vps, do I just setup a github action that pulls the new code and restarts an app?
is that shit copypasta in #development ? yikes
is there a good terminal manager thingy that I can use?
like, if I just do npm start and close the vps connection the process stops right, so there are apps for that to run in the background or whatever, any recommendations?
import {exec}
exec.run('git pull $branch pass')
exec.run('node ./index.js')
await message.send('restarting bot')
process.exit(0)
``` this simple
will that not kill the app once I close the connection?
isnt the point to restart the app with a pull to update the code?
I swear I love the dev community but all the contradictory info makes me go crazy
anyone needs js help?
if you cut the connection from you to the vps it doesnt matter at all
unless the vps goes into statis without a connection, which would be absolutely idiotic
imagine exec as a terminal
wtf so why people say that you need some process manager like pm2 or others
you're simply running commands
in truth
cuz most people dont know jackshit about coding and want stuff pre-made at their leasure convenience
wait till you look at the npm directory
https://www.npmjs.com/package/is-undefined
6306 weekly downloads
ok so I put the code you sent into a file and then...run it with a gh action?
lmfao
hahahaha
not efficient memory management
welcome to js community
input === void 0; would be better
my memory is being overflowed rn thanks
@returns Boolean class
gross typings
now
here
here
watch this
500k WEEKLY
wait so can you explain to me what do I do with the code u sent
lmfao no way, that's gotta be a meme
i shit you not
500k people per week
all this code is trahs
return (n % 2) === 1;
this
this is what 500k people are downloading weekly
its disgusting
Just goes to show how much of a lost cause some people are
case*
@lament rock I need an assessment here, memory efficient or not?

Yes. Memory efficient
great
then you require ("modules/shema/log.js")
yeah where I take the bus
and i assume you've been using terminals before too
exdi
@river panther if you arent going to contribute to this channel, i kindly ask you to either lurk or do something else
ok ok
so
import {exec}
exec.run('git pull $branch pass')
exec.run('node ./index.js')
await message.send('restarting bot')
process.exit(0)```
this is not valid code btw
intentionally
this is just to give a quick gimplse or what im suggesting
lol use this to xD
you're opening a terminall
and running that command basically
git pull will pull from a repo
which you'd be pushing your updates to
the second will run after the first one has been finished, so give it a couple seconds before continuing
aka, node ./index.js
or wherever your entry point is at
right
that'll start a second instance
then a simple console.log or message to let you know the bot is restarting
and then closing the initial process
now you have the old process terminated, and a new one opening with the new code updated
simple as that
how you trigger that is up to you, webhooks, commands, panels, dashboard, nodemon, anything you want
oh okok
I've used them before so that's why I know I can use them, but also when I learned to use gh actions to do "continuous deployment" they used pm2 to start the app
in the tutorial I mean
the usual gist is:
if it works, dont touch it unless you plan on scaling it
if what you got works flawlessly, there isnt much need to update it
what im suggesting would be lighter since it wouldnt require pm2 as a dependency
unless you using it as a monitor
in which case you might wanna consider it
yeah, I mean all of this I'm doing it for private servers so there's no "scaling" that needs to happen
then there shouldnt be much need to change it
my shitty first bot is still on heroku doing fine
go with the
ItJustWorks™️
yeah in a custom script
oauth2
Look at Discord's Oauth2 docs
with redirects
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
thnx
thnx
how about just using it in the cli, good? good enough?
bruh i am
i usually run it with bash
though the length of the command is quite big
since im using forever on startup
@signal night check this too https://github.com/discord/discord-oauth2-example
thnx
bruh
it does not need to have it
if not it would say cant find module
how can it read it the module, okay try with .js
require() resolves on modules
you dont need to have .js in the require
only in the file
yea
lol, I suggested them 
oh, my bad
it was meister
anyway, the point still there
it doesnt need it for .js
nor .mjs iirc
thats his code
NodeRequire is weird
@lethal trout Can I see the schema?
yea
const { Schema, model } = require("mongoose");
module.exports = model(
"logging",
new Schema({
req: {
required: true,
type: Boolean,
default: false
},
channelID: {
type: String
},
guildID: {
type: String
},
MessageUpdate: {
required: true,
type: Boolean,
default: false
},
MessageDelete: {
required: true,
type: Boolean,
default: false
}
})
);```
@tired panther
looks fine, and does it create a collection named loggings?
And what is not working, creating the documents or editing them?
ill show
finding them?
const client = require('../index')
const Discord = require('discord.js')
const logs = require('../models/logs')
client.on("messageUpdate", async (oldMessage, newMessage) => {
const channel = oldMessage.channel
if (oldMessage.content === newMessage.content) return;
const data = await logs.findOne({
guildID: newMessage.guild.id,
channelID: newMessage.channel.id,
MessageUpdate: true
});
console.log(data)
if (data) {
//const targetchannel = client.channels.fetch(data.channelID)
//console.log(targetchannel)
const embed = new Discord.MessageEmbed()
.setAuthor('A message has been edited!')
.setThumbnail(oldMessage.author.displayAvatarURL({ dynamic: true }))
.setColor('#FF0000')
.addField("Edited by:", oldMessage.author.tag)
.addField("Edited in:", oldMessage.channel)
.addField("Edited at:", oldMessage.createdAt)
.addField("Before:", oldMessage.content)
.addField("After:", newMessage.content)
.addField("URL:", `[Click Me](${oldMessage.url})`)
.setTitle('Message Edited!')
.setTimestamp()
client.channels.fetch(data.channelID).then(c=>c.send(embed))
} else {
return
}
})```
um..
there is a id in the db and i need to get the channel id
but i always get null
that means nothing
but there is smth
https://media.discordapp.net/attachments/272764566411149314/818343159196418088/unknown.png
https://media.discordapp.net/attachments/272764566411149314/818343832588124160/unknown.png
wow
no wonder
i did `console.log(data.guildID)` and it sent `cannot read property of guilfID of null`
how to fix it?
look
this
for some reason it is not able to get the channel id
because it is not even able to get the guild
smh me and my bot
what happens when you log out data, what does it output?
are you still on ths?
i would say your mongodb query is making the issues
did you want to have mutiple documents per guild?
it just findOne, thats way it picks the first it finds
null
he can, with other properties
see first i need the get the guild id then from that guild i need the msg id so it can send the msg in that channel of that guild only
he probably wont find anything bcs of his filter
?
um...
like i said did you have mutiple documents per guild?
const data = await logs.find({})
console.log(data)
k
Tfw you get a dm saying your bot is not working, you check logs and everything is fine, you ask them to show you what theyre doing, and theyre just using the command wrong and ignoring the part where the error message shows exactly how to use the command
like i said, expect the enduser to be a donkey

Guess where the user is from
huehue land
Nop
kebab land?
like i said it now 2 or 3 times your filter will always return null
Yup
lul
so what should i do?
thats suspicous, then Superbrain suggestion is right
put channelid above?

tim help me spread the word of our glorious god, detritus
answer the question ive asked now 4 times in the past 15 minutes
Blasphemy
no the other guy who has issues getting data from his mongodb server
All hail discord.js for better or worse :^)
so how do i fix my issuse?
Lul
which wasnt hard at all
If i ever make a lib it wont have them either

why would that be?
but i need help soo yea..
oof 😦
Channel for chatting about development. If you have questions, ask the questions and wait for someone who can answer to help you
I like making barebones stuff that forces the user to implement their own shit

Is there away to use discord AUTH and checking if the member has admin perms in the guild without client login?
wouldnt that hurt growth?
Likely yes
not something that would bother you much i assume
I like being niche
you mean oAuth?
yes

I always find the small things that dont exist and do them, even if nobody will use
iirc you can request the guilds from the user and there are permissions as bitwise present
i swear i havent been paid to advertise their shit lol
@quartz kindle could u help me fix my code?
What is the problen
this
i use it to check if a user got the manage guild permission to invite my bot (over my maybe working dashboard in the future)
so i do not need any client.login? anymore.
okay i will try,should work
i use oauth for it, i dont have directly a bot running
const client = require('../index')
const Discord = require('discord.js')
const logs = require('../models/logs')
client.on("messageUpdate", async (oldMessage, newMessage) => {
const channel = oldMessage.channel
if (oldMessage.content === newMessage.content) return;
const data = await logs.findOne({
guildID: newMessage.guild.id,
channelID: newMessage.channel.id,
MessageUpdate: true
});
console.log(data)
if (data) {
//const targetchannel = client.channels.fetch(data.channelID)
//console.log(targetchannel)
const embed = new Discord.MessageEmbed()
.setAuthor('A message has been edited!')
.setThumbnail(oldMessage.author.displayAvatarURL({ dynamic: true }))
.setColor('#FF0000')
.addField("Edited by:", oldMessage.author.tag)
.addField("Edited in:", oldMessage.channel)
.addField("Edited at:", oldMessage.createdAt)
.addField("Before:", oldMessage.content)
.addField("After:", newMessage.content)
.addField("URL:", `[Click Me](${oldMessage.url})`)
.setTitle('Message Edited!')
.setTimestamp()
client.channels.fetch(data.channelID).then(c=>c.send(embed))
} else {
return
}
})```
um..
there is a id in the db and i need to get the channel id
but i always get null
that means nothing
but there is smth
https://media.discordapp.net/attachments/272764566411149314/818343159196418088/unknown.png
https://media.discordapp.net/attachments/272764566411149314/818343832588124160/unknown.png
wow
no wonder
i did `console.log(data.guildID)` and it sent `cannot read property of guilfID of null`
how to fix it?
@quartz kindle he got issues getting the data from his mongodb, but he doesnt listen ffs
i listen to everyone
thx
just that i am very bad a db
ive asked you like 4 times something, never got an answer lol
ask again ig
i also suggested a lot of stuff thats wrong with that command
ill tell
completely ignored
like??
beyond this point i gave you a lot of feedback, seems like you didnt fix a SINGLE thing
come on guys forgive me
literally wdym by 1st bad, 2nd bad?
what u need help with
me and shiv went back and fourth with info about how you can improve it
const client = require('../index')
const Discord = require('discord.js')
const logs = require('../models/logs')
client.on("messageUpdate", async (oldMessage, newMessage) => {
const channel = oldMessage.channel
if (oldMessage.content === newMessage.content) return;
const data = await logs.findOne({
guildID: newMessage.guild.id,
channelID: newMessage.channel.id,
MessageUpdate: true
});
console.log(data)
if (data) {
//const targetchannel = client.channels.fetch(data.channelID)
//console.log(targetchannel)
const embed = new Discord.MessageEmbed()
.setAuthor('A message has been edited!')
.setThumbnail(oldMessage.author.displayAvatarURL({ dynamic: true }))
.setColor('#FF0000')
.addField("Edited by:", oldMessage.author.tag)
.addField("Edited in:", oldMessage.channel)
.addField("Edited at:", oldMessage.createdAt)
.addField("Before:", oldMessage.content)
.addField("After:", newMessage.content)
.addField("URL:", `[Click Me](${oldMessage.url})`)
.setTitle('Message Edited!')
.setTimestamp()
client.channels.fetch(data.channelID).then(c=>c.send(embed))
} else {
return
}
})```
um..
there is a id in the db and i need to get the channel id
but i always get null
that means nothing
but there is smth
https://media.discordapp.net/attachments/272764566411149314/818343159196418088/unknown.png
https://media.discordapp.net/attachments/272764566411149314/818343832588124160/unknown.png
wow
no wonder
i did `console.log(data.guildID)` and it sent `cannot read property of guilfID of null`
how to fix it?
have u read what they said?
probably not
definitively not

i did but totoally did not understand a single thing cause i am very bad at understanding anything
so its my mistake
then you might want to learn a bit more how mongodb works
you're checking for an object
that object might be empty
like i mentioned, you arent checking anything inside
i am trying to check the msg id from the specific guild

😭

start from what you understood then
if you say you didnt understand a SINGLE thing from all the things i mentioned, you need to learn js before making a bot
and i'll slap you with the docs if thats the case
hard
its like in 300+servers
the words js will be stamped on ur cheeks

lol
tbh i expected this
i meant this
And you are 100 sure there is data in it
administrator AND all the perms
Then you might be using tbe database wrong
my dude legit went and clicked on every permission
Check the database documentation again
Tbf many big bots do that lul
big bots usually can backup the need for it tho
and not many do
Rythm for example is just administrator
discord should make a button, where yiu can uncheck all
not EVERY permission
same with mine
just do bare minumum to work, and you never need Administrator,
^^
no sketchy perms, just what it needs
its good practice to just put what your bot needs
Thats why, big bots have commands fof everything lul
Lmao
wait, i have turned everything for my bot, like the permission, so is my bot big now 0.0
wtf my dude?
this is a good way to get denied
his brain is messed up ngl
shows no effort whatsoever
but it needs everything
bruh
no it doesn't
you dont need everything
it needs a new ddev
ABSOLUTELY doubt
but sure if you think it does leave it like that and then ask yourself again why your bot got declined

when a meme bot requires Ban, Kick and Administrator permissions for fetching memes From Reddit and then sending them into a channel
then thats stupid
Ecks dee
hello sir, big fan
this is probably why most bots get denied
how solve this?
not really but sure ig
Unknown interaction
=|
Check your send function
see, i have named it changemymind same as the file name
okok
breh
Ah yes
juuuuuuust some small anger issues
lmao
i mean, there are more but ok
I don't think thats appropiate

that moment when you want to help people in development but then you see this
forever saved
lol how tf did this post with the star instantly went into the starboard
"small voice of calm" 
And reason
i was banned for 3 months from that server because of the NSFW roasts which continued that
ive made a bot that could help you improving you attitude
no no, thank you 👍
Yeah it's called Blacklist that bans a user from every single server the bot is in
lul
just make an AFK arena bot where you simply spam a single reaction on the bot to get coins. ezpz
kekw
nope the bot uses AI to detect insults, toxicity and other stuff and then warns the user, if someone gets to emotional he will get kicked and or banned
let me guess
isn't AFK arena a mobile game ?
it uses perspective ai
this the send function
that has to be the most idiotic idea i've had today
lul
simply spam on the reaction to get points
it runs on my server with tensorflow
you spam dsicord, the bot, the channel, everywhere
ok
its a win-win situation


since that dude on youtube made that video with his bot I have seen like 50 clones off it on top.gg
yeha, you posted something so stupid people thought it was worthy
delete your post 
lol
That's HELL of !fame
famen't
!fame
First of all how about you actually catch the rejection
That should give you a better and more informative error
fixed
oh, ok ok
oh no, i forgot to take a shower today, brb 👍
you should always catch errors anyways
Imagine making your bot code public
Who cares about showering, code is more important
errors? what errors?
process.on('unhandledException', () => {})```
i see no errors?
as far as I know the bot code is not public but people copied it anyways

Go die in hell

Lmfao tim
xDDDD
lmao tim
How are you Tim
Am fine
Gud gud
look, its not my fault node 15 legit crashes on any hidrance
and im too lazy to go get the flag to prevent crash.
I blame tim for not coding the bot for me
Lmao
is there anything new in discord.js-light? 
Lmfao
Not yet
anything planned maybe
tim adding random catgirls to commands
wait, what does that code mean?


Working on the session refresh thing, but it doesnt work with the sharding manager without heavy mods
see tim? listen to your public
it pretty much makes it so it prevents any errors from being logged into the console

catgirls to be added on discord.js-light
Yes catgirls
as built-in command
Have you fixed the rate limit issue with /gateway/bot in d.js-light
indeed
And raid shadow legends
oh exdi, i guess everyone who post their code on github should do it
it sends catgirls at random moments at random times
when you create client it automatically adds the command to client.commands

No i didnt touch that part, djs didnt fix that yet?
It should fixed in v13 i think
do it tim
you are the magician
When they move to gateway v8
Optimist
what if my commands are not in client.commands
kekw
Catfemboys
I use discord.js-commando-light
when you create client, it sends a catgirl pic to every user cached
oh god
Whats so special on commando?
my modified package
I just like commando
people may hate it
but I like it
check detritus commandClient link
ik, but which features does it have
check the docs
its basically a half assed attempt to make a more advanced command handler
commando is basically a "command framework"
as they call it
lol
has stuff like args prompting and so on
Raw commands ftw
and built in commands
which ones?
good luck beating that commando

I dont even use http routers i use raw requests on my webserver
imagine calling something trash that you havent even heard of

lol, I checked it xD
ping, help, reload, unload, load, disable, enable
Eris is the Inbetweener of the two tbh Erwin
I think those are all
oh lol, I meant commando, my mistake
oh and also eval
is it though?
i havent touched eris, but since its compared so often to d.j i would assume its on the same level with minor differences
You sent that here too
It's not worth rewriting my backend tho tbh
Considering I already know it can handle 120k~ with 6GB if ram
Too much caching... must... disable... all... caches...
imagine having built in caching options
imagine needing for someone to work on your lib to make cache optional

could
#designgoals
Same
but i dont need it cached
I mean fair
is that bad?
Yup
they should use your libary 
hmmm
xd
fast-zlib gang
tim go advertise ur lib to them
shame on them xD
wink wink
I havent actually tested the difference in a discord environment
frick
I mean
Considering async zlib still handles tens of thousands of packets per second
There wont be much difference
But making sync could lower the cpu a bit
You specifically out of all people saying that just kills me

computers are all gates
NOR XOR AND
and binary
thats basically it

thats the basic of a processor
tbh
ig its only NAND
idk what is OOP
object oriented programming
Sarcosi
:/
The reason why djs is so bad is excessive oop
yes
and they tried patching that with partials, and from the looks of it failed miserably
How do i modules.exports in typescript
electron
just like that
export
export =?
yes and no
export function abc
export default
would be the equivalent of modeule.exports
module.exports.thing
would be
export thing =
Ah gotcha thanks
no preblomo
You dont need the = do you
Ye
scratch is the ultimate lang btw
@river panther #memes-and-media
export thing =
Could be confused witb
export abc = function() {}
anyone by chance have a good suggestion for a GitHub action to maintain versioning?
Idk ive never used github actions
tbh after the long days I have programming i'm slowly trying to move away from manual releases and automate things
You probably dont wanna automate releases
i was actually scolding tim cuz of versioning not too long ago
cuz he was hardcoding it
Higher chance of accidentally releasing broken code

Wut
lmao yeah my main issue I face atm though is the extra steps required with the current repo, sometimes bumping our version doesn't actually update the version to the registry lol
What i wanna show in the changelog is not the same as github commits
commit with the message
thats it
when someone uses the bot just pull from your history
I often need several commits and testing
rather than having to update it everytime
Before releasing a feature
you can always fetch full on releases too from github
Lul
Be my guest lul
u at 9k no?
8k
I only grow when im featured in the certified section
speaking of which
Other than that i hardly grow
Yes
i dont think my bot has ever reached any frontpage
be certified, trending, anything
probably blow up if it did
and all my attempts at auctions failed
Most likely
cuz last second outbid
People blindly add featured bots for no reason
i've noticed
Without understanding what they do
quite a few people added my bot for roleplay purposes
3 months of development
and they add it to roleplay

xD
3 years of development
and they add it, dont understand shit then remove it
:^)
mine hasnt had much join/leaves
the retention is quite high
though theres quite the discrepancy between commands
looks balanced

I dont measure that xd
isnt that how we measure whose pp is bigger? 
F
Hi i running my bot on vps and i created website for him not on the vps someone know how can i post the sever.length on his website without using the token out of the vps?
Put a webserver in your bot and make a small rest api
Then from your website just make a request to your bot
when i run the same code on vscode i get no errors but if i run the code on heroku i get this error
2021-03-08T08:18:51.564303+00:0 heroku[worker.1]: Starting process with command `node index.js`
2021-03-08T08:18:52.213286+00:0 heroku[worker.1]: State changed from starting to up
2021-03-08T08:18:54.096664+00:0 heroku[worker.1]: Process exited with status 1
2021-03-08T08:18:54.160668+00:0 heroku[worker.1]: State changed from up to crashed
2021-03-08T08:18:54.040965+00:0 app[worker.1]: internal/fs/utils.js:307
2021-03-08T08:18:54.040987+00:0 app[worker.1]: throw err;
2021-03-08T08:18:54.040987+00:0 app[worker.1]: ^
2021-03-08T08:18:54.040987+00:0 app[worker.1]:
2021-03-08T08:18:54.040988+00:00 app[worker.1]: Error: ENOENT: no such file or directory, scandir './commands'
2021-03-08T08:18:54.040989+00:00 app[worker.1]: at Object.readdirSync (fs.js:1021:3)
2021-03-08T08:18:54.040989+00:00 app[worker.1]: at Object.<anonymous> (/app/index.js:20:25)
2021-03-08T08:18:54.040990+00:00 app[worker.1]: at Module._compile (internal/modules/cjs/loader.js:1063:30)
2021-03-08T08:18:54.040990+00:00 app[worker.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
2021-03-08T08:18:54.040990+00:00 app[worker.1]: at Module.load (internal/modules/cjs/loader.js:928:32)
2021-03-08T08:18:54.040991+00:00 app[worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:769:14)
2021-03-08T08:18:54.040991+00:00 app[worker.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
2021-03-08T08:18:54.040992+00:00 app[worker.1]: at internal/main/run_main_module.js:17:47 {
2021-03-08T08:18:54.040992+00:00 app[worker.1]: errno: -2,
2021-03-08T08:18:54.040992+00:00 app[worker.1]: syscall: 'scandir',
2021-03-08T08:18:54.040993+00:00 app[worker.1]: code: 'ENOENT',
2021-03-08T08:18:54.040993+00:00 app[worker.1]: path: './commands'
2021-03-08T08:18:54.040994+00:00 app[worker.1]: }
do u have a procfile
yes
that has worked set to node mainfilename
The folder commands was not found
did u push it
Whats your bot coded in?
js
Check out express.js
what to do with that?
go to npm and search express.js
New guild joined: Top.gg Verification Center (id: 333949691962195969). This guild has 99 members!
lol
😂
yes, thats where the bots get approved i think
ik
yeah but how to use that....
wait isn't it just npm i express
I think express.js is fake
oh it does
the module npm would install for express.js is made by someone whom I don't think is affiliated with actual express
that 1 is
but thats the real 1 #development message
but when you do npm i express.js it'll install the fake one from npm
ok
yea
oh that makes more sense
Many libs are like that
imagine trying npm i discord
*npm i discord.js
bruh
It was a joke
ik
What happens if you try it
prob some sketchy thing
error or fake lib?
I get this
require('discord').start({
world_name: 'DiscordMUD',
world_path: __dirname+'/world',
start_room: 'lobby'
}).listen(8000);
Lmao wut
it actually exists lol
9yrs ago
Lol 9 years ago
Npm is not allowing this anymore btw
You cant publish a package with a similar name to an existing one
yea
that's why they named it discord.js
I mean
... ?
discord.ts i think is on there

Ye but you cant do that anymore
Packages with similar/confusing names are no longer allowed
I tried publishing a package called stringbase and it didnt let me
Because stringbase.js exists
h
I
Actually it wasnt stringbase.js
It was string-base
There is a lib on npm to check if a given name is available on npm
The lib downloads the entire npm list
150mb
Lmao
You didnt template it in the link
Ejs variables only exist inside templates, inside <% %>
You might need to use <%=
Check the ejs docs
They have special tags for running code with and without output
Check the ejs docs
I dont remember the exact tags
tell me the 3 words which can just change your life
See the %=
no no, it is npm install discord.js
you know why does verified devs have </> because whoever programmed bot's </life> and </happiness>
Flame from jda users incoming
i was waiting for that
you mean the 2 users here that use java?
lmao
command bot @pliant gorge please
3*
wait, can you program a bot with java too?
command bot @pliant gorge please
ok
oh i mis read that as JDK
imagine programming a bot in java
what do you use?
detritus
ok
no
const Discord = require('discord.js');
module.exports.run = async (bot, message, args) => {
message.delete();
if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send( "Üyeleri At yetkisine sahip değilsin!");
let kUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if(!kUser) return message.channel.send('Kullanıcı giriniz.')
if(kUser.id === bot.user.id) return message.channel.send('Botu Atamazsın!');
let kReason = args.join(" ").slice(22);
if(!kReason) return message.channel.send('Sebep giriniz...')
if(kUser.hasPermission("BAN_MEMBERS")) return message.channel.send("Atmak istediğin kişi Üyeleri At yetkisine sahip Atamam...");
let kickEmbed = new Discord.RichEmbed()
.setDescription("Atma")
.setColor("#bc0000")
.addField("Atılan Kişi", `${kUser} ID'si ${kUser.id}`)
.addField("Yetkili", `<@${message.author.id}> ID'si ${message.author.id}`)
.addField("Sebep", kReason);
let incidentchannel = message.guild.channels.find(`name`, "mod-log");
if(!incidentchannel) return message.channel.send("`mod-log` kanalını bulamıyorum.");
message.guild.member(kUser).kick(kReason);
incidentchannel.send(kickEmbed);
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: 0
};
exports.help = {
name: 'kick',
description: 'İstediğiniz kişiyi atar.',
usage: 'kick [kullanıcı] [sebep]'
};
I wonder what the code of this is, I could not understand
i had that problem too, but its related to your ports
the fuck is this code
how do i fix?
i was running ssh tunneling which was fucking with it
easy fix:
open from mobile
hard fix: restart or stop app that might be using some special prots
oh, okok
Things inside <% are server side, things outside are client side
tim what do you use?
tim has his own lib lolo
dscord.js-light
is it better?
I wonder what the code of this is, I could not understand,
discord.js-light
kick
its d.js but it wont gurgle ram like i drink vodka
oh nice
Drinking challenge, djs ram vs erwin vodka
im already advertising detritus
hmmmmmm
every gb is 1 liter?
not sure i'd be able to keep up

by the end of the day i might be at 6 or 7 liters of pure vodka
You cant compare them directly
do you know any good api for roast?
let varFromServer = <%= guilds %>
// use varFromServer on the client side
When I type kick, I can't kick the user why?
Jesus christ you need help
bad code, bad permissions, hierarchy

send it in a code block
how do i send
```js
//code
```
Lmao

The voices in your head
breh i really got a ping
const Discord = require('discord.js');
module.exports.run = async (bot, message, args) => {
message.delete();
if(!message.member.hasPermission("KICK_MEMBERS")) return
message.channel.send( "**Üyeleri At** yetkisine sahip değilsin!");
let kUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if(!kUser) return message.channel.send('Kullanıcı giriniz.')
if(kUser.id === bot.user.id) return message.channel.send('Botu **Atamazsın!**');
let kReason = args.join(" ").slice(22);
if(!kReason) return message.channel.send('Sebep giriniz...')
if(kUser.hasPermission("BAN_MEMBERS")) return message.channel.send("Atmak istediğin kişi **Üyeleri At** yetkisine sahip **Atamam...**");
let kickEmbed = new Discord.RichEmbed()
.setDescription("Atma")
.setColor("#bc0000")
.addField("Atılan Kişi", `${kUser} ID'si ${kUser.id}`)
.addField("Yetkili", `<@${message.author.id}> ID'si ${message.author.id}`)
.addField("Sebep", kReason);
let incidentchannel = message.guild.channels.find(`name`, "mod-log");
if(!incidentchannel) return message.channel.send("`mod-log` kanalını bulamıyorum.");
message.guild.member(kUser).kick(kReason);
incidentchannel.send(kickEmbed);
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: 0
};
exports.help = {
name: 'kick',
description: 'İstediğiniz kişiyi atar.',
usage: 'kick [kullanıcı] [sebep]'
};
//code
oh god oh fuck
//code
exdi
Congrats, you did it
maybe 6th is the charm
Now what is the problem?
cant kick member aparently
no error
maybe
they didnt mention an error
just that it didnt work
he deleted the message before even taking details out of it
what command












