#development

1 messages · Page 527 of 1

earnest phoenix
#

i dont wanna type every single number in an array

hollow fulcrum
#

theres a way in python to avoid that

earnest phoenix
#

in c i just set loop, and add %A_Index%

quartz kindle
#
let i = 0;
while(i++) {
    if(i > 100) break;
    // use i here
}```
#

but dont send a separate message for each number lol

#

you can also do js for(let i = 0; i < 100; i++) { //use i here }

ruby lichen
#

Why is the DBL API for Java not working?

quartz kindle
#

no idea, but if it doesnt work, just post it yourself

#

make an http post request

#

thats what i do (in js)

earnest phoenix
#

@quartz kindle works kinda, just had to set sleep function

ruby lichen
#

ok but how can i change the htlml looking of my bots page?

quartz kindle
#

use css in your html description

ruby lichen
#

like this for example

#

where?

quartz kindle
#

long description

#

in your bot edit page

ruby lichen
#

ahh

#

and what can i write for example?

quartz kindle
#
<style>
css here
</style>```
ruby lichen
#

And i dont know about css

#

How can i change the background color?

lofty abyss
#

how do i fix this

#

for a json file doe?;

quartz kindle
#

save it as unicode/utf-8

#

@ruby lichen right click on the page > inspect element

ruby lichen
#

ah thank you ;D

#

bot-img {radius: 120;}

#

Is this right? @quartz kindle

quartz kindle
#

no

#

what do you want to do?

ruby lichen
#

I want to make the bot image to a circle

quartz kindle
#

border-radius

#

and bot-img is not specific enough

ruby lichen
#

Ok and how now?

quartz kindle
#

this is the original css

#

you have to use the same

ruby lichen
#

bot-img {border-radius: 120;}

#

This?

quartz kindle
#

everything

ruby lichen
#

could you explain it to me with the image radius?

#

How to write?

quartz kindle
#

the same as its written in the picture

ruby lichen
#

@quartz kindle Not working

quartz kindle
#

yes

#

now put the number you want

ruby lichen
#

yes but it is not working

quartz kindle
#

it works for me

ruby lichen
quartz kindle
#

where is the .columns .bot-img?

ruby lichen
#

Still not working

quartz kindle
#

change the 4px to the number you want

#

.>

ruby lichen
#

ohhhhh

#

thank you

#

@quartz kindle Why is this not working?

quartz kindle
#

@ruby lichen that css is wrong

#

these are multiple classes on the same element, you cannot call them like that

#

if you do what you did, it will look for child elements, one inside the other, not only 1 element with all those classes

#

and all classes need a .

#

you just need one of those. the original one is .btn-orange. thats all you need

hollow fulcrum
#

learn css

quartz kindle
#

^

weary zodiac
#

Someone wanna help me with iframes

valid frigate
#

you said earlier that they didnt work, like do they not load at all

earnest phoenix
#

@inner jewel so for my java problem where would i put @Override

inner jewel
#

you really should learn java basics before making a bot

weary zodiac
#

@valid frigate yea they dont load

earnest phoenix
#

Also, how do I view how many servers a shard handle? My bot got 3 shards.

west raptor
#

why are sharding

#

at

#

22 servers

earnest phoenix
#

I got nothing to do. I get bored

west raptor
#

doesnt mean you should just go shard at 22 servers

earnest phoenix
#

I know I don’t need to shard if my bot don’t got 30+ servers

west raptor
#

also

#

its just telling you that shards guild size

earnest phoenix
#

Ok thanks.

pine herald
#

how would i invite my bot to this server

#

@hushed berry how?

hushed berry
#

@earnest phoenix it's good that you're sharding early -- less hassle later

#

@pine herald you have to submit your bot on the website

pine herald
#

on what website?

#

yes

earnest phoenix
bright spear
#

@earnest phoenix one shard can hold 2500 servers

#

but 1000 is recommended

zenith moss
#

I should test sharding sometime

#

I should also use a database instead of enmap

earnest phoenix
#

sharding at a few hundred servers is one thing...but 22? wow

#

Thats really early

#

Too early in my opinion

weary zodiac
#

Someone help me with my iframes

#

they arent loading

pastel mulch
#

I got a quick question for all you discord bot coders out there. I coded my bot with JS. I was wondering how I could make the users vote to access certain commands. How can I make this possible?

last ferry
#

idk js but i would just check if they voted or not

#

theres api documentation

pastel mulch
#

Love you dad

last ferry
earnest phoenix
#

@pastel mulch I dont know how to make them vote for certain commands but I think you have to be using a certain library to do that

pastel mulch
#

Library as in discord.js I hope

keen drift
#

Use the webhook for vote checks

#

You are less likely to throttle and you will receive information as it's available

pastel mulch
#
  console.log(`User with ID ${vote.user} just voted!`);
});```
#

This is confusing

earnest phoenix
#

WHERE IS MY SUPER SUIT?

coral trellis
earnest phoenix
#

THIS IS NOT A MEME

#

THIS IS ME BEING CONCERNED

#

BECAUSE I CAN'T FIND MY SUPER SUIT

#

!

#
<!DOCTYPE html>
<head>
<title>Where's my super suit?</title>
</head>
<body>
<h1>WHERE IS MY SUPER SUIT?!?!?!?!?!</h1>
</body>
</html>```
#

there you go

earnest phoenix
zealous veldt
earnest phoenix
#

i dont thank i ever saw that before

keen drift
#

Yeah

zenith moss
#

I’ve never seen that error

uneven rover
#

it happened to my project before, for unknown reason, maybe because of the restart, or mybe it was about connecting to discord

echo pumice
#

It seems like it would be server-side or somewhere in between.

uneven rover
#

that too

hasty ginkgo
#

That happened when discord was having outages

echo pumice
#

I almost said it was a runtime error, because I apparently forgot how Javascript works lol

earnest phoenix
#

Linux a dc dates bot pls

#

Linuxa dc bot nasıl kurarim

gleaming glen
#

No turkish here GWqlabsMmLol

#

And there should be some tutorials in youtube or somewhere

earnest phoenix
#

Bulamadim

gleaming glen
#

sir

#

no turkish here GWnekomakiAngeryBOYE

earnest phoenix
#

Ok

#

1 minutes pls

gleaming glen
#

minute*

earnest phoenix
#

How to install linux discord bot @gleaming glen

gleaming glen
short hinge
#

so uhh my NPM install got stuck

#

idk what i fucked up in package.json but i cant install any modules anymore

lament meteor
#

@short hinge send ur pkg.json here i could try to fix it for u

short hinge
#

DM?

#

@lament meteor

lament meteor
#

sure

earnest phoenix
#
@bot.event
async def on_raw_reaction_add(payload):
    if payload.emoji.name == 'golden_apple':
        print('emoji is fine')
        guild = bot.get_guild(payload.guild_id)
        member = guild.get_member(payload.user_id)
        if not member.bot:
            print('we arrived here')
            role = discord.utils.get(guild.roles, name=("bla bla"))
            return await member.add_role(role)
``` why its not working?
abstract crystal
#

which version if d.py?

#

async of rewrite

slender thistle
#

Rewrite

#

Judging by their messages in here and d.py rewrite help channel :p

#

@earnest phoenix Does it not assign the role with name bla bla?

#

And does it even print anything?

trim saddle
#

Don’t use on_raw

slender thistle
#

y tho

tight heath
#

@queen sentinel is this legal

queen sentinel
#

that's the link to inv @gilded plank I think

#

¯_(ツ)_/¯

#

what

tight heath
#

264811613708746752

queen sentinel
tight heath
#

Yeah no imposter

#

Okay

#

sry for the ping-pong then

queen sentinel
#

is okay

tight heath
#

😊

earnest phoenix
#

Is there an event to tell me when a shard has went offline?

#

JavaScript

last ferry
#

uhhh

#

you could ping each shard to see if they respond

earnest phoenix
#

So I guess that answer to my question is no

last ferry
#

idk i dont use js

#

but thats what i would do

valid frigate
#

https://discord.js.org/#/docs/main/stable/class/Shard?scrollTo=e-death the shard will emit a death event when it gets killed or disconnect if it disconnects

earnest phoenix
#

Much appreciated ❤ @valid frigate

valid frigate
#

👌

earnest phoenix
#

Is it possible to emit that event?

#

With like eval or something

valid frigate
#

you can't emit that event iirc

earnest phoenix
#

darn

valid frigate
#

the shard will tell you when it dies/disconnects

earnest phoenix
#

What if I was to process.exit(), you think that would tell me then?

valid frigate
#

most likely it would emit death and then exit yeah

marble elm
#

Just destroy a shard and it will emit

#

shard#destroy()

earnest phoenix
#

Okay thanks

winged shell
#

how do you make hentai command

last ferry
#

just use a web scraper

#

thats all im gonna say

#

or an api if they have it

valid frigate
#

well

winged shell
#

asking for a friend

last ferry
#

mhm

mossy vine
#

Or

#

Manually add images to a database

last ferry
#

horrible idea

winged shell
#

uh...

#

no

last ferry
#

in specific situations thats a good idea

mossy vine
#

It works tho, at least for me

winged shell
#

it would be better to like have a website

#

and grab the image data from said website

last ferry
#

its not very hard to web scrape

mossy vine
#

If all else fails just fetch from a hentai subreddit, i heard reddits web api is easy to use

winged shell
#

...

last ferry
#

bliz my suggestion would just be to webscrape

#

if you dont know how to do that then i cant explain it

mossy vine
#

Technically thats what im suggesting too

last ferry
#

yes

#

but without the database thing

mossy vine
#

I meant the reddit fetch thing

last ferry
#

why not just scrape the actual website mmLol

mossy vine
earnest phoenix
#

im trying to make a thing that will add to a .json file in .js but when i use fs.appendFile but it always outputs like this ```[

]"asdasd"```

#

i mean like a list of blacklisted roles that the bot cannot give to normal users

mossy vine
#

because it literally appends the string to the end of the file

#

if you actually want to use .json and accept the risk of data corruption, a better idea would be to write the entire object (array in your case) in the file

earnest phoenix
#

so like something that could add to the array like copy old + new then write it

mossy vine
#

basically, yes

earnest phoenix
#

ok thanks

hearty tree
#

whats the best way i should store each individual user in my server's custom items? i have a db but im not sure how to implement it

late hill
#

If you put the array in the js file you can use .push to add to it @earnest phoenix

let myArray = ['a', 'b'];
myArray.push('c');
//myArray will be -> ['a', 'b', 'c']```
earnest phoenix
#

anyone knows why i get an error, ReferenceError: channel is not defined

#

wesley would defining it first in the js file then writing it to the json work

late hill
#

Yes sure

earnest phoenix
#

ok thanks

late hill
#

What is channel @earnest phoenix thonkku

earnest phoenix
#

aaaaaaaaah fuck me

#

i forgot xd

late hill
#

lol

earnest phoenix
#

i mean i know the channel

#

just forgot to specify it

#

god

#

yet i get same error, its supposed to send message to channel

#

that command is executed in

late hill
#

msg.channel?

earnest phoenix
#

yes

late hill
#

And that doesn't work? 👀

earnest phoenix
#

idk

#

its the most basic thing

earnest phoenix
#

do you have client.on

earnest phoenix
#

of course.

marble elm
#

What have you defined message as?

earnest phoenix
#

anyone know how i can list all servers with the member counts for each server on dpy

hollow fulcrum
#

What

#

You mean server - member count?

#

@earnest phoenix

earnest phoenix
#

yes

hollow fulcrum
#

If i was on my computer

#

I would spoonfeed you

#

I'll give you a hint

#

for ge in bot.guilds:

inner jewel
#

or a list comprehension

#

[x.y for y in z]

hollow fulcrum
#

I type what i barely understand

#

Ok

#

Not what i don't understand

earnest phoenix
#

print("Server ID: {} Server Name: {} Member Count: {}".format(server.id,server.name,server.member_count) for server in client.servers)

#

would this work

#
    print("Server ID: `{}` Server Name: `{}` Member Count: {}".format(server.id,server.name,server.member_count) for server in client.servers)

inner jewel
#

try it and see

earnest phoenix
#

it just sends

#

<generator object servers1.<locals>.<genexpr> at 0x03F74780>

inner jewel
#

try something like "\n".join([<that thing>])

earnest phoenix
#

instead of .format right?

inner jewel
#

no

frigid juniper
#

I would say setting a loop before print

earnest phoenix
#
@client.command(pass_context=True)
async def servers1(ctx):
    print("Server ID: `{}` Server Name: `{}` Member Count: {}\n".format(server.id,server.name,server.member_count) for server in client.servers)

inner jewel
#

print("\n".join(["...".format(...) for server in client.servers]))

frigid juniper
#

like

    Print````
#

I never did that in one line

inner jewel
#

since you're printing to stdout a for loop may be better

earnest phoenix
#

ima change to send

#

once it works

#

i think

#

i might

inner jewel
#

to send as a message a list comprehension would be easier

frigid juniper
#

Just simplify your loop

earnest phoenix
#

lemme try both

#

it works

#

but any idea how i could make it send it in a text file?

#

cos if i have too many servers

#

it wont send the msg

hollow fulcrum
#

Experiment with file r/w

frigid juniper
#

Just file = open(...)
For item in list:
File write item

earnest phoenix
#

any docs on it?

hollow fulcrum
#

Google

#

It's native to python

frigid juniper
#

Yeah

hollow fulcrum
#

Don't even need imports

frigid juniper
#

Simple code, search open method

earnest phoenix
#

do i need to store a file

#

or can it create one on the spot

frigid juniper
#
file = open("log.txt")
for item in your_list:
    file.write(item)
file.close()```
earnest phoenix
#

it wont print it with my actual bot

#

and item is?

#

ive never done this before

frigid juniper
#

Item is the var inside the loop

#

You loop the list you get before

hollow fulcrum
#

Learn python :p

earnest phoenix
#
so item = ("\n".join(["Server ID: `{}` Server Name: `{}` Member Count: {}\n".format(server.id,server.name,server.member_count) for server in client.servers]))```
frigid juniper
#

XD

inner jewel
#

even better

#

don't write a file

frigid juniper
#

No

inner jewel
#

you can upload files in discord.py without reading from disk

frigid juniper
#

so item = ["Server ID: {} Server Name: {} Member Count: {}\n".format(server.id,server.name,server.member_count) for server in client.servers]

earnest phoenix
#

yeah

frigid juniper
#

[] is a list

earnest phoenix
#

how

hollow fulcrum
#

stringIO? @inner jewel

earnest phoenix
#

thats what i wanted @inner jewel

inner jewel
#
string = "\n".join(["...".format(...) for server in client.servers])
bytes = io.BytesIO(bytearray(string, "utf8"))
await send(file=discord.File(bytes, "filename.txt"))```
frigid juniper
#

You wanna upload a file ?

#

Oh ok

hollow fulcrum
#

I actually learnt something

inner jewel
#

that should work according to d.py/python docs + stackoverflow

hollow fulcrum
#

Thanks

#

Lemme Eval that

frigid juniper
#

I don't even tried this in my life 😂

inner jewel
#

i just searched the docs

#

¯_(ツ)_/¯

frigid juniper
#

Lol

earnest phoenix
#

lemme try

frigid juniper
#

But if he wanna do this like a beginner, he could just do a local file but your method is a way simple

earnest phoenix
#
Ignoring exception in command servers1
Traceback (most recent call last):
  File "C:\Users\hamza_000.HAMZA.000\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 50, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "C:\Users\hamza_000.HAMZA.000\Desktop\discord bot python\ChatManager\ChatManager 6.py", line 414, in servers1
    bytes = io.BytesIO(bytearray(string, "utf8"))
NameError: name 'io' is not defined

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\hamza_000.HAMZA.000\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
    yield from command.invoke(ctx)
  File "C:\Users\hamza_000.HAMZA.000\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 374, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\hamza_000.HAMZA.000\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 54, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'io' is not defined
#

what imports?

inner jewel
#

import io

earnest phoenix
#

lemme try that

frigid juniper
#

You will have to learn more python for this purpose

earnest phoenix
#

nah its fine

#
await send(file=discord.File(bytes, "serverslist.txt"))
#

i dont think that would work

#

@inner jewel

inner jewel
#

that's pseudocode

earnest phoenix
#

would client.say work?

inner jewel
#

not copy paste code

earnest phoenix
#

would it work as client.say or client.send_message?

#

or both

frigid juniper
#

Say is in the current channel

#

it will work

earnest phoenix
#

k

frigid juniper
#

With send-msg you have to specify the channel object

#

Or ctx.message.channel

earnest phoenix
#

i got that

frigid juniper
#

I will leave, have fun with your code ^^ bye

earnest phoenix
#
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: module 'discord' has no attribute 'File'```
#

uhh

knotty steeple
#

learn python

earnest phoenix
#

just dont say that

inner jewel
#

are you on d.py async

earnest phoenix
#

yes

inner jewel
#

then idk

earnest phoenix
#

oh okay

inner jewel
#

the code i searched was for rewrite

earnest phoenix
#

thanks anyways

pastel mulch
#

`TypeError: Cannot read property 'on' of undefined

`

inner jewel
#

someUndefinedVariable.on

pastel mulch
#

?

inner jewel
earnest phoenix
#

@inner jewel what do you call what you just told me

#

like sending files or what

pastel mulch
#

yes im reading that

#

@inner jewel

#

but I did everything

inner jewel
#

did you add the { webhookPort: 5000, webhookAuth: 'password' } part

keen drift
#

not sure why you calling .on for .webhook

inner jewel
#

that's not wrong

#

those events are on dbl.webhook

knotty steeple
#

wrong channel smh

#

not redirecting to right channel

#

inner jewel
knotty steeple
#

@earnest phoenix use rewrite

earnest phoenix
#

NO

#

no*

knotty steeple
#

async is outdated

earnest phoenix
#

im not gonna change my whole bot

#

i cba

#

ima just make my bot

#

and thats it

knotty steeple
#

ignorance

earnest phoenix
#

and never update

pastel mulch
#

alright

#

now where is that update sent even

topaz fjord
#

never update

#

Have fun lacking features

pastel mulch
#

what?

earnest phoenix
#

What is better? pm2 or tmux

sick cloud
#

pm2

earnest phoenix
#

ok

west raptor
#

tmux is a terminal multiplexer tho

earnest phoenix
#

am i able to get html help here

sick cloud
#

yes

earnest phoenix
topaz fjord
#

is there a route called homepage.html

bright spear
#

You need to add all pages as routes in express

slim heart
#

is there a way with discord's richembed to edit an embed like
channel.fetchMessage('msgid').setDescription("new description")
kinda thing?

quartz kindle
#

yes

slim heart
#

h o w?

quartz kindle
#

idk exactly how with discord's builder, because i use literal object instead, but im pretty sure message has an embed property that you can edit

slim heart
#

ok sooooooo? message.embeds.setdescription?

quartz kindle
#

message.edit(message.embeds[embedindex because its an array].setdescription)

#

something like that

slim heart
#

oh i see

slim heart
quartz kindle
#

try new Discord.RichEmbed(result.embeds[0]);

slim heart
#

richembed needs a new

#

its a class

#

or well

#

yeah

#

u know what i mean

quartz kindle
slim heart
#

sks

quartz kindle
#

lul

slim heart
#

wow i legit did not see that at all GWfroggyBlobThonk

inner jewel
#

even if you edit the data you have it won't update the message

quartz kindle
#

hes doing it in a message edit thing

slim heart
#

^

#

yay it worked

#

thanks sm

quartz kindle
#

basically message edit needs a whole new message to replace the old one with, so just build a new embed using the old embed data

slim heart
#

yeah

#

smort

dusk raft
#

why do i keep screwing up my bot

rocky mesa
#

what does your bot do? what language?

dusk raft
#

it's a bot that adds a rating system into your server where you can rate memes, jokes, etc. with a reddit-like karma system, and it's coded in javascript

#

really all im doing is trying to port the database im using because my original hosting service wont work with sqlite

torpid fable
#

What would be the best option to use to host my bot (d.py)?

west raptor
#

pins

earnest phoenix
#

vps

torpid fable
#

Ok I checked the pins thanks

#

I'll probably end up using aws because i've heard a bit about it

rocky mesa
#

expensive

#

try hetzner

coral trellis
#

Hetzners voice connection has been blocked my discord

rocky mesa
#

rip

#

didnt they like spam discord

echo pumice
#

How do I prevent my bot from talking in channels it's not supposed to?

#

Can it be done with just a role?

earnest phoenix
#

yes

#

or you can code it in since redundancy i guess

echo pumice
#

Well i'll just do it with a role

#

Also i assume it won't ever see messages in channels it doesn't have access to?

earnest phoenix
#

yup

#

bots are just like normal users so they dont even know that the channel exists if it doesn't have read message perms

visual zenith
#

how to remove the .png part on the link?

earnest phoenix
#

of what link?

bright spear
#

@earnest phoenix actually they can

#

The client hides it in most cases but you can see channels you don't have perms for

austere fossil
#

Need cheap hosting options for a music bot, anyone got any ideas?

bright spear
#

Check pins

jagged plume
#

they can see channels but cant fetch messages / wont receive message events, right?

late hill
#

Yes

earnest phoenix
#

Anybody know any tutorials on the web about creating an API?

keen drift
#

Just Google rest tutorial

#

Thousands

glad iris
grave ocean
#

i have arrived

#

safely

#

:3

inner jewel
#

for the error, imo the best option is checking for permissions

#

before trying to send

#

eg on message, if no perms to send, ignore

grave ocean
#

but i have to use that in EVERY message.channel.send?

#

that will be a pain

inner jewel
#

¯_(ツ)_/¯

grave ocean
#

i have a try-catch thing

inner jewel
#

if you don't await the promise, a try-catch won't work

#

because promises are async

grave ocean
#

oof

queen violet
#

you can have a reject function

#

then all you need to do is .catch(reject)

earnest phoenix
#
undefined:1



SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.<anonymous> (C:\Users\Administrator\Desktop\yvsYedek\server.js:633:19)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
#

Help me

inner jewel
#

SyntaxError: Unexpected end of JSON input

queen violet
#

whats the json

amber junco
#

How do I make my bot send emojis in embeds?

tight heath
#

Which programming language @amber junco?

amber junco
#

js

tight heath
#

client.emojis.get('id of the emoji').toString()

mossy vine
#

@amber junco if its a default emoji, ctrl c the unicode version by doing \:poop:

amber junco
#

oh ok

mossy vine
#

If not, i dont remember lol

tight heath
#

I just sent

amber junco
#

ok

tight heath
#

What to do if not

#

😋

amber junco
#

client.emojis.get('id of the emoji').toString()

then what?

tight heath
#

That's a custom emoji

#

Put it wherever you want

amber junco
#

ok

#

oh k

#

thnx

tight heath
lament meteor
#

toString is a default js method

tight heath
#

Can be overwritten.

earnest phoenix
#
                            ^

TypeError: e.replace is not a function
    at Client.client.on.e (C:\Users\Administrator\Desktop\yvsYedek\server.js:354:29)
    at Client.emit (events.js:182:13)
    at WebSocketConnection.onError (C:\Users\Administrator\Desktop\yvsYedek\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:374:17)
    at WebSocket.onError (C:\Users\Administrator\Desktop\yvsYedek\node_modules\ws\lib\event-target.js:128:16)
    at WebSocket.emit (events.js:182:13)
    at _receiver.cleanup (C:\Users\Administrator\Desktop\yvsYedek\node_modules\ws\lib\websocket.js:211:14)
    at Receiver.cleanup (C:\Users\Administrator\Desktop\yvsYedek\node_modules\ws\lib\receiver.js:535:15)
    at WebSocket.finalize (C:\Users\Administrator\Desktop\yvsYedek\node_modules\ws\lib\websocket.js:206:20)
    at TLSSocket.emit (events.js:182:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
#

New error :(

lament meteor
#

e is not a string

earnest phoenix
#

YAni?

earnest phoenix
#

Helppp

last ferry
#

it says replace isn’t a function

earnest phoenix
#

What should i do

#

@last ferry

last ferry
#

I’m not gonna spoonfeed you code, but if it says it isn’t a function you have to find another way to replace it

earnest phoenix
#

How will i do so urgently please

earnest phoenix
#

e isn't a string.

mossy vine
#

what about "e"?

slender thistle
#

"e".replace(regToken, 'that was redacted')

#

Hmmmm

#

Wouldn't do anything

earnest phoenix
#

Ben ne soruyor um

#

Siz ne diyonuz

mossy vine
#

@slender thistle i assume he passed e as a variable, rather than as a string

slender thistle
#

e is supposed to be a variable in that case, no?

mossy vine
#

maybe it has an assigned value that isnt a string?

#

we need context for this

slender thistle
#

Several people above said that e is not a string in this case

mossy vine
#

wait there was convo about this before?

slender thistle
#

Scroll up a bit :p

earnest phoenix
#

Yaw yardım edin

queen sentinel
molten pewter
#

It's pretty much a gist embedded in a webpage, but without it saying it's a gist, and actually renders markdown properly

misty rune
#

does it take some time to display guild count when you update it ?

shut sparrow
#

Do you guys support setting the authorization for webhook via the API?

shut sparrow
#

Is it okay to mention one of the website admins?

mossy vine
#

no

knotty steeple
#

for valid reason yes

shut sparrow
#
greenbigfrogToday at 6:07 PM
Do you guys support setting the authorization for webhook via the API?

@bitter sundial

#

(just noticed there's an #topgg-api channel... smh I must rly be bling)

bitter sundial
#

no we don't

shut sparrow
#

Any reason why not?

surreal saffron
hallow prairie
#

@surreal saffron File "/Users/gebruiker/Documents/Python/Flipp3rrrBot.py", line 25, in <module>
client.run(TOKEN)

slender thistle
#

Pastebin isn't working for me, what's the error?

surreal saffron
#

TOKEN = 'I inserted the token here but I wont show it to you'

hallow prairie
slender thistle
#

Could regenerate it and post the old one

hallow prairie
#

i copied for u

slender thistle
#

Oh really

#

Thanks

#

Fucking

#

Your bot couldn't conmect to Discord

#

That's it

surreal saffron
#

I got it in a server and stuff

slender thistle
#

@hallow prairie And please do not point at random things if you don't know what to do

#

Well, you are running it but it can't connect to Discord servers for whatever reasons

inner jewel
#

aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discordapp.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1051)')]

#

looks like your ssl certificates are broken

slender thistle
#

Is that Mac?

surreal saffron
#

I don't have SSL, it said it was pre-installed with Python.

inner jewel
#

yes you have ssl

surreal saffron
#

And yes it's a MacBook.

inner jewel
#

you can't use discord without ssl

slender thistle
#

Aight, one sec

surreal saffron
#

I meant I don't have a certificate for SSL...

slender thistle
#

Getting [SSL: CERTIFICATE_VERIFY_FAILED] on Python 3.6 on OS X?
Navigate to your Applications/Python 3.6/ folder and double click the Install Certificates.command to fix this.
Happy coding!

#

Simply copied ofc

#

Instead of 3.6, see 3.7 because I hope you know why

surreal saffron
#

I got Python 3.7

#

It still doesn't work:

# Work with Python 3.6
import discord

TOKEN = 'XXXXXXXXXX'

client = discord.Client()

@client.event
async def on_message(message):
    # we do not want the bot to reply to itself
    if message.author == client.user:
        return

    if message.content.startswith('!hello'):
        msg = 'Hello {0.author.mention}'.format(message)
        await client.send_message(message.channel, msg)

@client.event
async def on_ready():
    print('Logged in as')
    print(client.user.name)
    print(client.user.id)
    print('------')

client.run(TOKEN)

My bot doesn't respond to !hello

slender thistle
#

Uuuhhh

#

Because...

surreal saffron
slender thistle
surreal saffron
#
  1. Where can I find it?
  2. Error 404
  3. Already done
  4. Uhm?
slender thistle
#
  1. Give me a moment, I failed the link.
  2. Refer to option 1.
  3. Noice.
  4. Object-Oriented Programming.
surreal saffron
#

Thank you very much! It works!

low wasp
#

is it possible to get all votes from the past 12 hours?

dusk raft
#

How much time do you guys think it would take to port a bot from js to py

night imp
inner jewel
#

depends on the size of the bot, how much you know of the languages, etc

dusk raft
#

With like 2/10 knowledge of Python lol

earnest phoenix
#

is it possible to make my bot invite other bots with a command

#

so like !invite (ID)

#

would add the bot

#

to your server

mossy vine
#

Nope

dusk raft
#

There's a captcha lol

mossy vine
#

Api doesnt support unauthorized bot joins

earnest phoenix
#

alright

#

thanks anyway

#

s

#

is it possible to edit an existing file (add info) on dpy async

#

if yes can someone send me a link

earnest phoenix
#

Has anybody got a link to a tutorial on how to add a web dashboard for a javascript bot please?

inner jewel
#

that's highly dependent on your code

#

you won't find anything that specific

earnest phoenix
#

Is there any tutorials though

#

Any at all

inner jewel
#

i highly doubt

#

you can get tutorials for the parts needed to make one

sick cloud
inner jewel
#

how to make a rest api, how to handle oauth2, how to make a front end

earnest phoenix
#

Would you consider it quite complicated?

sick cloud
#

if your new to it, yes

earnest phoenix
#

Darn

#

What would I have to learn? HTML, CSS or something

inner jewel
#

html, css, possibly browser js

#

and whatever lang you choose to make your backend in

earnest phoenix
#

Well.

#

Looks like I aint making a web dashboard 😦

quartz kindle
#

for starters you can try playing around with express.js or something

cold harness
#

wait since your bot acts as a middleman, can't you host a bot and a website form the same code

#

and then use that as a like bot/website communicator

#

and then bam don't you have a website dashboard thingy

sick cloud
#

sure can

#

its more dangerous

vernal basin
#

client.channels.get(517441679511519242).send("message");

It says type error, cannot read property 'send' of undefined

#

i am so confused

#

the long number is the channel ID

#

should it be channels.get(channelID).send?

#

i feel like i did something wrong

sick cloud
#

string

#

smh

#

IDs are strings

zenith moss
#

You need “13422233”

#

Client.channels.get(”channel id”).send(“message”)

#

@vernal basin

vernal basin
#

oh right

#

pfft

earnest phoenix
#

@quartz kindle Express is so slowwww

#

@cold harness I used to do this, but I quickly realized that it's not very smart.

quartz kindle
#

it may be slow, but its the most popular webserver framework and has the biggest community

#

and it still handles 10k requests per second

#

im using fastify now

inner jewel
#

not like web server performance even matters for a web dashboard

#

unless you have tens of thousands of users using the dashboard at the same time

earnest phoenix
#

Just because its popular doesn't mean its good

#

Personally @quartz kindle, I recommend polka

#

Its faster than fastify for one.
also, it has an api that is very similar to express

#

so you can basically switch

const app = require('express')();
//to this
const app = require('polka')();

For the most part, and get a big speed increase

vernal basin
#

is there some way to take the name of a channel, get the bot to take that channel and then post in a channel with a specific name? for example:

#channel-a is where the message is sent
#channel-a-test is where i want the bot to respond.

earnest phoenix
#

I mean, just scroll down and look at the benchmarks

#

Express is last, at 24k requests per second

#

Polka only loses to native http module, at 50k requests per second

#

So even for a simple app, you'll be getting a 35-40% speed increase

inner jewel
#

nvm

earnest phoenix
#

Was about to say natan. no way bloblul

quartz kindle
#

they're about the same, not necessarily faster

#

polka and fastify

#

depends on which benchmark you follow

inner jewel
#

if you go by transfer speed fastify wins

earnest phoenix
#

yea I'd say margin of error, since benchamrks vary.

#

But we can all agree, that either choice is better thna express

inner jewel
#

again, not like performance matters for a discord bot

#

if you don't have thousands of concurrent accesses

#

just use whatever is easier

quartz kindle
#

there's also rayo

#

which apparently is faster than both in some benchmarks

earnest phoenix
#

I mean, there is a point where you can't be ignorant

#

polka is basically express's API.

#

anything is easy if you take time to learn it

quartz kindle
#

there's also turbo-http which is a node http replacement

#

roughly twice as fast as all others

sick cloud
#

koa exists

quartz kindle
#

restana + turbo-http = fastest node framework

bright spear
#

what about just http

vernal basin
#

is there some way to take the name of a channel, get the bot to take that channel and then post in a channel with a specific name? for example:

#channel-a is where the message is sent
#channel-a-test is where i want the bot to respond.

and this would go for letters a, b, c, d, e, and so forth. (is there some way to do this using channel ID's? I'm not sure if there's a correlation between channel ID and name of channel though.)

sick cloud
#

ids are unique

#

names arent

#

you can have 2 channels with the same name

vernal basin
#

ah i see

#

is there another possibility to get it to work

last ferry
#

If you have a set channel you can just have your code so it gets the channel you want to send it in and then responds in there

vernal basin
#

ah i see

echo pumice
#

Why is my owner ID rounding up lol

#

Do I need to store it as a string?

keen drift
#

what

bright spear
#

Yes IDs are strings

keen drift
#

You can store them as uint64

#

less space needed & calculations

bright spear
#

Well many languages like js will screw them up cuz they're too big

#

That's why they're strings in the first place

hollow fulcrum
#

Not python

valid frigate
#

ok but imagine having to indent everything mmLol

slender thistle
#

You get used to it at some point Think

keen drift
#

imagine ide auto indenting for you

bitter sundial
#

no need to imagine

misty rune
#

a lot of bots are actually triggering message updated after the embed load

sick cloud
#

because they don't filter

misty rune
#

i guess yeah

gloomy fog
#
.send({ server_count: client.guilds.size })

to Send guilds size
how to update shard count?

#

shard_count?

earnest phoenix
#

@sick cloud koa is one of the slowest http frameworks you can use

zealous veldt
#

Yeah use express

earnest phoenix
#

coment on fais un bot

hallow prairie
#

Use polka

earnest phoenix
#

@zealous veldt Express is even slower bloblul

rigid crane
#

Hi

oak cliff
#

Hey so I really need some help, i've asked a few other people and theyre like "oh it should be working idk whats causing it"

Whenever someone new tries to use my bot that hasn't before, it doesn't respond. I have to reload the bot and then it works for them.
and sometimes if someone has used the bot before, and then they try to use a command, it doesn't work for them either.

#

I can send my index file if someone wants to try to help me

vernal basin
#

if two channels with related names are in the same category, is there a way to send a message to a specific channel without using channel ID?

Category A:

  • #channel-a is where the bot receives a command
  • #channel-a-test is where the bot should send the message
atomic sleet
#

@oak cliff if its javascript I could help

oak cliff
#

it is discord.js yes

atomic sleet
oak cliff
atomic sleet
#

I dont see anything that wouldn't let them not use the bot

oak cliff
#

im really frustrated cause it should be working by all accounts but it doesnt >.<

inner jewel
#

try using a debugger

#

and setting some breakpoints

oak cliff
#

alright, will try

inner jewel
#

so the bot will pause in the middle of the function and you can inspect the local variables

topaz fjord
#

@oak cliff yes you can get a channel by id

#

...channels.get('id')

oak cliff
#

uh yeah i knew how to do that

#

the issue i was having earlier with that was i have the ids

#

how do i find the actual channel and what server its in

topaz fjord
#

Are you using specific ids

oak cliff
#

well when my bot can't post, it sends a message in console with the path, which has an id in it

topaz fjord
#

to get the guild id that the channel is in you do

<Client>.channels.get('id').guild.id
oak cliff
#

i see thank you

silver flare
#

Anyone able to help me with a really quick js code pm me

earnest phoenix
#

No. No one will pm you

#

Ask the question here if it has to do with bot development

silver flare
#

i aint tryna dev

#

im tryna pay someone to dev for me

earnest phoenix
silver flare
#

people are V stupid in general

inner jewel
#

the people in general are the same people in here

uneven rover
sick cloud
#

if i have an array of values (ie. [true, false, true true]) how could i make a % like 75% true

#

like a report of the values

night imp
#

@sick cloud includes size?

#

Assuming js

smoky spire
#

filter

sick cloud
#

yeah, like out of the 4 results, 75% were true

night imp
#

Or what's that thing

#

Reduce

#

Use reduce to check if it is true if so add certain proportion of total

#

f=>if(element == true) {
percent += 100/array.length
}

#

@sick cloud

sick cloud
#

alright, i'll give it a go

#

thanks 👍

night imp
#

Np

quartz kindle
#
let n = 0;
let l = array.length;
for(let i = 0, i < l; i++) {
    if(array[i]) n++;
}
result = n*100/l```
slate pilot
#

what is the best database to use in a bot that exceeds 500 servers and can be modified easily?

bright spear
#

Well there's no best database

west raptor
#

most people prefer mongo or rethink

#

from what ive seen

inner jewel
#

there's no best database²

#

and which one to use depends on your exact needs

west raptor
#

^

slate pilot
#

I will use MongoDB but most commands will be in WEB DASHBOARD

bright spear
#

Can you stop making random things bold and caps

#

It's annoying

west raptor
#

^

slate pilot
#

👍

sick cloud
#

mongo or rethink are your best bets tho

#

rethink is better for realtime as well, since thats what it was made for

safe path
#

Im having trouble implementing server count into my bot (python), it says bot is undefined. Any fixes?

sick cloud
#

make bot defined

safe path
#

to what?

#

client id?

sick cloud
#

to your bot

safe path
#

name of bot, like bot = 'SubwayBot'?

#

because 'to your bot' isn't specific

sick cloud
#

to your bots client or whatever

safe path
#

so client id

#

i'll do that

sick cloud
#

no

safe path
#

o

sick cloud
#

the client object

#

like if you have client.login or something, idk

#

you set it to client

#

i dont use python

safe path
#

client = discord.Client()

#

i'll try doing bot = discord.Client()

#

Exception has occurred: AttributeError

#

any dev know python that can help?

#

Im having trouble implementing server count into my bot (python), it says bot is undefined. Any fixes?

west raptor
#

what

#

version of

safe path
#

@west raptor latest, i believe (im also using python 3.6.7)

vernal basin
#

if two channels with related names are in the same category, is there a way to send a message to a specific channel without using channel ID?

Category A:

  • #channel-a is where the bot receives a command
  • #channel-a-test is where the bot should send the message

there is a category ID, is there some way to make use of that?

bright spear
#

@vernal basin whenever you ask a question always say the lib

#

however you should know that there can be 2 channels with the same name in one category

vernal basin
#

ik. is there some workaround like, if it's given there isn't 2 duplicate names?

discord.js

bright spear
#

k gimme a sec

knotty steeple
#

@safe path what is "latest"

spare spruce
#

is there way i can set images format from data:image/png;base64, to embed.setThumbnail("")

sick cloud
#

upload

safe path
#

should be updated

knotty steeple
#

i know

#

what is

#

latest

safe path
#

IDK man im a python beginner

knotty steeple
#

a python beginner knows what version of something they are using?

#

thats not an excuse

#

async or rewrite

safe path
#

@knotty steeple async

knotty steeple
#

ok

#

get rewrite

bright spear
#

@vernal basin js message.guild.channels.filter(c => c.parentID === 'CATEGORYID' && c.name === 'CHANNELNAME').first()

vernal basin
#

ah i see

#

thank you

empty owl
#
fs.readdir('./cmds/', (err, file) => {
        if(err) console.log(err)
  
  let jsfile = files.filter(f => f.split(".").pop() === "js")
  if(jsfile.length <= 0) {
    console.log("Err: Could not find commands.");
    return
  }
});

it says files isnt defined

smoky spire
#

That would be true, you called it file

empty owl
#

o

#

Thanks

#

I didnt see that

formal agate
#

Trying to made a command handler that gathers commands from different folders. The furthest I've gotten is below, everything is working below this message so far. Except

jsfile.forEach(function(f, i){
            let props = require(\`${config.commanddir}${config.commands[i2]}/${f}\`);
            props.config.command.forEach(function(name){
                bot.commands.set(name, props);
            });
        });```

entire code is here 
```let index;
for(index=0;index<config.commands.length;index++){
    let i2 = index;
    fs.readdir(config.commanddir + config.commands[index], function(err, files){
        if(err) console.log(err);
    
        let jsfile = files.filter(f => f.split('.').pop() == 'js');
        if(jsfile.length<=0){
            console.log('error reading files');
        }
    
        jsfile.forEach(function(f, i){
            let props = require(`${config.commanddir}${config.commands[i2]}/${f}`);
            props.config.command.forEach(function(name){
                bot.commands.set(name, props);
            });
        });
    });
};```
rocky mesa
#

what language is this

formal agate
#

Discord js, so java script. Sorry i forget to mention

west raptor
#

did you mean commands?

formal agate
#

maybe lol

west raptor
#

lol

rocky mesa
#

I have a working one if you want it

west raptor
#

no

#

no spoonfeeding

formal agate
west raptor
#

hmm

formal agate
#

sorry different error

#

before it was not a function

#

now it is undefined

slender thistle
#

@safe path Full error and full code please

safe path
#

I’ll get it to you tm, it’s late for me

slender thistle
#

👌

bright spear
#

@formal agate props.config.commands doesn't exist

#

According to that error

earnest phoenix
#

anyone here good at html lol

meager garden
#

What do you need help with @earnest phoenix?

earnest phoenix
#

oh True its u lol

#

I need help creating a website.

meager garden
#

Which part are you stuck on?

earnest phoenix
#

Everything 😂

#

I dont expect a spoon feed but how do u change the background of the color

meager garden
#

If you mean color of the background, then it would be

element {
    background-color: #FFFFFF;
}

in your stylesheet -- The element would most likely be body if you're trying to change the background for the entire website

Related resources: https://www.w3schools.com/CSSref/pr_background-color.asp

earnest phoenix
#

ty

#

@meager garden sorry for ping but when i edit the website and do <person> it cancels it out how can i stop that?

meager garden
#

No worries about the ping, but I'm not sure what you mean about your error

earnest phoenix
#

hmm wait

#

@meager garden So

#

what i do

#

then turns out like

meager garden
#

<text> defines an HTML tag, if you're trying to get a line of code it would be

`<person>`

The 2 `'s define the line of code

flat obsidian
earnest phoenix
#

K

bitter sundial
#

I believe you can also escape it by adding a \ in front of it

lament meteor
#

whats the best way to make a reminder in js?(and if the process turns off it still works if i reboot)

latent willow
#

Save the reminder time and message in a db

Then check your reminder table each x minutes for and compare the time if reached send the reminder and flag it as done or delete it

earnest phoenix
#

A comment

#

👏😂

tight heath
#

(and maybe cache them on launch with setTimeout)

#

¯_(ツ)_/¯

lament meteor
#

@latent willow the issue with that is if the process turns off then.... it would stop counting

latent willow
#

You don't count you just save the time when the reminder should be triggered and compare it to the current time whenever you check

topaz fjord
#

You can also use &lt;person&gt; @bitter sundial

bitter sundial
#

@topaz fjord yeah but I dont really like the look of that lol

topaz fjord
#

meh

bitter sundial
#

and yeah the markdown parser might use \ which would just look nicer

chrome olive
#

u

earnest phoenix
#

how can i get the avatar of a user in a new member event

slender thistle
#

What lib

echo pumice
#

the channel description should tell you to state your library...

earnest phoenix
#

is there anything else rather than ffmpeg to play audio?

#

Javascript @slender thistle @echo pumice

smoky spire
#

That's not a library

bright spear
#

@earnest phoenix that's a language not a lib

earnest phoenix
#

discord.js

#

guys is ffmpeg an app i dont get it

#

is that a library

#

??

#

will it work if i transfer my app to another place

amber junco
#

umm... how make ur bot automatically send images and messages to a channel?
Example:
!set-image
The bot sends images daily

earnest phoenix
#

how do I make my bot say “I don’t have permission to do that” when the channel has missing permissions because I keep on getting errors from that (discord.py) mention when answering me question

#
if (!message.guild.me.hasPermission
amber junco
#

thats for js righ?

earnest phoenix
#

yes

amber junco
#

k

earnest phoenix
#

omg

#

why nobody sees me

#

wym

amber junco
#

?>

earnest phoenix
#

oh

#

it will work if you transfer your app, as long as ffmpeg is installed correcttly

#

now, how do i make this work

    let role1 = member.guild.roles.find("name", "▃▃▃▃▃▃▃▃▃▃");
    let role2 = member.guild.roles.find("name", "Player 👊");
    let role3 = member.guild.roles.find("name", "Bots");
      if(!member.bot) return member.addRole(role1).catch(console.error);
      if(!member.bot) return member.addRole(role2).catch(console.error);
      if(member.bot) return member.addRole(role3).catch(console.error);
zenith oriole
#

try using else ifs

#

and not indenting your code incorrectly

earnest phoenix
#

#deleted-channel ?

zenith oriole
#

join discord api

earnest phoenix
#

welp but i need to isntall ffmpeg ont he other machine too?

zenith oriole
#

don't use ffmpeg

#

use lavalink

earnest phoenix
#

lavalink?

#

i dont even know how to implement ffmpeg

#

lmao

amber junco
#

umm... how make ur bot automatically send images and messages to a channel?
Example:
!set-image
The bot sends images daily

quartz kindle
#

you need to save the channel somewhere

#

like a database

zenith oriole
#

save the channel and image, etc.

#

and use a timer, or whatever your language has to send messages

earnest phoenix
#

/invite

#

oops

#

sry

zenith oriole
#

@earnest phoenix look up what it is and don't just say no

earnest phoenix
#

its hard there are a lot of thigs i do.t know im so confused

zenith oriole
#

do one thing at a time

#

no reason to be confused unless you're handling race conditions

earnest phoenix
#

is there anyway to make it so if someone joins the server with an invite my bot can say who the inviter was?

smoky spire
#

You can fetch all invites and see which ones uses increased

#

@earnest phoenix

uneven rover
dim grove
#

Please ping me with the response.

serene sun
#

would anyone be able to help me with a npm install?

modern sable
serene sun
#

it keeps saying "Sorry, name can only contain URL-friendly characters."

dim grove
#

Oh, just found out.

leaden lance
#

!invite

dim grove
#

Corrected that, it no longer DMs on leave.

#

For the NPM install, what are you trying to install? As in, what exactly are you typing?

earnest phoenix
#

i dev bot have no role

#

xd

dim grove
#

Huh.

quartz kindle
#

@serene sun what are you trying to install?

empty owl
#
(node:15740) UnhandledPromiseRejectionWarning: RangeError: RichEmbed field values may not be empty.

    at RichEmbed.addField (/rbd/pnpm-volume/796e667b-22ab-4154-b10d-18c07f3647b5/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/structures/RichEmbed.js:165:34)

at Object.module.exports.run (/app/cmds/8ball.js:20:8)

at Client.bot.on (/app/index.js:39:28)

    at emitOne (events.js:116:13)

    at Client.emit (events.js:211:7)

    at MessageCreateHandler.handle (/rbd/pnpm-volume/796e667b-22ab-4154-b10d-18c07f3647b5/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)

    at WebSocketPacketManager.handle (/rbd/pnpm-volume/796e667b-22ab-4154-b10d-18c07f3647b5/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)

    at WebSocketConnection.onPacket (/rbd/pnpm-volume/796e667b-22ab-4154-b10d-18c07f3647b5/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)

    at WebSocketConnection.onMessage (/rbd/pnpm-volume/796e667b-22ab-4154-b10d-18c07f3647b5/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)

    at WebSocket.onMessage (/rbd/pnpm-volume/796e667b-22ab-4154-b10d-18c07f3647b5/node_modules/.registry.npmjs.org/ws/4.1.0/node_modules/ws/lib/event-target.js:120:16)

(node:15740) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:15740) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

#

I dont know what this means

#

I dont send empty embeds

warped ruin
empty owl
#

ik

#

but its not empty

#

let choicesrandom = choices[Math.floor(Math.random() * choices.length)]
let ballEmbed = new Discord.RichEmbed()
.addField('Question', question)
.addField('Answer', ${choicesrandom})
.setFooter(Asked by ${message.author.username})
message.channel.send({embed: ballEmbed});

#

let diceEmbed = new Discord.RichEmbed()
.addField(${message.author.username} rolled a dice, ${LAOL} ${lol})
.setFooter('Dice')
message.channel.send({embed: diceEmbed});

#

see?

#

I can show u my whole code if u want

warped ruin
#

that's weird

#

try doing console.log(diceEmbed)

empty owl
#

here

west raptor
#

token

empty owl
#

its protected in the env

west raptor
#

collaborators can see it

empty owl
#

ik

empty finch
#

ello

empty owl
#

but i didnt invite to collab

empty finch
#

How do i make a bot lol

empty owl
#

um what???

west raptor
#

@empty finch u dont

empty finch
#

joking

#

ik

#

joking

empty owl
#

boi watch a yt seris

empty finch
#

relax

earnest phoenix
#

hey idk why this isnt working but can anyone help me with this

client.shard.broadcastEval(`let guildDef = this.guilds.get('506559251167313920'); let user; let hasRole; if(guildDef) user = guildDef.members.get('${msg.author.id}'); if(user) { if(guildDef.member(user).roles.some(r=>["Premium"].includes(r.name))) { hasRole = "true" } else { hasRole = "false" } } else hasRole = "false"; hasRole;`)
inner jewel
#

user = guildDef.members.get('${msg.author.id}'); guildDef.member(user) it's already a member

#

.some(r=>["Premium"].includes(r.name)) should be .find(r => r.name === "Premium")

#

also why hasRole = "true"/hasRole = "false" instead of just using booleans?

serene sun
#

could anyone help me with a npm install?

inner jewel
#

you could also initialize it to false and remove the assignments to false

earnest phoenix
#

o ok

smoky spire
#

Why not just <member>.hasRole()

west mango
#

All I want to do is

#

grab the url param "src" from the URL

#

and then just return the dominant colour

#

on the webpage

#

but idk why it's not working

earnest phoenix
#

how would i make something not run in a ready event because it does not use member or message so it cant be that so wat would be before guild.id

empty owl
#

What

#

What are u trying to do

earnest phoenix
#
client.on('ready', () => {
  wait(1000);

  client.guilds.forEach(g => {
    g.fetchInvites().then(guildInvites => {
      invites[g.id] = guildInvites;
    });
  });
});
empty owl
#

I see

earnest phoenix
#

i want it to be only for 1 guild

empty owl
#

U trying to check invites?

earnest phoenix
#

yes

west raptor
#

first