#development

1 messages · Page 815 of 1

earnest phoenix
#

if I don't find one we'll bite the bullet as you say in the future sometime

true ravine
#

I definitely see your point, but I guess many servers don't see it to be that important

copper cradle
#

I mean

#

DIY

earnest phoenix
#

I agree it is not that important, yet a few extreme users dividing up one sentence into 10 messages skew with the results enough that we'd prefer to count characters.
It would certainly not be worth it to create and host a custom bot just for this feature, if we find nothing some other features would likely have to be considered and added first

true ravine
#

Fair enough - good luck with whatever you decide to do 👍

quartz kindle
#

Its very hard for a machine to draw a line between an actual conversation and spam

#

Its extremely easy to trick it

#

Youd need something like an AI to do anything more than a few basic checks

earnest phoenix
#

we already considered that problem, fortunately the moderation capacity is currently high enough to check for spam. For the simple "aaaaaaaaaaaaaaaaaaaa" spam we already have a bot with web API, otherwise members could easily report to staff. But yes, to create a true automatic system to draw the line what you suggest is absolutely true

floral bloom
#
{
  "prefixes":["."],
  "restart": {
    "guild": "",
    "channel": "",
    "user": ""
  },
  "botMasters": ["370381633305575426", "[REDACTED]"],
  "latency": [50,100,39,163,192,100,75,117,108,215]
}
```Why am I getting `Unexpected end of JSON input`?
quartz kindle
#

Are you sure its coming from there?

floral bloom
#

When I click Jump To it takes me to the top of the file.

summer torrent
#

what is server.js 4th line

floral bloom
#
client.config = require("./config.json");
quartz kindle
#

Is that everything your config.json has?

floral bloom
#

Yes.

quartz kindle
#

Copy it and paste it into a json linter website

#

Does it say its valid?

floral bloom
quartz kindle
#

Then do console.log(fs.readFileSync("./config.json"))

#

Before the require

#

Make sure you require fs before if you dont have it already

#

Does anything show up in the console?

floral bloom
#

It shows <Buffer >.

quartz kindle
#

Ah oops

#

Add , "utf8"

#

"./config.json","utf8"

quaint sorrel
#

i need some help to get in my bot to my server agien...

floral bloom
quartz kindle
#

Then your json file is actually empty

#

Your glitch editor is out of sync

#

Or the file is not saved

#

Make sure the file is saved

#

And refresh your project

floral bloom
#

Awesome! That worked, thank you! 😄

#

And in v12, did client.guilds and guild.channels change to client.guilds.cache and guild.channels.cache?

quartz kindle
#

Yes

#

They were separated

quaint sorrel
quartz kindle
#

Methods that send a request to discord, such as .fetch, is the same as before

floral bloom
#
client.guilds.cache.get("guild_id").channels.cache.get("channel_id").send(`Test.`)
```So this *should* work?
quartz kindle
#

But collection methods such as set,get,has,filter,map,forEach,etc were all moved to .cache

#

Yes

#

@quaint sorrel you need to disable the code grant option

#

In your discord developer bot settings

quaint sorrel
#

ammmm okk

#

omgggg thxxx

#

you helpd me so much today thx so much

floral bloom
#
exports.run = async (client, message, args) => {
  if (!client.config.botMasters.includes(message.author.id)) {
    return;
  }
  await message.channel.send({embed: {
    color: client.color,
    title: "Restarting bot. This may take a few seconds...",
    timestamp: new Date(),
    footer: {
      text: message.author.username,
      icon_url: message.author.avatarURL
    }
  }});
  
  client.config.restart.guild = message.guild.id;
  client.config.restart.channel = message.channel.id;
  client.config.restart.user = message.author.id;
  
  client.fs.writeFile(`./config.json`, JSON.stringify(client.config), (err) => console.error);
  client.destroy();
  process.exit();
};

I have this code and for some reason it is deleting the data in config.json (which was my problem before now).

#

I've done it this way before and had no problems.

earnest phoenix
#

when you write to a file, its current data is overwritten

#

so make sure that the config you have in memory is up to date with the json file

floral bloom
#

Your last message is confusing. waitWhat

earnest phoenix
#

what is confusing about it

#

the config object you stored in memory may not be the exact same object that's in the json file

#

aka something changed between those two

#

you should listen for changes on the json file and read it on boot (and of course store the result of it in memory)

floral bloom
#

Okay, I fixed it.
I was using writeFile instead of writeFileSync.
Thanks though. 😄

lyric rock
#

Hey, need some help with making a bot with Java

#

I don't know how to install JDA

#

Also getting the error...
java error: release version 5 not supported

zenith terrace
#

JDA?

lyric rock
#

This thing

#

For Java

#

Only coding language I know

quartz kindle
#

@floral bloom the reason it was being deleted is that you put process.exit() outside of the writeFile callback (err => {}). That makes it immediatelly exit the process without waiting for the write to complete

#

which ends up with an incomplete/broken file

blissful scaffold
#

JDA is pretty easy to install if you use Maven

floral bloom
#

the reason it was being deleted is that you put process.exit() outside of the writeFile callback (err => {}). That makes it immediatelly exit the process without waiting for the write to complete
Ah, I see.

lyric rock
#

@blissful scaffold Thanks! Now having issues with...

#

<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>4.1.1_110</version>

#

net.dv8tion, JDA, and 4.1.1_110 are red

#

I use Maven

blissful scaffold
lyric rock
#

There's a JDA discord?

blissful scaffold
#

yes

lyric rock
#

Can I have the link?

blissful scaffold
lyric rock
#

Thanks!

summer torrent
#

has there been any change in the Instagram API? my instagram info command not working now

regal saddle
#

how can i check the version of my discord.js?

#

tag me for answer

summer torrent
#
require("discord.js").version```
#

@regal saddle

regal saddle
#

after version@V12?

summer torrent
#

wdym

regal saddle
#

you wrote

require("discord.js").version```
#

and after .version @V12?

summer torrent
#
require("discord.js").version```

returns as your djs version

sudden geyser
#

You can also just check out your package.json

regal saddle
#

yeah, already did

#

and in my cmd i can also do npm list discord.js

astral yoke
#

Getting an error when trying to make a new command for mute.

#

This command well make it so that it will create a mute role when command is executed.

#

Code.

#
const usage = require("../../../utils/usage.js"); //better help-messages
const { prefix } = require("../../loaders/reader") //get prefix from botconfig

module.exports = {
    config: {
        name: "createmute",
        aliases: ["createnospeak"],
        usage: "!createmute",
        description: "Make the mute role.",
        permissions: "manage roles"
    },
    run: async (bot, message, args) => {
        if (message.channel.type == "dm") return message.channel.send("This command only works in a server!");
        if(!message.member.hasPermission("MANAGE_ROLES") || !message.guild.owner) return errors.noPerms(message, "MANAGE_ROLES");
        if(!message.guild.me.hasPermission(["MANAGE_ROLES", "ADMINISTRATOR"])) return errors.lack(message.channel, "MANAGE_ROLES");
        let muterole = message.guild.roles.find(r => r.name === "Muted") //look to see if muted role already exists
        
        

            if(!muterole) { //if not
            try{
                muterole = await message.guild.createRole({
                    name: "Muted",
                    color: "#514f48",
                    permissions: [] //create muterole name + color
                });
                message.guild.channels.forEach(async (channel, id) => {
                    await channel.overwritePermissions(muterole, {
                        SEND_MESSAGES: false,
                        ADD_REACTIONS: false,
                        SEND_TTS_MESSAGES: false,
                        ATTACH_FILES: false,
                        SPEAK: false
                    });  //will overwrite permissiosn for each channel to make it so that the user can't speak
                });
                channel.message.send("Mute role was not found, so it made it. ")
            } catch(e) {
                console.log(e.stack); //if err log err
                
            }
        }
    }
}
#

Error.

#
    at Object.run (C:\Users\Cools\Downloads\DogBot\src\commands\moderating\createmute.js:37:17)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
ReferenceError: channel is not defined
    at Object.run (C:\Users\Cools\Downloads\DogBot\src\commands\moderating\createmute.js:37:17)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
#

Note, it does everything, but it dosen't message into that channel that it was executed and say "Mute role was not found, so it made it.

hollow granite
#

Isn't it supposed to be message.channel.send("text") instead of channel.message.send?

astral yoke
#

Ah okay.

#

Yeah that did it. Thanks.

hollow granite
#

yeah, np

tame prairie
#

I want add music to my "Spanish" Bot but when i do the distpacher its says me "distpatcher is not defined" (Ik that i dont have to define it but what can i do?)

slate mist
#

can you send your code?

hollow granite
#

on discord.js.org it says you can use const dispatcher = connection.play('/home/discord/audio.mp3'); to define it

tame prairie
#

o h thanks

#

i did not notice that

#

i need more help soon but tomorrow i gtg

copper cradle
#

LMAO channel.message.send() BRUH

earnest phoenix
#

channeling the inner message WeSmart

amber geyser
#

if(!message.member.roles..has('662466795810193428')) return; how to use in new version of discord.js (v12)?

regal saddle
#

here you can find all changes

amber geyser
#

no fund

regal saddle
#

wut

modern iron
#

Hi, I was wondering if this is a bad thing to show up and how do I fix it if so?
(node:11) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
Please @ (or DM) me if you can help. Thank you so much

stable horizon
#

Possible memory leak detected. Solution given.
...

cerulean pebble
#

how to add server count here

regal saddle
#

Coronavirus bot.

stable horizon
#

Post it

regal saddle
#

big bruh

cerulean pebble
#

like this

#

how to add server count

modern iron
#

I think that your bot has to be in enough servers for that to come up. But I could be wrong

cerulean pebble
#

@modern iron hmmm enough is how much

earnest phoenix
#

you need to use the topgg api

cerulean pebble
#

she is in 50 +

#

hmm oke

earnest phoenix
modern iron
#

Oh cool yeah that sounds right

#

Btw I tried to use “emitter.serMaxListeners()” but it said emitter is not defined

cerulean pebble
#

oke tks

#

i didn't see thart

#

oke tks good friend tickYes

amber geyser
cerulean pebble
#

can we make a command count upvote

earnest phoenix
copper cradle
#

@earnest phoenix I hope that's a jokw

#

since you already have the bot dev role I'll assume it is

earnest phoenix
#

it is a joke

astral yoke
#

Attempting to make a createmodlog channel. It'll create a channel called modlog so that my bot logs everything it needs to into that channel.

#

My code:

#
const usage = require("../../../utils/usage.js"); //better help-messages
const { prefix } = require("../../loaders/reader") //get prefix from botconfig

module.exports = {
    config: {
        name: "createmodlog",
        aliases: ["createmodlogchannel"],
        usage: "!createmodlog",
        description: "Make the modlog channel",
        permissions: "manage roles"
    },
    run: async (bot, message, args) => {
        if (message.channel.type == "dm") return message.channel.send("This command only works in a server!");
        if(!message.member.hasPermission("MANAGE_ROLES") || !message.guild.owner) return errors.noPerms(message, "MANAGE_ROLES");
        if(!message.guild.me.hasPermission(["MANAGE_ROLES", "ADMINISTRATOR"])) return errors.lack(message.channel, "MANAGE_ROLES");
        let modchannel = message.guild.channels.find(r => r.name === 'modlog' ) //look to see if muted role already exists
        if(modchannel) message.channel.send("\ FAILED! Reason: Modlog is already a channel!") 
        
        if(!modchannel) {
            message.channel.send("Making channel currently. It wont have permissions meaning everyone can view it!")
            guild.createChannel(name, "modlog");
    }
        }

        
}
    

#

Error:

#
    at Object.run (C:\Users\Cools\Downloads\DogBot\src\commands\moderating\createchannel.js:22:13)
    at module.exports (C:\Users\Cools\Downloads\DogBot\events\guild\message.js:38:21)
    at Client.emit (events.js:219:5)
    at MessageCreateHandler.handle (C:\Users\Cools\Downloads\DogBot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (C:\Users\Cools\Downloads\DogBot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:108:65)
    at WebSocketConnection.onPacket (C:\Users\Cools\Downloads\DogBot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:336:35)
    at WebSocketConnection.onMessage (C:\Users\Cools\Downloads\DogBot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:299:17)
    at WebSocket.onMessage (C:\Users\Cools\Downloads\DogBot\node_modules\ws\lib\event-target.js:120:16)
    at WebSocket.emit (events.js:219:5)
    at Receiver.receiverOnMessage (C:\Users\Cools\Downloads\DogBot\node_modules\ws\lib\websocket.js:789:20)
(node:5968) 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:5968) [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.```
earnest phoenix
#

its self explanatory

#

smh

hoary elm
#

Lol maybe try making it message.guild how it is in the rest of the command 🤷🏻‍♂️

earnest phoenix
#

Hey, I need help

#
const Discord = require("discord.js");

module.exports = async (client, message) => {
if(message.author.bot) return;
if(message.author.id == client.user.id) return;
if(message.channel.name.includes("staff")) return;
let logBTN = client.db.setguild.get(message.guild.id, "loggingBTN");
if(logBTN !== true) return;
let chn = client.db.setguild.get(message.guild.id, "loggingCHN");
if(chn == null) return;  
  
let embed = new Discord.RichEmbed()
            .setTitle(`A message was deleted`)
            .setDescription(`▫️Author: \`${message.author.tag}\`
▫️ Content: \`${message.content.length >= 1 ? message.content.substring(0,960) : '-' }\`
▫️ Message ID: \`${message.id}\`
▫️ Channel: <#${message.channel.id}>`)
            .setTimestamp()
            .setColor(client.scolor)
            .setFooter(`${client.user.username}#${client.user.discriminator}`, client.user.avatarURL)

    let c = message.guild.channels.get(chn);
    c.send({embed}); 
};
``` my messageDelete.js
#

event

#

Whenever a user delete's a embed message it returns -

#

Is there any way I could get like the message is deleted is a embed?

soft flare
#

who can give me a simple server.js for glitch com?

#

cuz i cant use embed messages

earnest phoenix
#

@soft flare self host your bot

soft flare
#

i did...

#

i need a full model of Embed

#

its gives me erroe Token...

#

And how can i make a file.js to run exemple server.js is running by package.json how can i make more?

#

dm me for Suggestion or Awnser

cerulean pebble
#

@soft flare i can't see anything

soft flare
#

press on it

#

and zoom

#

oh your are on pc

#

let me try again

earnest phoenix
#

i mean

#

if people are on pc

#

they can always click "open original"

#

i wasnt talking about you

soft flare
#

;_;

#

bruh

copper cradle
#

how old are u

soft flare
#

any suggestion ?

#

how make moderation.js to run?

earnest phoenix
#

dont use glitch is one but ik thats not very helpful

soft flare
#

too

earnest phoenix
#

;p

soft flare
#

but what i use?

#

i finally made by bot to run

earnest phoenix
#

eh im just very against free services. but idk anything about js ;p

soft flare
#

glitch have discord.js

earnest phoenix
#

lol

#

ok?

#

i mean.

soft flare
#

wut

earnest phoenix
#

you can literally install discord.js on any vps so-

#

i would never run my bot on glitch or any other free services

#

^

soft flare
#

i hosted my bot 24/7

earnest phoenix
#

until it actually gets people using it

gleaming narwhal
#

i prefer heroku for hosting and if you have a github account you can have 200$ credits for spending on heroku with student program

soft flare
#

its set on private

earnest phoenix
#

ah

#

i mean i just use my laptop

#

a rdp is what i use to run my bot on can edit my files any where i go 😏

#

i mean

#

i just remote into said laptop

#

or i can just push to my github repo and restart my bot so

#

i dont need to be dragging files to vps and then run it again

soft flare
#

just tell me how can i run any js...

earnest phoenix
#

nadeko again i dont either

#

i literally push to /master and restart my bot with %die

#

once i finish my bot auto restarts

#

and boom its running

#

xD

#

lol

#

vps is slow sometimes as well

soft flare
#

ok nobody is useful

earnest phoenix
#

ok dont insult people cuz no one can help you atm

#

@soft flare get a vps if u want to run your bot

soft flare
#

my bot is running non stop

earnest phoenix
#

or hell. a raspberry pi

#

lol

#

what

#

i run a bot on it

#

not ansura

#

but a private bot

#

what u run your bot on?

#

me?

#

yes

#

ansura and a self-hosted nadeko run on a laptop

#

kaede (private) runs on a rpi

#

oh

#

sometimes some of those vps will delete your file then u have to start all over

#

i have kaede set to run as a service and the rpi to go into usb otg so i can actually just plug the pi into my laptop, copy files, and plug it back into its power supply

#

laptop running bots also acts as a router for my pi cuz uni wifi is dumb

#

(wpa2 enterprise - raspbian doesnt like that)

#

lol

soft flare
#

im just happy cuz finally i made by bot running

earnest phoenix
#

good

#

glad i dont have to run mine on pc and have it running 24/7

#

i mean its a spare laptop

#

my old one

#

before i upgraded

#

yh

#

just a baby i5 dual core

#

what i realize some of the bots here doesnt show the owner in serverinfo like it says undefined samething with my bot

#

-bots @earnest phoenix

gilded plankBOT
earnest phoenix
#

ohhh

#

that could happen if the owner deletes their acct

#

oh

soft flare
#

i just did some basic stuff

earnest phoenix
#

some bots in here shows it

#

cry actually found an endpoint to tell if a user is deleted

soft flare
#

and i did to make him to put a status

earnest phoenix
soft flare
#

-bots @soft flare

gilded plankBOT
earnest phoenix
#

@earnest phoenix does your bot show owner on serverinfo?

#

this will 404 we think when passed an ID of a deleted user

#

and i dont have a server info command

#

oh

#

not yet

#

im trying to not add features that arent handy and aren't related to gaming

#

yh

#

like it isnt gonna have moderation commands

#

but it'll have profile lookups for as many platforms as i can get an api key for

#

if the owners account is deleted why some bots show it and some doesnt kinda weird

#

dunno

#

could also be the owner isnt cached?

#

depending on the lib?

#

nah

#

i tried it with a discord.js bot showed the owners name and tag but mines doesnt do that says user undefined

#

again, cache

#

or you messed something up

#

not really it works in other servers good

#

let me show u in test 2 channel

#

then imma blame it not being cached for one reason or another

#

hmm

gritty frost
#
bot.on('guildMemberAdd',member =>{


    const channel = member.guild.channels.find(channel=> channel.name === "<channelname>");
    if(!channel) return

    channel.send(`<@${member.id}> Welcome to our server`)

});```
charred jetty
#

Ohk

#

But

#

It finds channel name

finite bough
charred jetty
#

If any guild don't wanna set it then they will kick the bot

finite bough
#

u can also do

gritty frost
#

yes

finite bough
#

${member}

charred jetty
#

I wanna set it for specific Channels

hearty perch
#

.

charred jetty
#

A person just told me that he uses quick.db for that

gritty frost
#

@finite bough Fix

charred jetty
#

But he didn't tell me how to do it

hearty perch
#

K eval guilds.size

charred jetty
hearty perch
#

nvm

#

not here

finite bough
#

it should fix it

hearty perch
#

just do member

#

bruh

gritty frost
#

@finite bough This not for me

finite bough
#

then for who?

gritty frost
#

This is very simple version for @charred jetty

tight plinth
#

.find

finite bough
#

if u r trying to give out a code

tight plinth
#

With djs v11, I think this is the problem

finite bough
#

spoon feeding is not allowed

tight plinth
#

<#channelid> @gritty frost

finite bough
#

@tight plinth nah

#

.find works fine

tight plinth
#

Oh

finite bough
#

u can also use .get

#

but not much of a difference

#

or fetch

#

or commit delete project

#

lnao

gritty frost
#

@tight plinth It's very old one with bugs

tight plinth
#

Like which ver

#

8?

gritty frost
#

I think **** I don't know 8 or

tight plinth
#

Upgrade to v11/v12

#

🤨

gritty frost
#

nop my F** key

quaint sorrel
#

can some boody help me with my he does not sending msg

#

`bot.on('message', msg=>{

let args = msg.content.substring(PREFIX.length).split (" ");

  switch(args[0]){
    case "ping":
    message.channel.sendMessage('pong!')
  break;
} 
})`
pale vessel
#

use message.channel.send instead

#

msg.channel.send on your case

#

you had message, which is not defined

#

i want to work on my weather command but i'm too lazy to wake up

finite bough
#

wtf

pale vessel
#

tf

finite bough
#

@quaint sorrel is msg.channel.send('pong')

#

as

#

u defined the message sent as msg

pale vessel
#

sendMessage is deprecated

quaint sorrel
#

Oh ok thx

#

but my bot still wont send a msg back

finite bough
#

discord.js version?

charred jetty
#

Done

pale vessel
#

done?

zenith terrace
#

Bun

quaint sorrel
#

12

zenith terrace
#

11

earnest phoenix
#

How do I set up my Discord bot in a DigitalOcean VPS? I am moving from Glitch to an actual VPS.

#

I am using discord.js v12

tight plinth
#

Copy ur bot files, do npm i and then npm start

#

Start it as normal

earnest phoenix
#

oh thanks

#

is it possible to connect to DigitalOcean on mobile?

restive furnace
#

yes ofc

earnest phoenix
#

how?

finite bough
#

download the files on mobile

restive furnace
#

Remote Desktop if windows, or SSH if linux

#

just search on app store/play store

earnest phoenix
#

thanks

earnest phoenix
#

does anyone know how to make this show the owner of the server?

tight plinth
#

Show code

earnest phoenix
#

message.guild.fetchMember(message.guild.ownerID).then(m => m.user.username)

torn nebula
#

message.guild.owner.user.username

tight plinth
#

Eval it and see output

#

@torn nebula no

torn nebula
slender thistle
#

Owner not cached

tight plinth
#

Oliy is online

slender thistle
#

Just d.js things

tight plinth
#

Should be cached

earnest phoenix
#

not working

amber fractal
#

That's why they were doing it right

#

Fetching owner

#

You'll need to await it though

#

Await the fetch then get the username

earnest phoenix
#

message.guild.fetchMember(message.guild.ownerID).then(m => m.user.username)

#

that is my code

amber fractal
#

Try (await message.guild.fetchMember(message.guild.ownerID)).user.username

torn nebula
amber fractal
#

They are on v11 it looks like

zenith terrace
#

@earnest phoenix JS yea?

earnest phoenix
#

yes

#

v11.5.1

#

@amber fractal didnt work

zenith terrace
#

I have it as

let owner = message.guild.owner
if(owner) owner = owner.user.tag

.addField("Owner", owner) @earnest phoenix

copper cradle
#

o w n e r

earnest phoenix
#

let me try that

zenith terrace
#

Yes

#

o w n e r

fast zenith
#

o w n e r

earnest phoenix
#

o w n e r

pale vessel
#

use ternary operator

zenith terrace
#

o w n e r

slender thistle
#

Aight let's not

earnest phoenix
#

@zenith terrace didnt work

zenith terrace
#

How big is the server ur trying?

earnest phoenix
#

this server's size

pale vessel
#

what's the problem you're having?

zenith terrace
#

Cant find the owner

earnest phoenix
#

this server

pale vessel
#

try finding the owner in cache

#

is guild.ownerID undefined?

earnest phoenix
#

message.guild.fetchMember(message.guild.ownerID).then(m => m.user.username),

#

thats what i have

pale vessel
#

oh damn 12.0.2 is out

tight plinth
#

Changes?

earnest phoenix
#

@pale vessel

pale vessel
#

@earnest phoenix

zenith terrace
#

Sometimes the bigger the server sometimes the bot cannot get the serverinfo. I had issues with it on this server as well

pale vessel
zenith terrace
#

But it worked on smaller servers

tight plinth
#

Version 12.0.2 has been released!

Bug Fixes:

  • APIRequest: only use form data when actually sending files
  • Guild: resolve role id and call existing handler
  • MessageEmbed: skip validation of fields when inside a message
  • VoiceChannel: adapt #manageable to check for CONNECT

Performance Improvements:

  • VoiceConnection: skip redundant volume transformer on join

The full (read as: same) changelog is available on GitHub: https://github.com/discordjs/discord.js/releases/tag/12.0.2

tight plinth
#

Nothing interedto'c

tight plinth
#

Interesting

pale vessel
#

please

earnest phoenix
#

@zenith terrace can u show me your bot serverinfo in testing 1

zenith terrace
#

Testing 2 since its freed up

earnest phoenix
#

yh

pale vessel
#

have you tried fetching the owner using client.fetchUser(guild.ownerID)?

earnest phoenix
#

fetchUser is so old..

pale vessel
#

he's on 11

earnest phoenix
#

is he still on 11?

#

oh

torn nebula
#

message.guild.fetchMember(message.guild.owner, true)

earnest phoenix
summer torrent
#

resolve promise

#

async/await

earnest phoenix
#

already tries that sameting

torn nebula
#

message.guild.fetchMember(message.guild.owner, true).then(u => u.id) or just user...

summer torrent
#

message.guild.ownerID

earnest phoenix
#

didnt work

pale vessel
#

does fetchmember accept a member object?

zenith terrace
#

Again it is gonna be hard to find the owner of here since its a big server

fast zenith
#

^

regal saddle
#

what is the problem here?

earnest phoenix
#

my bot serverinfo cant find the owner for here

zenith terrace
#

Have you tried the bot on a smaller server?

earnest phoenix
#

yes

summer torrent
#

message.guild.fetchMember(message.guild
.ownerID)

fast zenith
#

it's 11 right @earnest phoenix ? or are you using 12 ?

zenith terrace
#

Ye

fast zenith
#

kk

zenith terrace
#

11

#

I hate this stupid V12 update

summer torrent
#

message.guild.fetchMember(message.guild
.ownerID)
@earnest phoenix try this

earnest phoenix
#

v11

fast zenith
#

do you have fetchAllMembers true?

earnest phoenix
#

YES

summer torrent
#

🤦

regal saddle
summer torrent
#

@earnest phoenix try this
Just try this

#

message.guild.fetchMember(message.guild
.ownerID)

manic light
#

anyone know this error ?

(node:14811) 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: 645)
(node:14811) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 162.....
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1097:14)

regal saddle
#

anyone know this error ?

(node:14811) 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: 645)
(node:14811) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 162.....
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1097:14)

async without function?

#

missing }?

manic light
#

missing }?
@regal saddle i dont think so

rugged minnow
#

ok so, i wanted to get the .joinedAt (GuildMember) of the user, i fetch a user with .getUser, but i don't know how to get the GuildMember propriety on the user

earnest phoenix
#

@summer torrent i did still not showing anything

manic light
#

async without function?
@regal saddle maybe this one hmm

regal saddle
#

can i see your code?

manic light
#

i dont know which code is wrong

west raptor
#

give the full stacktrace

fast zenith
#

You don't have a catch but it looks like a connection timed out causing it to error

#

honestly not much to go off from that

manic light
#

give the full stacktrace
@west raptor i cant sorry

west raptor
#

why

regal saddle
#

.catch(); is missing...But where?

west raptor
#

if you gave the full error/stacktrace we could figure out where in the code there's an issue

regal saddle
#

async function without a catch block, or by rejecting a promise which was not handled with .catch().

manic light
fast zenith
#

the full stracktrace would say what line is at fault or where it's hanging

#

that's your issue

regal saddle
#

bruh

fast zenith
#

it's timing out while connecting to that TCP connection

#

and you don't have any catch so it just errors since it fails

torn nebula
#

your on master?
bot have shards?

#

d.js issue
even i had same issue Fixed

manic light
#

i have shards

torn nebula
#

they said ^ when i asked in d.js

manic light
#

i was add so much try catch

cunning glen
#

@manic light reload panel

manic light
#

maybe i miss something

#

@manic light reload panel
@cunning glen ye i know but its coming all time

cunning glen
regal saddle
manic light
#

and after 2-3 hours

#

bot stoppi,ng

#

its online but commands not working XD

fast zenith
#

@manic light try generating a new token, maybe check how many requests your bot is making to the discord api

manic light
#

cuz of this sh*t

fast zenith
#

because you can get blacklisted temporarily if you make too many causing your bot to essentially die as it fails to connect

manic light
#

okey

fast zenith
#

as some other information as well that might be useful for you aswell

regal saddle
#

Embeds got changed?

#

bruh moment

earnest phoenix
#

huh?

fast zenith
#

Embeds haven't changed for ages?

regal saddle
#

in v12 they got changed?

#

or am i wrong

fast zenith
#

used to be RichEmbed now it's MessageEmbed
https://discord.js.org/#/docs/main/master/class/MessageEmbed

zenith terrace
#

Changed from RichEmbed to MessageEmbed

regal saddle
#

oh ok, my bad

earnest phoenix
#

Does anyone know how to use Termius SSH Client to connect to their Linux VPS? Because I can’t type anything in the teminal.

white anvil
#

try just tapping the screen

#

keyboard tends to pop up if you do that

earnest phoenix
#

the keyboard is already up but it just wont record my inputs

#

Why my bot not added tell me all developer

#

<@&304313580025544704>

white anvil
#

do you have a decent connection to the server

zenith terrace
#

@earnest phoenix you gotta wait

white anvil
#

it’s just a ssh stream so if your connection is bad it will probably lag or not load at all

earnest phoenix
#

Seen bot don't added in discord bot list

white anvil
#

because it hasn’t been approved yet

#

you need to wait a couple of weeks

earnest phoenix
#

I am added 05/03/2020 but Bot don't added

#

Bro

tight plinth
#

Wait

#

It's 1-2 weeks

#

So yea just wait

earnest phoenix
#

Ok

lyric mountain
#

lol, it's only been 4 days

coral trellis
#

-atmods

gilded plankBOT
#

Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.

Here are some examples of emergencies:

  • Raids / Multiple members mass spamming.
  • Severe disruption of Discord's ToS (NSFW content, etc)
  • Anything that requires more than 2 moderators to handle.
earnest phoenix
#

My bot automatically restarted

#

and started installation and shows that error

maiden kayak
#

Alright, I've been trying to get a bot up and running (first time) and ive hit a brick wall so very hard that even now, half an hour after giving up, my heads still spinning. Im following the https://www.sitepoint.com/discord-bot-node-js/ guide for how to get a bot online, however im afraid that even the most basic of coding listed here is anathema to me. I use VSCode (the latest version) and Node.js. I copied the repository locally, opened it in VSCode, ran npm install dotenv as well as npm install discord.js
the next step says "Lastly, to complete the installation, create a .env file in the root of the project. Add one environment variable called TOKEN to the file like this: TOKEN=my-unique-bot-token wherein lies my problem. I dont know where the Root is, nor do I know hoe to create a .env file. On top of that, I am unsure what an Enviromental Variable is. I am more than willing to provide any screenshots or more in depth explination of someone is willing to help me figure out whats wrong. If someone does for whatever reason feel like helping, please DM me or @ me in this channel. Thank you in advance,

-Ikit Cawl

Michiel Mulders shows you how to install and set up a new Discord bot, which is made easier thanks to the API offered by the Discord.js package.

earnest phoenix
#

The root is quite literally the root directory, the main directory of the project, where everything originates from, to create an env file you can create a new file in vsc and give it a custom extension of .env

maiden kayak
#

Do i name it something?

charred jetty
#
  static async verify(channel, user, time = 30000) {
    channel.awaitMessages(
      m =>
        m.author.id == user.id &&
        yesno.includes(m.first().content.toLowerCase()), {
          time: 30000,
          max: 1,
          errors: ["time"]
        })
          .then(collection => {
            let msg = collection.first().content
              ? collection.first().content.toLowerCase()
              : null;
            if (yes.includes(msg)) return true;
            if (no.includes(msg)) return false;
          })
          .catch(err => {
      console.log(err)
            return false;
          })```
m.first() is making problem
maiden kayak
#

Im gonna guess i just have to name it .env

#

as for an Enviromental Variable, is that just imputting a line of code saying TOKEN=my-unique-bot-token
?

#

i have this nagging feeling that my bot token goes in place of "my-unique-bot-token" however the way its worded makes me think otherwise, since it dosent contain parentheses. Perhaps it dosent need them?

tight plinth
#

E

maiden kayak
#

perhaps i should start over with the pinned Discord Bot guide...

#

it seems like i was misunderstandsing the use for the pinned bot guide

severe gyro
#

Does anyone know of a bot testing framework for JS?

#

Like Mocha or Jasmine, but for bots

#

Yes?

#

Why can't you just call .react() twice?

maiden kayak
#

can anyone make sense of this? the token provided is the one i copied of my dev page so it shouldnt be invalid. or at least i dont think it should be?

pale vessel
#

make sure it's the token under bot

maiden kayak
#

Thanks i wasnt using the right one

#

However the problem persists

pale vessel
#

what's the new problem?

maiden kayak
pale vessel
#

or is it the same error?

maiden kayak
#

same error

#

im thinking its something wrong with the package.json

pale vessel
#

i don't think so

#

try regenerating your token

fast zenith
#

^

earnest phoenix
#

^

#

The package.json shouldn't be effecting anything

pale vessel
#

it would've said missing module instead

earnest phoenix
#

ye

maiden kayak
#

OH!

#

IT WORKED!

pale vessel
#

nice

maiden kayak
#

holy christ on a cheeze-it it worked

fast zenith
maiden kayak
#

ive been going at it for...

#

7 hours now?

pale vessel
#

oh damn

earnest phoenix
maiden kayak
#

its 7am

pale vessel
#

better late than never

#

so congrats

fast zenith
maiden kayak
#

thank y'all so much

limpid raptor
#

Hey, can someone help me ? It's a discord.js module bug, what should I do ? I already tried to uninstall reinstall

pale vessel
#

catch(err)

#

it should be like that

summer torrent
#

no

#

what is your node js version

amber fractal
#

^

#

Outdated node version most likely

limpid raptor
#

I will check @summer torrent

summer torrent
amber fractal
#

v12 requires node v12 too

limpid raptor
#

But I never touch to version and it worked perfectly before

amber fractal
#

Stable was just updated to v12

pale vessel
#

no?

#

v12

amber fractal
#

I mistyped, which is why I edited

#

Calm down

pale vessel
#

ok

#

i'm perfectly calm

#

don't look at that picture

limpid raptor
pale vessel
#

8.11

limpid raptor
#

I'm bad sorry 😭

summer torrent
#

yeah

limpid raptor
#

Oh

summer torrent
#

update

limpid raptor
#

Okay

pale vessel
#

you need to update to node.js 12

limpid raptor
#

Okay I will

summer torrent
limpid raptor
#

thanks 😁

odd tendon
#

yo i’m looking for a discord bot to be developed i don’t think it will be insanely hard i just have no clue what i’m doing. DM me for more info

soft flare
#

who can tell me a model of Embed Message for Glitch.com

torn nebula
soft flare
#

error

#

all embeds stuff gives me error

torn nebula
#

maybe your doing wrong

soft flare
#

try to build it yourself

#

and give it

#

maybe im fool

torn nebula
#

😐 I build more than 100
not gonna spoonfeed

soft flare
mossy vine
#

its MessageEmbed now

#

and unexpected token is because your bracket/whatever pairs are fucked up

soft flare
#

and how i am suppose to fix?

mossy vine
#

???

soft flare
#

i mean

#

i have to reset it to 0?

torn nebula
soft flare
#

mehmmh

#

how about this **const exampleEmbed = new Discord.RichEmbed()
.setTitle('Some title')
.attachFiles(['../assets/discordjs.png'])
.setImage('attachment://discordjs.png');

channel.send(exampleEmbed);**

#

?

torn nebula
#

good

soft flare
#

ok let paste it

torn nebula
#

url must be valid

soft flare
#

i will add a image in assets

#

and post it in there right?

#

the pairs error still there

#

how can i fix this...

torn nebula
#

})
client.login
maybe depends on code

soft flare
#

oh?

fast zenith
#

if it's a static image you can just use a service like imgur to upload it saves needing to upload to discord each time

soft flare
#

i deleted it accidentally...

#

ok no more error

#

let test

torn nebula
#

make sure it's reload and online back

soft flare
#

you know packaxe.json make server.js to run

#

and i want to make another one

#

i restarted

torn nebula
#

New File Button

soft flare
#

no awnser

#

ye ?

#

i created it already

#

its called moderator.js

#

you can join the server and take a look

restive furnace
#

const file = require(file); on the main file.

soft flare
#

server.js or packaxe.json?

mossy vine
#

@soft flare i suggest you learn basic javascript before making a bot

soft flare
#

i suggest to help me

#

i know some of them

#

ok let me try

restive furnace
#

learn all of js. not just some.

finite bough
#

@soft flare no

elder garnet
#

i am trying to make my bot play audio the bot joins the VC and discord shows that its playing the audio but it isn't

if (msg.member.voiceChannel) {
msg.member.voiceChannel.join()
.then(connection => { // Connection is an instance of VoiceConnection
msg.reply('I have successfully connected to the channel!');
const dispatcher = connection.playFile('K:/audios/audio.mp3');
})
.catch(console.log);
 } else {
 msg.reply('You need to join a voice channel first!');
}
finite bough
#

u cant read a pic from assets

#

on glitch

earnest phoenix
#

Hello i have a probleme with my discord bot (node:13) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function at Function.normalizeFields (/home/container/node_modules/discord.js/src/structures/MessageEmbed.js:433:8) at MessageEmbed.addFields (/home/container/node_modules/discord.js/src/structures/MessageEmbed.js:249:42) at MessageEmbed.addField (/home/container/node_modules/discord.js/src/structures/MessageEmbed.js:240:17) at Object.run (/home/container/commands/help.js:15:14) at process._tickCallback (internal/process/next_tick.js:68:7) (node:13) 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:13) [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.

torn nebula
#

fields.flat not a thing ig

elder garnet
#

@earnest phoenix fields.flat is not a function

earnest phoenix
#

And how to solve my probleme ?

#

I replace fields.flat with ?

elder garnet
#

you can make a function by doing

function fields.flat() {

}
#

and put your code inside that

earnest phoenix
#

in my help.js

elder garnet
#

in the file you have "fields.flat" in

earnest phoenix
#

Were ? ```const {
MessageEmbed
} = require('discord.js');

module.exports = {
name: 'help',
category: 'bot',
async run(client, message) {
var commands = client.commands;
var commandList = new MessageEmbed()
.setAuthor(message.author.username, await message.author.displayAvatarURL(), client.opt.url)
.setDescription(Voici la liste de mes commandes | prefix: ${client.opt.prefix})
.setThumbnail(await client.user.displayAvatarURL())
.setColor(client.opt.color)
.addField('Bot', '' + commands.filter(e => e.category === 'bot').map(c => c.name).join(', ', true) + '')
.addField('Music', '' + commands.filter(e => e.category === 'music').map(c => c.name).join(', ', true) + '')

    message.channel.send({
        embed: commandList
    }).catch(console.error);
}

}```

elder garnet
#

put it at the end

#

before "module.exports = {"

earnest phoenix
#

This ?

const {
    MessageEmbed
} = require('discord.js');
function fields.flat() {

}

module.exports = {
    
    name: 'help',
    category: 'bot',
    async run(client, message) {
        var commands = client.commands;
        var commandList = new MessageEmbed()
            .setAuthor(message.author.username, await message.author.displayAvatarURL(), client.opt.url)
            .setDescription(`Voici la liste de mes commandes | prefix: ${client.opt.prefix}`)
            .setThumbnail(await client.user.displayAvatarURL())
            .setColor(client.opt.color)
            .addField('Bot', '`' + commands.filter(e => e.category === 'bot').map(c => c.name).join('`, `', true) + '`')
            .addField('Music', '`' + commands.filter(e => e.category === 'music').map(c => c.name).join('`, `', true) + '`')
            

        message.channel.send({
            embed: commandList
        }).catch(console.error);
    }
}```
elder garnet
#

yes

earnest phoenix
#

But my bot crash :/

elder garnet
#

oh

#

wait

earnest phoenix
#

Ok

elder garnet
#

it seems fine with me

copper cradle
#

if you're asking, where should I put a function, then you should question your knowledge as a dev

earnest phoenix
#

I start in dev

elder garnet
#

to trigger the function do fields.flat()

pale vessel
#

shouldn't it be run: async (client, message) { ?

earnest phoenix
#

no

copper cradle
#

it is whatever you want

#

it's a fucking function

#

add the params you want

pale vessel
#

i meant the fact that it's an object. you can't put a function out of nowhere

tight plinth
#

It should be async run: (client, message)

pale vessel
#

why are you salty

copper cradle
#

well yes

mossy vine
#

@tight plinth no

#

lmao neither of those are correct

earnest phoenix
#

@elder garnet Have a solution ?

tight plinth
#

Erp

#

Try async run

#

Works for me

elder garnet
#

wait

#

i will have a look at how you trigger the function

earnest phoenix
#

Ok

#

@tight plinth what ?

tight plinth
#

async run: (client, message) {

earnest phoenix
#

i test

#

no it's an error

elder garnet
#

@earnest phoenix you need to put something in the function so whenever you type "fields.flat()" it runs the script inside that function

earnest phoenix
#

i put all help.js in function .

elder garnet
#

?

earnest phoenix
#

is this about the fields.flat thing

elder garnet
#

yeah

earnest phoenix
#

because none of you are helping

#

just update node

pale vessel
#

didn't scroll

elder garnet
#

lol

pale vessel
#

i'm rarted

earnest phoenix
#

@earnest phoenix I'm in serveur but i didn't do this

elder garnet
#

@earnest phoenix i guess you need to update node from https://nodejs.org/en/

earnest phoenix
#

discordjs now requires a minimum of node 12 iirc

pale vessel
#

yes

earnest phoenix
#

But i'm in server

#

i didn't do this

#

i didn't update

pale vessel
#

you need to update

earnest phoenix
#

I contact Pterodactyl Panel for update a panel to a new version to node js

elder garnet
earnest phoenix
#

I'm in server !

#

But i didn't update node js

elder garnet
#

you need to update node.js for it to work

earnest phoenix
#

Mon bot est sur une machine

restive furnace
#

bruh moment #1

elder garnet
#

that is french

earnest phoenix
#

Oh sorry

elder garnet
#

"my bot is on a machine"

#

its ok

earnest phoenix
#

My bot is on a machine

#

Yes

#

Bruh xD

elder garnet
#

and install it

#

and yer done

finite bough
#

posting ur bot on ur machine Is a bad idea

earnest phoenix
#

I don't have to update node js on the machine

finite bough
#

download it

#

.

#

oh

#

auto update

elder garnet
earnest phoenix
elder garnet
#

its ok

#

maybe contact them to update nodejs

#

idk

earnest phoenix
#

Oh no it's to long pandasad

finite bough
#

what is so long

earnest phoenix
#

To contact my hosting

#

to update nodejs

lilac wharf
#

@earnest phoenix you should be able to use the terminal they have to update nodejs if I'm not mistaken. if not then that's my bad ^-^

earnest phoenix
#

How?

copper cradle
#

again

#

if you're askin' this kind of questions...

lilac wharf
#

Google is your friend for that Tapaque.

summer torrent
#

what is messageSent[1]

pale vessel
#

message that is split by spaces maybe

gritty frost
fast zenith
#

It's because you are checking if it isn't tail but your sending tail so it's false

gritty frost
#

I want this file

#

How to download

#

It

#

Anyone

#

Anyone have mention me pls

modest maple
#

@gritty frost why?

summer torrent
#

google it @gritty frost

gritty frost
#

No search it

#

@modest maple files missing

#

@summer torrent I can't find it

modest maple
#

wdym files missing Thonk

summer torrent
gritty frost
#

🥺

earnest phoenix
#

this is my code

const { RichEmbed } = require("discord.js");
const { getMember } = require("../../functions.js");

module.exports = {
    name: "dm",
    aliases: ["message"],
    category: "fun",
    description: "dms a user :O",
    usage: "[mention | id | username]",
    run: async (client, message, args) => {
        if (!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send(`${message.author}You don't have permission! **You need BAN_MEMBERS perms for this**`);
        let user = getMember(message, args[0]);

        if (!user) {
            message.chanel.send("give me a mention/userid to mesasge");
        }

        const embed = new RichEmbed()
            .setColor("RANDOM")
            .setDescription(args.slice(1).join(" "));
        try {
            user.send(embed).then(message.react("✅")).catch(() => {})
          }
        }
    }
}

and i get this error

restive furnace
#

missing catch(e) {} after try { user.send(embed) blablabla }

#

example of using try and catch

console.log("successfull");
} catch(e) {
console.log(e.stack);
}```
#

basic js

wheat jolt
#

what's the difference between Attachment.proxyUrl and Attachment.url?

#

d.js

earnest phoenix
#

i have a music bot that doesnt play music from youtube. What should i do?

golden condor
#

@earnest phoenix what music do you uze

earnest phoenix
#

youtube music

golden condor
#

What library do you use

earnest phoenix
#

discord.js in Glitch

golden condor
#

Ok

#

What is the music package you use

#

ytdl-core?

earnest phoenix
#

yes

golden condor
#

Ok, do you have a YouTube API key?

earnest phoenix
#

no

golden condor
#

You need one

earnest phoenix
#

where can i get it?

golden condor
#

Hold on

#

I will send a guide

#

@earnest phoenixsearch up YouTube API key

earnest phoenix
earnest phoenix
#

nvm

limber saddle
summer torrent
#

what is your djs version

limber saddle
#

discord.js ?

tight plinth
#

Yes

limber saddle
#

12.0.2

summer torrent
#

MessageEmbed

#

RichEmbed renamed in v12

limber saddle
#

Oh i din't know thanks !

gilded ether
#

Can anyone help me with a super simple discord bot that writes and reads to a JSON file?

lyric hawk
#
Exception ignored when trying to write to the signal wakeup fd:
BlockingIOError: [Errno 11] Resource temporarily unavailable
#

My bot becomes inactive after a while

#

How can this be solved?

gilded ether
#
        editedmessage = message.content.slice(prefix.length);
        
        client.msgs [message.author.username] =  {
            T6PB: "Yes",
            }



            fs.appendFile ("./msgs.json", JSON.stringify (client.msgs, null , 4), err => {
                if (err) throw err;

                
                message.reply ("I have stored that you can" + editedmessage);
            
            });

            
    
        
        }

        if (message.content == (prefix + " craft T6 plate armor")) {
            editedmessage = message.content.slice(prefix.length);
            
            client.msgs [message.author.username] = {
                T6PA: "Yes",
                }
    
    
                fs.appendFile ("./msgs.json", JSON.stringify (client.msgs, null , 4), err => {
                    if (err) throw err;
    
                    
                    message.reply ("I have stored that you can" + editedmessage);
                
                });
    
                
        
            
            }```
#

I have this code to write to a JSON file

#
    "BigTibbies": {
        "T6PA": "Yes"
    }
}{
    "BigTibbies": {
        "T6PB": "Yes"
    }
}```
#

It outputs like that

#

How can i get the T6PB under the first "BigTibbies" instead of creating a new one?

quartz kindle
#

You cant use appendFile with json

#

It breaks the json structure and makes it unusable

#

Also, doing something = { etc:etc } will replace the entire object, since youre defining a new one from scratch

#

To add to an existing object you do something.etc = etc

#

You just need to check if the object exists before adding

tame prairie
#

can u help me i want to do my music bot but when i try to define song its says me error

#
  const serverQueue = queue.get(message.guild.id);
  if (!serverQueue) {

}else {
 serverQueue.songs.push(song);
 console.log(serverQueue.songs);
 return message.channel.send(`${song.title} has been added to the queue!`);
}
#

"song is not defined"

quartz kindle
#

Well did you define song?

tame prairie
#

i did it but its jump me error

#

what can i do?

quartz kindle
#

Show where you define song

tame prairie
#

i just dont defined idk how to srry if i lie XD

quartz kindle
#

Youre trying to add a piece of data called "song" to the queue

#

But what is "song"? Where does it come from? What does it contain?

#

Your code doesnt magically know that

tame prairie
#

Ik

quartz kindle
#

You need to tell is exactly what to do

tame prairie
#

:/

#

Ok?

quartz kindle
#

So where does song come from?

tame prairie
#

Mhh from my library?...

quartz kindle
#

In your code, do you have let song = something anywhere?

#

You need to tell your code what the value of song is supposed to be

tame prairie
#

wait a minute

#

brb

#

gtg

limber saddle
#

${client.guilds.size}
${client.users.size}
After i updated discord.js to v12 now my bot say undefined
Sorry for disturbing your time. You the guys who is reading this.
Thanks for taking your time for my problems.

solemn quartz
#

Guys what cmd do you suggest me to do?

quartz kindle
#

@limber saddle there is a guide on updating v11 to v12, check it out

limber saddle
#

Ok, Where? Sorry for disturbing

earnest phoenix
#

checkcircle ^

quartz kindle
limber saddle
#

Ok

#

Thanks

solemn quartz
#

Guys what cmd do you suggest me to do? (2)

earnest phoenix
#

What is the bot's main purpose?

solemn quartz
#

everything

grim aspen
#

wdym by everything

finite bough
#

@earnest phoenix depends

#

if it's a moderation bot

earnest phoenix
#

Why'd you ping me D:

finite bough
#

kick,ban,mute

#

and if it's a fun bot

#

games, avatar edits etc

earnest phoenix
#

I was asking BG what kind of bot it is so I could suggest a command.

finite bough
#

wrong channel

earnest phoenix
#

:p

solemn quartz
#

of moderation i only did kick, ban and clear

earnest phoenix
#

Maybe for moderation do lockdown-channel?

finite bough
#

ur wish

solemn quartz
#

i just fucking got pinged 5 times in 10 minutes in the same fucking server

#

i wanna die

#

Maybe for moderation do lockdown-channel?
@earnest phoenix idk

#

should I?

#

Im here to ask suggestions :p

earnest phoenix
#

TohruShrug Your choice

solemn quartz
#

:|

quartz kindle
#

Look at what other bots are doing

#

And see if you like anything

#

Or just wait until you come up with something

solemn quartz
#

oki

#

Or just wait until you come up with something
@quartz kindle the next eternity

plucky jewel
#

heeeelp meee

finite bough
#

@plucky jewel ur problem pls

plucky jewel
#

not build my bot to heroku

#

error

quartz kindle
#

Show error show code explain

finite bough
#

no

plucky jewel
#

error:

finite bough
#

show error show code show explain

#

did u try going to that link?

plucky jewel
#

no)))))))))) i am silly

finite bough
plucky jewel
#

i am not understand

#

I can’t understand how to put this language so that it understands

lyric mountain
#

you what

plucky jewel
#

its so hard to me

#

help

lyric mountain
#

which language do you speak?

plucky jewel
#

russian)

lyric mountain
#

omg

cursive dagger
#

You dont have the required files for heroku

#

Procfile etc

plucky jewel
lyric mountain
#

have you selected a buildpack on heroku's dashboard?

plucky jewel
#

what

#

i am not understand

lyric mountain
#

just a second

plucky jewel
#

oh

lyric mountain
plucky jewel
#

wait

earnest phoenix
#

Why does this happen when using discord.js and trying to get the uptime of my bot? (Note: I am using a VPS and a Command Handler)

module.exports = {
    name: "uptime",
    desc: "Returns bot uptime from start",
    usage: "",
    execute: async (message, args) => {

let totalSeconds = (client.uptime / 1000);
let days = Math.floor(totalSeconds / 86400);
let hours = Math.floor(totalSeconds / 3600);
totalSeconds %= 3600;
let minutes = Math.floor(totalSeconds / 60);
let seconds = totalSeconds % 60;
let uptime = `${days} days, ${hours} hours, ${minutes} minutes and ${seconds} seconds`;
message.channel.send(uptime)
}};
lyric mountain
#

integer division maybe?

earnest phoenix
#

^?

lyric mountain
#

1 / 2 is 0

#

1 / 2.0 is 0.5

plucky jewel
#

new error..

quartz kindle
#

Js doesnt differentiate ints and floats

digital ibex
#

hi

lyric mountain
#

then I'm clueless

#

@plucky jewel which one?

digital ibex
#

does anyone know how to get a role colorr?

#

ik number, but not hex

quartz kindle
#

@earnest phoenix youd problem is youre using the wrong client

lyric mountain
#

with botss

digital ibex
#

eris

slender thistle
#

Isn't it // for int div

earnest phoenix
#

The wrong client?

quartz kindle
#

Yes

earnest phoenix
#

Hm.

quartz kindle
#

The client youre using there

#

For client.uptime

#

Is not the client of your bot

earnest phoenix
#

Let me recheck my globals...

lyric mountain
#

ik number, but not hex
@digital ibex how tf do you know number colors?

digital ibex
#

wot

plucky jewel
#

oh

lyric mountain
#

like, do you mean integers?

digital ibex
#

like

quartz kindle
#

You need to either get it from the message, or send it in the execute function

earnest phoenix
#

message.client()?

#

^/()/

quartz kindle
#

Without ()

plucky jewel
#

все, мой недоангл урвался

digital ibex
#

message.channel.guild.roles.find((r) => r.name === 'some-role-name').color

#

returns a number

plucky jewel
#

буду общаться на русском

digital ibex
#

bruh

lyric mountain
#

ah, just convert it to rgb

unique nimbus
#

They are going to talk in Russian

quartz kindle
#

Does eris not have .hexColor?

unique nimbus
#

Google Translate time

digital ibex
#

not that im aware

lyric mountain
#

shiro translate time

unique nimbus
#

Большинство людей здесь говорят только по-английски @plucky jewel

plucky jewel
#

я не буду пользоваться переводчиком @unique nimbus

#

потомучто это супер костыли

quartz kindle
#

Then you need to convert it yourself

digital ibex
#

uh

#

ok

unique nimbus
#

Вы находитесь на английском сервере

quartz kindle
#

Google how to convert decimal to hex

lyric mountain
#

not that im aware
@digital ibex probably that method returns an integer

plucky jewel
#

так нету же блин такого сервера ток на русском @unique nimbus

digital ibex
#

🙃

quartz kindle
#

Yeah so eris doesnt have it

#

Just convert it yourself

lyric mountain
#

get the bytes of it:
0xFF0000FF -> red
0xFF00FF00 -> green
0xFFFF0000 -> blue

digital ibex
#

ok uh

unique nimbus
#

Тогда используйте переводчик, чтобы попытаться поговорить с нами

lyric mountain
#

shift the bytes of the value to get each channel

digital ibex
#

how would i get the a users highest role and get the colour of that?

lyric mountain
#

get the role array -> first

unique nimbus
#

Sorry for the random Russian

quartz kindle
#

Try this color.toString(16)

digital ibex
#

ok

#

uh

#

when it should be

lyric mountain