#development

1 messages · Page 950 of 1

tulip ledge
#
    let item = args[0].toLowerCase();
    let collection = mostSimilarModule(item)
    message.channel.send(itemfile[collection]);

Cant send emptym essage

next remnant
#

when i put it in src/commands it works but not in src/commands/first

#

i have no idea why

warm marsh
#

Using console.log first.

#

No clue.

tulip ledge
#

using console.log it works

warm marsh
#

Returns?

tulip ledge
#

?

warm marsh
#

What does it return?

tulip ledge
#

dimond returns diamond

#

IT works

warm marsh
#

Alright.

tulip ledge
#

It just sais it cant send an empty message

warm marsh
#

Probably because of the null

#

Change null to 'no module found'

#

Or some other error message.

tulip ledge
#

Dillon

#

Do u know a way

#

To turn the itemfile into an array?

tight plinth
#

.setAuthor

#

smh

#

you need to use it like this: ```js
[embed].setAuthor('text'[,image])

#

image is optional

clever tree
#

@fluid basin I used to test. Same issue. What should I do ?

async function testing(connection, message) {

                const serverdispatcher2 = connection.playStream(ytdl("https://www.youtube.com/watch?v=G9ffM4EJPVs", { filter: 'audioonly', quality: 'highestaudio', highWaterMark: 1 << 25 }))
                    .on("end", () => {        
                            connection.disconnect(10000);
                    })
                    .on("error", error => {        
                        console.log(error)
                    })

                }

                message.member.voiceChannel.join().then(function (connection) {
                        testing(connection, message);
                    })

@fluid basin So i used this code and got no error at all. The bot joins and leaves. Even if i install an older version of ytdl-core

tight plinth
#

optimization:

message.member.voiceChannel.join().then(function (connection) {
                        testing(connection, message);
                    })```
can be ```js
message.member.voiceChannel.join().then(connection => {testing(connection,message)})```
#

you can use the .tag property of a user

#

like

#

@tight plinth.tag = Lumap#0001

warm marsh
#

@tulip ledge Array or [['name', 'data']] or?

tulip ledge
#

No

#

So

warm marsh
#

['name', 'name2']

tulip ledge
#
{
    "greater backpack": "Big oof",
    "diamond": "Also big oof",
    "emerald": "Another big oof"
}

I want to turn that into an array like this: "greater backpack", "diamond", "emerald"

warm marsh
#

Right?

#

Inside the file or in js?

tulip ledge
#

In js

#

So that I don't need this anymore const itemstosearch = ["diamond", "greater backpack", "emerald"];

warm marsh
#

You don't need that.

tulip ledge
#

Yes I do

warm marsh
#

delete it and change keys to

const keys = Object.keys(file);```
tulip ledge
#

Alright

#

ty

warm marsh
#

I thought that array was for whitelisted stuff.

tulip ledge
#

No

fluid basin
#

@clever tree I just downloaded the code from the repo, and its working fine

tulip ledge
#

Well ty verry much

fluid basin
#

make sure you fast forward the changes from the repo to your code

tulip ledge
warm marsh
#

Yes.

tulip ledge
#

Higher or lower?

warm marsh
#

Higher means it will be more restricted

tulip ledge
#

Ok

warm marsh
#

lower means it will accept less close values.

#

Like di = diamond

tulip ledge
#

Ok

#

Ty

warm marsh
#

or diamon = diamond

clever tree
#

@fluid basin lul. Then its my pc i gues.

fluid basin
#

install a fresh copy from the repo

#

and try running it

#

if its working

#

that means its something with your current code

obtuse jungle
clever tree
#

@fluid basin Whisch packages did u use ?

fluid basin
#

the default ones

#

also if you aren't using d.js v12

#

you should be using that

clever tree
#

@fluid basin if i use v12 my whole code break. So idk xd
Almsot all function are wrong then

fluid basin
#

yes its a major version change

warm marsh
#

Changes to 12.

fluid basin
#

though you can still use v11, but I think about october it will not work anymore

#

when discord officially introduces intents

clever tree
#

@fluid basin I will look then. But at this moment i want my bot to wokr again xd

fluid basin
clever tree
#

@fluid basin Yea. I did this :

async function testing(connection, message) {

                const serverdispatcher2 = connection.playStream(ytdl("https://www.youtube.com/watch?v=G9ffM4EJPVs", { filter: 'audioonly', quality: 'highestaudio', highWaterMark: 1 << 25 }))
                    .on("end", () => {        
                            connection.disconnect(10000);
                    });

                    serverdispatcher2.on("error", error => {        
                        console.log(error)
                    })



                }

                message.member.voiceChannel.join().then(function (connection) {
                        testing(connection, message);
                    })

package

"@discordjs/opus": "^0.3.2",
    "colors": "^1.4.0",
    "discord.js": "^11.6.4",
    "file-system": "^2.2.2",
    "ms": "^2.1.2",
    "simple-youtube-api": "^5.2.1",
    "yt-search": "^1.1.2",
    "ytdl-core": "^2.1.5"

Instant leave.

fluid basin
#

try removing quality: 'highestaudio', highWaterMark: 1 << 25

next remnant
#

what would be commando equivalent of dpy's "consume rest" behavior

#

like how do i make a string command arg act like this
command: {p} {cmd} text with spaces
arg: 'text with spaces'

clever tree
#

@fluid basin still instant leave.

next remnant
#
{
    key: 'text',
    prompt: 'promt',
    type: 'string',
    infinite: true
}```
makes it returns an object of args like this: `one two` would be `['one', two']`
fluid basin
#

did you try a clean install?

#

of the code from the github repo

#

and re-setup with your token

#

if that works that means there's something wrong with your bot

next remnant
#

me?

fluid basin
#

not u

tulip ledge
#

My friend is like: Coding is just knowing the syntax it's so easy

fluid basin
#

My friend is like: Opening cmd is hackerman

tulip ledge
#

(My friend doesn't know shit about coding) he just sais its easy

brave rover
#

y'all have friends?

mossy vine
#

what is this friend thing ur talking about

compact kite
#

My friens is like: Trying to skip python basics such as OOP and goto machine learning

pure lion
#

My friends are like:
.
.
.
.
.
.
.
.
.
(They don't exist)

compact kite
#

lmao

tulip ledge
#

[{"name":"Name1"},{"name":"Name2","changedToAt":1571238414000},{"name":"Name3","changedToAt":1573834068000}]
How do I get the last collection?

#

Cuz i wanna get Name3

#

But

#

The amount of objects inside of it can vary

#

So i can't just do [2]

fluid basin
#

is it a d.js collection?

quartz kindle
#

discord.js collections have a .last() function

tulip ledge
#

No

#

Its grabbed from an api

fluid basin
#

so its just a normal array

quartz kindle
#

array[array.length-1]

tulip ledge
#

should be

brave rover
#

use the length of the collection i guess

fluid basin
#

array[array.length-1]
then use this

tulip ledge
#
{ [Error: ENOENT: no such file or directory, scandir 'D:\OneDrive\Bureaublad\Caeli\cmds\ ']
  errno: -4058,
  code: 'ENOENT',
  syscall: 'scandir',
  path: 'D:\\OneDrive\\Bureaublad\\Caeli\\cmds\\ ' }
#

Euh

clever tree
#

@fluid basin Im too dumb to install the bot u sent. xd
But idk what my issue is. I installed everything new. Made a new folder everything. but ...

tulip ledge
#

NBvm fixed

#

A space somehow sneaked into my dir

fluid basin
#

also not sure about this but it isn't really a good idea to have your node modules in onedrive XD

tulip ledge
#

TypeError: fields.flat is not a function

#

I hate v12

#

How do I fix?

fluid basin
#

lmao

#

whats fields

warm marsh
#

You must pass an array of objects.

tulip ledge
#
                let embed = new Discord.MessageEmbed()
                .setTitle(`Caeli | Skyblock Craft Request`)
                .addField(`IGN`, ign)
warm marsh
#

What does ign equal?

tulip ledge
#

I used richembed first

#

But it got removed

#

Name3

next remnant
#

Setting to null means that the default prefix from CommandoClient#options will be used instead.

#

but i am looking at CommandoClient's options

#

????

fluid basin
#

but i am looking at CommandoClient's options
nah

#

its 2 different things

clever tree
#

Oh dude. I will just delete my bot i gues. Nobody knows how to help me... that does not make fun if u coded for half a year on this bot everything worked fine but from one day to another the bot didnt play music haha xd

next remnant
#

its 2 different things
@fluid basin what is what then

fluid basin
#

well if you don't mind you should upload your code somewhere so maybe I could take a look @clever tree

tulip ledge
#

Anyone knows whats happening with mine?

fluid basin
#

@next remnant
the one in the link is referring to:
commandoClient.commandPrefix = '!'
but the one in options is:
const commandoClient = new Commando.CommandoClient({commandPrefix: '-'})

clever tree
#

@fluid basin The problem is. You saw my code. The play command with a specific yt link was the command. And the Package was the package

fluid basin
#

no I meant all the files not just that

next remnant
#

also, how do i make it not ping the author in every response

clever tree
#

@fluid basin I will look. have to do sth else now

fluid basin
#

don't use message.reply? @next remnant

next remnant
#

there are other places it does that too

#

like with unknown commands responses (how do i disable those?)

#

prompts

#

etc

fluid basin
#

I think that is a built in feature

#

well honestly commando isn't the best to use if you're planning to have an entire command system

tulip ledge
#

Fixed it by updating nodejs

next remnant
#

what else do i use?

fluid basin
#

you could just make your own

#

it isn't very difficult

#

good starting point

tulip ledge
#

Anyone here know the color code to make it seem like an embed doesnt have a color on the side?

fluid basin
#

don't think that is possible?

tulip ledge
#

It is tho

#

I did it

fluid basin
#

if you're using light theme the background colour is different from the dark theme background colour

tulip ledge
#

But I dont have the color code anymore

#

Yeah I know

#

But I just want the one for the dark colore

brave rover
#

I thought if you just left the colour field empty it does the job for you

fluid basin
#

hmm does it really sound that complex? @next remnant

next remnant
#

as someone who has dug through discord.py's comamnds ext code, yes

#

plus its more code on me to maintain

fluid basin
#

well, what kind of system will you need though

next remnant
#

i'm just trying it out, not gonna write any prod bot in it but i'm looking fot something like d.py's

#

a configuarable command system

#

with good docs

fluid basin
#

you should go looking around github for a d.js framework then

#

d.py is rather nicely developed

#

with a bunch of helper stuff

tulip ledge
#

Any idea why this isn't working?

            function toProperCase(string) {
                let str = string.toLowerCase();
                console.log(str)
                if(string.includes(" ")) str = string.split(" ")
                str.forEach(x => {
                    let splitted = x.split("")
                    console.log(splitted)
                    splitted[0].toUpperCase();
                    splitted.join("")
                })
                if(string.includes(" ")) string = str.join(" ")
                return string;
            }
#

It doesn't uppercase the first letter

fluid basin
#

@tulip ledge strings are immutable

tulip ledge
#

?

next remnant
#

d.py is rather nicely developed
@fluid basin as someone who has prod bot written in d.py, it sure is

tulip ledge
#

@fluid basin wdym? I dont know what that means lol

fluid basin
#

oh it just means that you cannot modify a string character individually

tulip ledge
#

Well

fluid basin
#

if you want to modify the string, you have to change the entire string

tulip ledge
#

I turned it into an array

#

And then glued it back together

#

Bu

fluid basin
#

well then theres something wrong the code

tulip ledge
#

It's not turning the first letter to uppercase

#

And I can't find what

fluid basin
#

yeah well I don't understand what you're trying to do

tulip ledge
#

When i have this:
big oof
It needs to become
Big Oof

fluid basin
#

also <string>.toUpperCase() returns the uppercased string, and does not modify the string

tulip ledge
#

Oh yeah lol

#

Thats my problem

next remnant
#

welp turns out

#

short of making my own command framework, there's no good way to handle commands with djs

fluid basin
#

yeah pretty much

#

that much I can tell with my few years of working with d.js

brave rover
#

wait does d.js just work off of d.py's equivalent of on_message?

valid frigate
#

are you trying to do something similar to commando

next remnant
#

it can

brave rover
#

because if so, args must be a pain in the ass

next remnant
#

are you trying to do something similar to commando
im trying to use commando and failing miserably at it

fluid basin
#

well the main issue is the language difference, javascript doesn't support annotations

next remnant
#

typescript

earnest phoenix
#

Hey can anyone help me with that

When I Play A Music And Disconnect The Bot By Clicking Right On The Bot And Disconnect And Play Another Song Then The Bot Add That Song To In His Queue

tulip ledge
#

Ok so splitted[0] = splitted[0].toUpperCase doesnt work

#

Any idea why?

next remnant
fluid basin
#

and decorators in ts is messy imo

next remnant
#

no?

fluid basin
#

well unless you can find a library that supports that

next remnant
#

as someone who has only consumed them

fluid basin
#

if not you still need to implement them yourself

next remnant
#

ive only used them with angular and they work well

earnest phoenix
#

Can somebody explain how's the t is the second index while it's literally the 3rd index in the array?

  '/', '/', 't', 'e', 's', 't', '\n', 'a',
  'r', 'g', 's', '.', 'j', 'o', 'i',  'n',
  '(', '"', '',  '',  '"', ')', '.',  's',
  'p', 'l', 'i', 't', '(', '"', '"',  ')',
  '.', 'j', 'o', 'i', 'n', '(', '"',  '',
  '',  '"', ')', '.', 's', 'p', 'l',  'i',
  't', '(', '"', '',  '',  '"', ')'
]```
brave rover
#

0, 1, 2

next remnant
#

indexing starts from 0

fluid basin
#

arrays start from 0

earnest phoenix
#

Oh wait damn... I forgot

fluid basin
#

LOL

#

@tulip ledge you are not modifying the original array

next remnant
#

is there any good big open source js bot whose code i can look at

fluid basin
#

so thats why you still get the same data back

next remnant
#

preferably written in ts

pale vessel
fluid basin
#

thats some requirements

pale vessel
#

it's not big but it's pretty good

#

damn that sounds wrong

next remnant
#

i mean big as in big code base

fluid basin
pale vessel
#

oh

next remnant
pale vessel
#

no

#

jacher's

#

it uses a custom lib

copper cradle
#

don't you know how indexing works in most langs?

fluid basin
#

there isn't much ts d.js bots with a complex command framework well

copper cradle
#

dank voltrex

tulip ledge
#

AbortError: The user aborted a request.

#

??

fluid basin
#

@tulip ledge also there should be a simpler way to do it

pale vessel
#

@copper cradle maybe he's confused with length

tulip ledge
#

Nani

#

Do u know the simple way?

copper cradle
#

I don't think so

pale vessel
#

well then

copper cradle
#

¯\_(ツ)_/¯

tulip ledge
#

My wifi is dying

fluid basin
#

well your main issue is that splitted is not used

tulip ledge
#

I fixed that

fluid basin
#

you need to modify the original array string

#

updated code?

next remnant
#
export default {
  name: 'badtranslator',
  aliases: ['bt', 'badtranslate'],
  responseOptional: true,
  metadata: {
    description: 'Run text through a bad translator',
    usage: '<text>',
    examples: ['hello there']
  },
  ratelimit: {
    type: 'guild',
    limit: 1,
    duration: 10000
  },
  args: [
    {
      name: 'hops',
      default: '6'
    }
  ],
  run: async (assyst: Assyst, ctx: Context, args: any) => {
    await ctx.triggerTyping();
    if (!args || !args.badtranslator) {
      return ctx.editOrReply('You need to supply text to translate');
    }
``` ngl this looks horrible
fluid basin
#

oof

tulip ledge
#
            function toProperCase(string) {
                let str;
                if(string.includes(" ")) {
                    console.log(1)
                    str = string.split(" ")
                    str.forEach(x => {
                        let splitted = x.split("")
                        splitted[0] = splitted[0].toUpperCase();
                        str = splitted.join("")
                        console.log(str)
                    })
                    console.log(str)
                    str = str.join(" ")
                }
                else {
                    str = string.split('');
                    str[0] = str[0].toUpperCase();
                    str = str.join('')
                }
                return str;
            }
next remnant
#

(coming from dpy)

tulip ledge
#

The one for single words work

#

But the one for multiple words doesn't

fluid basin
#

yeah why are you replacing the entire str variable

tired nimbus
#

if you want to find the guild using a invite link would you have to fetchInvites for each guild in order to find which guild the link goes to?

#

assuming that the bot is also in that guild

fluid basin
#

uh no

#

you can just use the invite api

tulip ledge
#

what do I do to fix it?

#

My pc or my wifi is dieing

#

or discord is

fluid basin
#

hmm you need to change the word

next remnant
#

you can fetch invite

fluid basin
#

you are splitting the string into an array

tired nimbus
#

got it I see it in the docs

fluid basin
#

so you need to replace the part of the array with the new uppercased string

tulip ledge
#

so instead of foreach

#

I should use a for

fluid basin
#

yea

#

or of course if you're more advanced you can do this with a .map but well lets not go into that

tulip ledge
#

.map(x => x[0].toUpperCase)?

fluid basin
#

uh not exactly but close

#

that will give you this:
'big oof' -> 'B O'

tulip ledge
#

Oh lol

#

Is discord dieing?

#

Or my wifi

pale vessel
#

discord

fluid basin
#

.map(x => x[0].toUpperCase + x.substr(1))

tulip ledge
#

So I just do that

#

On str?

fluid basin
#

yeah

#

then join it

tulip ledge
#

So

#

str.split(" ").then(x => x.map(x => x[0].toUpperCase + x.substr(1)))

fluid basin
#

you don't need the then

#

.map works on arrays

tulip ledge
#

alr

fluid basin
#

str.split(" ").map(x => x[0].toUpperCase + x.substr(1))).join(" ")

#

very nice 1 liner

tulip ledge
#

My bot is just not sending the embed

#

Ok

#

function toUpperCase() { [native code] }reater function toUpperCase() { [native code] }ackpack

pale vessel
#

add a ()

fluid basin
#
                let str;
                if(string.includes(" ")) {
                    str = str.split(" ").map(x => x[0].toUpperCase + x.substr(1)).join(" ")
                }
                else {
                    str = string.split('');
                    str[0] = str[0].toUpperCase();
                    str = str.join('')
                }
                return str;
            }```
earnest phoenix
#

Oi

pale vessel
#

it's a method

tulip ledge
#

where do I add it?

fluid basin
#

lol not str.split(" ") but string.split(" ")

tulip ledge
#

str = string.split(" ").map(x => x[0].toUpperCase + x.substr(1)).join(" ")

pale vessel
#

you forgot () in toUpperCase()

tulip ledge
#

I have this

pale vessel
tulip ledge
#

Oh ok

fluid basin
#

yeah and that

tulip ledge
#

lol

#

So its not my wifi dieing its discord?

#

But my ping is liek 2 secs

#

.setColor("#ffffff")

#

Why is it making my embed blue?

pale vessel
#

because fff is white

#

:pepega:

earnest phoenix
#

i am using a vps*

#

but that my website

mystic ice
#

how does one get the server boost lvl?

#

omg @tulip ledge lmfao

tulip ledge
#

What

#

It used to work like that

#

@mystic ice

pale vessel
#

no.

mystic ice
#

no i mean didnt know u were in here

#

lol

tulip ledge
#

oh

mystic ice
#

so no one knows how to get server boost lvl?

timid glen
#

how to add own bot to our site

mystic ice
#

even djs cant give it to me

#

xd

tulip ledge
#

And no one knows how to change the color of a friking embed? in v12

mystic ice
#

what u meen ddl

timid glen
#

how do I add my own bot to the top.gg

tulip ledge
#

No

#

#ffffff makes my embed blue

#

And thats the hex for white

pale vessel
#

you used #ffffff, which is a hexadecimal for the color WHITE

tulip ledge
#

And it makes my embed blue

#

Is this blue or am I color blind?

#

                let embed = new Discord.MessageEmbed()
                .setColor("#ffffff")
                .setTitle(`Caeli | Skyblock Craft Request`)
                .addField(`IGN`, ign, true)
                .addField(`Item to Craft`, tocraft, true)
                .addField(`Collection`, collection, true)
                message.channel.send(embed)
#

Thats the code

pale vessel
#

LMAO i misread that

#

i thought you meant why isn't it making your embed blue

pure lion
#

how do i log all the servers the bot is in?

earnest phoenix
#

@pure lion all their instances or their names or something?

mystic ice
#

i love discord

earnest phoenix
warm marsh
#

Make sure if you do this, That it's not a command that everyone can use.

mystic ice
#

both are screenshots taken on phone

#

different servers

#

same command

earnest phoenix
#

Emojis get really big if you don't put at least one letter or a character

#

On mobile

pale vessel
#

invisible spaces should do the trick yeah

mystic ice
#

but

#

its the same

#

and one is bigger than the other

pale vessel
#

we gave you a fix

earnest phoenix
#

Did you try zws?

#

zero width space

mystic ice
#

like just ' ' or?

pale vessel
#

no

mystic ice
#

oh wait

#

the blank shit

earnest phoenix
#

\u200B

mystic ice
#

thatd be nice

#

thanks

opaque seal
#

Let's say I have an object with a value called lock than can either be true or false;
Now I have a variable which contains for example a string "lock", so myVariable = "lock";
How can I say if(myObject.myVariable) //do stuff ?

earnest phoenix
#

Yea but myObject would be your object name and myVariable would be one of the objects inside the main object

opaque seal
#

Didn't really get it

earnest phoenix
#

For example
myObject: { name: "Thing" }
if(myObject.name){

opaque seal
#

yeah but I need to referr to the name with a variable

#

like myVariable = "name"

#

is there a way to use the content of that variable to indicate the object property?

warm marsh
#

?

#

Like object.variable = value

tired nimbus
#

is there a method to determine if an invite link is valid or invalid

warm marsh
#

fetch it

earnest phoenix
#

Idk what you exactly trying to do but you can get that whole object by a content of a variable inside that object
<Array of objects>.find(o => o.name === "content of the variable").....

warm marsh
#

check error

pale vessel
#

myObject.myVariable = "something";
= js { myVariable: "something" }

warm marsh
#

myObject[myVariable] = "value"

pale vessel
#

" "

opaque seal
#

myObject.myVariable = "something";
= js { myVariable: "something" }
yeah that's what I don't want

pale vessel
#

what do you want then?

opaque seal
#

to use the variable value to call an object value

warm marsh
#

object[variable]

pale vessel
#

^

opaque seal
#

nice thank you

pale vessel
#

wait no

opaque seal
#

?

mystic ice
#

thanks @pale vessel

pale vessel
#

never mind

#

what did i do

opaque seal
#

I'm confused lol

mystic ice
#

the field was a great idea

pale vessel
#

ah

mystic ice
#

honestly i wanna facepalm with a chair.. why didnt i think of that xd

still merlin
#

is message.guild.owner a thing? (I'm not sure where to look on the docs)

pale vessel
#

show code

warm marsh
#

Under message.guild

#

Under the Guild class.

still merlin
#

ok thanks

pale vessel
#

yeah

warm marsh
#

But message.guild.owner returns a resolvable member or a null.

pale vessel
#

it is but the owner can be uncached

#

i like how this looks exactly like mine

#

console.log(message.guild.region) for starters

#

well?

#

there's no europe in the object

#

you have an outdated region list

#

did you read the migrating article?

#

you'll see

#

region is not the part of that

#

it's channels and roles

#

for regions, you can fetch them using discord's REST API

#

then?

#

what

#

damn ok

#

so problem solved?

earnest phoenix
#

V11 or V12?

magic jackal
#

@pale vessel What do you use for music my man?

pale vessel
#

ffmpeg

#

my music barely works

#

too lazy to fix

magic jackal
#

Same I cant get lavaplayer to work correctly 😠

#
[ERROR] [LocalAudioTrackExecutor]: Error in playback of u1YRjCTxR80


com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Something broke when playing the track.```
#

Does anyone else have this issues with lavalink/player/cord?

radiant parcel
#

how do I make the bot match only the user, not the bot?

magic jackal
#

@radiant parcel if(msg.author.bot) return

radiant parcel
#

oh

#

😅

magic jackal
#

haha, dont worry I feel you

radiant parcel
#

thy

pale vessel
radiant parcel
#

thx

grizzled raven
#

please stop using css highlighting when sending bot code wearyaf

earnest phoenix
#

Yes

grizzled raven
radiant parcel
#

@magic jackal

client.on("message", msg => {
  if (msg.content === "qu!ping") {
    if(msg.author.bot) return
    msg.reply("Pong!");
  }
});
#

?

pale vessel
#

move it outside

radiant parcel
#

"if(msg.author.bot) return

magic jackal
#

uhhhhhhhhhh

#
client.on("message", msg => {
  if (msg.content === "qu!ping" && !msg.author.bot) {
    msg.reply("Pong!");
  }
});```
pale vessel
#

uhhhhhhhhhhhhhh

warm marsh
#

Bit long winded as you'd have to check for that each time.

radiant parcel
#

oh

#

thx

magic jackal
#

mhm thats per command

radiant parcel
#

so so thx

warm marsh
#
client.on('message', m => {
  if (m.author.bot)
    return
  //commands here
});```
#

As you'd have to use if (message.content == "qu!command" && !message.author.bot) {} every time.

quartz kindle
#

show code

#

in v12 verificationLevel is a string, not a number

#

yes

#

no, you remove the entire thing

#

you're still trying to use it as an array index

coarse topaz
#

Hey there, how could I make the bot to send attachments? I've tried many methods but no one of them seem to work. I'm using discord.js, thanks 👍

quartz kindle
#

in an embed or in a normal message?

coarse topaz
#

Normal message 😛

quartz kindle
#

without defining a file name .send({files:[URL OR BUFFER OR STREAM]})

#

with a file name .send({files:[{attachment: URL OR BUFFER OR STREAM, name: "filename.jpg"}]})

earnest phoenix
#

why jpg

quartz kindle
#

just an example

coarse topaz
#

Oh, alright, let me try! Thanks! 😄

#

Well, the bot sent this, and that wasn't the objective x)
Could it send the picture? Not a download link, but the picture itself ^^'

#

For example, could the bot send an image in this way? Without the URL, only the picture

warm marsh
#

Yes. Turn the photo into an attachment.

#

Send the attachment.

#

Or use an embed and setImage

coarse topaz
#

How to turn the photo into an attachment? 🤔 😅

warm marsh
quartz kindle
#

@coarse topaz that is the picture itself

#

its 600kb big

#

which looks correct

#

its not showing because it has an incorrect file name

warm marsh
#

File extension.

amber fractal
#

could it be that it doesnt have an extension?

quartz kindle
#

if its a png image, you have to use the version that defines the file name as i showed you and name the file with a .png extension

coarse topaz
#

Oh!

#

I got it now, thank you so much! ^^

earnest phoenix
#

how do I make commands for my bot

quartz kindle
#

learn a programming language

earnest phoenix
#

how-

quartz kindle
#

do you know what programming is?

earnest phoenix
#

quite

quartz kindle
#

programming is the act of creating programs, programs that execute functions in a machine or computer
there are many different programming platforms, languages, methods, environments etc

#

discord bots have to be programmed, ie you have to build a program and connects to discord in order to make it execute functions and commands

#

there are many different programming languages with various purposes, and discord bots can be built with many of them

#

for example, javascript is widely used for making advanced websites

#

python is another language widely used to make a variety of programs

#

both can be used to make discord bots

#

you need to chose a language and start learning it, there are plenty of online courses and guides for free

#

you need to have a basic understanding of a programming language before attempting to create a bot, else you will have a very hard time

earnest phoenix
#

that's what I'm afraid of

#

because I got no experience

quartz kindle
#

try looking into some online course and see if you like it

#

for example, try codecademy

#

or udemy

earnest phoenix
#

I can try

digital ibex
#

it helped me a lot more than codecademy

tired nimbus
#

bot.fetchInvite("invite link").guild.id

gives an error even though the invite link is valid. When I looked at the docs, it said there was a .guild property so Im not sure why this doesnt work

coarse topaz
#

A question: Could I create an edit message command by having the message's ID?
Something like: !edit <MessageID> <new text>

quartz kindle
#

@tired nimbus all methods with the word "fetch" in it are async, which means they return a promise, which means it has to be awaited or used with a .then()

digital ibex
#

ur bot can't edit users messages if thats what ur trying to do, or if ur not trying to do that, you can await sending the message, and then edit that

quartz kindle
#

@coarse topaz only if the message was sent by your bot

tired nimbus
#

oh ok its strange because bot.fetchInvite("link").toString() works but the guild id doesnt

coarse topaz
#

Yes! The message was sent by my bot, of course! x)

warm marsh
#

fetch the message

digital ibex
#

then you can await sending the message, or r u trying to edit a random message ur bot sent?

coarse topaz
#

The second one, yeah

tired nimbus
#

my full code:

let invite = await bot.fetchInvite("link").toString()
      let guild = await bot.fetchInvite("link").guild.id```
#

1st one works but second one doesnt

digital ibex
#

what library are you using?

tired nimbus
#

discord.js

#

v12

digital ibex
#

no uhh hector

quartz kindle
#

@tired nimbus you're not awaiting correctly

#

if you do await bla().bla2.bla3 you're actually doing await bla3

#

you have to explicitly define which one you want to await, for example (await bla()).bla2 or define a variable first something = await bla(); something.bla2

tired nimbus
#

oh okay thanks

coarse topaz
#

no uhh hector
@digital ibexyeah, v12 😅
Is there a problem with the library? :c

tired nimbus
#

I have fixed it thank you

digital ibex
#

idk how you'd do it in d.js, but i assume it would be something likeTextChannel.messages.cache.get('mesasge id').edit('ee');

#

you can try client.getMessage but d.js doesn't branch out like eris' client 😛

quartz kindle
#

in djs v12 it would be channel.messages.fetch(id)

#

then after fetching, you can do message.edit()

coarse topaz
#

Oh, alright.. So will I need to edit messages from the bot's code or can I create an edit message command?

clever tree
#

anyone else has issues with ytdl and audio?
The following codes result:
buffer: BufferList { length: 0 },

function testing(voicecc, message) {

                    const streamstream = ytdl("https://www.youtube.com/watch?v=iU9bc6LmX8k", { filter: 'audioonly'})

                var dispatcher = voicecc.playStream(streamstream);

                if(dispatcher) {
                    console.log("dispatcher exist")
                }

                dispatcher.on("finish", () => {
                    voicecc.disconnect();
                    console.log("disconected")
                });

                dispatcher.on("speaking", () => {
                    console.log("i try to speak")
                });

                dispatcher.on('error', error => {console.log(error)});

                console.log(streamstream)

                }

                const voicecc = await message.member.voiceChannel.join()

                if(voicecc) {
                    console.log("joined a voicechannel")
                }

                testing(voicecc, message)
"dependencies": {
    "@discordjs/opus": "^0.3.2",
    "colors": "^1.4.0",
    "discord.js": "^11.6.4",
    "file-system": "^2.2.2",
    "ms": "^2.1.2",
    "simple-youtube-api": "^5.2.1",
    "yt-search": "^1.1.2",
    "ytdl-core": "^2.1.5"
quartz kindle
#

@coarse topaz you can do it through a command, but thats what your command code will have to do

coarse topaz
#

Ah, got it... Sorry if I bother you, but could you please give me an example of the command already done? I'm kinda new in programming, so I'm still learning all these things ^^'
@quartz kindle

quartz kindle
#
on message received...
let args = message.content.split(" "); // assuming your command is something like "mycommand IDHERE CONTENTHERE"
let id = args[1];
let content = args[2];
let m = await message.channel.messages.fetch(id);
await m.edit(content)
#

note that the target message needs to be in the same channel as the command

#

if you want to edit messages from other channels, you will need to supply a channel id too

#

for example mycommand MESSAGEID CONTENT OPTIONALCHANNELID

#

then you will need to get the channel as well in the code

coarse topaz
#

Oh sure, thanks for it! I'm gonna test it right now GWprytrFoxxolove

#

Oof, it didn't edit the message, @quartz kindle
Being this the code:
if (message.content === `mm!edit`) { let args1 = message.content.split(" "); let id = args1[1]; let content = args1[2]; let m = await message.channel.messages.fetch(id); await m.edit(content) }

quartz kindle
#

code looks fine

#

any errors?

coarse topaz
#

let me check

#

No, it doesn't look like so

#

:/

#

All seem normal

quartz kindle
#

add some logging

#

for example console.log(id,content)

#

to make sure they are correct

coarse topaz
#

if (message.content === `mm!edit`) { let args1 = message.content.split(" "); let id = args1[1]; let content = args1[2]; let m = await message.channel.messages.fetch(id); await m.edit(content) console.log(id,content) } like this?

#

(Anyway it doesn't log anything even after running the command)

quartz kindle
#

if it still doesnt log anything, then the command is not even running

#

where did you put that code?

coarse topaz
#

On Glitch, all other commands are working correctly

#

Well, this appeared after running the commands some times, @quartz kindle

quartz kindle
#

that has nothing to do with the bot

coarse topaz
#

exactly lol

quartz kindle
#

are you running other things? like a webserver, uptimerobot, etc

#

anyway i meant where in your code did you put the command

coarse topaz
#

Hmmm, well, the bot is being hosted on another page too, but it doesn't has nothing to do with my code, both hosters can work at the same time :p

anyway i meant where in your code did you put the command
under the bot.on("message", async (message) => { listener

quartz kindle
#

try moving the console.log to before the await message line

coarse topaz
quartz kindle
#

if there is nothing, then the command is not running

#

you said you had another copy of the bot running somewhere else?

coarse topaz
#

Yeah, but everything has been working normally

quartz kindle
#

are you sure you didnt add the command to the wrong bot?

coarse topaz
#

No, lol, I have the right token, and as I told you, I have another commands, and they're working fine

#

For example, mm!say <text>

#

And the send attachments one

quartz kindle
#

that doesnt mean you're working on the right file/bot

#

if you change your other commands are the changes actually applied?

#

for whatever reason your bot is either not restarting/updating or not picking up the code you wrote

#

you need to figure that out

coarse topaz
#

Ok, let me edit a command and tell I'm going to tell you if it updated the code 👍

quartz kindle
#

then show your full code

coarse topaz
#

in dm?

quartz kindle
#

ok

#

@coarse topaz ah i know why

#

change content === "bla" to content.startsWith("bla")

tired nimbus
#

is there a package that will automatically change strings like "5d65m" to ms

onyx summit
#

ms

#

but I dont know if it can parse those specific strings

tired nimbus
#

I just want it to know what is a minute, day, hour

#

and can take it from the string

#

I just want to know if something like this already exists before I get into it

onyx summit
#

I mean, ms does things like that, but it does not seem to support the format you want

tired nimbus
#

I mean I guess all I really have to do is just separate the strings and then add them up

onyx summit
#

yes

#

ig something like \d*[a-z] and then just run ms on each match

coarse topaz
#

@quartz kindle

let args1 = message.content.split(" ");
let id = args1[1];
let content = args1[2];
let m = await message.channel.messages.fetch(id);
console.log(id,content)
await m.edit(content)```
It doesn't work anyway ![GWnatesnowSad](https://cdn.discordapp.com/emojis/388110391928029216.webp?size=128 "GWnatesnowSad")
glossy elk
#

Sup moi buddies

#

What’s happening

restive lily
#

i need help with my cogs pls

#

i think i scripted it wrong

#

bc i try to do my command

#

and in terminal feedback thing it says "ignored command ping, cant find the command"

#

i can post pics

#

i got it fixed

compact kite
#

Python gang

glossy elk
#

is client.guilds.map deprecated

amber fractal
#

well on v12 you use client.guilds.cache

glossy elk
#

client.guilds.cache.map

#

?

amber fractal
#

On v12 yes

#

and I dont believe it's deprecated

earnest phoenix
#

can node.js be exploited in any way to do something malicious? Over like some form of exploit?

amber fractal
#

Most languages can

dusky marsh
#

Anything can be exploited if the attackers are given a chance

earnest phoenix
#

Like exploiting it to that point where it evals stuff where it shouldnt do

quartz kindle
#

no

#

if you mean something like an sql/eval injection on some random bot built with discord.js then no

earnest phoenix
#

cool, then it shouldnt be possible to yoink my bots token without me being dumb

#

nice

quartz kindle
#

yeah, unless you do something like an open eval command, or something stupid, nobody can do anything

#

not through discord

#

most tokens are stolen from github or glitch

#

because people forget to put them in a separate file and gitignore it

#

or just dont know that thats a thing

sudden geyser
#

or a math command except the dev decided eval would do the trick

steel drum
#

iirc discord resets your bot token if it finds it on github

earnest phoenix
#

I’d eval the equasion in a container so it doesnt have access to global vars

steel drum
#

regardless, you should keep them in a .env file or some other file that you plan to ignore on git

quartz kindle
#

containers are still not safe enough

#

people can still require("fs") and wreck havoc

sudden geyser
#

What about the VM module

amber fractal
#

or require child process and delete everything

quartz kindle
#

or require("http") and dos something

earnest phoenix
#

I mean

sudden geyser
#

vm module is kind of cool but takes a bit.

earnest phoenix
#

why not chmod 000 the container and yoink its internet access

steel drum
#

lul

quartz kindle
#

there's a lot of things that would need to be taken care of

#

so its generally discouraged to even try

misty sigil
#

is it normal to have 2 bots for the same bot?

quartz kindle
#

but if you absolutely wanna go that route, i believe Brain did something like that

#

using a custom c++ javascript engine or something

earnest phoenix
#

OR

sudden geyser
#

that's dedication

earnest phoenix
#

eval() in python

#

eval /= exec

misty sigil
#

srsly is it normal?

quartz kindle
#

@misty sigil normal? not really

#

but not unheard of

misty sigil
#

oh wait i should probably provide context

#

i have a canary build (just in my test server) and a stable build (hosted 24/7 for everyone)

earnest phoenix
#

@quartz kindle are you busy?

quartz kindle
#

its 2am

#

my eyes are shutting down

#

@misty sigil thats perfectly normal yes

misty sigil
#

your Brit too tim?

quartz kindle
#

nop

#

portugal

misty sigil
#

2am implied Brit but 👌cool

tired nimbus
#

is there a quick method to check if your bot is in a server given server id?

earnest phoenix
#

client.guilds.resolve(id)

#

if it returns undefined its not in there

tired nimbus
#

thank you

astral yoke
#

const {body: background} = await bot.fetch.get("https://cdn.discordapp.com/attachments/533877198885486603/533877255810842635/800px-Thank-you-2017-background-320.svg.png");

#
at Client.bot.on (/app/src/index.js:99:46)```
#

?

copper cradle
#

what's bot.fetch

glossy elk
#

b r u h

#

@astral yoke what's bot.fetch

astral yoke
#

dont damn copy someone else lmao

#

fixed it

neat ingot
#

yea brains system is complex af

glossy elk
#

no but wtf

#

is bot.fetch

neat ingot
#

its a custom javascript interpreter embedded in his bot

#

so only the things he defined are available for users scripts

glossy elk
#

bot.fetch.get??

astral yoke
#

its from node-superfetch .

#

just so yk 😉

glacial beacon
#

Does the ban members permission include fetching guild bans

#

If not, which permission allows fetching guild bans

amber fractal
#

I would assume it's view audit log, but not sure

tired nimbus
#

does anyone know of a situation where they await messages but then it returns the catch that was supposed to be for timeout?

#

I remember having this issue before but I seriously forgot how to fix it and I just wanted to know if there was a cause of this error so I can find the fix more quickly

restive lily
#

me got questionn

#

i made a welcome cog

#

and idk what to change bot and member to

earnest phoenix
#

How can I keep my bot on 24/7?

restive lily
#

use a host

#

theres many free ones and ones that cost money

earnest phoenix
#

I use Node.js

restive lily
#

yes

#

no offense, but if u yt it, MANY MANY tutorials on it! :)

earnest phoenix
#

Ok i'll watch some

restive lily
#

mhm!

tired nimbus
#

is there a fast way to get all guild ids that have the bot?

sudden geyser
#

What language

tired nimbus
#

discord.js for me

#

do I have to loop through each guild and then get the id

sudden geyser
#

Iterate over the .guilds collection on the client with the map method.

tired nimbus
#

is there a way to loop through each row in better-sqlite3 and get the first key value

#

also is it faster to loop through guilds using guilds registered in a database or should I iterate over bot.guilds

hardy vector
#

code: https://hastebin.com/qiviqagiru.cs
error: src/client/BotClient.ts:6:10 - error TS2614: Module '"../../../../../../Users/nerd/Desktop/ts bot/src/structures/Database"' has no exported member 'Database'. Did you mean to use 'import Database from "../../../../../../Users/nerd/Desktop/ts bot/src/structures/Database"' instead?

6 import { Database } from "../structures/Database"

earnest phoenix
#

I shut down my computer at 10PM every night and then I turn my PC back on 10PM. The problem about this is that my Bot shuts down 5 minutes after my PC
Question: How can I keep my bot online after my PC shutsdown

warm marsh
#

Hosting?

#

Check pins.

earnest phoenix
#

I have a hosting platform. I use Node.Js. But that doesn’t keep it on 24/7.

hoary elm
#

I have a hosting platform. I use Node.Js. But that doesn’t keep it on 24/7.
Uhh, lol that's a runtime/framework

#

Hosting is like. Glitch, Heroku, Google Cloud ect

copper cradle
#

that's not a hosting platform

earnest phoenix
#

Oh-

hoary elm
#

Would be kinda nice if it hosted itself 😂

glacial beacon
#

@hardy vector You're exporting as default export default ... and importing as a named export import { Database } ...

earnest phoenix
#

Sorry for wasting your time @hoary elm I’m new to bot developing.

hoary elm
#

Your good. I'm pretty sure there's a list of hosts somewhere in the pinned messages

frank wraith
#

kok dapet role bot dev sih?? gimana??

summer torrent
frank wraith
#

yeah

#

indonesian

wild mist
#

submit your bots If you bots accepted you will get the role

frank wraith
#

where a submit? @wild mist

summer torrent
wild mist
#

Yeah

frank wraith
#

done

#

@wild mist

wild mist
#

Wait for approval

#

When your bot get approved you will get the role

steel drum
#

^

#

roughly takes 5-7 days

#

in my experience

frank wraith
#

wait, how long will it take?

#

owh oke

earnest phoenix
#

briefly, u can check that out

frank wraith
#

owh oke

earnest phoenix
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Fun' object has no attribute 'channels'
what does this mean?

wild mist
#

@frank wraith Did you use other library?

frank wraith
#

yeah

#

on VisualStudioCode

#

@wild mist

wild mist
#

Then u use discord.js?

frank wraith
#

yeah use it

wild mist
#

Then why u select other library lol

#

VisualStudioCode is not lib

frank wraith
#

owh am so sorry

#

am wrong choice

#

done

wild mist
#

Btw u had bad english

frank wraith
#

yeah because i from indonesian

earnest phoenix
#

@wild mist discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Fun' object has no attribute 'channels'
can u help me with this?

wild mist
#

Is that py?

earnest phoenix
#

yep

wild mist
#

I dont use py

earnest phoenix
#

oh ok!

wild mist
#

K

frank wraith
#

i am wait to approved my bot

wild mist
#

Im indonesian but not isnt that bad

spare iron
#

Hello

#

@earnest phoenix What is Fun there

earnest phoenix
#

@spare iron cogs

spare iron
#

what u want to do then?

#

Fun.channels?

#

What is this

earnest phoenix
#

i loaded the cog but when i type the commands in that cog it gives this error
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Fun' object has no attribute 'channels'

#

@spare iron ^

spare iron
#

This is not Full Error

wild mist
#

@glossy elk Just use normal discord.js

#

Why would u use commando

earnest phoenix
#

wait

spare iron
#

Can U show me that code where u are using Fun.channels

glossy elk
#

im using commando

#

Like it or not

wild mist
#

wew

glossy elk
#

I asked a question not a suggestion

neat ingot
#

anyone here randomly know how to setup netdata notifications to send to a discord channel via webhook?

frank wraith
#

gua harus nunggu dlu sampe 5-7 hari ya bro @wild mist

earnest phoenix
#
from discord.ext import commands

class Fun(commands.Cog):
  
  def __init__(self, client):
    self.client = client

  @commands.command()
  @commands.bot_has_permissions(add_reactions=True)
  async def payrespect(self, ctx, *, user: discord.User = None):
      """Pay respects by pressing F"""
      if str(ctx.channel.id) in self.channels:
          return await ctx.send(
              "Oops! I'm still paying respects in this channel, you'll have to wait until I'm done."
          )
      self.channels[str(ctx.channel.id)] = {}

      if user:
          answer = user.display_name
      else:
          await ctx.send("What do you want to pay respects to?")

          def check(m):
              return m.author == ctx.author and m.channel == ctx.channel

          try:
              pressf = await ctx.bot.wait_for("message", timeout=120.0, check=check)
          except asyncio.TimeoutError:
              del self.channels[str(ctx.channel.id)]
              return await ctx.send("You took too long to reply.")

          answer = pressf.content[:1900]

      message = await ctx.send(
          f"Everyone, let's pay respects to **{filter_mass_mentions(answer)}**! Press the f reaction on the this message to pay respects."
      )
      await message.add_reaction("\U0001f1eb")
      self.channels[str(ctx.channel.id)] = {'msg_id': message.id, 'reacted': []}
      await asyncio.sleep(120)
      try:
          await message.delete()
      except (discord.errors.NotFound, discord.errors.Forbidden):
          pass
      amount = len(self.channels[str(ctx.channel.id)]['reacted'])
      word = "person has" if amount == 1 else "people have"
      await ctx.send(f"**{amount}** {word} paid respects to **{filter_mass_mentions(answer)}**.")
      del self.channels[str(ctx.channel.id)] 

def setup(client):
  client.add_cog(Fun(client))```
wild mist
glossy elk
#

@earnest phoenix I don't code in py

earnest phoenix
#

oh f wrong tag

frank wraith
#

okey

glossy elk
#

@neat ingot I never used netdata but I am pretty sure ifttt is similar to it.

spare iron
#

Is it not loading @earnest phoenix

earnest phoenix
#

@spare iron it is loading

spare iron
#

Then,

neat ingot
#

unlikely, i need to know specifically for netdata which conf file i need to be editing for a dockerized netdata instance

earnest phoenix
#

but commands not working

#
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 892, in invoke
    await ctx.command.invoke(ctx)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 797, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 92, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Fun' object has no attribute 'channels'```
neat ingot
#

cause my changes dont seem to be taking effect at all

#

lol

earnest phoenix
#

@spare iron shows me this ^

spare iron
#

Its A Indentation Prob

earnest phoenix
#

oh!

spare iron
#

Huh

#

i figured out

glossy elk
#

So is anyone going to help?

spare iron
#

It is in self.channels line

glossy elk
#

Is there a script to create commando commands?
It will fill in all those ```js
const Command = require('../../structures/Command');

module.exports = class HangUpCommand extends Command {
constructor(client) {
super(client, {
name: 'name',
group: 'groupname',
memberName: 'membername',
description: 'deschere',
guildOnly: true
});
}

async run(msg) {
        }

};

This is how i thought it would be 

Command name: # enter command name
Command group: # enter command group
...```
Like an interactive shell

spare iron
#

@earnest phoenix It is in self.channels line

earnest phoenix
#

there are 5 of them

#

and i dont see any wrong in them

#

*4

spare iron
#

Yes they are wrong, cause self is fun cog, and it has no attribute channel

earnest phoenix
#

so how should i overcome it?

glossy elk
#

so.. uh no help i guess

spare iron
#

Can U Tell me What will self.channel do?

#

Then I can help according to that

#

Looking like channel is dictionary yes?

earnest phoenix
#

post a specific message i want in a channel.

spare iron
#

Which Channel, Is it stored in a list or dict or some db?

earnest phoenix
#

in the channel the command was used

spare iron
#

see did u have channels dict?

earnest phoenix
#

umm no ig

spare iron
#

Then Make It

#

At the top

#

And in init():
add self.channels = channels

earnest phoenix
#

ok let me check

spare iron
#

And I suggest you to ask this in dpy

#

Will be more helpfull

earnest phoenix
#

hmm i asked but no response

spare iron
#

Can, you tell me are u copying this code from somewhere?

#

@earnest phoenix channels is list

#

make it empty list at top not dict

#

channels = []

earnest phoenix
#

my friend gave me when i asked

spare iron
#

self.channels = channels

earnest phoenix
#

oh

spare iron
#

😅 I think he removed some lines😅

earnest phoenix
#

wait

spare iron
#

U did it?

glossy elk
#

Is there a script to create commando commands?
It will fill in all those ```js
const Command = require('../../structures/Command');

module.exports = class HangUpCommand extends Command {
constructor(client) {
super(client, {
name: 'name',
group: 'groupname',
memberName: 'membername',
description: 'deschere',
guildOnly: true
});
}

async run(msg) {
        }

};

This is how i thought it would be 

Command name: # enter command name
Command group: # enter command group
...```
Like an interactive shell

#

SOMEONE

#

HELP

earnest phoenix
#

😅 I think he removed some lines😅
@spare iron not removed his codes are really huge so i just ask him for the code for that specific command. A Verified Bot Developer

#

@glossy elk no idea me beginner

spare iron
#

@earnest phoenix Is it working now?

earnest phoenix
#

wait give me a min

spare iron
#
def __init__(self, client, channels):
        self.client = client
        self.channels = channels
earnest phoenix
#

i did that now showing me some other error

#

im having a look at that

broken crater
#

glad charm
#

@broken crater stop posting nothing in every channel.

glossy elk
#

Is there a script to create commando commands while filling in name,desc,etc?
It will fill in all those ```js
const Command = require('../../structures/Command');

module.exports = class HangUpCommand extends Command {
constructor(client) {
super(client, {
name: 'name',
group: 'groupname',
memberName: 'membername',
description: 'deschere',
guildOnly: true
});
}

async run(msg) {
        }

};

This is how i thought it would be 

Command name: # enter command name
Command group: # enter command group
...```
Like an interactive shell

copper cradle
#

@glossy elk no, but you can make it

glossy elk
#

Damn

#

I will just use VSC snippets

compact tundra
#
private void updateWater(){
        int[] pushData = new int[resolution*resolution];
        pushData = data;
        for(int x = 0;x<resolution;x++){
            for(int y = 0;y<resolution;y++){
                if(data[resolution*x+y] == 1){

                    if(x<resolution-1){
                        pushData[resolution*(x+1)+(y)] = 1;
                    }
                    if(x>0){
                        pushData[resolution*(x-1)+(y)] = 1;
                    }
                    if(y<resolution-1){
                        pushData[resolution*(x)+(y+1)] = 1;
                    }
                    if(y>0){
                        pushData[resolution*(x)+(y-1)] = 1;
                    }

                }else{pushData[resolution*x+y] = 0;}}}
        data = pushData;
    }

This function is called once a second but it just fills the data array with ones can someone help with this

forest pond
#

Really I Need Help With DiscordGO

small prairie
#

check the bot's perms in that particular channel

summer torrent
#

yes

small prairie
#

Thanks

balmy knoll
#

In discord.js, how can I check whether or not the Everyone role has specific permission in a channel?

pale vessel
#

use the guild id

#

that's the id for everyone role

steel drum
pale vessel
#

that's not it

balmy knoll
#

Yes, but can i use channel.permissionOverwrites.get(guild.id)?

pale vessel
#

yeah

balmy knoll
#

Ok thanks

pale vessel
#

i'm not sure if that's the correct way of getting permission overwrites but yeah, use the guild id

summer torrent
distant hound
#

await reaction.remove(1);

#

bu doğru bir terim midir

#

sadece 1 reaction silmesi için

#

@summer torrent

summer torrent
#

english only in this channel. (also no)

distant hound
#

dur çeviri yapıp geliom .d

summer torrent
balmy knoll
#

@summer torrent Ok if i want to check if the permission in true or false?

flat pelican
#

Keep this channel english only

distant hound
#

await reaction.remove(1);
is this a correct term
for 1 reaction delete only

lavish summit
#

Hello

distant hound
#

hi

lavish summit
#

Sorry, i´m new on this. How can I have a color?

distant hound
#

are you mention the bot developer role ?

lavish summit
#

I think not

distant hound
#

this channel help to code

lavish summit
#

hmmmm

#

Am I have to react to a message or something?

distant hound
#

reaction.add('\👌')

#

\👌

summer torrent
#

@balmy knoll has() is Boolean

#

true/false

#

@lavish summit you need an approved bot on website

#

for Bot Developer role

obtuse thorn
distant hound
#

@obtuse thorn WOW

obtuse thorn
#

What should i do to make ping go down?

misty hemlock
#

is the reactions bot down?

summer torrent
#

@misty hemlock go to their support server

misty hemlock
#

idk where it is

lavish summit
#

F

summer torrent
#

click "Join Support Server"

obtuse thorn
misty hemlock
#

where ;-;

obtuse thorn
#

its my bit

#

its my bot

misty hemlock
#

can you dm me the link? or no?

obtuse thorn
#

want me to invite ?

misty hemlock
#

yes please

lavish summit
summer torrent
obtuse thorn
#

Neon's Info
Total servers:
16
Total users:
827
Ping:
9544ms

misty hemlock
#

whats that

lavish summit
#

Send help

summer torrent
#

@misty hemlock ^

misty hemlock
#

0k thanks

distant hound
#

await reaction.remove(1);
is this a correct term
for 1 reaction delete only
@summer torrent

summer torrent
#

no

distant hound
#

how

summer torrent
lavish summit
#

Ay, esta chingadera ya valió. xdxdx

misty hemlock
#

ohhhh

#

thank you so much

lavish summit
#

eh?

summer torrent
#

What should i do to make ping go down?
@obtuse thorn get faster internet speed

distant hound
#

vds

lavish summit
#

Hmmm...

#

Can we play Mafia here?

summer torrent
lavish summit
#

Why?

summer torrent
#

this channel is for chatting about development

lavish summit
#

Okay

distant hound
#

await reaction.remove(1);
is this a correct term
for 1 reaction delete only

#

pls response

summer torrent
#

remove which user's reaction

distant hound
#

message.author

summer torrent
#

you have to specify that

#

remove(message.author)

#

remove(user object here)

distant hound
#

when it does so it deletes them all

#

.d

obtuse thorn
#

@obtuse thorn get faster internet speed
@summer torrent bot dosent run on my internett and i have 300mbs... But my bot is on a vps....

summer torrent
#

I mean on a vps

obtuse thorn
#

how do i do that

small prairie
#

How do i use if...else in try....catch statements

#

like

pale vessel
#

just use them normally

small prairie
#

try{
If(something)Error here
else
}
catch(e){
console.log(e)
}

pale vessel
#

yeah

golden condor
#

Yes

small prairie
#

this doesnt seem to be working

golden condor
#

Well not literally that

small prairie
#

its still saying unhandled promise rejection

pale vessel
#

you need to add await or then

#

or just use .catch

small prairie
#

just catch would become inefficient

golden condor
#

No

#

.then(do something).catch(console.log)

small prairie
#
try {
              if (a condition) {
                mg.edit(Something else)
              } else {
                mg.edit(Something)
              }
            } catch (e) {
Wanna handle here
}```
golden condor
#

Yes

#

I guess

small prairie
#

the error is in mg.edit

#

catch isnt catching exactly

golden condor
#

Is mg defined?

small prairie
#

Yea

#

The error is

pale vessel
#

what is mg

small prairie
#

content: Must be 2000 or fewer in length.

#

Thats a message object

pale vessel
#

oh

#

just slice the content

small prairie
#

and its bot's

golden condor
#

Then the message is more than 2000 characters

small prairie
#

Yeah i want it to send in a new message

summer torrent
#

is this discord.js

pale vessel
#

yeah

grand dagger
#

do two messages

summer torrent
#

use {split:true}

pale vessel
#

isn't that only for sending

golden condor
#

That's a thing??

small prairie
#

it is just returning after that error

summer torrent
#

@golden condor yes

small prairie
#

it is not reaching to catch

golden condor
#

Holy shit I wish I realised this sooner

small prairie
#

i have made a catch which used to work without try catch

pale vessel
#

you pepega

#

that's what i used for lyrics

golden condor
#

I just manually checked lengths

small prairie
#

holy shit really

#

but it wont work on my case as it would split in middle of a sentence i suppose

pale vessel
#

is it the content that you want to edit that has over 2000 length?

summer torrent