#development

1 messages · Page 558 of 1

earnest phoenix
#

My sql commands are broken

#

Im using quick.db

keen fulcrum
#

How can I make a bot that can rank people in roblox?

sick cloud
#

@keen fulcrum use a function

inner yoke
#

#MISSION_IMPOSSIBLE
For me

keen fulcrum
#

How?

sick cloud
#

find('x', 'y') to find(p => p.x === y)

#

ie

#

ohwait

#

wrong mention lul

#

@earnest phoenix ^

#

and @keen fulcrum look into some roblox api or something, thats not really a topic we cover here

junior nacelle
#

That moment when you are truly lost as to why your bot wont work only to find you didnt save the changes yet....

earnest phoenix
#

How do i make my bot desc be shown correct on phones?
Rn its just garbage

#

Only on pc it works great

wicked summit
#
			<table class="table is-striped" id="toremove-parent">
				<thead>
					<tr>
						<th>Command</th>
						<th>Response</th>
						<th></th>
					</tr>
				</thead>
				<tbody id="toremove">
          <%for(let list of settings.customcommands){%>
						<tr>
							<td><%=list.name%></td>
							<td><%=list.reply%></td>
							<td><a onclick="delCC()" class="button is-info command-remove" data="<%=list.name%>">Remove</a></td>
						</tr>
          <%}%>
				</tbody>
			</table>
	</div>```
#

How i get data from the clicked button?

junior nacelle
#

@wicked summit I don't know JS that well but wouldn't you pass data when you call the delCC() function? Then you can do something with said data in the function.

wicked summit
#

Ok wait

#
     function delCC(){
          let opt = document.getElementById("toremove").data
          let data = {
            data: opt,
          }
          axios.post("/manage/<%=guild.id%>/customcommands/remove", data).then((res) => {
                    if(res.data !== "Success") return window.alert(res.data);
                  console.log(res)
                });
        }
#

@junior nacelle there ^

junior nacelle
#

this.data? I dont think I know JS enough to help you

wicked summit
#

the function i made itsn't working

#

Idk how get the data from pressed "button"

junior nacelle
#

I would know how to troubleshoot this in a web application but not in a bot. Perhaps try using console.log for all of your variables to ensure they are getting what you are expecting

#

After let opt, console.log(opt)

#

Are you getting a return on the res console log?

lusty dew
junior nacelle
#

@lusty dew The depends what you are going for; it is an input, what kind of input are you seeking?

lusty dew
#

Well

#

It is a dropdown

#

and I want it to input whatever the person chooses

#

So like for example they choose Cutie Doctor

#

it will input that choice

junior nacelle
#

@lusty dew good point, I typically don't write dropdowns that way so never thought about it

lusty dew
#

Ok

waxen quest
#

Could cycling through all the guild members and checking if each one of them has a specific role considered API abuse or something of that nature?

knotty steeple
#

y e s

quartz kindle
#

no

#

not if they're cached

waxen quest
#

How do I know if they are cached?

quartz kindle
#

d.js?

waxen quest
#

yes

quartz kindle
#

if you're not using fetch, they are cached

waxen quest
#

Nice, thanks peepo_ThumbsUp

lime fiber
queen sentinel
#

it means that another bot can activate commands on your bot

#

which can cause loops, which is why we muted it

lime fiber
#

Ok, thanks i will fix it 👍

lime fiber
#

I think i fixed it 👍

fallen arch
#

what is the best site to host your bot

visual zenith
#

use a paid vps

fallen arch
#

?

visual zenith
#

glitch or heroku

fallen arch
#

what is free and 24/7

visual zenith
#

glitch or heroku

#

-_-

#

legit

fallen arch
#

heroku

visual zenith
#

search those up ;/

fallen arch
#

Oh Ok

visual zenith
#

glitch is also free

fallen arch
#

Oh Ok thanks

marble elm
#

It’s best to buy a VPS

visual zenith
#

ye

marble elm
#

OVH is cheap

visual zenith
#

i dont have a credit card so ye

#
        const commandList = client.comman.get('command')
        const commands = client.comman.map(c => {
        console.log(`${c[0][0].name} :: ${c[0][1].description}`);
        });
```error: shows only 1 thing not repeating to show all of the commands
earnest phoenix
#

tldr dont use a free hosting

fallen arch
#

umm

earnest phoenix
#

Raspberry pi hosting ftw

keen drift
#

I host my bot on my washing machine

earnest phoenix
#

Yas, Samsung smart washing machines

#

Throw a hard drive into the washing machine and turn it on

keen drift
#

Yes

#

I also host my bot on the juicero

earnest phoenix
#

I could not join the voice channel: TypeError: serverQueue.connection.playStream is not a function

#

library: eris stable

keen drift
#

Read the error

earnest phoenix
#

I voted, and it didn't log.

earnest phoenix
#

Hey Idk why when I add 3 songs in queue and when I skip first song it plays second but when I skip 2 it leaves the 3

chrome olive
#

how i can get the title?

#

body.title?

earnest phoenix
#

Try it and see

chrome olive
#

undefined

earnest phoenix
marble elm
#

DBL doesn’t host your bot

earnest phoenix
#

lol true that

marble elm
#

DBL gives your bot publicity

earnest phoenix
mossy vine
#

so when i console.log a Map object i get stuff in the output like [Array] and [Object] how can i display the entire thing?

pale marsh
#

Join it?

mossy vine
#

doesnt work

#

any other way i can display the entire thing without those stupid compressions or whatever they are

pale marsh
#

Is that js?

mossy vine
#

yes

pale marsh
#

I assume the array elements are not strings?

mossy vine
#

array elements are numbers and strings

#

wait no

#

the array contains objects

pale marsh
#

Then loop over the array and determine what properties you want to output, and add them to a variable or something

mossy vine
#

i want to output everything

#

to make sure my shit works

pale marsh
#

I don't think that's how js works

mossy vine
#

i know

#

thats why im looking for a solution to this problem xd

barren brook
#

I need to generate a numbers for a report I’d and idk how since I’m a noob at coding I am trying to do message.channel.send(Math.floor((Math.random() * 100) + 1)) but it won’t work

earnest phoenix
#

Doesn't d.js require a string for send

#

you can’t console.log an array in node iirc

inner jewel
#

console.log(require("util").inspect(x, {depth: maxDepth}))

#

just set a large[citation needed] value for depth

quartz kindle
#

or connect it to chrome's dev tools, and log it there

mossy vine
#

@inner jewel x is my Map object right?

inner jewel
#

yes

mossy vine
#

maxDepth is not defined

#

wait

#

am i dumb

#

yes i am

#

that worked thanks

rugged terrace
#

Can someone help me with a vote command I just got my bot approved

#

Oh nvm found it

lusty dew
rocky dagger
#

why isn't the bot removing the "muted" role? Can some1 help me?```css
if(warns[wUser.id].warns == 2){
let muterole = message.guild.roles.find(name, "muted");
if(!muterole) return message.reply("You should create that role dude.");

let mutetime = "10s";
await(wUser.addRole(muterole.id));
message.channel.send(`<@${wUser.id}> has been temporarily muted`);

setTimeout(function(){
  wUser.removeRole(muterole.id)
  message.reply(`<@${wUser.id}> has been unmuted.`)
}, ms(mutetime))
}``` ping me
earnest phoenix
#

Nhe

lofty hamlet
#

hi

#

who can help me

#

:

#

I would like to make a command in an array but how? Ex:? Search Ab / And the bot sends me everything that starts with Ab in my array

lusty dew
#

You would have to loop through the array I think

#

I am not too keen on Arrays

lofty hamlet
#

loop all the time is not optimize :/

earnest phoenix
#

you can't not loop waitwhat

#

you have to iterate over the array to find if an instance matching x exists

rocky dagger
#

why isn't the bot removing the "muted" role? Can some1 help me?```css
if(warns[wUser.id].warns == 2){
let muterole = message.guild.roles.find(name, "muted");
if(!muterole) return message.reply("You should create that role dude.");

let mutetime = "10s";
await(wUser.addRole(muterole.id));
message.channel.send(`<@${wUser.id}> has been temporarily muted`);

setTimeout(function(){
  wUser.removeRole(muterole.id)
  message.reply(`<@${wUser.id}> has been unmuted.`)
}, ms(mutetime))
}``` ping me
earnest phoenix
#

@rocky dagger

#

What is the error?

#

Hmm wtf

#

Why you put "10s"

#

On mute time

rocky dagger
#

It doesn’t remove the “muted” role

earnest phoenix
#

I understand

#

Delete "10s"; and remplace by let mutetime = 10000

#

@rocky dagger

lusty dew
#

yeet

rocky dagger
#

Okay I will do that tomorrow I need to sleep 🛏

earnest phoenix
#

Gn

lusty dew
#

I wouldn't put mutetime as a int

#

I would do

#

let mutetime = args[1]

#

So it takes whatever time you say

#

for example

#

!mute @ user 12s

#

it would take 12s and mute them for that amount of time

#

@earnest phoenix What lang do you know?

earnest phoenix
#

Lang?

lusty dew
#

Yes, like d.js, d.py etc

earnest phoenix
#

Java, JavaScript, Php, html

lusty dew
#

Ooo

#

Do you know CSS?

earnest phoenix
#

Yes

lusty dew
#

May I dm you?

earnest phoenix
#

I forgot that

viral spade
#

hi,
so sometimes i get a missingPermissions error, i think when trying to send a message to a textchannel. i guess the serverowner is trying to use the commands in channels the bot can not post to? is there a workaround, or an established way of handling such a situation? should i let the user know whats going on somehow? or can i request permissions enough to post anywhere on a server?

earnest phoenix
#

just... don't execute the command if you miss permissions to do whatever the command does?

viral spade
#

the command is .send()

#

a user enters a command and gets no response because the bot has no permission to post in this textchannel

earnest phoenix
#

ok, but read what i said because you completely disregarded it

viral spade
#

i dont get it

#

i don't care about the error message. i care about the user not getting a response

#

the question is what should i execute instead

rocky dagger
#

@lusty dew it’s a warning command

lusty dew
#

Oh

#

Didn't know that

#

ok

#

yet

#

yeet*

faint topaz
#

So bots cant vote or whatever but is it fine to reward voters in the form of magical internet points?

serene cobalt
#

Why the unneeded '

faint topaz
#

why the unnecessary response?

#

that came out unintentionally salty

bright spear
#

Wdym magic internet points

#

You can (and are encouraged to) give users rewards for voting

earnest phoenix
#

does anyone know how to do this 1

bright spear
#

Just update the channel names like every minute

quartz kindle
#

thats kinda api abuse

#

if your server is not very large, you can do it using the member add event

#

it will probably hit the api much less than updating every x

earnest phoenix
#

someone clicks an emoji and it gives u a role

sick cloud
#

using events

#

zira does it

keen drift
#

@earnest phoenix Yagpdb should do it?

pale marsh
#

Omg no...

#

7 reactions

glass linden
#

Does anyone know why my music bot keeps skipping songs randomly during a song? I asked this yesterday but it didn't answer my question

faint topaz
#

You can (and are encouraged to) give users rewards for voting

#

Thank you !

livid swallow
#

my bot is able to log messages, send files (as attachments) and send text messages to the channel. What permission does it require? Can I just leave it at ‘0’ cause it is no different from everyone else on the channel?

inner jewel
#

you can omit the query param

#

https://...&permissions=1234 -> https://...

livid swallow
#

@inner jewel So, in other words - I could leave it at 0? Or were you replying to me?

glass linden
#

Can someone help me with my issue above?

daring trellis
#

?

earnest phoenix
#

nobody will help you if you provide little to no context about what you are using

daring trellis
#

Yep

glass linden
#

@earnest phoenix Like?

quartz kindle
#

like code sample, some tests you made like testing if the issue is with a specific song or songs

glass linden
#

It's not i already tested

quartz kindle
#

add some logging to your code so you can see when it happens and in which context

glass linden
#

But when i host it on my computer the skipping doesn't happen 🤔

#

When I host it on my host it skips randomly during the song

#

Could it be my host?

quartz kindle
#

it could be network issues, ram/cpu shortage, outdated or broken dependencies/packages

glass linden
#

All my packages are up to date

#

So it may be network issues

quartz kindle
#

whats your host?

glass linden
#

SyroNodes Every time i say this people always say its a wired host lol when they check it out

quartz kindle
#

it doesnt look like a well known host, so its very possible that it might be an issue on their end

glass linden
#

I check with them apparently it's not

quartz kindle
#

are you 100% sure its not your code?

glass linden
#

Nope

#

It works on my computer

#

When i self host it

quartz kindle
#

test it on another host

#

amazon is free for 12 months

#

google as well

glass linden
#

Is it easy to set up?

quartz kindle
#

google is not that easy, idk about amazon, havent used it

glass linden
#

Also do you need any Credit Card info?

quartz kindle
#

yes, to create an account

glass linden
#

Ah

#

Can u link me the google one?

#

I'll try it

quartz kindle
#

look for a "compute engine" instance

#

F1-Micro - 600mb ram

#

thats their free tier

#

its free forever, but limited to 1gb traffic / mo

glass linden
#

Would i click that to learn about it?

#

@quartz kindle Also one of the support team people said it was youtube is this true?

quartz kindle
#

also possible, depending on the location of your home machine and your host, it could be a local youtube server having issues

#

regardless, whatever is causing the skip should be perfectly catchable and loggable and even auto-retry-able

glass linden
#

Ah

lusty dew
#

Does anyone want to collaboration on a project? I need someone with knowledge of Vue.js, html, CSS and many other things

amber fractal
#

Is there any way to test to see if a user would accept DMs from the bot without actually dming them?

#

Discord.js

#

I was thinking using createDM() but I'm not sure if it would work or not, but I'll try it mmLol

#

Nah didnt work, didn't expect it to lmao

#

could just dm then delete and see if it went through mmLol

#

Im not evil tho

junior nacelle
#

JS question: I have a command handler implemented and I am struggling with breaking scope.
Command X - sends an Embed message
Command Y - Edits embed message
How can I get Command Y to retrieve the message I need changed?
How can I pass variables from Command X to Command Y when the handler is in the index.js?

amber fractal
#

Well, could store the message in a database, or if its unimportant a json file

#

then retrive it from said places

#

etrieve*

#

retrieve* mmLol

junior nacelle
#

@amber fractal thank you, I'll try that

dusk skiff
#

Hey.

amber fractal
#

Hi

#

Got a question or just like greeting here or something

lusty dew
#

What version of Python would I need to code a bot in python?

#

or can I use any version

amber fractal
#

think its py3

#

some 3 version

#

I dont follow python

lusty dew
#

Mk thanks

#

I want to try learning Python xD

#

Even though I don't know JS that well which is what I have been studying for the past year now

junior nacelle
#

@amber fractal looks like I will have to go with a DB; discord.js has some serious issues when it comes to recalling messages. Stored the ID on a json, tried to use the fetchMessage([id]) command which is supposed to run on a channel command which apparently cant run on its own. If I do message.channel.fetchMessage - the promise is pending and even with a delay I am getting 404 not found.

wanton shuttle
#

Somehow the http npm is not working for me a few days ago, so my webhook is not working tho

#

What can I use to replace it?

keen drift
wanton shuttle
#

I need the newest version of node.js?

keen drift
#

no

#

http is built into nodejs

#

not sure why you looking on npm for a built in api

wanton shuttle
#

No I'm just asking

#

"Node.js v11.7.0 Documentation"

#

cuz I'm using node 8.x

keen drift
#

http has been built in since v0.10.48

#

js devs: npm everything

proud pier
#

Any one help me

#

I want to make a trivia life bot

rugged terrace
#

I'm getting this error and I don't exactly know where it's coming from. Can someone lead me to the right place? (node:16841) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'constructor' of null

#

(discord.js)

#

Heres more context ```(node:16841) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'constructor' of null
at Map.[check] (/root/ChigBot/node_modules/enmap/src/index.js:884:44)
at Map.get (/root/ChigBot/node_modules/enmap/src/index.js:224:19)
at Client.client.on (/root/ChigBot/index.js:54:129)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at MessageCreateHandler.handle (/root/ChigBot/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/root/ChigBot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (/root/ChigBot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/root/ChigBot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/root/ChigBot/node_modules/ws/lib/event-target.js:120:16)

#

This happens everytime i ch help etc

#

do any commmand

#

nvm fixed it

lusty dew
#
C:\Users\Aj\Desktop\Python Practice>Python app.py
'Python' is not recognized as an internal or external command,
operable program or batch file.

Can someone explain why I am getting this?

restive silo
#

python isn't in your enviroment

#

you probaly need to add it manually then

lusty dew
#

It is...

#

It is in my environment

#

Along with these two

#

@restive silo What would I need to add then?

restive silo
#

that should be enough, are you sure that the python.exe is located there?

lusty dew
#

I don't see any python files

#

on my computer

#

Just the Python IDE and such

#

C:\Python27

#

doesn't exist

restive silo
#

then python is probaly not installed and your IDE has his own python in it or smth

lusty dew
#

Idk

#

I am trying to reinstall it

#

even though I hit

#

ADD TO PATH

#

and then clicked Install

sturdy delta
#

How do I make an !AFK command where you do !afk and it changes your nickname to {AFK} and then your name. And then !un-AFK resets your nickname

wicked summit
#

Hmm

earnest phoenix
#

Help

#

How to invit bot in my server?

#

H

#
client.on('guildCreate', guild => {
 const join = client.channels.get("517749949413457938"); //CHANGE TO YOUR CHANNEL-ID TO GET NOTIFICATIONS
       const invite = guild.channels.find(c => c.type === "text").createInvite({
        maxAge: 0,
        maxUses: 0,
        reason: "Security ToS of bot"
    });
    let rbnEmbed = new Discord.RichEmbed()
    .setTitle(`Started Serving In **${guild.name}**`)
    .setColor(`GREEN`)
    .setDescription(`${invite.url}`)
    join.send(rbnEmbed); 
});```
#

return's undefined

restive silo
#

createInvite returns a Promise

#

you need to .then() that or await it

earnest phoenix
#

yeah await

#

thanks

late hill
#

Use webhooks for logs 👏

fiery nebula
#

nvm iam retarded

#

forgot {} in json

faint topaz
#

Anyone here set up webhooks for the dbl api on Heroku and willing to help me out? trying to get vote notifications. new to webhooks.

earnest phoenix
#

Anyone here, good at making bots?

#

I uh, im trying to make a bot much like "the dank memer"

#

But with actual good memes

frigid zephyr
#

Hello

#

I am facing a problem

fiery nebula
#

@earnest phoenix iam not good but for dank memer u dont need much skills

earnest phoenix
#

@fiery nebula rip, now i feel even more like a nub

fiery nebula
#

xd

#

in beginning all is difficult

earnest phoenix
#

Well i basicly want to make a dank memer, but with different memes

#

i just dont know where to begin

fiery nebula
#

do you have created the bot?

earnest phoenix
#

im doing that rn

#

But tbh, ive never made a bot lol

fiery nebula
#

ok just try a normal command when you set it up

frigid zephyr
#

Though I send welcome text channel invitation link to others, but still whenever someone joins the first page that appers to him is that channel where at the top it is written that welcome to the server

fiery nebula
#

not that difficult

#

watch a tutoial and it helps alot

frigid zephyr
#

I mean how to set a channel as welcome channel in a server.

fiery nebula
#

@frigid zephyr code?

#

with member.guild.channels.find() you can serach a channel and set it as a channel if its existing

earnest phoenix
#

ok so i invited the bot

#

But how do i change its code

mossy vine
#

what

faint topaz
#

yes

mossy vine
#

your bot doesnt have any code by default WaitWhat

earnest phoenix
#

re

#

uhmm

fiery nebula
#

watch a tutorial and come back xd

earnest phoenix
#

yes dad

fiery nebula
#

gj son

blazing stratus
#

hi

earnest phoenix
#

@fiery nebula so the tutorial wanted me to install node.js and other things, and wanted me to work with command prompt, does that sound right?

quartz kindle
#

yes

#

a bot is a software that needs to run somewhere, ie your computer or a server

#

the bot application in the discord website is just to create a "bot account"

earnest phoenix
#

Discord dont host them?

quartz kindle
#

no

earnest phoenix
#

O

#

So my pc has to run for it to work?

quartz kindle
#

yes, or get a vps

earnest phoenix
#

Aha

#

Alright

#

But it gives me this

#

Its not happy

quartz kindle
#

you're following a bad and outdated tutorial

#

also, first of all, do you have any experience with programming?

earnest phoenix
#

I do but not with the setting up part

quartz kindle
#

which languages do you have experience with?

earnest phoenix
#

Javascript and java

quartz kindle
#

alright, both of them have discord libraries to work with, you can use either of them

#

which one would you prefer?

earnest phoenix
#

Java script

quartz kindle
#

then you're on the right path, to use javascript you need to use node.js

#

now, the best javascript libraries for discord are discord.js and eris

#

discord.io (the one you tried to install) is outdated and not very good

#

so go ahead and take a look at the discord.js website

earnest phoenix
#

Outdated? it was posted like 2 months ago

#

this tutorial

inner jewel
earnest phoenix
#

but but

#

discord.js it is then

quartz kindle
fiery nebula
#

discord.js best

earnest phoenix
#

oof

#

Alright i will take your word for it

quartz kindle
#

so take a look at their website, and their documentation

#

they have a getting started guide and much more

earnest phoenix
#

Alright, cheers

fiery nebula
#
ruby dust
#

discord.js and discord.py are the simplest libraries so far

#

and most well known Thonk

quartz kindle
#

because javascript and python are noob languages

#

xD

earnest phoenix
#

Thats just how i roll

quartz kindle
#

dont get me wrong, im a javascript developer too

#

but compared to java and c++ for example, javascript is like a super dumbed down language

#

like comparing mac to linux

earnest phoenix
#

I know i know

ruby dust
#

apple is overrated

earnest phoenix
#

Im not exactly a coder either

glad iris
#

Is there any bot that Reset all the Nick Names

quartz kindle
#

wrong channel, also, you should use the search function in the website

fiery nebula
#

how can i terminate a collector

quartz kindle
#

pretty sure it has an .end() function

fiery nebula
#

ok

quartz kindle
#

its .stop() actually

#

just checked the docs

fiery nebula
#

ended is existing and stop but its not working

#

i'll check

faint topaz
#

Anyone here familiar with Heroku tho?

fiery nebula
#

nvm i just made it with out ()...

#

not me

quartz kindle
#

im familiar with telling people not to use heroku

#

xD

faint topaz
#

Not many better free alts tho

quartz kindle
#

google / amazon

faint topaz
#

lifetime free?

quartz kindle
#

google is free forever, but after 12 months they charge for traffic above 1gb/mo, which depending on the size of your bot ends up being 1-2 usd/mo

faint topaz
#

cause with a card registered I can run 24/7 basically no problems

#

just cant figure out working webhooks into this :/

#

not to mention I'm a noob on the subject to begin with xD

quartz kindle
#

doesnt heroku offer you an external url?

faint topaz
#

lol its uh supposed to

quartz kindle
#

if im not mistaken they redirect it to port 3000

faint topaz
#

but not running a web worker breaks that I think

quartz kindle
#

well, to use webhooks you need to setup a small webserver

#

and accept requests

faint topaz
quartz kindle
#

try setting up a webserver like express

#

and listen to port 3000

earnest phoenix
faint topaz
#

ok thanks

#

but I've done my research and am content with the limitations and features of my host 😛 just asking for help ~

earnest phoenix
#

What exactly does node.js do, is it really needed

quartz kindle
#

node.js is a javascript runtime environment

#

it runs javascript code without a browser

earnest phoenix
#

O fair enough

#

Welp guess i cant do without that

quartz kindle
#

either that or anything else that can run javascript

faint topaz
#

so running a web-worker attempted to run my bot so thats cool

quartz kindle
#

you could actually run a discord bot in a browser if you wanted to

faint topaz
#

too advanced for 2019

earnest phoenix
#

Well i do have an extra pc available for such a purpose

quartz kindle
#

my bot used on run on node-webkit / nw.js

#

its pretty awesome actually, because its super easy to test and debug

ornate shoal
#

my bot has a profile picture that changes every hour (it features a song that one of the users is listening to), but the discord bots site is having issues picking it up and can't display the profile pic

#

is there any way that i could fix it on my side, would implementing the api help (didn't look into the api much yet)?

quartz kindle
#

i dont think so, because of caching

faint topaz
#

the api is good to have if you wanna post your server count but I think the pfp would be handled elsewhere anyway

ornate shoal
#

hm yeah i see, its just for votes and stats

earnest phoenix
#

Surely theres a community where i can steal peoples code right?

ornate shoal
#

github

quartz kindle
#

thats a bad idea

earnest phoenix
#

Stealing code is fun

faint topaz
#

but how will you ever improve?

earnest phoenix
#

O i mean *borrowing

quartz kindle
#

good luck getting it to work

earnest phoenix
#

Mr exi, i have flex tape

#

I take code and i use flex tape

quartz kindle
#

i mean, you can take a look at other people's code if you want to understand how they are doing it, but dont just copy/paste

ornate shoal
#

you could also just use it for inspiration instead of copying everything, that way you'll even learn stuff

quartz kindle
#

copy/pasted code probably wont even work, and you wont understand why

earnest phoenix
#

O but its so beautiful

#

And i make it work

#

It aint pretty doe

late hill
#

@faint topaz You could have the web worker in a different app

faint topaz
#

if your having a rough time there was a git I used when I moved from C# to js, its a started bot with the events set up and a few basic commands. you just have to put your token in the config.

late hill
#

And for voting rewards use a db which is connected to both apps

faint topaz
#

oh that could work

quartz kindle
#

heroku does have a free database you can use

#

heroku postgres

late hill
#

(It's probably trash)

faint topaz
#

yeah I have all that shebang set up just not hooks xD

late hill
faint topaz
#

I use the jaws addon xd

quartz kindle
#

it actually isnt

late hill
#

mlab is also free

#

And very epic

quartz kindle
#

heroku postgres is a good managed database solution

faint topaz
#

more familiar with just basic sql

quartz kindle
#

similar to google cloudstore/firebase

late hill
#

Is it simple to setup

#

the postgres thing

quartz kindle
#

no idea, havent actually used it

late hill
#

o

quartz kindle
#

but postgre is one of the best rdbms's out there

#

probably better than mysql

#

just harder to use and setup, which heroku basically does for you, and exposes it to you via an api

#

as far as i understood

latent willow
#

Since the logging stuff on my bot is the most spammy event (for messages send) I guess it would be better to create a webhook url per server which activates logging and send to the webhook (because of rate limits)?

Main question would be are webhook messages more tolerant for rate limits than normal messages send through the bot?

quartz kindle
#

what kind of logging do you do that spams so much?

latent willow
#

It doesn't really spam but it's the most spammy out of all the functions

It's just all these mod events user join left banned kicked role change and more.

So I thought I'll have a look before it's getting rate limited (I don't really know what's the rate limit for send message across all servers per second/minute)

I just thought about if there is a better way for it

quartz kindle
#

im not sure actually

#

check what big bots like dyno and tatsumaki are doing, if they're not using webhooks for logging, you should be fine

inner jewel
#

the global ratelimit is quite high

#

you're unlikely to hit it

latent willow
#

Ohh alright ye already checked bigger bots and they don't seem to do sth. special.

Alright thank you 2 I'll keep it this way then doggowave

earnest phoenix
#

This is muted role

#

I want create muted role when my bot added someones server

dapper spoke
#

i have a problem with node-opus any help ?

inner jewel
#

you're missing a : after permissions

#

get a better theme

#

it's unreadable with that one

dapper spoke
#

indeed

rugged terrace
#

What's the cheapest way to host a discord bot. Currently I'm using DigitalOcean with free creds from Github.

inner jewel
#

GCP free plan, AWS free plan

surreal peak
#

DO is good enough for a start

#

and quite cheap

quartz kindle
#

i second GCP and AWS

#

use one at a time, get 2 years free

inner jewel
#

DO isn't cheap lol

rugged terrace
#

Yea but I'm using free credits from the Github Student Pack

#

All I want to do is ssh into a Linux machine

spring ember
#

DO is ok

viral spade
#

guys i want to shard my bot and am not sure on what i have to worry about. in this guide it says "If you're using any sort of database or connection, multiple shards may cause issues with multiple processes connecting to a single end point". What do they mean? simply race conditions or some nasty db errors?

spring ember
#

I recommend Scaleway

#

It's cheap and reliable

rugged terrace
#

In 10 months my free credits from Github will be spent so I'll switch then

knotty steeple
#

@earnest phoenix what language is that thonkeyebrows

#

oh wait

blazing star
#

looks like coffeescript

rugged terrace
#

Ew

knotty steeple
#

but it isnt OMEGALUL

blazing star
rugged terrace
knotty steeple
#

the special characters are just really dark

blazing star
#

yea true

spring ember
#

Looks like shitty js theme

rugged terrace
blazing star
#

I had to view the image

spring ember
#

Coffee Script has []

#

@blazing star same

amber fractal
#

dont use dark characters on a dark background Thonk

blazing star
#

I literally had to zoom in

rugged terrace
#

🏀

amber fractal
#

zoom and enhance

blazing star
#

he forgot a :

knotty steeple
#

also

#

even if it was coffeescript that code isnt valid

blazing star
#

=> would be ->

#

I haven’t used it in a long time

knotty steeple
#

it would literally be

client(on('guildCreate'))
#

when compiled

blazing star
#

that’s valid js

#

10/10

quartz kindle
#

@viral spade basically sharding is not compatible with databases that create file locks, such as leveldb, which only allow one process to use it at a time

viral spade
#

so with my noobish mysql, hows my perspective?

quartz kindle
#

you'll be fine

viral spade
#

du i have to set different users or something?

quartz kindle
#

just make sure your database is designed so that it can function with arbitrary requests that do not depend on data from other shards

knotty steeple
quartz kindle
#

for example, if you have functions that require getting data from other servers, you need to review that

knotty steeple
#

how do you do

quartz kindle
#

because they will be executed in a shard context

#

basically any kind of cross-guild code

viral spade
#

no my bot loops through all users in the servers and insert stats into the db. teh stats can be queried with commands, but only from own server. should be fine right?

quartz kindle
#

yeah should be fine

viral spade
#

aight thanks very much

#

so do i see it correct that sharding basically is just 3 lines of code, adding that "shardmanger"?

quartz kindle
#

yeah, just in another file

#

that file will be like the "starter"

#

and will run your actual bot file multiple times as shards

viral spade
#

ok thanks

amber fractal
#

Will a guilds shard id change?

#

if you have shards anyways

inner jewel
#

@quartz kindle sharding is compatible with file locks

#

if you use internal sharding

#

what's incompatible is multiple processes

#

both major js libs have internal sharding afaik

viral spade
#

i have a cronjob once per minute that takes the client/bot object as input. i set/start the cronjob after the bot has loggedin. i'd like to shard and wondered can i make it so every shard gets a different cronjobinterval with 10sec offset?

lyric talon
#

Guys, could someone help me with discord.py [rewrite] ?
I'm trying to create a mute function, that create a role if it doesn't exists in the server and wait for a time to took of the role of the muted user.
But the user still can write in the server, how can i fix it ?
https://hastebin.com/papabawisa.py

inner jewel
#

you might need a global queue or something

#

once each shard connects, add it's task to the queue

#

and every 10s, you check if there's anything in the queue

#

if there is, remove it and start the task

quartz kindle
#

yeah, he was talking about the shard manager

#

but you're right, i wasnt specific enough

placid crystal
#

hi

slim heart
#

i have my express server hosting a static serve to a directory but for some reason only one file too, is creating problems and whenever i go to that file it makes me download it so i think that's the problem

#

whenever i try to POST to it

desert bough
#

its 2.5k guilds that u should start sharding right?

inner jewel
#

yes

bright spear
#

well

#

you need to start before

#

if you hit 2.5k and its not sharded your bot will break

inner jewel
#

you can still run 1 shard with 2500

#

at 2501 it'll break

#

if you don't get disconnected you could have eg 10k guilds on one shard

#

you only get errors when connecting with > 2500 guilds on that shard

earnest phoenix
#

fi

bright spear
#

well

#

the bot will only be online in half of the servers its in

earnest phoenix
#

This is why I run 4 shards on 73 servers

bright spear
#

ok thats borderline api abuse

earnest phoenix
#

Wait really

#

why is it a problem

quartz kindle
#

well, you're using 4 connections instead of 1, but thats not much of an abuse anyway

keen drift
languid dragon
#

super unnecessary more than anything

earnest phoenix
#

I'm future proofing

keen drift
#

lmao

languid dragon
#

you're wasting whatever resources your bot takes up x4

keen drift
#

might as well spawn a shard for each server

#

#futureproof

earnest phoenix
#

I already did lmao

languid dragon
#

not to mention how silly that sounds, you make it sound like you're going to get 8000 servers overnight

earnest phoenix
#

I did that at 60 for like a few mints then stopped

keen drift
#

cough

quartz kindle
#

btw how was the ram/cpu difference?

earnest phoenix
#

No I'm not expecting

#

lemme check

quartz kindle
#

between 1 shard and 30+

languid dragon
#

dsl

earnest phoenix
#

Ive been meaning to check that

inner jewel
#

using more shards shouldn't affect the memory usage

earnest phoenix
#

I've got to go out soon I'll update you when I get back

inner jewel
#

maybe for users

quartz kindle
#

doesnt it spawn more node processes?

inner jewel
#

but if you have unified cache for all shards

keen drift
#

depends how you shard it

inner jewel
#

running more shards won't increase memory usage

#

at most the needed memory for the socket

earnest phoenix
#

legit I just added shards=shardscount

quartz kindle
#

does node.js reuse memory among multiple processes?

inner jewel
#

no

earnest phoenix
#

I'm in dpy

inner jewel
#

but i'm not talking about spawning a process per shard

#

i'm talking about one process running multiple ws connections

keen drift
#

ye

quartz kindle
#

yeah internal sharding

inner jewel
#

if you have a split cache, adding shards does increase memory usage

quartz kindle
#

im asking about normal sharding

inner jewel
#

if you have unified cache, pretty much no difference

#

well

keen drift
#

I just do 4 shards per process, then like 10 pods

inner jewel
#

normal sharding for me is same process

#

and most libs do it same process

earnest phoenix
#

What are pods?

inner jewel
#

d.js is pretty much the only snowflake

keen drift
#

kuberenetes pods

earnest phoenix
#

ok

bright spear
#

d.js has internal sharding

earnest phoenix
#

i need help

#

lol

#

i get this Collecting discord.py==1.0.0a (from -r /tmp/build_b377451db7b41ea54720be482eccdd8f/requirements.txt (line 1)) Could not find a version that satisfies the requirement discord.py==1.0.0a (from -r

#

i tried discord.py==1.0.0a

#

heroku is a .js only I believe

#

i dont think so

#

nvm

#

i used a link

#

all good

#

kk

earnest phoenix
#

@earnest phoenix yeah you should buy something reliable

#
  • Bots are not what the platform is designed for. Heroku is designed to provide web servers (like Django, Flask, etc). This is why they give you a domain name and open a port on their local emulator.

  • Heroku's environment is heavily containerized, making it significantly underpowered for a standard use case.

  • Heroku's environment is volatile. In order to handle the insane amount of users trying to use it for their own applications, Heroku will dispose your environment every time your application dies unless you pay.

  • Heroku has minimal system dependency control. If any of your Python requirements need C bindings (such as PyNaCl binding to libsodium, or lxml binding to libxml), they are unlikely to function properly, if at all, in a native environment. As such, you often need to resort to adding third-party buildpacks to facilitate otherwise normal CPython extension functionality. (This is the reason why voice doesn't work natively on heroku.)

  • Heroku only offers a limited amount of time on their free programme for your applications. If you exceed this limit, which you probably will, they'll shut down your application until your free credit resets.

bright spear
#

but iirc u can run python on heroku

earnest phoenix
#

Well

#

I have heroku premium

#

Sooo

#

14gb ram dedicated, whatever

#

good for you

#

Yea

bright spear
#

@earnest phoenix the latest version of d.py is 0.16.12 according to pypi

earnest phoenix
#

there is a development version

twilit ledge
#

rewrite

bright spear
#

ah i see thats async

earnest phoenix
#

i still dont see why people would buy something that is actaully meant to be a webserver then a vps

#

buying heroku premium is a bigger ripoff than the kenza cosmetics scam

#

Question.

#

you can find a vps 2 times cheaper and 2 times stronger at DO/Scaleway/GC/AWS

#

IF someone votes for my bot, and uses a votelocked command

#

@earnest phoenix oh and good luck with voice on your bot hq|one

#

and I'm not using webhooks

bright spear
earnest phoenix
#

votelocking is bad dont be an asshole to your users

#

If i restart will they still be able to use the votelocked command?

bright spear
#

do you check the api route?

earnest phoenix
#

@earnest phoenix I only use it on commands that use a lot of resources

bright spear
#

if so then restarting will have no effect on it obviously

earnest phoenix
#

@earnest phoenix ah no problem pal

#

Such as bansync

#

kicksync

#

ect

bright spear
#

swifti how are you checking it

earnest phoenix
bright spear
#

well then restarting will obviously have no effect

earnest phoenix
#

Alright

#

Perfect

bright spear
earnest phoenix
#

Was worried abt that

#

Oh, alright.

#

yeah he just said that a few messages above

amber fractal
#

what does that do?

earnest phoenix
#

Bansync?

amber fractal
#

Yes

earnest phoenix
#

So

amber fractal
#

Not here tho

earnest phoenix
#

Where?

#

Dms?

#

Or general

amber fractal
#

somewhere that isnt here mmLol

earnest phoenix
#

kk

earnest phoenix
#

Anyone got some pre-made stuff for a starboard that will work on 1 server only? I don't feel like making it myself

#

Thanks tho

#

lol

amber fractal
earnest phoenix
#

it wouldnt hurt for you to make it yourself

#

Yeah but it's like, it already exists, so save a fellow programmer you know

#

a true programmer would not copy something

amber fractal
#

Im pretty sure its in the rules that say we cant just give code

earnest phoenix
#

dont be a Bethesda

sick cloud
#

@earnest phoenix does lang matter

earnest phoenix
#

.js

sick cloud
#

i made a starboard bot if you'd like it

#

it has some bugs i have to fix but it works

earnest phoenix
#

Thanks br0

amber fractal
#

I mean some people say stuff that has to do with https://en.wikipedia.org/wiki/Reinventing_the_wheel

sick cloud
#

i'll dm you it in like

#

2 days bc

earnest phoenix
#

alright

sick cloud
#

internet is out

earnest phoenix
#

gotcha

sick cloud
#

i can't upload anything

#

but yeah i will

earnest phoenix
#

I'll use my google home mini to set a reminder lol

amber fractal
#

You could make one in an hour or less tho Thonk

earnest phoenix
#

eh

#

got other things

#

like

#

My dads going into life saving surgery tomorrow

#

it's gonnna be a 5 hour operation

#

So imma spend some time with him tonight guys

#

👋 Peace guys

bright spear
#

@amber fractal please don't put links in code formatting, its extremely annoying and serves no purpose other than making people hate you

amber fractal
#

https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-messageReactionAdd

sick cloud
#

just send the flipping link

amber fractal
#

Honestly couldnt care less if people like me or not

bright spear
#

steven what is your problem

#

thats just evil

#

ur literally going out of your way to make things harder for people

keen drift
#

what's so bad about links in inline code Thonk

#

I do it sometimes

amber fractal
#

Its not identical

#

But thats just to show its easy to do

#

and would be a lot faster to do it on your own

bright spear
#

@keen drift well if its something you want people to open in their browser, it just makes them copy-paste instead of clicking it

#

and theres no reason to do it

amber fractal
#

I didn't want people to click it, I did it more for the quote "Why reinvent the wheel" because I think saying a true programmer would not copy something isnt true

#

But what I dont like is asking for code that you just want

#

that hasnt been made

#

or optimized.

hardy junco
#

wtf? In the invite code I have it set to 8 or Administrator and have administrator check while inviting my bot, but when my bot joins it says it has these permissions:
CREATE_INSTANT_INVITE,ADD_REACTIONS,VIEW_CHANNEL,READ_MESSAGES,SEND_MESSAGES,SEND_TTS_MESSAGES,EMBED_LINKS,ATTACH_FILES,READ_MESSAGE_HISTORY,MENTION_EVERYONE,EXTERNAL_EMOJIS,USE_EXTERNAL_EMOJIS,CONNECT,SPEAK,USE_VAD,CHANGE_NICKNAME

#

anyone know what is up?

amber fractal
#

that just looks like default perms

#

sure you put it in the right place?

hardy junco
#

put what in the right place?

amber fractal
#

the 8

#

dm me the link you used

hardy junco
#

plus I used the bot to generate the invite

topaz fjord
#

Those are default perms

#

I believe

hardy junco
#

Hmm I wonder why my invite code doesn't work....

lusty dew
#

How could I get the bots username in Discord.py rewrite?

bright spear
#

@hardy junco the bot also has all perms @everyone has

#

oh i see it doesnt say admin

#

if u check the bot's role does it have admin?

hardy junco
#

Yes

#

It is weird

#

not sure xd

#

seems like it is just me though

earnest phoenix
#
const Discord = require(`discord.js`);

module.exports.run = async (bot, message, args) => {
  let message1 = args.join(" ");
const hook = new Discord.WebhookClient('537122172859056130', '_mzbO_XENDVIn_csUQUBucxD_BB6ah14-v0tykp6rSt2mLUQCvVwANWGRy5x8N_gitSV');
hook.send(`${message1}`);
}
module.exports.help = {
  name: "terris"
}

It keeps showing the command before the message can anybody help me?

#

I keep getting this error for some reason

#

From that code

#

Takes ages for the error tho

#

I didn't tho

#

OOF @earnest phoenix did

#

Nvm

sick cloud
#

@earnest phoenix make a new webhook

#

leaking your id and secret means people can send to your hook

earnest phoenix
#

i figured it out i needed to us args.slice(1).join(" ");

sick cloud
#

yes but remake your webhook

earnest phoenix
#

bouta post to it rn

#

jk

sick cloud
#

i can stick that in an eval and literally spam your channel

earnest phoenix
indigo notch
#

You should use m.connection.collection(<Collection>).findOne

#

Also u never defined it

sick cloud
#

OneDrive/Desktop

keen drift
#

Github/C/Windows/

junior nacelle
#

anyone able to answer a discord.js question?

earnest phoenix
#

probably

junior nacelle
#

I am struggling to figure out how to parse a promise; it doesn't seem to behave like a normal object.
I sent a message and stored it in a const, now I am trying to delete said message using the message.delete(); but if I try that it will error that delete is not a function (my guess is because it is a promise not a message) but promise.message or promise.Message is also not working. Yet oddly I can promise.content.

#

@earnest phoenix thoughts?

earnest phoenix
#

const m = await message.channel.send("test");
m.delete();
worked fine for me

sick cloud
#
const Command = require('../../structures/Command');
const { MessageEmbed: Embed } = require('discord.js');

module.exports = class Help extends Command {
    constructor() {
        super({
            name: 'help',
            description: 'View a list of available commands, or view information for a specified command.',
            aliases: ['h', '?'],
            module: 'General',
            
            developerOnly: false,
            guildOnly: false,
        });
    }

    async command(client, ctx) {
        const locale = await client.getLocaleFromCache(ctx.guild.id);

        console.log(locale);

        let usersCommands = null;
        ctx.client.d.developers.find(id => id == ctx.author.id) ? usersCommands = ctx.client.commands : usersCommands = ctx.client.commands.filter(cmd => !cmd.developerOnly); 

        if (!ctx.args.length) {
            const embed = new Embed()
            .setAuthor(locale.welcome.replace('{{commands}}', usersCommands.size))
            .setDescription(locale.description)
            .addField(locale.commandsTitle, usersCommands.map(c => `\`${c.name}\``).join(' \u200B '))
            .setFooter('YouTube', client.user.displayAvatarURL({ format: 'png' }))

            return ctx.send({ embed });
        } else {
            
        }
    }
}

would anyone recommend a switch-case setup here or is if-else fine

#

performance wise

junior nacelle
#

@earnest phoenix i see my issue, I was assigning it to the const while it was still a promise, I needed to add the await. Thank you

earnest phoenix
#

np matthumb

slender thistle
#

@lusty dew User version of your bot user - bot.user

#

And all User/Member objects have attribute name

earnest phoenix
#

@fossil oxide hey

#

@everyone can anyone help me please

earnest phoenix
#

Hey, so im making a bot that picks out random memes, im making it in discord.py.
I can make it pick out images from an URL but not locally, can someone help me?

#

if someone can, please do send a dm

lament meteor
#

u do the x = [] thing and pick one of em at random

earnest phoenix
#

huh?

ruby dust
earnest phoenix
#

Ill check it out

#

thx

fiery nebula
#

can maybe someone explain me how i get the last message of a channel

#

i tryied it like this but its not working

glass ivy
amber fractal
#

<Channel>.fetchMessage(<Channel>.lastMessageID) returns a promise message

#

or should

inner jewel
#

don't trust that

#

just fetch the last message with the get messages endpoint

amber fractal
#

Has it not worked before?

fiery nebula
#

how do you mean Natan

amber fractal
#

I might be wrong tho cuz idk what he's talking about either mmLol

quartz kindle
#

i think he means because lastMessageID is cached and might be outdated, using something like fetchMessages() instead of fetchMessage() (in d.js) will get the latest messages from the api instead of relying on the cached lastmessageID

amber fractal
#

so you mean something like <Channel>.fetchMessages({limit:1})?

quartz kindle
#

yeah

#

that should request it directly from the api without requiring a message id to be known

rotund mango
#

/home/ec2-user/discord

quartz kindle
#

although in his case, if he wants to get the message he just sent, its much better to use something like .then(msg => {})

earnest phoenix
#

Where would I put the code to post server counts to dbl sites? My bot is sharded and only displays that specific shards' guild count instead of total guilds. Where would I put the code to make it work?

#

JavaScript with Cmd Handler

quartz kindle
#

if you're not using internal sharding, you need to use broadcastEval i believe

earnest phoenix
#

Inside of what file lmao

#

My sharding file, my file handler or the ready event?

quartz kindle
#

i dont know if the sharding file has a ready event... i dont think so

earnest phoenix
#

Indeed it does

quartz kindle
#

does it? then put it there

earnest phoenix
#

shard.on("spawn")

quartz kindle
#

hmm

earnest phoenix
#

Yeah but what about rate limits?

quartz kindle
#

you'd need to wait for all shards to spawn

earnest phoenix
#

oo

quartz kindle
#

then use broadcastEval to get the guild count from all shards

earnest phoenix
#

I think I have it lol

#

yea

quartz kindle
#

wait

#

i think dbl also accepts individual shard count no?

#

so you can just have each shard send its count by using the shard id

#

i think that would be way easier

#

yeah it does .postStats(serverCount, [shardId], [shardCount])

earnest phoenix
#

My bot is NSFW only. Can't be doing with this Servers API

#

😦

quartz kindle
#

why not?

earnest phoenix
#

NSFW Only bots are not allowed in this Server

quartz kindle
#

the nsfw rule is only about having it in the description, shouldnt affect any api usage

#

oh they banned strictly nsfw bots too

earnest phoenix
#

Ye

viral spade
#

Heyi get a DiscordAPIError: Missing Permissions when i try to send a message on only a few servers. i guess the bot has no permission to send messages in certain channels. how should i handle this? people are kicking the bot because he cant answer

earnest phoenix
#

if(message.member.hasPermission("SEND_MESSAGE"))

#

lul

quartz kindle
#

or .catch(console.log)

viral spade
#

i dont mean not getting the error. i mean what do i do about people kicking the bot because it doesnt respond

quartz kindle
#

and wouldnt message.member check for permissions from the user who used the command, not the bot? lmao

earnest phoenix
#

Nothing you can do about that lmao. It's their choice

#

Darn

#

I was hoping you wouldn't see that Tim lmao

quartz kindle
#

what you can do tho, if add your permissions to the bot invite link

#

that will automatically create a bot role when they add it

viral spade
#

all the bots have the permission

inner jewel
#

those permissions can be removed

#

and permission overrides can deny it

earnest phoenix
#

Wouldn't if(message.guild.member(client.user).hasPermission("PERM")) work?

inner jewel
#

you should also check permissions on the channel

#

because even if the roles allow it, overrides may deny

viral spade
#

i guess there are channels that need special roles or smth for writin. independet of the invite permission

inner jewel
#

yes

quartz kindle
#

also, if your bot sends embeds, for example the help command in an embed, it needs the embed links permissions

viral spade
#

but i wanna tell people whats going on

quartz kindle
#

so you should add the embed links perm to your invite url

viral spade
#

so they dont kick the bot but try in another channel

earnest phoenix
#

Hey Tim

#
manager.on('launch', shard => {
  //shard.on("spawn", () => { console.log(`[Shard ${shard.id}] Shard has been spawned.`)})
  shard.on("death", process => { console.log(`[Shard ${shard.id}] Shard has went offline.`)})
  shard.on("disconnect", () => { console.log(`[Shard ${shard.id}] Shard has disconnected.`)})
  shard.on("reconnecting", () => { console.log(`[Shard ${shard.id}] Shard is attempting to reconnect.`)})
  if(shard.count > 3) console.log("Not yet")
  else console.log("NOW!")
})
#

Bottom 2 lines

#

That would work right?

#

I tested it but all it says is NOW

#

I'm spawning 5 Shards

viral spade
#

it's working in 350 of 353 guilds so its not about invite permissions

quartz kindle
#

but does your invite url have permissions in it?

viral spade
#

yes, send, embed

#

33647616

quartz kindle
#

then its their fault, and should be treated as such

viral spade
#

sure, i just would like to inform them about it

quartz kindle
#

some people are just dumb, you cant fix their problems

earnest phoenix
#

You should see if the bot can DM the user that it doesn't have permission to speak there maybe

quartz kindle
#

i mean, you can try sending them dms

earnest phoenix
#

^

quartz kindle
#

but thats frowned upon

earnest phoenix
#

🤢

quartz kindle
#

nobody likes getting dms from bots

viral spade
#

right

#

i thought maybe theres a established practice for that case

quartz kindle
#

i think the best practice is just rely on the users figuring it out

#

i mean

#

when people try to install something, they need to figure out how to use it too

#

nobody installs google chrome and then complains it isnt working

earnest phoenix
#

2019 people are just dum lul

viral spade
#

yaaah sure but the creater has reason to make it easy for them

earnest phoenix
#

Creator shouldn't have to

#

They want the bot, they figure it out

quartz kindle
#

the only thing i do is listing the required permissions in my docs/description

viral spade
#

the user interface and experience is part of the bot 😉

earnest phoenix
#

Anyway Tim, could you gimme a little help? 😂

#

I'm currently stuck

amber fractal
earnest phoenix
#

ikr

amber fractal
#

Literally everyone asks for him lol,

quartz kindle
#

im not even close to being a god, but i do enjoy explaining/teaching/helping, so i end up being here a lot xD

#

@earnest phoenix does an individual shard have a count property?

earnest phoenix
#

Yea

#

client.shard.count

quartz kindle
#

well, client.shard yes

#

what about the individual shard that manager returns?

amber fractal
#

I dont think it does

quartz kindle
#

i mean, you want to console.log something different if the current shard id is bigger than 3

earnest phoenix
#

Currently spawning 5 Shards and this still wont work:

manager.on('launch', shard => {
  //shard.on("spawn", () => { console.log(`[Shard ${shard.id}] Shard has been spawned.`)})
  shard.on("death", process => { console.log(`[Shard ${shard.id}] Shard has went offline.`)})
  shard.on("disconnect", () => { console.log(`[Shard ${shard.id}] Shard has disconnected.`)})
  shard.on("reconnecting", () => { console.log(`[Shard ${shard.id}] Shard is attempting to reconnect.`)})
  if(shard.count === this.totalShards) console.log("NOW")
  else console.log("Not Yet!")
})
#

this.totalShard is 5

amber fractal
#

shard id starts at 0

quartz kindle
#

ah so you want to wait for the last shard?

earnest phoenix
#

Might as well do it that way lol Or would it not work as good?

#

@amber fractal Yeah i know, I also tried doing if(shard.count+1 === this.totalShard)
still nothing

quartz kindle
#

the thing is

amber fractal
#

well try and log shard.count and this.totalShard seperately they may be undefined

quartz kindle
#

you're launching all shards at the same time]

#

meaning shard 5 can finish launching before shard 4

#

so you cant use that method to find out when all shard finish launching

earnest phoenix
#
manager.spawn(this.totalShards, 1000)

Not really, there's a 1 second delay between shards getting spawned

quartz kindle
#

ah alright

#

what if a shard fails to launch?

#

does the delay wait for it to retry?

amber fractal
#

what exactly is he trying to do?

earnest phoenix
#

Well if a shard fails to launch then i'm dun fucked 😂

quartz kindle
#

wait for all shards to spawn => get total guild count

#

i think

earnest phoenix
#

Ye

#

So I can post server stats to multiple bot listing servers

amber fractal
earnest phoenix
#

ow

#

Or!

quartz kindle
#

i think what you should do

earnest phoenix
#

I could make a seperate command to post it to the servers

#

Do it every so often manually

amber fractal
#

Thats what mine is

quartz kindle
#

is waiting for the ready event on each shard, and increment a variable with it, and check if the variable equals total shard count

amber fractal
#

but you can still broadcast eval in an auto poster

earnest phoenix
#

Screw it.

quartz kindle
#

that way you can see when all shard are connected, regardless of connection order

earnest phoenix
#

Imma do it manually lul

#

It's easier for me

amber fractal
#

You'd still need to broadcast eval Thonk

earnest phoenix
#

Yea yeah

#

I know how to do that lmao

amber fractal
#

then just in your bots main file

#

do it automatically

#

Wait no

#

disregard everything I said

quartz kindle
#

.....
shard.on("ready", () => { connected++ })
shard.on("disconnect", () => { connected-- })```
earnest phoenix
#

Could I make a command that sets it on a timer and then posts it every so often such as like, every minute or so or would that be a lil spammy?

quartz kindle
#

lul

amber fractal
#

Thats what I have

quartz kindle
#

i have it every hour

amber fractal
#

Its just on a setTimeout() in a function that calls itself mmLol

earnest phoenix
#

Ah, i'll do it like that then lmao

#

Or a simple setInterval bloblul

amber fractal
#

Mine is posted every 12 hours cuz I dont get growth

#

Yea, I didnt know that existed until after I made it