#development

1 messages · Page 749 of 1

restive furnace
#

almost no one uses normal js for bots so, i did say js cuz shorter than node.js

#

and its almost same as js just maybe little changes to original js

earnest phoenix
#

all i understand is that since i started dealing with discord botallo i started to study this language

#

but there would be another problem I just ran into

#

all prefixes are detected by the bot

#
  if(message.author.bot) return;
  if(message.channel.type === "dm") return;

  let prefix = botconfig.prefix;
  let messageArray = message.content.split(" ");
  let cmd = messageArray[0];
  let args = messageArray.slice(1);
  let commandfile = bot.commands.get(cmd.slice(prefix.length));
  if(commandfile) commandfile.run(bot,message,args);

});```
#

  if(err) console.log(err);
  let jsfile = files.filter(f => f.split(".").pop() === "js")
  if(jsfile.length <= 0){
    console.log("Couldn't find commands.");
    return;
  }

  jsfile.forEach((f, i) =>{
    let props = require(`./commands/${f}`);
    console.log(`${f} loaded!`);
    bot.commands.set(props.help.name, props);
  });
});```
#

I gave it to - to have the prefix

#

but it senses everything else and I think well written

earnest phoenix
#

you can request that the command run on any server logs it on my server to a designated room, and how much it loads the server machine?

#

I know I have a lot of questions, but I'm curious 😉

slender mountain
#

Hey all, so I tried using this to determine whether or not the reaction is animated or not, when I do this on a message with three reactions (normal, normal, animated) it returns (undefined, false, undefined)

msg.reactions.forEach(reaction=>{
    var emoji = reaction.emoji;
    console.log(emoji.animated)
});

Anyone know why it reacts this way?

dusk cargo
#

Please help me

#

Music embed+ video thumbnail

#

Please help me

twilit rapids
#

Do you mean adding a thumbnail of a YouTube video to an embed

dusk cargo
#

Ya @twilit rapids

#

Please help me

#

😭 😭 😭

twilit rapids
#

The thumbnail is build like:
http://img.youtube.com/vi/[video-id]/0.jpg

dusk cargo
#

Ya

#

I am try

twilit rapids
#

So get the video ID of a video an use that

dusk cargo
#

But my not working

twilit rapids
#

show your code

dusk cargo
#

Dm me

twilit rapids
#

Just paste it here...

earnest phoenix
#

prefix bug only + 1 line if (!message.content.startsWith(PREFIX)) return undefined;

twilit rapids
#

what

dusk cargo
#

My play .js

#

Code

#

@twilit rapids my code

#

Sir

twilit rapids
#

I assume you just pasted the code from The BelguimGames

dusk cargo
#

No copy @twilit rapids

#

Video .title or video .url

#

Sir help me

#

Please

#

😭

twilit rapids
#

You literally

#

Deleted the messages while I was reading

#

Ok then

dusk cargo
#

But sir

#

Video id miss

#

Video id info video URL or video title

#

@twilit rapids sorry ping you

twilit rapids
#

just google
"how to get video ID of youtube url javascript"

dusk cargo
#

👍

#

Thx

#

And sir my bot please test

earnest phoenix
#

@dusk cargo mods are human please wait for your bot

dusk cargo
#

Ya but my bot command guilde all too.gg description include

earnest phoenix
#

???

glad charm
#

Not a clue.

earnest phoenix
glad charm
#

As Dany said they're human and there are plenty of other bots to go through first. They can't rush these things.

earnest phoenix
#

I don't understand your last message Name Boy

wheat jolt
#

ignore that expiresAt is different

earnest phoenix
#

Can someone tell me how do I get a server's member count excluding bots? I tried the code below but it just returns an empty list.

let finfo = await db.collection("factions").findOne({_id: "info"});
    let list = "";
    let members = 0;
    for(var i = 0; i < finfo.count; i++){
      db.collection("factions").findOne({_id: i}).then(fsinfo => {
      let fserver = client.guilds.get(fsinfo.serverID);
        fserver.members.array().forEach(m => {
          if(m.user.bot === false) members = members + 1;
        });
      list += `**[${parseInt(i)+1}]:** \`${fsinfo.name}\` (${members} members)\n`;
      });
wheat jolt
#
var memberCount = await guild.members.filter(m => !m.user.bot).size
console.log(memberCount) //should print the member count excluding the bots
earnest phoenix
#

oh ok thanks

wheat jolt
#

np

twilit rapids
#
  • add .size at the end to get the number and not every member object
wheat jolt
#

ah, yes

earnest phoenix
#
if(args[0] === "all"){
    let finfo = await db.collection("factions").findOne({_id: "info"});
    let list = "";
    for(var i = 0; i < finfo.count; i++){
      db.collection("factions").findOne({_id: i}).then(fsinfo => {
      let fserver = client.guilds.get(fsinfo.serverID);
      list += `**[${parseInt(i)+1}]:** \`${fsinfo.name}\` (${fserver.members.filter(m => {!m.user.bot}).size} members)\n`;
      });
    }
    let embed = new Discord.RichEmbed()
    .setTitle("List of factions.")
    .setDescription(list)
    .setColor("#ffa500");
    message.channel.send(embed);
  }
``` the list is still empty. Can someone tell me if I wrote anything wrong? The console didnt output anythin
wheat jolt
#

uhm

#

hold on

#
if(args[0] === "all"){
    let finfo = await db.collection("factions").findOne({_id: "info"});
    let list = "";
    for(var i = 0; i < finfo.count; i++){
      db.collection("factions").findOne({_id: i}).then(async fsinfo => {
      let fserver = await client.guilds.get(fsinfo.serverID);
      let memberCount = await fserver.members.filter(m => !m.user.bot).size
      list += `**[${parseInt(i)+1}]:** \`${fsinfo.name}\` (${memberCount} members)\n`;
      });
    }
    let embed = new Discord.RichEmbed()
    .setTitle("List of factions.")
    .setDescription(list)
    .setColor("#ffa500");
    message.channel.send(embed);
  }
#

use this @earnest phoenix

earnest phoenix
#

lemme try

wheat jolt
#

feel free

earnest phoenix
#

its still an empty list

wheat jolt
#

it sends ( members) ?

mortal depot
#

Can i ask help

wheat jolt
#

of course

earnest phoenix
#

no list is empty

wheat jolt
#

give me a screenshot

mortal depot
#

I was trying to add Cosmos bot to my server

wheat jolt
#

of the embed

mortal depot
#

And i was linked here..

mossy vine
#

@mortal depot you clicked the wrong button

mortal depot
#

O

earnest phoenix
mortal depot
#

So this server is a collection of newly made bots?

#

Oooh

#

Coool

earnest phoenix
#

this server is a bot list

mossy vine
#

no

#

its a bot list

earnest phoenix
#

not just for newly made

#

mee6 and pokecord are all here

wheat jolt
#

it's basically a hub

earnest phoenix
#

the embed is above, alex

mortal depot
#

Ooh

#

Is cosmos bot herr?

#

Here*

earnest phoenix
wheat jolt
#

what does finfo return

earnest phoenix
#

{
_id: "info",
count: 1
}

green kestrel
#

not sure i can improve my table appearance any further with the limited abilities of discord markdown. thoughts?

mossy vine
#

thats insanely creative

green kestrel
#

its unicode box drawing characters and ```diff

pearl jasper
#

Howwww

#

the banner thingy

mossy vine
#

certified

pearl jasper
#

Ohhhhhh

#

alright

#

Thanks

opaque eagle
#

Why is it that whenever I try to change the font of text on my bot's dbl page, it goes to Times New Roman

#

or serif but times new roman is more popular so im calling it that

#
@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');
span.bot-name {
   color: white;
   font-family: 'Roboto' !important;
}```
modest maple
#

Is Roboto a HTML/CSS safe Font

opaque eagle
#

No I don't think so

#

wait it is

#

idk

modest maple
compact raft
#

hello

#

My project of glitch has stuck on Starting...

any help

modest maple
#

Idk if that's a code error or a glitch issue

#

Ask them ig

compact raft
#

no any error

#

code is completely perfect i haven't seen any error

lilac wharf
#

Well did you call on the start up client.on('ready') etc... event (not sure the exact format from memory.

#

As well as login the token to the bot.

compact raft
#

i'm using this

exports.start = (client, options) => 
mossy vine
#

dont use glitch

#

it makes debugging hell

opaque eagle
#

^

#

You can’t even set breakpoints

compact raft
#

@mossy vine WHY?

mossy vine
#

we just said 2 good reasons why not

lilac wharf
#

I'd suggest getting VSCodium / Visual Studio Code for development with discord (from personal experience).

mossy vine
#

do you have some client mods installed that only display messages with code blocks or glitch mentioned in them?

compact raft
#

i dont have my own nodejs supported hosting
so i'm using free hosting

mossy vine
#

no reason not to develop locally

wheat jolt
#

That's not free hosting

compact raft
#

@wheat jolt there is a free plan also

wheat jolt
#

Free hosting can be heroku

opaque eagle
#

^

wheat jolt
#

But not glitch

#

Glitch is for testing or something like this

compact raft
#

@wheat jolt heroku is not trusted by my experience

opaque eagle
#

Heroku has much a much better tool chain compared to glitch

mossy vine
#

this convo makes me want to jump out the window but im in school and i would only fall a couple meters

opaque eagle
#

Lol

#

I’m on the bus so I’d fall into the highway

amber fractal
#

Even better

mossy vine
#

at least youd get hit by a car then

wheat jolt
#

@compact raft what's your experience, sir

lilac wharf
#

It's best to do stuff locally before it's published to a live edition of a server, I personally have found that a good method for me but from the reviews of glitch and from what everyone has said here but I can't comment on that site.

compact raft
#

@wheat jolt heroku try to ha*k my discord server

because my friend's server has got ha*ked by heroku

mossy vine
#

okay no, that couple meters will be enough

wheat jolt
#

=)))))

amber fractal
#

That's...

lilac wharf
#

That is probably not likely...

amber fractal
#

It didn't

#

Your friend probably put their token on github

lilac wharf
#

Plus bot tokens can be refreshed with ease.

compact raft
#

Yes sure

amber fractal
#

Which is why you use env vars or an actual proper host like a vps.

opaque eagle
#

If your friend supposedly got hacked by Heroku, then they don’t know how to use it

wheat jolt
#

^

late hill
#

nice status that violates tos vanillaPray

opaque eagle
#

But yes Heroku has a truly great toolchain, especially for a free platform

compact raft
#

@opaque eagle it will be

wheat jolt
#

It will be what

#

Lmao

lilac wharf
#

Plus I'm 100% sure that Heroku as a legitimate business wouldn't compromise accounts since it would violate the law of compromising user's data.

compact raft
#

Why they give's Free hosting

amber fractal
#

@late hill I just noticed theirs lmao

late hill
amber fractal
#

@compact raft because free trials are extremely profitable

wheat jolt
#

they give

lilac wharf
#

I mean my VPS hosting I'm with had a free hosting for 7 days and I'm still with them after 4 months.

compact raft
#

@lilac wharf my suggestion don't use any free VPS hosting...

#

i have paid shared hosting but nodejs not supported..

wheat jolt
#

Oh really

mossy vine
#

the hypocrisy is intense

lilac wharf
#

@compact raft Well I had a free trial and been with them for 4 months so far, about $9/month but it's worth it.

pseudo mesa
#

maybe do research on the hosting before buying it thonk

wheat jolt
#

Then why do you use glitch

compact raft
#

@lilac wharf Wait for Twist

wheat jolt
#

What

lilac wharf
#

There isn't a twist...

mossy vine
#

oh shut up youre the one claiming that heroku hacked your friend

opaque eagle
#

^

lilac wharf
#

I have to agree with Cyber on that.

mossy vine
#

im pretty sure saying bullshit like that instantly devalues your contributions to future conversations about a similar topic

wheat jolt
#

^

amber fractal
#

Honestly just get an actual vps, they have so many more use cases

#

I have one for $3/month

#

I host multiple websites and bots from it

opaque eagle
#

If you’re a student, you can get VPSes free for months

amber fractal
#

I had a minecraft server on it at one point

opaque eagle
#

Through GitHub Student Education Pack

#

You just need to show like a school id or a report card

unique nimbus
#

My VPS is 5 euros a month and is powerful enough for what I need

opaque eagle
#

Also I’m pretty sure GCP has a free forever plan

compact oriole
#

^

steel patrol
#

@wheat jolt Are you sure your hi doesn't contain extra space(s) at the end

wheat jolt
#

It's ok, I fized that

#

Thanks anyways

earnest phoenix
#

i just evaled message.guild and saw features but it was empty array. Anyone knows what the array has in it

late hill
#

It contains stuff from the boost rewards

#

and probably also verified servers

#

That's Eris

earnest phoenix
#

Ok ty

restive furnace
#

its exact same on d.js dev-12

#

or dev-11

#

not stable ones

green kestrel
#

does d.js derive from eris, or vice versa, or are they totally separate codebases?

#

e.g. was one originally a fork of the other

amber fractal
#

Eris was made because of downfalls in d.js stable, it wasnt being worked on

#

It wasnt a fork afaik

#

It's completely different

#

D.js master fixes a lot of it's stable counterpart issues.

green kestrel
#

ah ok

#

one day i might have a play with discord.js or eris

#

to see what the fuss is about

#

scratch that, thats something else

restive furnace
green kestrel
#

ah ok

#

dont really hear much about it here

cobalt umbra
#

how would one go with making djagno website communicate with d.py bot pepe_sweaty
what would be the simplest to connect those 2, that isn't blocking the bot stap

#

Just need keywords to look it up

slender thistle
#

Is there an async version of django

#

Try to search for one and run it as a background task

cobalt umbra
#

so you're suggesting to run django alonside d.py bot and expose some API endpoints peterthink

amber fractal
#

If you know what you're doing you wouldnt need to expose endpoints

cobalt umbra
#

I never did django I'm on the bot part

earnest phoenix
#

I know how to do common prefix for my bot, but what is the easiest way to manipulate databases using js?

cobalt umbra
green kestrel
#

@cobalt umbra personally i'd find a non-blocking sql library

#

and connect the bot to the website that way

#

simply because that worked well for me

#

YMMV

#

treat the db as write-only in the bot, and read-only on the website, depending on the table, you can reverse that flow

cobalt umbra
#

yes plan is to have api tunnel handling database in the middle. But for example one can verify itself on the website and I need to send that to the bot so the bot can add role that that member. Your suggestion is good I guess but I would have to manually trigger bot to lookup the database

green kestrel
#

depends what you want to do

#

i have role assignment based on webhooks, and yes the bot checks the db table for new rows on a 30 second timer

#

its fast enough that nobody really notices the delay: by the time theyve made their way back to discord they have their role

cobalt umbra
#

ah timer are simplest but I'm not sure that's the best way

green kestrel
#

and slow enough to not hammer discord

#

its the simplest way and easiest to maintain

cobalt umbra
#

there's been talk about websockets but never done them and I think they block pepe_sweaty

green kestrel
#

you could go around the houses and make some kind of web service within your bot with a listening port and https etc, and then query it from your website and have an internal api but... thats a lot of work when occams razor always wins out

#

everything only blocks if you let it block, for most languages, you can put blocking stuff into its own thread and marshall requests to it via a mutex

cobalt umbra
#

ye but threads stap

green kestrel
#

i cant tell you how to do that in python as i've not coded in python but i do know its possible

cobalt umbra
#

oki thanks for advice

green kestrel
#

np 🙂

#

also i dont know how expensive threads are in python

#

im coming from a C++ mindset where a thread is a trivial thing, once you get to grips with the concurrency issues

modest maple
#

Threading with async is the worst thing to ever put yourself through for no reward

#

Stick with async's tasks system and just have the wait for a request or response

green kestrel
#

threading with async works well if its done for you, no need to try and reinvent that razor sharp wheel with your bare hands. see ASIO.

#

can't say the same for JS

#

some things work great as thread and others work great event driven

#

if youre going to crunch numbers for 300 milliseconds... put it in a thread queue. if youre waiting for a socket to say its got data, use events.

#

horses for courses.

modest maple
#

I'm referring to using python's threading module and processes module

green kestrel
#

ah not used them

#

do they not play well together?

modest maple
#

They're basically for threading sync tasks to dedicate more reasorces and processes for async processing

amber fractal
#

Just upgrade your cpu and get a higher clock speed, problem solved mmulu

modest maple
#

But async has its own way of doing threading

#

By using tasks

#

Allows you to have more things going on one thread

earnest phoenix
#

I have to learn sqlite ;-;

sudden geyser
#

good luck

topaz fjord
#

sqlite is trash mmLol

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

fuck sqlite

topaz fjord
#

basically

earnest phoenix
#

or you can use an ORM

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

well any real database is better than JSON tbh

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

wheat jolt
#

smh

wooden lance
#

Anyone know how to detect when a user is banned and get who banned them? (Discord.js)

surreal sage
#

@sage bobcat Never but NEVER use Json as Database

sage bobcat
#

One message removed from a suspended account.

surreal sage
#

you could use it to store text

sage bobcat
#

One message removed from a suspended account.

surreal sage
#

or other info

#

ok

sage bobcat
#

One message removed from a suspended account.

surreal sage
#

no

#

发了饿u人 lol

compact oriole
#

Its CP again

lavish shuttle
#

In memory databases are fast

#

You could check out lokijs

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

valid frigate
#

if youre willing to configure redis it's a pretty good choice ngl

fluid basin
#

might as well just use a map

valid frigate
#

you can host it off of ur main vps so it doesnt die along with your bot if something happens to the vps/process

#

i think

#

but hey loki is a good choice too so you know

#

and i assume you know the whole gist that redis shouldnt be used as a db for permanent data like booleans n whatnot

fluid basin
#

well no one said you couldnt

#

just that you wont be able to restore any last changes/latest changes to it after it dies or whatever

valid frigate
#

wait that came out wrong

#

i mean for larger amounts of data for example economy and stuff

fluid basin
#

hmm if you do have that amount of ram and cpu

valid frigate
#

maaaaybe

#

the glorious part about programming: if you have the resources to do x, do it

wooden lance
#

Anyone know how to find out who banned a user in js?

fluid basin
#

it should be fine for non realtime stuff such as logging or perma caching

valid frigate
#

guildBanAdd event

fluid basin
#

yeah, and for already banned users, use the audit logs

valid frigate
#

redis is epic for things like maybe games if you do that

#

or cooldowns on commands

wooden lance
#

Ok

valid frigate
#

but not so epic for long term data like user ids and whatever else people store in actual dbs

sudden geyser
#

json can be usable as a db if you use it correctly

valid frigate
#

while you can, why would you

sudden geyser
#

suffering

valid frigate
#

fair

fluid basin
#

meh maps are better

valid frigate
#

its all preference really

fluid basin
#

though maps are basically objects

valid frigate
#

these are just our opinions

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

wdym?

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

Uh sure I guess

wheat jolt
#

Is it ok if a bot edits a message each second?

modest maple
#

nope

#

API abuse

#

think its like 12 edits a minute

#

somthing like that if i remember

wheat jolt
#

thanks

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

aight

#

Looks ok

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

what

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

You already have that right

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

same directory as your bot's main file

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

Well ofc you need to require it

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

Look in kongou where Saya requires it

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

Epic

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

uh one sec

surreal sage
#

onst emoji = 'regional_indicator_t'
message.reply(emoji.url) how to let emoji work?

#

ik const

twilit rapids
#

@sage bobcat if you don't include that anywhere, does it connect or?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

Just

#

remove that part

#

this.client.start(lavalinkserver)

surreal sage
#

i think 'this' isnt anything

#

i think ‹

sage bobcat
#

One message removed from a suspended account.

surreal sage
#

ç _ c

#

æy

sage bobcat
#

One message removed from a suspended account.

surreal sage
#

can u read errors?

sage bobcat
#

One message removed from a suspended account.

twilit rapids
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

Just remove that part

sage bobcat
#

One message removed from a suspended account.

surreal sage
twilit rapids
#

Axyx, pleaes

#

Read up the entire conversation before you conclude

surreal sage
#

sry

#

late react

#

i was sending the img

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

Hmm

#

Let me dig into my code where it connects

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

alright

#

Require the file somewhere

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

shoukaku.build(LavalinkServers, { id: client.user.id });

#

replace LavalinkServers with whatever you named it as

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

You have it defined somewhere right

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

in your main file

#

just place that code there

#

Build it before your ready event

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

Uh

#

Shouldn't make a difference for sharding

#

Just move the building outside of the ready event, before it

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

You mean

#

command handler then

#

Just move it to your main file then

#

before you load all the commands or events

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

what

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

How did you define Shoukaku

#
const { Shoukaku } = require('shoukaku');
```?
sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

Did you check capital letters

#

Shoukaku

#

shoukaku

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

Move it to your main file

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

Before you load any commands or events

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

what did you define your client as

#

bot?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

Have you placed it above defining your client

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

Move the Shoukaku.build() line into the ready event?

#

I have no idea at this point

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

Define Shoukaku there pepeJAMMER

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

Yeah

#

tbh, no idea

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

It's 1am for him

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

Wait

#

Move the Shoukaku.build() line under client.login()

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

might have effect

#

If not then I have no idea

earnest phoenix
#

please

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

no idea then

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

Let me just look at his github once more

late latch
twilit rapids
#

No

#

@sage bobcat recreate what Saya did there

#

This part

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#
const { Client } = require('discord.js');
const { Shoukaku } = require('shoukaku');
const MyLavalinkServer = [{
    name: 'Lewd Server',
    host: 'localhost',
    port: 6969,
    auth: 'do not guess my password'
}];
const client = new Client();

// In this example, I will assign Shoukaku to a carrier variable. Options are the default options if nothing is specified
const Carrier = new Shoukaku(client, {
  moveOnDisconnect: false,
  resumable: false,
  resumableTimeout: 30,
  reconnectTries: 2,
  restTimeout: 10000 
});

// Listeners you can use for Shoukaku
Carrier.on('ready', (name) => console.log(`Lavalink Node: ${name} is now connected`));
// Error must be handled
Carrier.on('error', (name, error) => console.log(`Lavalink Node: ${name} emitted an error.`, error));
// Close emits when a lavalink node disconnects.
Carrier.on('close', (name, code, reason) => console.log(`Lavalink Node: ${name} closed with code ${code}. Reason: ${reason || 'No reason'}`));
// Disconnected emits when a lavalink node disconnected and will not try to reconnect again.
Carrier.on('disconnected', (name, reason) => console.log(`Lavalink Node: ${name} disconnected. Reason: ${reason || 'No reason'}`));

client.on('ready', () => {
  // Connecting Shoukaku to Lavalink Nodes.
  Carrier.start(MyLavalinkServer, { id: client.user.id  });
  console.log('Bot Initialized');
})
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

twilit rapids
#

what if

sage bobcat
#

One message removed from a suspended account.

twilit rapids
#

hmm

#

No idea then

late latch
modest maple
sage bobcat
#

One message removed from a suspended account.

late latch
#

@sage bobcat

#

Good question sorry only to me

#

help me how to make the bot look for the user on all servers available to the bot and kick it from the servers?

mossy vine
#

loop through servers, check if the user is in it, if yes kick

modest maple
#

that is a dangerous feature to have

#

if your kicking a user from every server the bot is in

sage bobcat
#

One message removed from a suspended account.

late latch
#

I understand, but it’s not in malicious intent.

sage bobcat
#

One message removed from a suspended account.

modest maple
late latch
#

I don't think this is api abuse

modest maple
#

it is

sage bobcat
#

One message removed from a suspended account.

modest maple
#

its also a bad idea in general

sage bobcat
#

One message removed from a suspended account.

surreal sage
#
const emoji = 'regional_indicator_t'
message.reply(emoji.url) // How to make "emoji" work?```
modest maple
#

good way to piss alot of people off if one user gets kicked in one server gets kicked in all

surreal sage
#

hello?

modest maple
#

the the docs

surreal sage
#

ok

mossy vine
#

what the fuck

#

what the actual fucking fuck

#

string.url isnt a thing

surreal sage
#

how then

modest maple
#

Read the docs

surreal sage
#

okokokok

late latch
#

I did something like a blacklist, which will include a person with evil intentions, maybe a spammer, maybe server destroyers. Something like.

sage bobcat
#

One message removed from a suspended account.

mossy vine
#

actually i dont think thats gonna be in docs

sage bobcat
#

One message removed from a suspended account.

modest maple
#

it is

surreal sage
#

same

mossy vine
#

send the raw unicode string

surreal sage
#

oh

#

where? emoji class?

mossy vine
#

no

#

unicode

#

string

late latch
#
const emodji = client.emojis.find(s => s.name === 'regional_indicator_t');
surreal sage
#

ooooof

mossy vine
#

\🇹

#

copy that

#

and send that

#

@late latch that wont work

#

emojis only contains custom emojis

late latch
#

Why?

mossy vine
#

and regional_indicator_t isnt a custom emoji

sage bobcat
#

One message removed from a suspended account.

late latch
#

oh

#

ok

mossy vine
#

escape it with a backslash to get the unicode version of it

late latch
#

\🇹

surreal sage
late latch
#

nice fix))

surreal sage
#

😂

mossy vine
#

i love how the one time i actually try helping you, you just respond with an emoji

late latch
#

use \🇹

#

Copy and paste

mossy vine
#

congrats thats what ive been saying

surreal sage
#

what? **

#

\

late latch
#

Works for me

surreal sage
#

lol

#

oh y

mossy vine
#

do you just not care about your question at all

late latch
surreal sage
#

hmmmmm

mossy vine
#

dont do that

#

they will copy paste without any thought

surreal sage
#

i dont

#

im thinking about that code

glad charm
#

Y'all just ever have a computer so slow the bot doesn't even want to load data correctly. 🙂 (using an rpi to host lmao)

modest maple
#

my bots would kill any RPI

glad charm
#

I need to find somewhere else to host this thing or it's going to shit on the pi lmao

#

Time to by a pi4 with 4GB of ram

modest maple
#
Website.find_element_by_xpath(
                                 f"/html/body/div[1]/div/div[1]/main/section/div/div/ol/li[{Day + 1}]/section/div/ol/li[{Counter}]/article/div[1]/h1/a").get_attribute('datetime')```
#

i have

#

no idea why

#

its returning none

#

when

#

<time datetime="2019-12-17T11:25:00+00:00" class="available-time">11:25am</time>

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

tfw your internet's too shit to selfhost anything 😭 ✌️

sage bobcat
#

One message removed from a suspended account.

modest maple
#

F

#

do what i do

#

have multiple lines

glad charm
#

The solution was to just make it async/await a million task :)))

earnest phoenix
#

node async is weird

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

node async is cancer

sage bobcat
#

One message removed from a suspended account.

tepid hedge
#

Command handler loads commands but they don't actually run? Reconstructed and used 3 different command handlers, all for none of them to actually run commands yet loading them all.

#

Example command ``` exports.run = async(client, message, args) => {

let msg = await message.channel.send("Generating avatar...");

if(!message.guild.iconURL) return msg.edit("No icon.");

await message.channel.send({files: [
    {
        attachment: message.guild.iconURL,
        name: "icon.png"
    }
]});

msg.delete();

};

#

handler


    if (err) return console.log(err);
    files.forEach(file => {
        if (!file.endsWith(".js")) return;
        let props = require(`./commands/${file}`);
        console.log("Successfully loaded " + file)
        let commandName = file.split(".")[0];
        client.commands.set(commandName, props);
    });
});```
atomic quarry
quartz kindle
#

noblox.js said you're not logged in

atomic quarry
#

Great just just great

quartz kindle
#

@tepid hedge how are you running them?

tepid hedge
#

In that case it would be !icon

quartz kindle
#

i mean, in the message event

tepid hedge
#

one sec I think have might have found the error

#

I forgot to define the prefix

slender mountain
#

Hey all, why is it when dealing with reactions, reaction.emoji has no animated property?

modest maple
#

What lib?

slender mountain
#

discord.js

modest maple
#

What's the code

slender mountain
#
message.channel.fetchMessage(args[0]).then(msg=>{
    msg.reactions.forEach(reaction=>{
        console.log(reaction.emoji);
    });
});
#

The objects that brings back has no animated property

tepid hedge
#

@quartz kindle still nothing, Im using if (message.content.startsWith(prefix + "findusers")) { Since I switched to a new command handler

slender mountain
#

Like all I am trying to do is tell if the reaction is animated or not. @modest maple It's giving me a lot more trouble then I would have expected from something like this.

modest maple
#

Oh if your just doing that

#

Why not just do reaction.animated

#

Which I believe is a bool

#

Then do as you will with it

#

Ignore that command

#

Incorrect information I have give

slender mountain
#

reaction doesn't have an animated property either

#

emoji should though

#

which is why I am confused it doesn't

modest maple
#

.emoji just returns the emoji hash / string

#

If you do .url maybe idk

#

I'd check the discord.js docs on the object reaction and object emoji

#

And see what properties they have and what you can do with it

slender mountain
#

In the docs it says there is an animated property for emoji :1

modest maple
#

Wait surley reaction.emoji gives a sting? Or a hash

#

Can you try print out the emoji string

atomic quarry
#

@quartz kindle Sorry to bother you if I am, but I changed the cookie because it got changed so I put the new cookie in the code, but now it says this, https://hastebin.com/ugohusecog.css

modest maple
#

As animated emojis have a before them

#

So you could maybe check for that

slender mountain
#

reaction.emoji is an object

modest maple
#

/ can you get the emoji id

slender mountain
#

Yes I can get the emoji ID

modest maple
#

Couldn't you do what ever js version of guilds.emojis.get(Emoji ID) which gives you the actual emoji property which does have animated as a property

#

Just kinda shooting ideas out there xD

tepid hedge
#

@modest maple When you get the chance can you help me out? Problem above

slender mountain
#

@modest maple doesn't that require the bot to be in that guild?

tepid hedge
#

@slender mountain it would but why wouldnt it be in the guild

modest maple
#

Well yh, bots can't get emojis that is doesn't get from guilds

#

Like the bot has to be in a guild with that emoji for it to be able to get it

#

And @tepid hedge are you getting an error?

tepid hedge
#

no error, just the commands wont run

#

the other developer who works in the server hasnt seen anything like it

modest maple
#

Have you tried printing out what message content is and seeing if it's what you're expecting

tepid hedge
#

confused

#

its not just on this command it is on all commands

#

it was working fine until I accidentally ALT-Zed a few things last night

#

and it wouldnt undo that

modest maple
#

I'd check what it's comparing against

#

E.g caps sensitive or not

tepid hedge
#

Even if it was caps sensitive I make sure everything is lowercase

#

at this point I think its a problem with the command handler not loading the prefix correctly

modest maple
#

Well on the message event just print out:

Message.content (what your checking)
Prefix

quartz kindle
#

@atomic quarry that is not an error, that is literally the discord client

#

you get that if you do console.log(client)

modest maple
#

Tim thank god youre here xD

quartz kindle
#

wut

modest maple
#

Dw

#

You know js

#

I dont

#

XD

quartz kindle
#

lul

#

@tepid hedge show the full message event

tepid hedge
#
    if(message.author.bot) return;
    if(message.channel.type === "dm") return;```
quartz kindle
#

full message event

#

thats not all is it?

tepid hedge
#

yes...

quartz kindle
#

thats all?

#

then no wonder none of your commands work lol

tepid hedge
#
    if(message.author.bot) return;
    if(message.channel.type === "dm") return;



    let messageArray = message.content.split(/\s+/g);
    let command = messageArray[0];
    let args = messageArray.slice(1);

    if(!command.startsWith(prefix)) return;

    let limit = bot.ratelimits.get(message.author.id);
    let now = Date.now();
    let timeLimit = 2000;

    if(limit != null) {
        if(limit >= now - timeLimit) {
            message.delete();
            return message.channel.send("You are being ratelimited. Try again in `" + (Math.abs((now - limit) - timeLimit) / 1000).toFixed(2) + "` seconds.").then(m => m.delete(2000));
        } else {
            bot.ratelimits.set(message.author.id, now);
        }
    } else {
        bot.ratelimits.set(message.author.id, now);
    }

    let cmd = bot.commands.get(command.slice(prefix.length));
    if(cmd) cmd.run(bot, message, args, con);
});
quartz kindle
#

thats better, lemme see

#

are you using bot or client? in your previous messages you set your commands in client, but now you're using bot

atomic quarry
#

So what am I supposed to do with console.log?

quartz kindle
#

nothing

#

if you dont want that to appear, remove it

atomic quarry
#

Well the bot hasn't turned on

#

So there has to be something wrong with the code

quartz kindle
#

show code

tepid hedge
#

@quartz kindle bot, switched back to a different command handler because the other one didn't work and this was the original one

atomic quarry
#

The whole code or just index.js?

quartz kindle
#

you cant just be switching things around because they dont work lol. if it doesnt work it means you did something wrong

tepid hedge
#

yeah I realized

quartz kindle
#

whats the code for the current command handler?

tepid hedge
#
    if(err) console.error(err);

    let jsfiles = files.filter(f => f.split(".").pop() === "js");
    if(jsfiles.length <= 0) {
        console.log("No commands to load!");
        return;
    }

    console.log(`Loading ${jsfiles.length} commands!`);

    jsfiles.forEach((f, i) => {
        let props = require(`./cmds/${f}`);
        console.log(`${i + 1}: ${f} loaded!`);
        bot.commands.set(props.help, props);
    });
});```
quartz kindle
#

@atomic quarry index should be fine

atomic quarry
#

Ok

sudden geyser
#

check how you're setting it

quartz kindle
#

@tepid hedge show a command file

#

do your commands have an exported "help" field?

tepid hedge
#

Yes

#
module.exports.run = async (bot, message, args) => {
    let msg = await message.channel.send("Generating avatar...");

    if(!message.guild.iconURL) return msg.edit("No icon.");

    await message.channel.send({files: [
        {
            attachment: message.guild.iconURL,
            name: "icon.png"
        }
    ]});

    msg.delete();
}

module.exports.help = {
    name: "icon"
}
quartz kindle
#

thats one problem

#

you're setting the command key as prop.help

#

meaning the key to the command is {name:"icon"} not icon

tepid hedge
#

So what should I change to make it use icon?

quartz kindle
tepid hedge
quartz kindle
#

props

tepid hedge
quartz kindle
#

hmm

#

console.log(props)

atomic quarry
tepid hedge
quartz kindle
#

after props is defined duh

tepid hedge
#

oops

quartz kindle
#

@atomic quarry where is the index?

atomic quarry
#

oof

quartz kindle
#

i see config, package and package-lock

atomic quarry
#

I forgot to put that

tepid hedge
quartz kindle
#

where did you add it?

atomic quarry
tepid hedge
#
    if(err) console.error(err);

    let jsfiles = files.filter(f => f.split(".").pop() === "js");
    if(jsfiles.length <= 0) {
        console.log("No commands to load!");
        return;
    }

    console.log(`Loading ${jsfiles.length} commands!`);

    jsfiles.forEach((f, i) => {
        let props = require(`./cmds/${f}`);
        console.log(`${i + 1}: ${f} loaded!`);
        bot.commands.set(props.help.name, props);
    });
});

console.log(props)
quartz kindle
#

/facepalm

atomic quarry
#

🤦‍♂️

quartz kindle
#

@tepid hedge you're supposed to add it on the line after you define it

#

let props = require(...)
console.log(props)

tepid hedge
quartz kindle
#

@atomic quarry your client.login() is inside your purge command lol

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

@tepid hedge that command doesnt have a help field

atomic quarry
#

oof

tepid hedge
#

yeah because thats not a command

#

thats the handler

quartz kindle
#

are your handlers also in the cmds folder?

tepid hedge
#

no

#

the handler is in the main file, in this case bot.js

quartz kindle
#

i mean

#

ban.js

#

the file ban.js doesnt have a help field

tepid hedge
quartz kindle
#

yes

tepid hedge
#

thats been in there

quartz kindle
#

did you save it? because its not detecting it

tepid hedge
#

yes

quartz kindle
#

check your other files

#

it only shows run, not help

tepid hedge
#

they all have it in there as well

quartz kindle
#

well, its not finding them

#

show the ban file

tepid hedge
#

too long

#

one sec

quartz kindle
#

weird

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

not that lol

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

anyways @tepid hedge comment out the bot.commands.set line

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

that has nothing to do with the issue lol

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

tepid hedge
#

I did that @quartz kindle still nothing

#

well

quartz kindle
#

what did the console show

tepid hedge
#

All the commands loaded

#

but just didnt work

quartz kindle
#

with the console.log(props)

tepid hedge
#

without

quartz kindle
#

make it with

#

i want to see

tepid hedge
quartz kindle
#

ok, so ban and icon have help fields

#

the others dont

#

when it reaches a file without a help field, it throws an error because of it

tepid hedge
#

they do though

#
    let users = bot.users;

    let searchTerm = args[0];
    if(!searchTerm) return message.channel.send("Please provide a search term.");

    let matches = users.filter(u => u.tag.toLowerCase().includes(searchTerm.toLowerCase()));

    message.channel.send(matches.map(u => u.tag).join(", "));
}

module.exports.help = {
    name: "findusers"
}```
#

This is findusers.js

#

and it has it

atomic quarry
#

So I'm having trouble fixing the "client.login" thing

quartz kindle
#

well, for some reason its not finding it

#

make sure its properly saved

#

and in the correct folder

tepid hedge
#

did and still the same

quartz kindle
#

did it show up in the console at least?

tepid hedge
#

fixed it

#

I didnt have const Discord = require("discord.js"); const client = new Discord.Client(); at the top

#

even though that wasnt there for icon but it still worked

#

but it fixed it for find users

#

nvm thats not why

quartz kindle
#

thats not needed

tepid hedge
#

I have everything except unban working now

#

nvm got it all now

quartz kindle
#

they all have the help now right?

tepid hedge
#

Yep

quartz kindle
#

so go ahead and uncomment the commands.set line

tepid hedge
#
    if(message.author.bot) return;
    if(message.channel.type === "dm") return;



    let messageArray = message.content.split(/\s+/g);
    let command = messageArray[0];
    let args = messageArray.slice(1);

    if(!command.startsWith(prefix)) return;

    let limit = bot.ratelimits.get(message.author.id);
    let now = Date.now();
    let timeLimit = 2000;

    if(limit != null) {
        if(limit >= now - timeLimit) {
            message.delete();
            return message.channel.send("You are being ratelimited. Try again in `" + (Math.abs((now - limit) - timeLimit) / 1000).toFixed(2) + "` seconds.").then(m => m.delete(2000));
        } else {
            bot.ratelimits.set(message.author.id, now);
        }
    } else {
        bot.ratelimits.set(message.author.id, now);
    }

    let cmd = bot.commands.get(command.slice(prefix.length));
    if(cmd) cmd.run(bot, message, args, con);
});
quartz kindle
#

whats line 98?

tepid hedge
#

line 98 is second to last line

quartz kindle
#

what is that doing there?

#

remove it

#

the ,con part

tepid hedge
#

fixed i just took it out

#

everything works now

#

ty

quartz kindle
#

👍

atomic quarry
#

Tim how do I fix the problem I'm having

quartz kindle
#

put your login line in the correct place lol

#

im gonna go sleep now, cya

tepid hedge
#

@quartz kindle one last thing, the ban command im using is a modified mute command, how do I know if the time is working properly? Everything is a day plus so I used this: time: Date.now() + parseInt(args[1]) * 1000*60*60*24 originally it was 1000 alone for seconds, but i've been told doing 60(minute) another 60(hour) and 24(day) will work. Is that correct?

atomic quarry
#

Can somone please help me I cannot figure out what tf is wrong with my code

tepid hedge
#

Can you send it again?

tepid hedge
#

What is the error?

#

@atomic quarry

atomic quarry
#

Well the Bot won't sign in

tepid hedge
#

have you made sure your token is correct?

#

And that you are copying a token and not ID

atomic quarry
#

Yes I'm pretty sure

tepid hedge
#

Is your token number or numbers and letters

atomic quarry
#

Both

#

I mean I'll check it again and make sure it's correct

tepid hedge
#

Where is it not logging into, discord or rblx

atomic quarry
#

The discord bot itself isn't logging in

prime cliff
#

Which lib do you use? You can enable logging to see why it's not logging in

earnest phoenix
#

make sure you're actually using the token and not the client secret

sudden geyser
#

The problem is the way it's formatted

#

There's even a message listener inside a message listener for the purge command (unless I'm missing something)

atomic quarry
#

oof

prime cliff
#

Yea why do you have 2 on message events anyway thonK

modest maple
#

Got a point

#

And interesting way of doing it

atomic quarry
#

To be honest I don't know

#

So how do I change that?

valid frigate
#

have one

atomic quarry
#

Well I don't know which one I have to delete

valid frigate
#

you need to change your code so you only have uno

#

so it doesn't matter really

atomic quarry
#

ok

dense patio
#

does anyone know how to make a cooldown that shows how long is left when you try the command again? (discord.js)
please ping me if you respond

sudden geyser
#

@dense patio save a map or some key-value pair as userID: timeLeft then format it.

#

For example,

let cooldown = new Map();
cooldown.set("264811613708746752", 3000); // 3 seconds for this command.

if (cooldown includes user ID) {
  // Make your better version of this
  respond(`Try again in ${(Date.now() + getCooldowntime - Date.now()).toFixed}`)
}```
dense patio
#

oh I see, thanks a lot

west raptor
earnest phoenix
#

i'm new to bots, and i have a pretty beginner question, if anyone would be so kind as to let me know what i'm doing wrong. i'm using basically boilerplate code:

var auth = require('./auth.json');

// Initialize Discord Bot
var bot = new Discord.Client({
   token: auth.token,
   autorun: true
});

console.log("test")

bot.on('ready', function (evt) {
    console.log('Connected');
    console.log('Logged in as: ');
    console.log(bot.username + ' - (' + bot.id + ')');
});

bot.on('message', function (user, userID, channelID, message, evt) {
    // Our bot needs to know if it will execute a command
    // It will listen for messages that will start with `!`
    if (message.substring(0, 1) == '!') {
        var args = message.substring(1).split(' ');
        var cmd = args[0];
       
        args = args.splice(1);
        switch(cmd) {
            // !ping
            case 'ping':
                bot.sendMessage({
                    to: channelID,
                    message: 'Pong!'
                });
            break;
            // Just add any case commands if you want to..
         }
     }
});```
for some reason when i run it on node it just opens and closes right away:
```$ node bot.js 
test
$ ```

i'm clearly missing something obvious. anyone wanna tell me what it is?
west raptor
#

I recommend referring to that if you're having trouble

#

Please use a code block

#

use ```

#

not just one `

earnest phoenix
#

aye aye

west raptor
#

thank you

#

the message event only emits message

#

with the message object

#

function (...) should be function (message)

#

oh wait

loud salmon
west raptor
#

it's extremely outdated

earnest phoenix
#

oh

west raptor
#
#

It has a good getting started guide

earnest phoenix
#

i'll read up on it!

#

thank you so much!

west raptor
#

No problem

earnest phoenix
#

lol something was wrong with my token so a new token fixed it. i did switch over to discord.js tho and it seems much better so far!

west raptor
#

alright cool

slim heart
#

how do you update status?
{op: 3, d: {game: {name: 'test', type: 0}}, t: 'UPDATE_STATUS', s: shard.s} i was doing this but it doesnt work

analog roost
#

because im dumb and do not have the smarts how do you shard a bot

fluid basin
#

@slim heart raw dapi?

slim heart
#

yeah

fluid basin
#
{
  "since": 91879201, 
  "game": {
     "name": "Save the Oxford Comma", 
     "type": 0
  }, 
  "status": "online",
  "afk": false
}
#

missing status info

analog roost
#

what should I type to shard my bot

fluid basin
#

@slim heart

analog roost
#

i tryed and it broke

slim heart
#

yeah just learned it wasnt optional lol

fluid basin
#

all are required except since and game

#

yeah u didnt have status field and afk field

earnest phoenix
#

@scenic kelp wanna freestyle?

scenic kelp
analog roost
#

so I have a question

vital lark
#

and I have an answer

analog roost
#

lol

sudden geyser
#

hopefully

analog roost
#

ok so when I try to change the status and try to make it say KB!

#

I use this line do not know if it is right

#
client.user.setActivity("KB!");```
vital lark
#

is there an error thrown when you run it?

#

or it doesn't work at all

analog roost
#

lets see

#

ReferenceError: client is not defined

#

:\

vital lark
#

is client defined in your code?

analog roost
#

hangon

#

yess

#

the bot does not run at all

vital lark
#

can I see your code

analog roost
#

ok hangon brb gotta go do something

#

ok so just copy and paste it?

vital lark
#

copy and paste what

analog roost
#

codin

vital lark
#

just copy and paste the definitons and ready event

analog roost
#

k

#

I feel wrong when i look at this so much

#
    console.log('Keko bot online!!!!!');
    client.user.setActivity("KB!"); 

});```
vital lark
#

hmm

#

which library & version you are using

analog roost
#

im using discord.js

vital lark
#

master (12.x) or stable (11.x)

analog roost
#

11.x

vital lark
#

so you're using discord.js v11.5.1?

analog roost
#

Hangon

#

visual studio codees

#

and llets seeee

vital lark
#

just check your package.json in the dependencies object

analog roost
#

alright

#

"dependencies": {

vital lark
#

is that all?

analog roost
#

wrong thing srry

#

i will just show this whole thing to you

#
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "O So",
  "license": "ISC",
  "dependencies": {
    "discord.js": "^11.5.1",
    "ms": "^2.1.2"
  }```
vital lark
#

so you are using discord.js v11.5.1

analog roost
#

yes

vital lark
analog roost
#

in the entire package json?

vital lark
#

no

#

your main file

analog roost
#

that is what i meant to say

#

no it is not

vital lark
#

hmm

analog roost
#

rip for your brain rn

sudden geyser
#

@analog roost client =/= bot

analog roost
#

okk

analog roost
#

@vital lark add me so I can send you this

atomic quarry
#

/home/runner/index.js:105
return message.channel.send({
^^^^^^

SyntaxError: Illegal return statement

analog roost
#

?

atomic quarry
#

That is something I need help with

analog roost
#

ohhhh

atomic quarry
#

Yeah

analog roost
#

I am still trying to fix something to

atomic quarry
#

What's your problem?

#

Whats your code?

#

Use that

analog roost
#

hangon think I just fixed it

atomic quarry
#

Ok

valid frigate
#

what's your problem

#

oh right

atomic quarry
#

/home/runner/index.js:105
return message.channel.send({
^^^^^^

SyntaxError: Illegal return statement

valid frigate
#

yes i saw

#

is your if statement a valid if statement though

#

to me it looks like you're missing {}

atomic quarry
#

hmm

valid frigate
#

you can omit brackets if it's on one line

#

like if(cond) func()

#

otherwise you need the {}, which i assume you don't have so add it and see what happens

atomic quarry
#

ok

analog roost
#

what do i need to do to make the bot say as its custom status "watching you"

atomic quarry
#

Yeah I can't get it Vysion

#

I don't know I can't get that code fixed

restive furnace
#

func(params) {}

valid frigate
#

?

atomic quarry
#

I don't even know

dusky marsh
#

What is that planning/outline website people use to plan their projects and the steps they need to accomplish?

valid frigate
#

trello™️

dusky marsh
#

Ah yes

#

Thank you

atomic quarry
#

Yeah I give up

wheat jolt
#

How does the Invite Manager finds out who invited a new member in a guild

prime cliff
#

It checks the created invites and when a new user joins it finds the invite that was just increased

earnest phoenix
#

which is how it got api banned when api bans for an hour were introduced loool

lament meteor
#

what

modest maple
#

Invite manager the normal one pushes API rate limits alot

earnest phoenix
#

Discord.js-commando is more simple or more complex than discord.js?

mossy vine
#

bloat

#

imo it doesnt offer anything more than your own command handler

restive furnace
#

d.js better

#

cuz u can make ur custom cmd handler

earnest phoenix
#

But commando has a built-in one

modest maple
#

No language is subjectively better

restive furnace
#

@earnest phoenix but its mehh... i rn have better one than commando

#

aliases, msg collecting, reaction collecting, etc.

fluid basin
#

commando is d.js

mossy vine
#

commando is legit a command handler

empty owl
#

hey

#

client.on('messageReactionAdd', async (reaction, user) => {
  console.log("yes")
     if (user.bot) return;
  
      if (reaction.message.channel.id !== "656680566481092608") return;
  
      if (reaction.emoji !== "❌") return;
  console.log(reaction.emoji)
      if (reaction.message.reactions.get("❌").size === 2) {
        reaction.message.delete()
        client.channels.get("626198959924183040").send("Message was deleted.")
        client.channels.get("626198959924183040").send(reaction.message.content)
        
      }
  
});```
#

im tryna delete a message after 2 reactions

#

well not really 2 but for an example

radiant jay
#

any error?

empty owl
#

no

#

wait