#development

1 messages · Page 1202 of 1

pale vessel
slender thistle
#

inb4 all event names are lowercase

pale vessel
#

even though you can just use guild.client

fringe axle
pale vessel
#

the message content is probably empty

#

look in your embed for potential empty values

#

such as message content

fringe axle
#

But how can I fix it that he's not sending this in console?

pale vessel
#

you can use something like message.content || "Empty"

fringe axle
#

Good idea

slender thistle
#

Wrap the .addField part in the if

#

or that

viral iris
#

idk its your code?
@lusty quest what it should be

lusty quest
#

depends on your code. Idk for what you used the key you get out the forEach loop

weak rain
#
    at Client.<anonymous> (E:\Thunder\server.js:118:38)
    at Client.emit (events.js:315:20)
    at Object.module.exports [as GUILD_CREATE] (E:\Thunder\node_modules\discord.js\src\client\websocket\handlers\GUILD_CREATE.js:33:14)
    at WebSocketManager.handlePacket (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
    at WebSocketShard.onPacket (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
    at WebSocketShard.onMessage (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
    at WebSocket.onMessage (E:\Thunder\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)
    at Receiver.receiverOnMessage (E:\Thunder\node_modules\ws\lib\websocket.js:797:20)
    at Receiver.emit (events.js:315:20)
(node:8592) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, 
use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8592) [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.
misty sigil
#

Codeeeeeeee?

pale vessel
#

@weak rain

#

remove client

weak rain
#

kk

misty sigil
#

ngl he’s tracking a nasty amount of data

hushed crane
#

Where did I go wrong?

misty sigil
#

error?

hushed crane
#
/storage/emulated/0/jarvis/commands/owner/restart.js:15
      let embed = new MessageEmbed()
      ^^^

SyntaxError: Unexpected identifier
    at wrapSafe (internal/modules/cjs/loader.js:1167:16)
    at Module._compile (internal/modules/cjs/loader.js:1215:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1272:10)
    at Module.load (internal/modules/cjs/loader.js:1100:32)
    at Function.Module._load (internal/modules/cjs/loader.js:962:14)
    at Module.require (internal/modules/cjs/loader.js:1140:19)
    at require (internal/modules/cjs/helpers.js:75:18)
    at /storage/emulated/0/jarvis/handlers/command.js:19:24
    at Array.forEach (<anonymous>)
    at module.exports (/storage/emulated/0/jarvis/handlers/command.js:11:32)
viral iris
#

@lusty quest is there another way and easier to make timeout in forEach

lusty quest
#

this one is already easy AF there is probably one but i would need to use Google to find it

earnest phoenix
lusty quest
#

for loops are basic Js idk what the issue is

viral iris
#

this one is already easy AF there is probably one but i would need to use Google to find it
@lusty quest it's not easy?

lusty quest
#

lol just run a async loop and call a async function in it. idk how much easier you could make it

viral iris
#

i did

#

not working

lusty quest
#

there is probably a way to do it in a foreach loop but i dont know the answer and would need to google it

pale vessel
#

you can't

#

forEach just loops through everything without waiting

viral iris
#

i tried this but :
send 5 embed then wait 5sec but i need it send 1 embed then wait 5 sec

lusty quest
#
var items = document.querySelectorAll('.item'), i;

for (i = 0; i < items.length; ++i) {
  // items[i] <--- your element
}
``` in your Stack overflow page. just add the sleep to it at the end
#

make the loop async and you can use the await sleep function i sended you

#

there are more ways to do it down the article

viral iris
lusty quest
#

there is somewhere else an error

#

you still cant run async stuff inside a forEach loop

#

forEach iliterate over every item in the array without waiting

viral iris
#

you still cant run async stuff inside a forEach loop
@lusty quest if move it sleepis not defined

lusty quest
#

?

#

you cant use a function that needs to run async inside a forEach loop

viral iris
#

then how

misty sigil
#

What

viral iris
#

wtf

#

no self promo

slender thistle
#

Well

earnest phoenix
#

hmm

knotty obsidian
#

why wont my bot respond to commands

misty sigil
#

lib?

knotty obsidian
#

rary

misty sigil
#

???

knotty obsidian
#

these ones?

misty sigil
#

So a jda bot?

knotty obsidian
#

yess

#

i guess

misty sigil
#

No idea sorry

earnest phoenix
#

AYYYY intellij gang

knotty obsidian
#

;-;

earnest phoenix
#

@knotty obsidian have you do

#

.queue() after everything?

knotty obsidian
#

yes

earnest phoenix
#

show code

knotty obsidian
#

the bot worked before

#
String raw = event.getMessage().getContentRaw();
if (raw.startsWith("S!")) {
  if (raw.replace("S!", "").equals("ping")) {
    if (event.getJDA().getGatewayPing() > 100) {
      event.getChannel().sendMessage("My Ping is: " + event.getJDA().getGatewayPing() + "\n... Great!").queue();
    } else {
      event.getChannel().sendMessage("My Ping is: " + event.getJDA().getGatewayPing()).queue();
    }
  }
}```
#

ma code

#

the bot worked fine

#

just i forgot to turn it on one day

#

todya

#

it dead

earnest phoenix
#

hmmm

knotty obsidian
#

the latest release is 4.2.0, i checked

earnest phoenix
#

first args?

#

i mean

#

raw.replace("S!", "").equals("ping") return all the content

#

for example

#

S!gsdgsd sdiojgjeosg

#

the code will return

#

gsdgsd sdiojgjeosg

#

so you should split it into string[]

#

and get the first string[]

knotty obsidian
#

thats just the say command-

earnest phoenix
#

heuh

#

why doesn't iwrok

knotty obsidian
#

im not improving the code, im trying to fix the bot

earnest phoenix
#

yeah

#

the reason why it doesn't work

#

is cuz

#

yall know

knotty obsidian
#

its dead all the sudden ;-;

earnest phoenix
#

lemme try it

knotty obsidian
#

it worked befor

earnest phoenix
#

1 sec

knotty obsidian
#

they deleted the bot

#

jk

#

xd

#

can it be my wifi

#

cuz currently its in badddd

earnest phoenix
#

1 second

knotty obsidian
#

no

#

let me type out everything

#

2020-08-28, The bot worked fine, it responded to commands and I didn't do anything with it.

#

2020-08-29, I forgot to run the bot.

#

2020-08-30, I wanted to run the bot, it worked but it didn't respond to commands

earnest phoenix
#

did you change anything with the code?

knotty obsidian
#

NOPE

#

0

#

i did nothing

#

i tried to run the code on a diffrent bot, it worked and it also sent what its logged in as

#

thats what it supouse to do

#

but

#

on my bot

earnest phoenix
#

gateway issue?

knotty obsidian
#

the code is exact same

#

but it didnt work

earnest phoenix
knotty obsidian
#

idk no errors

#

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
SLF4J: Defaulting to no-operation MDCAdapter implementation.
SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.
[main] INFO JDA - Login Successful!
[JDA MainWS-ReadThread] INFO WebSocketClient - Connected to WebSocket

restive furnace
#

try make your caching policies different, since it might be this server, since yeah, 130 members here

knotty obsidian
#

what it sends

restive furnace
#

130k*

knotty obsidian
#

its supouse to send
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
SLF4J: Defaulting to no-operation MDCAdapter implementation.
SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.
[main] INFO JDA - Login Successful!
[JDA MainWS-ReadThread] INFO WebSocketClient - Connected to WebSocket
<What its logged in as>

restive furnace
#

full code pls?

knotty obsidian
#

its looong

restive furnace
#

post to hastebin

knotty obsidian
#
package me.scorpion37.ahelpfulscorpionscorpion37;

import java.io.IOException;

import javax.security.auth.login.LoginException;

import net.dv8tion.jda.api.JDABuilder;
import net.dv8tion.jda.api.OnlineStatus;
import net.dv8tion.jda.api.entities.Activity;
import net.dv8tion.jda.api.requests.GatewayIntent;
import net.dv8tion.jda.api.utils.ChunkingFilter;
import net.dv8tion.jda.api.utils.cache.CacheFlag;

public class MainCode {

    private MainCode() throws IOException{
        try {
            JDABuilder.createDefault("Token uwu").setStatus(OnlineStatus.ONLINE)
                    .setActivity(Activity.playing("Refusing To Boot Up... | S!help"))
                    .addEventListeners(new BotCode())
                    .enableIntents(GatewayIntent.GUILD_MEMBERS, GatewayIntent.GUILD_PRESENCES)
                    .enableCache(CacheFlag.ACTIVITY)
                    .setChunkingFilter(ChunkingFilter.ALL)
                    .build()
                    .awaitReady();
        } catch (LoginException | InterruptedException e) {
            e.printStackTrace();
        }
    }
    
    public static void main(String[] args) {
        try {
            new MainCode();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    
}```
weak rain
#

why not working ;-;

#

Earlier was working

restive furnace
#

hmm is there intent for guild messages or messages, scorpion? that might be the problem

tired gate
#

is there a way to disable the command prompt sending a message when the bot failed to dm someone (because they have dm's closed)?

restive furnace
#

thing.catch(err => undefined) @tired gate

knotty obsidian
#

hmm is there intent for guild messages or messages, scorpion? that might be the problem
@restive furnace ok, BUT, why did it work on the other bot while on this bot it wont???

restive furnace
#

maybe because your bot is in so big server? ¯\_(ツ)_/¯

tired gate
#

thing.catch(err => undefined) @tired gate
@restive furnace that disables the cmd error message?

restive furnace
#

yes

tired gate
#

cool!

#

thanks

restive furnace
#

replace thing with the dm thing

tired gate
#

yep

knotty obsidian
#

2020-08-28, The bot worked fine, it responded to commands and I didn't do anything with it.
2020-08-29, I forgot to run the bot.
2020-08-30, I wanted to run the bot, it worked but it didn't respond to commands.

weak rain
#

;-;

knotty obsidian
#

nothing was changed, i just ran the bot

restive furnace
#

try with the "hello world" aka "ping example" code in JDA docs

knotty obsidian
#

i clicked the little green button

restive furnace
#

that does it work

#

if not, then its JDA's fault

knotty obsidian
#

JDA's?

restive furnace
#

Java Discord API

knotty obsidian
#

system.Out.Print("e")

restive furnace
#

is System.out.println("thing");

tired gate
#

@restive furnace your method worked, thanks!

restive furnace
#

@tired gate np

knotty obsidian
#
public void onReady(ReadyEvent event) {
  System.out.println("Logged in as " + event.getJDA().getSelfUser().getAsTag());
}
#

this

#

this line wont work

#

why

eternal osprey
#

hey i've got a qestion

#

betweene very addField

sinful belfry
#

each field has a name and a value

#

you're just entering the name

#

you need to do .addField("name", "value")

weak rain
#

Hey guys help pls

#

why this is not working

still merlin
#

Do you have any errors?

#

And what is the problem

opal plank
#

@eternal osprey also addFields() is a thing

#

Takes an array as param

weak rain
#

@opal plank hey erwin hehehhe

#

help me pls

opal plank
#

?

#

Lemme switch to pc rq

#

Hate mobile

weak rain
#

Hm

opal plank
#

k whats up?

still merlin
#

Be patient

#

Your not even saying what the problem is

eternal osprey
#

i know

#

i already fixed

#

it

weak rain
#

it is not even replying

still merlin
#

I was talking to 'ThunderDev'

weak rain
#

Be patient
@still merlin i m waiting from 20 minutes

opal plank
still merlin
#

Your not even saying the issue

opal plank
#

this will already error

pale vessel
opal plank
#

cuz you arent checking

weak rain
opal plank
weak rain
#

it was args.slice.join("")

#

first

opal plank
#

it'll still get the user in the reason

#

which you dont want

golden condor
#

slice is a function

pale vessel
#

assuming they mentioned user first and then reason

opal plank
#

also pls use OR operator

#

a lot of those IF's can be narrowed down

#

if if if if i fi if else if

#

you should have your help command point them towards the syntax

golden condor
#

if(condition1 || condition2) {
//Code1
} else {
//Code 2
}

opal plank
#

also same thing i told the other person

#

addFields()

#

plural

#

takes an array

pale vessel
#

ngl if you use that you might as well use { embed: { fields: [] } }

#

way hotter

weak rain
#

hm

opal plank
#

indeed

weak rain
#

i like this

opal plank
#

i did the test

weak rain
#

but

weak rain
#
    at Object.run (E:\Thunder\commands\moderation\warn.js:19:35)
    at Client.<anonymous> (E:\Thunder\server.js:68:17)
    at Client.emit (events.js:315:20)
    at MessageCreateAction.handle (E:\Thunder\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (E:\Thunder\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)        
    at WebSocketManager.handlePacket (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
    at WebSocketShard.onPacket (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
    at WebSocketShard.onMessage (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
    at WebSocket.onMessage (E:\Thunder\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)
(node:11584) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11584) [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
#

ah yes, data

weak rain
#
      return message.channel.send("I m sorry but You can not warn yourself")
    }```
opal plank
weak rain
#

done that

opal plank
#

you have not

#

i told u

#

before that it'll already error, and the same one at that

weak rain
#

i removed that it was doing nothing

#

and giving errors

opal plank
#

dont just remove stuff

#

fix it

weak rain
opal plank
#

either check or conditional chaining if there are mentions/users

#

'this doesnt work, i'll just delete code/command rather than fix"

weak rain
eternal osprey
#
weather.find({search: 'Germany', degreeType: 'C'}, function(err, result1) { 
            if (err) message.channel.send(err)

            weather.find({search: 'California', degreeType: 'C'}, function(err, result2) { 
                if (err) message.channel.send(err);
                
                weather.find({search: 'Union Square', degreeType: 'C'}, function(err, result3) { 
                    if (err) message.channel.send(err);
                    
                    weather.find({search: 'Union Square', degreeType: 'C'}, function(err, result4) { 
                        if (err) message.channel.send(err);
            
            if (result1 === undefined || result1.length === 0)
            return message.channel.send("**Invalid** location")
 });
    });
})

}})```
#

for some reason i keep fucking around

#

with thee brackets

ripe kayak
#

Do ppl only use discord.js

eternal osprey
#

these*

ripe kayak
#

Do ppl only use discord.js
@ripe kayak
???

opal plank
#

@eternal osprey you still doing callback hell?

eternal osprey
#

yup

opal plank
#

bad

#

fix

eternal osprey
#

every new country is going through hell

opal plank
#

promisify your shit dude

ripe kayak
#

Anybody here using BDFD

eternal osprey
#

tf id BDFD

#

i know Erwin

weak rain
#

bot designer

eternal osprey
#

i am going to try it in a second

opal plank
#

no u dont

weak rain
ripe kayak
#

@weak rain

opal plank
#

i told you literally 4 days ago about this

ripe kayak
#

Do u use

opal plank
#

and you still havent fixed it

eternal osprey
#

what?

weak rain
#

no

ripe kayak
#

Bot designer

opal plank
#

you completely ignored what i said and continued

eternal osprey
#

you told me yesterday about it

ripe kayak
#

For discord

eternal osprey
#

not 4 day?

weak rain
#

pepeno @opal plank

opal plank
#

it was another guy then

#

but yeah dude, fix ur shit

eternal osprey
#

check the dicord chat here

restive furnace
#

@ripe kayak ngl, its easier to learn to code instead of using bdfd

eternal osprey
#

it was yesterday ;0-

opal plank
#

before it was 2 callsbacks

#

now its four

ripe kayak
#

@restive furnace thanks

eternal osprey
#

@ripe kayak i have been using discord bot maker

opal plank
#

next it'll be 5

#

then 6

ripe kayak
#

@eternal osprey

eternal osprey
#

i know

opal plank
eternal osprey
#

i am trying to get atleast 40

#

🙂

weak rain
#

ok

opal plank
#

say what now?

ripe kayak
#

Bot maker??

opal plank
#

i have been using discord bot maker

eternal osprey
#

yeah

opal plank
#

have you not been developing this whole time?

ripe kayak
#

Can u send link

eternal osprey
#

@opal plank

#

i have

opal plank
eternal osprey
#

but i used this program

ripe kayak
#

Bot designer or bot maker??

eternal osprey
#

for a couple of days

#

to check it out

ripe kayak
#

@eternal osprey

restive furnace
#

can

#

you

#

not

#

talk

#

like

#

this

weak rain
#

use dms for apps

ripe kayak
#

Who???

eternal osprey
#

Sorry

ripe kayak
#

Oh ok

#

Np

eternal osprey
ripe kayak
#

Anybody need help with BDscript u can ask me

restive furnace
#

just use js

eternal osprey
#

i know

pale vessel
#

JUST :4head:

earnest phoenix
#

can my bot be taken down by "low quality"

eternal osprey
#

you can do way more with js

pale vessel
#

yes

opal plank
#

of course

#

specially if its made with bot maker dboatsMmlol

earnest phoenix
#

heh

opal plank
#

then you fine

eternal osprey
#

@opal plank how long will it take me to lean how to promisfy my functions, and then change my bot folder?

slender thistle
opal plank
#

by using bot makers n such you arent developing anything, at least for public usage, dont use bot maker. if its for personal servers, might aswell if you dont want to learn a language

earnest phoenix
eternal osprey
#

I have only ussed it once when i tried to make a levelingsystem

#

but the function you can use are really limited

#

@earnest phoenix why would it be bad?

earnest phoenix
#

oh

#

it is ok?

eternal osprey
#

but

opal plank
#

@eternal osprey likely a couple hours, cuz u need to learn sync/async, await, promisification and callback/promises

earnest phoenix
#

i made it in 3 mins

eternal osprey
#

hmm yeah, i will have a look at it

#

i mean, what are the chances of someone writing that word?

#

probably really low

#

so i would add more filters

opal plank
#

theres likely a database or dictionary that you can use

still merlin
#

I've spent ages trying to fix this one ||god damn|| issue with my client, I've logged my client and everything is valid, But 'NaN' is the result of my ping, 'null' is the result of client.uptime and my servercount is '0' when its in several guilds (I've cached it, Still 0) Can someone help me please ;/

restive furnace
#

cOdE

tight plinth
#

is your client even ready

#

apparently no

#

@still merlin

still merlin
#

Wdym 'ready'-

tight plinth
#

the ready event successfully triggered

still merlin
#

The token and stuff is valid, The messages and embeds work, Just not ws ping etc

#

the ready event works 🤷‍♀️
should I change it to client.once?

#

no clue what client.once does, I use client.on, But idk

tight plinth
#

have you tried with a different bot token (different bot app) to see if the problem comes from discord or your code

#

.once only triggers... once

opal plank
#

that looks like a problem with node

#

even if all those things are in the 'ready' event

tight plinth
#

what's your node version

#

personally I use 13.12.0 and never had any issue with it

opal plank
#

think you could run a powershell in administrator and try it opening node?

still merlin
#
  spiderbot2: '1.0.0',
  npm: '6.14.5',      
  ares: '1.16.0',     
  brotli: '1.0.7',    
  cldr: '37.0',       
  icu: '67.1',        
  llhttp: '2.0.4',
  modules: '83',
  napi: '6',
  nghttp2: '1.41.0',
  node: '14.4.0',
  openssl: '1.1.1g',
  tz: '2019c',
  unicode: '13.0',
  uv: '1.37.0',
  v8: '8.1.307.31-node.33',
  zlib: '1.2.11'
}```
opal plank
#

14

tight plinth
#

node version, not package versions

restive furnace
#

14.8 is personally what i use and no problems

opal plank
#

i cant see any reason it wouldnt be able to get websocket ping

tight plinth
#

what node -v returns

still merlin
#

14.4.0

tight plinth
#

hm

#

have you tried with a different bot token (different bot app) to see if the problem comes from discord or your code
try that just to be sure

still merlin
#

Okay

eternal osprey
#

it will return the countries only that have cloudy weather?

#

i was thinking about:

opal plank
#

you start by first not doing callback hell

eternal osprey
#

hahahah yeah

#

i promise you

tight plinth
#

filter

eternal osprey
#

i do it today

opal plank
#

if you await them first you can properly parse them without a headache

still merlin
spice oriole
#

.

#

@errant dome

opal plank
#

@spice oriole go dot elsewhere

restive furnace
#

promises are way out of callback hell

#

and so is sync

eternal osprey
#

oof he has been dotted

tight plinth
#

@sinful belfry -dotpost required

opal plank
#

his method isnt a promise

restive furnace
#

ik

opal plank
#

hence why i told em' to promisify it

sinful belfry
#

-dotpost @spice oriole zoomeyes

gilded plankBOT
#

@spice oriole

Please do not post dots to clear your messages/get attention. It adds absolutely nothing to the conversation and just causes spam.
If you need to get attention, then say hello everyone. If you need to clear your messages, then press the Esc key. If you do not follow these instructions you will be muted.

restive furnace
#

sync is fine too

eternal osprey
#

today is the day

#

that this madness will stop

still merlin
#

Should I make a hastebin of my code-

tight plinth
#

@still merlin welp

restive furnace
#

use promisify from util kthx

tight plinth
#

your code is bad ig

misty sigil
#

god almighty what the hell is that syntax

#

i love it

eternal osprey
#

that my people

#

is called

tight plinth
#

@eternal osprey hsotpost for memes plz

#

shitpost*

eternal osprey
#

WHAHAHAHHA

tight plinth
#

talk here only to help/ask help please guys

misty sigil
#

gosh the spaghetti

eternal osprey
#

it wasn't a shitpost what i've sent

opal plank
#

this is the whole reason i told you to learn promisification

eternal osprey
#

that is my actual code

tight plinth
#

but who asked

opal plank
#

NOW thats what it looks like

#

it'll turn into that soon

misty sigil
#

wait its not theoretically spaghetti is it Thonk
it has nice indents
good syntax

spice oriole
#

@sinful belfry 👀

eternal osprey
#

@opal plank i promise you, tomorrow i will know the promsify

opal plank
#

at the very least stop working on yopur code till you elarn it

#

work on another command that dont use that

eternal osprey
#

yeah

restive furnace
#
const {promisify} = require("util");

promisify(function).bind(args);```iirc
opal plank
#

you'll just entangle yourself by conitnuing it

eternal osprey
#

i am trying to work on filtering right now..

#

that was also my question, how do i filter my info so if i use $po sunny, it will only return countrie with sunny weather

still merlin
eternal osprey
opal plank
#

how is the response set?

#

OMG

#

SETFIELDS()

#

plural

#

that starting to look ascii text

eternal osprey
#

i like the vibes

restive furnace
#

thats... definition... of a... slow...

eternal osprey
#

but uhhm

#

how do i filter these guys

opal plank
#

imma keep this handy from now on

tight plinth
#

@still merlin lemme see

restive furnace
#

try with 10 addfields @opal plank

opal plank
#

oh god

#

think node can even run it?

still merlin
#

Cool, Thanks @tight plinth

eternal osprey
#

i was thinking about: if ${current.skytext} == 'sunny'

#

and then return;

#

or something

tight plinth
#

put client.login at the end of your index k thx

still merlin
#

Ok

tight plinth
#

client.ready does not take any args

opal plank
#

i mean they are events

#

it shouldnt matter

#

if before or after those two will only be called after its emited

tight plinth
#

(ready) should be ()

eternal osprey
#

i was thinking about: if ${current.skytext} == 'sunny'
@eternal osprey anyone

restive furnace
#

client.on("ready", () => undefined /* define urself */);

opal plank
#

you ignored me

eternal osprey
#

i said

#

i like the vibes

tight plinth
#

ALSO What

opal plank
#

im asking about YOUR code

#

not THEIRS

#

how is your response being returned?

eternal osprey
#

owh fuck

tight plinth
#

you're creating a second client in your ping.js @still merlin

#

how dumb

eternal osprey
#

i was looking at the wrong line

still merlin
#

client was undefined-

tight plinth
#

and?

#

export it

opal plank
#

then pass it to that

#

dont initialize another client instance

tight plinth
#

add your initial client in your execute function as an argument

eternal osprey
#

my reponse being returned?

tight plinth
#

@still merlin

opal plank
#

yes

earnest phoenix
#

hi i have made a level system and i have made a leaderboard but the leader board shows member in other servers
How can i fix it plese?
Here is the code:

const { MessageEmbed } = require("discord.js");

module.exports.run = async (client, message, args) => {
    let data = client.db.all().filter(i => i.ID.startsWith("xp_")).sort((a, b) => b.data - a.data);
    if (data.length < 1) return message.channel.send("No record");
    let myrank = data.map(m => m.ID).indexOf(`xp_${message.author.id}`) + 1 || "N/A";
    data.length = 20;
    let lb = [];
    for (let i in data)  {
        let id = data[i].ID.split("_")[1];
        let user = await client.users.fetch(id);
        user = user ? user.tag : "Unknown User#0000";
        let rank = data.indexOf(data[i]) + 1;
        let level = client.db.get(`level_${id}`);
        let xp = data[i].data;
        let xpreq = Math.floor(Math.pow(level / 0.1, 2));
        lb.push({
            user: { id, tag: user },
            rank,
            level,
            xp,
            xpreq
        });
    };

    const embed = new MessageEmbed()
    .setTitle("Level Leaderboard")
    .setColor("RANDOM")
    lb.forEach(d => {
        embed.addField(`${d.rank}. ${d.user.tag}`, `**level** - ${d.level}\n**XP** - ${d.xp} / ${d.xpreq}`);
    });
    embed.setFooter(`This is where you are: ${myrank}`);
    return message.channel.send(embed);
};

module.exports.help = {
    name: "leaderboard"
};
eternal osprey
#

message.channel.send({embed});

misty sigil
#

please use hastebin

opal plank
#

the weather response

#

not the embed

tight plinth
#

@earnest phoenix fikter members to check if they are in message.guild

opal plank
still merlin
#

I removed the other defined clients now I get a 'client undefined' .-.

earnest phoenix
#

how to 🤔

opal plank
#

@still merlin read what e said

tight plinth
#

I removed the other defined clients now I get a 'client undefined' .-.
@still merlin read what I said k thx

still merlin
#

Ok

eternal osprey
tight plinth
#

add your initial client in your execute function as an argument

opal plank
eternal osprey
#

whahahaah

opal plank
#

still not what i mean awsome

eternal osprey
#

okay

still merlin
#

Thanks

earnest phoenix
#

<=no0b here

eternal osprey
#

agreed

earnest phoenix
#

so

eternal osprey
#

how is my weather bot response set?

restive furnace
#

learn how to code correctly kthx, just use message.client if you exported message into the command (amari)

earnest phoenix
#

how to🤔

opal plank
#
console.log(current1)```
earnest phoenix
#

CAN ANYONE DO IT FOR ME PLEASE?

opal plank
#

no

tight plinth
#

no

opal plank
#

we dont spoonfed code

misty sigil
#

no that'd be spoonfeed

tight plinth
#

^

earnest phoenix
#

I USE BDFD brfore lol

tight plinth
#

learn js

earnest phoenix
#

trying

tight plinth
#

¯\_(ツ)_/¯

opal plank
#

asking someone 'to do it for you' isnt trying

restive furnace
#

yeah ^

still merlin
#

Should i do 'execute(client, message, args) {'

eternal osprey
restive furnace
#

when i learn new languages (programming langs), i just use google and the languages reference.

earnest phoenix
#

asking someone 'to do it for you' isnt trying
@opal plank got it

tight plinth
#

Should i do 'execute(client, message, args) {'
@still merlin yes

still merlin
#

thankyou so much

opal plank
#

@eternal osprey okay so its an array response, open the 0 one

restive furnace
#

and why even export client whike message#client exists ¯\_(ツ)_/¯

eternal osprey
tight plinth
#

just edit the line that calls the execute command and ur good to go

opal plank
#

there are a couple things you can do

#

since its an object

eternal osprey
#

okay

tight plinth
#

and why even export client whike message#client exists ¯\_(ツ)_/¯
@restive furnace no one uses it

opal plank
#

for in

#

prob be your best bet tbh

#

you could deconstruct it but prob me more of a hassle

eternal osprey
#

okay, i will have a look at it,. Thanks.

opal plank
eternal osprey
#

yeah i already saw that site

summer carbon
#

How can I download discord previous version 29.0 for iPhone ?

tight plinth
#

i dont think you can on ios

eternal osprey
#

i have seen the examples, but have a hard time using it on my bot.

summer carbon
#

Sad

tight plinth
#

or maybe with itunes

eternal osprey
#

i will serach up some tutorials,

summer carbon
#

or maybe with itunes
@tight plinth how ?

tight plinth
#

just checked, u sadly can't @summer carbon

summer carbon
#

:/

tight plinth
#

or maybe if you jailbreak your iPhone, then you're able to install app packages / install previous versions of an app

#

but idk a lot about iPhone since I'm an android guy

summer carbon
#

How can I jailbreak my iPhone

eternal osprey
#

can't i just use an if statement to check if the skytext = 'clear'

tight plinth
#

Google

summer carbon
#

Ok

#

B/w can someone give me hackban code for discord.js v11

eternal osprey
#

currently you can jailbreak to get cydia

tight plinth
#

and it's probably not that legal so I don't think that, even if I know how to do, I can help you here

eternal osprey
#

michael, if something happens with your iphone

tight plinth
#

afaik you can't hachban with v11

eternal osprey
#

they won't help you anymore

summer carbon
#

Yes

eternal osprey
#

as apple is highly against jailbreaking

tight plinth
#

also when you jailbreak guarantee goes poof

summer carbon
#

This recently discord update crush my iPhone

#

Too loaded tho

eternal osprey
#

also, i have tried jailbreaking with the latest iphone version. It is really hard to find a working one.

summer carbon
#

Even I can’t able to send messages

eternal osprey
#

most of them are scams or won't work

opal plank
#

time to switch to a proper android it seems

restive furnace
#

@restive furnace no one uses it
@tight plinth i do, and why to pass it even, since it just takes more time, so basically you copy it 2 times, since message.client and client passed

surreal sage
#

Do you guys know any site or software that compresses javascript to 1 line?

sharp hollow
#

nope

opaque eagle
#

Why do you need it @surreal sage

surreal sage
#

Why do you need to know :)

opaque eagle
#

Because there are different answers depending on your use case

surreal sage
#

What are your answers?

opaque eagle
#

If it's for a website, go with webpack. For node/server apps webpack won't work (and neither should it, because why would you need to minify server-side code)

surreal sage
#

Not what i wanted

#

I want to make a full javascript file from multiple lines of code into 1

misty sigil
#

but why tho

opaque eagle
#

^

surreal sage
#

I need to like compress it?

opaque eagle
#

Why

surreal sage
#

Why not

opaque eagle
#

Why do you need to compress it

surreal sage
#

¯_(ツ)_/¯

digital ibex
#

u can write js code on one line

opaque eagle
#

I don't think you understand what a dumb idea that is

surreal sage
#

idc

#

I'm asking something

digital ibex
#

line breaks aren’t needed unless its an object iirc

opaque eagle
#

commas

surreal sage
#

You guys wont help

#

sigh

opaque eagle
#

We do help

surreal sage
#

bye

#

no you dont

opaque eagle
#

You're just too much of a dick

misty sigil
#

because its literally pointless

#

it makes code harder to read

#

harder to work on

opaque eagle
#

It's like asking how to make a pizza smoothie

#

no point

digital ibex
#

i mean, u can write ur code on one line anyways, js doesn’t care about indentation @surreal sage

earnest phoenix
#

I want to make a msg who it edits in 5 seconds with discord.js

#

How can I do it?

opaque eagle
#

setTimeout

#

setTimeout(function, time to wait before function)

#

in the function, delete the message with message.delete()

#

pass in 5000 for the time (5 seconds converted to milliseconds)

hazy sparrow
misty sigil
#

presence

opaque eagle
#

lol the order is messed up too

misty sigil
#
hazy sparrow
#

wdym @opaque eagle

opaque eagle
#

ur closing the literal before the }

#

it should be }` not `}

#

at the end

hazy sparrow
#

oh yea i messed up when typing here

opaque eagle
#

just copy paste

earnest phoenix
#

Anyone help?

#

I want to make a msg and it will edited at 5 seconds

#

But how

#

message sendinf returns a promise

#

use await or use .then

#

example:

#
message.channel.send("lol").then(msg => {
msg.edit("edited the message");
});
opaque eagle
#

or setTimeout like I suggested the last time you asked the same question lol

sand skiff
#

i need help

#
  } else if (msg.content === '-embed') {
    const exampleEmbed = new Discord.MessageEmbed()
      .setColor('ffb3ba')
      .setTitle('Commands')
        .setAuthor('By: Sia (ALT)#9417')
        .setDescription('Command used: -help\nHere is a list of all command groups!')
        .setThumbnail('https://cdn.discordapp.com/attachments/749010415224356905/749056612181999676/image0.png')
        .addFields(
            { name: 'Regular field title', value: 'Some value here' },
            { name: '\u200B', value: '\u200B' },
            { name: 'Utility', value: '-utility help', inline: true },
        { name: 'Moderation', value: '-moderation help', inline: true },
        { name: 'Fun', value: '-fun help', inline: true },
        )
      .addFields(
        { name: 'General', value: '-general help', inline: true },
        { name: 'More coming soon...', value: 'More Coming Soon', inline: true },
      )
        .setFooter('© 2020 - ✩May✩ - All rights reserved.', 'https://cdn.discordapp.com/attachments/749010415224356905/749056612181999676/image0.png');
  }
});```
#

is this correct?

misty sigil
earnest phoenix
#

i just switched to ubuntu

#

back to my old days

#

:))

sand skiff
misty sigil
#

ok what error

sand skiff
#

its exacty why im asking

#

`Last login: Sat Aug 29 12:21:53 on ttys000
Susantas-iMac:~ SiaYT$ cd /Users/SiaYT/Desktop/MAY
Susantas-iMac:MAY SiaYT$ node index.js
internal/modules/cjs/loader.js:968
throw err;
^

Error: Cannot find module './util/Util'
Require stack:

  • /Users/SiaYT/Desktop/MAY/node_modules/discord.js/src/index.js
  • /Users/SiaYT/Desktop/MAY/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/SiaYT/Desktop/MAY/node_modules/discord.js/src/index.js:3:14)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [`
#

i want to make an embed

#

like

misty sigil
#

ok so 1

sand skiff
#

as a response

misty sigil
#

you arent sending it

sand skiff
#

wait

#

what?

#

ooh

#

but how do i

earnest phoenix
#

:))

sand skiff
#

im very very new to embeds

misty sigil
#

message.channel.send({embed: embed})

sand skiff
#

where do i put that

misty sigil
#

below the embed code

sand skiff
#

like

#
  } else if (msg.content === '-embed') {
    const exampleEmbed = new Discord.MessageEmbed()
      .setColor('ffb3ba')
      .setTitle('Commands')
        .setAuthor('By: Sia (ALT)#9417')
        .setDescription('Command used: -help\nHere is a list of all command groups!')
        .setThumbnail('https://cdn.discordapp.com/attachments/749010415224356905/749056612181999676/image0.png')
        .addFields(
            { name: 'Regular field title', value: 'Some value here' },
            { name: '\u200B', value: '\u200B' },
            { name: 'Utility', value: '-utility help', inline: true },
        { name: 'Moderation', value: '-moderation help', inline: true },
        { name: 'Fun', value: '-fun help', inline: true },
        )
      .addFields(
        { name: 'General', value: '-general help', inline: true },
        { name: 'More coming soon...', value: 'More Coming Soon', inline: true },
      )
        .setFooter('© 2020 - ✩May✩ - All rights reserved.', 'https://cdn.discordapp.com/attachments/749010415224356905/749056612181999676/image0.png');
      message.channel.send({embed: embed})
  }```
#

like this?

earnest phoenix
#
message.channel.send(exampleEmbed)
#

like this ^^

sand skiff
#

oh ok

earnest phoenix
#

message.channel.send({embed: embed})
@misty sigil bruh u give wrong code

misty sigil
#

no?

sand skiff
#
  } else if (msg.content === '-embed') {
    const exampleEmbed = new Discord.MessageEmbed()
      .setColor('ffb3ba')
      .setTitle('Commands')
        .setAuthor('By: Sia (ALT)#9417')
        .setDescription('Command used: -help\nHere is a list of all command groups!')
        .setThumbnail('https://cdn.discordapp.com/attachments/749010415224356905/749056612181999676/image0.png')
        .addFields(
            { name: 'Regular field title', value: 'Some value here' },
            { name: '\u200B', value: '\u200B' },
            { name: 'Utility', value: '-utility help', inline: true },
        { name: 'Moderation', value: '-moderation help', inline: true },
        { name: 'Fun', value: '-fun help', inline: true },
        )
      .addFields(
        { name: 'General', value: '-general help', inline: true },
        { name: 'More coming soon...', value: 'More Coming Soon', inline: true },
      )
        .setFooter('© 2020 - ✩May✩ - All rights reserved.', 'https://cdn.discordapp.com/attachments/749010415224356905/749056612181999676/image0.png');
      message.channel.send(exampleEmbed)
  }```
earnest phoenix
#

yes

misty sigil
#

no i didn't

earnest phoenix
#

she defiene it as a variable

misty sigil
#

yes BUT it returns a json object

#

so message.channel.send({embed: exampleEmbed}) would work

earnest phoenix
#

ok

sand skiff
#

oh ok

earnest phoenix
#

message.channel.send(exampleEmbed) will work to and they are same

#

oh nvm

#

ok u gave a right code

sand skiff
#

ok

#

im gonna try running it

earnest phoenix
#

ok

misty sigil
sand skiff
#

`Susantas-iMac:MAY SiaYT$ cd /Users/SiaYT/Desktop/MAY
Susantas-iMac:MAY SiaYT$ node index.js
internal/modules/cjs/loader.js:968
throw err;
^

Error: Cannot find module './util/Util'
Require stack:

  • /Users/SiaYT/Desktop/MAY/node_modules/discord.js/src/index.js
  • /Users/SiaYT/Desktop/MAY/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/SiaYT/Desktop/MAY/node_modules/discord.js/src/index.js:3:14)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/Users/SiaYT/Desktop/MAY/node_modules/discord.js/src/index.js',
    '/Users/SiaYT/Desktop/MAY/index.js'
    ]
    }
    Susantas-iMac:MAY SiaYT$ `
#

uh

#

idk why it wont work

misty sigil
#

npm i util

sand skiff
#

?

misty sigil
#

it shows you're missing the util module

#

so install it

sand skiff
#

what is that

misty sigil
#

it inspects promises; commonly used in eval commands.

sand skiff
#

ok

#

ths?

misty sigil
#

yes

sand skiff
#

ok

#

`Last login: Sun Aug 30 08:22:20 on ttys002
Susantas-iMac:~ SiaYT$ npm install util
npm WARN saveError ENOENT: no such file or directory, open '/Users/SiaYT/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/SiaYT/package.json'
npm WARN SiaYT No description
npm WARN SiaYT No repository field.
npm WARN SiaYT No README data
npm WARN SiaYT No license field.

  • util@0.12.3
    added 25 packages from 17 contributors and audited 40 packages in 4.378s

14 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

Susantas-iMac:~ SiaYT$

`

#

did it work?

#

Matthew?

#

@misty sigil

misty sigil
#

yes

sand skiff
#

ok

#

so ill try running it again

#

nope

#

i tried installing again

lament rock
#

That's a discord.js error not a built in Node error. The first stack frame says it's coming from discord.js' index requiring discord.js' Util module. Try reinstalling discord.js

sand skiff
#

oh

#

ok

#

how

lament rock
#

Well. How did you install it in the first place?

earnest phoenix
#

@sand skiff just send the first, sec lines of the error

sand skiff
#

npm install discord.js???

earnest phoenix
#

don't copy all the terminal

#

npm install discord.js???
@sand skiff yes

lament rock
#

That would be correct

sand skiff
#

ok

#
Last login: Sun Aug 30 08:39:57 on ttys002
Susantas-iMac:~ SiaYT$ npm install discord.js
npm WARN saveError ENOENT: no such file or directory, open '/Users/SiaYT/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/SiaYT/package.json'
npm WARN SiaYT No description
npm WARN SiaYT No repository field.
npm WARN SiaYT No README data
npm WARN SiaYT No license field.

+ discord.js@12.3.1
updated 1 package, moved 14 packages and audited 54 packages in 2.945s

14 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
earnest phoenix
#

now try it again

sand skiff
#

ok

earnest phoenix
#

oh

#

i know why

lament rock
#

You don't event have a package.json???

earnest phoenix
#

@sand skiff type in terminal node -v

#

cuz discord.js v12 support only nodejs v12+

sand skiff
#

Last login: Sun Aug 30 08:46:08 on ttys003
Susantas-iMac:~ SiaYT$ node -v
v12.18.3
Susantas-iMac:~ SiaYT$

earnest phoenix
#

@sand skiff type in terminal npm init

sand skiff
#

Susantas-iMac:~ SiaYT$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See npm help init for definitive documentation on these fields
and exactly what they do.

Use npm install <pkg> afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (siayt)

earnest phoenix
#

yes try ur name

sand skiff
#

huh

earnest phoenix
#

package name: UR PROJECT NAME

sand skiff
#

o-o

lament rock
#

you can just hit enter for most of the prompts

earnest phoenix
#

yes

wary flame
#
npm init -y

Would also work

lament rock
#

unless you want to change properties

earnest phoenix
#

or just enter

sand skiff
#

most or all

earnest phoenix
#

ye do what batman said

lament rock
#

you could hit enter for all but it's good to customize it

earnest phoenix
#

yes

#

how long is an id ?

sand skiff
#

`package name: (siayt)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /Users/SiaYT/package.json:

{
"name": "siayt",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"discord.js": "^12.3.1",
"util": "^0.12.3"
},
"devDependencies": {},
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "ISC"
}

Is this OK? (yes) yes`

#

huh

earnest phoenix
#

u done

sand skiff
#

yes

earnest phoenix
#

```

sand skiff
wary flame
#

how long is an id ?
I thougth it was 8/9 digits

sand skiff
#

``

#

oop

wary flame
#

I thougth it was 8/9 digits
Nope its not

sand skiff
#
\`\`\`
#

oop

earnest phoenix
#

@wary flame 18

#

lol

wary flame
#

Mine is

sand skiff
#

``

wary flame
#

But it can differ a bit

sand skiff
#

ooop

#

ok @earnest phoenix nowwhat

earnest phoenix
#

then intall discord.js

#

install

#

imma send u screeenshot @wary flame but i need to install flame shot

tight plinth
earnest phoenix
#

LoL

wary flame
#

Yes, but it is not always 18

earnest phoenix
#

wut

#

rly

#

omg

#

oh no

wary flame
#

Pretty sure

lament rock
#

Do not check ID lengths ever since IDs will never consistently be the same length. They will increase in length eventually and the developers can arbitrarily add IDs into the database and break your code

wary flame
#

What papi said

sand skiff
#

then intall discord.js
@earnest phoenix again?

earnest phoenix
#

again?
@sand skiff yes

sand skiff
#

`Susantas-iMac:~ SiaYT$ npm instal discord.js

Usage: npm <command>

where <command> is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, fund, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami

npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview

Specify configs in the ini-formatted file:
/Users/SiaYT/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@6.14.6 /usr/local/lib/node_modules/npm

Did you mean one of these?
install
unstar
init
Susantas-iMac:~ SiaYT$ `

earnest phoenix
#

STOP

lament rock
#

you spelled install incorrectly

earnest phoenix
#
npm install discord.js
#

why u alway copy all terminal error

#

read it and find the most importain then send it

sand skiff
#

lol

#

sorry

earnest phoenix
#

is there a server or site that shows/helps with vsc scrips?

drifting wedge
#

i have a thing that sends a message when a role is updated
when a role is moved
all the roles get "updated"
how can i stop it from spamming it
and just sending the one that was updated
using python

#

It’s on the on role edit event

dire obsidian
strange mango
#

yes?

dire obsidian
#

i thik you can use "easy to use" there

earnest phoenix
#

How i can get mongoose ping ?

wary flame
#

I think you need to use findOne

earnest phoenix
#

yes but how

wary flame
#

Idk, new Date() beforehand, new Date() afterwards and subtract them?

misty sigil
#
Take time (1)
Make DB call
Take time (2)
ping = time(2) - time(1)
wary flame
#

Would that work

lament rock
#

Yes

misty sigil
#

aye it does

earnest phoenix
#

thx

strange mango
#

also the border is very.... THICC
@dire obsidian I cant change the border

#

I wish I could use iframe... but its not working

lament rock
#

Top supports custom html and css so you can if that's what they're talking about

dire obsidian
#

hmm, what is "not working" @strange mango ?

lament rock
#

iFrames are not allowed on Top for non cert

strange mango
#

idk but its blocked by nginx

sinful belfry
#

iframes are fine

strange mango
#

I saw a lot of bots using iframe

sinful belfry
#

the content must follow the same rules as a normal bot page tho

lament rock
#

really? Must be thinking of an other site then

sinful belfry
#

yeah

strange mango
#

but it doesnt work for me

lament rock
#

Thanks for the clarification, then

simple stump
misty sigil
#

Oh hey, somethin i can help with

fringe axle
#

How can I get the guilds invite, the message was send? (discord.js v12)

misty sigil
#

i genuinely cannot see the music code

queen geyser
#

this example code dont work :c im in discord.js 12.3

earnest phoenix
#

is there a server or site that shows/helps with vsc scrips?
@earnest phoenix vsc is just an ide

#

Oop

digital ibex
#

text editor* not ide

misty sigil
#

advanced text editor mmLoL

green kestrel
#

There's nothing in discord TOS that forbids me giving nitro as a prize for winning the months trivia in my bot is there

misty sigil
#

not afaict

#

its just rewarding your users, giving them an incentive to use your bot and share it

green kestrel
#

Yeah that's what I thought

#

I just didn't want to get stung by any laws re gambling because nitro has a real world cash value, although they don't pay to participate so...

sudden geyser
#

wait run this in terminal, xcode-select --install
@crystal socket Sorry for late response, but I ended up doing the following:

  • Deleting my old Xcode as I already had the beta.
  • Updating the beta (Xcode 12 beta 6)
  • Downloading the Command Line Tools directly from Apple's site (beta 5)

I got Homebrew working now komarusmile

green kestrel
#

Hmm does it encourage sharing though and grow user base or does it encourage people to keep the bot quiet so there's less competition and more chance of winning nitro

misty sigil
#

Just make it so to receive the nitro you have to be an active voter

green kestrel
#

Right now there's perhaps 40 hardcore players that would vie for the prize and may make a lot of trash talk noise between each other trying to win

#

Lol perhaps yeah

#

I already have voter rewards

earnest phoenix
#

Hi does anyone know how to send hyperlinks on discord.py?

quartz kindle
#

links are not library dependant

earnest phoenix
#

Meaning?

quartz kindle
#

meaning they are just a piece of text that discord converts to links

earnest phoenix
#

Oh ok!

quartz kindle
#

its the same in all libraries

earnest phoenix
#

But what about hyperlinks

quartz kindle
#

the format is [text here](url here)

earnest phoenix
#

Ok

#

so like this?

faint prism
#

Discord takes care of the rest

earnest phoenix
#

ok thanks

wheat kraken
#

How do you make a code run forever on repl.it cause after a bit it stops

misty sigil
#

ping it

wheat kraken
#

that wont work but ok

slender thistle
#

Sending a request to your repl.co link once every X minutes

wheat kraken
#

what do you mean

olive rune
slender thistle
#

repl.it gives you a URL to access your project

summer torrent
#

use uptime services

wheat kraken
#

Ok

slender thistle
#

Let's not encourage that ty

slate oyster
#

It was a joke...

slender thistle
#

and is this a channel for jokes

slate oyster
#

Oh

wheat kraken
#

So basically every bit i run it again

slender thistle
#

Every X minutes, your uptime service will send a request to your project URL

wheat kraken
#

Oh Ok

slender thistle
#

which, therefore, will keep it running for another Y minutes

wheat kraken
#

Ok where do i see uptime service

slender thistle
#

UptimeRobot is one of those

wheat kraken
#

Ok

slender thistle
wheat kraken
#

Oh yeah

#

i have uptime robot

#

i used it before

slender thistle
#

Yeah, point it at your project's public URL and done

wheat kraken
#

Ok

pale vessel
#

can't you use the project to ping itself or does repl check for those?

slender thistle
#

Huh, an interesting idea

#

I can try deploying a small script and see

#

Oh, it's repl.run

pale vessel
#

i did that for an org and it seems to be working just fine

wheat kraken
#

do you mean URL by where it says something about creative dark magenta download repl.co https:// thing?

#

it has 1 down monitor

slender thistle
wicked pivot
#
let guilds = member.guild.cache
        let memberadd = guilds.members
        .filter(member => member.cache.hasPermission('MANAGE_GUILD'))
        .filter(member => !member.user.bot)
        .map(m => ">" + m.user + ` (TAG : \`${m.user.tag}\`, ID : \`${m.user.id}\`)`).join('\n')```

```(node:5592) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'members' of undefined
    at Client.bot.on (C:\Users\Utilisateur\Desktop\Détente [FR]\bot juzoo bot v12\main.js:212:32)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:5592) 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:5592) [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.``` ![Detente_ref](https://cdn.discordapp.com/emojis/547849405210951708.webp?size=128 "Detente_ref")
pale vessel
#

member.guild.cache?

#

what are you trying to access

#

the members? that would be member.guild.members.cache

wicked pivot
#

oof I'm new to v12 I'm updating my code, thank you "

pale vessel
#

english only here

#

you can just remove guilds as it's unneeded and change memberadd to member.guild.members.cache

#

so that grabs the guild of the member and gets the members of the guild and accesses the cache

#

from there you can just do normal filter operation

wicked pivot
#

what (node:13040) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function

#
let embedSendBot = new MessageEmbed()
          .setTitle("Un membre vient d'ajouter un bot")
          .setDescription(`
          > Bot : \n > ${member.user} 
          (TAG : \`${member.user.tag}\`, ID : \`${member.user.id}\`)
          
          > **Source a vérifier**, \n > Les logs me dise que l'utilisateur qui a ajouter le bot peut être : \n > ${UserGet} (TAG : \`${UserGet.tag}\`, ID : \`${UserGet.id}\`)

          > Les membres qui a les permissions d'ajouter des bots \n\n` + memberadd)

        return bot.channels.cache.get("706979372145442917").send(embedSendBot)```
quartz kindle
#

update your node

earnest phoenix
#

npm install node.js

quartz kindle
#

no lol

wicked pivot
#

update my node ?

earnest phoenix
#

yeah

#

Update to v12+ node.js

wicked pivot
crystal stream
#

@rough sand

#

Omg...

#

Thz ^^

earnest phoenix
#

discord.js v12 works for v12+ node.js

#

why are you using old versions anyways

wicked pivot
#

okay okay

earnest phoenix
#

Thz ^^
@crystal stream what happened

crystal stream
#

They add my bot ^^

wicked pivot
#

I started on v11, and at that time it was this version, simply recommend it and since then I have not updated

earnest phoenix
#

mhmm

#

They add my bot ^^
@crystal stream and it's muted KEKW

crystal stream
#

Soon i will change prefix)

wicked pivot
#
.map(m => ">" + m.user + ` (TAG : \`${m.user.tag}\`, ID : \`${m.user.id}\`)`).join('\n')```
in v11 it gives the mention but in v12 it gives the id how to change this ?
quartz kindle
#

you want the id to be a mention?

wicked pivot
#

I want m.user = a mention

misty sigil
#

m.user is a mention iirc

slender thistle
#

m.user.toString() is a mention

quartz kindle
#

or just <@${m.user.id}>

wicked pivot
#

thx

earnest phoenix
#

`import discord

client = discord.Client()

@client.event
async def on_message(message):
if message.content.startswith('example'):
await message.delete()
await message.channel.send('{} stop using that word'.format(message.author.mention))`

any way to make it search for example in entire message?

slender thistle
#

Use the in operator

lunar basin
#

Hello, how do I put nitro emojis in a discord bot?

opal plank
#

bots have access to all emojis from guilds they are in

#

if you want to add it,. put it on a server that the bot is in

cinder sandal
#

just create a secret server with those emojis

lunar basin
#

I put the nitro emojis on the server on which the bot is but instead of putting the animated emojis on me it puts me for example :emojis:

cinder sandal
#

saving your bot files on github is good, useful when something went wrong with the local storage that the bot is in

lunar basin
#

It's already done I'm testing my bot locally now

#

There is a specific writing for nitro emojis or you just have to put :nameemojis: ?

quartz kindle
#

your bot must be in the same server where the emoji is from, and your bot must have "use external emojis" permission

lunar basin
#

ok i will test this

#

it puts me this

    at RequestHandler.execute (C:\Users\Kylian\Desktop\Kaelya BOT\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:8696) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8696) [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.```
quartz kindle
#

that means a message was not found

lunar basin
#

But it's only been doing this since I put the animated emojis in the code

stark terrace
#

lets say i have 18 shards. how many shards should i be running in a single docker container?

quartz kindle
#

as many as you want

faint prism
#

Depends on process CPU load ig.

stark terrace
#

cause i'm trying to think of possibilities on why my cpu is shitting itself with a load of 18 shards

#

idk if i need to split containers up, do a deep dive on the process

quartz kindle
#

are you using intents?

#

did you disable presences?

stark terrace
#

i did

#

was one of the first things i did went implementing intents

tight plinth
#

cause i'm trying to think of possibilities on why my cpu is shitting itself with a load of 18 shards
@stark terrace if you have 18 shards, you should cluster your bot

#

your bot is divided in multiple processes instead of a big one

worthy glacier
#

So i have two collections in mongodb, one that stores the settings of each server and one that stores only a single document containing the defaults. I want it so that if I change the defaults each server document is merged with the new defaults, except for the fields that were changed from the defaults

#

how do i go about accomplishing this?

restive furnace
#

or use d.js's wacky shard handler

#

not internal sharding

stark terrace
#

i have never used internal sharding

tight plinth
#

djs shard handler ew

stark terrace
#
  • i wont even be using djs for that much longer
#

at least by the end of the year

restive furnace
#

well then u need to cluster ur bot

tight plinth
#

btw quick question with shoukaku and sharding: how am i supposed to handle it? shards > shoukaku > client or shoukaku > shards > client?

quartz kindle
#

is it a music bot?

stark terrace
#

its not @quartz kindle

quartz kindle
#

how many cpus does your vps have?

#

cores

stark terrace
#

4 cores, 8 threads (cpu started shitting itself within the past week) 18 shards, 17.7k guilds. could it be time to upgrade the cpu? other processes running on this machine are super lightweight

faint prism
#

Might want to look at optimizations first

#

Are there any resource-intensive operations you perform?

quartz kindle
#

your cpu shouldnt be even close to shitting itself

#

unless you do intensive operations like music or image processing

faint prism
#

well what Ghzs are the cores running at?

stark terrace
#

no music or image processing with this bot

quartz kindle
#

considering my bot averages at 2-3% cpu on a single core at 4500 guilds

stark terrace
#

and db calls either cause im caching guild settings

earnest phoenix
#

In mongodb how do I check if a collection exists?

#

considering my bot averages at 2-3% cpu on a single core at 4500 guilds
@quartz kindle HOLY SHEET

faint prism
#

In mongodb how do I check if a collection exists?
@earnest phoenix Make a call for it. If it returns null, it doesn't exist

earnest phoenix
#

okay my mom is sitting beside me so i can't swear

faint prism
#

well what Ghzs are the cores running at?
?

stark terrace
#

well what Ghzs are the cores running at?
@faint prism 3.4GHz

faint prism
#

lol your cpu is plenty powerful enough

earnest phoenix
#

@earnest phoenix Make a call for it. If it returns null, it doesn't exist
@faint prism but then I can just do normal methods on it like it existed and mongodb will create the collection anyways

#

which i don't want to happen

stark terrace
#

yeah that's why im curious on what could be wrong

faint prism
#

@faint prism 3.4GHz
@stark terrace You should check your code for areas you can optimize

#

Reduce file I/O operations, unnecessary sorting, etc

#

Tim might know a few ways

quartz kindle
#

i assume you're using discord.js's sharding manager?