#development
1 messages · Page 991 of 1
then you dont need to repeat it
ok'
i got that
client.on('message',message =>{
var mmbr = mons[message.author.id]
(mons = require("./mons.json"))
let args = message.content.substring(prefix.length).split(" ")
let _command = message.content.toLowerCase()
if (!_command.startsWith(prefix)) return```
for there
do you know how to get the ID of the user currently typing with typingStart?
Why json?
@long yew dude what, you're not supposed to literally write (mons = ....)
well when they write .start [pokemon name] it records their id and pokemon chosen in mons.json
i was just saying that your mons file needs to be required in your main file
ok
usually you require the file in the top of the file, before any other code
ok
const mons = require("./mons.json");```
does that do the same as js mons = require("./mons.json");?
no
because in the first you actually define the variable
in the second you are just trying to change a variable that aint existing
:c
remove the mons = require("./mons.json")
is the path in your first one correct?
or else you get an error
ok
only keep the first one
no
it does that
that doesn't say about json
its not for you @long yew
oh ok
ty
let target = msg.mentions.users.first() //only triggered if there is args[1]
let tar0 = loadImage(msg.author.displayAvatarURL({ dynamic: true, size: 2048, format: 'png' }))
let tar1 = loadImage(target.displayAvatarURL({ dynamic: true, size: 2048, format: 'png' }))
const myimg0 = await loadImage(tar0)
const myimg1 = await loadImage(tar1)
if (args[1] = target) {
//invert the target avatar here
} else {
//invert the author's avatar
}
help please
what is your issue?
i have a case of not-know-what-to-do itis
you have a syntax error
:o
you made an assignment instead of a comparison
good idea
yup
you didn't even make a canvas
ok canvas has been made
get the context
done
what size did you set it to?
2048 x 2048
is the avatar the same size?
yeah
add the image to the canvas
drawImage()
make sure you set the width and height to 2048 too since the avatar can be small if no higher resolution available
doing that resizes it no matter what the dimensions are
so drawImage(image, 0, 0, 2048, 2048) iirc
Okay, so I have this sql stmt to createa a table based on the guild id:
"CREATE TABLE IF NOT EXISTS '"+GuildId+"' (case_number int IDENTITY(0,1) PRIMARY KEY, UserId TEXT, reason TEXT, executor TEXT, punishment_type TEXT, date TEXT)";
the concats are in java
And the table, when data is inserted is as follows:
Case Number | Name | Moderator | Punishment Type | Date | Reason
0 | Zoþ | Zoþ | warn | Thu Jun 25 07:04:03 EDT 2020 | spam
0 | Zoþ | Zoþ | warn | Thu Jun 25 07:04:24 EDT 2020 | spam
My question is, why isnt the "Case Number" column, starting at one and adding up?
I did try IDENTITY(1,1) And this is for sql.
AUTO_INCREMENT is probably the thing you look for
#topgg-api <----help here
(node:10876) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'displayAvatarURL' of undefined
@lusty quest
org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (near "AUTO_INCREMENT": syntax error)```
iirc thats for mysql, not sql
It throws the error above. Im gonna try INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL
Someone one stack overflow is having the somewhat same error
this looks good.
more infos?
wdym
it can be everything with this error
context etc
const Discord = require(`discord.js`)
const ytdl = require('ytdl-core');
module.exports.run = async(bot, msg, args) => {
voiceChannel = msg.member.voice.channel;
if(!voiceChannel)
return msg.channel.send("You are not in a voice channel");
const permissions = voiceChannel.permissionsFor(msg.client.user);
if(!permissions.has('CONNECT'))
return msg.channel.send("You don't have the right permissions");
if(!permissions.has('SPEAK'))
return msg.channel.send("You don't have the right permissions to speak");
let validate = await ytdl.validateURL(args[0]);
if(!validate)
return msg.channel.send("Enter a valid youtube url please!");
let info = await ytdl.getInfo(args[0]);
let data = ops.active.get(msg.guild.id) || {};
if(!data.connection)
data.connection = await msg.member.voice.channel.join();
if(!data.queue)
data.queue = [];
data.guildID = msg.guild.id;
data.queue.push({
songTitle: info.title,
requester: msg.author.tag,
url: args[0],
announceChannel: msg.channel.id
});
if(!data.dispatcher) play(client, ops, data);
else
msg.channel.send(`Added to queue: **${info.title}** | requested by **${msg.author.username}**`);
ops.active.set(msg.guild.id, data);
}
async function play(client, ops, data){
data.dispatcher = await data.connection.play(ytdl(data.queue[0].url, {filter: 'audioonly'}));
data.dispatcher.guildID = data.guildID;
data.dispatcher.once('end', function(){
finish(client, ops, this);
});
}
function finish(client, ops, dispatcher){
let fetched = ops.active.get(dispatcher.guildID);
fetched.queue.shift();
if(fetched.queue.length > 0){
ops.active.set(dispatcher.guildID, fetched);
play(client, ops, fetched);
}
else{
ops.active.delete(dispatcher.guildID);
let vc = client.guilds.get(dispatcher.guildID).me.voiceChannel;
if(vc) vc.leave();
}
}
so what do i have to do
Anyone good with sharding here i have 1 question
Like @digital ibex said, handle your errors
You have a promise that got reject but it isn't being handled
i was talking to you LOL
Like @digital ibex said, handle your errors
@tulip ledge how can i do that
I didn't say that to you
But it was the right advice 🤷♂️
@vivid ravine like I already said: "You have a promise that got rejected but it isn't being handled"
now its not
?
@vivid ravine like I already said: "You have a promise that got rejected but it isn't being handled"
@tulip ledge so how can i fix that
Since when does const con = require('./index.js').con; execute a whole file?
index.js (only module.exports):
module.exports = { con };```
con is a mysql pool
if you have the module.exports, thats what you're doing, right?
then its because of the module.exports?
in a previous version of my own bot, I did module.exports = { client }; in my index.js file and used that in my commands by using const client = require('../index.js').client;, without the index.js getting executed again
I don't get why it doesn't work now
it doesn't execute the file?
that didn't, but now it does with the code in my first message
im confused, what do u need help with lol
yes I'm also confused
I want to know why this (https://discordapp.com/channels/264445053596991498/272764566411149314/725677741504069662) works but this (https://discordapp.com/channels/264445053596991498/272764566411149314/725677288095744002) doesn't
so it used to not work, and now it works?
oh
well, the issue isn't coming from code provided, what is client and con like the definitions
client was my Discord Client, con is a mysql pool
but if I do module.exports = { hi: 'hi' }; and require that using require('./index.js').hi; it also executes the file again
but what is the code
index.js is the sharding starting file and the other one is the bot file
I will compact it and send the piece of *
you're requiring index.js from shard.js?
no requiring a mysql pool from the sharding file, which is called index.js
but still, form the shard file right ?
each shard runs in a separate process
but that is a file in some way lol
each separate process has no knowledge of index.js
shard.js is its starting point
so requiring index.js will indeed execute the entire file
🤔
but the module.exports part is executed before manager.spawn()
but you're still saying that doesn't work?
not sure tbh, but i think the entire file will be executed regardless
each separate process has no knowledge of index.js
@quartz kindle ohhh you're saying their nodejs process is starting where their shard gets launched, so they don't know about the module.exports line in the sharding file?
that makes sense tho
they dont know about index.js at all
so when you require(index.js) its the same as requiring any other file for the first time
and the first time you require a file, its contents are evaluated before its cached
Can someone help me, i have a warn command which was working fine but out of nowhere this error popped up how do i fix it??
@lusty spade the error is coming from the mute file
yeah it's not the same file
oops i copied the wrong error but both of the file has the same problem
but show the file where the error is
at Object.run (C:\Users\ngzhu\OneDrive\Projects\DiscordBots\Mod-Bot\commands\moderation\strike.js:68:12)1```
so we can see the line
ok line 68
logs is a channel id?
I guess the channel is deleted
const logs = db.fetch(`logchannel_${message.guild.id}`); const channel = message.guild.channels.cache.get(logs);
either there is not logs channel or the logs channel doesnt exist / was not found
hmm ok i'll look into it
oh nvm i fixed it
Hi, How can i get all data from enmap database? I wanna do level leaderboard. Does anybody know, please?
im stupid i changed the name of the save
@rustic sundial If there is a way in enmap to select everything and order by descending do that, else loop through all enmap entries and order them by value
and how? 😄
in short: docs
check their docs for documentation for help, and then you might can do it instead of asking everyone (https://tryitands.ee). thank you
I checked.
const Discord = require('discord.js');
const ms = require('ms')
const db = require('quick.db')
module.exports.run = async (client, message, args) => {
let servidor = (message.guild.name)
if(!message.member.hasPermission("MANAGE_ROLES")) return message.reply("Você não pode usar esse comando.")
let member = message.mentions.members.first();
if (!member){return message.reply('Lembre de mencionar a pessoa que deseja punir!')}
if (member== message.member) return message.reply('vc nao pode punir vc mesmo.')
if(!member.bannable) return message.channel.send('sem permissão para punir o usuario!')
let role = message.guild.roles.cache.get(db.get(`rolemute_${message.guild.id}`))
if(!role) return message.reply(`desculpe mais parece que não tem um cargo de mute definido no ${servidor}`)
message.channel.send(`opa, vc realmente deseja punir esse usuario?`).then(msg => {
msg.react(":thumbsup:")
let filtro = (reaction, usuario) => reaction.emoji.name === ":thumbsup:" && usuario.id === message.author.id;
let coletor = msg.createReactionCollector(filtro, {max: 1})
coletor.on("collect", cp => {
cp.remove(message.author.id);
msg.delete()
let MuteTime = args[1]
if(!MuteTime) return message.channel.send(`Você não inseriu um tempo para silenciar ousuário!`)
member.roles.add(role)
message.channel.send(`O usuário foi silenciado por ${MuteTime} !`)
setTimeout(function() {
member.roles.remove(role)
message.channel.send(`acabou o silencio, o(a) ${member} voltou a falar ficou ${MuteTime} mutado!`)
}, ms(MuteTime))
}
)}
)}
what is wrong?
why would their documentation document javascript?
quick question, even if the answer would be obvious. does the guild member update event triggers if a user is updated or is there another event for user update?
only triggers when someone in the server updates themeselves, ie change their nickanme, username etc
ok
you need to know 3 things for what you want to do
what freestyle sent you, + what i previously told you
tf am i missing????
const canvasInvert = createCanvas(2048, 2048)
const contxt = canvasInvert.getContext('2d')
const uuser = msg.mentions.users.first() || msg.author;
let target = loadImage(uuser.displayAvatarURL({ dynamic: true, size: 2048, format: 'png' }))
const myimg = await loadImage(target)
contxt.drawImage(myimg, 0,0,2048,2048)
let sendd = canvasInvert.toBuffer()
msg.channel.send(sendd)
client.guilds.cache.get().memberCount will get you the member count of a guild you want. Loop this for all guilds you have
Thats your total users
for servers its more simple, just use client.guilds.cache.size @cobalt spruce
the user cache for client is bad cuz it only takes into account online users, so avoid using that
you can't just send the buffer
a
attach it as a file first [@pure lion]
ok
can someone help me with regex 
what i have: /(?!({{)){the}(?!(}}))/g
what i want it to do: match {the} , but not if it says {{the}}
can someone help me?
switch (args[0]) {
case 'start':mmbr
if (mmbr[0]) {
return message.channel.send('You can\'t change your starter.')
} else {
if (!args[1]) {
return message.channel.send(startEmbed)
} else if (args[1] === `sobble`) {
mons[`${message.author.id}`] = [`sobble`]
fs.writeFile('./mons.json', JSON.stringify(mons, null, 1), err => { if (err) console.log(err)})
return message.channel.send(sobbleEmbed)
} else if (args[1] === `scorbunny`) {
mons[`${message.author.id}`] = [`scorbunny`]
fs.writeFile('./mons.json', JSON.stringify(mons, null, 1), err => { if (err) console.log(err)})
return message.channel.send(scorbunnyEmbed)
} else if (args[1] === `grookey`) {
mons[`${message.author.id}`] = [`grookey`]
fs.writeFile('./mons.json', JSON.stringify(mons, null, 1), err => { if (err) console.log(err)})
return message.channel.send(grookeyEmbed)
} else {
return message.channel.send('This is an invalid Pokémon.')
}
i think the code is arranged wrong
because
if someone writes .start with no pokemon
it makes an error
but if they have a pokemon and write .start it says that they can't change their starter
help me ```js
var myHeaders = new Headers();
myHeaders.append("token");
myHeaders.append("Content-Type", "application/json");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: JSON.stringify({"server_count": bot.guilds.cache.size})
};
fetch(`https://cyclone-botlist.herokuapp.com/api/auth/stats/${bot.user.id}`, requestOptions) // Make sure you include the domain
.then(response => response.text())
.then(console.log)
.catch(console.error);
Headers not defined
you have an extra { and } in ur regex
@spare goblet what exactly are you trying to capture?
version 12
who can help me?
@opal plank
help me
but if it says {{the}}, i dont wnat it ot match
define it
how can i compare 2 member roles to see what roles they dont have in common?
Header
@opal plank
its shows its defined
aight, sec
I dont want it to match if it says {{the}}
jasjajajajajajajajajjajajajajajajajajajaj
this might be a better approach @spare goblet
exclude if theres another { before {the}
@opal plank am dumb it wont work
here is the script i use to make it just saying Ahx moderating servers
const canvasInvert = createCanvas(2048, 2048)
const contxt = canvasInvert.getContext('2d')
const uuser = msg.mentions.users.first() || msg.author;
let target = loadImage(uuser.displayAvatarURL({ dynamic: true, size: 2048, format: 'png' }))
const myimg = await loadImage(target)
contxt.drawImage(myimg, 0,0,2048,2048)
let forfuckssakeworkplease = new Discord.MessageAttachment(
canvasInvert.toBuffer(), name = 'fuck.png'
)
msg.channel.send(forfuckssakeworkplease)
WHAT NOW????????????????????????????????????????????????????????
name =
/[^{]({the})/g @spare goblet
@earnest phoenix
bot.on('ready', () =>{
console.log('This bot is On')
bot.user.setActivity(Ahx Moderating Servers🛰️ , {type: 'PLAYING'}).catch(console.error);
});
what i add
*windows log-off noise*
${client.guilds.cache.size}
@earnest phoenix
bot.on('ready', () =>{
console.log('This bot is On')
bot.user.setActivity(Ahx Moderating Servers🛰️ | ${client.guilds.cache.size} , {type: 'PLAYING'}).catch(console.error);
});
yeah, use template literals
@opal plank don't think she meant the literally
@cobalt spruce
bot.on('ready', () =>{
console.log('This bot is On')
bot.user.setActivity(`Ahx Moderating Servers🛰️ | ${client.guilds.cache.size}` , {type: 'PLAYING'}).catch(console.error);
});```
jsjsjsjsjsjsjsjsjsjsjsjs
im just going by the question ```what i want it to do: match {the} , but not if it says {{the}}
the regex provided will match it on the capture group
@earnest phoenix not working
@cobalt spruce error?
@_@
what
heroku?
can someone help me?
switch (args[0]) {
case 'start':mmbr
if (mmbr[0]) {
return message.channel.send('You can\'t change your starter.')
} else {
if (!args[1]) {
return message.channel.send(startEmbed)
} else if (args[1] === `sobble`) {
mons[`${message.author.id}`] = [`sobble`]
fs.writeFile('./mons.json', JSON.stringify(mons, null, 1), err => { if (err) console.log(err)})
return message.channel.send(sobbleEmbed)
} else if (args[1] === `scorbunny`) {
mons[`${message.author.id}`] = [`scorbunny`]
fs.writeFile('./mons.json', JSON.stringify(mons, null, 1), err => { if (err) console.log(err)})
return message.channel.send(scorbunnyEmbed)
} else if (args[1] === `grookey`) {
mons[`${message.author.id}`] = [`grookey`]
fs.writeFile('./mons.json', JSON.stringify(mons, null, 1), err => { if (err) console.log(err)})
return message.channel.send(grookeyEmbed)
} else {
return message.channel.send('This is an invalid Pokémon.')
}```i think the code is arranged wrong
because
if someone writes .start with no pokemon
it makes an error
but if they have a pokemon and write .start it says that they can't change their starter
then wait 5 mins
*loudly dying*
@cobalt spruce wait 5 min
@earnest phoenix it dont take that much of time as i tested in
which version of discord.js you use
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@long yew its because there is no value in mmbr to check
when someone writes .start, log their member id to your db
@pure lion what about if they write .start grookey? or a pokemon?
@long yew take it one step at a time
@cobalt spruce which discord.js verison u use
v12
@earnest phoenix im here llol
post your error and code here
(node:22776) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'highest' of undefined
at Object.run (/app/commands/userinfo.js:20:39)
at Client.<anonymous> (/app/Index.js:156:11)
at processTicksAndRejections (internal/process/task_queues.js:88:5)
(node:22776) 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(). (rejection id: 1)
(node:22776) [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.
sourcebin
const Discord = require("discord.js");
const moment = require("moment");
module.exports = {
name: "userinfo",
aliases: ["ui"],
run: async (bot, message, args) => {
const user =
message.mentions.users.first() || message.author
let userinfo = {};
userinfo.avatar = user.displayAvatarURL({ dynamic: true });
userinfo.name = user.username;
userinfo.discrim = `#${user.discriminator}`;
userinfo.id = user.id;
userinfo.status = user.presence.status;
userinfo.joined = moment
.utc(message.guild.members.cache.get(user.id).joinedAt)
.format("dddd, MMMM Do, YYYY");
userinfo.highestrole = user.roles.highest;
userinfo.nickname = user.nickname || "No Nickname";
const embed = new Discord.MessageEmbed()
.setAuthor(
`${user.username}'s Info!`,
user.displayAvatarURL({ dynamic: true })
)
.setColor("RANDOM")
.addField("Username", userinfo.name, true)
.addField("#", userinfo.discrim, true)
.addField("ID", userinfo.id, true)
.addField("Status", userinfo.status, true)
.addField("Date Joined Server", userinfo.joined, true)
.addField("Nickname", userinfo.nickname, true)
.addField("Highest Role", userinfo.highestrole, true)
.setTimestamp()
.setThumbnail(userinfo.avatar);
console.log(`Someone checked ${userinfo.name}s info!`);
message.channel.send(embed);
}
};
or that
@earnest phoenix
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
not sure mentions work like that
wdym
dont think mentions return a user object
can someone help me with canvas
const canvasInvert = createCanvas(2048, 2048)
const contxt = canvasInvert.getContext('2d')
const uuser = msg.mentions.users.first() || msg.author;
let target = loadImage(uuser.displayAvatarURL({ dynamic: true, size: 2048, format: 'png' }))
const myimg = await loadImage(target)
contxt.drawImage(myimg, 0,0,2048,2048)
let forfuckssakeworkplease = new Discord.MessageAttachment(
canvasInvert.toBuffer(), name = 'fuck.png'
)
msg.channel.send(forfuckssakeworkplease)
it doesnt log an error or send anything please h el p its been 2 days
dont think mentions return a user object
@opal plank they do
would it be user.user?
it's already a user
@pure lion why are you doing name =, just put the name
so you can fetch it
why are you doing
name =, just put the name
idk why am i puttingname =
because it's a user
you can only get it by a member property
indeed
uh so how about make it members.first() and go from there
you can use member.user for user
can someone help me?
switch (args[0]) {
case 'start':mmbr
if (mmbr[0]) {
return message.channel.send('You can\'t change your starter.')
} else {
if (!args[1]) {
return message.channel.send(startEmbed)
} else if (args[1] === `sobble`) {
mons[`${message.author.id}`] = [`sobble`]
fs.writeFile('./mons.json', JSON.stringify(mons, null, 1), err => { if (err) console.log(err)})
return message.channel.send(sobbleEmbed)
} else if (args[1] === `scorbunny`) {
mons[`${message.author.id}`] = [`scorbunny`]
fs.writeFile('./mons.json', JSON.stringify(mons, null, 1), err => { if (err) console.log(err)})
return message.channel.send(scorbunnyEmbed)
} else if (args[1] === `grookey`) {
mons[`${message.author.id}`] = [`grookey`]
fs.writeFile('./mons.json', JSON.stringify(mons, null, 1), err => { if (err) console.log(err)})
return message.channel.send(grookeyEmbed)
} else {
return message.channel.send('This is an invalid Pokémon.')
}```i think the code is arranged wrong
because
if someone writes .start with no pokemon
it makes an error
but if they have a pokemon and write .start it says that they can't change their starter
could make both use ID instead, then turn the id into obj
Uhm can someone help me?
so how tf can i get their avatar
client.users.cache.get(id)
if (!message.content.startsWith(prefix) || message.author.bot) return; if(message.content === `${prefix}nodelprotocol-on`) { client.on('messageDelete', message => { if (!message.partial) { const channel = message.channel; const delEmbed = new Discord.MessageEmbed() .setColor('#ff0000') .setAuthor(`${message.author.tag}`, `${message.author.avatarURL({ dynamic: true })}`) .setDescription(message.content) .setTimestamp() channel.send(delEmbed); } }); if (message.content === `${prefix}nodelprotocol-off`) {
client.on('end', () => {
message.reply('No
Delete Protocol Deactivated');
you would only need their member object and then you can access everything else
I want to turn off the event emitter
then your client won't work
That's only the part of the code btw
let tempt = message.author.id || message.mentions.users.first()
let user = client.users.cache.get(tempt)
@earnest phoenix
The only part that I want to disable after a command
uh ok
that if you have them in shared servers
whoever is good at js and json dm me i need help with it, it will be quick
if not you'll need to manually send a request to discord api
i'd recommend axios if so
@pale vessel nothing at all-
just js let member = message.mentions.members.first() || message.member; let user = member.user;
de-ui
that could work too
well yeah
but it'll get the same problem, if not in shared server
so you can access member and user
i usually add handler for when thats not avaliable to send api request
i wouldn't have a reason to do that
what would be the reason to get a user that isn't in the server?
de.ui
de-ui
(node:23428) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'highest' of undefined
at Object.run (/app/commands/userinfo.js:20:39)
at Client.<anonymous> (/app/Index.js:156:11)
at processTicksAndRejections (internal/process/task_queues.js:88:5)
(node:23428) 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(). (rejection id: 1)
(node:23428) [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.
i only do that for my tag command
de-ui @earnest phoenix
dunno why, but i did add it
quite useful for fetching data about people you have shared servers with but the bot isnt in
i got an erro
(node:23428) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'highest' of undefined
at Object.run (/app/commands/userinfo.js:20:39)
at Client.<anonymous> (/app/Index.js:156:11)
at processTicksAndRejections (internal/process/task_queues.js:88:5)
(node:23428) 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(). (rejection id: 1)
(node:23428) [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.
give me an example of a command that needs that
Is there a way to get guilds equally divided over shards? (for testing)
i did use it a white ago
anyway, refine your user info command
get mentioned members instead
you can get their user property too
tf?
isn't that privacy breach
no, user info is publically fetchable
Its on your account
whoever is good at js and json dm me i need help with it, it will be quick
Just ask here
https://discord.com/developers/docs/resources/user @pale vessel documented and open accessible, no reason it'd be privacy breach
de-ui
through a bot, yes
so
but users can't do that unless they're in the guild too
case 'start':mmbr
if (mmbr[0]) {
return message.channel.send('You can\'t change your starter.')
} else {
if (!args[1]) {
return message.channel.send(startEmbed)
} else if (args[1] === `sobble`) {
mons[`${message.author.id}`] = [`sobble`]
fs.writeFile('./mons.json', JSON.stringify(mons, null, 1), err => { if (err) console.log(err)})
return message.channel.send(sobbleEmbed)
} else if (args[1] === `scorbunny`) {
mons[`${message.author.id}`] = [`scorbunny`]
fs.writeFile('./mons.json', JSON.stringify(mons, null, 1), err => { if (err) console.log(err)})
return message.channel.send(scorbunnyEmbed)
} else if (args[1] === `grookey`) {
mons[`${message.author.id}`] = [`grookey`]
fs.writeFile('./mons.json', JSON.stringify(mons, null, 1), err => { if (err) console.log(err)})
return message.channel.send(grookeyEmbed)
} else {
return message.channel.send('This is an invalid Pokémon.')
}
why would i make a bot user?
that logs the pokemon chose
should i just remake my whole ui cmd? and then start asking wuestions and that
not quite, thats info that can be accessed thru normal means
how do i make a command that shows the pokemon logged for the user in the json file?
the bot is the medium
but the user doesn't have the right to view it?
discord makes your info publically avaliable
i guess
can anyone help?
@long yew your start command logs the pokemon?
Shouldn't it just be used to choose a starter?
const Discord = require("discord.js");
const moment = require("moment");
module.exports = {
name: "userinfo",
aliases: ["ui"],
run: async (bot, message, args) => {
let tempt = message.author.id || message.mentions.users.first();
let user = bot.users.cache.get(tempt);
let userinfo = {};
userinfo.joined = moment
.utc(message.guild.members.cache.get(user.id).joinedAt)
.format("dddd, MMMM Do, YYYY");
const embed = new Discord.MessageEmbed()
console.log(`Someone checked ${userinfo.name}s info!`);
message.channel.send(embed);
}
};
``` ok im remaking the whole cmd so where do i start lol?
@solemn latch it does log them
i want a command that will show the pokemon logged for the user
also they are unnecessary
@opal plank #development message
mons[`${message.author.id}`] = [`grookey`]
``` firstly why not just change `'grookey'` to args[1]
also dont use backticks if you aren't using template literallys
@earnest phoenix log user right after
ok
do console.log(user) right after that
@short siren idk how
now what
run the command
i just changed it for you?
k
` is a back tick use ' or "
then show me the console you get for that
backticks are only for template literals
de-ui
?
User {
id: '669206927879962626',
bot: false,
username: 'Derku',
discriminator: '1507',
avatar: 'a_4db3da8fd285b4fb2d8fefa167c0e9e3',
flags: UserFlags { bitfield: 128 },
lastMessageID: '725697651290669097',
lastMessageChannelID: '272764566411149314'
}
oh, my bad, thats user not member
@opal plank
try with what flaze said, it'll work the same but in your case, easier
?
i actually want to see a policy statement that infers that the PUBLICALLY ACESSIBLE data isnt allowed to be fetched by the user
even though the api grants anyone access to that info
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
User accessible data?
try with what flaze said, it'll work the same but in your case, easier
@opal plank wdym
@earnest phoenix #development message

now try it
the code wont run, t says it requires a , but if i put the , then it says "explanation or declaration needed"
de-ui
same role error?
de-ui
@earnest phoenix why u trying in here,lol
User {
id: '669206927879962626',
bot: false,
username: 'Derku',
discriminator: '1507',
avatar: 'a_4db3da8fd285b4fb2d8fefa167c0e9e3',
flags: UserFlags { bitfield: 128 },
lastMessageID: '725698620417900605',
lastMessageChannelID: '272764566411149314'
}
it logs that
its the same, its not a member, thats a user object
you need a guild.member to be able to access the role
case 'start':
if (mmbr[0]) return message.channel.send('You can\'t change your starter.')''
if (!args[1]) return message.channel.send(startEmbed)
mons[message.author.id] = [args[1]]
fs.writeFile('./mons.json', JSON.stringify(mons, null, 1), err => { if (err) console.log(err)})
message.channel.send(sobbleEmbed)
break;``` @long yew something like that. Might want to change the way you send the embed tho if its just a different description for each embed change the description on each embed
yeah, which should return this
let member = message.mentions.members.first() || message.member;
let user = member.user;
What are you trying to achieve
im remaking my user info cmd
message.mentions.users.first().tag
Vx_userinfo
Something like that
Commands won't work here
member obj, not user
#commands message like that
message.member should return that
*crying*
user: User {
id: '669206927879962626',
bot: false,
username: 'Derku',
discriminator: '1507',
avatar: 'a_4db3da8fd285b4fb2d8fefa167c0e9e3',
flags: UserFlags { bitfield: 128 },
lastMessageID: '725699467529158677',
lastMessageChannelID: '265156286406983680'
},
joinedTimestamp: 1588157612409,
lastMessageID: '725699467529158677',
lastMessageChannelID: '265156286406983680',
premiumSinceTimestamp: null,
deleted: false,
_roles: [ '265125253443878912' ],
nickname: 'Derku'
}
it logs that
As a guild member but if you want as a user, message.mentions.users.first()
message.member.roles <= thats where you can find the roles property
^^
many ppl get that wrong and idk why
it logs
user: User {
id: '669206927879962626',
bot: false,
username: 'Derku',
discriminator: '1507',
avatar: 'a_4db3da8fd285b4fb2d8fefa167c0e9e3',
flags: UserFlags { bitfield: 128 },
lastMessageID: '725699467529158677',
lastMessageChannelID: '265156286406983680'
},
joinedTimestamp: 1588157612409,
lastMessageID: '725699467529158677',
lastMessageChannelID: '265156286406983680',
premiumSinceTimestamp: null,
deleted: false,
_roles: [ '265125253443878912' ],
nickname: 'Derku'
}
that last log you got is correct
still an user
Yeah true
ok so uhh now what
it has a roles property you can access
ok
Thank God Mr. Tim is here
message.author // User
message.member // Member
message.author.username // works
message.author.roles // doesnt work
message.member.username // doesnt work
message.member.roles // works
ok
member.username 😎
message.member.roles <= thats where you can find the roles property
@opal plank
so uh what do i do
message.author.username
now
if you used the method i gave, it's easy as user.username
k
you just need to understand the differences between User and Member, and use the correct one for whatever information you want to get from it
but the roles it cant be a user
if you are accessing user.roles.highest, so you only need to pass message.member
right?
roles cant be User, only Member
ok
.cache
because a User represents the person's account, not linked to any guild
^^
where a Member represents that user as a member of a specific guild
what if somone mentions someone what if they want the roles displayed
.map
message.mentions.users and message.mentions.members
there is a mention for each type
memory 100
ok
flazepe, did you find a clause in the policy that states my command isnt TOS compliant?
Well yeah can someone help me with event emitter?
@opal plank a mod is looking into it i guess
aight, let me know if they find something
Please help me about the client.on
e?
what is the problem
if (!message.content.startsWith(prefix) || message.author.bot) return; if(message.content === `${prefix}nodelprotocol-on`) { client.on('messageDelete', message => { if (!message.partial) { const channel = message.channel; const delEmbed = new Discord.MessageEmbed() .setColor('#ff0000') .setAuthor(`${message.author.tag}`, `${message.author.avatarURL({ dynamic: true })}`) .setDescription(message.content) .setTimestamp() channel.send(delEmbed); } }); if (message.content === `${prefix}nodelprotocol-off`) {
client.on('end', () => {
message.reply('No
Delete Protocol Deactivated');
I can not disable it
I'm kinda confused
what is that code
Well yeah I just copy pasted it
it's hard to read
can you put it in a sourcebin
yeesh
Ok wait

you cant do that
you cant put an event listener inside another event listener
there is no client.on("end")
Sorry I'm working on android
Sorry I based it on client.on("collect", => .......
The await reaction thing
there is no client.on("collect") either
it shouldn't be on client though
oh the collector.on
Sorry sorry
Well yeah the undeleter is working but I can't find a way to disable it.
you're doing it wrong
Yes :( sorry...
the client's event emitter is supposed to be permanent, and while there is a way to disable it, its not supposed to be used like that in the first place
Ohhhh noted
you want to keep client events separated
can i post my question about hosting here?
what you can do is set up some sort of control variable
so the messageDelete event checks this variable to see if it executes the function or not
and your command sets/unsets this variable
@uneven laurel if (!cmd) return :D?
need more code
robin, havent you been answered in another server?
you said the problem is a specific user id?
then the problem is likely wherever you check for the author's id
whats the problem? Everything looks fine
so what if u log cmd only
does it always log the object
(cmd.help)
is anyone here an expert at canvas because i have no clue whats going wrong here
const canvasInvert = createCanvas(2048, 2048)
const contxt = canvasInvert.getContext('2d')
const uuser = msg.mentions.users.first() || msg.author;
let target = loadImage(uuser.displayAvatarURL({ dynamic: true, size: 2048, format: 'png' }))
const myimg = await loadImage(target)
contxt.drawImage(myimg, 0,0,2048,2048)
let forfuckssakeworkplease = new Discord.MessageAttachment(
canvasInvert.toBuffer(), name = 'fuck.png'
)
msg.channel.send(forfuckssakeworkplease)
it doesnt log an error or send anything please h el p its been 2 days
Um i want to make a command like $say hey man
and it says hey man
i made it but with one arg only, how to make with more than 1 arg?
async def say(ctx, args):
await ctx.send(args)
``` iam new to python, started yesterday
@final summit what appears if you do print(args)?
@uneven laurel logo command
log*
is it the same all the time?
@final summit what appears if you do print(args)?
@earnest phoenix what happens is it gets the word in the terminal?
just one word? try typing some more text
@pure lion your using loadimage twice
I guess
and it's a promise
oh?x2
code: ```js
const Discord = require("discord.js");
const moment = require("moment");
module.exports = {
name: "userinfo",
aliases: ["ui"],
run: async (bot, message, args) => {
let member = message.mentions.members.first() || message.member;
let user = member.user;
console.log(member)
let userinfo = {};
userinfo.rolesHighest = message.member.roles.highest;
userinfo.joined = moment
.utc(message.guild.members.cache.get(user.id).joinedAt)
.format("dddd, MMMM Do, YYYY");
const embed = new Discord.MessageEmbed()
.addFields(
{
name: "Roles",
value: `• Highest Role: **${userinfo.rolesHighest}**
•`
}
)
console.log(`Someone checked ${userinfo.name}s info!`);
message.channel.send(embed);
}
};
not the message author
you don't need userinfo anymore
you already have member and user that has all information
for userinfo in python :
async def userinfo(ctx, member: discord.Member):
roles = [role for role in member.roles]
embed= discord.Embed(color=member.color, timestamp=ctx.message.created_at)
embed.set_author(name=f"User Info - {member}")
embed.set_thumbnail(url=member.avatar_url)
embed.set_footer(text=f"Requested By {ctx.author}", icon_url=ctx.author.avatar_url)
embed.add_field(name="ID:", value=member.id)
embed.add_field(name="Name", value=member.display_name)
embed.add_field(name="Created at:", value=member.created_at.strftime("%a, %#d %B %Y, %I:%M %p UTC"))
embed.add_field(name="Joined At:", value=member.joined_at.strftime("%a, %#d %B %Y, %I:%M %p UTC"))
embed.add_field(name=f"Roles ({len(roles)})", value=" ".join([role.mention for role in roles]))
embed.add_field(name="Main Role:", value=member.top_role.mention)
embed.add_field(name="Bot?", value=member.bot)
await ctx.send(embed=embed)
@bot.command()```
roles#highest @earnest phoenix
markdown
how is that
search discord markdown
?
```
provide language
pepe
```cpp
```
Hi mom
```css
stuff
```
```http
stuff
``` is my favorite
ok
this is #development channel
i want it to do likek someone get mentioned it shows their highest role ifn not then the messge aauthors :/
u wot
let thing = message.mentions.first() || message.member```
^
highest role requires member
message.member then
they're not listening
this is not esting chan
I want to make a command like
$iphoneX @exmaple#0001 and it shows their pfp in a iphone x
any help
?
I want to make a command like
$iphoneX @exmaple#0001 and it shows their pfp in a iphone x
Depends on your library and language
canvas
python

if js
uh i want the code if anyone knows python here
lol
or if js no prob, i have a js bot too
an api
^
Lol there's an api for it.
i would suggest using a module like canvas since APIs are usually unreliable
Thats amazing
aaa it works n0ow
how long did that take? a day lul
amazing
application programming interface
how the fuck do i invert image colours
application programming interface
@pale vessel is there a code for the command or is only an api
are you sure they're both the same value and one of them is not undefined?
i told them multiple times to use it https://ptb.discordapp.com/channels/264445053596991498/272764566411149314/725700149711601746
application programming interface
@pale vessel or how to use these
you would simply do an API request. i think there's a rawImage option for nekobot where it just returns a raw image without json. you can straight up put the URL to your embed
eh i want a code lol
looks easy to remake
i dont understand anything
2020-06-25T13:37:07.934527+00:00 app[Worker.1]: ^
2020-06-25T13:37:07.934527+00:00 app[Worker.1]:
2020-06-25T13:37:07.934528+00:00 app[Worker.1]: TypeError: Cannot read property 'forEach' of undefined
2020-06-25T13:37:07.934528+00:00 app[Worker.1]: at /app/index.js:29:29
2020-06-25T13:37:07.934529+00:00 app[Worker.1]: at Array.forEach (<anonymous>)
2020-06-25T13:37:07.934529+00:00 app[Worker.1]: at /app/index.js:26:12
2020-06-25T13:37:07.934529+00:00 app[Worker.1]: at FSReqCallback.oncomplete (fs.js:155:23)``` Does anyone know why I keep getting this error? (discord.js)
forEach requires an array, no?
undefined, pull.configs doesnt have a .aliases property in it @elfin finch
oh, so aliases is undefined
indeed
do you need the index.js?
the error throws at you exactly what went wrong, just gotta read it carefully
ok thanks
const Discord = require("discord.js");
module.exports = {
name: "avatar",
run: async(bot, message, args) => {
const user = message.mentions.users.first() || message.author || args[0];
let embed = new Discord.MessageEmbed()
.setTitle(`Here is ${user.username}'s avatar!`)
.setColor('RANDOM')
.setImage(user.displayAvatarURL({dynamic: true}))
.setDescription(`[Avatar Link](${user.avatarURL({ dynamic: true}, { format: "png" })})`)
message.channel.send(embed)
}
}
``` i want the link to be png but its webp help
what the actual...
@sleek crypt
Can i ask sql related questions here?
yes
@sleek crypt
@dusky fog https://discordapp.com/channels/264445053596991498/325648177178869760/724287543884906576
not sure i understand your question
When i update it it just updates all duplicate rows with same id
I am assigning ids 1,2,3 etc...to rows. But when there's duplicate row it just assigns same value
Did you get it now?
can u not use UNIQUE?
Unique as what?
Nah
unique or primary key
yeah
how me use filter?
contxt.filter = 'invert(100%)'
contxt.drawImage(myimg, 0,0,2048,2048)
just make the index unique
^^
and then you can use ON DUPLICATE KEY
what database are you using?
i use MySQL, not sure if the syntax is the same on PostgreSQL but it should be identical
2020-06-25T14:02:26.344805+00:00 app[Worker.1]: at readdirSync (fs.js:948:3)
2020-06-25T14:02:26.344806+00:00 app[Worker.1]: at /app/index.js:16:20
2020-06-25T14:02:26.344806+00:00 app[Worker.1]: at Array.forEach (<anonymous>)
2020-06-25T14:02:26.344806+00:00 app[Worker.1]: at load (/app/index.js:15:19)
2020-06-25T14:02:26.344807+00:00 app[Worker.1]: at Object.<anonymous> (/app/index.js:41:1)
2020-06-25T14:02:26.344807+00:00 app[Worker.1]: at Module._compile (internal/modules/cjs/loader.js:1138:30)
2020-06-25T14:02:26.344808+00:00 app[Worker.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
2020-06-25T14:02:26.344808+00:00 app[Worker.1]: at Module.load (internal/modules/cjs/loader.js:986:32)
2020-06-25T14:02:26.344808+00:00 app[Worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:879:14)
2020-06-25T14:02:26.344809+00:00 app[Worker.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
2020-06-25T14:02:26.344809+00:00 app[Worker.1]: errno: -20,
2020-06-25T14:02:26.344810+00:00 app[Worker.1]: syscall: 'scandir',
2020-06-25T14:02:26.344810+00:00 app[Worker.1]: code: 'ENOTDIR',
2020-06-25T14:02:26.344810+00:00 app[Worker.1]: path: './commands//ban.js/'
2020-06-25T14:02:26.344811+00:00 app[Worker.1]: }```
if its postgres, check this one https://www.postgresqltutorial.com/how-to-delete-duplicate-rows-in-postgresql/
it couldn't find ban.js
oh, why not?
because it doesn't exist??
i dont remember if double // is readable
^
probably
/ ./ ../, but i dont recall //
but you can try removing the extra /
ok thanks
Thanks
id|movie
1 |Batman
2 |Superman
3 |Spiderman
4 |Ironman
4 |Ironman```
i want it like this
then the name and id should be unique
1 |Batman
2 |Batman
3 |Superman
4 |Spiderman
5 |Ironman
6 |Ironman```
think it's called composite key
that^
make both id and movie primary key
How to check our bot upvotes with cmd
Please include a bot mention or ID
yes but how do i make ids ?@pale vessel
the same way?
-botinfo 714487153475977276
714487153475977276
People+
8505
this bot is made to increase people and members in your server ! this bot will help you too get your server big
discord.js
185
184
747 Servers
@vast wolf
@brittle cipher
See
when i make them it duplicates same id with duplicate values
Here it shows upvotes
the data already exists
interesting
make an http request
Where :D?
could prob use axios to request it though
2020-06-25T14:02:26.344805+00:00 app[Worker.1]: at readdirSync (fs.js:948:3)
2020-06-25T14:02:26.344806+00:00 app[Worker.1]: at /app/index.js:16:20
2020-06-25T14:02:26.344806+00:00 app[Worker.1]: at Array.forEach (<anonymous>)
2020-06-25T14:02:26.344806+00:00 app[Worker.1]: at load (/app/index.js:15:19)
2020-06-25T14:02:26.344807+00:00 app[Worker.1]: at Object.<anonymous> (/app/index.js:41:1)
2020-06-25T14:02:26.344807+00:00 app[Worker.1]: at Module._compile (internal/modules/cjs/loader.js:1138:30)
2020-06-25T14:02:26.344808+00:00 app[Worker.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
2020-06-25T14:02:26.344808+00:00 app[Worker.1]: at Module.load (internal/modules/cjs/loader.js:986:32)
2020-06-25T14:02:26.344808+00:00 app[Worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:879:14)
2020-06-25T14:02:26.344809+00:00 app[Worker.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
2020-06-25T14:02:26.344809+00:00 app[Worker.1]: errno: -20,
2020-06-25T14:02:26.344810+00:00 app[Worker.1]: syscall: 'scandir',
2020-06-25T14:02:26.344810+00:00 app[Worker.1]: code: 'ENOTDIR',
2020-06-25T14:02:26.344810+00:00 app[Worker.1]: path: './commands//ban.js/'
2020-06-25T14:02:26.344811+00:00 app[Worker.1]: }``` What can i do to fix this error
read docs
do you want to get votes, or you want to receive webhooks? @earnest phoenix
you can, i use it to check who voted
@quartz kindle votes
like .getVotes() in dblapi?
flazepe can i dm u?
I don't want to use 'dblapi.js'
@plucky harness about to sleep, maybe later
alright before u sleep
can anyone help?
how do i generate id so it doesnt dupliacte id when theres same value
INTERESTING
@elfin finch we told you to try to remove the extra /
how do i invert image colours using canvas pLease :))))))
holy spaguetti
lol
recommendation, stop using builders
they just waste processing power
build the embeds manually
@earnest phoenix you need to make an http request to these endpoints, using any http library, such as https, node-fetch, axios, got, etc...

@elfin finch we told you to try to remove the extra /
@pale vessel i couldnt find it anywhere
@plucky harness if the IDs are unique, there can't be duplicates so you can use the same way as you've been doing
@long yew you should really stop using embed Builders, if its once, it may be fine, but if you require them too much, its better to do [embed: {//stuff here}] than using an embed builder that'll waste processing power
just a recommendation, feel free to ignore

i saw it instantly
@solemn latch wait where is it
@quartz kindle https://top.gg/bots/mybotid/check?userId=410865885117415424 true?
yes and include the authorization header kyoya
therefore //
@opal plank ty i don't understand them thou
okey
your dirs have /
you are also adding a /
@solemn latch where https://sourceb.in/b39587b012 ??
your screenshot was more specific
also, why is multiple dirs, called dir.
and a single dir, called dirs

ah
acutally it can be simpler
blah blah canvas invert colours blah blah
it could indeed be even simplier
client.commands = new Discord.Collection();
for(let c of fs.readdirSync('./commands/').filter((f) => f.endsWith('.js'))) client.commands.set(c, require('./commands/' + c));```
remove brackets xd
i dont know does for of loop support it butk
3 liner, i like it
2 actually
jaja
make it 1 please
^^
ye just ; who needs newline
well isnt 2 lines enough small
n o
kk then
make it better
long line syndrome > chubby code
nah
gotta go shorter
i want it to be more lines, otherwise i cant say, i wrote so many lines OMG so much work

when i used forEach, i usually used one line xd
mutually excluded if's to add lenght
each else if also needs to be more lines
1450 lines :DDDDDDDDDDDDD
if
{
}
else
if()
{
}
If(true) do stuff
if(false) dont do stuff
jeez
:pikathink:
@solemn latch oh thanks man (whered you get that emote btw)
just download it and add it to your server
some gambling discord
how to discord 101
:h:
before you ask dice, i dont use cavas, i use libs to do image creation

:dies:
🎲
not ignoring, i simply dont know the awnser
awnser?
is fine
just use canvacord
aswener
@flapze
i told you 20 times
IMN0TINSTALLIBNGANOTEURTIWTHESDSGHIOHDFUIHAKLJHSDFKJGAKHJGDSFJHGASJKHDGFHJKGSAJKHGJHGDJFHGSJHGDFA
@pale vessel can u help me make the iphone thing cuz i dont know how to use the api thing 😦
can't
someone call an ambulance pls
@opal plank calling 91231982371928371037129731239
done
it's not another, just delete current module and install canvacord
ye
it's not another, just delete current module and install canvacord
@pale vessel 😿
brb
npm i canvacord?
one way to find out
can anyone help?
@long yew with?
Can someone help me?
I got this error
@long yew
2020-06-25T14:54:57.653217+00:00 app[Worker.1]: throw err;
2020-06-25T14:54:57.653218+00:00 app[Worker.1]: ^
2020-06-25T14:54:57.653218+00:00 app[Worker.1]:
2020-06-25T14:54:57.653219+00:00 app[Worker.1]: Error: Cannot find module './botsettings.json'
2020-06-25T14:54:57.653219+00:00 app[Worker.1]: Require stack:
2020-06-25T14:54:57.653219+00:00 app[Worker.1]: - /app/index.js
2020-06-25T14:54:57.653220+00:00 app[Worker.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
2020-06-25T14:54:57.653220+00:00 app[Worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:842:27)
2020-06-25T14:54:57.653221+00:00 app[Worker.1]: at Module.require (internal/modules/cjs/loader.js:1026:19)
2020-06-25T14:54:57.653221+00:00 app[Worker.1]: at require (internal/modules/cjs/helpers.js:72:18)
2020-06-25T14:54:57.653222+00:00 app[Worker.1]: at Object.<anonymous> (/app/index.js:2:21)
2020-06-25T14:54:57.653222+00:00 app[Worker.1]: at Module._compile (internal/modules/cjs/loader.js:1138:30)
2020-06-25T14:54:57.653223+00:00 app[Worker.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
2020-06-25T14:54:57.653223+00:00 app[Worker.1]: at Module.load (internal/modules/cjs/loader.js:986:32)
2020-06-25T14:54:57.653223+00:00 app[Worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:879:14)
2020-06-25T14:54:57.653224+00:00 app[Worker.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
2020-06-25T14:54:57.653224+00:00 app[Worker.1]: code: 'MODULE_NOT_FOUND',
2020-06-25T14:54:57.653225+00:00 app[Worker.1]: requireStack: [ '/app/index.js' ]
2020-06-25T14:54:57.653225+00:00 app[Worker.1]: }
error
wrong path at module import
its giving you the error
yes
https://hasteb.in/vajaleyi.js when i do _cc hello hi and try running _hello the custom command i created i recieve an error saying cannot send an empty message but on the GUI in mongo compass i can see it
😉
:D
its giving you the error
@opal plank um? and?
its needing botsettings.json, though its not finding it where its trying to look for
so, fix it
ok thanks
or you could state what you need help with
it throws me this error when i run the code:
Require stack:
- /home/runner/Mortalito/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
at Function.Module._load (internal/modules/cjs/loader.js:840:27)
at Module.require (internal/modules/cjs/loader.js:1019:19)
at /home/runner/Mortalito/index.js:22:17
at Script.runInContext (vm.js:131:20)
at Object.<anonymous> (/run_dir/interp.js:156:20)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)````
i have const Discord = require('discord.js')
and repl.it its suposed to automatically intall whatever u require
did u install with npm?
it clearly cant find the module, either you installed it in a different directory or you didnt install at all
shift + right click, open a terminal/shell and install discord.js
https://hasteb.in/vajaleyi.js when i do _cc hello hi and try running _hello the custom command i created i recieve an error saying cannot send an empty message but on the GUI in mongo compass i can see it
i have other modules rquired on the code and it insalled it automatically
i cant install it tho
there should be a folder called node_modules
open it manually and see if discord.js is there
do you have a package.json file?
i forgot, that could also be the culprit
im installing it on cmd maybe thats the problem
use shell
2020-06-25T15:07:22.802393+00:00 app[Worker.1]: at /app/index.js:29:29
2020-06-25T15:07:22.802393+00:00 app[Worker.1]: at Array.forEach (<anonymous>)
2020-06-25T15:07:22.802393+00:00 app[Worker.1]: at /app/index.js:26:12
2020-06-25T15:07:22.802393+00:00 app[Worker.1]: at FSReqCallback.oncomplete (fs.js:155:23)``` How do I make it so that Array.forEach is defined
how i use shell?
shift + right click on the folder, make sure nothing is selected
there should appear a new options called "open Powershell here"
@elfin finch you're trying to use forEach on something that either doesnt exist or was not found
cant do it bro

