#development
1 messages · Page 1347 of 1
explaination ^
i assumed it was done attempting to answer this question
#development message
function reverseString(str) {
return str.split("").reverse().join("");
}
message.channel.send(reverseString(args))
str.split is not a function
yeah
well you can't use an array as a string
and you can't use string methods on the array
@viscid gale An interesting way to think about the N queens problem is to find a different way to represent the board. Because no 2 queens can be on the same row, instead of using a 2d grid you can collapse it into a one dimensional array where each index represents a new row. So you can have [1, 3, 0, 2] that represents the solution
.Q..
...Q
Q...
..Q.
and from there you can pre-fill a single index of that array and create a backtracking algorithm that will ignore a position you pass in when checking different solutions
k im back and... hmm reading
aaaa
i was indeed thinking of changing my approach but the number example was VERY HELPFUL
this is gonna take a bit to sink in fully
cool i cant save my hastebin now
now im getting this when i download quick.db
help plz
cool i cant save my hastebin now
@vale garden I'm jealous of you man
@woeful pike thanks :}
i got church soon but after i would implement that idea.. appreciated
yeah no worries, this problem took me a long time to figure out even when I fully understood the solution lol
so ur one of the 43 who solved it huh.. nice
@vale garden npm install node-pre-gyp
by this afternoon hopefully it gonna be 44 :}
Error: HTTP Error: 400, Billing account for project '505255374849' is not found. Billing must be enabled for activation of service(s) 'cloudbuild.googleapis.com,containerregistry.googleapis.com' to proceed.
I can't deploy to firebase functions smh
how do i make that if it is
it will return a message in the channel
idk how to return that
k ill try
embed.fields[3].value.length
it will return the length
if it's larger than 1024 send a message in the channel
@vale garden also, the error is on better-sqlite
you know how to do math in JS right?
not very good
If you read the error is a problem when installing that pckage
repl.it doesnt support building sqlite
the build takes too long, and gets killed
you have to ask the maintainer to release a prebuilt version for repl.it's node version
@earnest phoenix
if (embed.fields[3].value.length(1024)) return message.channel.send('if you dont see anything that means that you got more roles then i can list.` Must be 1024 or fewer in length.` ')```
now?
@tardy hornet do you know how to check if a number is bigger or smaller than another number?
number > othernumber
o wait
then
if (message.length > 1024) return message.channel.send('if you dont see anything that means that you got more roles then i can list.` Must be 1024 or fewer in length.` ')```
fixed that ty
@vale garden #development message
``` let enabled = db.get(24/7_${message.guild.id}) {
if(enabled) return
player.playing = false
} else {
player.destroy()
}```
why isnt this working
what version?
7.1.1
on the other one too?
well no the latest version is 7.1.3
but i guessed it would load up 7.1.1 if i changed it in the package.json
and that didnt do anything
latest version for better-sqlite3 is 7.1.1
lol
@vale garden quick.db is built on top of better-sqlite3
``` let enabled = db.get(
24/7_${message.guild.id}) {
if(enabled) return
player.playing = false
} else {
player.destroy()}```
:/
its 7.1.3 here tho
i dont use mongo, but you should be caching prefixes, not fetch them on every single message
@vale garden thats quick.db version, not better-sqlite3 version
hey tim
u know why it is givin error?
@vale garden
oh kk
does your other bot which works also use the same versions?
how do you send HTTP requests through browser javascript?
wait so can i download previous versions of better-sqlite3
@vale garden there were changes on v7 that makes better-sqlite3 take longer to install, and repl.it doesnt like that it takes too long
repl.it doesnt like that it takes too long
can't i just dorequire("child_process").exec("npm install quick.db")in index.js and run it? repl can't kill the process for that
let enabled = db.get(`24/7_${message.guild.id}`) {
if(enabled) return
player.playing = false
} else {
player.destroy()
}
why are there random braces on line 98 and 104
@next flax
hmm
those curly brackets shouldn't be there
ok
actually no
@earnest phoenix use axios
there should be a { after the if statement and no { after db.get(...)
@earnest phoenix use axios
@earnest phoenix i can do that in node but i wanna do it on browser
Use axios the client side version
ok
link me the website for that
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
Its shown in the axios repo
let enabled = db.get(`24/7_${message.guild.id}`) if(enabled) return { player.playing = false } else { player.destroy() }
the brace should be before the return statement mate
and there should be no line break after the return statement
u mean
let enabled = db.get(`24/7_${message.guild.id}`) { if(enabled) return player.playing = false } else { player.destroy() }

does that look valid JS syntax to you
the brace should be before the return statement NOT at the start of the whole if statement
let enabled = db.get(`24/7_${message.guild.id}`) if(enabled) { return player.playing = false } else { player.destroy() }
finally
ye
and why is there a line break after return
why even return, what are you returning?
Does anyone know why this only updates my database after ive updated it twice and then it updates to the version ive updated to the first time
client.on('guildUpdate', async guildData => {
db.collection('guilds').doc(guildData.id).update({
'guildID' : guildData.id,
'guildName' : guildData.name,
'guildOwner' : guildData.owner.user.username,
'guildOwnerID' : guildData.owner.id,
'guildMemberCount' : guildData.memberCount,
});
});
if the db isnt seted so it will disconnect
yes but why return
yes, but why return
yo anyone please?
@solid snow why do you need to store this info?
Just fetch and get when you need the data
well i wanted to use it for prefixes and other things but i just followed a tutorial so far
Oh, is that mongodb?
its firebase
Oh
Either way it's being overcomplicated
All you need to store is the guild ID and the prefix for the guild
probably
yeah but my problem is still that it only updates after i update the guild for the second time and then it stores the info from the time i updated it for the first time
so if my server name is 1
When the command to edit the prefix is used, create a new doc with the guild ID and the prefix
and i update it to 2
it doesnt change until i set it to 3 and then it sets it to 2
well updating the prefix works
well i want the guild name to be changed in the database if they decide to update it
even if i used it for something else my problem is that it only updates after the second time and then it still uses the version from my first update
so if my server name is 1 and i update it to 2 it doesnt change until i set it to 3 and then it sets it to 2
Don't need to use the guild update event at all
Don't have to store any strings other than the ID and the prefix
how are you checking this?
just fetch it using the ID
It's unnecessary as all hell
is that less unnecessary?
client.on('guildUpdate', async gData => {
db.collection('guilds').doc(gData.id).update({
'guildMemberCount' : gData.memberCount,
});
});
what if i wanted to do this lol
please dont kill me
Why do you need to store the membercount tho?
ARGH
Just get it when you need it
WHAT IF i juts want to because my soul is possesed by a demon
IF thats what i want to do then WHY is it not working
because my soul is possesed by a demon
aka you're dumb enough to install discord
yes
but i still want to know why it only updated my database after the second time i updated the guild
🤦
ok then
@solid snow how are you checking that it only updates on the second call?
you'll need the ID anyways to get ANYTHING at all
you edit your guild, then you check the database on firebase's website? and you refresh and all that and still nothing?
well it WORKS BUT only after the second time i update the guild
only after i update it for a second time but then the db gets updated with the name from the first update
so like name starts out with 1, i set it to 2 - nothing, i set it to 3, database updates it to 2
what library are you using for firebase?
firebase-tools probably
youtube tutorials!?
``` let enabled = db.get(24/7_${guild.id})
^
TypeError: Cannot read property 'id' of undefined
at Manager.<anonymous> (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\server.js:98:38)
at Manager.emit (events.js:315:20)
at Node.trackEnd (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\erela.js\dist\structures\Node.js:208:30)
at Node.handleEvent (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\erela.js\dist\structures\Node.js:167:18)
at Node.message (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\erela.js\dist\structures\Node.js:147:22)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\ws\lib\websocket.js:797:20)
at Receiver.emit (events.js:315:20)
at Receiver.dataMessage (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\ws\lib\receiver.js:437:14)
at Receiver.getData (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\ws\lib\receiver.js:367:17)```
why
let me try thanks for actually helping lol
well, with name, not with membercount
why their is that error
guild is not defined
i did define it in the functions part
show it
well, what is player supposed to be?
client.channels.cache.get(player.textChannel)
.send({
embed: {
color: "#FF0000",
title: "Queue Ended",
thumbnail: {
url: "https://images-ext-1.discordapp.net/external/0347DCDXRHB7-aBKxz3JdU2-gFOXggZKkIWBcome1rc/https/media.discordapp.net/attachments/726369370888077327/729881766160105582/83.audio_visualizer_perspective_3d2.gif",
},
description: `🎵 | Music Queue Ended`
}
})
let guild = player.guild()
let enabled = db.get(`24/7_${guild.id}`)
if(enabled) { return player.playing = false
} else {
player.destroy()
}
});```
Oo
@quartz kindle still the same
@solid snow then idk, never used firebase before, i dont like it either
hm thats ok thank you for actually trying to help i appreciate it
u know something? @quartz kindle
how much traffic can firebase handle?
@next flax #development message
well, what is player supposed to be?
@quartz kindle its the audio based manager i m using to play music
@rocky hearth this is the free plan
@next flax you made it yourself, or is it from a library? is there a documentation to confirm that player.guild exists?
thats why im asking, what is it? where it came from?
Yes I know, but I want to know, if I have more than 1M active users. should I still use firebase?
if you know what player is made of, then you know what it can and cant do, what it has and doesnt have
is there a documentation for this player?
yep
who made this? is it from a library?
its a package
then check the package's readme
well
its a property of type string
so you use it as player.guild and it should give you a guild id

for example db.get(`24/7_${player.guild}`)
hmm
Hey Rexxy do u know some other packages other than erela??
music bot
discord-player
Does anyone know how i can code a playing in ..... servers stats
After a period of time the bot will leave, despite me and others being in the call.
what is diffrent between them?
@lost stone its difrent
{ is curly brackets
( is a normal bracket
[ is square brackets
< this is a arrow
in coding i mean
😂
( is a parenthesis
const discord = require("discord.js")
module.exports = {
name: "24/7",
run: async (client, message, args) => {
//ARGUMEN
let guild = message.guild;
db.set(`24/7_${guild.id}`)
await message.channel.send("24/7 ")
}
}```
why doesnt this work
at Object.set (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\quick.db\src\index.js:64:19)
at Object.run (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\commands\music\247.js:13:7)
at Client.<anonymous> (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\server.js:166:17)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)```
i made my own paste service
good job
how
programming
spent a fuckton of time making it
u are op
I've been trying to make a radio command for a day now and it still doesn't work, My bot joins the voice channel, And is silent for 3 seconds with no green ring, then a green ring appears but no music, i'm pretty sure the green ring is a talking bar.
the code is
module.exports = {
name: 'radio',
description: 'The bot will join the voice channel and play some nice pop music',
async execute(client, message, args) {
const broadcast = client.voice.createBroadcast();
const dispatcher = broadcast.play('https://radio.dual.pw/stream.mp3');
if (!message.guild) return;
if (message.member.voice.channel) {
const connection = await message.member.voice.channel.join();
connection.play(broadcast).then(
message => { (message.channel.send('Playing the <https://dual.pw> radio!')); },
);
if (!message.member.voiceChannel) return message.channel.send('**error** You need to be in a voice channel to play the radio');
}
},
};
``` and the error is https://hastebin.com/ivitohuxob
u are op
@next flax no i am programmer
.
@still merlin connection.play() doesn't return a Message instance.
thonk
You get a StreamDispatcher.
And that if condition after is not valid as .voiceChannel is not a valid property on a GuildMember. You don't even need it since you already check if the user is in a voice channel in your parent if condition.
i think i accidentally broke the website 😅
lol
hi
message.channel.send(`Congratulations! Charmander is your first Pokémon!`)
db.set(`userinfo_${message.author.id}`, { bal: 0 })
db.push(`userinfo_${message.author.id}`, { party: ['Charmander'] })
so i have this
and for some reason i am getting this err
UnhandledPromiseRejectionWarning: TypeError: Target is not an array.
have you tried reading the error
website is fixed but CSS is fucked
what is a lavalink
an HTTP server thingy for Java iirc
code913 to me??
yes
you need to use js db.push(`userinfo_${message.author.id}.party`, 'Charmander')
what is it used for
hello @earnest phoenix
oh shit
yo
lmao
wdym
help out with what though
helper roles are useless
we don't get rewarded roles for helping
why do you care so much for a role
You don't need a special role to help someone.
yeah
it's bad because people sometimes ignore people without that role and only ask for help from people with the role
which is bad
and also if you have helper role it looks like it's your literal job to help
@next flax website should be working now
fixed the CSS
What is lavalink used for? Can somebody tell me?
@rocky hearth music
@earnest phoenix Yep
which database should i use
for my 24/7 cmd
🤔
share my website with your friends and make me a popular rich guy overnight
just only music?
if u use that u can play from sound cloud ,vimeo,twitch
nd add a plugin to play spotify
can we record audio from this?
can we record audio from this?
@rocky hearth idk
@pale vessel hey flaze which db should i use to store 24/7 vc
depends
if you do db calls like 1 million calls / sec then go with postgres
if not -> mongodb
flaze aah yes, sorry
@restive furnace is mongodb easy to setup
yes
Yo
I have a problem
I tried to make a rob command but it says user does not exist
Is there anything wrong ?
$nomention
$onlyIf[$getUserVar[money;$mentioned[1]]>799;Not worth Robbing this user bro.]
$onlyIf[$getUserVar[money]>499;you need 500$ to rob]
$description[
You just robbed <@$memtioned[1]>? WTF,and got $random[0;$getUserVar[money;$mentioned[1]]]]
$sum[$getUserVar[money;$authorID];$random[0;$mentioned[1]];$authorID]
$random[0;$getUserVar[money;$mentioned[1]]]]]
$setUserVar[money;$Sum[$getUserVar[money];$random[0;$mentioned[1]]]]
Brah
It is Bot designer
thou
@next flax db.set, db.get is all what you need.
how can i ping a user when they join my server? i found some amazing code from stackloverflow but it didd't work bot.on('guildMemberAdd', member => { member.guild.channels.get('channelID').send("Welcome"); });
dont ctrl + c and ctrl k v
yes
Yeah it's .cache.get now
Lmk if that works
@next flax
db.set,db.getis all what you need.
@restive furnace hmm i wanted to make a
24/7 vc enable
disable cmd
the code for what it will be used
is ready
mars.on("disconnect", () => console.log("An error occurred, trying to reconnect!"));
mars.on("reconnecting", () => console.log("I am reconnecting now..."));
mars.on("message", async msg => { // eslint-disable-line
if (msg.author.bot) return undefined;
if (!msg.content.startsWith(PREFIX)) return undefined;
const args = msg.content.split(" ");
const searchString = args.slice(1).join(" ");
const url = args[1] ? args[1].replace(/<(.+)>/g, "$d&") : "";
const serverQueue = queue.get(msg.guild.id);
let command = msg.content.toLowerCase().split(" ")[0];
command = command.slice(PREFIX.length);
if (command === "_shelp" || command == "&h") {
const helpembed = new Discord.RichEmbed()
.setColor("#7289DA")
.setImage("https://cdn.discordapp.comddd/attachments/734068759157014662/734073650768117760/2Dn3.gif")
.setAuthor(mars.user.tag, mars.user.displayAvatarURL)
.setDescription(` **bot information**
〔 & 〕⇰ 『 perfix bot 』
===================================
〔 play or p 〕⇰ 『 play for song 』
===================================
〔 stop 〕⇰ 『 stop for song 』
===================================
〔 skip 〕⇰ 『 skip for song 』
===================================
〔 volume 〕⇰ 『 volume for song 』
===================================
〔 about 〕⇰ 『 about bot 』
===================================
〔 invite 〕⇰ 『 invite bot to server 』
===================================
**•𝐁𝐘 MARS•**`);
}
can someone tell me why this gives me a erorr
you never told us what the error was
lol
} this gives me a error
we're not robots 😩
i am using glitch.com
bismillah
lmao
huh?
u know js ? @weak crag
CeZo do you know what an error is
Then you should be able to give us the error message & stacktrace
Parsing error: Unexpected Token
Then you have an unexpected } somewhere as you said.
so what should i put
let enabled = db.get(`24/7`, player.guild.id) if(enabled) { return player.playing = false } else { player.destroy() }
This doesnt work
bot stays in the vc
why dead :/
Hi, how can i create an invite to a server using discord.js?
@steel heath someone did that already
hi developnmet
fuck
const {
MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');
module.exports = class extends Command {
constructor(...args) {
super(...args, {
aliases: ['play, p'],
description: 'Play music',
usage: 't!play <song>',
category: 'Music :musical_note:'
});
}
// eslint-disable-next-line
async run(message, args) {
const voiceChannel = message.member.voice.channel;
if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
const permissions = voiceChannel.permissionsFor(message.client.user)
if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!")
try {
var connection = await voiceChannel.join();
} catch (error) {
console.log(`There was an error connecting to the voice channel: ${error}`)
message.channel.send(`There was an error connecting to the voice channel: ${error}`)
}
const dispatcher = connection.play(ytdl(args.join(" ")))
.on('finish', () => {
voiceChannel.leave()
message.channel.send("I left the voice channel cause the music end!")
})
.on('error', error => {
console.log(error);
})
dispatcher.setVolumeLogarithmic(5 / 5)
}
};```
Error: No video id found: never gonna give you up
Hi, how can i create an invite to a server using discord.js?
Still asking...
not a query
so
you need to handle queries in a different way
hmm
by using another package for example
how can i do then?
@viral timber check docs
try using https://www.npmjs.com/package/yt-search
Would be faster
@viral timber, use <GuildChannel>.createInvite: https://discord.js.org/#/docs/main/stable/class/GuildChannel?scrollTo=createInvite
ty
ty
"client.elevation is not a function" anyone can help?

let talkedRecently = new Set();
module.exports = message => {
if (talkedRecently.has(message.author.id)) {
return;
}
talkedRecently.add(message.author.id);
setTimeout(() => {
talkedRecently.delete(message.author.id);
}, 2500);
let client = message.client;
if (message.author.bot) return;
if (!message.content.startsWith(ayarlar.prefix)) return;
let command = message.content.split(' ')[0].slice(ayarlar.prefix.length);
let params = message.content.split(' ').slice(1);
let perms = client.elevation(message);
let cmd;
if (client.commands.has(command)) {
cmd = client.commands.get(command);
} else if (client.aliases.has(command)) {
cmd = client.commands.get(client.aliases.get(command));
}
if (cmd) {
if (perms < cmd.conf.permLevel) return;
cmd.run(client, message, params, perms);
}
};```
is there a way to get the ping with cluster?
ufuG that still doesn't tell me what it's supposed to do.
when i used a command
"client.elevation is not a function" anyone can help?
@plucky plover its not a function...
there is a error like that
try using https://www.npmjs.com/package/yt-search
@pale vessel i do not know how
lmao
Then you need to make one.
how do i get the query?
Either extend the class and add a method called elevation, or create the client instance and add a property called elevation with the value of a function to it.
It's your source code. You'll need to fill in the puzzle pieces.
oki thx
@pale vessel can you help?
ohh cmonnn
const {
MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');
const yts = require('yt-search')
module.exports = class extends Command {
constructor(...args) {
super(...args, {
aliases: ['play, p'],
description: 'Play music',
usage: 't!play <song>',
category: 'Music :musical_note:'
});
}
// eslint-disable-next-line
async run(message) {
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const r = yts(args.join(" "))
const voiceChannel = message.member.voice.channel;
if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
const permissions = voiceChannel.permissionsFor(message.client.user)
if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!")
try {
var connection = await voiceChannel.join();
} catch (error) {
console.log(`There was an error connecting to the voice channel: ${error}`)
message.channel.send(`There was an error connecting to the voice channel: ${error}`)
}
const dispatcher = connection.play(ytdl(r))
.on('finish', () => {
voiceChannel.leave()
message.channel.send("I left the voice channel cause the music end!")
})
.on('error', error => {
console.log(error);
})
dispatcher.setVolumeLogarithmic(5 / 5)
}
};
ReferenceError: args is not defined
What line is the error coming from?
sorry i've made some changes
args came up as undefined
const {
MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');
const yts = require('yt-search')
module.exports = class extends Command {
constructor(...args) {
super(...args, {
aliases: ['play, p'],
description: 'Play music',
usage: 't!play <song>',
category: 'Music :musical_note:'
});
}
// eslint-disable-next-line
async run(message, args) {
const r = yts("superman theme");
const voiceChannel = message.member.voice.channel;
if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
const permissions = voiceChannel.permissionsFor(message.client.user)
if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!")
try {
var connection = await voiceChannel.join();
} catch (error) {
console.log(`There was an error connecting to the voice channel: ${error}`)
message.channel.send(`There was an error connecting to the voice channel: ${error}`)
}
const dispatcher = connection.play(ytdl(r))
.on('finish', () => {
voiceChannel.leave()
message.channel.send("I left the voice channel cause the music end!")
})
.on('error', error => {
console.log(error);
})
dispatcher.setVolumeLogarithmic(5 / 5)
}
};
ReferenceError: args is not defined
6:15
there's no variable named args
did args ever get defined on run
yes
I will define them agan
si you can see its the same
const {
MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');
const yts = require('yt-search')
module.exports = class extends Command {
constructor(...args) {
super(...args, {
aliases: ['play, p'],
description: 'Play music',
usage: 't!play <song>',
category: 'Music :musical_note:'
});
}
// eslint-disable-next-line
async run(message, args) {
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const r = yts("superman theme");
const voiceChannel = message.member.voice.channel;
if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
const permissions = voiceChannel.permissionsFor(message.client.user)
if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!")
try {
var connection = await voiceChannel.join();
} catch (error) {
console.log(`There was an error connecting to the voice channel: ${error}`)
message.channel.send(`There was an error connecting to the voice channel: ${error}`)
}
const dispatcher = connection.play(ytdl(r))
.on('finish', () => {
voiceChannel.leave()
message.channel.send("I left the voice channel cause the music end!")
})
.on('error', error => {
console.log(error);
})
dispatcher.setVolumeLogarithmic(5 / 5)
}
};
Identifier 'args' has already been declared
see?
const {
MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');
const yts = require('yt-search')
module.exports = class extends Command {
constructor(...args) {
super(...args, {
aliases: ['play, p'],
description: 'Play music',
usage: 't!play <song>',
category: 'Music :musical_note:'
});
}
// eslint-disable-next-line
async run(message, args) {
const r = yts("superman theme");
const voiceChannel = message.member.voice.channel;
if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
const permissions = voiceChannel.permissionsFor(message.client.user)
if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!")
try {
var connection = await voiceChannel.join();
} catch (error) {
console.log(`There was an error connecting to the voice channel: ${error}`)
message.channel.send(`There was an error connecting to the voice channel: ${error}`)
}
const dispatcher = connection.play(ytdl(r))
.on('finish', () => {
voiceChannel.leave()
message.channel.send("I left the voice channel cause the music end!")
})
.on('error', error => {
console.log(error);
})
dispatcher.setVolumeLogarithmic(5 / 5)
}
};
dude
so what do i do here?
const args
,X
you have the following
run(something, args) {
const args...
do you see it now
then
ah
let enabled = db.get(`24/7`, player.guild.id) if(enabled) { return player.playing = false } else { player.destroy() }
This doesnt work
bot stays in the vc
need help in setinterval() function
client.on("message", async member => {
setInterval(() => {
const channel = member.guild.channels.cache.find(ch => ch.id === '753657673383149688')
if(!channel) return;;
}, 1000);
})```
👀
cursed code
message event
calls it member
set an interval on every message
😅 trying interval first time
help
const {
MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');
module.exports = class extends Command {
constructor(...args) {
super(...args, {
aliases: ['play, p'],
description: 'Play music',
usage: 't!play <song>',
category: 'Music :musical_note:'
});
}
// eslint-disable-next-line
async run(message, args) {
const voiceChannel = message.member.voice.channel;
if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
const permissions = voiceChannel.permissionsFor(message.client.user)
if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!");
try {
var connection = await voiceChannel.join();
} catch (error) {
console.log(`There was an error connecting to the voice channel: ${error}`);
message.channel.send(`There was an error connecting to the voice channel: ${error}`);
}
const dispatcher = connection.play(ytdl(args[0]))
n('finish', () => {
voiceChannel.leave();
message.channel.send("I left the voice channel cause the music end!")
})
.on('error', error => {
console.log(error);
})
dispatcher.setVolumeLogarithmic(5 / 5);
}
};```
ic\play.js:43
}
SyntaxError: Unexpected end of input
no that's youtube-dl
CMONN
they're entirely different
On GitHub it says youtube-dl was taken down @pale vessel
heyo
bruh
Are you messing with me
yes, it was youtube-dl, not ytdl
@earnest phoenix Take a look at the last line.
has fields with no value
@vale garden using description
OK
you can have more then one desc?
ye
if i remove it
by ending lines
oh lol
It's still the same error
o
breaking lines
}; what could be wrong?
Oh I see
@vale garden use \n to break lines
Hey guys! I need some help sending an embed when an user joins a guild (as greeting) may someone help me? I think its easy but I've been stuck for 30min trying to make it work
I showed it
} not };
show code
What part are you stuck on (when the user joins, sending the embed, etc.)? What library are you using?
const {
MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');
module.exports = class extends Command {
constructor(...args) {
super(...args, {
aliases: ['play, p'],
description: 'Play music',
usage: 't!play <song>',
category: 'Music :musical_note:'
});
}
// eslint-disable-next-line
async run(message, args) {
const voiceChannel = message.member.voice.channel;
if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
const permissions = voiceChannel.permissionsFor(message.client.user)
if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!");
try {
var connection = await voiceChannel.join();
} catch (error) {
console.log(`There was an error connecting to the voice channel: ${error}`);
message.channel.send(`There was an error connecting to the voice channel: ${error}`);
}
const dispatcher = connection.play(ytdl(args[0]))
n('finish', () => {
voiceChannel.leave();
message.channel.send("I left the voice channel cause the music end!")
})
.on('error', error => {
console.log(error);
})
dispatcher.setVolumeLogarithmic(5 / 5);
}
To be exact, i know how to send a message when an user joins, but not an embed
not u
}not};
@earnest phoenix
What library are you using then
@earnest phoenix which line ?
wee
where is taht ?
@earnest phoenix dude you removed }; a few seconds ago, close the class with a } and not a };
@earnest phoenix where is that
can be so difficult
To be honest, since YTDL has been taken down by the US RIAA, I feel like I can't make a music cog anymore, but is there a good GitHub code file for wavelink? I just well, need to use wavelink instead :/
COPY ONLY THAT LINE
const {
MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');
module.exports = class extends Command {
constructor(...args) {
super(...args, {
aliases: ['play, p'],
description: 'Play music',
usage: 't!play <song>',
category: 'Music :musical_note:'
});
}
// eslint-disable-next-line
async run(message, args) {
const voiceChannel = message.member.voice.channel;
if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
const permissions = voiceChannel.permissionsFor(message.client.user)
if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!");
try {
var connection = await voiceChannel.join();
} catch (error) {
console.log(`There was an error connecting to the voice channel: ${error}`);
message.channel.send(`There was an error connecting to the voice channel: ${error}`);
}
const dispatcher = connection.play(ytdl(args[0]))
n('finish', () => {
voiceChannel.leave();
message.channel.send("I left the voice channel cause the music end!")
})
.on('error', error => {
console.log(error);
})
dispatcher.setVolumeLogarithmic(5 / 5);
}
}```
OMG
run(client, message, args)
my brain
kk
@earnest phoenix so ?
show line 46
u kidding meh
add a } before async run()
I'M SO BBAD AT FORMATTING
Show from line 40 to 46
press ctrl + shift + p and then type format document
ok
or ctrl + shift + i
what line is async
constructor(...args) {
super(...args, {
aliases: ['play, p'],
description: 'Play music',
usage: 't!play <song>',
category: 'Music :musical_note:'
});
}---> , <---- // THIS ONE IS IMPORTAIN
// eslint-disable-next-line
async run(message, args) {
19
what was it suppose to be
i assume its a cb from connection.play?
whats wrong with your code, i have no errors when i pasted it into my editor
const Command = require('../../Structures/Command');
const { MessageEmbed } = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');
module.exports = class extends Command {
constructor(...args) {
super(...args, {
aliases: ['play, p'],
description: 'Play music',
usage: 't!play <song>',
category: 'Music :musical_note:',
});
}
// eslint-disable-next-line
async run(message, args) {
const voiceChannel = message.member.voice.channel;
if (!voiceChannel)
return message.channel.send(
'You must be in a voice channel to run this command!'
);
const permissions = voiceChannel.permissionsFor(message.client.user);
if (!permissions.has('CONNECT'))
return message.channel.send(
"I don't have permissions to conenct to the voice channel!"
);
if (!permissions.has('SPEAK'))
return message.channel.send(
"I don't have permission to play the video!"
);
try {
var connection = await voiceChannel.join();
} catch (error) {
console.log(
`There was an error connecting to the voice channel: ${error}`
);
message.channel.send(
`There was an error connecting to the voice channel: ${error}`
);
}
const dispatcher = connection.play(ytdl(args[0]));
dispatcher.on('finish', () => {
voiceChannel.leave();
message.channel.send(
'I left the voice channel cause the music end!'
);
}).on('error', (error) => {
console.log(error);
});
dispatcher.setVolumeLogarithmic(5 / 5);
}
};
besides the nn
n*
@earnest phoenix i think you gotta learn javascript from new
why
cuz u don't even know how brackets works
THEN FIX IT BY UR OWN
TRY TO FIGURE OUT WHY IT HAS ERROR
i have other 100 errors
omg
bro what
@willow mirage chill
lmao
so now
hi
let arr = db.get(`userinfo_${message.author.id}.party`)
let desc = ""
console.log(desc)
let i = 0;
do {
desc =+ db.get(`userinfo_${message.author.id}.party[${i}]`) + "\n"
i++;
}
while (i < arr.length) {
console.log(i)
const embed = new Discord.MessageEmbed()
.setTitle("Your pokémon")
.setDescription(desc)
.setColor("ORANGE")
.setFooter(`Showing 1–20 out of ${arr.length}`)
.setTimestamp()
message.channel.send(embed)
}
here for some reason when i log i im getting 3
even tho arr.length is also 3
plz help
if i do i === (arr.length - 1), i becomes 1 for some reason
and it also becomes 1 when i === arr.length
I don't think that's how do while loops work
why whats wrong
W
@scenic kelp it would seem a random botum has appeared
Opps
@vale garden what's the purpose of the do{} in your code
And does it work?
I'm asking because I'm confused now
Uh I already pinged a mod
Sorry:(
@west crow don't send bot invite links please
if your bot has nsfw features it should be limited to nsfw channels only
I really don't understand why people would use a discord bot for nsfw stuff
mommy blocked pornhub
||vpn||
member.guild.iconURL()
I made a small Fibonacci sequence generator in JS
https://paste.code913.repl.co/paste/uytpyWucZr.html
What do you guys think of this?
member.guild.iconURL()
@earnest phoenix member?
He literally showed that in his code
"Yo man how many numbers?"
@earnest phoenix you should try improving it by using a generator
The hell is that supposed to do, code913
generate Fibonacci sequence numbers within a specified range
also it works in node only
I don't speak "Fibonacci", tf is that
It's a mathematical sequence
The next number is equal to the last two numbers added up
@earnest phoenix member?
@earnest phoenix yes, its a welcomer
I came across it on a repl talk post
how would i for example, take a message i received on one client, and respond on another
but it sends the guild icon instead of the ppl who joins
how would i for example, take a message i received on one client, and respond on another
@earnest phoenix send an http request from one client to the other through a middle server
fun, ty
but it sends the guild icon instead of the ppl who joins
@dreamy thistle member.avatarURL
@dreamy thistle You should use
member.user.displayAvatarURL()
gonna try
So I am trying to create these two teams:
const newTeamScores = new mongoose.Schema({
teamDawn: {Number, default: 0},
teamDusk: {Number, default: 0},
})
module.exports.model = new mongoose.model('teamScores', newTeamScores)
I've written code to get the teams
const teams = await this.model.findOne({ name: 'teamscores' });```
but when I try to save things to it
```js
teams.teamDawn = points
await teams.save()
but it gives me this error
(node:3200) UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'teamDawn' of null
at Client.<anonymous> (C:\Users\djkol\Desktop\testtestbot\index.js:74:19)```
please help :3
:))
what is the difference between module.exports and exports?
honestly i got no clue code913
@dreamy thistle rename member number to member count because it looks better
yeah @earnest phoenix absolutely nothing is different between those two
module is probably a global variable hence i can access exports without putting module.
mhm
@sweet ruin wtf is that bot name
but this is a bot that is all in index.js
its just some random test bot i made
not my main bot obvs xD
but this is a bot that is all in index.js
@sweet ruin
WUTTT
THAT'S ILLEGAL
module is probably a global variable hence i can access exports without putting
module.
@earnest phoenix if i create a global variablexand define it as{exportssss:true}, exportsss would not be defined
globally
@sweet ruin Well that would return that if it didn't find any documents with the name matching teamscores, did you save a document with this property?
well its all in the index file
It's not even related to the index file 
My boy's currency system at the moment is kind of like dank member's currency system but with some changes but I plan on making it a lot different. Would this be reason to reject my bot in top.gg website
wait wut
@rugged cobalt that should be fine, just dont copy it exactly
Log this
let getDocuments = await this.model.find().toArray();
console.log(getDocuments);``` Creepa
Yeah it isn't
Tf
let getDocuments = await this.model.find();
console.log(getDocuments);``` try this maybe
Yea, that's why
You don't have any documents
this.model.insertOne({
teamDawn: <whatever here>
<Other properties>
}) <No need to save>```
but like i already did in the schematic?
That's the Scheme of how the things should be inputed
Not a document
const newTeamScores = new mongoose.Schema({
teamDawn: Object,
teamDusk: Object
});``` this is a correct schema for example
but thats what I did
No, you put the actual object, you have to put the constructors, after that, make a document
:/
Schema:
{
teamDawn: Object,
teamDusk: Object
}```
Document:
```js
teamDawn: {
Number,
default: 0
},
teamDusk: {
Number,
default: 0
}```
If you didn't know, schemas in mongoose are just document templates
Documentation shows you how to create a schema and make instances of it @sweet ruin
@earnest phoenix client.elevation() isnt a thng
this seems copy pasted code, please don't. 
it is
I understand I'll try by deleting
reeeeeeeeeeeee what db should i learn
if (!message.context.startsWith(PREFIX) || message.author.bot) return; const args = message.content.slice(PREFIX.length).trim().split(/ =/); const command = args.shift().toLowerCase();```
@earnest phoenix context -> content.
yes.
reeeeeeeeeeeee what db should i learn
@zenith knoll whichever one is best for your needs
My boy's currency system at the moment is kind of like dank member's currency system but with some changes but I plan on making it a lot different. Would this be reason to reject my bot in top.gg website
@rugged cobalt yourboy's currency system?
uh
also let deletehowmuchiwant = "message.content.slice(Prefix + 6)"
its a string
you dont need deletehowmuchiwant
yea
just do
if(command == "command name" )
is that copy pasted code? because you seem like you dont know what it does yourself
its probably not copy and pasted
Guys, he came here yesterday. Just let him know that he needs to have a foundation knowing javascript before attempting to make a node bot.
no one would ever name a variable deletehowmuchiwant
Well you dont need that, you can just check if the "cmd" var is equal; to the cmd name
no one would ever name a variable
deletehowmuchiwant
@hollow sedge umm i have variables with 20+ character names so
thats not what i was saying
deletehowmuchiwant could be simpler and more descriptive
heres some code if(command == "purge") { let amt = args[0] message.channel.bulkDelete(amt) } if you did my format
prob not but work around it
@earnest phoenix do you know how javascript works?
@earnest phoenix
Please don't ignore all the advice everyone gave you yesterday. This channel is for bot development questions, not basic javascript syntax errors.
if you don't know how to code it probably won't be a good idea to get into bot development so early
It's not that you can't ask for help here, but you've had a pattern of just ignoring the advice you've gotten
https://discordjs.guide/#before-you-begin will help if ur new
This channel is for bot development questions, not basic javascript syntax errors.
@tame kestrel since i asked do many vanilla js relatef questions am i a criminal?
@tame kestrel since i asked do many vanilla js relatef questions am i a criminal?
@earnest phoenix probably pog pog pogu
since i asked do many vanilla js relatef questions am i a criminal?
@earnest phoenix i think its more like when people ask basic questions
i made 2 commands but purges dontwork
@earnest phoenix who taught u it
or did you just guess the code? (no offense, just asking)
yes
i made 2 commands but purges dontwork
@earnest phoenix you do you then, but please don't have the members here code it for you.
like is whoever taught u it a dbot coder that makes sure it worked
you cant copy code or make it similar like that
cause it wont work if u have a diff formatr
format not language
like if he has a channel obj alr defined and you dont it wornt work
i wish js had variable shadowing (not including vars)
hm
i wish js had variable shadowing (not including
vars)
@restive furnace like... different scopes?
well yes
JS does allow same named variables in different scopes
Guys, I've been wondering, is there an efficient way to construct an embed based on a json file? I'm kinda confused, the best i could come up with was making if statements for each of them, makes it unneat. This is about how my json file looked like:
{
"color": [0,0,0],
"title": "",
"url": "",
"author": {
"name": "",
"icon_url": "",
"url": ""
},
"description": "",
"thumbnail": {
"url": ""
},
"fields": [
{
"name": "",
"value": ""
}
],
"image": {
"url": ""
},
"footer": {
"text": "",
"icon_url": ""
}
}
are you saying from json to embed?
Or maybe if I could use the embed constructor as the json file itself?
are you saying from json to embed?
@tame kestrel Yes
Smlt
can't you just take the partial embed data and stick it into the constructor
I've been wondering about that, it doesn't seem to work tho, hang on I'll test in on a local server
does anyone know another nsfw endpoint instead nekos.life?
cuz I use nekos.life for my nsfw command and i see the DBL doesnt allow it.
btw, im use an filtered list to nekos.life
🙂
Try using reddit
does anyone know another nsfw endpoint instead nekos.life?
cuz I use nekos.life for my nsfw command and i see the DBL doesnt allow it.
btw, im use an filtered list to nekos.life
🙂
@coarse oyster If it's limited to NSFW only channels, should be okay, I think?
D:
"dependencies": {
"dblapi.js": "^2.4.0",
"discord.js": "^12.3.1",
"mongoose": "^5.9.26",
"node-fetch": "^2.6.0",
"nodemon": "^2.0.3",
"body-parser": "^1.19.0",
"patreon": "^0.4.1",
"nekos.life": "^2.0.7",
"safe-eval": "^0.4.1",
"akaneko": "^3.3.0",
"neko-love.js": "^1.0.4"
}
Lel
Idk
@rugged cobalt your
boy's currency system?
@earnest phoenix I meant bot, I was typing on my really small phone keyboard
neko-love is good?
@coarse oyster AkaNeko is better I think
Say farewell to this server my bot lmao
@coarse oyster AkaNeko is better I think
@neat harness ill try to add AkaNeko.
Kk
nekos.life is banned on top.gg
@tame kestrel btw SFW nekos.life is banned too?
like hug, kiss etc
@tame kestrel btw SFW nekos.life is banned too?
@coarse oyster Especially that
like nekos life, in all is banned. I think it's cause the sfw endpoints still show heavy ecchi and even nsfw photos
lol, thats sad...
Yeah f for my bot gettinng rejected twice bcz of Nekos.Life
I mean it lives in another bot listing site
@neat harness same
Im using nekos life in sfw and nsfw commands, lol
weeb.sh needs a fucking key to use.
ode:12568) UnhandledPromiseRejectionWarning: TypeError: "channel".bulkDelete is not a function
@earnest phoenix Probaably misdefined channel
try await msg.channel.bulkDelete(messages, true);
You need to check that the channel property is a channel property
in messages fetch the limit
Just use message.channel.bulkDelete()
@neat harness did you use only discord.js?
Yes
Im using nekos life in sfw and nsfw commands, lol
@coarse oyster 60% of my bot's commands are NSFW lmao
Hmm
Thats what im doing
@earnest phoenix Wait, srsly, lemme check docs for a sec
its an good endpoint i guess
Kk
have an good hentai list too
Thats what im doing
@earnest phoenix Check https://github.com/discordjs/discord.js/issues/4731
See if that fixes it
like nekos life, in all is banned. I think it's cause the sfw endpoints still show heavy ecchi and even nsfw photos
@tame kestrel what about nekos.moe
TypeError [MESSAGE_BULK_DELETE_TYPE]: The messages must be an Array, Collection, or number.
@earnest phoenix Hmm... did you add how many messages to delete from what was fetched, e.g. 6?
Kk
Np
I'm getting trashed by MongoDB
ValidationError: exp: Cast to Number failed for value "NaN" at path "exp", coins: Cast to Number failed for value "NaN" at path "coins"
Oh, nice!
Is there anyway i can sync the file requirements? So like it waits until module 1 is done and than executes the module2.
Is there anyway i can sync the file requirements? So like it waits until module 1 is done and than executes the module2.
@earnest phoenix Async/Await?
Hey so how do I make it so it does e!purge 1 or e!purge 2?
@earnest phoenix Wdym?
@earnest phoenix Async/Await?
@neat harness I take that back it doesn't work before load I think
Maybe you'll have to require it after the client is ready?
I'm not quite sure
no i have like auto mod and i want to require different files(modules)
but i need them to go one by one
not all instantly
Hmm, sorry I can't help you @earnest phoenix
k
Unknown message means it didn't find the message by the id 770009066448879637 in the channel 741335432750694532 @earnest phoenix
I'm not sure of what's the cause though
No offense, I don't understand a single thing in that ss
I mean, I got confused
args.shift().toLowerCase() => args.shift().join(" ").toLowerCase()
uh strings check deletehowmuchiwant variable again
I'm still mourning on this, someone help?
betterdiscord detected
lmao
ban
betterdiscord detected
@restive furnace I had to CSS it
you don't have to
What is let deletehowmuchiwant for?
I don't do videos
And JS is just some ez logic
nice. I didnt know discord.js is a js guide
lol
nice. I didnt know discord.js is a js guide
@tired nimbus I was talking about the discord.js guide not js
Who needs a guide for JS lmao
he asked for js
why are you giving a discord.js guide
There
how do i do like that it checks if channel is nsfw so yes send an immage so no say 'this is a sfw chan goto a nsfw chan' dont ask me why tho
oh lol
@earnest phoenix so ur making thre cmd called "Message.content.slice"?
how do i do like that it checks if channel is nsfw so yes send an immage so no say 'this is a sfw chan goto a nsfw chan' dont ask me why tho
@quiet archmessage.channel.nsfwreturns true if it is, and false if it isn't
The docs are so easy but no one cares
that should be the first thing they use or learn
that should be the first thing they use or learn
@tired nimbus True
else if (command = 'pp') {
if (message.channel.nsfw) {
let pp = new Discord.MessageAttachment('./pepepp.jpg')
message.channel.send('lick lick *suck*')
message.channel.send(pp)
} else {
message.channel.send('no this is not a nsfw channel u dumb fugcc goto [#741679617374552114](/guild/264445053596991498/channel/741679617374552114/) ||else i wont lick my dick for u|| ')```
> @quiet arch `message.channel.nsfw` returns true if it is, and false if it isn't
@neat harness but how bc this gives me a typing err
yessssssssssssssssssssssss
ye
it is
its just a pic of a pepe licking his pepe dont worrie
Uhh yeah that above
@zenith knoll so like I said my friend was helping and he said to put that
@earnest phoenix I think it's absurd, but I won't judge
oh shoot wrng link
i don't think you want to use message.content.slice as the command
Btw, you're not even using it
*properly
and what does
message.content.slicedo?
@earnest phoenix as a string, it's a string
as a property, it slices and is a function message.content.slice()
so that piece of code is useless?
@earnest phoenix Not exactly, but could be way better
so like this is my err
(node:80060) UnhandledPromiseRejectionWarning: TypeError: Assignment to constant variable.
at Client.<anonymous> (D:\github\pepe-bot\index.js:98:23)
at Client.emit (events.js:314:20)
at MessageCreateAction.handle (D:\github\pepe-bot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (D:\github\pepe-bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (D:\github\pepe-bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (D:\github\pepe-bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (D:\github\pepe-bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (D:\github\pepe-bot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:314:20)
at Receiver.receiverOnMessage (D:\github\pepe-bot\node_modules\ws\lib\websocket.js:797:20)
(node:80060) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:80060) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
and this my code
}else if (command = 'pp') {
if (message.channel.nsfw) {
let pp = new Discord.MessageAttachment('./pepepp.jpg')
message.channel.send('lick lick *suck*')
message.channel.send(pp)
} else {
message.channel.send('no this is not a nsfw channel u dumb fugcc goto [#741679617374552114](/guild/264445053596991498/channel/741679617374552114/) ||else i wont lick my dick for u|| ')
}```
so you assigned to a constant
Xetera is typing...
what are you typing so long




