#development

1 messages · Page 1223 of 1

thick gull
#

wait I didn’t even think about that

vale garden
#

ok wtf

#

it didnt work

#

no cuz i need 4 players

#

lol

#

its a 4 player game

cinder patio
#

You can do that with one collector

vale garden
#

how

#

howwwww

cinder patio
#

All collectors are collecting at the same time

#

Just because one is after the other doesn't mean it will be collected after

vale garden
#

oh

#

should i just add await to the collector.on or what

cinder patio
#

Also, your filter only accepts messages by the one doing the intial command

vale garden
#

wait whatttt

#

how do i define it as the person who says ready

#

cuz i thought message.author was the author of the message collected

cinder patio
#

m is the author of the collected message, message would be the author of the command message

vale garden
#

oh

#

kk

#

how do i collect many message from 1 collector

#

plz

#

tell

#

me

cinder patio
#

I mean, you just have one collector

#

that's it

vale garden
#

what

thick gull
#

sell your soul to discord js gods and they’ll do it for you

vale garden
#

lol

#

how do i like restrict it to 4

#

also

#

since

cinder patio
#

You don't have to do anything. Just remove 3 of the collectors, and now you are collecting messages from one collector

vale garden
#

ok wait nvm

#

no but like i need a max limit of 4

thick gull
#

i use await messages mmulu

vale garden
#

like how do i make it not collect more than 4

cinder patio
#

Where do you keep your players?

opal plank
#

omg wtf

vale garden
#

wdym where

cinder patio
#

You can do max: 4 in the options

vale garden
#

oh

#

oh wait yea

#

lmao

thick gull
#

check if it’s the same person though

#

😩

cinder patio
#

Also your filter should accept only messages which have the content "ready"

opal plank
#

you also can use a single collector

#

and a single filter

cinder patio
#

Already went over that

opal plank
#

aight

vale garden
#

thxx a lot

weak rain
#

Why arent u a verified bot dev? @opal plank

opal plank
#

mainly cuz i delete my small guilds

#

i got my message LOONG ago

thick gull
#

why aren’t you a discord staff member atThunder

opal plank
#

even though im at 54 guilds rn

earnest phoenix
#

How do you get the verified dev badge?

opal plank
#

you dont

sand condor
#

you can't anymore

#

who gave me green role

opal plank
#

you got your bot verified, have u not?

sand condor
#

ye but my other acc got deleted here

#

so i was a white name

weak rain
sand condor
#

no clue how i got green role i didn't resubmit

opal plank
#

im not sure then

vale garden
#

ok what did i do

opal plank
#

idk, what did u do?

vale garden
#
const filter = m => m.author.id === message.author.id

const collector = message.channel.createMessageCollector(filter, { time: 15000, max: 4 });

message.channel.send("Type `ready` to enter the game");

collector.on('collect', m => {

if (m.content == "ready" && m.author.id) {
m.author.send("test")
}})

collector.on('end', collected => {
  message.channel.send("Collected messages from all 4 players")
});

#

lol

#

so i reduced my code to this

#

but now it is only dming the message.author

cinder patio
#

Your filter

thick gull
#

I meant

vale garden
#

i removed the message.author so like

#

it should work right

cinder patio
#

Only accepts messages from the message author

thick gull
#

check if they already have been chosen

vale garden
#

wait no wtf

#

i didnt remove it

#

bruh i am dumb

thick gull
#

don’t limit to one person

vale garden
#

lol

#

i thought i removed that

#

ooof

cinder patio
#

Also yeah, multple people can do ready and get in, so you should keep people who are in in a map or an array

vale garden
#

wdym

#

it is limited to 4

#

right so

#

it will only let 4

thick gull
#

yes but that 4 can be

#

the same person

copper cradle
#

just make sure I can't join twice

vale garden
#

oh kk

#

wait but making an array wont fix that

#

right

#

lol

#

cuz it would just display same guy 4 times

thick gull
#

let users = []
// collector
// check users for author
users.push(author)

vale garden
#

kk

thick gull
#

don’t copy it

#

just

#

yea

vale garden
#

lol ok

cinder patio
#

A Set would be better in this case, or a map

copper cradle
#

make a map or an array, then add any user that joins to the array, but before that check if the user is already in the list, if they are then send an error message, if they're not then add them

thick gull
#

I mean

#

an array works

#

¯_(ツ)_/¯

copper cradle
#

use a hashmap

thick gull
misty sigil
copper cradle
#

lmao

vale garden
#

lol

thick gull
#

@misty sigil add a clarification that mongo is Bson vs Json

#

cause it’s a common thing

#

that people say

misty sigil
#

look we aren’t comparing types of db

thick gull
#

no shush

misty sigil
#

just saying which is better

cinder patio
#

quick.db uses sqlite3

cerulean salmon
#

whats wrong here ? 👀

vale garden
#

hi im back

#
let users = new Map();

    const filter = m => m.author.id

const collector = message.channel.createMessageCollector(filter, { time: 15000, max: 4 });

message.channel.send("Type `ready` to enter the game");

collector.on('collect', m => {

if (m.content == "ready" && m.author.id) {
m.author.send("test")
}})

collector.on('end', collected => {
  message.channel.send("Collected messages from all 4 players")
});

users.set(m.author.username, 1)
users.set(m.author.username, 2)
users.set(m.author.username, 3)
users.set(m.author.username, 4)

console.log(users)

#

this might be wrong

opal plank
#

@cerulean salmon 3 dots

#

wtf

vale garden
#

but

#

wat

opal plank
#

../../ iirc

cerulean salmon
#

@cerulean salmon 3 dots
@opal plank i tried with all combination 1,2,3

#

😅

vale garden
#

in my code it says m is not defined

#

how

#

do

#

i

opal plank
#

@cerulean salmon its not a combination, you gotta learn relative path

vale garden
#

fix this

#

plz help

cinder patio
#

Multi, use your brain

#

geez

opal plank
cinder patio
#

You should set the user in the map inside the collect event, inside the if statement

cerulean salmon
#

@opal plank not worked 😦

#

i tried that one too

opal plank
#

@cerulean salmon again, its 2 ../

#

../ is parent folder

#

./ is working dir

#

none is also targeting same dir

#

though require looks for module without it

cerulean salmon
#

🤦

misty sigil
#

it’s ../../

dire obsidian
#

Someone knows how make a 404 screen?

cerulean salmon
#

@misty sigil ty

dire obsidian
#

Well actually how make if the page dont exist shows the custom 404 error page

restive furnace
#
thick gull
#

nice

opaque seal
#

Can anyone help me, my bot wont login into discord and I have no idea of what it could be...
It was fine until today, it just launches the first shard and then it fails at client.login()

thick gull
#

errors?

opaque seal
#

just the shard error: Shard 0's Client took too long to become ready.

thick gull
#

are you on v11?

opaque seal
#

no v12

thick gull
#

hm

opaque seal
#

the fact is that it has always worked fine

#

and today it just stopped

thick gull
#

try another token, idk it happened to someone else earlier

#

they said it was only for that one token

opaque seal
#

I tried resetting the token already

#

didn't fix the issue

misty sigil
#

try client.on("debug", console.log)

#

give us the info from there

opaque seal
#

I thought I was short on ram so I even added ram to the vps lol

misty sigil
#

lol

opaque seal
#

one sec

manic osprey
#

hi

opaque seal
#
Launched shard 0
0|index    | Provided token: NzM5Nzk2NjI3NjgxODM3MDY3.XyfrTA.***************************
0|index    | Preparing to connect to the gateway...
0|index    | Mongoose connection successfully opened!
0|index    | [WS => Manager] Fetched Gateway Information
0|index    |     URL: wss://gateway.discord.gg
0|index    |     Recommended Shards: 1
0|index    | [WS => Manager] Session Limit Information
0|index    |     Total: 1000
0|index    |     Remaining: 0
0|index    | [WS => Manager] Spawning shards: 0
0|index    | [WS => Manager] Exceeded identify threshold. Will attempt a connection in 66446972ms```
@misty sigil
misty sigil
#

ah

#

doesnt that mean ratelimits

#

try again tomorrow

opaque seal
#

how could I possibly get rate limited

#

My bot doesn't do much and it has all the needed cooldowns

misty sigil
#

restarting too much is one way

opaque seal
#

ah

#

don't think so thought

#

*that I restarted much

#

I just restarted it once

vale garden
#
    let users = new Map();

    const filter = m => m.author.id

const collector = message.channel.createMessageCollector(filter, { time: 15000, max: 4 });

message.channel.send("Type `ready` to enter the game");

collector.on('collect', m => {

if (m.content === "ready" && m.author.id) {
m.author.send("test")

users.set(m.author.username, 1)
users.set(m.author.username, 2)
users.set(m.author.username, 3)
users.set(m.author.username, 4)


}})

collector.on('end', collected => {
  message.channel.send("Collected messages from all 4 players")
});

console.log(users)
#

ok now why is this not working

#

i actually dont get it

#

the map is empty

eternal osprey
#

hey what is wrong with my bot here

#

for some reason i cannot use $po sunny

#

and if i type $po weather types it returns me the embed and lots of error codes with it.

vale garden
#

btw forget my question

#

lol

eternal osprey
#

no-one that could help?

earnest phoenix
#

that feeling when you finally figure out how to use canvas:CS_AlphabetYCS_AlphabetECS_AlphabetSpogey yeetuswigglewigglerollonthefloor||nitro flexnitro||

#

lol my bot db was just held for btc ransom

split holly
#

Bruh

manic osprey
#

hello

earnest phoenix
#

i accidently commited creds to private repo...thats only way i can think...but how did they get info from private repo

vale garden
#
module.exports = {
  name: 'cards',
  description: "still under constuction",
  async execute(message, args) {

    let users = new Map();

    const filter = m => m.author.id

const collector = message.channel.createMessageCollector(filter, { time: 15000, max: 4 });

message.channel.send("Type `ready` to enter the game");

collector.on('collect', m => {

if (m.content === "ready" && m.author.id) {
m.author.send("test")

console.log(m.author.username)

/*users.set(m.author.username, 1)
.then(() => users.set(m.author.username, 2))
.then(() => users.set(m.author.username, 3))
.then(() => users.set(m.author.username, 4))*/

await users.set(m.author.username, 1)
await users.set(m.author.username, 2)
await users.set(m.author.username, 3)
await users.set(m.author.username, 4)



}})

collector.on('end', collected => {
  message.channel.send("Collected messages from all 4 players")
});

console.log(users)


  }
}



#

how

#

is this

#

bruh

#

it says await is only valid in async function

#

wtfff

nimble kiln
#

Yeah

wary flame
#

Youre not in async context

nimble kiln
wary flame
#

^

nimble kiln
#

'collect', async m =>

#

I believe it was

wary flame
#

Also use tabs/spaces to format your code

vale garden
#

ohhhhhhhhhh

stable nimbus
#

I'm trying to get my code to detect if a number (any length) is provided for a command, here is my current code:

const server = args[0];
        const text = args.slice(1).join(' ');
        if(!server || server != Number){
            const embed = new MessageEmbed()
            .setAuthor(message.member.displayName, message.author.displayAvatarURL())
            .setTitle(":warning: Error in: Server Number :warning:")
misty sigil
#

server is a string

#

you need to turn it into a Number

#

isNaN() also works too

cinder patio
#

Multi, why are you setting it 4 times? Completely pointless, also, Map.set does not return a promise so no point using async/await

misty sigil
gentle oxide
#

I want to add an embed that says ping: and memory used:

#

In Python

#

Help me

#

Please

chilly bison
#

@gentle oxide search google

#

and then you can convert it using

gentle oxide
#

I can't find it anywhere that's why I'm writing it here in case you can help me

chilly bison
#

you can convert it using this code

#
import math

def convert_size(size_bytes):
   if size_bytes == 0:
       return "0B"
   size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
   i = int(math.floor(math.log(size_bytes, 1024)))
   p = math.pow(1024, i)
   s = round(size_bytes / p, 2)
   return "%s %s" % (s, size_name[i])
gentle oxide
#

@chilly bison and what would it say where is the emoji 👀

Ping🏓
Latency:
100ms
Memory Ram:
👀mb

#

what command?

chilly bison
#

idk

#

u decide

#

I have a easy-to-use dahboard for my bots

gentle oxide
#

What is?

midnight blaze
#

can someone help me with this..

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://discord.com/channels/237367938242445322/237367938242445322
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
//class="username-1A8OIy clickable-1bVtEA focusable-1YV_-H"

(function() {
    'use strict';
//class="username-1A8OIy clickable-1bVtEA focusable-1YV_-H"
    for (var i = 0; i < document.getElementsByClassName("username-1A8OIy clickable-1bVtEA focusable-1YV_-H").length; i++) {
        if (document.getElementsByClassName("username-1A8OIy clickable-1bVtEA focusable-1YV_-H")[i].textContent == "Obliterous") {
       document.getElementsByClassName("username-1A8OIy clickable-1bVtEA focusable-1YV_-H")[i].textContent == "blocked"

            
           
  }
}
})();

I am still not able to replace the name of someone

#

with tampermonkey

gentle oxide
#

Is Python?

midnight blaze
chilly bison
#

@midnight blaze try .innerText instead

midnight blaze
#

didnt work

gentle oxide
#

then I don't know xD would you tell me what command I can put with the python language to know the memory used by my bot in an embed message

midnight blaze
#

I tried that as well

#

@pale vessel

chilly bison
#

try

if(item[i].innerText.trim().toLowerCase() == "name of blocked person"){
item[i].innerText = "blocked";
}
midnight blaze
#

thanks, let me try it out

chilly bison
#

then I don't know xD would you tell me what command I can put with the python language to know the memory used by my bot in an embed message
@gentle oxide be creative lol

#

<prefix>botstats maybe?

gentle oxide
#

Yes

chilly bison
#

k

midnight blaze
#

doesnt work as well

gentle oxide
#

but to tell me the memory used and the latency of the bot when I press <prefix>botstats

midnight blaze
#

@quartz kindle pls help man xD

gentle oxide
#

?

#

but to tell me the memory used and the latency of the bot when I press <prefix>botstats

#

then I don't know xD would you tell me what command I can put with the python language to know the memory used by my bot in an embed message

#

Please help me

#

In python language

#

@quartz kindle

earnest phoenix
#

don't ping random people except tim

slender thistle
#

What's the issue you are facing

#

I thought you were given code to enter to implement your requested feature

plucky harness
#

the \n doesnt work on iphone devices as it doent display text in next line or is it iphones discord apps fault
on andriod and pc \n displays in next line
but in ios app it doesnt

faint prism
#

Ya boy got approved!
Also, I've hit an issue with the massive amount of people on this server.
Sorting through 100k people makes for at least one of my commands to have a 40s response time

gentle oxide
#

my problem was not solved

opaque seal
#

What should I use as a cache database? js

#

Like a "RAM" database

rare gale
#

im trying to find out how to send a DM using discord.js 🤣

prime glacier
#

i had created application bot i want to do if someone attach picture in bot's dm bot send it to (MENTIONED channell) channel

misty sigil
#

Like a "RAM" database
@opaque seal I use a map

thick gull
#

Matthew here to delete you

misty sigil
#

im trying to find out how to send a DM using discord.js 🤣
@rare gale <user>.send

rare gale
#

any ideas on how to send a DM using discord.js?

thick gull
#

above you

misty sigil
#

@thick gull they say it’s caching some stuff from main db

rare gale
#

thanks mathew

misty sigil
#

it’s fine, I do that

thick gull
#

ohok

#

I thought he meant

#

like

#

entirely in

#

ram

opaque seal
#

@opaque seal I use a map
@misty sigil I'm using discord.js Collection but I think it's not quite the best option

misty sigil
#

map is basically the same

stable nimbus
#

server is a string
@misty sigil The reason why I say server is because that links to a number needed for command output. I made a roleplay bot for GTAV and RDR2 roleplay.

thick gull
#

@misty sigil how make json

misty sigil
#

I gave u the

thick gull
misty sigil
stable nimbus
#

I know I just wanted to mention that.

opaque seal
#

map is basically the same
@misty sigil one guy told me to use redis

midnight blaze
#
// ==UserScript==
// @name         Leon macht sachen mit discordusern
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  niemand mag tsumo
// @author       Pauli
// @match        https://discord.com/channels/237367938242445322/237367938242445322
// @match         https://discord.com/channels/@me
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    setTimeout(() => {

        let search = 'Noel';

        let epple = Array.from(document.querySelectorAll('div')).find(el => el.innerText === 'Noel');

        epple.setAttribute("style", "background-color: gold");

        console.log("this is epple", epple);

    }, 5000);
})();

this worked, but when I change div to span to access this in the chat, it still doesnt work

#

Has anyone here some experience with html?

rare gale
#

kind of yeah @midnight blaze

midnight blaze
#

have you ever worked with tampermonkey? And idea why this doesnt work on the normal chat?

rare gale
#

ok that i dont have a clue sorry 🤣

#

u know how to use js?

midnight blaze
#

are u kidding me?

#

yes

#

I do how to use js

#

anyone here who has some serious experience?

rare gale
#

i dont even know how to send messages to dm's. been trying to find that out for 2 hours 🤣

oak cliff
#

user.send ?

stable nimbus
#

^

midnight blaze
#

there must be someone who used tampermonkey

#

ffs

misty sigil
#

it’s user.send

#

good work xiuh ur correct

oak cliff
#

I've used tampermonkey but idk how it works lol

midnight blaze
#

rip xd

stable nimbus
#

I never touched it.

oak cliff
#

I just copied stuff from other people

midnight blaze
#

nvm I worked it out

#

thanks tho

rare gale
#

user.send ?
@oak cliff i tried that, it said invalid something

oak cliff
#

Is your user defined?

#

They may have dms closed

#

I've never done it myself

stable nimbus
#

Either their DM's are closed or its not defined.

#

I use user.send all the time.

rare gale
#

no im trying to do like -help
then it sends a message to dm

misty sigil
#

user.send is valid

#

user.send is valid

#

user.send is valid

#

fuck discord man

thick gull
#

spammer!1!1!1!

stable nimbus
#

How did you define user.send?

misty sigil
#

no im trying to do like -help
then it sends a message to dm
@rare gale <message>.author.send()

stable nimbus
#

Let me try that again

thick gull
#

did you just write user.send without thinking

rough lodge
#

Hello i dont know htm or css... I want create a description can someone help me out?

rare gale
#

@rare gale <message>.author.send()
@misty sigil thanks, ill try

stable nimbus
#

How did you define user?

thick gull
#

user should be the target

misty sigil
#

<message>.author replaces <user>

stable nimbus
#

That too.

rough lodge
#

Hello i dont know htm or css... I want create a description can someone help me out?
@rough lodge i even dont know basics

stable nimbus
#

I know basics but is easier to google things.

#

Use W3 school website.

faint prism
#

I mean, that's how you learn

rough lodge
#

Ok ;-; i guess it will take time so yeah thanks

stable nimbus
#

It took me a long time to learn the basics man, I know what its like.

rare gale
#

TypeError: client.send is not a function
thats what it says

stable nimbus
#

Code?

rare gale
#

wym?

stable nimbus
#

Whats your code?

rare gale
#

u mean like what is it meant to be doing
sorry im a noob

stable nimbus
#

Show me the code you wrote for the command.

rare gale
#

ok it may be incorrect so dont make fun

stable nimbus
#
.setAuthor(message.member.displayName, message.author.displayAvatarURL())
            .setTitle(`:warning: Error in: Server Number :warning:`)
            .setColor(0xFFD700)
            .setDescription(`Hey <@${message.author.id}>! I see you're trying to dispatch !`)
            .setFooter(copyright.copyright);
            message.delete();
            message.channel.send(`Hey <@${message.author.id}>`)
#

Could look something like that.

rare gale
#

oh no...

stable nimbus
#

Show me you're code bud, I promise I won't make fun. I was just as new as you a few months ago.

rare gale
#

f(message.content.startsWith(${prefix}help)) {
client.send("{prefix}help -- gives this message")
("{prefix}kick @mention -- kicks the mentioned person (have to have kick permission")
("prefix}ban @mention -- bans the mentioned person (have to have the ban permission")

}

})

#

LOL

stable nimbus
#

Okay, I see where you're at. You'll need to do message.author.send or you need to define a user which is a boolean, you'll need that if you need to prevent things happening to bots like I. Easy to define user.

rare gale
#

ok, ill try it, thanks for helping 😄

stable nimbus
#

Don't forget you need to use dollar sign when defining prefix so it calls back to your config.json if thats where you have it stored.

rare gale
#

yes

stable nimbus
#

So yeah

rare gale
#

like (${prefix}help)

stable nimbus
#
`${prefix}kick @user --- kicks a mentioned user.`
#

Thats better.

rare gale
#

yes exactly what i did with kick 🙂

stable nimbus
#

Good boy.

rare gale
#

thanks bro

stable nimbus
#

Any progress @rare gale?

jagged sun
#

Hey, what methods can I use to restart my Discord Bot in Discord.js with a command? Somehow client.destroy(), then client.login(token) does not work...

molten yarrow
#
process.exit()
nimble kiln
#

Use something to auto-restart your bot (while-true loopscript, or pm2 I think), and use that what Alina posted + a client.destroy() above it

rare gale
#

Any progress @rare gale?
@stable nimbus not really....

i may just send an embed message to the channel instead, but then again i dont know how to do a new line in an embed

molten yarrow
#

im using pm2, it just restart my Bot after process.exit()

stable nimbus
#

DM me I'll happily help.

nimble kiln
#

im using pm2, it just restart my Bot after process.exit()
@molten yarrow Yeah nono, a process.exit() will restart with pm2 - But I'd add a client.destroy() above it to log out the bot properly 🙂

prime glacier
#

i had created application bot i want to do if someone attach picture in bot's dm bot send it to (MENTIONED channell) channel
@prime glacier

molten yarrow
#

yeah true :3 im using it like once a month, its kinda enough xD

jagged sun
#
process.exit()

@molten yarrow This just exits the whole code, but I want to restart it...

nimble kiln
#

Like we said, use pm2 or a while(true)-script

molten yarrow
#

yeah read some lines above

jagged sun
#

Aaah, srryy

thick gull
#

when your bot crash loops with pm2 😩

nimble kiln
#

when your bot crash loops with pm2 😩
Oh yeah.
@jagged sun You have to watch out for that. If your bot restarts 1000 times within 24hrs the token will reset automatically

thick gull
#

just be a big boy like me and test on prod

jagged sun
#

oof

nimble kiln
#

just be a big boy like me and test on prod
Where else do you test stuff? cooldoge

thick gull
#

exactly

nimble kiln
#

oof
@jagged sun If you're using discord.js you can use client.on('debug', e => console.log(e)) to see how many restarts you have left, but it will spam your console with Heartbeat responses

jagged sun
#

Would it also be a good alternative to just restart it every 24 hours with chrontab?

nimble kiln
#

It will output it after you start your bot

thick gull
#

i mean

#

what if your bot dies at like

#

1 am

earnest phoenix
#

Hello

nimble kiln
#

Would it also be a good alternative to just restart it every 24 hours with chrontab?
Do you have a problem with your bot that requires restarting constantly? It shouldn't need that thonk

earnest phoenix
#

Can someone tell me how can I make my discord bot announce when I am live on twitch?

jagged sun
#

No not really, just for RAM freeing purposes...

nimble kiln
#

discord.js has .clear() functions to clear out cached stuff - Or maybe that's JS in general, not sure

jagged sun
#

what if your bot dies at like
@thick gull Then I would also have to restart it manually w/o chrontab

#

discord.js has .clear() functions to clear out cached stuff
@nimble kiln How do you use .clear()?

nimble kiln
#

I'm trying to find it rn 😄

earnest phoenix
#

@nimble kiln how can I make my discord bot announce when I am live on twitch?

jagged sun
#

Think u need a Twitch API for Events...

nimble kiln
#

@nimble kiln How do you use .clear()?
@jagged sun Appears to be a javascript thing.
client.users.cache.clear() empties the user cache - Same can be done with client.guilds.cache, etc.

jagged sun
#

But then you can't use/get those cleared elements in other commands, can you?

nimble kiln
#

If your bot fetches something from that cache then it wont find it, yes

#

You'll have to fetch it again

jagged sun
#

In my opinion a reboot would be way better than that

nimble kiln
#

You'll have to fetch it again
You have to test that tho, I'm not 100% sure what will happen when you do this:

client.guilds.cache.clear();
client.guilds.cache.get('guildid');

Maybe discord.js will automatically fetch it, idk

misty sigil
#

discord.js auto fetches iirc

thick gull
#

yea

#

wait i dont know

#

i think so

molten yarrow
#

didnt fetched for me, get undefined after .clear()

#
bot.guilds.cache.clear()
console.log(bot.guilds.cache.get(message.guild.id))
nimble kiln
#
client.guilds.fetch('guildid');
console.log(client.guilds.cache.get('guildid'));```
Then this should work 😄
jagged sun
#

Does pm2 also start the bot after server reboot?

molten yarrow
#

dont think so

misty sigil
#

if u do pm2 enable it does iirc

nimble kiln
jagged sun
#

Ok, but I guess crontab can start a file pm2 @reboot so that is also not a problem...

nimble kiln
#

Yes crontab can do that

#

If you have RAM issues you should look for some other library tbh, so you have more fine control over cached stuff -> and have less ram usage

jagged sun
#

Can it also start in another user in another screen, without changing into those users session?

nimble kiln
#

Just access crontab -e from that user directly and it'll run with the user

jagged sun
#

Ah, I thought there would just be one crontab for all users

heavy marsh
molten yarrow
earnest phoenix
#

Alright, im having a little trouble. Anyone know what the create channel function is for Discord.JS v12?

#

I swear im doing it right

molten yarrow
#

its guild.channels.create() in v12 i think

misty sigil
#

<guild>.channels.create()

molten yarrow
earnest phoenix
#

I swear I hate

#

V12

#

everything

#

is

#

so different

molten yarrow
#

true xD

#
guild.channels.create('new-channel', { type: 'text', permissionOverwrites: permissionOverwriteArray, reason: 'New channel added for fun!' });
earnest phoenix
#

im sitting here

#

doing createChannel();

drifting wedge
#

how do i send an image from my pc?

#

py

fringe axle
#

So I have this after I try to login with discord on my page but IDK why. He just should redirect

molten yarrow
#

do you have a "/redirect" router?

fringe axle
#

No...

#

Oh, NO WAYYYY

#

What I have to add in it @molten yarrow?

pure lion
#

Is there a way to read the content of a MessageEmbed in Discord.js?

#

@fringe axle are you using express?

fringe axle
#

ejs

#

And Node js

#

But yea, I have routers

pure lion
#

What are you using to route and stuff

fringe axle
#

ejs

opaque seal
#

How can I calculate the bytes size of a js object?

pure lion
#

Wait you can use ejs as a server? I thought it was just a view engine

molten yarrow
#

no

fringe axle
#

Nah

#

Alina, what I need to add in the Redirect File

molten yarrow
#

you need a redirect after successfull authentication

fringe axle
#

Yes

#

I know

molten yarrow
#
router.get("/redirect", passport.authenticate("discord", {
    failureRedirect: "/auth/autherror",
    successRedirect: "/"
}))
fringe axle
#

Oh

#

But I don‘t habe a /redirect file

molten yarrow
#

me nether

fringe axle
#

Okay

molten yarrow
#

this is a callback where discord redirects you

fringe axle
#

I try it

faint prism
#

I love how in Discord.NET you can type for the scope of a using statement

using (Context.Message.Channel.EnterTypingState())
{
  // Some command
}
molten yarrow
#

like localhost:port/auth/redirect

fringe axle
#

@molten yarrow can I send you my index file?

#

IDK where to add it

molten yarrow
#

i hope u dont have over 1k lines in it xDD

fringe axle
#

I zave

#

Have

#

Only 200

#

@ me if you know where and what to add

molten yarrow
#

@fringe axle
on line 120 is your callback

add after 122 successRedirect: "/"

fringe axle
#

Waiz

#

Okay

#

After line? Okay.

#

With a ,?

molten yarrow
#

after failureRedirect: "/",

manic osprey
#

hi

fringe axle
#

passport.authenticate('discord', {
failureRedirect: '/',
successRedirect: "/"
})
);

#

Like this?

molten yarrow
#

yeah and remove " , (req, res) => res.redirect('/') "

fringe axle
#

I edited it. Correct?

molten yarrow
#

try it :3 should be okay i think xD

fringe axle
#

Okas

#

Okay

#

@molten yarrow same thing...

molten yarrow
#

what callback did you add into your devportal?

fringe axle
#

Can I show the Redirect URL?

ancient nova
#

if (message.guild.members <= 5) {
message.channel.send('Your Server Has Under 5 Members And Therefore Is Recognized As A Dummy/Fake server, Bot Will Now Leave')
await message.guild.leave();
}

#

will this work?

fringe axle
#

Try and see

earnest phoenix
#

if (message.guild.members <= 5) {
message.channel.send('Your Server Has Under 5 Members And Therefore Is Recognized As A Dummy/Fake server, Bot Will Now Leave')
await message.guild.leave();
}
no

ancient nova
#

I don't wanna until I'm sure

earnest phoenix
#

it wont work

ancient nova
#

@earnest phoenix what's wrong with it?

molten yarrow
#

its ```js
guild.memberCount()

earnest phoenix
#

which djs version?

fringe axle
#

@molten yarrow you saw my image?

ancient nova
#

newest

earnest phoenix
#

message.guild.members.cache.size

molten yarrow
#

vale the /auth/callback should work tho

ancient nova
#

if (guild.memberCount() <= 5) {
message.channel.send('Your Server Has Under 5 Members And Therefore Is Recognized As A Dummy/Fake server, Bot Will Now Leave')
await message.guild.leave();
}

earnest phoenix
#

this will work

ancient nova
#

alright, better?

pure lion
#

Did someone say oauth 😧

fringe axle
#

vale the /auth/callback should work tho
@molten yarrow should

#

@molten yarrow by the way he tried to redirect to || o.zwolfy.tech:3000/redirect?code=Tzml5THpL3yn7NWptiFCxBd9QDpTm8|| after the login...

#

IDK why

pure lion
#

That's good

#

That's good

molten yarrow
#

can u remove the other two

pure lion
#

You're doing oauth my friend

#

But

fringe axle
#

can u remove the other two
@molten yarrow the other two? Only the auth/callback should stay?

pure lion
#

I store all the oauth info on my webserver

molten yarrow
#

yeah

pure lion
#

Behind a session ID

#

Which is stored in a cookie

#

So if you want security then do something like that

fringe axle
#

And Select Redirect URL?

#

What there?

#

The auth/callback?

molten yarrow
#

yeah

fringe axle
#

Okay, I‘ll try it

molten yarrow
fringe axle
#

Huh?

#

Yea looks like that

#

No

#

I used auth/callback

#

auth/redirect?

molten yarrow
#

yeah its right with /auth/callback

fringe axle
#

Hm

#

But its not working

#

@molten yarrow any idea now?

#

You there?

molten yarrow
#

maybe its your login route?

fringe axle
#

Hm

#

Should I try auth/redirect?

#

@molten yarrow by the way he tried to redirect to || o.zwolfy.tech:3000/redirect?code=Tzml5THpL3yn7NWptiFCxBd9QDpTm8|| after the login...
You saw this?

#

Why he‘s writing redirect?code= ?

misty sigil
#

it’s /redirect

fringe axle
#

Yea

#

I know

#

See?

molten yarrow
#

what redirect do you have in your ```client.config.bot.redirect

fringe axle
#

Lemme see

#

It‘s in my config.yaml

molten yarrow
#

yeah but is it the right redirect?

fringe axle
#

It is

molten yarrow
#

thats the error xD

fringe axle
#

Huh?

#

:0

molten yarrow
#

need to be the full redirect url

fringe axle
#

Uh

#

OH NO

#

XD

#

It‘s with auth/callback

#

What I need to write instead of it

molten yarrow
fringe axle
#

Oh

#

Hmm

molten yarrow
#

its still the wrong redirect

gritty bolt
#

Can someone help me define messageReminderModel?

mongoose.connect('mongodb+srv://sbss1111:Samiam1234@remindme.1q91f.mongodb.net/RemindMe?retryWrites=true&w=majority', {useNewUrlParser: true});
        const db = mongoose.connection;
        db.on('error', console.error.bind(console, 'Connection Error:'));
        db.once('open', function() {
            const messageReminderSchema = new mongoose.Schema({
                user: String,
                messageLink: String,
                time: String
            });
            global.messageReminderModel = mongoose.model('messageReminder', messageReminderSchema);
            global.messageReminder = new messageReminder({user: user, messageLink: messageLink, time: time});
            messageReminder.save(function(err) {
                console.log(err);
                console.log("Successfully saved reminder." + messageReminder);
            });
        });
    }
});
} catch (err) {
    console.log(err);
}
}

//Node-Scheduler Function
nodeSchedule: async function scheduler() {
try {
    (await messageReminderModel.find({}).forEach(data => {
        let currentUnix = Date.now()
        if(data.time <= currentUnix) remindUser()
        schedule.scheduleJob(data.time, remindUser);
    console.log("Scheduled a reminder.");
}))
} catch (err) {
    console.log(err);
}
}
}```
fringe axle
#

No

#

I changed it

#

In the config

molten yarrow
#

did you restart your server? xD

fringe axle
#

Of course I did

molten yarrow
#

you also dont need the full link in your /login route

#

try

fringe axle
#

Huh?

#

What I try?

molten yarrow
#

app.get("/login", passport.authenticate("discord"))

#

its enough

fringe axle
#

Where?

#

Ah

#

Okay

molten yarrow
#

116 - 118

fringe axle
#

Okay, you think then it‘s working? xD

#

Same

#

@molten yarrow

#

Still the same...

#

Any idea?

molten yarrow
#

its still the redirect

fringe axle
#

No

#

I restarted the server

molten yarrow
#

if i look on my ws, its shows the right redirect in the link xD

fringe axle
#

And now? :0

#

Hmm

quartz kindle
#

@gritty bolt i believe i told you already, if you define it on global, then you have to use it with global every time as well

fringe axle
#

You don‘t have a „code“ in your URL

gritty bolt
#

wdym

#

so i have to do .global?

#

or global.?

fringe axle
#

Any other idea @molten yarrow

quartz kindle
#

global.messageReminderModel

gritty bolt
#

ah ok

#

thanks

#

still undefined

#

i will note that they are both seperate functions that I am exporting into my index file

#

but i have no idea how to define it then

fringe axle
#

@molten yarrow I restarted it again. Same thing

drifting wedge
#

how can i check if my bot is the only one in a vc?

quartz kindle
#

@gritty bolt are you trying to use it immediately or only on message events or some other events?

molten yarrow
#

did you change your "/login" route?

fringe axle
#

I did

gritty bolt
#

one function is immediate, where it is defined is by event

#

which is an issue

fringe axle
#

app.get("/login", passport.authenticate("discord"))

#

The login

gritty bolt
#

is there a way I can require it in my index as well?

#

without it being in a function?

quartz kindle
#

Afaik you dont need to wait for mongo to connect to create models

#

You can create all models immediately and then connect later

drifting wedge
#

how do i send an image from my pc?

#

as the bot in py?

fringe axle
#

@molten yarrow any other idea?

molten yarrow
#

can u try changing the scopes on line 104 to
scope: ["identify", "guilds.join"]

fringe axle
#

Okay

gritty bolt
#

how do I require variables though from this file tok my index file?

quartz kindle
#

give them to module.exports

fringe axle
#

Now my friend with the access to restart the server went offline... XD

molten yarrow
#

xD

fringe axle
#

He‘s back

molten yarrow
#

create a local express server, to test stuff

fringe axle
#

@molten yarrow invalid...

#

And I changed all

#

And the server is changing i

#

it*

molten yarrow
#

but its telling in the link "o.zwolfy.tech%3A3000%2Fredirect" that your redirect is wrong

fringe axle
#

Hm

#

And now?

#

Any other idea?

molten yarrow
#

this one works fine if i edit it myself

fringe axle
#

And what I have to change?

#

:0

molten yarrow
#

check all your redirects

#

one of them is still wrong

fringe axle
#

Hm

#

Nah

#

But I do it

#

Is something wrong here?

low shard
#

Tim

fringe axle
#

app.get('/auth/callback',
passport.authenticate('discord', {
failureRedirect: '/',
successRedirect: "/"
})
);

quartz kindle
#

@fringe axle did you add the redirect url to your oauth2 in your discord developers page?

low shard
#

How I can to do status with that 1,400 Users

#

With the ,

fringe axle
#

Yes

molten yarrow
#

can u make a screen?

fringe axle
#

All is correct Alina

#

Me?

ancient nova
#

how do I make my bot leave fake servers while someone invites it? (d.js)

molten yarrow
#

from developer portal

fringe axle
low shard
#

How I can to do status with that 1,400 Users
@quartz kindle

fringe axle
#

@molten yarrow

earnest phoenix
#

Is there a good way to make the bot auto remove a vote role after being added after 12 hours? (using discord.js)
without using setTimeout/databases or something
well if i have to i can use a database but not a timer because the bot might restart

drifting wedge
#

how do i check if my bot is alone in a vc
and how do i send an image from my pc??

molten yarrow
#

looks fine tho

fringe axle
#

I know...

molten yarrow
#

maybe config?

fringe axle
#

config.yaml?

molten yarrow
#

@ancient nova
bot.guilds.cache.get(guildid).leave()

low shard
#

How I can to do status with that 1,400 Users

#

?

#

With this ,

molten yarrow
#

where you saved your stuff for DiscordStrategy

fringe axle
#

@molten yarrow should I send you the config.yaml?

ancient nova
#

@molten yarrow I don't have the fake servers Id

#

.

molten yarrow
#

yeah in dm

fringe axle
molten yarrow
#

you can log all your servers and find the IDs

ancient nova
#

if usercount in that server is below 5 then make bot leave. will that work?

fringe axle
#

@molten yarrow you see?

low shard
#

Try

molten yarrow
#

yeah

#

vale

low shard
#

I think after you do it

#

Your bot will be in 1 server

ancient nova
#

:/

molten yarrow
ancient nova
#

some dude has been inviting my bot to fake servers

#

I just want my bot to stop joining them

fringe axle
#

Okay

ancient nova
#

please help me

molten yarrow
#

loop over all server and leave if memberCount <= 5

ancient nova
#

I'vr tried

#

to do that

#

it didn't work

molten yarrow
#

show your code :3

ancient nova
#

if (bot.guild.memberCount() <= 5) {
message.channel.send('Your Server Has Under 5 Members And Therefore Is Recognized As A Dummy/Fake server, Bot Will Now Leave')
await message.guild.leave();
}

molten yarrow
#

message.guild.leave() would leave your server

#

or where the message get executed

gritty bolt
#
module.exports.messageReminderSchema = new mongoose.Schema({
    user: String,
    messageLink: String,
    time: String
});
module.exports.messageReminderModel = mongoose.model('messageReminder', module.exports.messageReminderSchema);
//This is in a function
    (await module.exports.messageReminderModel.find({}).forEach(data => {
        let currentUnix = Date.now()
        if(data.time <= currentUnix) remindUser()
        schedule.scheduleJob(data.time, remindUser);
    console.log("Scheduled a reminder.");
}))```
I keep getting that messageReminderModel is undefined
ancient nova
#

@molten yarrow I want onBotJoined

fringe axle
#

@molten yarrow still invalid...

low shard
#

How I can to do status with that 1,400 Users

ancient nova
#

when someone invites my bot to their server

low shard
#

With the ,

ancient nova
#

this executes

low shard
#

Help

ancient nova
#

and checks if the user count is below 5

#

how am I supposed to do that?

fringe axle
#

@molten yarrow the link is still invalid... ;__;

low shard
#

How I can to do status with that 1,400 Users

#

I wanna do the

#

,

molten yarrow
#

@low shard

your number.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,')
ancient nova
#

@molten yarrow

#

so, do you know?

molten yarrow
#

yeah

fringe axle
#

@molten yarrow any idea now?

ancient nova
#

could you write me a code to do that, please?

fringe axle
misty sigil
#

guildCreate event for discord.js

#

no spoonfeed

molten yarrow
#

@fringe axle like i sayed its something with your redirect url

@ancient nova add it to your guildCreate event

fringe axle
#

Huh?

ancient nova
#

..

misty sigil
#

<guild>.memberCount returns a number

#

that u can compare

drifting wedge
#

how do i send an image from my pc?

low shard
#

Attachment?

ancient nova
#

@molten yarrow can you write a script to do that though, I have no clue how to make that

misty sigil
#

no

drifting wedge
#

Attachment?
@low shard yea

molten yarrow
#

not allowed to spoonfeed here KomaNONONONO

misty sigil
#

just use client.on

fringe axle
#

@molten yarrow any idea to fix it now?

ancient nova
#

I have no clue on go HOW even make a leaving command, I made the one I've sent you but it didn't work.

misty sigil
#

bruh

ancient nova
#

I mean I can make a leaving command

low shard
#

const attachment = new Attachment(“”)
message.channel.send(attachment)
I think this

#

Try

molten yarrow
#

<guild>.leave() is already a command

ancient nova
#

but not on joined leave

fringe axle
#

D:

misty sigil
#

client.on("guildCreate", guild => {
// put stuff here
)}

#

guild is a guild object

#

so it has .memberCount

ancient nova
#

onServerJoin?

low shard
#

@drifting wedge work?

misty sigil
#

are you d.JS

ancient nova
#

so I do guild.membetCount inside that?

misty sigil
#

yes

ancient nova
#

alright.

drifting wedge
#

@drifting wedge work?
@low shard ill try

misty sigil
#

if(memberCount < desired count)return guild.leave()

drifting wedge
#

ty

low shard
#

K tell me

fringe axle
low shard
#

Work?

#

@drifting wedge

drifting wedge
#

i dont think so

#

i have file name

#

but it gives me invalid syntax

molten yarrow
#

@fringe axle do u have any other config files?

fringe axle
#

Uh, no

ancient nova
#

client.on("guildCreate", guild => {

if (guild.memberCount < 5) { message.channel.send('Fake server detected, leaving server')
guild.leave()
}

)}

#

@misty sigil

misty sigil
#

message.channel doesn’t exist

low shard
#

Give me the image name

misty sigil
#

lolmao

gentle talon
#

how do i make my bot repeat a message every 5 mins

molten yarrow
#
message.channel.send("here the message", {
          files: [{
              attachment:"path",
              name: 'name.png'
          }]
      })

@drifting wedge

drifting wedge
#

Give me the image name
@low shard 1.png

misty sigil
#

you need to get the channel and send it

ancient nova
#

@misty sigil what do you mean?

drifting wedge
#

its using pil

misty sigil
#

it’s not a message event

#

LMAO

low shard
#

Lmao

drifting wedge
#

path

#

as in the file path?

misty sigil
#

u can’t have message.channel in a guildCreate event

#

it doesn’t provide a message payload

molten yarrow
#

@gentle talon setInterval()

fringe axle
#

@molten yarrow Any other idea?

ancient nova
#

alright, thanks for your help, I'll just keep my bot unprotected. eventually I'll lose aspiration to continue developing my bot and it'll be a time wasted anyways

gentle talon
#

ok thanks

misty sigil
#

you can just remove the message.channel.send @ancient nova

ancient nova
#

@misty sigil I want an message to test it with before putting bot.leave I don't have any testing bots to test it with

livid otter
#

please give me !leave {serverid} command

misty sigil
torn pine
low shard
#

Nope

livid otter
#

i will leave my bot in blank servers

low shard
#

You need to make one

ancient nova
#

..I'll just go

misty sigil
#

bruh bots don’t need to be protected

#

server is fucking server smh

opal plank
#

unless its a bot hell, then i leave mine from those dead servers

misty sigil
#

I don’t because server is server

low shard
#

Lol

#

Mom is mom

misty sigil
#

what

#

record every message?

opal plank
#

sounds highly against tos

misty sigil
#

lmfao ikr

opal plank
#

storing end user data that isnt cached

misty sigil
#

seems a bit

opal plank
#

nor encrypted

misty sigil
ancient nova
#

@misty sigil bruh I don't wanna get wrong groth thingie or whatever some dude has been adding my bot to fake servers

#

I just wanna prevent that from happening in the future

misty sigil
#

I mean I suppose I don’t needa worry about it

#

just remove message.channel.send

opal plank
#

though you could get harmed if you are lower than 100 servers

misty sigil
#

and it’d work

#

aaaaa

ancient nova
#

how do you knoe?

#

@opal plank and yeah.

low shard
#

Use obs studio

#

To record

#

Lmao

opal plank
#

imagine a guy adds you on 100 servers, now what? you got inorganic growth and you cant verify, and now every guild that try to your bot wont be able to

#

¯_(ツ)_/¯

ancient nova
#

if you get too much fake servers discord will block you from verification.

low shard
#

Yep

gentle talon
#

@gentle talon setInterval()
@molten yarrow but how do you type it in?

low shard
#

But now you cant get the badge

#

Only the v

opal plank
#

doesnt matter

ancient nova
#

THATS WHAT IM TRYING TO PREVENT HERE

opal plank
#

we aint doing it for the badge

#

its not about the badge

misty sigil
#

we’re doing it to grow over 100 servers

ancient nova
#

I'm doing it not to lose my months of work bruh

misty sigil
ancient nova
#

client.on("guildCreate", guild => { if(guild.memberCount < 5)return guild.leave() )}

opal plank
#

MeeShits and Rythm, wait for me, i'll take over

ancient nova
#

you sure this will work?

misty sigil
#

yea it should

ancient nova
#

100% sure?

opal plank
#

thats bad design though

drifting wedge
#

how can i get the link of an image in my pc?

#

like should i upload it somehwre?

gentle talon
#

right click it then click copy image adress

opal plank
#

these are my settings for auto leave

molten yarrow
#

@gentle talon

const interval = setInterval(() => {
//your code
}, 300000); //5min

//clearInterval(interval); to stop it
drifting wedge
#

right click it then click copy image adress
@gentle talon its in my pc

misty sigil
#

100% sure?
@ancient nova yes

drifting wedge
#

like i have image name

#

and that stuff

ancient nova
#

:<

gentle talon
#

ah ok thanks @molten yarrow

ancient nova
#

alright.

opal plank
#

within the idle timer, if server doesnt send 20 messages AND doesnt use 5+ commands AND has less than 10 members, it leaves

#

im not interested in dead servers

#

¯_(ツ)_/¯

#

just saturates the bot statistics

misty sigil
#

I am interested in them

#

mainly cuz cba to leave them

#

and they add a server so Shrug

opal plank
#

hence why i automated it

#

we dont get badges anymore, no reason to fake growth

ancient nova
#

should I change client to bot?

opal plank
misty sigil
#

yea but

opal plank
#

doesnt matter

#

its only a variable

misty sigil
#

should I change client to bot?
@ancient nova if ur client instance is called bot, yes

opal plank
#

you can nake it let TooLOngDoesntMatterVar = new Discord.Client() if you so wish

drifting wedge
#

how do i send an image from my pc?

#

i cant do path

misty sigil
#

some bots even have clients named after themselves

drifting wedge
#

and its using PIL

opal plank
#

why not?

drifting wedge
#

bc im using heroku

opal plank
misty sigil
#

😩

low shard
ancient nova
#

you mean the new Client @misty sigil

#

right?

misty sigil
#

yes

low shard
#

Matthe

#

Where is your badge

ancient nova
#

alright then I'm refreshing my bot

opal plank
#

but yeah matt, as i said, rn there isnt much need for me personally to get a lot of dead servers just to say 'hey my bot has x servers!" mainly cuz there isnt a need to rush verification

ancient nova
#

that didn't make sense

opal plank
#

and if i want to test traffic, i got my twitch bot to stress test my bots stability

drifting wedge
#

how can i upload an image from my pc to imgur

#

or something like that?

misty sigil
#

I don’t really care about fake servers

#

personally

opal plank
#

thats why i made the auto leave so strict

#

those are ANDS, not ORS

#

to make sure it has a little false positives as possible

misty sigil
#

damn strict as FUCK

opal plank
#

while still leaving bad servers

#

iiirc

#

holdup

#

thats the auto leave kicking in

#

24 guilds down the drain

misty sigil
#

sad

ancient nova
#

@misty sigil alright it worked more or less

opal plank
#

not much actually, its just inflating server stats

ancient nova
#

is it possible to add an message before the bot leaves?

drifting wedge
#

how do i send images from my pc to discord?

#

like upload them in my bot

ancient nova
#

bot.on("guildCreate", guild => {
if (guild.memberCount < 5) { guild.leave() }
})

#

to this

opal plank
#

there aint much really stopping anyone from going make 20 accounts and adding the bot in one or two servers

ancient nova
#

stop making me feel more sad please

opal plank
#

sad about what?

ancient nova
#

this dude tried to ruin my bot

opal plank
#

howcome?

ancient nova
#

and the funny thing is the servers he made my bot join

#

are still

#

joined

drifting wedge
#

u can leave lol

#

loop thru servers

ancient nova
#

so yeah I'll get that growth thingie for sure

drifting wedge
#

and leave all fake servers

opal plank
#

run a global thing to leave then

misty sigil
#

do u have an eval command?

opal plank
#

loop channels cache

ancient nova
#

yes

misty sigil
#

do u know his ID?

ancient nova
#

his ID or his servers

misty sigil
#

his ID

ancient nova
#

I can go and copy it

misty sigil
#

Nice

opal plank
#
for(let g of client.guilds.cache.values()) {
if( g.memberCount >= 5 /*Check other stuff here like owner ids*/) g.leave();
}

Do not run that without knowing what it does

#

but thats the gist

ancient nova
#

bot.on("guildCreate", guild => {
if (guild.memberCount < 5) { guild.leave() }
}) <- bot how can I add a message before bot leaves to this

opal plank
#

dont do that

#

that'll just run on guildCreate

#

aka when the guild is added

#

blacklist the onwer id

#

and clean your cache

#

get the owner of those bad guilds and whenever they try to add it to a guild, auto leave

#

likely will make alts, take taht into account

misty sigil
#

makes sense

opal plank
#

store the owner id's who add your bot

#

if they start adding more than 3 servers, auto leave them the 4th

ancient nova
#

ah alright

opal plank
#

i'll make a shit template for you

#

so you get a general idea

ancient nova
#

alright

#

by looking at templates, that's how I learned most stuff anyways, lol

opal plank
#
let users= new Map();

on('botJoin', (g:Discord.Guild) =>  {
if(users.has(g.owner)) user.set(users.get(g.owner) + 1);
else users.set(g.owner , 1);

if(users.get(g.owner) > threshhold) g.leave();
})
#

of course, thats bad way of doing it cuz you'll lose all the values on bot restart

#

so you'll need a database to keep track of those values, so they persist

#

@ancient nova

ancient nova
#

seems neat