#development

1 messages · Page 991 of 1

long yew
#

ohhhh

quartz kindle
#

then you dont need to repeat it

long yew
#
 case 'pokemon':mmbr
    .join(", ")
#

or do i move mmbr to the next line?

quartz kindle
#

doesnt matter

#

but you still need to send it

long yew
#

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

woeful pollen
#

do you know how to get the ID of the user currently typing with typingStart?

earnest phoenix
#

Why json?

quartz kindle
#

@long yew dude what, you're not supposed to literally write (mons = ....)

long yew
#

well when they write .start [pokemon name] it records their id and pokemon chosen in mons.json

quartz kindle
#

i was just saying that your mons file needs to be required in your main file

long yew
#

ok

quartz kindle
#

usually you require the file in the top of the file, before any other code

long yew
#

ok

#
const mons = require("./mons.json");```
#

does that do the same as js mons = require("./mons.json");?

marble juniper
#

no

#

because in the first you actually define the variable

#

in the second you are just trying to change a variable that aint existing

long yew
#

i have them both now

marble juniper
#

no

#

bad

long yew
#

:c

marble juniper
#

remove the mons = require("./mons.json")

lusty quest
#

is the path in your first one correct?

marble juniper
#

or else you get an error

long yew
#

ok

marble juniper
#

only keep the first one

woeful pollen
#

when i use typingStart with author.id it just gives the channel ID?

long yew
#

no

pure lion
#

suuuuuuuuuuuuuuuuuuuuuuuup

#

mycodeisfucked.jpg

long yew
#

it does that

lusty quest
long yew
#

that doesn't say about json

lusty quest
#

its not for you @long yew

long yew
#

oh ok

woeful pollen
#

ty

pure lion
#
      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

lusty quest
#

what is your issue?

pure lion
#

i have a case of not-know-what-to-do itis

pale vessel
#

you have a syntax error

pure lion
#

:o

pale vessel
#

you made an assignment instead of a comparison

restive furnace
#

good idea

pure lion
#

:dying:

#

how would i fix that-

restive furnace
#

dying

#

by not assingin

#

have heard of ==?

pure lion
#

OH

#

SHIT

#

so to clarify:
= is assign
== is compare
=== is compare but on steroids

quartz kindle
#

yup

pure lion
#

okay epic

#

but idk how to invert image colours :'D

pale vessel
#

you didn't even make a canvas

pure lion
#

ok canvas has been made

pale vessel
#

get the context

pure lion
#

done

pale vessel
#

what size did you set it to?

pure lion
#

2048 x 2048

pale vessel
#

is the avatar the same size?

pure lion
#

yeah

pale vessel
#

add the image to the canvas

pure lion
#

ctx#(what goes here?)

#

wait ill just read the docs its fine

pale vessel
#

drawImage()

pure lion
#

o

#

ty

pale vessel
#

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

pure lion
#

wait lemme check if it sends properly

#

okay

pale vessel
#

so drawImage(image, 0, 0, 2048, 2048) iirc

grizzled isle
#

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.

lusty quest
#

AUTO_INCREMENT is probably the thing you look for

earnest phoenix
pure lion
#
(node:10876) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'displayAvatarURL' of undefined
grizzled isle
#

@lusty quest

org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (near "AUTO_INCREMENT": syntax error)```
#

iirc thats for mysql, not sql

lusty quest
#

ohh sqlite

#

ye its probably mysql

#

@grizzled isle does AUTOINCREMENT work?

grizzled isle
#

It throws the error above. Im gonna try INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL
Someone one stack overflow is having the somewhat same error

lusty quest
#

this looks good.

grizzled isle
#

No error on console...ima try it out right quick

#

Now its working.

vivid ravine
#

UnhandledPromiseRejectionWarning: Error: Status code: 429

#

pls help

lusty quest
#

more infos?

vivid ravine
#

wdym

lusty quest
#

it can be everything with this error

tulip ledge
#

context etc

vivid ravine
#

when i do play and then the yt url

#

it comes this error

tulip ledge
#

code

#

Like ur error literally sais it tho

#

UnhandledPromiseRejectionWarning

vivid ravine
#
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();
}
}
digital ibex
#

handle your promises...

#

tf

tulip ledge
vivid ravine
#

so what do i have to do

earnest phoenix
#

Anyone good with sharding here i have 1 question

tulip ledge
#

Like @digital ibex said, handle your errors

vivid ravine
tulip ledge
#

You have a promise that got reject but it isn't being handled

digital ibex
#

i was talking to you LOL

vivid ravine
#

Like @digital ibex said, handle your errors
@tulip ledge how can i do that

digital ibex
#

I didn't say that to you

tulip ledge
#

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"

digital ibex
#

now its not

tulip ledge
#

?

vivid ravine
#

@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

tulip ledge
nocturne grove
#

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

digital ibex
#

if you have the module.exports, thats what you're doing, right?

nocturne grove
#

yes

#

that's what I'm doing

digital ibex
#

then its because of the module.exports?

nocturne grove
#

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

digital ibex
#

it doesn't execute the file?

nocturne grove
#

that didn't, but now it does with the code in my first message

digital ibex
#

im confused, what do u need help with lol

digital ibex
#

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

nocturne grove
#

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

digital ibex
#

but what is the code

nocturne grove
#

index.js is the sharding starting file and the other one is the bot file

#

I will compact it and send the piece of *

quartz kindle
#

you're requiring index.js from shard.js?

nocturne grove
#

no requiring a mysql pool from the sharding file, which is called index.js

quartz kindle
#

but still, form the shard file right ?

nocturne grove
#

yes

#

but I'm not requiring index.js or any file, I'm requiring a var

quartz kindle
#

each shard runs in a separate process

nocturne grove
#

but that is a file in some way lol

quartz kindle
#

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

nocturne grove
#

🤔

#

but the module.exports part is executed before manager.spawn()

#

but you're still saying that doesn't work?

quartz kindle
#

not sure tbh, but i think the entire file will be executed regardless

nocturne grove
#

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

quartz kindle
#

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

lusty spade
nocturne grove
#

oh I didn't know that, thanks Tim

#

and thanks @digital ibex

quartz kindle
#

@lusty spade the error is coming from the mute file

nocturne grove
#

yeah it's not the same file

lusty spade
#

oops i copied the wrong error but both of the file has the same problem

nocturne grove
#

but show the file where the error is

lusty spade
#
    at Object.run (C:\Users\ngzhu\OneDrive\Projects\DiscordBots\Mod-Bot\commands\moderation\strike.js:68:12)1```
nocturne grove
#

so we can see the line

#

ok line 68

#

logs is a channel id?

#

I guess the channel is deleted

quartz kindle
#

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

lusty spade
#

hmm ok i'll look into it

tulip ledge
#

@lusty spade are you saving the channel id?

#

Like is logs an id or not?

lusty spade
#

oh nvm i fixed it

rustic sundial
#

Hi, How can i get all data from enmap database? I wanna do level leaderboard. Does anybody know, please?

lusty spade
#

im stupid i changed the name of the save

tulip ledge
#

@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

rustic sundial
#

and how? 😄

restive furnace
#

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

rustic sundial
#

I checked.

dark steeple
#
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?

digital ibex
#

why would their documentation document javascript?

tight plinth
#

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?

digital ibex
#

only triggers when someone in the server updates themeselves, ie change their nickanme, username etc

opal plank
#

@cobalt spruce here

#

development talk goes in here

restive furnace
cobalt spruce
#

@restive furnace ok

#

give me a sec

tight plinth
#

ok

opal plank
#

you need to know 3 things for what you want to do

#

what freestyle sent you, + what i previously told you

cobalt spruce
#

i just wanted to add guild count + member count

pure lion
#

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)
opal plank
#

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

pale vessel
#

you can't just send the buffer

pure lion
#

a

pale vessel
#

attach it as a file first [@pure lion]

pure lion
#

ok

cobalt spruce
#

@opal plank ok

#

ama see

spare goblet
#

can someone help me with regex sobmylifeisover
what i have: /(?!({{)){the}(?!(}}))/g
what i want it to do: match {the} , but not if it says {{the}}

long yew
#

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

earnest phoenix
#

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

digital ibex
#

you have an extra { and } in ur regex

opal plank
#

@spare goblet what exactly are you trying to capture?

earnest phoenix
#

version 12

long yew
#

who can help me?

spare goblet
opal plank
#

just {the}?

#

anywhere in a sentence?

spare goblet
#

ye

#

in the string

earnest phoenix
#

help me

spare goblet
#

but if it says {{the}}, i dont wnat it ot match

earnest phoenix
#

var header = new Header()

#

Header not defined

pale vessel
#

define it

tight plinth
#

how can i compare 2 member roles to see what roles they dont have in common?

earnest phoenix
#

Header

opal plank
#

so you just want one?

spare goblet
earnest phoenix
#

its shows its defined

opal plank
#

aight, sec

spare goblet
#

I dont want it to match if it says {{the}}

pure lion
#

jasjajajajajajajajajjajajajajajajajajajaj

opal plank
#

this might be a better approach @spare goblet

#

exclude if theres another { before {the}

cobalt spruce
#

here is the script i use to make it just saying Ahx moderating servers

earnest phoenix
#

do there

#

client.guilds.cache.size

pure lion
#
      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????????????????????????????????????????????????????????

pale vessel
#

name =

pure lion
#

YES

#

NAME =

opal plank
#

/[^{]({the})/g @spare goblet

cobalt spruce
#

@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

pure lion
#

*windows log-off noise*

earnest phoenix
#

${client.guilds.cache.size}

cobalt spruce
#

@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);
});

opal plank
#

yeah, use template literals

pale vessel
#

@opal plank don't think she meant the literally

earnest phoenix
#

@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);
});```
pure lion
#

jsjsjsjsjsjsjsjsjsjsjsjs

opal plank
#

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

cobalt spruce
#

@earnest phoenix not working

earnest phoenix
#

@cobalt spruce error?

cobalt spruce
#

am in gitgub

#

github

earnest phoenix
#

@_@

opal plank
#

what

earnest phoenix
#

heroku?

cobalt spruce
#

Yup

#

@earnest phoenix

long yew
#

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
earnest phoenix
#

then wait 5 mins

pure lion
#

*loudly dying*

earnest phoenix
#

@cobalt spruce wait 5 min

cobalt spruce
#

@earnest phoenix it dont take that much of time as i tested in

earnest phoenix
#

which version of discord.js you use

long yew
#

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

pure lion
#

@long yew its because there is no value in mmbr to check

#

when someone writes .start, log their member id to your db

cobalt spruce
#

@earnest phoenix it runed offline

#

lol

#

i give up

long yew
#

@pure lion what about if they write .start grookey? or a pokemon?

pure lion
#

@long yew take it one step at a time

earnest phoenix
#

@cobalt spruce which discord.js verison u use

cobalt spruce
#

v12

earnest phoenix
#

@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.

pure lion
#

can someone help me with canvas

#

please

opal plank
#

omg

#

please use ``

earnest phoenix
#

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);
  }
};
opal plank
#

or that

earnest phoenix
#

@earnest phoenix

long yew
#

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

opal plank
#

not sure mentions work like that

earnest phoenix
#

wdym

opal plank
#

dont think mentions return a user object

pure lion
#

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

earnest phoenix
#

dont think mentions return a user object
@opal plank they do

opal plank
#

the roles is only accesible via author

#

do they?

earnest phoenix
#

yes

#

else you can't get the user's avatar

restive furnace
#

in eris not

#

in d.js yes

earnest phoenix
#

would it be user.user?

pale vessel
#

it's already a user

earnest phoenix
#

k

#

so uhh

#

how would i fix my error

#

you can only get it by a member property

pale vessel
#

@pure lion why are you doing name =, just put the name

earnest phoenix
#

so you can fetch it

pure lion
#

why are you doing name =, just put the name
idk why am i putting name =

opal plank
#

it doesnt have a guild.role property

#

thats why its error'ing

earnest phoenix
#

yh like i said

#

de-ui

pale vessel
#

because it's a user

earnest phoenix
#

you can only get it by a member property

opal plank
#

indeed

pale vessel
#

uh so how about make it members.first() and go from there

#

you can use member.user for user

opal plank
long yew
#

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
opal plank
#

could make both use ID instead, then turn the id into obj

hoary lily
#

Uhm can someone help me?

earnest phoenix
#

so how tf can i get their avatar

opal plank
#

client.users.cache.get(id)

hoary lily
#
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');
pale vessel
#

you would only need their member object and then you can access everything else

hoary lily
#

I want to turn off the event emitter

pale vessel
#

then your client won't work

hoary lily
#

That's only the part of the code btw

opal plank
#

let tempt = message.author.id || message.mentions.users.first()
let user = client.users.cache.get(tempt)

#

@earnest phoenix

hoary lily
#

The only part that I want to disable after a command

earnest phoenix
#

uh ok

opal plank
#

that if you have them in shared servers

long yew
#

whoever is good at js and json dm me i need help with it, it will be quick

opal plank
#

if not you'll need to manually send a request to discord api

#

i'd recommend axios if so

pure lion
#

@pale vessel nothing at all-

pale vessel
#

just js let member = message.mentions.members.first() || message.member; let user = member.user;

earnest phoenix
#

de-ui

opal plank
#

that could work too

pale vessel
#

well yeah

opal plank
#

but it'll get the same problem, if not in shared server

pale vessel
#

so you can access member and user

opal plank
#

i usually add handler for when thats not avaliable to send api request

pale vessel
#

i wouldn't have a reason to do that

#

what would be the reason to get a user that isn't in the server?

earnest phoenix
#

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.

pale vessel
#

i only do that for my tag command

earnest phoenix
#

de-ui @earnest phoenix

opal plank
#

dunno why, but i did add it

#

quite useful for fetching data about people you have shared servers with but the bot isnt in

earnest phoenix
#

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.

pale vessel
#

give me an example of a command that needs that

nocturne grove
#

Is there a way to get guilds equally divided over shards? (for testing)

opal plank
#

i did use it a white ago

earnest phoenix
#

bruh

#

hello

#

guys

pale vessel
#

anyway, refine your user info command

#

get mentioned members instead

#

you can get their user property too

earnest phoenix
#

tf?

opal plank
pale vessel
#

isn't that privacy breach

opal plank
#

no, user info is publically fetchable

solemn latch
#

Its on your account

long yew
#

whoever is good at js and json dm me i need help with it, it will be quick

hasty sparrow
#

Just ask here

opal plank
long yew
#

ok

#

i will

earnest phoenix
#

de-ui

pale vessel
#

through a bot, yes

long yew
#

so

pale vessel
#

but users can't do that unless they're in the guild too

long yew
#
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.')
    }
opal plank
#

why would i make a bot user?

long yew
#

that logs the pokemon chose

earnest phoenix
#

should i just remake my whole ui cmd? and then start asking wuestions and that

opal plank
#

not quite, thats info that can be accessed thru normal means

long yew
#

how do i make a command that shows the pokemon logged for the user in the json file?

pale vessel
#

the bot is the medium

opal plank
#

indeed, and has access to the info

#

how is that privacy breach?

pale vessel
#

but the user doesn't have the right to view it?

opal plank
#

discord makes your info publically avaliable

pale vessel
#

i guess

long yew
#

can anyone help?

solemn latch
#

@long yew your start command logs the pokemon?
Shouldn't it just be used to choose a starter?

earnest phoenix
#
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?
long yew
#

@solemn latch it does log them

short siren
#

@long yew Thats a lot of if's

#

might look cleaner if you use a switch

long yew
#

i want a command that will show the pokemon logged for the user

short siren
#

also they are unnecessary

earnest phoenix
short siren
#
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

opal plank
#

@earnest phoenix log user right after

earnest phoenix
#

ok

opal plank
#

do console.log(user) right after that

long yew
#

@short siren idk how

earnest phoenix
#

now what

opal plank
#

run the command

short siren
#

i just changed it for you?

earnest phoenix
#

k

short siren
#

` is a back tick use ' or "

opal plank
#

then show me the console you get for that

short siren
#

backticks are only for template literals

earnest phoenix
#

de-ui

opal plank
#

?

earnest phoenix
#

User {
id: '669206927879962626',
bot: false,
username: 'Derku',
discriminator: '1507',
avatar: 'a_4db3da8fd285b4fb2d8fefa167c0e9e3',
flags: UserFlags { bitfield: 128 },
lastMessageID: '725697651290669097',
lastMessageChannelID: '272764566411149314'
}

opal plank
#

oh, my bad, thats user not member

earnest phoenix
#

ok?

#

so uhh what do i do

pale vessel
opal plank
#

try with what flaze said, it'll work the same but in your case, easier

earnest phoenix
#

?

opal plank
#

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

solemn latch
#

User accessible data?

earnest phoenix
#

try with what flaze said, it'll work the same but in your case, easier
@opal plank wdym

solemn latch
#

Or developer accessible data?

#

There is a difference there

opal plank
solemn latch
earnest phoenix
#

ok now wha

#

what

opal plank
#

now try it

hazy sparrow
#

the code wont run, t says it requires a , but if i put the , then it says "explanation or declaration needed"

earnest phoenix
#

de-ui

opal plank
#

same role error?

earnest phoenix
#

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

opal plank
#

its the same, its not a member, thats a user object

#

you need a guild.member to be able to access the role

earnest phoenix
#

but you told me to do console.log(user)

#

im using

short siren
#
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
opal plank
#

yeah, which should return this

earnest phoenix
#

let member = message.mentions.members.first() || message.member;
let user = member.user;

hoary lily
#

What are you trying to achieve

earnest phoenix
#

im remaking my user info cmd

hoary lily
#

Oh ?whois

#

Something like that?

earnest phoenix
#

more of

#

Vx_ui

hoary lily
#

message.mentions.users.first().tag

earnest phoenix
#

Vx_userinfo

hoary lily
#

Something like that

earnest phoenix
#

crap

#

fb.ui

#

-ui

#

-userinfo

#

bruh ok

hoary lily
opal plank
#

this is what you are looking for

hoary lily
#

Commands won't work here

opal plank
#

member obj, not user

earnest phoenix
opal plank
#

message.member should return that

pure lion
#

*crying*

earnest phoenix
#

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

hoary lily
#

As a guild member but if you want as a user, message.mentions.users.first()

opal plank
#

message.member.roles <= thats where you can find the roles property

earnest phoenix
#

note that message.member isnt a user

#

its a member

opal plank
#

^^

earnest phoenix
#

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'
}

opal plank
#

that last log you got is correct

earnest phoenix
#

still an user

hoary lily
#

Yeah true

earnest phoenix
#

ok so uhh now what

opal plank
#

it has a roles property you can access

earnest phoenix
#

ok

hoary lily
#

Thank God Mr. Tim is here

quartz kindle
#
message.author // User
message.member // Member
message.author.username // works
message.author.roles // doesnt work
message.member.username // doesnt work
message.member.roles // works
earnest phoenix
#

ok

pale vessel
#

member.username 😎

opal plank
#

message.member.roles <= thats where you can find the roles property
@opal plank

earnest phoenix
#

so uh what do i do

hoary lily
#

message.author.username

earnest phoenix
#

now

pale vessel
#

if you used the method i gave, it's easy as user.username

earnest phoenix
#

k

quartz kindle
#

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

earnest phoenix
#

but the roles it cant be a user

opal plank
#

if you are accessing user.roles.highest, so you only need to pass message.member

earnest phoenix
#

right?

quartz kindle
#

roles cant be User, only Member

earnest phoenix
#

ok

hoary lily
#

.cache

quartz kindle
#

because a User represents the person's account, not linked to any guild

opal plank
#

^^

quartz kindle
#

where a Member represents that user as a member of a specific guild

earnest phoenix
#

what if somone mentions someone what if they want the roles displayed

hoary lily
#

.map

quartz kindle
#

message.mentions.users and message.mentions.members

#

there is a mention for each type

pale vessel
#

memory 100

earnest phoenix
#

ok

hoary lily
#

message.mentions.members.first().roles.cache.map

#

Maybe

opal plank
#

flazepe, did you find a clause in the policy that states my command isnt TOS compliant?

hoary lily
#

Well yeah can someone help me with event emitter?

pale vessel
#

@opal plank a mod is looking into it i guess

opal plank
#

aight, let me know if they find something

hoary lily
#

Please help me about the client.on

pure lion
#

e?

quartz kindle
#

what is the problem

hoary lily
#
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

earnest phoenix
#

what is that code

hoary lily
#

Well yeah I just copy pasted it

earnest phoenix
#

it's hard to read

pure lion
#

whoa

#

that is

earnest phoenix
#

can you put it in a sourcebin

pure lion
#

yeesh

hoary lily
#

Ok wait

earnest phoenix
quartz kindle
#

you cant do that

#

you cant put an event listener inside another event listener

#

there is no client.on("end")

hoary lily
#

Sorry I'm working on android

#

Sorry I based it on client.on("collect", => .......

#

The await reaction thing

pale vessel
#

still no?

#

ah

quartz kindle
#

there is no client.on("collect") either

pale vessel
#

it shouldn't be on client though

hoary lily
#

oh the collector.on

#

Sorry sorry

#

Well yeah the undeleter is working but I can't find a way to disable it.

quartz kindle
#

you're doing it wrong

hoary lily
#

Yes :( sorry...

quartz kindle
#

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

hoary lily
#

Ohhhh noted

quartz kindle
#

you want to keep client events separated

olive crown
#

can i post my question about hosting here?

quartz kindle
#

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

earnest phoenix
#

@uneven laurel if (!cmd) return :D?

hoary lily
#

Ok ok I'm writing it down.

#

Thanks!

#

Such a great help sir! Thank you very much.

quartz kindle
#

need more code

digital ibex
#

robin, havent you been answered in another server?

quartz kindle
#

you said the problem is a specific user id?

#

then the problem is likely wherever you check for the author's id

earnest phoenix
#

whats the problem? Everything looks fine

#

so what if u log cmd only

#

does it always log the object

#

(cmd.help)

pure lion
#

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

final summit
#

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
earnest phoenix
#

@final summit what appears if you do print(args)?

#

@uneven laurel logo command

#

log*

#

is it the same all the time?

final summit
#

@final summit what appears if you do print(args)?
@earnest phoenix what happens is it gets the word in the terminal?

earnest phoenix
#

just one word? try typing some more text

solemn latch
#

@pure lion your using loadimage twice

earnest phoenix
#

I guess

pale vessel
#

and it's a promise

pure lion
#

oh?x2

earnest phoenix
#

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

pale vessel
#

you don't need userinfo anymore

earnest phoenix
#

ok

#

lol

pale vessel
#

you already have member and user that has all information

final summit
#

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()```
earnest phoenix
#

roles#highest @earnest phoenix

final summit
#

btw guys how to make my code colored here

#

in discord

#

like (``)

earnest phoenix
#

markdown

final summit
#

how is that

earnest phoenix
#

search discord markdown

final summit
#

?

earnest phoenix
#

```

pale vessel
earnest phoenix
#
pepe
#

oop

#
e
final summit
#
pepe
pure lion
#

```cpp
```

final summit
#
@bot.command

```****
#

oh ok

#

thx

solemn latch
#
Hi mom
earnest phoenix
#

```css
stuff
```

final summit
#
Hi mom

@solemn latch

#
Bye mom
restive furnace
#

```http
stuff
``` is my favorite

pale vessel
final summit
#

ok

earnest phoenix
#

de-ui

#

opp

#

wait

#

de-ui

#

fuck

restive furnace
earnest phoenix
#

i want it to do likek someone get mentioned it shows their highest role ifn not then the messge aauthors :/

digital ibex
#

u wot

restive furnace
#
let thing = message.mentions.first() || message.member```
solemn latch
#

^

pale vessel
#

highest role requires member

digital ibex
#

itd be member

#

not author

restive furnace
#

message.member then

pale vessel
#

they're not listening

earnest phoenix
#

de-ui

#

eee

restive furnace
#

this is not esting chan

pale vessel
final summit
#

I want to make a command like
$iphoneX @exmaple#0001 and it shows their pfp in a iphone x

#

any help

earnest phoenix
#

YAY IT WORKED

#

de-ui @final summit

final summit
#

?

earnest phoenix
#

hmm

#

lol

#

not testing

restive furnace
#

this is still developement channel

#

lol

earnest phoenix
#

fuck

#

commands don't work here

#

forgot

final summit
#

I want to make a command like
$iphoneX @exmaple#0001 and it shows their pfp in a iphone x

solemn latch
#

Depends on your library and language

restive furnace
#

canvas

final summit
#

python

solemn latch
restive furnace
#

if js

final summit
restive furnace
#

then probably pygame

#

idk lol

final summit
#

uh i want the code if anyone knows python here

#

lol

#

or if js no prob, i have a js bot too

earnest phoenix
#

@final summit

final summit
#

thanks

#

but what is this

#

@earnest phoenix

pale vessel
#

an api

earnest phoenix
#

^

solemn latch
#

Lol there's an api for it.

pale vessel
#

i would suggest using a module like canvas since APIs are usually unreliable

solemn latch
#

Thats amazing

final summit
#

tbh i dont know what an api is lol

#

new to coding

pure lion
#

aaa it works n0ow

pale vessel
#

how long did that take? a day lul

pure lion
#

2 almost

#

lma9

pale vessel
#

amazing

final summit
#

an api
@pale vessel i dont know what an api is tbh

#

lol

pale vessel
#

application programming interface

pure lion
#

how the fuck do i invert image colours

final summit
#

application programming interface
@pale vessel is there a code for the command or is only an api

pale vessel
#

are you sure they're both the same value and one of them is not undefined?

final summit
#

cuz if code itll be a bittt ezier for

#

me

opal plank
final summit
#

application programming interface
@pale vessel or how to use these

pale vessel
#

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

earnest phoenix
#

the output

#

lmao

#

i don't think it's meant for avatars

final summit
#

eh i want a code lol

pale vessel
#

looks easy to remake

final summit
#

i dont understand anything

elfin finch
#
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)
final summit
#

my brain is gonna explode

#

🤯

opal plank
#

forEach requires an array, no?

pale vessel
#

works on collections too

#

but they're using an array

opal plank
#

undefined, pull.configs doesnt have a .aliases property in it @elfin finch

elfin finch
#

oh, so aliases is undefined

opal plank
#

indeed

elfin finch
#

do you need the index.js?

opal plank
#

the error throws at you exactly what went wrong, just gotta read it carefully

elfin finch
#

ok thanks

opal plank
#

property forEach of undefined <= meaning what came before forEach is undefined

#

np

earnest phoenix
#
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...

dusky fog
#

@sleek crypt

earnest phoenix
#

your bots muted @dusky fog

#

({ dynamic: true, format: 'png')}

#

ok

plucky harness
#

Can i ask sql related questions here?

earnest phoenix
#

yes

plucky harness
#

So i want to give 1,2,3,4 values in my duplicate data rows

#

How do i go about it

opal plank
#

not sure i understand your question

plucky harness
#

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?

opal plank
#

can u not use UNIQUE?

plucky harness
#

Unique as what?

opal plank
#

to avoid having duplicates

#

constraint

plucky harness
#

Nah

pale vessel
#

unique or primary key

plucky harness
#

I need to do it using update

#

Update table

pale vessel
#

yeah

pure lion
#

how me use filter?

      contxt.filter = 'invert(100%)'
      contxt.drawImage(myimg, 0,0,2048,2048)
pale vessel
#

just make the index unique

opal plank
#

^^

pale vessel
#

and then you can use ON DUPLICATE KEY

plucky harness
#

Oh wait

#

That just might work

#

Thanks a lot dude 👌👌👌

pale vessel
#

what database are you using?

plucky harness
#

I am not sure how to use on duplicate

#

Postgre

pale vessel
#

i use MySQL, not sure if the syntax is the same on PostgreSQL but it should be identical

elfin finch
#
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]: }```
opal plank
elfin finch
#

what'sthat

#

i got that error

earnest phoenix
#

it couldn't find ban.js

elfin finch
#

oh, why not?

earnest phoenix
#

because it doesn't exist??

opal plank
#

i dont remember if double // is readable

earnest phoenix
#

^

pale vessel
#

probably

opal plank
#

/ ./ ../, but i dont recall //

pale vessel
#

but you can try removing the extra /

elfin finch
#

ok thanks

plucky harness
#

Thanks

#

id|movie

1 |Batman
2 |Superman
3 |Spiderman
4 |Ironman
4 |Ironman```
#

i want it like this

pale vessel
#

then the name and id should be unique

plucky harness
#
1 |Batman
2 |Batman
3 |Superman
4 |Spiderman
5 |Ironman
6 |Ironman```
pale vessel
#

think it's called composite key

plucky harness
#

that^

pale vessel
#

make both id and movie primary key

earnest phoenix
#

How to check our bot upvotes with cmd

opal plank
#

hmmmm good question, does top.gg provide an api we can hook into to request that data?

elfin finch
#

I checked my code and i cant find the //

#

is the code

earnest phoenix
#

Pikachu :d

#

@opal plank see the Luca bot

#

-botinfo @people+

gilded plankBOT
#

tickNo Please include a bot mention or ID

plucky harness
#

yes but how do i make ids ?@pale vessel

pale vessel
#

the same way?

earnest phoenix
#

-botinfo 714487153475977276

gilded plankBOT
#
Bot info
ID

714487153475977276

Username

People+

Discriminator

8505

Short Description

this bot is made to increase people and members in your server ! this bot will help you too get your server big

Library

discord.js

Prefix
Total Upvotes

185

Monthly Upvotes

184

Server Count

747 Servers

Owner(s)

@vast wolf
@brittle cipher

earnest phoenix
#

See

plucky harness
#

when i make them it duplicates same id with duplicate values

earnest phoenix
#

Here it shows upvotes

plucky harness
#

the data already exists

opal plank
#

interesting

earnest phoenix
#

@_@

#

How can i get upvotes without use dblapi.js ?

quartz kindle
#

make an http request

opal plank
#

they have package for it?

#

😮

earnest phoenix
#

Where :D?

opal plank
#

could prob use axios to request it though

elfin finch
#
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
pale vessel
#

read docs

quartz kindle
#

do you want to get votes, or you want to receive webhooks? @earnest phoenix

pale vessel
#

you can, i use it to check who voted

earnest phoenix
#

@quartz kindle votes

quartz kindle
#

like .getVotes() in dblapi?

plucky harness
#

flazepe can i dm u?

earnest phoenix
#

I don't want to use 'dblapi.js'

pale vessel
#

@plucky harness about to sleep, maybe later

plucky harness
#

alright before u sleep

long yew
#

can anyone help?

plucky harness
#

how do i generate id so it doesnt dupliacte id when theres same value

opal plank
#

INTERESTING

pale vessel
#

@elfin finch we told you to try to remove the extra /

pure lion
#

how do i invert image colours using canvas pLease :))))))

opal plank
#

holy spaguetti

solemn latch
#

lol

opal plank
#

recommendation, stop using builders

#

they just waste processing power

#

build the embeds manually

quartz kindle
#

@earnest phoenix you need to make an http request to these endpoints, using any http library, such as https, node-fetch, axios, got, etc...

earnest phoenix
elfin finch
#

@elfin finch we told you to try to remove the extra /
@pale vessel i couldnt find it anywhere

solemn latch
#

i saw it instantly

elfin finch
#

code

pale vessel
#

@plucky harness if the IDs are unique, there can't be duplicates so you can use the same way as you've been doing

opal plank
#

@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

earnest phoenix
elfin finch
#

i saw it instantly
@solemn latch wait where is it

earnest phoenix
#

@quartz kindle https://top.gg/bots/mybotid/check?userId=410865885117415424 true?

solemn latch
#

your dirs have /
you are also adding a /

pale vessel
#

yes and include the authorization header kyoya

solemn latch
#

therefore //

long yew
#

@opal plank ty i don't understand them thou

earnest phoenix
#

okey

elfin finch
solemn latch
opal plank
#

ob here

#

oops, duplicate

solemn latch
#

your screenshot was more specific

#

also, why is multiple dirs, called dir.
and a single dir, called dirs

quartz kindle
#

maybe its dir and dir specific

#

xD

solemn latch
#

ah

opal plank
#

dunno why overcomplicate it like that though

#

it could be this simple

#

¯_(ツ)_/¯

restive furnace
#

acutally it can be simpler

pure lion
#

blah blah canvas invert colours blah blah

opal plank
#

it could indeed be even simplier

solemn latch
#

i thought that was solved @pure lion

pure lion
#

no

#

just managed to send an image with canvas

#

not sure how to edit said image

restive furnace
#
client.commands = new Discord.Collection();
for(let c of fs.readdirSync('./commands/').filter((f) => f.endsWith('.js'))) client.commands.set(c, require('./commands/' + c));```
pale vessel
#

remove brackets xd

restive furnace
#

i dont know does for of loop support it butk

pale vessel
#

it does

#

now you're talking

opal plank
#

3 liner, i like it

restive furnace
#

2 actually

pure lion
#

jaja

solemn latch
#

make it 1 please

opal plank
#

^^

pure lion
#

ye just ; who needs newline

restive furnace
#

well isnt 2 lines enough small

pure lion
#

n o

restive furnace
#

kk then

opal plank
#

make it better

pure lion
#

long line syndrome > chubby code

restive furnace
#

nah

opal plank
#

gotta go shorter

solemn latch
#

i want it to be more lines, otherwise i cant say, i wrote so many lines OMG so much work

pure lion
#

is joke

#

lma9

opal plank
#

one liners

#

just add a bunch of stupid if's

final summit
#

i write in 1000000000 lines

#

🙂

restive furnace
#

when i used forEach, i usually used one line xd

opal plank
#

mutually excluded if's to add lenght

solemn latch
#

each else if also needs to be more lines

pure lion
#

1450 lines :DDDDDDDDDDDDD

solemn latch
#

if
{
}
else
if()
{
}

restive furnace
#

5 lines

#

actually now

opal plank
#

If(true) do stuff
if(false) dont do stuff

restive furnace
#

if (false) do
else if (true) dont do

#

if you dont put ; that should work

pure lion
#

ok
but
can
someone
help
me?

#

canvas invert

#

colours

#

nuff said

opal plank
#

jeez

elfin finch
#

:pikathink:
@solemn latch oh thanks man (whered you get that emote btw)

pale vessel
#

just download it and add it to your server

solemn latch
#

some gambling discord

opal plank
#

how to discord 101

pure lion
#

:h:

opal plank
#

before you ask dice, i dont use cavas, i use libs to do image creation

final summit
pure lion
#

:dies:

opal plank
#

so, i cant help you with that

#

¯_(ツ)_/¯

final summit
#

🎲

opal plank
#

not ignoring, i simply dont know the awnser

final summit
#

awnser?

pure lion
#

is fine

pale vessel
#

just use canvacord

opal plank
#

aswener

final summit
#

@flapze

pale vessel
#

i told you 20 times

solemn latch
#

seems simple enough

pure lion
#

IMN0TINSTALLIBNGANOTEURTIWTHESDSGHIOHDFUIHAKLJHSDFKJGAKHJGDSFJHGASJKHDGFHJKGSAJKHGJHGDJFHGSJHGDFA

final summit
#

@pale vessel can u help me make the iphone thing cuz i dont know how to use the api thing 😦

opal plank
#

someone call an ambulance pls

#

someone having a stroke

pale vessel
#

can't

final summit
#

someone call an ambulance pls
@opal plank calling 91231982371928371037129731239

#

done

pale vessel
#

it's not another, just delete current module and install canvacord

opal plank
#

guuud

#

now we wait and relax

final summit
#

ye

pale vessel
#

it's literally a wrapper for canvas

#

it's like quickdb

#

they even have an example

pure lion
#

it's not another, just delete current module and install canvacord
@pale vessel 😿

#

brb

#

npm i canvacord?

pale vessel
#

one way to find out

pure lion
#

Epiccc

#

Use aeon

long yew
#

can anyone help?

opal plank
#

@long yew with?

long yew
#

my bot

opal plank
#

check typos in that json

#

mons.json

elfin finch
#

Can someone help me?

opal plank
#

its giving you the error

elfin finch
#

I got this error

opal plank
#

@long yew

elfin finch
#
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

opal plank
#

same thing i told him krabby

lusty quest
#

wrong path at module import

opal plank
#

its giving you the error

elfin finch
#

yes

hardy vector
#

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

long yew
#

@opal plank ty u are big brain

#

i forgot to put {} in there

opal plank
#

😉

long yew
#

:D

elfin finch
#

its giving you the error
@opal plank um? and?

opal plank
#

its needing botsettings.json, though its not finding it where its trying to look for

#

so, fix it

elfin finch
#

ok thanks

opal plank
#

i wonder why you doing ./ though

#

oh, nvm

dusky mist
earnest phoenix
#

or you could state what you need help with

dusky mist
#

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

opal plank
#

did u install with npm?

dusky mist
#

and repl.it its suposed to automatically intall whatever u require
@dusky mist

opal plank
#

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

dusky mist
hardy vector
#

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

dusky mist
#

i have other modules rquired on the code and it insalled it automatically

opal plank
#

its clearly not installed my dude

#

navigate directly to the modules folder

dusky mist
#

i cant install it tho

opal plank
#

there should be a folder called node_modules

#

open it manually and see if discord.js is there

quartz kindle
#

do you have a package.json file?

opal plank
#

i forgot, that could also be the culprit

dusky mist
#

im installing it on cmd maybe thats the problem

opal plank
#

use shell

elfin finch
#
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
dusky mist
#

how i use shell?

opal plank
#

shift + right click on the folder, make sure nothing is selected

#

there should appear a new options called "open Powershell here"

quartz kindle
#

@elfin finch you're trying to use forEach on something that either doesnt exist or was not found

dusky mist
#

cant do it bro