#development
1 messages ยท Page 1387 of 1
const connection = await mysql.createConnection({host:'localhost', user: 'root', database: 'test', Promise: bluebird});
// query database
const [rows, fields] = await connection.execute('SELECT * FROM `table` WHERE `name` = ? AND `age` > ?', ['Morty', 14]);```
like that
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
TypeError: botdb.query is not a function```
Oh I forgot.
suuuure
It did it on query.
So the problem is probably that either you're not passing the same botdb to the run function, or the mysql library isn't happy with you adding random methods to it
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
TypeError: botdb.query is not a function
at Inventory.run (C:\Users\dargc\Desktop\Coding\rpbot\commands\Civilian\inventory.js:22:21)
yeah really you're reinventing the wheel and it's not turning right now ๐
hello, when i do a command i want it to appear: check your messages md! I want him to send a message in the chat and another to me just with a command
@slender epoch what library are you using?
Bot desinger for discord
that's not a library that's an app, we can't help you with that
@stable nimbus
do a quick npm uninstall mysql npm i mysql2and try the example```js
const mysql = require('mysql2/promise');
const connection = await mysql.createConnection({host:'localhost', user: 'root', database: 'test'});
const [rows, fields] = await connection.execute('SELECT * FROM table WHERE name = ? AND age > ?', ['Morty', 14]);```
That's not a library ๐ learn to code javascript. Honestly it's more flexible.
that's not a library that's an app, we can't help you with that
@umbral zealot
BSscript
All of my other functions where I use it work perfectly fine, but for some reason when I look for just one thing it just says "F U Buddy".
any basics teaching site
yeah that's a special snowflake language @slender epoch you should join their support server or look up tutorials. you're not doing "development" at this point.
no
don't point people to a bot guide when they need to learn JS, @rose warren
@eternal solstice Useful links for learning JavaScript and Node:
Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Is there actually a way to debug where a UnhandledPromiseRejectionWarning is coming from if it provides no further content than just the warning itself, it's been annoying me for a while now
Tbh using a bot to learn js is a good exercise imo ๐คทโโ๏ธ
No, it's not a good exercise, it's like learning to cook by making Beef Wellington. It requires advanced skills that beginners don't have.

i mean you can see details if you handle/catch all your promises @twilit rapids
Well that's the thing, I have everything in try catches
do you await them?
I just do this ```js
process.on("unhandledRejection", err => {
console.error(err);
});
so that it prints more of the stack ๐
If he makes a bot on Heroku etc where you don't have any vps to set up then it's a good way to learn js
@rose warren where it's hosted is irrelevant. You can code a bot locally without a VPS. Beginners don't even understand strings, functions and conditions, how are they supposed to make bots based on promises, callbacks and event handlers? People should have a good grasp of programming Before making bots.
And yes some people are self-taught. Those people don't come crying to development servers for simple errors because they're self-taught ๐
I'm in love with schemas already
Yeah sure. I agree, but everyone has to start somewhere. I taught myself HTML, PHP and CSS way back in the day while making websites. You have to apply what you're learning. Having a project you can build on while you learn is very rewarding.
Everything is so much better than quick.db.
That seems to be logging this
[Error] { name: undefined }
[Error] { name: undefined }

sounds like you're going through a logger feature that's not printing out the entire thing ๐
fuck it's 3 am why am I still helping people

Haha, gn

sounds like you're going through a logger feature that's not printing out the entire thing ๐
Nope, justconsole.errror()btw
hi
hi
yo im tryna use oAuth but im confused kinda like, where do i get data when someone logs in
anyone know why setParent wont work in this
let channel = message.guild.channels.create(`${message.author.username}s-ticket`, {
type: 'text',
permissionOverwrites: [
{
allow: 'VIEW_CHANNEL',
id: message.author.id
},
{
deny: 'VIEW_CHANNEL',
id: message.guild.id
},
{
allow: 'VIEW_CHANNEL',
id: '710751019495194645'
}
]
})
let category = bot.db.get(`ticketcategory_${message.guild.id}`)
channel.setParent(category)
channel.send(`<@${message.author.id}>`)
let embed = new MessageEmbed()
.setDescription(`Opened.`)
message.channel.send(embed)```
if(!id) message.reply("Need the category id.");
if(id) {
bot.db.set(`ticketcategory_${message.guild.id}`, id)
let embed = new MessageEmbed()
.setDescription(`Set to ${id}`)
message.channel.send(embed)```
is the category id the id of the category on the server?
yeah, i double checked htat
Everyone has on top.gg a nice page, How can I built in html, with justhaving one main file?
did you pass it as a string? or as a number?
should not matter but discord is sometimes finicky
i evaled what it was and it was the category id
maybe pass it as a string
`${category}`
``` should not make a difference but its worth a try
it errors as TypeError: channel.setParent is not a function
you could also chain it with the channel creation (the .setparent)
It went through the code with no error but didnt put it in the category .
I can try that
like this server.channels.find("name","general").setParent(categoryID);
(its a almost 2 years old stackoverflow post so it uses V11)
you're not awaiting it so it won't return a channel but a promise and you can't setParent a promise
use .then() then
I have
(node:17268) UnhandledPromiseRejectionWarning: ReferenceError: Cannot access 'channel' before initialization
let channel = await message.guild.channels.create(`${message.author.username}s-ticket`, { type: 'text', permissionOverwrites: [ { allow: 'VIEW_CHANNEL', id: message.author.id }, { deny: 'VIEW_CHANNEL', id: message.guild.id }, { allow: 'VIEW_CHANNEL', id: '710751019495194645' } ] }).then(channel.setParent("777062285793427457"))

run the set parent seperate and see it it works then
it's .then(channel => channel.setParent())
should I get rid of the let channel = then?
or this yea
now time for a ticket close and message reaction for it
you need to use js const channel = await guild.channels.create(); await channel.setParent(id); channel.send();
otherwise right now it would try to send a message to the category
how would i filter out the channel and then delete it?
store the channel ID in a Database and then just fetch it and delete it
storing it in a database is persitent over restarts
define the coordinate
is it because my lat1 lat2 lng1 and lng2 are defined outside the function?
whats lastcoordinated supposed to be defined as
yes they are outside the scope. if you need them in the function pass them into the function
use hastebin the next time
wdym?
function calcCrow(lat1, lng1, lat2, lng2, lastcoordinate) {
and in your function call pass it too
did you pass the coordinate also in your function call?
let text = `**${name}**` + "\n"
+ `**${raid.gym_name}**` + "\n"
+ `*${lat1}, ${lng1}*` + "\n"
+ `**Raid level: **${raid.level} | **Pokemon Cp: **${raid.cp}\n`
+ `**Distance From Last Raid: **${lastcoordinate}` + "\n"
+ `**Egg Spawn Time: ** ${getFormattedTime(raid.raid_spawn)}\n`
+ `**Raid Start Time: **${getFormattedTime(raid.raid_start)} | **Raid End Time: **${getFormattedTime(raid.raid_end)}\n`
let msg = await message.channel.send(text);``` it isn't an embed
it is just text
yea but when you call this function you pass coordinates right?
exactly
ooowh you mean this:
let lastcoordinate;
function toRad(value) {
return value * Math.PI / 180;
}
```
no
this is how i return the lastcoordinate
you call this function calcCrow somewhere right?
yeah
ohh wait nvm the text is outside of the function
yeah that is the problem why it returns undefined
i think because my lat1 lat2 etc are defined outside the function
how would i fix it
the lastcoordinate is lat2-lat1
etc
so calcrow
and the lat2 and lat1 lng1 and lng2 are defined above the function:
yea
const lat1 = raid.lat.substring(1);
const lng1 = raid.lng.substring(1);
fs.writeFileSync("./lastcoordinate.json", [lat1, lng1])
console.log(name, + "\n" + raid.gym_name, + "\n" + raid.lat, + "\n" + raid.lng);
const lat2 = fs.readFileSync("./lastcoordinate.json", [lat1])
const lng2 = fs.readFileSync("./lastcoordinate.json", [lng1])
let lastcoordinate;
function toRad(value) {
return value * Math.PI / 180;
}
function calcCrow(lat1, lng1, lat2, lng2, lastcoordinate) {
var R = 6371;
var dLat = toRad(lat2 - lat1);
var dLon = toRad(lng2 - lng1);
var lat1 = toRad(lat1);
var lat2 = toRad(lat2);
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return d;
}````
yeah as the lat2 and lat1 are never defined
as they are outside the function right
yeah but they are outside the function
to rad or calccrow?
the values are both undefined at torad and calcCrow
you need to pass them into the function
let lastcoordinate = calcCrow(lat1, lng1, lat2, lng2)
console.log(lastcoordinate)
this will call your function and set it as lastcoordinate
the log is just for checking the output
where should i define that? above torad or right above the function calcCrow
would do it beneath the function but it should not matter iirc
above the text
but haven't i already declared lastcoordinate?
it would declare it double which is not possible
let lastcoordinate;//so i should remove this?
function toRad(value) {
return value * Math.PI / 180;
}
function calcCrow(lat1, lng1, lat2, lng2, lastcoordinate) {
var R = 6371;
var dLat = toRad(lat2 - lat1);
var dLon = toRad(lng2 - lng1);
var lat1 = toRad(lat1);
var lat2 = toRad(lat2);
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return d;
//and add the let lastcoordinate = ...... here?
}```
or am i horribly wrong at the moment?
let lastcoordinate;//so i should remove this?
function toRad(value) {
return value * Math.PI / 180;
}
function calcCrow(lat1, lng1, lat2, lng2, lastcoordinate) {
var R = 6371;
var dLat = toRad(lat2 - lat1);
var dLon = toRad(lng2 - lng1);
var lat1 = toRad(lat1);
var lat2 = toRad(lat2);
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return d;
//and add the let lastcoordinate = ...... here?
}
//add it here
did you check the output?
Egg 0Bay Scallops In New York State 040.503634 0-74.218792
program.js:65
NaN
that is my conole.log
the NaN
looks like there is an error in your function
var R = 6371;
var dLat = toRad(lat2 - lat1);
var dLon = toRad(lng2 - lng1);
var lat1 = toRad(lat1);
var lat2 = toRad(lat2);
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return d;
}```there is somewhere the error
is it because i am returning d?
but not calling d in the text
but lastcoordinate
debug the function and check if every step is doing what is called
d = lastcoordinate
no that wouldn't be it
show your full code again
you still refer to outdated modules
dw i should remove them
i am not using them right now. They were from an older project.
request is deprecated and no longer maintained
i am not using promise anywhere
i just defined it as i started the project using different modules to see what would be the best approach
why did you refer it then? sure wont break anything but it looks messy
i just defined it as i started the project using different modules to see what would be the best approach
@eternal osprey .
@eternal osprey your lat and lng variables are all fucked up
lat1 and lng1 are strings, not numbers, and lat2 and lng2 are reading directly from a file and not being parsed in any way whatsoever
this is my entire bot
console.log(lat1,lng1,lat2,lng2)
okay on my way to log them
also, the second parameter for readFileSync is an object of options
idk why you're giving it lat1 and lng1 in an array
lol thats everything but what you want to use
yeah i see now.
you're reading the file as a buffer
Hello
how come that?
someone could speak french
function calcCrow(lat1, lng1, lat2, lng2, lastcoordinate) { you can remove lastcoorinate here its not needed
i can but this is only an english chat @earnest phoenix \
@eternal osprey readFileSync("path","utf8")
is that the correct way to do it? Why? Also what does path and utf8 refer to>
utf8 is the encoding
yes
but this wouldn't make sense right?
as my json file has 2 coordinates saved to it
why?
lat1 and lng1
if i am const lat2 = readFileSync("./lastcoordinate.json","utf8")
it will get the whole lat1 +lng1
what would integer path look like
it would be a file descriptor @pale vessel
hmm okay
or no
wait
but how would my lat2 be defined now then?
as i have taken the whole lat1 and lng1
and i only need the lat1
you can refer the file as const coordinates = fs.....
and then read it with coordinates.lat1
if your file structure matches to it
if its json, you can convert it, if its string, you can split it
according to your writeFileSync right above
it should be an array
you can use JSON.parse on it
so json.parse(lat1) for example?
if its being written as a comma delimited string instead, which is how arrays get automatically stringified, then you can split it by a comma
so json.parse(lat1) for example?
@eternal osprey is this example right?
console.log it and see
okay on my way
tim
i tried doing it the way how superbrain8 told me, but it still gave me buffer shit
let me try it on your way
erwin
not erwin's icon is hot
your nitro expired? shes no longer dancing
anything really, im doing a bitwise field like discords for permission
though.... 25+ gets shit to the power of 2 really big
so im unsure if its a good idea to store that many items like that
so its viable until 48?
technically yes
you could also use bigints just to make sure
i mean i know the shapw always
shape*
so it wont be returning anything bigger
rn i got 22 items that need to be mapped
i still can't get it working!
but i was checking and it was getting really big really quick post 25
for fuck sakes
actually js can handle up to 53 bits
JavaScript can only handle integer values up to a magnitude of 53 bits (the 52 bits of the fraction plus 1 indirect bit, via the exponent
hmmmmm
i'll prob stick with that for this case
50 gives me plenty of room to play with for a bit
storing a user's configs in a single number is handy af
no need to create entries for the database for each thingy
just picturing a db table with 53 collums gives me a headache
lmao yeah
aight, imma go with that for now then
there are databases out there with thousands of cols, can you imagine that
xD
i usually unconsciously try to reach for my flamethrower to burn it the moment i see it
at least its not as bad as what i wrote yesterday
@quartz kindle enjoy cursed ts
the hell
lol why did you censor that
the world shall never know
formatted ts doesn't even look cool i'm sorry
its not about formatting, the content is worse
lmao
yeah sorry for being so dumb and persistant.
timer = setInterval(async ()=>{
if (raids.length > 0)
{
let raid = raids.shift();
const name = getName(raid.pokemon_id);
const lat1 = raid.lat;
const lng1 = raid.lng.substring(1);
fs.writeFileSync("./lastcoordinate.json", [lat1, lng1])
console.log(name, + "\n" + raid.gym_name, + "\n" + raid.lat, + "\n" + raid.lng);
const coordinates = fs.readFileSync("./lastcoordinate.json","utf8")
const lat2 = fs.readFileSync("./lastcoordinate.json", coordinates.lat1)
const lng2 = fs.readFileSync("./lastcoordinate.json", coordinates.lng1)
console.log(lat1, lat2, lng1, lng2)
``` what the fuck
i like the comment
xD
why the fuck is this returning bufferss still.
mine or awesome?
can setInterval even run async?
i remember having some issue with something of that sort and i cant remember what
can we just start by why not use a database?
@quartz kindle yeah i am really just fucking up my code right now
@opal plank i know. It just saves 2 coordinates. It shouldn't be a big deal.
hmmmm
json is the worst of it's kind, but once used correct there cannot be much of an isse.
issue*
hmmmmmmmm
but atm i am just stuck with my code. It still returns me a fuckingg long list of bufferrs.
any suggestions?
hmm tostring?
how to i fix heroku cant connect to mongodb
also
dood
const coordinates = fs.readFileSync("./lastcoordinate.json","utf8")
const lat2 = fs.readFileSync("./lastcoordinate.json", coordinates.lat1)
const lng2 = fs.readFileSync("./lastcoordinate.json", coordinates.lng1)```
why
yeah i am stupid
just read the file once
because coordinates gives the lat1 and ln1
or better yet, store in memory
i will try with tostring.
@eternal osprey dude... dont read the same file 3 times
read the file once
then do things to it
const coordinates = fs.readFileSync("./lastcoordinate.json","utf8").toString()
const lat2 = coordinates.lat1
const lng2 = coordinates.lng1
console.log(lat1, lat2, lng1, lng2)
```i know that it is wong what i just wrote. The const coordinates will show the lat1,lng1 but how would i ever define lat2 and lng2
i know i know
you dont need toString() if you use utf8
someone just said that i had to use tostring
to return a string as it would be easier
coordinates is not an object, you cant do coordinates.lat1
parse it
console.log(coordinates) so you see what it is
@quartz kindle it returns me : 40.752579,73.720396
which is good.
but how can i define lng2 and lat2
ah so lat2= coordinates[0] etc
aha i get it!
how can this ever be: 8353.165083512797 kilometers of distance?
between 40.628727, 74.02469 and 40.816857, 73.75716
my console.log
like wtf is this
@quartz kindle
const coordinates = fs.readFileSync("./lastcoordinate.json","utf8").toString()
const lat2 = coordinates[0]
const lng2 = coordinates[1]
console.log(lat2 + "\n" + lng2)
``` i've done everything you said
but uhhm
dafuq
it returns 4 and 0
toString() returns, well, a string
what you are getting is the returned string position
aka string[position 0], string[position 1]
const [lat1, lat2] = readFileSync().toString().split(",") or something
Egg 0American Boy Statue 040.849534 0-73.82336 program.js:65 40.849534 //lat2 coordinate 73.82336 //lng2 coordinate program.js:72 0 program.js:97 Egg 0International Year Rock 040.600624 0-74.150802 program.js:65 40.600624//lat1 coordinate 74.150802//lng1 coordinate program.js:72 0//lastcoordinate (result)
how can the lastcoordinate ever be 0?
function toRad(value) {
return value * Math.PI / 180;
}
function calcCrow(lat1, lng1, lat2, lng2) {
var R = 6371;
var dLat = toRad(lat2 - lat1);
var dLon = toRad(lng2 - lng1);
var lat1 = toRad(lat1);
var lat2 = toRad(lat2);
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return d;
}
let lastcoordinate = calcCrow(lat1, lng1, lat2, lng2)```is this code wrong that i wrote?
is it using the wron variables?
i am really confused at this point
what the fuck are you doing @mighty zealot
XD
Hi someone will advise me looking for discord bots that can do registrations
}).catch(
It's .users.first()
also, just use members.first()
anyone that knows the answer on my question?
you don't need to do guild.member(user) afterwards too
whats the full stack trace
const msg = await message.channel.send(helpss);
await msg.react('๐๏ธ')
await msg.awaitReactions((reaction, user) => message.author.id == user.id && (reaction.emoji.name == "๐๏ธ"), {max: 1, time:15000})
.then(async collected => {
if(collected.first().emoji.name == "๐๏ธ"){msg.delete(), message.delete()}
else return message.channel.send("error")
})
sometimes it work and sometimes it dose not
message.reply("that member isn\'t in the server") you can take off the \ in \' cuz the " does the quote and it doesn't affect the ' @earnest phoenix
only if the quote is inside ' '
if (memeber) { should be member instead of memeber
wait
send the error
read it, what does it say?
that's an error with Node.JS
you should check the dependencies
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
there must be more above all npm ERR!s
is there anything in the console?
above what you sent?
hmm
so the problem may be with reading the code and start it
lemme check again
yes
did u edit what I told you to?
this version is still the same before I told you anything
ah
it's })
member.kick('you were kicked from the server!') this is what concerns me
you might want to learn basic js first
I don't think you can send messages to a member who's getting kicked like that
@earnest phoenix https://discordjs.guide/
use this guide
it may help you
no use this guide https://www.w3schools.com/js/DEFAULT.asp
really ._.
better the guide from the library than w3schools imo ๐ค
oh wait
LOL
now I noticed o_o
@earnest phoenix so, try the JS guide @pale vessel sent you. Then try that Discord.js guide I sent earlier, and in the end use this https://discord.js.org/#/docs/main/stable/general/welcome to help you coding with the library you're using
and never forget
always use let over var
๐
const also works
const also works
@lusty questconstis for constant variable, if you want a changeable variable, u can usevar, butletis better I forgot why ๐ฎ
var is more or less deprecated and ignores the scope
ive got my Developer medal on discord with a D.js bot
You're right in saying there is no real advantage to using var over let - if you define them at the start of a function their meaning is basically identical.
You're right that there is no real reason to write new code using var (except maybe this, if relevant).
There are pages on the internet that are decades old though, and no one is going to rewrite them. There is nothing really to gain by removing var from the language. For languages like HTML and Javascript that are interpreted - backward compatability is absolutely mandatory.
That is also why they chose not to simply redefine var. Take the following example code;
// THIS IS AN EXAMPLE OF BAD CODE. DO NOT COPY AND PASTE THIS.
if (logic) {
var output = "true"
} else {
var output = "false"
}
console.log(output)
If var was changed to behave like let then the console.log would cause a reference error because of the scope difference.```
so how can you have mistakes like that in your code?
did you smoked something?
How can I paste a html code from a website , in the inbuilt code field on top.gg page, do the html code have a special format?
must have been some good shit
did you smoked something?
@lusty quest sorry wrong guy
YIKES
the guy never said anything again
and I even thought he was wrinting
let's forget what just happened
How can I paste a html code from a website , in the inbuilt code field on top.gg page, do the html code have a special format?
@tired panther I guess CSS is the only thing you can customize there
only html/css. scripts if you are certified dev
how do they do such things? @outer perch
so you can use html
my html code does not work there
k
not sure but it looks like it. (in a limited way)
but, Certified Developer isn't being given to anyone now
at least from what I'm told
Correct
so that means no one's getting free html/css xD
i never really worked with HTML/CSS so idk
{ name: `Prefix`, value: `${prefixes}`, inline: false },
{ name: `**Information Commands (${prefixes}help information)**`, value: 'lmao help', inline: false},
{ name: `**Moderation Commands (${prefixes}help moderation)**`, value: 'what', inline: false},
{ name: `**Fun Commands (${prefixes}help fun)**`, value: '``<meme`` ``<poll``'}
)```
i think html also is limited in what is allowed. like you are not allowed to remove or overwrite ads
it says damn this error
TypeError: "" is not a function
what can i do
i tried EVERYTHING
'``<meme`` ``<poll``' i would guess this creates the error
you can escape them with \
so how can i correctly form that?
'`<meme` `<poll`'
{ name: `Prefix`, value: `${prefixes}`, inline: false },
{ name: `**Information Commands (${prefixes}help information)**`, value: 'lmao help', inline: false},
{ name: `**Moderation Commands (${prefixes}help moderation)**`, value: 'what', inline: false},
{ name: `**Fun Commands (${prefixes}help fun)**`, value: 'oml'}
)```
now i got this
yikes
TypeError: "" is not a function
Discord escapes the characters too xD
well you need a codeblock
i will do the fields all over again lmao
@tribal siren are you sure its this part of the code that errors out?
i will do the fields all over again lmao
@tribal siren don't
yes
send the entire code. if its to long use hastebin or something like it
i just finished doing a customizable prefix command and this pops out
wait lemme do some stuff
i will refer here if a problem occurs again
@lusty quest @rustic nova
Html css and markdown allowed
JavaScript will be removed
Exactly what i said, yeah
yea i know but its almost a year ago that i used it the last time
anyone know how to fix: TypeError: Cannot read property 'guild' of undefined
the line is: const MOD_CHANNEL = member.guild.channels.cache.find(ch => ch.name === 'botlog');
member is undefined
V
where did you define member?
don't repost that 
ic
is this an event?
or sorry, can you show your command handler code?
did you provide member and guild?
in the handler
because it could just be client and message
its not a message its on ban report the ban to the MOD_CHANNEL
How can i get mongodb ping?
like this?
mongoose.connection.on(connecting, () => {
console.log(([${name}-WARN])} : Connecting to MongoDB server...`)
});
No, not that like the connection ping? Not sure what its called
im not sure
do u know this
anyone know how to fix: TypeError: Cannot read property 'guild' of undefined
the line is: const MOD_CHANNEL = member.guild.channels.cache.find(ch => ch.name === 'botlog');
try logging the member and see if it has the guild property
which event is that?
what should i type to define member
its unban
and yes it is hoggers
client.on("guildBanRemove", function(guild, user, member) {
const MOD_CHANNEL = member.guild.channels.cache.find(ch => ch.name === 'botlo');
unban event?
guildBanRemove doesn't provide member property
ohhh
so just do guild.channels....
ima test
and there is no member object since they aren't in the guild
return client.channels.cache.get(MOD_CHANNEL).send(embed);
^
TypeError: Cannot read property 'send' of undefine
log the channel
wdym
The channel couldn't be found in the cache.
doesn't djs cache all channels?
.get takes a channel ID for the record
already found it in cache before that lite
i don't remember since I'm using eris
I GOT IT TO WORK
read the docs next time
i just did return MOD_CHANNEL.send(embed)
yh ik
lol
thanks
Does someone has a neath porn command
Or a api
I need a api
for pussy, sex, anal, blowjob, 4k, hentai
best is to search that for yourself
@rustic nova Bro, I searched for days
but i cant find
such a good api
@earnest phoenix const { API } = require('nhentai-api')


self bots against tos
@modern sable
He buys selfbot
please act
@zealous sable
Alex is always active
he will assist us
Pinging one is good enough
now you pinged 2 people that cant do anything
No i can ping 2
Dude trying to ask for selfbot programming
I will leave it to a mod
I'm looking for a bot to send a private message and invite it to the server
will pay?her style selftboot
@SeGo#8743
Yes
@earnest phoenix selfbotting is against Discord ToS
so we wont assist you with that
We also dont sell
First off @earnest phoenix, bot reviewers don't have perms to ban or whatever
O
crap, I'm late DX
Sorry, I just sniped this channel lmao
and also you will quickly get banned from Discord if you send lots of DMs at once so just dont
But dont mini mod
ANYWAYS, let's get on topic lol
I need porn api
that is why im here
i cant google
because my parents dont like that
We, can't help with NSFW?
O
well idk tbh
we can but we should not
Is it an NSFW bot?
oh ok
@earnest phoenix like we said, NO SELF-BOT development.
@green kestrel i guess this is something for you

i guess he is gone
Back to development talk 
no one is gonna make a bot for u free
i already found this
.-.
use a open one
I use node fetch
No NSFW content
O, sorry
marco are anime body pillows safe for work?
dont say that u hurt marco's feelings
there are API clients for this stuff. if you search for it in on the npm website you will find stuff
but with nsfw commands you will not get the Bot verified here
nekos.life is a website they have sfw endpoints and nsfw endpoints (the later one can get you in trouble bcs some of the stuff is yikes)
javascript crawler is a node module that allows you to crawl pornpics.com and save picture automatically.
I found this one
nice
I think so
I dont want my bot gets declined
As long as it is restricted to nsfw channels
yes, if you lock it to nsfw channels only and don't mention the comamnd in your bot description
Also, don't mention it on your bot page because that will get your bot denied
K
nsfw bots that mainly promote nsfw stuff will be declined. if you got nsfw commands they should not be mentioned on your Top.gg page and needs to be limited to nsfw channels
well then no nsfw commands for you
write a command and when you are done limit it to nsfw channels
if you're under 18, don't implement nsfw stuff in it
lmao thatโs where we got in 2020
Make a generic bot that doesn't have nsfw yet
Not saying that it isn't allowed or anything
But best to not implement it yet
make a hidden nsfw command that is nowhere listed and then join random servers where your bot is in and use the command to confuse everyone
LMAO
you check if the Server is listed somewhere
you can get the name pretty easy like you have a automatic posting of Guilds where your Bot joins or leave
PornHub Kids
joke aside like i said they wont allow pure NSFW bots but if you have one or two nsfw command and they are not listed on the top.gg page and are limited to nsfw channels it should be fine
LMAO
It sends soo much porn
and it also did this:
oh nvm
Undefined
not so good
i cant send link
I still suggest not implementing it yet
HAHAHAHAHAHA
It sends soo much porn
@earnest phoenix
Bro
Fr
I test it on a message event
without nsfw block
and it reacted to itselfs
and the bot is already in 80 servers
i am scared it spammed porn in there
lmaoooooooooooooooooooooooooooooooo
Well HAHAHAHAHAH
This is NOT GOOOD
this is why you dont develop on a Live system
LMAOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
i fked it up
Im a shit developer
i will quit
thats the best
my bot is fked up
who pinged me
No dont worry
Im a shit developer
@earnest phoenix
better than the dude who ran a eval that made his bot leave every Server it where in (he got over 300 before)
in a not nsfw channel
HAHAAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAH
@lusty quest How dumb can you be??
idk someone ran in #commands or #265156322012561408 an eval for this
but i think this is also dumb
better than the dude who ran a eval that made his bot leave every Server it where in (he got over 300 before)
@lusty quest LMAOOOOOOOOO
Bro
i dont know
how many damage this is
it sended mass porn in not nsfw channels
if you search a half year worth of posts in #starboard you maybe find it
ok
it got removed already out 4 servers
i fked my bot up
I will just quit
its the best
NO DONT QUIT PLEASE YOU DESERVE THE WORLD FOR MAKING ME LAUGH SO HARD
@earnest phoenix to prevent this stuff make a 2nd bot account at the Discord developers page. use the 2nd bot for development
if you fuck it up again it will just spam in one Server not 80
Yes that is true
lol my raspberry can handle more
@earnest phoenix You probably get some people horny not that bad
Ur.....mm
this pc costed 27$, but it was on alixpress, my dad dont wanted to buy me a good one
It was very cheap
and it starts up
Why i cant click the star
on my message
Its very sat
Ok
I was talking about development
and about instances
but ok
another person that thinks im a shit developer
Stop being a drama queen
lmao imagine suddenly seeing a bot you added send 5000 porn for no reason
hi
hi
instant no nut November fail
instant no nut November fail
@cinder patio HAHAHAHAHAHAHAHAHA
Hello Multi
instant no nut November fail
@cinder patio AntiNNN Bot
const Pornsearch = require('pornsearch').search('WHAT YOU WANNA SEND');
Pornsearch.gifs()
.then(gifs =>{
var result = gifs[Math.floor(Math.random() * gifs.length)];
console.log(result.url) //Is your finally gif result
})
Thank me later
does anyone how you can create an invite in a server the bot is in
oh my
@earnest phoenix How many server banned your bot for that spam? lmao
Shit XD
does anyone how you can create an invite in a server the bot is in
@vale garden
anyoneee
its not really allowed
That's a privacy breach
We dont help
not allowed
With that
oh
you could get the name and google if they are public
unless your bot user asks for it, like doing "!createinvite"
yea
but you are not allowed to get these invites through !createinvite for example and use them yourself
unless it's mentioned that you can join through it, but I'm not 100% sure if that's allowed
ask a mod on that
message.channel.createInvite().then(invite =>{
message.channel.send(invite.code)
})
here big spoonfeed
lol ok tq
lol
if you were smart you also could
it isnt very hard
Also I made porn working now
docs
wtf would i have done
lol ok
I can use here nice emoji

^^ Spoonfeed
๐
should I do 10 seconds on porn command
or longer

HAHAHAHAHAHAHAHAHAHHAHA
@earnest phoenix would recommend to talk about less nsfw stuff since there are still rules here and here are still users that are not legal age
No dont add cooldown, i dont think they will like that
Oh
If someone asks for nsfw api send them this: #development message
ok??
That is best
Now i will stop about this topic
Imagine letting your bot leave all servers
๐ฎ
right, "pin" a porn command lul
that is not soo good
@pale vessel Yes, people really need it and no one knows how to make
so this is such a good idea
module.exports = {
name: 'args-info',
cooldown: 5,
aliases: ['icon', 'pfp'],
description: 'Information about the arguments provided.',
execute(message, args) {
if (!args.length) {
return message.channel.send(`You didn't provide any arguments, ${message.author}!`);
} else if (args[0] === 'foo') {
return message.channel.send('bar');
}
message.channel.send(`Arguments: ${args}\nArguments length: ${args.length}`);
},
};
this was my first command
Nice
but that was with discordjs guide
they gave me this all
๐
i didnt made it
i copied pasta
Pasta
My first self written command was:
export const description = "Info, Harry Potter Characters";
exports.run = (client: Client, msg: Message, args: Array<string>) => {
if (args[0] == null || args[1] == null)
return msg.channel.send('Pleae provice a Harry Potter charachter')
fetch("https://hp-api.herokuapp.com/api/characters").then(resp => {
return resp.json()
}).then(data => {
let character;
data.forEach(item => {
if (item.name.toLowerCase() == args[0].toLowerCase() + " " + args[1].toLowerCase()) {
character = item;
}
});
if(!character) {
return msg.channel.send(`${args[0] + " " + args[1]} was'nt found! I'm so sorry!`)
}
if (character.wand.length === '') {
character.wand.length = '-'
}
if (character.wand.wood === '') {
character.wand.wood = '-'
}
if (character.wand.core === '') {
character.wand.core = '-'
}
let embed = new MessageEmbed()
.setTitle(`Information ${args[0] + " " + args[1]}`)
.addField('**House**', `${character.house}`)
.addField('**Date of Birth**:', `${character.dateOfBirth}`)
.addField('**Wand**', `Wood: ${character.wand.wood} \n Core: ${character.wand.core} \n Length: ${character.wand.length}"`)
.setThumbnail(character.image)
.setColor(character.eyeColour.toUpperCase())
msg.channel.send(embed)
})
}
``` lmao
@grave yoke use css inside your long description through <style> tags
Bro whats that
to get the selectors (the names of the objects like the button for example), use inspect element
Bro whats that
epic harry potter information
ok but ฤฑ want to do gif
a gif background? use background-image then
but remember to not use gifs that could cause seizures
how do i check the uptime of a bot using eval
@umbral zealot Hey mate, I figured my issue out. Apparently I was calling my db connection args instead of the actual DB connection. Soooo it was me being an idiot.
Why do you want to use eval?
Just make an uptime command?
process.uptime()?
Um... using eval you would place the same code for the command inside a string, so I don't really see the difference... lol
except it'll be slower, of course.
@rustic nova its not worked
I found one on the internet that will give exact time as long as it functions.
what does not work?
...
you need to get the css selector for the background
how can ฤฑ get it ?
background-image: url('img');
they need the css selector of the background
Do webhook bypass the global ratelimit? Meaning you only have to deal with local ratelimit? Regardless of the answer, I was planning to add webhook support for a certain feature of my bot, but I was just curious
I meant, if you use MANAGE_WEBHOOKS to create a webhook, and then post to that webhook
oh discord webhooks
yes they do
give me a minute
you could make a test request to a webhook through a rest client and get the ratelimits for the webhooks
Thanks!
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
I was planning to add (optional) webhook support for a certain feature
Primarily, to add nickname and pfp, sending support.
But I was also worried that the same feature could use up a ton of global ratelimits
So I was curious if webhooks would help
get some help
What???
Shivaco
shiv qt 
no u
somewhere
simp
development moment
That feeling when Git refuses to stash changes
ratelimits for webhooks if that's correct @slate oyster https://cdn.hopefuls.de/XEcu
anyone know how to make a kick or ban command? js
you can make 5 requests at once (like the global ratelimit) and the reset is around 10 Seconds or so
so pretty much very similar to normal message ratelimits
Thanks!
hello i created a html code for my bot but the top.gg is not reading the style
how can i fix it?
I really need help, I have no idea on what to do this
Basically I want to create a channel at the beginning of a category, how can I do that?
(voice channel)
What's wrong here?
if(isSomethingEquipped === true) {return message.channel.send('You have something else already equipped')};
message.channel.send('You equipped Weapon1');
db.set(`${message.author.id}_equipweapon`, 'Weapon1');
weapequip = db.fetch(`${message.author.id}_equipweapon`)
const filtro2 = weap2;
const newweap2 = filtro2.filter(weap2 => weap2!= weapequip);
weap2.set(`${message.author.id}_weapon`, newweap2)}
}```
Error code:
```(node:2608) UnhandledPromiseRejectionWarning: TypeError: filtro2.filter is not a function```
I got the error, im stupid lmao, weap2 is the table so the correct filter should be:
```const filtro2 = weapget2;
const newweap2 = filtro2.filter(weap2 => weap2!= weapequip);```
everything is wrong with that code
One message removed from a suspended account.
One message removed from a suspended account.
Veery nice
I really need help, I have no idea on what to do this
Basically I want to create a channel at the beginning of a category, how can I do that?
is this even possible?
@sage bobcat @earnest phoenix May i ask why and what can i do?
name: "slowmode",
description: "Lets you set slowmode on the channel.",
run: (client, message, args) => {
const amount = parseInt(args[0])
if(message.member.hasPermission("MANAGE_CHANNEL"))
if(isNaN(amount)) return message.channel.send("It doesn't seem to be valid number")
if(args[0] === amount + "s") {
message.channel.setRateLimitPerUser(amount)
if(amount > 1) {
message.channel.send("slowmode is now " + amount + " seconds")
return
}
else {message.channel.send("slowmode is now " + amount + " second")
return }
} if(args[0] === amount + "min") {
message.channel.setRateLimitPerUser(amount * 60)
if(amount > 1) {
message.channel.send("slowmode is now " + amount + " minutes")
return
} else {
message.channel.send("slowmode is now " + amount + " minute")
return }
} if(args[0] === amount + "h") {
message.channel.setRateLimitPerUser(amount * 60 * 60)
if(amount > 1) {
message.channel.send("slowmode is now " + amount + " hours")
return
} else {
message.channel.send("slowmode is now " + amount + " hour")
return}
} else {
message.channel.send("You can only set seconds(s), minutes(min) and hours(h)")
}
}
}
@opaque seal https://discord.com/developers/docs/resources/channel#channel-object
I'm sure there's a similar function available on DJS, too
List all channels, head to the category you want to and add a channel above the channel with it's parent id being the category
The problem @boreal iron is that I already have a VC at position 0, and if I set the new vc at position 0 it goes to the bottom of the already existing one
Did u set a correct position?
yes
It can't be below 0
so I set it to 0
but having the same position to the other VC it goes to its bottom
Then edit all channels of this category by increasing their position + 1
Creating the new channel after
That's api spam I think

