#development

1 messages · Page 816 of 1

quartz kindle
#

Lol

digital ibex
#

#00F1FF

#

OH

#

ok

#

so

quartz kindle
#

You need to append the 0s

digital ibex
#

yea

lyric mountain
#

is it #00F1FF or #F1FF00?

unique nimbus
#

@lyric mountain There is no server like this in Russian

#

basically

digital ibex
#

1st 1

lyric mountain
#

@lyric mountain There is no server like this in Russian
@unique nimbus I like pancake better

unique nimbus
#

yes

slender thistle
#

What's happening here

digital ibex
#

pancake is a bot

#

also

lyric mountain
#

What's happening here
@slender thistle jsut as usual, no russian

plucky jewel
#

хах

lyric mountain
#

sorry for the pun

digital ibex
#

how would i get the the highest role colour of a member?

plucky jewel
#

найс @lyric mountain

lyric mountain
#

@plucky jewel have you figured it out?

quartz kindle
#

You can do this: "000000".slice(hex.length) + hex

earnest phoenix
#

Now my bot is counting the hours as seconds partyblob

quartz kindle
#

Where hex is color.tostring

#

You can also hex.toUpperCase()

digital ibex
#

yea

plucky jewel
#

@lyric mountain ВоТаФа?

lyric mountain
#

Now my bot is counting the hours as seconds :partyblob:
@earnest phoenix seconds / 60 / 60

earnest phoenix
#

/60 /60?

lyric mountain
#

1 hour = 60 minutes

digital ibex
#

someones having fun with the quote feature

lyric mountain
#

1 minute = 60 seconds

#

or just make seconds / 3600

earnest phoenix
#

That makes more sene

#

sense

#

Why it wasnt working like it used to

lyric mountain
#

it just feels a bit better to me when using 60 / 60

#

like, it's a bit better visually

earnest phoenix
#

w

lyric mountain
#

@plucky jewel Извините, вы выяснили свою проблему?

#

Возможно, это проблема с настройками Heroku

plucky jewel
#

Кто его знает @lyric mountain

#

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

lyric mountain
#

Какой язык вы используете?

plucky jewel
#

Питон

lyric mountain
#

ah

#

Вы должны выбрать тот язык, который вы используете

#

В этом случае выберите только Python

plucky jewel
#

Я так и сделал @lyric mountain

lyric mountain
#

Все еще получаете неправильную языковую ошибку?

plucky jewel
#

Да. @lyric mountain

lyric mountain
#

Не могли бы вы показать нам ошибку вывода?

plucky jewel
#

Завтра покажу. Сегодня уже не могу @lyric mountain

lyric mountain
#

ok

steel heath
#

uh oh

wide ridge
#

Using nodejs and mongodb, how would I horizontally scale my app? Would I have to look into Redis for stateful processes? Just kind of confused on how I would run the server because right now when I use pm2 it runs my server 4 times and runs all commands 4 times xD

#

Would appreciate any help at all ❤️

flat pelican
hushed berry
#

Horizontally scaling bots is a bit of a doozy

#

Its generally accomplished through sharding

lyric mountain
#

@flat pelican it was questions regarding programming, I thought it belonged here, my bad

amber fractal
#

mongodbs are also shardable

#

and very good at horizontal scalability

heavy marsh
#

Need a help! discord.js
To get a user avatar is this member.user.avatarURL. But how to even get it when the user has a default avatar as I get it as blank

#

in Discord.js version 11

hollow saddle
#

user.displayAvatarURL

heavy marsh
#

so ...

member.user.displayAvatarURL```
hollow saddle
#

Yes

prime cliff
#

member.user WaitWhat

heavy marsh
#

Thank you! - I will test it out

shy turret
#

I've been working with some Discord Oauth2... I found out how to manually do it with https://reqbin.com/ but I can't find a way to do the body forms in js..

#

Is it possible to send it raw like this:

#
POST /api/oauth2/token HTTP/1.1
Host: discordapp.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 203

client_id=(id)&client_secret=(token)&grant_type=authorization_code&code=(code)&redirect_uri=(link)&scope=identify
earnest phoenix
#

you need an active webserver

#

reqbin won't work because you have to securely store your client secret and access tokens

shy turret
#

@earnest phoenix ikr but im saying i found out how to do it the raw way with resbin

quartz kindle
#

Dont use request as its deprecated

shy turret
#

still works

unique nimbus
#

use it until it breaks

#

then fix it

shy turret
#

{"message": "405: Method Not Allowed", "code": 0}

#

oof

slate oyster
#

I always used XMLHttpRequest in JS
Dunno what this request lib is lol

quartz kindle
#

xmlhttp is not available in node

shy turret
#

I actually did it.

shy turret
#

let userinfoarray = JSON.parse(userinfo) what is wrong with this..

#
undefined:1
undefined
^
SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
at Request._callback (/app/server.js:29:36)
    at self.callback (/rbd/pnpm-volume/9b4f293b-0301-4ace-8e5e-d1f7cb590ac0/node_modules/.registry.npmjs.org/request/2.88.2/node_modules/request/request.js:185:22)
    at Request.emit (events.js:196:13)
    at Auth.onRequest (/rbd/pnpm-volume/9b4f293b-0301-4ace-8e5e-d1f7cb590ac0/node_modules/.registry.npmjs.org/request/2.88.2/node_modules/request/lib/auth.js:132:18)
    at Request.auth (/rbd/pnpm-volume/9b4f293b-0301-4ace-8e5e-d1f7cb590ac0/node_modules/.registry.npmjs.org/request/2.88.2/node_modules/request/request.js:1341:14)
    at Request.init (/rbd/pnpm-volume/9b4f293b-0301-4ace-8e5e-d1f7cb590ac0/node_modules/.registry.npmjs.org/request/2.88.2/node_modules/request/request.js:378:10)
    at new Request (/rbd/pnpm-volume/9b4f293b-0301-4ace-8e5e-d1f7cb590ac0/node_modules/.registry.npmjs.org/request/2.88.2/node_modules/request/request.js:127:8)
    at request (/rbd/pnpm-volume/9b4f293b-0301-4ace-8e5e-d1f7cb590ac0/node_modules/.registry.npmjs.org/request/2.88.2/node_modules/request/index.js:53:10)
    at Function.get (/rbd/pnpm-volume/9b4f293b-0301-4ace-8e5e-d1f7cb590ac0/node_modules/.registry.npmjs.org/request/2.88.2/node_modules/request/index.js:61:12)
#

oh wait i might know

#

nvm

#

works again weird

modest maple
#

If you get a invalid / different response to a normal JSON response it won't like it

#

I'll try interact with a non JSON type and crash

shy turret
#

it just fixed by itself..

modest maple
#

Because your response wasn't undefined

copper cradle
#

it didn't lol

quartz kindle
#

It just means your code does not account for possible errors or unexpected data

shy turret
#

ikr

copper cradle
#

I swear to god

#

if it's a reference error

queen folio
#

right, I'm using discord.py and using the on_reaction_add event to check for reactions added, since wait_for didn't work. How do I figure out the user who called that said command?

modest maple
#

By any chance when you used wait_for did you give it on_reaction_add not reaction_add

#

Or

#

Did you not have a check that stops it from firing on the very first reaction and then finishing

fallow mango
#

Hey I'm trying to connect to my website data base but I keep getting a connection error with the FireZilla software;-;

quartz kindle
#

Describe the issue in more detail

#

Where is your website hosted, what database does it use, whether it requires ssh keys

earnest phoenix
#
let title = message
let description = message

These two are erroring on this line when I try to call:

if(title && description){

Any idea why?
I used const, var, and let

crimson vapor
#

What is the error?

earnest phoenix
#
(node:16) UnhandledPromiseRejectionWarning: ReferenceError: title is not defined
at Object.execute (/home/container/commands/Support/remoteticket:30:5)
at Client.<anonymous> (/home/container/index.js:59:13)
at Client.emit (events.js:210:5)
#

There is more but I don't want to flood the chat and it isn't very useful

crimson vapor
#

I’m not sure

earnest phoenix
#

Oke

copper cradle
#

@earnest phoenix it fucking says right there

#

are you trying to reference title before it being declared?

#

like any line above

dense drift
#

Anyone know how to reference the array name with a forEach() command?

For example, if my array is

array = { '10000' => { uno: 'one',
    dos: 'two'} }```

And I want to reference it in the `forEach()` like
```js
array.forEach(a => {
let d = a
console.log(d)
})```

Right now it prints the *entire* array, I would like to just print out the top level, '10000.'

Any pointers in the right direction would be very helpful.
copper cradle
#

that's not an array

#

that's an object

#

it's still iterable

#

tho

#

I think Object.entries turns it into an array of objects with each entry as an obj

#

but I'm not sure

#

@dense drift

#

And why is there an arrow function, that's literally useless for what you're doing

#

and this is an array ```js
let arr = [1, 2, 3, 4, 5, 6];

maiden kayak
#

How would I put a limit on how often one could use a command in JS

dense drift
#

Okay, it's technically a database that I'm using.

dense drift
#
array = { '10000' => { uno: 'one',
    dos: 'two'} 
'20000' => { cat: 'yes',
dog: 'no' } }```
#

That's a better explanation

#

Ikit, I'd use a database.

maiden kayak
#

like discord.js?

dense drift
#

Whatever you'd like to use.

maiden kayak
#

kk

dense drift
#

There are many databases to chose from.

#

Whatever is the easiest you could use.

#

When the command is run,

setTimeout(() => { client.cooldown.set(msg.author.id, 'no'), [TIME IN MS])

When the command is run again,

if(client.cooldown.get(msg.author.id) == 'no') return msg.channel.send(`You're on cooldown!`)```
maiden kayak
#

thanks

dense drift
#

yep

maiden kayak
#

sorry for buggin

dense drift
#

No worries

maiden kayak
#

and id put this a line under the message.content?

dense drift
#

The second line yeah, but you need to figure out what database you want to use.

maiden kayak
#

i npm installed discord.js if thats what you mean

dense drift
#

No

#

I mean find a database

maiden kayak
#

im afraid im lost

#

like node?

dense drift
maiden kayak
#

i see

#

i installed mysql

#

i can only assume i did it correctly since its not returning any errors

#

though i am getting an error with the above code

    if(client.cooldown.get(msg.author.id) == 'no') return msg.channel.send(`You're on cooldown!`)```
where at the [500]) segment it says that it expects ; instead of )
dense drift
#

Don't use the []

maiden kayak
#

kk

dense drift
#

Also, you need to create the database, and add to it.

#

I'm not sure how to interact with mysql, as I don't use it

maiden kayak
#

understood

earnest phoenix
#

Help me

#

Any one know how to make shit command like dank memer

#

Please mention me if anyone knows

maiden kayak
#

try

    message.channel.send ('the image url')
  }```
@earnest phoenix
earnest phoenix
#

@maiden kayak i want to know image url

maiden kayak
#
    message.channel.send('https://i.ya-webdesign.com/images/objection-transparent-pheonix-wright-3.png')```
is one I use
earnest phoenix
#

Dude

maiden kayak
#

the image url

earnest phoenix
#

Wait let me check url

maiden kayak
#

find the image on google, then right click it, then click copy image address

earnest phoenix
#

Then ?

maiden kayak
#

if (message.content === 'Shit') {
message.channel.send('Paste it here')

earnest phoenix
#

I use discord bot designer

#

oh no

#

@earnest phoenix

maiden kayak
#

uhh

#

should transfer 1-1 no?

marble juniper
#

dbm has its own support server

#

so why ask here

earnest phoenix
#

I can help

#

i actually have it paid for on steam

marble juniper
#

u wot

earnest phoenix
#

i use vs code now thou

#

get rekted

marble juniper
#

yes

#

I use js

earnest phoenix
#

@earnest phoenix create the command, then send the message with an action

#

same

marble juniper
#

well as I said go ask in the support server of "discord bot designer" @earnest phoenix

earnest phoenix
#

@marble juniper sorry

#

I was banned from the servers

marble juniper
#

same

#

lol

#

not like I care

maiden kayak
#

i

#

how

earnest phoenix
#

cars

marble juniper
#

*care

earnest phoenix
#

how what @maiden kayak

marble juniper
#

explain

earnest phoenix
#

explain it all

maiden kayak
#

oh, another error has cropped up with my bot. I changed a code from one message to output to another yet my bot still reads the old one, as well as the new one

#
if (message.content === 'bee') {
    message.channel.send ('hive')```

to

```if (message.content === 'hive') {
    message.channel.send ('bee')```
makes the bot respond to both
earnest phoenix
#

so what did you want again?

maiden kayak
#

id like it to stop responding to the previous imput

#

and only respond to the new one

earnest phoenix
#

So you want it to respond to you saying bee

maiden kayak
#

its just a placeholder

earnest phoenix
#

This is the equivalent of "Have you tried turning it off and on again": Did you restart the instance of the bot

#

Help pls

#

I'm dumb

maiden kayak
#

@earnest phoenix ill just restart it tomorrow, thanks though

earnest phoenix
#

Help

torn nebula
#

see error

earnest phoenix
#

What

#

Help please

#

DM if u can help

#

Someone help

torn nebula
#

show what u typed in server...

earnest phoenix
#

What?

torn nebula
#

u need to add

invite code iirc

earnest phoenix
#

How do I do that

torn nebula
#

go to ur server create invite
copy code add it

earnest phoenix
#

Are you trying to add multiple servers to your "Powered by" field

#

I did

#

I'm confused

#

@earnest phoenix Yeah I was right

#

So

#

You put the ID of the server

#

If you wanna place multiple servers iirc at max 3, you separate them with ,

#

Okay

#

Ugh Discord skipped it. I meant a comma and a space

#

So ID, ID, ID

#

I believe that was it. It's been a while

#

No you place the server ID

#

Not an invite link

#

How do I get the od

#

Id

#

Do you have developer mode activated

#

On Discord

#

No

#

DM me

#

I turned it on rn

#

Ok now right click the server you want the ID

#

It will say "Copy ID"

torn nebula
earnest phoenix
#

^

#

Now what

#

Now you wait

#

For what

#

Read

#

Read what

#

???

torn nebula
#

your bot added but waiting for approval once approved will be added

earnest phoenix
#

I dont even know why I'm here my friend invited me and said to complete that thing

#

I dont even got a PC

#

😂

torn nebula
small prairie
#

@earnest phoenix Did you even code?

#

whhat if that bot is a nuke bot Lmao

earnest phoenix
#

No I didn't even code it

torn nebula
#

you just created a new bot application and added here?

finite bough
#

@small prairie a spam bot, a server destroyer bot, a dm spam bot, a ip leaker bot etc

small prairie
#

Yea

#

Correct

#

And @earnest phoenix Weill get banned for it

earnest phoenix
#

What

#

My bot is a normal bot

#

Like dyno

modest maple
#

have you actually programmed it and run it?

finite bough
#

@modest maple or use botghost bot maker xD

earnest phoenix
#

that bot is not gonna get approved

finite bough
#

shhh

tight plinth
#

Botghost is prohibited

finite bough
#

@tight plinth SHHHH!

tight plinth
#

No u

earnest phoenix
#

Please help me

#

Someone help me to learn JavaScript

earnest phoenix
#

@tight plinth they say to join code academy

tight plinth
#

Erm

#

No

earnest phoenix
#

Wait let me show you

finite bough
#

@earnest phoenix javascript and discord.js are 2 different issues

earnest phoenix
#

there are a ton of courses online to help you learn it

finite bough
#

here we fix issues related to discord.js

#

and other languages related to discord

earnest phoenix
#

Can you guys help me ?

#

To learn discord.js

#

it's not a language

#

it's a lib

#

and docs exist

#

I have installed node.js what to do now

#

yikes

#

Please help me

#

@earnest phoenix lib means ?

#

library

#

Ok

#

@earnest phoenix you make your bot using discord.js

#

no

#

Then ?

#

@earnest phoenix you know about dicord.js ?

#

of course

#

Then can you help me to make bot using discord.js

#

no

#

😭

#

Any website ?

#

discord.js docs

#

@earnest phoenix can you help me a little bit ?

#

with what

#

I downloaded node.js and run cmd in the node.js folder and everything worked but the folder which is maked in gif is not showning

finite bough
#

gif?

earnest phoenix
earnest phoenix
#

Wtf 100 (node:2965) UnhandledPromiseRejectionWarning: TypeError: Discord.RichEmbed is not a constructor

vivid jacinth
#

hi

pale vessel
#

hi

vivid jacinth
#

can I get red role

pale vessel
#

no

#

does a colored role make you that happy?

#

that would be weird

finite bough
#

@pale vessel a better way. to look at it, no bullying and no ignoring

valid holly
#

@earnest phoenix Discord.RichEmbed()

earnest phoenix
#

Mmmmmmm okay i try again

finite bough
#

@earnest phoenix what discord.js version

earnest phoenix
#

12.0.0....

pale vessel
#

that would be MessageEmbed()

finite bough
#

^

valid holly
earnest phoenix
#

The version has a problem with embed

pale vessel
#

update to latest v12 btw

finite bough
#

use MessageEmbed()

earnest phoenix
#

Okay ty

#

"Message is not defined" @finite bough

summer torrent
#

show code

finite bough
#

^

earnest phoenix
#

Ok

summer torrent
#

MessageEmbed()

#

not Message.Embed()

earnest phoenix
#

Ok

#

Sorry

#

I used to with Discord.RichEmbed

finite bough
#

yes

earnest phoenix
finite bough
#

do

regal saddle
#

wait, you hosting your bot on a phone?

finite bough
#

const MessageEmbed = require("discord.js")

summer torrent
#

are you defined "discord.js"?

earnest phoenix
#

Yes

summer torrent
#

how

earnest phoenix
#

@finite bough okay

#

they arent

#

it's an ssh console

#

lol

summer torrent
#

const MessageEmbed = require("discord.js")
@finite bough you forgot {}

finite bough
#

?

earnest phoenix
#

nevermind oh god they are

#

@regal saddle it is temporary

summer torrent
#
const { MessageEmbed } = require("discord.js")
earnest phoenix
#

Why {} ?

regal saddle
#

@regal saddle it is temporary
What is the programm called you use for that?

finite bough
#

@summer torrent why?

earnest phoenix
#

Program ? which program

finite bough
#

{} are not needed for an individual const

summer torrent
#

for get MessageEmbed class from djs

#

another way is

const Discord = require("discord.js")
const embed = new Discord.MessageEmbed()```
earnest phoenix
#

Oh

finite bough
#

I will recommend the 1st method

earnest phoenix
#

Why discord modified Discord.RichEmbed() ?

finite bough
#

new api

summer torrent
#

¯_(ツ)_/¯

finite bough
#

a lot of changes have taken place

summer torrent
earnest phoenix
#

Oh okay but he create a problem

finite bough
#

?

earnest phoenix
#

its creates problems for example my friends believed that the embed walk more

finite bough
#

??

earnest phoenix
#

well i'm starting to get tired of it, even the `` don't work anymore

torn nebula
#

welp
i'm just hiting 429 too many requsts
whenever i start bot
shards 11
starts shard 0 and dies ....

charred jetty
#

Can I do it?
db.get("channels").forEach
?

summer torrent
#

forEach is a Array function

pale vessel
#

depends on what db.get() returns

quartz kindle
#

@torn nebula are you using the shard manager?

torn nebula
#

yes

quartz kindle
#

Do you spawn shards manually or automatically?

torn nebula
#

set to auto

pale vessel
#

@earnest phoenix no wonder it didn't work, you need to use ${} for template literals

quartz kindle
#

There is a bug going on with d.js where the login rate limitting isnt working

torn nebula
#

oh
but d.js atleast not saying that they having bug with d.js -_-

i asking from morning...

quartz kindle
earnest phoenix
#

anyway its fact that creates bugs i came back on version 11.0.0

torn nebula
#

Oh ok Thanks \🙂

quartz kindle
torn nebula
#

from start i just used master version....

vagrant wadi
#

Does someone know How to get the amount of servers the bot joined
and users?

(Discord.js Node v12)

quartz kindle
#

client.guilds.cache.size

vagrant wadi
#

OMG ty

pale vessel
#

discord.js node v12

#

interesting

vagrant wadi
#

node -v = v12.16.1

earnest phoenix
#

lol

#

v12 give problems

elder garnet
#

is it possible to make my bot go into a VC and play an local file audio?

#

in discordjs

tight plinth
#

Well yez

elder garnet
#

🤔

#

I tried doing it everything worked but the bot didnt play the audio but discord shows that he was speaking/playing the audio

earnest phoenix
#

music bots always give problems

amber fractal
#

Do you have the required packages for audio output?

elder garnet
#

I mean its a localfilr

#

file

#

and yes

#

I do have ffmpeg

#

and ffmpeg-static

tight plinth
#

Install @discordjs/opus, sodium and ffmpeg-static

plucky jewel
#

@earnest phoenix what is the redactor for android?

elder garnet
#

I have all these expect for sodium

#

I will download it when I open pc

tight plinth
#

Install sodium

#

Necesarry to play files

amber fractal
#

I only has ffmpeg and opus when I ran it on v11 is sodium new for v12?

plucky jewel
#

@earnest phoenix say please

earnest phoenix
#

Most of the node modules don't work on v12

#

Because the code has very big differences

#

So if u are upgrading from 11 to 12 then u have to redo the code a little

#

Which is a pain if u have crap tone of code

tight plinth
#

Try with sodium, should work

earnest phoenix
#

Hmmm but it will get the ID of the person that issued the command right

storm bluff
#

wtf

earnest phoenix
#

He wants the server owner ID though

storm bluff
#

🤦‍♂️

earnest phoenix
storm bluff
#

nothing

#

thanks

earnest phoenix
#

I think it was for him

storm bluff
#

lol

plucky jewel
#

@earnest phoenix

earnest phoenix
#

why tag your self 🤔

modest maple
#

Don't try and get an attribute from an undefined variable

finite bough
#

Alessandro show code

#

link doesnt work

#

can u copy paste the code?

#

nvm

#

got it

#

do u use a command handler?

#

do u have a code for reading and executing those commands

#

like

#

using fs module to read the js files

#

invalid invite

#

ur project is private

#

the command handler u use is very complex

#

try now @Alessandro⚡#7960

#

@earnest phoenix

plucky jewel
#

@earnest phoenix what is the program?

finite bough
#

@earnest phoenix

earnest phoenix
#

Can anyone help me setup sharding? My bot won’t come online now because of it 🤦🏻‍♂️

#

JavaScript btw ^

finite bough
#

ok

earnest phoenix
#

Ok I got sharding up how do I make it show the complete total amount of servers/users since me botinfo commands wouldn’t really show it

finite bough
#

@earnest phoenix have u copy pasted the code from a guide

tight plinth
#

Everything is in the official guide

#

No @earnest phoenix

#

He is sharding

finite bough
#

@earnest phoenix have u made the code urself

#

@earnest phoenix can u show me the site

earnest phoenix
#

Is the guide.owner.send right

#

Or wrong

pale vessel
#

wrong

tight plinth
#

Wrong

earnest phoenix
#

Though so

tight plinth
#

Send it to a guild channel

pale vessel
#

are you trying to dm the owner or what

earnest phoenix
#

Yep

pale vessel
#

why?

tight plinth
#

Stupid idea

earnest phoenix
#

I tried dm command but didn't work

#

So I tried that XD

pale vessel
#

the owner would instantly remove the bot after seconds adding it

earnest phoenix
#

Hmmmm so send it to an channel

#

But if I do that will it send it to the system channel

pale vessel
#

something like guild.channels.cache.find(c => c.name == "general").send(message)

earnest phoenix
#

It's say msg is not defined though

pale vessel
#

my bad. guild

earnest phoenix
#

Ahhh but what if they have custom names

pale vessel
#

then it won't send the message

earnest phoenix
#

......

pale vessel
#

this is a bad idea anyway

earnest phoenix
#

How do I fix

restive furnace
#

probably better guild.channels.cache.first()

#

cause some server wont have general.

earnest phoenix
#

I thought about that

#

But there is always an system channel yes

restive furnace
#

no

pale vessel
#

it could be the rules channel etc. bot wouldn't guaranteed to have the permission to send message

#

basically a lot of problems

restive furnace
#

guilds.channels.cache.filter(function)

#

thats better prob

#

and then just of that filtered array first one.

earnest phoenix
restive furnace
#

But not always.

earnest phoenix
#

Hmmmm

restive furnace
#

Some servers have disabled it

earnest phoenix
#

Ah yes

#

guilds.channels.cache.filter(function)

#

So i should use that

pale vessel
#

yes

#

and then pick the first one

restive furnace
#

function can be c => c.permissionsLevel > 1 or smh i dont really know cause i didnt use discord.js for long time

earnest phoenix
#

It won't send the msg every time it restart right

pale vessel
#

no

earnest phoenix
#

K

pale vessel
#

it's when a bot was added to a server

earnest phoenix
#

Yea

#

I shall try

#

guilds.channels.cache.filter(embed) @pale vessel

#

Will this work

pale vessel
#

no

#

do you know what that does

#

it filters channels based on a condition

earnest phoenix
#

Ahhh OK

earnest phoenix
#

Hmmmm

pale vessel
#

like .find

earnest phoenix
#

OK what do u suggest

#

I need to send an embed

pale vessel
#

well you need to find an appropriate channel first

#

i would suggest finding general if possible and if not, don't send the message

earnest phoenix
#

XD

pale vessel
#

you don't want your bot to send something on the wrong channel

#

owners wouldn't like that

earnest phoenix
#

What if I do guild.systemChannel.send(embed)

pale vessel
#

sure

earnest phoenix
#

K

pale vessel
#

errors are bound to happen though

earnest phoenix
#

Ehhhh as long as it works

restive furnace
#

rythm sends on systemChannel, and dank memer find chat/general, atleast i think so.

pale vessel
#

i would say send the message to general since it's the channel that's open for everyone in most cases

earnest phoenix
#

If u say so I will test it

#

Brb

#

Rip it didn't work

restive furnace
#

did or didn't?

earnest phoenix
#

;-;

#

Oop

#

XD

restive furnace
#

Can you show me the code right now?

pale vessel
#

scuffed code probably

earnest phoenix
pale vessel
#

my EYES

earnest phoenix
#

XD

#

I don't know why my pi has no color

#

It's just blue yellow and white

restive furnace
#

try guild.channels.cache.find(c => c.name.includes("general")).send(embed) sry spoonfeed

earnest phoenix
pale vessel
#

lol

earnest phoenix
#

Aeeee

pale vessel
#

did you even set up a system channel on that guild

earnest phoenix
#

Yeo

#

Yep

pale vessel
#

pepega

#

just realized he's on v11

#

@restive furnace

restive furnace
#

oh yea

#

yes cause RichEmbed

pale vessel
#

it would be guild.channels.find(c => c.name.includes("general")).send(embed)

earnest phoenix
#

Yah

#

I just came to say it didn't work

#

XD

restive furnace
#

or easier guild.channels.find("name", "general")

earnest phoenix
#

Then do general.send(embed)

pale vessel
#

assuming general is the channel, yes

earnest phoenix
#

Yah

#

Why is this so hard

#

XD

#

;-;

#

U know I give up

#

.

pale vessel
#

you shouldn't

#

it's not too hard

earnest phoenix
#

Wait what

#

One sec

pale vessel
#

30 sec xD

earnest phoenix
#

U know

#

I give up

pale vessel
#

i may or may not know

#

why

earnest phoenix
#

XD

pale vessel
#

does it at least throw an error?

earnest phoenix
#

Oh shit I don't have ffmpeg on pi

#

Yah a crap tone

pale vessel
#

that would be helpful

earnest phoenix
#

Plus the ffmpeg missing error

pale vessel
#

let's ignore that

earnest phoenix
#

My TV is filled with gibberish

#

XD

pale vessel
#

so what are the errors when trying to send the embed to a channel that has general in it?

#

oh

#

does the image load fine?

#

if you go to the url

#

i have the same problem on some sites

#

it just won't load the image

#

i'm not so sure myself. others can help

lyric mountain
#

Try http

slender thistle
lyric mountain
#

Hmmm, weird

#

I can see the image if I access the url

#

If it isn't showing on an embed then maybe it's an issue in the code itself

#

Check whether the id matches exactly your bot id

#

Maybe it's a dropped character issue

pale vessel
#

or just try to put the image shivaco linked and if it still doesn't show up, something is wrong

#

i haven't used the api. what's that parameter for?

lyric mountain
#

You....what?

#

Why are you generating a rand number?

pale vessel
#

i don't think you need it

#

exactly

lyric mountain
#

The id should be your bot's id

slender thistle
#

Bypassing cache

lyric mountain
#

Not a rng

pale vessel
#

oh, it's for bypassing cache

lyric mountain
#

Get your bot's id

#

Put it before .png

pale vessel
lyric mountain
#

Damn ninjas

pale vessel
#

200 OK

#

you might have to give it up for now

#

why did you send the code again

#

well until someone finds a solution, you should work on something else instead

earnest phoenix
#

Try uploading the images elsewhere

#

And copy the link

pale vessel
#

maybe attach* the picture

#

embed.attachFile(infodbl)

#

and then embed.setImage("attachment://id.png")

queen folio
#

By any chance when you used wait_for did you give it on_reaction_add not reaction_add
@modest maple I used reaction_add, but I've overcome that issue by making it a standalone event.

earnest phoenix
tight plinth
#

js

#

cert bots have access to js

#

like nekobot

earnest phoenix
#

oh okay

cursive dagger
#

you could make it via css animations aswell

marble drum
#

Where to use dank memer

crimson vapor
#

Testing

marble drum
#

wat

crimson vapor
earnest phoenix
#

@cursive dagger yes i know but i'm not good at css :/

cursive dagger
#

let me get a tutorial for you

earnest phoenix
#

okay thanks

torn nebula
#

ik how to do ...

lyric mountain
#

sorry for low framerate

earnest phoenix
#

The last bit where it goes back to its natural shape is a lil too rocky and sudden

lyric mountain
#

gonna try to smooth it a bit, thanks for the heads up

cursive dagger
#

also the sudden bump midway looks wierd

lyric mountain
#

it's a bit more smooth tho, I'll try to capture a higher framerate gif

broken jay
#

Is good idea to make bot's REST API with Java and bot itself with JS?

cursive dagger
#

Rest api? Whats that gonna be used for?

broken jay
#

This is not only REST... I'm making Pokemon bot and I want this interact with DB, do bigger calcs, generate images, eggsocket (WebSocket about eggs hatching) and maybe more uses. Just I have seen bots that do everything in bot itself, and this may break bot later.

modest maple
#

tbf my entire bot works off a rest api

lyric mountain
#

it could work, but depends on how frequently you're gonna use that api

#

depending on the size of the response it could make it become a bit slower too

broken jay
#

Almost every command will do request...

modest maple
#

i mean you can call it hundreds of times a seconds and not have issues if you do it well

lyric mountain
#

^

cursive dagger
#

would work although it will gain a few ms of ping

tight plinth
#

My api is like one request per MESSAGE and it still works

#

Sometimes 2

modest maple
#

if you do it on local host or atleast the main interactions over LAN on a good network you can get the web latnecy down to around 5 - 6ms

broken jay
#

Yes, but same time, I seen too much bots with 100000000000000ms in some hours

#

I'll use AWS Docker

lyric mountain
#

that's probably spaghetti code

cursive dagger
#

^

#

and that would probably work

lyric mountain
#

spring boot for java is quite solid as a rest api server

broken jay
#

I plan use Spring Boot for API

modest maple
#

my sort of API latency for the bot

broken jay
#

Nice

modest maple
#

one thing you do need to make sure you do tho is make the backend scaleable

broken jay
#

ok

void mantle
#

owo

#

just cache the import stuff 😛

#

so you dont have to make a request for every message

digital ibex
#

@modest maple what bot is yours

void mantle
modest maple
#

-bots

gilded plankBOT
modest maple
#

@digital ibex ^^

digital ibex
#

crunchy?

modest maple
#

i do some dev work with other bots but Crunchy and Innkeeper are my mains

#

Crunchyroll Discord bot

digital ibex
#

Ok

elder garnet
#

i want my bot to play an audio my bot joins but doesn't play anything here's the code anyway

msg.member.voiceChannel.join()
.then(connection => {
if(msg.member.voiceChannel === undefined) return msg.channel.send("You are not in a voice channel.")
let dispatcher = connection.playFile("/audios/audio.mp3", {filter: 'audioonly'});            
})

is there any fix?

tight plinth
#

Errors?

elder garnet
#

nop

#

oh

#

i have some missing stuff

#

i will install them

#

and see

#

i get a error everytime i try and install node-opus

plucky jewel
#

Xmmmm

#

Help

#

Please

modest maple
#

gonna actually tell us your error? Or let us read you mind bloblul

plucky jewel
#

I can't install node.js

prime cliff
#

Google: How to install node.js

plucky jewel
#

Xmmmm

elder garnet
plucky jewel
#

I tried

elder garnet
#

run the installer

#

and then spam next

#

and that it

plucky jewel
#

and nothing happened to me, well, or I did something wrong and it’s possible that everything worked out for me, but I just don’t know about it

#

I idk

earnest phoenix
#

-bots

gilded plankBOT
summer torrent
cunning glen
#

guys heroku in use db quick database settings saved programing example commands give to me

summer torrent
#

which language is this

modest maple
#

its called this thing called american ive heard

sudden geyser
#

They speak the language of gods.

earnest phoenix
severe gyro
earnest phoenix
#

I am currently working on a discord bot any good free bot hosting websites/applications?

severe gyro
#

There is nothing free

#

Heroku will fail you when you don't want it to

#

Believe me

sudden geyser
#

Free hosting's not so good, but there are sites like glitch and heroku.

earnest phoenix
#

I heard glitch was pretty good

#

Uptime robot is super bad lmao

#

ill check them out tho thank you

cunning glen
#

heroku nice notlikenoot

severe gyro
#

Digital Ocean even nicer

sudden geyser
#

heroku + dbs calascared

stable horizon
#

Who the fuck is saying a free hosting site is good?

earnest phoenix
#

Quick question will this work

#

defaultChannel.send("Welcome")

#

When the bot joins an server

modest maple
#

d.js

earnest phoenix
#

No js

modest maple
#

looks alright

#

providing defualtChannel is defined

earnest phoenix
#

I am trying different one but I saw that online so I wanted to know if it would work

#

K thx

#

Yes Ik

#

Pff it dint work

#

Time to read the doc again

quartz kindle
#

afaik defaultChannel was removed

earnest phoenix
#

Ahhh do u know what is the alternative to that

quartz kindle
#

there is no alternative, as a default channel no longer exists, ie, people can delete their # general channel

#

what can be done is check permissions for all text channels and send the message to the first one where your bot has permissions to send

#

another way is using guild.systemChannel

#

which is the channel that people chose their discord welcome messages

#

but it might not be available, and your bot might not have permissions for it

earnest phoenix
#

Yes I tried guild.systemChannel.send(embed)

#

But it didn't work

dusk pendant
#

i've made a bot, and I want it on top.gg right? So how long does it usually take for bots to get approved?

earnest phoenix
#

It has the welcome msg channel

#

My bad

#

what do you need a default channel for?

dusk pendant
#

thnx @earnest phoenix

pale vessel
#

@earnest phoenix for his bot welcome message, which is something i don't fully agree with

earnest phoenix
#

usually you don't want to do that automatically

#

instead let someone with admin perms set the welcome channel OR you create a welcome channel

#

the latter isn't really advised but it works

modest maple
#

otherwise it gets vvv annoying for the end user

earnest phoenix
#

Hmmm

#

OK then I will leave the idea

finite bough
#

@earnest phoenix a good idea will be

empty owl
#

i have an idea for defualt channel

#

who wanted it

finite bough
#

if an admin executes the cmd set the default channel by finding welcome in the channel name

empty owl
#

@earnest phoenix i have an idea

#

what lib

earnest phoenix
#

if an admin executes the cmd set the default channel by finding welcome in the channel name
do not do this

finite bough
#

why not

empty owl
#

just get all the channels

#

and choose a random one

finite bough
#

no @empty owl

empty owl
#

why

earnest phoenix
#

@empty owl that is fine

finite bough
#

no one wants welcome in announcements

empty owl
#

bro

earnest phoenix
#

Oh wait

empty owl
#

people delete it anyway

earnest phoenix
#

Right

empty owl
#

thats what every bot does

earnest phoenix
#

Hmmmm

solemn quartz
#

Guys

empty owl
#

well ones that have

finite bough
#

too much work for a well mad ebot

empty owl
#

it

solemn quartz
#

i need help with my say cmd

earnest phoenix
#

why not
because it's unreliable, the end user doesn't have any input on which channel will get picked by your code

empty owl
#

@solemn quartz what lib

solemn quartz
#

if i do this

#

message.channel.send(${message} \n \n - <@${message.member.id}>)

empty owl
#

its message.content

earnest phoenix
#

Bruh

finite bough
#

@earnest phoenix c => channel.name.includes ('welcome')

solemn quartz
#

no

empty owl
#

but you would also need args

solemn quartz
#

nope

#

if i say args it says

earnest phoenix
#

how does that matter shiemi

solemn quartz
#

its only that it says ?say too

earnest phoenix
#

the bot doesn't understand context

empty owl
#

do you even have args

solemn quartz
#

and the bot loops and sends infinite messages

earnest phoenix
#

you can't know if the channel is actually a channel for welcome messages

solemn quartz
#

do you even have args
@empty owl yes lol

empty owl
#

well first

finite bough
#

the chances it's not for welcome r like 1%

#

coz welcome r for welcoming

empty owl
#

dont make ur bot triggable by itself

#

you can get declined for tht

solemn quartz
#

how

earnest phoenix
#

automatically triggered features should be opt-in not opt-out and that has been said by a discord staff member too. your end user should willingly be able to pick where and what

finite bough
#

no

empty owl
#

like

finite bough
#

who tf said automatic

empty owl
#

check if the author is

#

bot

finite bough
#

if an admin exectues ot

empty owl
#

if yes dont do anythibng

finite bough
#

it

#

without setting the channel id

earnest phoenix
#

picking the welcome channel without user input is an automatic feature

finite bough
#

a trigger can be added

solemn quartz
#

So how do i do that say cmd?

earnest phoenix
#

wat

solemn quartz
#

i want it to say the message, but without ?say

empty owl
#

wdym @solemn quartz

finite bough
#

a code which makes the bot choose

#

not before it

earnest phoenix
#

what??

empty owl
#

you dont have args then

finite bough
#

I made it in the past

empty owl
#

@solemn quartz

finite bough
#

the bot wont do anything

solemn quartz
#

you dont have args then
@empty owl YES

empty owl
#

no you dont

solemn quartz
#

I DO

empty owl
#

args is only the thing after ?say

#

not ?say itself

solemn quartz
#

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

finite bough
#

if an admin does [prefix]welcomeperm=true

empty owl
#

@solemn quartz you didnt remove the command aswell

finite bough
#

it will check for a channel with welcome word

solemn quartz
#

wat

finite bough
#

if that fails

#

it checks for general

tight plinth
#

If that fails

solemn quartz
#

@empty owl btw if i use args it will let me use only 1 arg

finite bough
#

if that also fails the bot doesnt do anything

empty owl
#

@solemn quartz what does args return

tight plinth
#

Lol

finite bough
#

unless a channel has been set

solemn quartz
#

the choosen content of the messgae

earnest phoenix
#

at the point where you're taking user input, just take a channel input instead lol?

empty owl
#

discord.js right

#

@solemn quartz

solemn quartz
#

wat

finite bough
#

some people r lazy like me

solemn quartz
#

yea

#

me

empty owl
#

ok

#

@solemn quartz do you code in discord.js

#

well javascript

finite bough
#

and they set welcome = true

#

so theh want welcomes

#

channel can be changed if needed

#

messages can be deleted if needed

empty owl
#

@solemn quartz ....

solemn quartz
#

okay

#

@empty owl that doesnt work

empty owl
#

what

#

doesnt work

solemn quartz
#

if i do ?Say lol it says "Say lol"

empty owl
#

do u do const args = message.content.slice(prefix.length).trim().split(/ +/g);

solemn quartz
#

nope i did in a different way

#

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

empty owl
#

then do it that way

#

my way

solemn quartz
#

okay

#

lemme try

empty owl
#

and do
let foo = args.join(" ")
message.channel.send(foo)

solemn quartz
#

ik ik

#

Same thing

empty owl
#

ok

#

what

solemn quartz
#

lol

empty owl
#

send code pls

solemn quartz
#

case 'Dici':
let detto = args.join(" ")
message.channel.send(`${dett

empty owl
#

ok do this

solemn quartz
#

wat

empty owl
#

let messageArray = message.content.split(" ")

solemn quartz
#

Btw "dici" means "say" in italian

#

"detto" means "said"

grim aspen
#

well

empty owl
#

then

#

wait hold up

grim aspen
#

you're missing a couple important closing lines for the code

solemn quartz
#

wat

empty owl
#

let args = messageArray.slice(1);

grim aspen
empty owl
#

prolly a typo

grim aspen
#

oh

empty owl
#

and yall know theres quotes in discord now

#

you dont have to take the trouble to do that haha

grim aspen
#

dc

empty owl
#

@solemn quartz let messageArray = message.content.split(" ")
let args = messageArray.slice(1);

solemn quartz
#

okay

zenith terrace
#

Is this .js?

empty owl
#

yes

solemn quartz
#

yep

empty owl
#

i forgot how to do it in my other bots

#

but this is the current method

solemn quartz
#

same

#

same thing

empty owl
#

can i see ur code

solemn quartz
#

all?

empty owl
#

the say

solemn quartz
#

okay

empty owl
#

also what is your prefix

solemn quartz
zenith terrace
#

let content = args.slice(1).join(" ");
message.channel.send(content)

solemn quartz
#

?

empty owl
#

that might be a problem

solemn quartz
#

my prefix is "?"

empty owl
#

so

#

?Dici

zenith terrace
#

let content = args.slice(1).join(" ");
message.channel.send(content)
@solemn quartz

solemn quartz
#

lemme see

zenith terrace
#

O the code

#

waits

empty owl
#

lmao

zenith terrace
#

sips cup of tea while waiting

solemn quartz
#

@zenith terrace it works : D

#

but i need my args let

#

and not the one of @empty owl

empty owl
#

??

solemn quartz
#

ty @zenith terrace

#

lol

empty owl
#

idk what happened to your code tho

zenith terrace
#

So its working yea?

empty owl
#

works fine for me

#

and i understand why his or hers works too

#

but prolly not for anyone else

#

since their args would work

zenith terrace
#

Yeet

solemn quartz
#

lol

#

So its working yea?
@zenith terrace yea it works

#

ty

zenith terrace
#

Nice

#

And yw

solemn quartz
zenith terrace
#

Lol

solemn quartz
#

lol

solemn quartz
#

Guys can someone suggest me a "Fun" cmd pls?

earnest phoenix
#

8 ball

#

Also not really a development question imo peepoWeird

solemn quartz
#

yea

#

that is

#

BeCAusE I WilL DevElOp a CMd WiTh ThAT SuGGesTIoN

earnest phoenix
#

imagine making your bot just as generic as 90% of other bots here lmaoo

#

I can't really understand errors, but:

(node:14) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined
at Object.execute (/home/container/commands/Support/remoteticket:24:93)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:14) 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:14) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I think that means that the channel i'm sending to is undefined?

modest maple
#

TypeError: Cannot read property 'send' of undefined

#

its not what youre sending

#

its what you're trying to call .send from

#

bad wording

earnest phoenix
#

whatever you're calling the send method on is undefined, ^

modest maple
#

e.g

MyVar.send()

#

would be undefined error

earnest phoenix
#

I make a channel and await for it, the channel is indeed created but somehow it's undefined

#

what's your code

#

Here: