#development

1 messages · Page 1114 of 1

misty sigil
lusty quest
#

ye

plucky harness
#

i was running my postgres on docker and when i restarted my vps and restarted postgres it has now database now

solemn latch
#

so
broadcastEval(const embed = ${theembedyoubuilt} rest of code) didnt work for ya?

plucky harness
#

no*

lusty quest
#

did you set a persistant storage?

dense patio
#

oh i haven't tried that

#

hold on i'm going to try both of these

#

i'll get back to you

plucky harness
#

persistant storage whats dat>

#

i didnt set anything just default

lusty quest
#

docker are container. with no persistent storage everything is gone if the container restarts

earnest phoenix
#

Tfw this dude is running Docker & I still haven't messed with it

plucky harness
#

how do i set persistant storage?

earnest phoenix
#

Yet he doesn't seem the brightest

solemn latch
#

ive yet to play around with docker either

earnest phoenix
#

What does that say about me

lusty quest
#

commandline or dockerfile?

earnest phoenix
#

:pepehands:

solemn latch
#

you do what works

#

🤔

plucky harness
#

both

lusty quest
#

v- /path/on/host/os:/path/in/container

earnest phoenix
#

I really need to stop fucking around & learn Docker, since I'm running multiple origin servers for my site

plucky harness
#

yea then?

earnest phoenix
#

Having to manually setup each one is fucking AIDs

solemn latch
#

?

#

or if (!yourchannelfindcode) return "what you want to return";

#

if(!leaveChannel) return

lusty quest
dense patio
#

@solemn latch ReferenceError: broadcastEval is not defined

solemn latch
#

how are you doing broadcastEval?

dense patio
#

wdym how am i doing it

solemn latch
#

broadcastEval is a method of shard

#

client.shard.broadcastEval

dense patio
#

i see

solemn latch
silver dust
#

how

#

forEach is still undefined

solemn latch
#

.forEach isnt undefined

#

the thing your using it on is

silver dust
#

what

#

the thing your using it on is
@solemn latch wdym?

vestal star
solemn latch
#

undefined.forEach doesnt work

silver dust
#

i didnt use that

solemn latch
#

your variable is

#

TypeError: Cannot read property 'forEach' of undefined
the property .forEach cant be read from undefined

silver dust
#
const discord = require("discord.js")
const prefix = "!"
const client = new discord.Client()
client.commands = new discord.Collection()

const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('js'))

client.aliases = new discord.Collection()
for (const file of commandFiles) {
  const command = require(`./commands/${file}`)
  command.aliases.forEach(alias => client.aliases.set(alias, command.name))
  client.commands.set(command.name, command)
}

client.on("ready", () => {
  console.log("Im online")
  client.user.setPresence({
    activity: {
    name: client.users.cache.size + "  members | !help for commands!",
    type: "WATCHING"
  
    }
  
  });
  
  });

client.on('message', message => {
  if(message.mentions.users.first()===client.user){
    message.reply("Hi there, The prefix is '!' ")

};
});


client.on("message" , async message => {
  if(message.author.bot) return
  
  if(!message.content.startsWith(prefix)) return
  
  if(!message.member) message.member = await message.guild.fetchMember(message);
  const args = message.content.slice(prefix.length).split(/ +/)
  const command = args.shift().toLowerCase()
  const cmd = client.commands.get(command) || client.commands.get(client.aliases.get(command))
  
  if(cmd === null ) return
  
  if(cmd) cmd.run(client, message, args)
  if(!cmd) return
})

client.login("token") ```
solemn latch
#

command.aliases.forEach

#

one of your commands doesnt have the property
.aliases

#

so its undefined

#

so undefined.forEach

#

errors

silver dust
#

so what i have to do?

misty sigil
#

give all commands aliases

vestal star
#

#development literally became a place for people to ask questions after they just forked GuideBot

solemn latch
#

define aliases in each command, or check if its undefined before doing .foreach

misty sigil
#

#development literally became a place for people to ask questions after they just forked GuideBot
@vestal star lmao ikr

vestal star
#

^

solemn latch
#

its the same thing we discussed before 🤷‍♂️

silver dust
quartz kindle
#

your code expects ALL your commands to have aliases

#

if a single command for some reason doesnt have aliases, it will error

silver dust
#

oh

vestal star
#

Add an if statement

pure lion
#

How can I point my domain to IP:port?

solemn latch
#

in your domains dns settings

quartz kindle
#

edit its DNS records

pure lion
#

Idk how to port

faint prism
#

DNS bro

quartz kindle
#

you cant do port, only ip

solemn latch
#

^

vestal star
#
if(typeof command.allias === "undefined") {
   // add allias
}
quartz kindle
#

port is defined by the user

pure lion
#

O

quartz kindle
faint prism
#

DNS just resolves a domain name -> IP address

vestal star
#

You could use a reverse proxy or tunnel

pure lion
#

How do I make it automatically do the thing

vestal star
#

soooo....

#

wdym?

faint prism
#

You could bind the port to serve on port 80

vestal star
#

NO

#

Dont ever server on 80

pure lion
#

Oka-

#

No?

#

What about port 8080

earnest phoenix
#

I dont do invite member count in my discord help me please

vestal star
#

User a reverse proxy or iptables rule

silver dust
#

@quartz kindle thanks worked

faint prism
#

Are you serving a website?

silver dust
#

i had an empty file NM_Laugh

thick gull
#

I dont do invite member count in my discord help me please
???

vestal star
#

Binding directly to 80 is sometimes a bad idea

pure lion
#

Yeah

silver dust
#

thats why

#

advertising

thick gull
#

???

silver dust
quartz kindle
#

theres nothing against running a server on port 80, all major webservers do it, nginx, apache, etc... its not recommended for node specifically because other webservers do a better job at it

misty sigil
#

dm ads banhammer /s

pure lion
#

x)

misty sigil
#

did you

silver dust
#

Dm me for join ou discord
@earnest phoenix why vomit

misty sigil
#

like read xiuhs status?

#

pls dm another mod first?

faint prism
#

oh

#

rip

vestal star
#

@quartz kindle that's exactly what I meant, my earlier message said to use a reverse proxy

misty sigil
#

ping marco ig

earnest phoenix
#

How do i get the bot developer role

vestal star
#

By making a bot

misty sigil
#

and by having it approved

earnest phoenix
#

Yeah

quartz kindle
#

yes but you sounded a bit overdramatic when you said to never do it lmao

vestal star
#

O

scenic kelp
#

@opaque barn no ads

pure lion
#

What do I do with cert and chain in terms of SSL?

quartz kindle
#

which webserver are you gonna use?

#

nginx is usually a good option

pure lion
#

Idk I haven't set that up but nginx

#

Okay would I install nginx on my vps?

quartz kindle
#

then set it up first, then configure its SSL settings to point to your cert and chail files

pure lion
#

Alright

quartz kindle
#

whats the OS on your vps?

pure lion
#

Debian 10

quartz kindle
#

check nginx's version after installing

#

to make sure it isnt some outdated version

pure lion
#

Got it

#

Also where am I installing?

quartz kindle
#

you can install it on your vps using its built in package manager

pure lion
#

So in the default dir

quartz kindle
#

yeah

pure lion
#

Okay brb

#

*casually opens 4th instance of putty*

solemn latch
#

lol

gritty bolt
#
 if(reaction.emoji.name === "🔗") {
                if (reaction.message.content.includes("https://")) {
                    global.link1 = reaction.message.content.split("https://")[1]
                    global.link = link1.split(" ")[1]
                }
                if(reaction.message.content.includes("http://")) {
                    global.link1 = reaction.message.content.split("http://")[1]
                    global.link = link1.split(" ")[1]
                }
                console.log(link);```
link keeps coming out as undefined and im not sure why
pure lion
#

What are you trying to do?

solemn latch
#

[1] would be the second thing in the array

#

link1.split(" ")[1] will be undefined if there are no spaces

#

iirc

pure lion
#

Tim ver 1.14.2

quartz kindle
#

why are you using global variables?

pure lion
#

Me when the const

quartz kindle
#

@pure lion well current stable is 1.18 and latest is 1.19

pure lion
#

Ah shit

dusky lagoon
#
module.exports = {
    name:"test",
    run(message){
    
        const embed =  new Discord.MessageEmbed()
        .setColor('RED')
        .setDescription('Text')
        .setFooter('page 1')
  
  const embed2 =  new Discord.MessageEmbed()
        .setColor('RED')
        .setDescription('text 2')
        .setFooter('page 2')

        
  
        
  message.channel.send(embed).then(msg => {
              setTimeout(function () {
                  msg.react("◀")
              }, 500)
              setTimeout(function () {
                  msg.react("▶")
              }, 600)
              const collector = msg.createReactionCollector((r, u) => (r.emoji.name === "◀", "▶"))
              collector.on("collect", r => {
                  r.users.remove(message.author.id)
                  switch (r.emoji.name) {
                      case "◀":
                          msg.edit(embed) 
                          break
                      case "▶":
                          msg.edit(embed2) 
                  }
              })
          })

    }
}``` can someone maybe tell me how i can add more pages??
solemn latch
#

youd need to do things differently with more pages

#

since your just doing ▶ is the second page

misty sigil
#

you'd need it in an array

pure lion
#

Hh

quartz kindle
#

also, dont add reactions like that

#

make use of async await

#
....then(async msg => {
  await msg.react("<");
  await msg.react(">");
  const collector = ... 
pure lion
#

Tim what does an object with ... at the start mean?

#

E.g {...[probably an array or something]}

quartz kindle
#

... is a spread operator

#

it attempts to deconstructure the object or array into items

pure lion
#

Meeeeeeeaning

#

Oh

#

Also what would I need to do to get latest ver of nginx?

quartz kindle
pure lion
#

Oh that's actually easy cool

sudden geyser
#

.flat™️

pure lion
#

... vs .flat(

#

3 presses Vs 6

solemn latch
#

these tests you do, its just in browser console?

pure lion
#

H a

#

Tim has dark mode browser confirmed

quartz kindle
#

yes lol

pure lion
#

Wait shit do I need ufw

#

Aaaa

sudden geyser
#

how do you live without dark mode in console

solemn latch
#

🤔

#

ok

#

i see

sudden geyser
#

woo get out

pure lion
#

*dies*

sudden geyser
#

no light

quartz kindle
pure lion
#

:O

#

All hail Tim

solemn latch
#

i dont know what your talking about

#

ive always been on dark mode

pure lion
#

Hmmmm

#

Is that Tim's IMG?

#

hmmmmmmmmm*

solemn latch
#

my wallpaper determines my desktops theme

dusky lagoon
#
module.exports = {
    name:"test",
    run(message){
    
        const embed =  new Discord.MessageEmbed()
        .setColor('RED')
        .setDescription('Text')
        .setFooter('page 1')
  
  const embed2 =  new Discord.MessageEmbed()
        .setColor('RED')
        .setDescription('text 2')
        .setFooter('page 2')

        
  
        
  message.channel.send(embed).then(async msg => {
              setTimeout(function () {
                  msg.react("◀")
              }, 500)
              setTimeout(function () {
                  msg.react("▶")
              }, 600)
              const collector = msg.createReactionCollector((r, u) => (r.emoji.name === "◀", "▶"))
              collector.on("collect", r => {
                  r.users.remove(message.author.id)
                  switch (r.emoji.name) {
                      case "◀":
                          msg.edit(embed) 
                          break
                      case "▶":
                          msg.edit(embed2) 
                  }
              })
          })

    }
}``` i tried using async  msg but im getting a lil confused
solemn latch
#

and it changes wallpapers randomly

#

you can just

await msg.react();
await msg.react();
#

^ will do the first one, wait till the promise resolves, then do the second

quartz kindle
#

the collector is also wrong

#

you cant do comparisons like this r.emoji.name === "◀", "▶"

gritty bolt
#

@pure lion @solemn latch im trying to pull a link out of a message when a user reacts with 🔗

pure lion
#

:l ping

#

I'm getting a 'broken pipe' error

#

On a scale of 1 to fuck how boned am I?

solemn latch
#

ah the basement is flooding

pure lion
#

*exhale*

#

A

solemn latch
#

if you shut off the water in time not at all

earnest phoenix
#

That comparison is better like this

["<Symbol>", "<Another symbol>"].some(e => e === r.reaction.name)```
gritty bolt
#
if (reaction.message.content.includes("https://")) {
                    global.link1 = reaction.message.content.split("https://")[0]
                    global.link = link1.split(" ")[0]
                }
                if(reaction.message.content.includes("http://")) {
                    global.link1 = reaction.message.content.split("http://")[0]
                    global.link = link1.split(" ")[0]
                }
                console.log(link);```
changed the 1s to zeros and I either get nothing if the message is just a link or the first word
solemn latch
#

i think these lines should be [1]
global.link1 = reaction.message.content.split("https://")[0]

quartz kindle
#

^

#

but why are you using globals

#

pls dont

pure lion
#

*cries* the pipe is still broken

#

Would it be wise to install ufw?

solemn latch
#

firewalls are generally a good idea

pure lion
#

Mkay

solemn latch
#

also fail2ban

quartz kindle
#

it doesnt come preinstalled?

pure lion
#

Nope

quartz kindle
#

ubuntu has ufw preinstalled

#

also yes, fail2ban

pure lion
#

Good for ubantu

quartz kindle
#

took me a while to configure it for nginx tho

pure lion
#

:d

solemn latch
#

ubantu best os

quartz kindle
#

my nginx was being spammed with requests from a minecraft launcher

pure lion
#

Why did I choose Deb like a person who only knows how to use deb

#

Lmao what

quartz kindle
#

i had to make a custom rule in fail2ban to block that

pure lion
#

*o-opens 5th instance of putty*

quartz kindle
#

why are you opening so many instances lmao

pure lion
#

Because yes

solemn latch
#

gotta pump those numbers up

#

65 atleast

#

come on

quartz kindle
#

i only have a single ssh connection lmao

pure lion
#

Ok wooMer

solemn latch
#

only time i use more than one is if im watching htop or something

quiet isle
#

Hello! How to put like the bot DMs you when you vote for the bot on top.gg?

pure lion
#

Top.ggapi

quiet isle
#

Oop.

blazing ravine
pure lion
#

Try catch

solemn latch
#

check if you have the perm before doing it

blazing ravine
#

i dont know what error is this

#

only showing in console xd

quartz kindle
#

no permissions to react on a message

blazing ravine
#

maybe from reacts

#

oh okay

#

maybe from f!play command

pure lion
#

Epic I can still ssh

kind sedge
#
    const offline = message.guild.emojis.cache.find(emoji => emoji.name === 'UndefinedOffline');
    const dnd = message.guild.emojis.cache.find(emoji => emoji.name === 'UndefinedDnd');
    const idle = message.guild.emojis.cache.find(emoji => emoji.name === 'UndefinedIdle');
    
    let status;
    switch (user.presence.status) {
        case "online":
            status = `${online} online`;
            break;
            case "dnd":
            status = `${dnd} dnd`;
            break;
            case "idle":
            status = `${idle} idle`;
            break;
            case "offline":
                status = `${offline} offline`;
                break;
    }```
 that is my code but the emojis only work in my server how do I make it on all the servers
lmao
misty sigil
#

<:emojiname:emojiID>

#

:)

pure lion
#

Yooo nginx is working

misty sigil
#

gg Clap

solemn latch
#

you can also get the emoji from your own server

#

your currently getting them from the message's guild

midnight blaze
#

I have some questions about quick db, anyone ever tried it out?

solemn latch
#

quick.db has a support discord

summer torrent
solemn latch
#

oh yeah, non whitenames can post discord links

kind sedge
#

@misty sigil so like this right

#

    const online = message.guild.emojis.cache.find(emoji => emoji.name === ':UndefinedOnline:');
    const offline = message.guild.emojis.cache.find(emoji => emoji.name === ':UndefinedOffline:');
    const dnd = message.guild.emojis.cache.find(emoji => emoji.name === ':UndefinedDnd:');
    const idle = message.guild.emojis.cache.find(emoji => emoji.name === ':UndefinedIdle:');
    ```
#

yo why is it like that

#

whatever

misty sigil
#

no?

kind sedge
#

oop

#

It didn't put in the ids

#

wtf

sterile minnow
#

Can anyone give me a example how i get the Reputation etc from discordrep from a user with @aero/drep in discord.js?

solemn latch
#

in djs?

sterile minnow
#

yes in djs

kind sedge
misty sigil
#

no?

#

you don't need to find

kind sedge
#

wait

misty sigil
#

at all

kind sedge
#

yeah

#

I see that now

#

I'm a dumbass

misty sigil
#

you can just use the <:name:id>

solemn latch
quartz kindle
sterile minnow
#

yes

quartz kindle
#

according to the docs, it should be

#
const { DRepClient } = require('@aero/drep');
const drep = new DRepClient('your-fancy-token');

drep.rep(id) / drep.infractions(id)
sterile minnow
#

ty

quartz kindle
#

just console.log it and you should see what type it is and what it returns

pure lion
#

Tim after I install nginx how can I make it use my express app?

solemn latch
#

reverse proxy

pure lion
#

Who

quartz kindle
#

first check some guides on how to configure your nginx.conf files

#

for example mozilla even has a nginx configuration generator

pure lion
#

I set it up to my ale-bot.xyz domain

quartz kindle
#

you will need to edit your nginx.conf as well as your website.conf in the sites-available and sites-enabled folders

pure lion
#

Alright

quartz kindle
#

then in your website's cont file, you will have a server {} block and inside it a location {} block

#

inside the location block, you can set a proxy_pass directive

#

pointing it to localhost:3000 for example

pure lion
#

Okay I'll have a look before saying I'm confused

sterile minnow
#

Okay so i'm trying it with axios

#

Does anyone know how i like get the stuff from a axios request?

#

like axios.get(url).then(dat =>{})

#

But that doesnt work

#

nvm i have it i think

quartz kindle
#

just console log the response and see what it contains

pure lion
#

Tim what is document root?

#

And why is everything turning orange when I touch it :D

#

I mean on the site woo

#

Smh

quartz kindle
#

where you want your website's folder to be

#

for static files

pure lion
#

Define static

#

Files

quartz kindle
#

html, css, js, images

pure lion
#

I know what static means I'm just confused in that

#

Okay

#

I have a dir called apps where I'm keeping my web apps and a dir inside called diceRTC for rtc

#

I set it up like a normal node express project there and I feel like I did it wrong now because this happened :D

quartz kindle
#

doesnt matter, you can keep it like that

pure lion
#

Okay cool

quartz kindle
#

point the root directory to it

pure lion
#

/apps/diceRTC

quartz kindle
#

for example, if you use static files in node, you define a folder for them

pure lion
#

It went orange

quartz kindle
#

point nginx to the same folder

pure lion
#

The config dir?

quartz kindle
#

if you didnt define any static file, then just put it in the project folder, doesnt matter

pure lion
#

Wait confirming, the field NGINX config dir goes to apps/diceRTC

#

Also idk if it's too late to ask but does peer work by default on nginx

slender thistle
#

is the command being run in a server?

pure lion
#

Lol shiv qt

quartz kindle
#

what config dir? are you still talking about webroot directory or something else?

slender thistle
#

in which living hell's name did you find my message being related to you CatThink

quartz kindle
#

lmao

pure lion
#

On the link you provided

#

:d

#

Also the doc root was set to /apps/diceRTC

quartz kindle
pure lion
#

*can't see*

#

Yes that

quartz kindle
#

thats the folder for static content

#

for example

#

if you ever use images or css files that are not gonna be generated by nodejs

#

you put them inside a folder

pure lion
#

Ah got it

quartz kindle
#

for example /app/diceRTC/public

pure lion
#

hahaha fuck

quartz kindle
#

like the default option suggests

pure lion
#

Oh I already have a public folder with a js file

#

Just a js file

#

I forgot what it does brb

solemn latch
#

lol

pure lion
#

Oh it's for peer stuff

#

H o w s t a t i c

#

Lmao I literally wanted to just set up nginx so I can access the navigators mic and camera

digital ibex
#

hello gamers

pure lion
#

Hello found

solemn latch
#

heya mom

pure lion
#

See what I did there it's funny because your name is lost and yet I called you found ha ha ha ha ha I deserve the death sentence

digital ibex
#

oh ic ic ic ic ic veri funi

#

today i learnt

#

you can have curly brackets in the case thing

pure lion
#

You can what

digital ibex
#

in a switch statement

#

like

pure lion
#

:O

digital ibex
#
switch(urmom) {
    case 'stupid': {   
          // whatever
    }
}```
#

interessant

solemn latch
#

use message.client
or define client in your eval command

pure lion
#

my ting is thissssssssss

#

and my ahgkbergfd what the fuck do i do

digital ibex
#

?

pure lion
#

same

#

im going to bed brb

#

ping me if youre willing to help

faint prism
slender thistle
#

How does unit testing actually work?

faint prism
#

Dependency Inversion

slender thistle
#

What's the actual difference between manual testing and unit tests?

faint prism
#

I can click "Test" and it runs tests instantly to see if a code change I made broke something

restive lily
#

why isnt this working? ive tried so many things and i cant get it do do anything! it just deletes the message and doesnt respond

@commands.command(aliases=['si', 'sinfo', 'guildinfo'])
    async def serverinfo(self, ctx):
        await ctx.message.delete()
        embed = discord.Embed(colour=ctx.author.colour)
        embed.set_author(name=ctx.author.name, icon_url=ctx.author.avatar_url)
        embed.add_field(name='Guild Info', value=f'**Guild Owner:** {ctx.guild.owner}\n**Guild Name:** {ctx.guild.name}\n**Guild ID:** {ctx.guild.id}\n**Server Creation Date:** {ctx.guild.created_at.strftime("%a %b %d %Y at %I:%M %p")}', inline=False)
        embed.add_field(name='Members', value=f'**Total Members:** {len(ctx.guild.members)}', inline=True)
        embed.add_field(name='Role Info', value=f'**Top Role:** {ctx.guild.top_role.mention}', inline=False)
        embed.set_footer(text=f'Requested by: {ctx.author.name}')
        embed.set_thumbnail(url=ctx.author.avatar_url)
        await ctx.send(embed=embed)```
i *think* one of the values is wrong or incorrect but idk which one
#

pls tag or dm me if u have a response

faint prism
#

Notice how fast Unit Tests are

#

It directly tests the logic in your code (without hitting a database or api)

slender thistle
#

Huh

#

That's neat

faint prism
#

Instantly telling you if you broke something somewhere else when you make a new code change

restive lily
#

me?

faint prism
#

But, to make it work, you have to write your code a certain way

#

You have to adhere to SOLID
https://en.wikipedia.org/wiki/SOLID

In object-oriented computer programming, SOLID is a mnemonic acronym for five design principles intended to make software designs more understandable, flexible and maintainable. It is not related to the GRASP software design principles. The principles are a subset of many prin...

slender thistle
#

@restive lily are you running the command in a server

restive lily
#

yes

faint prism
slender thistle
#

Slap a try-except in the command and print the exception when one occurs

restive lily
#

wdym

slender thistle
#

Wrap everything in the command under try-except

restive lily
#

im new and dont know how to do that lmao

#

he talking about me

#

in py

pure lion
#

Yeah I didn't realise it was py

solemn latch
#

If your new, it helps to have a go to resource for things you don't know

pure lion
#

)/

solemn latch
earnest phoenix
#

hi

solemn latch
#

Hi

mellow anchor
#

f

sterile minnow
#

Hello

#

Me again

#

I have a lil npm issue:

If i try to run npm i canvas canvas-constructor

It says sh: 1: node-pre-gyp: Permission denied

But i'm on a root acc

(sudo not usable since i'm on root)

OS:Debian

#

npm --build-from-source install canvas canvas-constructor --unsafe-perm

Doesnt work too

topaz fjord
#

try installing the node-pre-gyp module first

sterile minnow
#

dued tii

#

dies too*

#

and if i try to install normaly it just gets stuck there: node-pre-gyp WARN Using needle for node-pre-gyp https download

earnest phoenix
#

how i can do a input() py but in js?

#

Hey, I have a bunch of organized arrays that are labeled a1-a27 and all have the same info, (their name, their age, their origin, and a picture of them in a link form in order.) I want to create a card for every user based off the info in the arrays, is there any simple way to transfer this info onto a card?

opal plank
#

Yo how exactly does d.js(or any good await message collector) with timer work?
does it just passes message emitted events to a handler while its active?

#

trying to make a message collector but mine seems to inefficient

amber fractal
solemn latch
#

You mean the actual code?

opal plank
#
//create collector map with filter 
collectors = new Map() 
//set channel name + query filter and timer object

message emitted => route it to collector.js

if(!map.has(channel name)) return;

while (date.now() > timer) {
obj.push message object
}
when done => push object with messages back to client



sudden geyser
#

does it just passes message emitted events to a handler while its active?
yes

opal plank
#

thats a gist of what im doing

#

but it looks so inefficient

#

also doesnt allow me to have more than 1 collector per channel

#

im doing something barebones, doesnt need to be super efficient

#

though it definetly looks like im doing a terrible job at it

quartz kindle
#
function collector(channel,filter,timer) {
  return new Promise(resolve => {
    let collection = new Map();
    let handler = message => {
      if(filter(message)) { collection.set(message.id,message) }
    }
    channel.client.on("message",handler)
    setTimeout(() => {
      channel.client.removeEventListener("message",handler)
      resolve(collection);
    },timer)
  })
}
``` something like that i guess
rare moss
#

<help

opal plank
#

hmmmm that looks way better than im doing already tbh

quartz kindle
#

your idea of a global map of collections is also not bad

#

just dont use a while loop for this

solemn latch
opal plank
#

well yeah the while does seem out of place

#

but adding a map like that really screws me over with quantity(even though i still need a 1 limit per channel)

#

i'll try that route you sent @quartz kindle , seems much better than what i had in mind

quartz kindle
#

@solemn latch it extends the base collector

#

the message event calls this

#

the collect() function is basically checking if the id of the channel matches and then the returned message id is used as the key in the collection

uneven crypt
#

is there any way of getting the animated emojis count in the guild? i was trying to filter it with the type but it's not working js message.guild.emojis.cache.filter(e => e.type === "animated").size

solemn latch
#

It took me a minute but I understand now

quartz kindle
uneven crypt
#

oh

#

thanks man

solemn latch
#

I need to spend more time looking over djs github. Theres a lot i don't understand still.

quartz kindle
#

the more you look at it, the more wtf it gets

solemn latch
#

Also didn't know you could reset the timer

quartz kindle
#

djs has a handy timer thingy

#

well not all timeouts use it tho

#

but there are a few timers that have a .refresh() function attached to them for example

opal plank
#

the problem is: im not using d.js lmao

#

i would be using that instead

solemn latch
#

The reaction timer reset and idle timer seems useful.
My reaction collectors are hardcoded to 2 minutes.
Didn't realise I could have reset it every time the user interacts

#

I didn't do much research into it.

earnest phoenix
#

I need help with making hello world bot

#

The CS is DiscordUnity

slender thistle
#

why

quartz kindle
#

you want to make a hello world bot in all languages?

honest perch
#

why

earnest phoenix
#

Yes

#

I currently need help with C# as its too difficult to me

#

I would love to learn C# but its too hard

#

there are infinite amount of libraries

#

there's no possible way you can cover it all

#

I only pick a popular one

#

that's dumv

#

dumb

#

Nuh

#

because the popular libs already have a sample in their docs, a proper one

#

I just wanna do it okie? Thanks chu

#

what did i even expect, should've looked at the avatar first

zinc condor
#

rate this

quartz kindle
#

TIL node.js's version of setTimeout has a .refresh() method

#

i thought it was a thing djs added, but apparently its built in lul

zinc condor
#

what is

quartz kindle
#

@zinc condor looks good. mine was very similar, but i moved to numbered emojis because it had too many pages so it took too long to find things

zinc condor
#

KM_Dorime thank

earnest phoenix
#

wtf did you use for compression because the vid on android discord is just a bunch of stars lmfaoo

#

it works on vlc though

quartz kindle
#

what

#

show

earnest phoenix
quartz kindle
#

lmfao

zinc condor
#

KEKW if your talking about my video my screenrecorder is in a really werid codec and i cant change it

#

on linux

#

so yeh

quartz kindle
#

why do linux guis look so shit

zinc condor
#

that particular one is gnome

#

its installed by default in Pop OS and i dont really care enough to change it

#

works well

#

laptop gui is much much better

#

uses Plasma

earnest phoenix
#

ngl that looks better than what windows forms gives us

quartz kindle
#

tru

zinc condor
#

also im on a laptop, its a gaming laptop but still a laptop.
shit works slow on windows so yeh

quartz kindle
#

i've never used windows langs but windows's native gui elements are ugly af

zinc condor
#

prefer to just have them dualboot for when i play games

solemn latch
#

I miss the old style of ui.
Basic, and just menus

zinc condor
#

GTK(gnome UI framework) runs on windows

#

you can compile GTK for windows and it looks like gtk on windows

#

disorienting

quartz kindle
#

i always disliked gtk

zinc condor
#

i still dislike it

#

qt is nicer

#

even though slower

#

actually at this point they might be equal

#

gtk is bloated now especially with glade

earnest phoenix
#

and then there's the modern era
✨ everything is electron ✨ @solemn latch @solemn latch

quartz kindle
#

xD

earnest phoenix
#

thanks phone

#

it double pinged

zinc condor
#

i hate electron KM_Dorime

quartz kindle
#

i like nw.js better than electron, although its mostly the same thing

earnest phoenix
#

nothing still rivals electron in features unfortunately, think transparency etc

zinc condor
#

KM_Dorime all my apps use Qt and are made in C++ or the Go wrapper for Qt

#

the only time i use electron is when i gotta deal with MANY async operations

#

like multiple things on ui changing at once

#

in Qt that is absolute hell

#

actually its nicer in Go cuz goroutine and the app runs on many threads and communicates

#

but still bleh

earnest phoenix
#

Cutie

zinc condor
earnest phoenix
#

i recently worked with ultralight which is a html based renderer in cpp, nice alternative to electron and it's extremely lightweight - still doesn't rival electron, the renderer runs 30fps max and no transparency support :/

quartz kindle
#

there are many attempts at relying on the OS's native gui elements instead of something like chromium

#

everyone and their grandmother are trying to make gui's for node.js lol

zinc condor
#

KM_Dorime tfw i dont like JS or even TS and avoid it for everything but frontend

#

same with python actually, i only use it for like AI stuff

#

or simple scripting

quartz kindle
#

i use js for everything because why not :^)

zinc condor
#

i use Go for everything i can and C++/Rust for gamedev or lower level shit

#

Vue for frontend

quartz kindle
#

i've never used a frontend framework

#

i probably should tbh

zinc condor
#

yeah its much better

#

trust me on that one

quartz kindle
#

they all look so bloated tho

#

every website out there that uses react or whatever the shit they use feels slow af

digital ibex
#

anything i wrote in js for backend

#

i might rewrite it into go

#

dynos site uses react, i think its pretty fast

zinc condor
#

i like vue

#

i dont like jsx

#

its horrible in my opinion

#

vue and svelte are my favorite frameworks

topaz fjord
#

@zinc condor qt license is aids

zinc condor
#

maybe so

#

i dont do commercial shit so idc much

digital ibex
#

i wanna actually learn vue or nuxt

#

where do u recommend learning vue @zinc condor ?

topaz fjord
#

I use preact for my web framework

#

preact is just a slimmed react

digital ibex
#

i like react

zinc condor
#

@digital ibex i learned Vue from my dev friend who does it alot, also a few simple tutorials, in theory its really simple

topaz fjord
#

I think it's a 3kb or 4kb gzip

zinc condor
#

vuex is complicated somewhat tho

digital ibex
#

but i think react is kinda dying tho, so i dont wanna fully learn it

topaz fjord
#

I've seen vue and I much prefer react

#

react isn't dying?

digital ibex
#

do u recommend any good tutorials?

#

idk

#

most code servers im in dont like react

zinc condor
digital ibex
#

oo thanks :)

topaz fjord
#

react is killing other frameworks mmLol

digital ibex
#

o

topaz fjord
#

e.g. angular and shit

zinc condor
#

ok angular is absolute trash

digital ibex
#

i've heard angul-

#

yeah

zinc condor
#

everyone except the angular users can agree

digital ibex
#

lol

zinc condor
#

vue, react, svelte. doesnt matter, we all hate angular

topaz fjord
#

but yes preact is lit

digital ibex
#

does using a framework make frontend easier?

#

like the ui?

zinc condor
#

ive found it does

topaz fjord
#

UI wise?

#

I don't think so

zinc condor
#

its better with scripting

digital ibex
#

i dont understand how tho (i've never used one before)

#

oh

zinc condor
#

for example you can bind an array with data to basically always foreach

#

its weird

#

but yeah bind an array to an element

digital ibex
#

but how does that like

topaz fjord
#

but that's for UI updating

digital ibex
#

make the design look better?

#

cuz if it changes it, im watching that rn instead of sleeping

zinc condor
#

mmm it doesnt unless you use frameworks built ontop of vue

#

like this

topaz fjord
#

what you're talking about is a css framework

#

a web framework is different

digital ibex
#

yeah

#

i use bulma and materializecss

#

still looks shit

zinc condor
#

KM_Dorime those are some interesting framework choices

#

lemme show something i made in scss

topaz fjord
#

i don't use a css framework

digital ibex
#

materialize is nice

#

i really like it

zinc condor
#

this is my status page

#

no frameworks at all

digital ibex
#

but for some reasno, i made it shit

topaz fjord
zinc condor
#

an older version doe but yeah

digital ibex
#

noice

topaz fjord
#

css frameworks are useless to me

digital ibex
#

i really like bulma

#

its really simple for a retard like me

topaz fjord
#

i didn't know how to do it without one

#

before

#

I just decided to do it because I wasn't getting what I wanted with one

digital ibex
#

oh

zinc condor
#

slide tfw yall ignored my screenshot of status page

digital ibex
#

i said "noice"

zinc condor
#

oh lmao

topaz fjord
#

it's nice but the purple header is too bright

digital ibex
#

cuz it /tenor noice

#

u got at least 7 shards with only 3 servers :o

topaz fjord
#

I should add a light mode

#

and kill people's eyes

digital ibex
#

how did u make it responsive and add a hamburger menu if ur on mobile?

sudden geyser
#

right click the gear and hover over apperance

digital ibex
#

and just a navbar on pc

sudden geyser
#

fast light mode

digital ibex
#

once u enter light mode

#

theres no going back

#

its their fault for doing it :o

latent moth
digital ibex
#

i find bug (i think) in ur website

#

if u click on the turtle it shows the menu when ur on mobile

strange trout
#

I like bulma

topaz fjord
#

@digital ibex not a bug

#

turtle image routes to /

#

whenever I route I close the menu

earnest phoenix
#

hello, if someone can ping me i need help with this. i need to figure out inside a discord.py embed how to ping a user

#

just like this please DM @gleaming zephyr

#

sorry for the ping mak, but can someone help out

solemn latch
#

<@userid>

earnest phoenix
#

@solemn latch embed.add_embed_field<@USERID> ?

#

like that

solemn latch
#

In the screenshot its the description, but you can do it in a field too I believe

gritty bolt
#

How do I fix this? js TypeError: fields.flat is not a function at Function.normalizeFields (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:443:8) at MessageEmbed.addFields (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:259:42) at MessageEmbed.addField (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:250:17) at /home/ubuntu/index.js:97:38 at process._tickCallback (internal/process/next_tick.js:68:7) TypeError: fields.flat is not a function at Function.normalizeFields (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:443:8) at MessageEmbed.addFields (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:259:42) at MessageEmbed.addField (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:250:17) at /home/ubuntu/index.js:97:38 at process._tickCallback (internal/process/next_tick.js:68:7) 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(). The promise rejected with the reason: TypeError: fields.flat is not a function at Function.normalizeFields (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:443:8) at MessageEmbed.addFields (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:259:42) at MessageEmbed.addField (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:250:17) at /home/ubuntu/index.js:97:38 at process._tickCallback (internal/process/next_tick.js:68:7)

solemn latch
#

Nodejs is outdated iirc

#

For the fields.flat error

#

Think you need version 12+

harsh moon
#

I have that same error on line 68:7

#

just updated hopefully will fix it

hallow frigate
#

the api have a portuguese support ?

harsh moon
#

ummm idk

hallow frigate
harsh moon
#

yes

hallow frigate
#

Oh, thanks

#

i don't speak english very well

harsh moon
solemn latch
#

Missing permissions just means your bot tried doing something it didn't have permissions to do

opal plank
#

wait until @hallow frigate realizes that me, Tim and a bunch of others speak Hue-Hue

pine aspen
#

Hi, does anyone know how to keep lavalink / jar file up 24/7?

faint prism
#

Keep up?

surreal notch
#

When a user have muted role and I use cmd ,unmute user it shows mssg the user doesn't have a muted role and when I take the role from user it shows the user is unmuted.

sudden geyser
#

what library and where in your code is it not working, as it's probably a logical error

surreal notch
#

Discord.js and let me share codes

#

@sudden geyser

#
  name: "unmute",
  category: "moderation",
  run: async (client, message, args) => {
    if (!message.member.hasPermission("MANAGE_ROLES")) {
      return message.channel.send(
        "Sorry but you do not have permission to unmute anyone"
      );
    }

    if (!message.guild.me.hasPermission("MANAGE_ROLES")) {
      return message.channel.send("I do not have permission to manage roles.");
    }

    const user = message.mentions.members.first();

    if (!user) {
      return message.channel.send(
        "Please mention the member to who you want to unmute"
      );
    }
    
    let muterole = message.guild.roles.cache.find(x => x.name === "Muted")
    
    
 if(user.roles.cache.has(muterole.id)) {
      return message.channel.send("Given User do not have mute role so what i am suppose to take")
    }
    
    
    user.roles.remove(muterole.id)
    
    await message.channel.send(`**${message.mentions.users.first().username}** is unmuted`)
    
    user.send(`You are now unmuted from **${message.guild.name}**`)

  }
};```
#

😐

sudden geyser
#

So it's responding with "Given User do not have mute role so what i am suppose to take"? Weird, it looks correct at first glance.

sudden geyser
#

oh wait im dumb

surreal notch
#

Why

sudden geyser
#

user.roles.cache.has(muterole.id) returns true if the role id is in the guild members roles collection

#

therefore it is

#

so it's running that block of code

#

use the ! operator before it to say "if it's not in the collection"

surreal notch
#

If it is blocking the code then I will put it in last lol

sudden geyser
#

confused. you just need to negate it with a ! before it

surreal notch
#

Ok

#

But before what

#

!

harsh moon
#

But my bot has to have perms or the checker will msg that It needs admin 😐

surreal notch
#

@harsh moon u want that checker of sign on admin while inviting bot?

harsh moon
#

sure

#

idk how to do that

#

@surreal notch

dark gull
#

.

slow fable
#

What are the main naming differences between eris and discord.js

#

like the class names and function names

restive furnace
#

dOt PoSt

#

SoloReece#9999

plain acorn
#

m getting this error

restive furnace
#

nice token leak

earnest phoenix
restive furnace
#

===

#

make it to startsWith

earnest phoenix
#

I will try that

#

It did not work

harsh moon
#

It should

#

Because that’s how I have it for my code

earnest phoenix
#

Me too, I have many different commands using that exact code and I just replaced the input and the output and now it doesn't work

surreal notch
#

@harsh moon if u want that link u need to setup oath2

harsh moon
#

Maybe because the input is a baritone

earnest phoenix
#

What’s the max nickname length?

harsh moon
#

Variable

earnest phoenix
#

Ohhh, maybe

harsh moon
#

That is my auth2

earnest phoenix
#

advertising thonk

harsh moon
#

Is that what you mean?

earnest phoenix
#

It still doesn't work @harsh moon 😕

harsh moon
#

Oof

surreal notch
#

@harsh moon Go to auth2 in portal and select bot there and then select perms of your bot at admin and copy the link

blazing ravine
#

gm

harsh moon
earnest phoenix
surreal notch
#

@harsh moon yes it's ok

#

@earnest phoenix Check the errors in console

restive furnace
#

@earnest phoenix i already helped you

#

use string#startsWith.

earnest phoenix
#

it doesn't work

#

I tried it

harsh moon
#

Idk then

restive furnace
#

it does

#

depends how you use it

harsh moon
#

Yeah that is how you use it it’s just not working

blazing ravine
#

if (!msg.content.toLocaleLowerCase().startsWith(PREFIX)) return;

#

;d

surreal notch
blazing ravine
#

👌 \

restive furnace
#

why toLocaleLowerCase always

#

havent heard of toLowerCase

harsh moon
#

...

#

Dam you live under a rock

surreal notch
#

Locale Rip

blazing ravine
#

@restive furnace

restive furnace
#

clientUser#setStatus("idle"); on ready event.

blazing ravine
#

already

restive furnace
#

code?

#

show urs full

#

ready event

blazing ravine
#

1m

still lily
#

i was hoping to code a discord bot that will be able to identify if someones online on hypixel or another minecraft server. I do know that minecraft is coded in java and discord bots can be too but since i know nothing about java is there anyway i could make a bot like this in js or py

restive furnace
#

thats not bot.user.setStatus("dnd");

#

i was hoping to code a discord bot that will be able to identify if someones online on hypixel or another minecraft server. I do know that minecraft is coded in java and discord bots can be too but since i know nothing about java is there anyway i could make a bot like this in js or py
yes, but you would still need to code the server-side stuff in java, like the identify command or what ever

blazing ravine
#

@restive furnace not work ;/

still lily
#

oof

blazing ravine
still lily
#

also i would somehow have to code it without using a plugin

#

i just saw a bot do this in the past

restive furnace
#

@blazing ravine use that snippet i sent you, and wait some time...

still lily
#

and i was wondering if i could do it to

blazing ravine
#

k

surreal notch
#

@still lily how u are a bot dev then

#

😐

pure lion
#

@still lily use a plugin if you don't want to die/potentially be ratelimited to hell

still lily
#

@surreal notch im talking about java right now

#

i dont know java

surreal notch
#

Hm

still lily
#

@pure lion im trying to have it tell me if certin people are on hypixel

#

so i can check my phone insted of my pc

pure lion
#

@surreal notch some people actually learn coding languages instead of using a bot builder app, what do you hope to achieve by saying that?

#

Also hmmm

still lily
#

i saw someone do this in a video

surreal notch
#

😐 😬

still lily
#

but he was just showcasing it

#

so idk how to accually code it

pure lion
#

Does the hypixel server hold activity statuses?

surreal notch
#

I also have a ques is there any difference b/w java and javascript

pure lion
#

Yes

restive furnace
#

ofc

#

lol

pure lion
#

Js is interpreted and a lower level than java (I believe)

surreal notch
#

Oh

still lily
#

ok i did some resarch

#

hypixel has a api

restive furnace
#

JS is interpreted, and java is interpreted and compiled while java is lower-level one.

still lily
#

but they dont have anything for when someone logs in

pure lion
#

@still lily good that's good

still lily
#

so i would have to do a lot of work

pure lion
#

An API is the best thing you can get rn

#

You wanna make a request with the username and get the activity status? Piece of cake

still lily
#

it would need constent reqests

#

yep

#

suld be easy

#

just need to learn java

pure lion
#

It depends on how good the API is

restive furnace
#

u dont need to with APIs

pure lion
#

Even so, any API is better than none

restive furnace
#

you can use js for api requests

#

for example

surreal notch
#

Can we make our own api

#

¯\_(ツ)_/¯

pure lion
#

Yes

restive furnace
#

yes

pure lion
#

I made my own api

surreal notch
#

How

restive furnace
#

those are basic programming questions..

surreal notch
#

And what does my own api do

#

😬

still lily
pure lion
#

To interact with my mongodb

still lily
#

oh nice they have a help form

pure lion
#

Yeah good luck, if you need help reading the docs we're here to help

surreal notch
#

Can I make my own bot api

#

😬

still lily
#

they just have a github

#

no docs

pure lion
#

I doubt it x)

#

@still lily show ss

surreal notch
pure lion
#

Or send link

still lily
#

wait im slow

pure lion
#

It's fine I'm tired

still lily
pure lion
#

*hug* I t s f i n e

#

Gogogogog have a good time

thick gull
#

hypixel api is cool and all but why do you still have access to games that were removed through the api 🙃

pure lion
#

Because develop

surreal notch
#

I hve one ques

sinful sorrel
#

hello

#

i wan to ask

pure lion
#

Sup

sinful sorrel
#

how to make bot when me mention the bot then the bot reply

sullen harness
#

message.reply()

pure lion
#

Check if the mention has the client user

sinful sorrel
#

y

#

i mean

#

like this

#

@pure lion

sullen harness
#

Oh.

pure lion
#

Idk what lib you're using

sinful sorrel
#

wdym

wanton anvil
#

@sinful sorrel
if Client.user in message.mentions: return 'something'

#

ok?

sinful sorrel
#

wait

#

letme try

wanton anvil
#

k

sullen harness
#

I used the bot's id and regex for that.

#

Hard to explain while I'm on my phone though.

pure lion
#

if (message.mentions.has(client.user))

still lily
#

alright i found a tutorial for how to find a players stats using python so im gonna start there

#

oh i also need to get a API key

#

so i got to start tomarow

#

good night everyone

wanton anvil
#

is this discord's official server

#

??

mild flower
#

no

blazing ravine
wanton anvil
#

k thanks

#

does discord have it's official server??

surreal notch
#

How can we attach our discord bot with our website means if we use this cmd then this happens in website

#

Etc.

sinful sorrel
#

if (message.mentions.has(client.user))
@pure lion ty very much man

#

@sinful sorrel
if Client.user in message.mentions: return 'something'
@wanton anvil tysm

wanton anvil
#

@sinful sorrel did it work

#

you are welcome

sinful sorrel
#

@sinful sorrel did it work
@wanton anvil if (message.mentions.has(client.user))

#

i realy epriciate it

#

aa

#

icant type good

#

rip ing

wanton anvil
#

in my bot i used the if statement which I said you

#

how can I get developer role??

sullen harness
#

If your bot gets approved

wanton anvil
#

I have created 20 bots

#

non-approved

#

how to do that

sullen harness
wanton anvil
#

thanks

surreal notch
sullen harness
#

By creating a dashboard or something alike.

#

Plenty of tutorials on YouTube

wanton anvil
#

@surreal notch is that website your's ??

surreal notch
#

Which ones@wanton anvil

wanton anvil
#

that which you want to run commands one you give certain instructions to your discord bot

surreal notch
#

Yeah I m working on a site

wanton anvil
#

which language are you using for backend

surreal notch
#

Ok site?

wanton anvil
#

yeah

#

site

surreal notch
#

Actually I didn't have done yet for backend

#

I m working on frontend then backend

#

I m not that much good at backend

wanton anvil
#

do you know python

surreal notch
#

Nope

wanton anvil
#

create a api for you site, let your bot send a http request to your site and create a program for giving client information in frontend

#

I hope that works

#

happy coding!!

surreal notch
#

Ok

delicate shore
#

ok

#

@wanton anvil yes?

wanton anvil
#

try the mentions for that command instead of ids

delicate shore
#

@wanton anvil what ?

#

i am using mentions only

#

i am pretty sure

surreal notch
#

to set welcome channel by db i have done db.set() and what to do to remove welcome?

pale vessel
#

guess

lusty quest
#

there are many ways. one easy way is using a defined number / string you can check if its set to it or not

glass steeple
#

my bot is reacting to member's msgs but some mebers can't see the reaction, why is that so ?

lusty quest
#

custom emoji?

glass steeple
#

nope

#

#

this

#

i can see that reaction

lusty quest
#

i dont think there is a permission for seeing reactions. wired

delicate shore
#

ok

glass steeple
#

but some members can't

delicate shore
#

ok

#
client.guilds.cache.map(x=>x.memberCount)
#

i wanna limit respond to only top 5

lusty quest
#

i know a stupid way, where i dont know if it works

delicate shore
#

ok

restive furnace
#

filter

lusty quest
#

ok this is better.

#

my way is really really stupid and inefficent

restive furnace
#

console.log(topGuilds);``` thats how you would do it
#

and basically this isnt spoonfeeding since he had code like that

lusty quest
#

i think he wanted a dynamic limit for the 5 largest guilds

#

but i dont get why

restive furnace
#

mehh just do some math

pale vessel
#

what kind of guild doesn't have memberCount, unavailable guilds?

restive furnace
#

i aint doing that math

pale vessel
#

oh nm

#

misread

pure lion
#

Who piged ne

wanton anvil
#

piged you??

pure lion
#

Someone piged me

wanton anvil
#

did u mean pinged

pale vessel
wanton anvil
#

@pure lion Findy pinged you

pure lion
#

@wanton anvil stop poging me

wanton anvil
#

it's ping dude chill out I'll not Ping you

surreal notch
#

how to setup that whenever my bot catches error instead of showing it in console it will send message in that channel

wanton anvil
#

try this

restive furnace
#

promise.catch(() => m.channel.send())

surreal notch
#

discord.js?

restive furnace
#

js

#

any js

wanton anvil
#

try:
your code
except:
message.chanel.send('message') @surreal notch

surreal notch
#

ok

restive furnace
#

thats python

surreal notch
#

lol

pale vessel
#

it's not even valid python

wanton anvil
#

just saying @pale vessel

restive furnace
#

promise.catch(() => m.channel.send())
@restive furnace this works on any js library what uses promises

wanton anvil
#

this not a compiler

pale vessel
#

you do realize he'd copy paste anything people say

pure lion
#

Find channel in guild

slender thistle
#

client.guild doesn't exist

#

Find a guild first, then find a channel

pale vessel
#

client is not even defined not a handler

#

oh

wanton anvil
#

this is .py I am telling you this because you'll get a idea CLient.get_guild(ID).get_channel(ID)

umbral pollen
#

what is BOT_GUILD

pale vessel
#

read docs

umbral pollen
#

@pale vessel do you know BOT_GUILD ??

pale vessel
#

no

umbral pollen
#

hmmmmm sad

jolly quail
#

client.guilds.cache.find(guild=>guild.id===YOURGUILDID).channels.cache.find(ch=>ch.id===CHANNELID)

#

@earnest phoenix

#

Maybe

golden condor
#

You don't have to do that

umbral pollen
#

@jolly quail do you know anything about BOT_GUILD

jolly quail
#

Nope

umbral pollen
#

@golden condor ??

golden condor
#

client.guilds.cache.get(GUILD ID).channels.cache.get(CHANNEL ID)

jolly quail
#

Oh ya get works

golden condor
#

Makes it less complicated

wanton anvil
#

@umbral pollen are you saying about Client.get_guild()