#development

1 messages · Page 683 of 1

opaque eagle
#

I've always just used the built-in http module that node provided, which seemed to work fine for me.

onyx summit
#

Definitly, express also builds around the http module (afaik)
I think it makes routing and parsing a lot easier
(and parsing paramaters in paths etc. like /projects/:id/stuff)

opaque eagle
#

oh

onyx summit
#

because in rest apis you do
/projects/some id here/tasks a lot

#

and parsing the parameters yourself is cancer, while in express you just do
app.get('/projects/:id/tasks..
and later you can access the id with req.params.id

quartz kindle
#

im using restana in my api

#

but basically there are 375398457 http abstractions, just chose one lul

onyx summit
#

I mean, you have a bunch of options,
fastify, express, loopback (what is built on express)

#

just use what looks best to you, lol

pale ether
#

Anyone able to help me out on this?
Running my own Windows server:

I have 2 bots (A&B) (dotnet core), which I want to run simultaneously.
Bot A gets launched fine, but starts 2 instances, thus sending command output twice
Bot B gets no instances at all...

(starting them through a batch file with 5sec delay in between them)

west spoke
#

start them seperate

#

eg using 2 command prompt windows

pale ether
#

That's what I'm doing

west spoke
#

then it should be fine. Something in your code is going wrong

pale ether
#

cd DirA -> start "BotA" dotnet run ... -> timeout 5s -> cd DirB -> start "BotB" dotnet run ...

#

Ah nevermind, apparantly I forgot to change the drive when copying files over from my dev machine to my server

#

I'll point out the fact that I'm an idiot myself, so you all don't have to! 😂

onyx summit
#

Actually wanted to laugh at you for using a windows server, but from my experience Linux with dotnet is cancer

west spoke
crude tide
#

hello anyone whos good at js here? help please

copper cradle
#

@crude tide just ask your question

#

someone may have an answer

loud salmon
#

dbl ask2ask @crude tide

covert turtleBOT
#

Dont ask to ask
Just ask your question
it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.

onyx summit
#

what is the difference between the stream#close and the stream#end event?
(nodejs)

#

found it, end means there is no more data to write, and close means it closed

golden bone
#

I get this in debug when trying to turn the bot on

      URL: wss://gateway.discord.gg
      Recommended Shards: 1
[WS => Manager] Session Limit Information
      Total: 1000
      Remaining: 0
[WS => Manager] Spawning shards: 0
[WS => Manager] Exceeded identify threshold. Will attempt a connection in 4155597ms```
#

bot wont start

#

Oh now it's online

#

But nevertheless what does that mean and how to possibly prevent it

earnest phoenix
#

don't login more than 1000 times a day

opaque eagle
#

Lmao

earnest phoenix
#

how tf do you even manage to cross 1k logins a day without being in like 10k guilds

latent oasis
#

U dont have any shards

#

U have only single bot

#

That's why it don't show shards

#

In your bot, only server count

#

?

#

Wdym?

#

Explain

#

I can't get what u talking about

#

Hmm

#

Explain

#

I'll get it

#

May be

slender thistle
#

Widget

latent oasis
#

Hmm

slender thistle
#

Bot's Edit page unless you mean in the code

latent oasis
latent oasis
onyx summit
#

heeeelp, I need to convert from MP3 to PCM, but I only get WSHHSS
using node-lame

 const encoder = new Lame({ output: outputFile, bitrate: config.audio.bitrate, raw: true, meta: {} }).setFile(inputFile);
await encoder.encode();
earnest phoenix
#

don't know anything for node but you can use ffmpeg

opaque eagle
#

^

unique nimbus
#

ffmpeg is good for this kind of stuff

onyx summit
#

yeah but I couldnt get it to convert pcm to mp3

#

nvm found something

#

its with streams but that will work too

pale mountain
#

hi 😄

#

'-'

copper cradle
onyx summit
#

fcking shit, now I can convert from mp3 to pcm but not back

#

this is all cancer

#

I can see it coming, I will just save the raw mp3 because I couldnt get it to work

topaz sphinx
#

this is bad

#
for items in raw_items:
            countval = ([item[0] for item in raw_items]).count(items[0])

            if countval == len(taglist):
                pre_result.append(items[0])
#

the finished filtering shows how long it takes to run the code above

#

can someone find any way to optimize it?

#

raw_items has the form [[i, v][i, v][i, v]]

quartz kindle
#

is that seconds or miliseconds?

#

if its miliseconds, 0.16ms is more than good enough

topaz sphinx
#

@quartz kindle its seconds

#

it's n^2 comparisons

#

wheras n is amount of items in raw_items

quartz kindle
#

so you need to compare each item to all other items?

#

i dont understand that very well since it doesnt look like javascript

#

but if i understand correctly, there might be repeated comparisons you could avoid

#

as well as looping over numbers in a for loop should be faster than looping over items in a for in

earnest phoenix
#

@latent oasis where is that widget customizer?

topaz sphinx
#

@quartz kindle it's a rather complex one, both i and v can appear multiple times

quartz kindle
#

hmm, is there an example you could provide?

earnest phoenix
#

Someone wanna review my bot?

#

Ping me in response

onyx summit
#

@earnest phoenix no, I don't

earnest phoenix
#

-_-

#

Not that kind of response...

onyx summit
#

Well you didn't say that ;)

earnest phoenix
#

...

earnest phoenix
#

@earnest phoenix I will

#

Aight dm me

proper ember
#

So, I have a bit of a problem.

#

I recently ran into an annoying problem with one of my bots where it failed to connect to a certain couple of guilds once in a while

#

Somewhere during the process of getting the presence or something. "Unable to load json" or something.

#

I assumed it might have been because I was running v2 of Discord4J, weird considering other bots running it have no issues, and began to rework it into v3.

#

I got a good bit of it down, but one of the things I can't figure out is how to send files. Is it even possible in v3?

#

I apologize if this is a stupid question, but I'm new to v3 and reactive programming as a whole.

worthy ivy
#

oh my

#

So wait

#

What coding language is it again?

proper ember
#

Java

#

Had a bot running 2.10 I believe with a mixture of v3 for music stuff

#

Worked fine until the weird error causing it not to work with a certain guild.

#

After a while, it went away. I assumed it was maybe something on Discords end until it popped up again. Not wanting to risk downtime, I started searching for a solution.

#

Unfortunately, I couldn't find any info on the issue and assumed it was perhaps due to v2 running outdated stuff.

worthy ivy
#

Oops cant help ya

#

Im using discord.js

proper ember
#

No problem bud, thanks anyway!

unborn shoal
#

Can anyone help give some examples of customizing a bots page?

#

Just certain text colors and the background

zealous veldt
#

Hey my mac friends, while using git, have you ever gotten errors like this when trying to git add files?

warning: unable to access '/Users/<my username>/.config/git/ignore': Permission denied
warning: unable to access '/Users/<my username>/.config/git/attributes': Permission denied```
Ping me with responses thanks
dusky marsh
#

looks like a ownership problem ¯_(ツ)_/¯

zealous veldt
#

will try it, thanks

torn meteor
#

I get this error everytime I try to deploy the branch to Heroku

#

And apparently I need to deploy rhe fucking branch to it or it wont host it

zealous veldt
earnest phoenix
opaque eagle
#

I'm writing an image manipulation API for my bot, but how would I go about storing the images I made? should it be sent as a buffer or should I store it internally and send a link, or what...

keen yacht
#

what up bois

opaque eagle
earnest phoenix
#

Promise { <pending> }Today at 7:08 AM
I'm writing an image manipulation API for my bot, but how would I go about storing the images I made? should it be sent as a buffer or should I store it internally and send a link, or what...
it depends on what you want to achieve

#

you'd usually always want to send the buffer

wheat jolt
#

the user is on the guild

#

hold on

#

nvm

#

I had to use msg.guild.member(user).bannable instead of using user.bannable

twilit rapids
#

Restoration 100

opaque eagle
#

Or message.mentions.members.first() should also work... @wheat jolt

wheat jolt
#

wtf

#

I am using that

#

but I want with ids too

#

nvm tho

onyx summit
#

And it's also not a promise

#

You don't have to await it

opaque eagle
#

^

wheat jolt
#

I fixed it

opaque eagle
#

Cool

wheat jolt
#

Like how I said above

#

I don't need help anymore

opaque eagle
#

Alright

wheat jolt
#

I added those awaits because other errors

#

¯_(ツ)_/¯

onyx summit
#

Well they certainly don't make sense there

#

And basically do nothing

opaque eagle
#

^

#

Those awaits wouldn’t have fixed anything

grave pilot
quartz kindle
#

you have too many event listeners

#

either you're using duplicated events, like having .on("message") multiple times in your code, or you're using a lot of collectors and possibly not shutting them down properly

opaque eagle
#

They have 11 listeners for guildMembersChunk

#

Let and const are block scoped

#

Also that code in general is really badly written, ngl

#

No, that’s not what that means.

#

Also don’t use JSON as a database

quartz kindle
#

@woven sundial your problem is this

opaque eagle
#

Lol

mossy vine
#

if (args.join(" ") == " ") wat

opaque eagle
#

IKR

quartz kindle
#

you are not checking if user is a bot. you are completely replacing user with user.bot

opaque eagle
#

That whole file is filled with bad code like that

mossy vine
#

^

quartz kindle
#

its not that bad

#

ive seen way worse, trust me

opaque eagle
#

lol

quartz kindle
#

let him experiment and learn

#

i told you why

#

you are replacing user with user.bot

#

so user no longer exists

#

when comparing, always use === or ==

opaque eagle
#

Those two code blocks do the same thingjs let user; // If the user mentions someone, display their stats. If they just run userinfo without mentions, it will show their own stats. if (message.mentions.users.first()) { user = message.mentions.users.first(); } else { user = message.author; }``````js let user = message.mentions.users.first() || message.author;

#

Except one is more concise

#

It is

#

Your user is wrong because you redefine it

#

Also don’t use JSON as a db

#

Not the brightest idea mon ami

#

Your call

#

Lol nice joke

#

Anyways have a nice day

quartz kindle
#

i didnt tell you to not use the user

#

i told you to compare it correctly, ie === not =

#

= means you're assigning a new value to it

#

aka, replacing

opaque eagle
#

= assigns a value
== check value, not type
=== check value and type

quartz kindle
#

also, to check if a user is a bot, you dont need to compare anything at all

#

you just do if(user.bot)

#

because if expects a true or a false, and user.bot is always either true or false

opaque eagle
#

Do any Node.js peeps here use lodash?

#

I don’t have a question, I’m just wondering

mossy vine
#

dont directly use, but its a dependency of a shit ton of packages

opaque eagle
#

Yeah

#

I met someone online who used node but didn’t know what lodash was, which kinda surprised me

mossy vine
#

lodash itself seems like a useful thing, i just never found a need for it

quartz kindle
#

i get annoyed when stackoverflow solutions tell you to use lodash for something simple

opaque eagle
#

Lmao

quartz kindle
#

i mean, why use a 17k line library and do _.divide(5,7) when you can just do 5/7

#

its like a js library version of a generic discord bot with 400 commands

opaque eagle
#

Lmao

#

But lodash is really useful in some scenarios

onyx summit
#

its usefull for cloning and setting/getting/deleting nested propertys with dot notation strings

quartz kindle
#

well if i need to do something like that, i usually just devise my own function

onyx summit
#

some dependencie has it installed anyway

opaque eagle
#

That’s like saying “well if I want to interact with the Discord API, I’ll just write my own Discord API wrapper instead of using d.js” @quartz kindle

quartz kindle
#

Yes, but my example is only one function, not an entire interface lul

#

Although writing my own lib does sound attractive

opaque eagle
#

Lmao

#

I wrote one before but I got rid of it cuz I didn’t see the point in having one lmao

#

It was much better to just contribute to an existing lib

#

It was written in TypeScript and used a lot of TypeScript features like decorators and shit

sinful lotus
#

if (user.bot) GWunuDrakeNo
if (user.bot === true) GWomoDrakeYea

opaque eagle
#

if (!!user.bot)

onyx summit
#

if (user.bot === !0)

#

hah we are so funny

quartz kindle
#

At this point, just rewrite that in jsfuck

#

Or make a discord lib written in jsfuck

onyx summit
#

good idea

#

I have better things to do

opaque eagle
#

I’ll do that once I get home

onyx summit
#

like

opaque eagle
#

Re-write eris in JSFuck

onyx summit
#

Okay actually I should finish my rewrite but I never do it

opaque eagle
#

Lol

onyx summit
#

just stuck on this annoying problem for weeks

opaque eagle
#

What is it

onyx summit
#

and this evening I will try the solution I didnt want to use, but probable have to cuzz nothing else works

#

converting audio

opaque eagle
#

Nvm I can’t help

#

Audio/video stuff isn’t my thing lol

onyx summit
#

same, but I gotta do that tiny part

#

and then never again

opaque eagle
#

Must be tough

onyx summit
#

I got it
PCM => Mp3
working,
but not
MP3 => PCM

#

no its probably easy, I'm just retarded

opaque eagle
#

Just put in an uno reverse card

onyx summit
opaque eagle
#

Bam done

west spoke
#

what

#

I've awaited it already, and same thing.

slender thistle
#

is it under a coroutine

#

.run is blocking

west spoke
slender thistle
#

you are using await outside of an async def function

west spoke
#

then how the fuck do I call it

slender thistle
#

asyncio Shrug

west spoke
#

xd

slender thistle
#

Honestly though

#

That won't work

west spoke
#

it worked beforeGWmiyanoWhat

slender thistle
#

Well only once

#

Due to the fact that .run blocks

west spoke
#

hm ok

slender thistle
#

Not really sure what you're trying to do there apart from running the bot

#

Either way, get_event_loop().run_until_complete in asyncio might be helpful

west spoke
#

Perhaps

slender thistle
#

if you don't use .run, that is GODLUL

#

literally could just make a simple function or use client.run directly

west spoke
#

I'm trying to make it restart on error (again)

twilit rapids
#

pm2 Thonk

inner jewel
#

systemd

mossy vine
#

what would be the equivalent of client.shard.id on d.js master?

mossy vine
#

lmao even better, why am i not getting any logs on this

const { ShardingManager } = require('discord.js')
require('dotenv').config()

const manager = new ShardingManager(`${__dirname}/bot.js`, {
    token: process.env.DISCORD_TOKEN,
    totalShards: 1
})

manager.spawn()

manager.on('shardCreate', shard => {
    console.log(`Launching ${shard.id}...`)
})
earnest phoenix
#

if i had to take a guess, i'd say you're spawning first and then telling it to log when a shard is created

#

trying putting the on method above the spawn

mossy vine
#

huh that worked, thanks

quartz kindle
#

guilds have a shardID

#

other than that, master has client.shard as well~

#

with .ids instead of .id

#

because of internal sharding, each process can have multiple shards

mossy vine
#

ah, so the first element of ids is what i need since i dont use internal sharding?

quartz kindle
#

yup

mossy vine
#

thanks

#

its possible for a shard to have 0 guilds. huh

earnest phoenix
#

it's not

#

You should shard at 2500 servers

opaque eagle
#

Lol

#

I’d start sharing at 1500

earnest phoenix
#

shit i hit 2 by accident lol

opaque eagle
#

You must shard at 2.5k

earnest phoenix
#

it's suggested to start sharding at 2k, enforced at 2.5k

mossy vine
#

i start the bot with sharding in mind to not have to rewrite lots of bullshit later cosmicbrain

opaque eagle
#

Internal sharding makes it easy in v12

quartz kindle
#

i think discord's fetchRecommendedShards gives you 2 shards starting from 1500 guilds

earnest phoenix
#

you guys know any services that provides you with an url, that you can manage and redirect to other url's ?

onyx summit
#

sssoooo, basically dynamic url shortener?

earnest phoenix
#

haven't of that before

copper cradle
#

@earnest phoenix freenom

#

FreeDNS @earnest phoenix

late hill
#

How does guild distribution over shards work

#

As most times they aren't even at all

#

Is it random?

#

Based on users?

#

And who decides what shard a guild goes on

#

Like is it a discord thing

#

Or does the library do it

earnest phoenix
#

@copper cradle thank you, i'll check em out

late hill
#

Many questions

inner jewel
#

@mossy vine @earnest phoenix yes it is

#

if you start 5 shards on a 2 guild bot, you'll have shards with zero guilds

earnest phoenix
#

huh

#

interesting

mossy vine
#

i started 2 on 3 XDcursed

inner jewel
#

@late hill shard_id = (guild_id >> 22) % shard_count

earnest phoenix
#

i thought they just kick you from the gateway

inner jewel
#

starting 2 shards on 3 guilds can have all 3 guilds on one shard

#

due to the formula

#

eg all guilds were created on an odd timestamp

#

they'll all go to shard 1 of 2

mossy vine
#

huh thats interesting

late hill
#

Oh

earnest phoenix
#

hmm, you guys know how an url, is "auto opened" when it's a gif or image

#

is it possible to do that for an url that's forwards to an image or gif

onyx summit
#

dunno wot u mean

earnest phoenix
#

like this

#

the url is for this gif

#

but when i paste it here, discord just opens it

#

how do i make discord do that for an url that is forwarding to an url that is like the above

onyx summit
#

afaik u can only do <theurl> for no embed

earnest phoenix
#

?, so you can't ?

onyx summit
#

well, not really. You would need to check that before sending the url

copper cradle
#

@earnest phoenix you can't

#

discord looks for metadata

earnest phoenix
#

you know any other solution that would achieve my goal `?

copper cradle
#

it isn't opening it

#

it just takes the metadata and shows it

#

it's called web scrapping iirc

earnest phoenix
#

can you forward metadatathinkhfjkld

copper cradle
#

I don't know

onyx summit
#

I dont think the discordbot will follow redirects

#

dafuq are you even trying to do?

earnest phoenix
#

well long story short, i can only use 1 url for embedded images gifs, etc.

#

and i'd like to occasionally change what image or gif that url is

#

but i don't have an easy way of changing the url manually

copper cradle
#

just use a local image

#

smh

earnest phoenix
#

can't

copper cradle
#

or host the image on your own vps

earnest phoenix
#

hmm

onyx summit
#

you are trying to do what?
Change the image?
I mean, whats the problem?

#

dont get it

earnest phoenix
#

it has to be an url

#

or at least something you can type in a discord chat

copper cradle
#

host it in a vps

#

then get the url

#

then you can change it

earnest phoenix
#

any vps services you suggest ?

copper cradle
#

GalaxyGate, GCP, AWS...

#

you can host your bot there too

sinful lotus
#

Contabo is fine

#

for most users

onyx summit
#

|| use the german version for lower prices ||

#

I dont usually say this, but glitch is enough to have a express server send some images, or not?

sinful lotus
#

yeah if you are fine with it resttartiing your server from time to ttime

onyx summit
#

I mean, if its only image hosting, nobody cares

sinful lotus
#

should be fine

earnest phoenix
#

sounds like a plan

#

you're right with stability or w/e not being super important

tidal parrot
#

@loud salmon help my bot borke when i try close logut window box

loud salmon
#

fuck

unique nimbus
#

smh

onyx summit
#

WoA yOu aRe tHe OwNeR oF poKeCorD?

unique nimbus
#

woah

opaque eagle
#

Old topic but yeah VPS prices tend to be cheaper when you view it from a VPN outside the U.S... even more cheap if you view it from a VPN in a third world country

onyx summit
#

contabo is a german provider and is well known in germany, I think that explains why you dont have to pay setup fees if you order on the german website

earnest phoenix
#

Promise { <pending> }Today at 5:23 PM
Old topic but yeah VPS prices tend to be cheaper when you view it from a VPN outside the U.S... even more cheap if you view it from a VPN in a third world country
this

#

it's because of conversion fees

#

sometimes they're miscalculated which can get you like a dollar off

#

and sometimes it's just conversion fees being stupid

onyx summit
#

not the case for contabo tho Angery

sinful lotus
#

I used contabo in past and what they list on their page is true

onyx summit
unborn shoal
#

this always surpasses 1024 characters here

#
    const embed = new Embed()
        .success()
        .title('Server Information')
        .field(message.guild.name, `ID: ${message.guild.id}\nOwner: ${message.guild.owner.user.tag}\nCreation date: ${message.guild.createdAt}\nMembers: ${message.guild.memberCount}`)
        .field('Emotes', emotes);
onyx summit
#

what is emotes

unborn shoal
#

emotes = message.guild.emojis.map(e=>e.toString()).join('');

sinful lotus
#

what if the emotes exceeded 50?

#

clearly it will throw that error

#

you need to find a way to make sure tthe emotes wont exceed 1024

unborn shoal
#

How can I do that

sinful lotus
#

for example :offline: an emote in string iis this biig

unborn shoal
#

ohohhh

sinful lotus
#
:offline:
#

smh

#

iit autto transforms

earnest phoenix
#

\

sinful lotus
#

\ :offline:

#

ugh

#

LOL

earnest phoenix
#

outside of the codeblock

sinful lotus
#

:offline:

earnest phoenix
#

thonk

sinful lotus
#

nah dont works

#

anyways

#

\ :offline:

#

wont really work

#

anyways the emote contains <:nameofemoji:id_here>

sinful lotus
#

iif you tried to send it all in one go you will get that error

#

you need to limit the emotes you wiill send

#

probably use .splice

#

your choice

unborn shoal
#

how would i go about doing this

#

how do i know how many to splice

sinful lotus
#

.map().splice()
experiment with values

#

start from 20 maybe

#

iif that errors make it 10

#

then iincrease it a litttle by little

#

untill you hit that error agaiin

earnest phoenix
#

or just you know

sinful lotus
#

I diidnt memorize whatt III diid

unborn shoal
#

well it works in most servers

earnest phoenix
#

split by last possible space that doesn't cross the char limit

sinful lotus
#

so yeah

#

yeah but you have a public bot

#

expect the unexpected

unborn shoal
#

how would i splice only when its a certain amount

sinful lotus
#

iif (the length of mapped values exceeds some threshold) spliice it

earnest phoenix
unborn shoal
#
        if (emotes.length >= 500) {
            emotes.splice(emotes.length - 500);
        }
#

well the whole thing

mossy vine
#

@earnest phoenix is that your website too?

unborn shoal
#

not just emotes.splice

earnest phoenix
#

nope

unborn shoal
#
        if (emotes.length > 750) {
            emotes = message.guild.emojis.map(e=>e.toString()).splice(emotes.length - 200).join('');
        }
#

What would I do to make something like this work

#

ooh

#

parseInt

earnest phoenix
#

i'm going to skim over this because i have to go in a few minutes; create a new number which has a value of 0, this will act as our index. then create an empty array of strings. do a while loop where the condition is if the index is smaller than the input string length. inside of the while loop, add an if closure, in the if check if index + 1024 is smaller than the input string length, if it is, add a string to our string array which substrings at our index and ends at index + 1024. if it isn't (else), just add our input string substringed at our index. finally outside of the if closure set the value of the index to index + 1024

unborn shoal
#

can you give an exampel

earnest phoenix
#

no

unborn shoal
#

ple*

earnest phoenix
#

this is a method that will preserve all words but split them accordingly to the limit (1024)

quartz kindle
#

i believe discord.js has a function that can do that, let me check

#

yup, Util.splitMessage

unborn shoal
#

I'll just do it manually

#

v

quartz kindle
unborn shoal
#

oh my god

#

thank you

#

emotes = message.guild.emojis.map(e=>e.toString()).join('');
maxEmotes = Util.splitMessage(emotes, { maxLength: 950, char: '', prepend: '', append: '' });

#

@quartz kindle Did I do this correctly?

unborn shoal
#

nope apparently not

quartz kindle
#

why are you doing parseInt(1000)? lmao

#

1000 is already an int

#

maxLength should be the max length of the field, so about 1000

opaque eagle
#

They for it for the same reason people do ```js
{some_string_here}

quartz kindle
#

char should be the character on which to split when the limit is reached

opaque eagle
#

or js message.guild.member(message.mentions.members.first())

quartz kindle
#

lul

opaque eagle
#

Apparently The Source Code does that in their vids

#

@unborn shoal I think you meant to say "MM DD YYYY", since "Do" isn't a thing and neither is "MMMM"

quartz kindle
#

for example, you have a string like this "some text here <some link here> some text here <some link here>" and you want to make sure this string does not go beyond 1000 chars, but you also want to keep the text -> link integrity. you would do something like limit: 1000, char:">", append:">"

#

so the message will be split on the last possible > before it goes over 1000 chars

unborn shoal
#

o

quartz kindle
#

and since the character you are splitting on is removed, you have to add it back

#

by appending it

unborn shoal
#

So I'd probably do char:":", append:":"

#

wait

#

oh so >

#

maxEmotes = Util.splitMessage(emotes, { maxLength: 1000, char: '>', append: '>' });

#

@quartz kindle

quartz kindle
#

yes, try that

#

that will give you an array

unborn shoal
#

exceeds 1024 chars

quartz kindle
#

like this [list of emojis until 1000 chars, next list of emojis from 1000 to 2000 chars, next list of emojis from 2000 to 3000 chars]

unborn shoal
#

ohh

#

so id do

#

maxEmotes[0]

#

?

quartz kindle
#

yes

#

and then maxEmotes[1] on another field, or message

unborn shoal
#

@opaque eagle uhhh theres nothing wrong with my code

#

it works fine

opaque eagle
#

ok

quasi forge
#

So, I have an array of Objects of a specific Class. I want to create a string joining some specific(actually just 2) properties of each of these objects. Is this possible in one line? Or do I need to span multiple lines. I feel like there was some array function for such purposes but I don't remember.

Language: JS

quartz kindle
#

@unborn shoal you still need to pay attention to the embed max char limit, which is 6000 i think

#

so you can check if maxEmotes length is bigger than 5, send the rest in a separate message

unborn shoal
#

yeah i did

#

thanks

quartz kindle
#

@quasi forge array.reduce() is probably what you're looking for

#

or array.map().join()

quasi forge
#

Yea, thanks @quartz kindle

#

^_^

#

It was map.join indeed

copper cradle
#

@quartz kindle whst kind of embed?

#

cuz discord's embeds have a max char limit of 1000 iirc

#

or 1600

#

I'm not sure tho

slender thistle
#

Depends on which part

copper cradle
#

isn't it the same for every part of the embed?

slender thistle
#

No

#

field amount = 25, title/field name = 256, value = 1024, footer text/description = 2048

quartz kindle
#

6000 is for all fields together i believe

topaz sphinx
#

any SQL big brains?

inner jewel
#

total is 6000 yes

copper cradle
#

b r u h

slender thistle
#

Well that's per embed :p

copper cradle
#

I never reach the limit so idk

quartz kindle
#

@topaz sphinx just ask the question

topaz sphinx
#
        INSERT INTO
        AnimeArt_userBookmarks(user_id, image_id_list)
        VALUES ($1, $2)
        
        ON CONFLICT (user_id) DO
            UPDATE AnimeArt_userBookmarks
            SET image_id_list = $2
            WHERE user_id = $1;
#

for some reason it errors on UPDATE

#

doe it doesnt say what error

#

just ERROR NEAR UPDATE

#

i've been digging trough solutions 3 hours straight

#

feel like sleeping already at 7 pm

quartz kindle
#

which database? mysql?

#

in sqlite it should be DO UPDATE SET, without referencing the table a second time

#

depending on which database you're using, it might be the same, or not

latent oasis
#

[2019-08-29 17:17:51]: ERROR Uncaught Exception: MongoError: connection 5 to xxxxxxxxxxx.mongodb.net:27017 closed

cant connect to mongo
when i terminate and create new cluster still same error

topaz sphinx
#

@quartz kindle yeah i found it now!

#
        INSERT INTO
        AnimeArt_userBookmarks(user_id, image_id_list)
        VALUES ($1, $2)
        
        ON CONFLICT (user_id) DO
            UPDATE
            SET image_id_list = $2
            WHERE AnimeArt_userBookmarks.user_id = $1;
#

sorry i were eating stuff, but now im back

#

iT RUNS

quartz kindle
#

👍

opaque eagle
#

If user can be User|undefined, do these two expressions equal each other?
Number(Boolean(user)) and Number(user)

#

I want to get 1 if user is defined and 0 if user is undefined

#

nvm Number(undefined) returns NaN

quartz kindle
#

^

#

it returns NaN for a Map as well, assuming User is a Collection/Map

inner jewel
#

user === undefined ? 0 : 1

opaque eagle
#

No I just did Number(Boolean(user))

#

it works fine

#

I originally got that idea cuz I had this ternary: js user ? 1 : 0

#

Which looked like it could be shortened

peak quail
#

~~why this is not unloding the Command reload

delete require.cache[require.resolve('../../commands/Owner/reload')]
console.log("._.")
```~~
onyx summit
#

does it look good?

latent oasis
#

Yes

#

Chy4e do u know about closed connection error to mongo cluster??
How to fix it?

late scroll
#

Hello guys, is there any way to catch all message on the channel, even if the message was sent when the bot was offline ?

onyx summit
#

No, I don't use mongo sad

latent oasis
#

I get error that I can't solve for 2 days

#

I'm dying

quartz kindle
#

@late scroll you can fetch messages from channels, but you probably dont wanna do that

#

it only works if messages are not older than 2 weeks

latent oasis
#

Ye

quartz kindle
#

its fine if you do it every once in a while or in specific channels

latent oasis
#

I wanted to write it

quartz kindle
#

but if you do it in all channels at once it will possibly get you banned

latent oasis
#

Get your bot

#

Not u

onyx summit
#

both wesmart

latent oasis
#

Sure?

onyx summit
#

no, just guessing lol

latent oasis
#

hmm

onyx summit
#

but you might lose your api access, like, at all

late scroll
#

@quartz kindle the issues is messages are not 2 week old, and the channel i'm aiming would contains at max 10 messages

latent oasis
#

Ye

#

Hmmmm

onyx summit
#

why would you need them

quartz kindle
#

@late scroll if its only one or a few channels (ie, one per guild) then you can use fetchMessages

#

which library are you using?

late scroll
#

discord.js

quartz kindle
#

v11 or v12?

#

(stable or master)

late scroll
#

11.5.1

quartz kindle
#

so it should be channel.fetchMessages(options)

late scroll
#

ok thanks i'll try it

quartz kindle
earnest phoenix
#

Can you create a bot easily on Android ?

#

easily? yes. quality? no.

#

Hm so basic things right? But how?

#

there are apps

#

Can you suggest me any if you know though

#

don't know any, google around

#

Ok thanks

#

though making bots on android is not suggested at all

#

the sheer nature of ARM is already a huge headache

#

Hm then is it also easy to make a bot on a PC?

#

Do I need anything special

onyx summit
#

The ability to code

earnest phoenix
#

What code is a bot based on?

onyx summit
#

Ur decision

earnest phoenix
#

that question doesn't make sense

#

Oo

#

It made way more sense on my head lil

#

I was meaning what code you need such python cc etc

#

But as you said anything that's good

#

that's a programming language

onyx summit
#

Or buying / downloading some bot maker, but most bots are doing the same thing because you don't have flexibility while creating them. But if you code them, you can do whatever you want

#

The language is your decision.

earnest phoenix
#

you can make a bot in any programming language you please, however it's suggested to use languages which already have discord api wrappers

#

So which is the most recommend programming language for dicostd bots

#

there's no recommended language

#

Ok @earnest phoenix and @onyx summit thank u very much for the info

#

use whatever you want

onyx summit
#

But JavaScript and python are the most used, but it really doesn't matter

earnest phoenix
#

yes

#

that's what interpreted the question as and then i was like "oh"

#

@onyx summit that's good to know

onyx summit
#

JavaScript, go, elixir, crystal, python, java, c#, lua
That's all the languages that definitely already have a Discord API wrapper (that's only my knowledge)

earnest phoenix
#

Nice

#

I will try tommorow and make one

latent oasis
#

@earnest phoenix, I used quoda on android

#

Which is really nice

earnest phoenix
#

Ok I will also try this

#

App

latent oasis
earnest phoenix
#

-bots

gilded plankBOT
#

tickNo This user has no bots

earnest phoenix
#

-bots @warped mist

gilded plankBOT
onyx summit
#

Wrong channel but ok

remote lotus
#

-bots

gilded plankBOT
#

tickNo This user has no bots

onyx summit
shadow dust
#

Hey does anyone happen to have react experience ? I am having an issue with an event handler. I have a button html element for which I have a onClick handler but it seems that this handler can only be fired once? If I try to click on the button afterward it does not work anymore. My handler is is literally just console.debug

#

I also dont have any errors

earnest phoenix
#

what's your code

shadow dust
#

return of the render method

<button onClick={this.onClick.bind(this)}>Connect</button>

handler is :

    onClick(e: React.MouseEvent<HTMLButtonElement, MouseEvent>): void {
        e.preventDefault();
        console.debug('test');
}
earnest phoenix
#

you need to pass it a function

#

onClick={() => ...}

#

what you provided is only an invocation if im correct

#

so it only fires once

shadow dust
#

I mean even if I remove the bind part it still does the same

earnest phoenix
#

re-read what i said

#

reading comprehension christmasthink

shadow dust
#

I dont understand actually

earnest phoenix
#

good for you

shadow dust
#

Ok ?

torn meteor
#

Hostility 💯

slim heart
#

How would i go about making my string split every like 5 - 10 words for example, and split it into a new line, i can split every x amount of characters but i want to do words so it doesnt just do random cutoffs

earnest phoenix
#

split the string by space, create a new empty string array and do a for/foreach on the split string array and build your string, every 5th word add the built string to your new string array

lusty dew
#

I actually gotta start on my web dash oh shit

#

Kek

earnest phoenix
#

would it be dumb or even possible to just do my discordbot.org description in an image and have the html link to it ?

sick cloud
#

you can probably

#

but yes it'd be dumb

lusty dew
#

Is there anything out there better then express?

sick cloud
earnest phoenix
#

t.t im just horrible at html and markdown compared to what i can do on gimp or photoshop

sick cloud
#

made by the same developers but lighter

lusty dew
#

Hm I’ll check it out

#

Thanks

sick cloud
#

np

#

and if you really want, just make your own off the http/http2/https modules

lusty dew
#

Yea, just trying to integrate oauth2 but i don’t like the http module that the docs are using. Plus want to expand my knowledge past just express.

opaque eagle
#

If you want to make web dashboards I would also check out front end frameworks

#

Like React, Vue, Angular, etc

lusty dew
#

Yea ima use vue

#

Though I heard it mainly focuses on design then functionality or whatever.

opaque eagle
#

Vue imo is the easiest out of all of them

#

Really fun to use too

lusty dew
#

Yea. What does angular do?

opaque eagle
#

It does the same thing as Vue and React

onyx summit
#

Angular works with typescript, so MmmYes

opaque eagle
#

Those all do the same thing... React is made by Facebook, Angular is made by Google, and Vue is made by some open source community

lusty dew
#

React is made by Facebook?

#

Didn’t know that

opaque eagle
#

Yeah Facebook amazingly makes some open source stuff

#

They also made GraphQL (better alternative to RESTful APIs) I'm pretty sure

onyx summit
#

I wouldn't recommend you to use Angular, it's pretty hard to learn, I would say

opaque eagle
#

^

#

Stick to React and Vue

lusty dew
#

Yea, ima use vue

#

Wait can I use express and http together?

opaque eagle
#

When will Microsoft make their own front end framework lol

#

They seem like the kind of company that would do this stuff

#

like work on OSS projects

onyx summit
#

express just builds onto http

opaque eagle
#

^

#

I've never actually used express in an actual app lmao... ik how to use it but never used it to made real stuff before

lusty dew
#

Express is what I’ve always used

#

Though I’d like to branch out

#

And learn something new

onyx summit
#

loopback 4 KAPPA

opaque eagle
#

I like to use Go for rest apis cuz shit's a little easier to do on there

#

and in the rare occasion i need to make an api in nodejs i just use the built-in http module

#

it's easier to use it than you think

#
import http from "http";

http.createServer((req, res) => {
   res.writeHead(200, { 'Content-Type': 'text/plain' });
   res.write('Hello world');
   res.end();
}).listen(process.env.PORT || 3000);```
onyx summit
#

I currently have to use loopback 4 at work, I think its a cancer thing. Everything requires 5 new files, with 100 Lines each

opaque eagle
#

Lmao

onyx summit
#

You want authorization? ask no more, just create 5 new files lol

idle mountain
#

Anyone know what it means when MongoDB errors with "No SNI name sent, make sure using a MongoDB 3.4+ driver/shell."? I'm using the most recent version of everything, Ubuntu 18.04

#

I remove my server's IP from being able to access the database and it still happens, too

#

been trying to debug this for a few hours now

#

(I ask here because a lot of people here use Mongo I'd assume)

lusty dew
#

So express is just to start the server and make it function while http makes requests for info and such from websites or things like that?

onyx summit
#

Uhhh, no.

sinful lotus
#

express is a webserver

#

webserver handles http requests

#

or https

#

dependiing on your flavor

lusty dew
#

Hm okay

onyx summit
#

Use http

lusty dew
#

So basically I can use express and leave out http

onyx summit
#

Yes, express uses http in it's core

#

you don't have to do anything with the http module

lusty dew
#

Http module on its own is weird.

#

Mk

#

God my eyes are getting heavy

onyx summit
#

Yeah same but it's 9 in the morning

lusty dew
#

It’s 12:21am oof

#

But I got so much work to do with the web dash

#

Sadly coding it on glitch

#

Lmao

#

The vsc code server won’t let me view the web dash

mental thorn
#

Hey, I want to do a few things related to my bot page, 1. What CSS should I define to change the font color of everything I circled in red? 2. How do I remove the annoying things circled in blue or atleast, change it’s color?

#

@bitter sundial help? :p

lusty dew
#

Not a good idea to ping randomly especially admins

#

Without valid reason.

mental thorn
#

Shoot

#

Im sorry :p

#

I usually dont get help until I ping someone

opaque eagle
#

Mess with css selectors until they work

#

That’s all you can do

#

If you see a bot that already does that you can also steal their css if you want, but it’s much better to do it yourself in case you need to make changes in the future

mental thorn
#

How?

onyx summit
#

@lusty dew why use glitch Angery

twilit rapids
#

Let's not start the ew glitch conversation again, there can be many reasons why the are unable to afford a paid host so just help them with what they have now or don't message at all

onyx summit
#

he literally has access to a dedicated server catWhat

slender thistle
#

They probably have their own reasons

#

Let's not keep this up, thanks

onyx summit
#

How can I check if a method has a specific decorator?
(ts)

opaque eagle
pearl jasper
#

my bot is muted

onyx summit
#

ye thanks, but turns out I can't even access the actual method

royal herald
mossy vine
#

cant find python executable

earnest phoenix
#

thr problem is that you are using javascript

mossy vine
#

install python

earnest phoenix
#

i suggest you delete this and go learn python

mossy vine
#

@earnest phoenix please dont give irrelevant advice

royal herald
#

what is dowland link? @mossy vine

mossy vine
royal herald
#

thx so much

mossy vine
#

since its node-gyp that needs it

#

you need python 2.7

#

@royal herald or you could run npm install --global --production windows-build-tools

royal herald
#

umm i dowlanded

#

*rınned

mental thorn
#

Any help?

#

I managed to get this far, but I still want to change the color of the things in red, and hide the things in blue :/

quartz kindle
#

@mental thorn use the element inspector

mental thorn
#

Ooooh ok ty!

onyx summit
#

@earnest phoenix the programming language for your project is still a personal decision

mossy vine
#

it depends more on your use case tbh

#

if there are several that are equally as good, then preference

onyx summit
#

Its just a Discord bot, not a enterprise solution, who cares what language u use

mossy vine
#

fax

earnest phoenix
#

@onyx summit it was a joke
the language you use doesn't mean anything

#

what rather comes into play is what library you use for the language

onyx summit
#

ha ha

earnest phoenix
#

some are shit & unoptimized

onyx summit
#

Classic Comedy

earnest phoenix
#

ok yea anome pic :+1:

onyx summit
#

ok yea comic pic agooglethumbsup

earnest phoenix
#

anemone? why are you calling people flowers

royal herald
#

guys

#

how can fix jimb

onyx summit
#

jimb?

royal herald
onyx summit
#

there is no package that is called jimb

royal herald
#

hmmm

#

look

#

needs jimb

onyx summit
#

Jimb is not a package shrug

earnest phoenix
#

learn to read

royal herald
#

oke

earnest phoenix
#

it says jimp, not jimb

royal herald
#

umm

#

spri

#

sorry

barren crest
#

@royal herald y do u use VS for js instead of VSC? 😄

onyx summit
#

Visual Studio has great support for Nodejs (at least enterprise), but I dont like to use it because you cant customize everything with addons and themes like in vsc

#

so its not wrong to use VS

late hill
#

In Java I have a string of the form "a[b]c"
I want to split this string to get a and c
I tried simply using string.split("[b]") but that doesn't work because the characters "[]" have a special meaning.
When I escape those characters like so "[b]" I get an error that there's an illegal escape character in there.
What am I doing wrong 😑

#

oof you can't see the escape characters

#

I put a \ before [ and ]

onyx summit
#

I dont know bout java, but in js 'a[b]c'.split('[b]' and 'a[b]c'.split('\[b\]' works

barren crest
#

@onyx summit vs is just CLuNkY

late hill
#

Ok so

#

I found out that in java you have to put 2 escape characters because you also have to escape the escape character because it has a special meaning in java strings

onyx summit
#

damn

onyx summit
#

anyone can help me with loopback 4?

wheat jolt
#

does someone know a simple way with I can get an array with members which have a specific role?

opaque eagle
#

Collection.filter() on Guild.members

wheat jolt
#

ah

barren crest
opaque eagle
#

It’s not really “setup”

onyx summit
#

I would recommend reading an article how oauth works
I had problems too, but its not that hard after you understand the concept

low birch
#

I can’t show my code at the moment as in about to leave for work but I’ll try and remember to do so when I’m at my computer

#

I’m about*

earnest phoenix
#

Okay meowmeltthumbsup

onyx summit
#

If you are using node.js you can yank the code from guidebot dashboard

opaque eagle
#

Guidebot dashboard is disgustingly bad imo

barren crest
onyx summit
#

@opaque eagle front-end or backend?

earnest phoenix
#

Everything

onyx summit
#

Never used it, but I always appreciated the code from aig to copy and modify for my own use

#

Anything particular?

opaque eagle
#

If I remember correctly, it’s attached to your bot’s code

#

It’s much better to have your dashboard independent of your bot

onyx summit
#

Uff, yeah probably

#

I think they did that because of all the kiddos hosting on glitch

wheat jolt
#

ytdl-core or ytdl-core-discord?

grim aspen
#

ytdl-core

#

birthday boy

wheat jolt
#

why ytdl-core

#

@grim aspen

grim aspen
wheat jolt
#

can u ask my question?

#

huh

grim aspen
#

not sure how to ask your queustion

wheat jolt
#

answer

#

my bad

grim aspen
#

one's more simple, the discord one uses await function

wheat jolt
#

ah

#

thanks

grim aspen
#

no problem

barren crest
#
  .bot-name{visibility:hidden;font-size: 0 !important}
  .bot-name:before{visibility:visible;content:'Chat';color #212121;font-size:32px}
  .bot-name:after {visibility:visible;content:'Hop';color:#00a8ff;font-size:32px}```
mossy vine
#

ah thats interesting, thanks

barren crest
#

lol

earnest phoenix
#

Wow

#

css 2 hard 4 me

barren crest
#

wasnt intended to change the name just to re color it

#

but u can change the name to 😄

bitter sundial
#

clever

barren crest
#

always 100% 😁

earnest phoenix
#

Where is the vote button

barren crest
#

idk wasnt there to start

#

¯_(ツ)_/¯

bitter sundial
#

not approved yet

barren crest
#

yeah

bitter sundial
#

cuz he's not a bot dev

barren crest
#

tuff life :/

onyx summit
#

I'm stealing that

#

thanks

barren crest
#

🙂

onyx summit
#

I have css that makes your vote button go wrmmmmm if you want

barren crest
#

:d

#

dont have one yet 😄

brave anvil
#

Is there a way to eval set your bots status

barren crest
#

eval?

brave anvil
#

Thats

onyx summit
#

yes

brave anvil
#

Discord .js

onyx summit
#

just like you would set it in normal code

earnest phoenix
#

eval client#setActivity

brave anvil
#

Ok

wheat jolt
#

bot.user.setActivity('javascripts', { type: 'WATCHING' })

brave anvil
#

OwO

#

Its client

wheat jolt
#

bot is your client

brave anvil
#

I use client

wheat jolt
#

i use bot

brave anvil
#

In my code

wheat jolt
#

¯_(ツ)_/¯

onyx summit
#

I use banana

barren crest
#

ewie

brave anvil
#

(╯°□°)╯︵ ┻━┻

wheat jolt
#

haha

barren crest
#

who doesnt alternate activity?

earnest phoenix
#

!eval client.user.setActivity('lol i like banana')

brave anvil
#

I’ll try it

wheat jolt
#

or just add it to your code

#

lol

brave anvil
#

@unborn mulch

#

I’mma beat him

#

Cant I set it to like guilds and servers

barren crest
#

furries PepeWot

brave anvil
#

The amount

#

@barren crest PFFFF

barren crest
#

😄

brave anvil
barren crest
#

yeah u can

brave anvil
#

XD

barren crest
#

do a filter of the guild members then get the .size at the end 🙂

brave anvil
#

client.user.setActivity(${client.guilds},{ type: 'WATCHING' })

#

XD

onyx summit
#

client.guilds is a collection of guilds

#

I think u should try client.guilds.size

earnest phoenix
#

^

broken shale
#
const { ShardingManager } = require("discord.js");
const config = require("./config.json");

const manager = new ShardingManager("./app.js", { totalShards: "auto", respawn: true, token: config.bot.token });
manager.spawn(2);
manager.on("launch", shard => console.log(`Launching shard ${shard.id}...`))```
pretty sure spawns 2 shards right?
amber gorge
#

hello everyone

public static int getDblVoteCount() {
        AtomicInteger votes = new AtomicInteger();
        dblApi.getBot(ID).whenComplete((bot, e) -> {
            votes.set(bot.getPoints());
        });
        return votes.get();
    }

here how can i wait for the process to get the votes before returning the result ?

mossy vine
#

@broken shale yeah, that should spawn 2 shards

broken shale
#

but why am I getting 0

mossy vine
broken shale
mossy vine
#

are you getting Launching shard .... in the console

broken shale
#

yea

#

0 shards launched

#

in ready event

mossy vine
#

are you using stable or master

broken shale
#

stable

mossy vine
#

try setting totalShards to 2 and call manager.spawn without any arguments

broken shale
#

okay

#

0

mossy vine
#

huh

broken shale
#

or is the file wrong?

#

'./app.js'

#

since my ready event is handled by an eventLoader

broken shale
#

@mossy vine Nvm I kept launching the wrong file

stray garnet
broken shale
#

when you use glitch.........

nimble temple
#

Anyone know what the cause of this is?

This is my code: channelPins = await after channel.pins

and this is the exception:

Ignoring exception in on_message_edit
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/discord/client.py", line 270, in _run_event
    await coro(*args, **kwargs)
  File "main.py", line 165, in on_message_edit
    channelPins = await after.channel.pins()
  File "/usr/local/lib/python3.6/dist-packages/discord/abc.py", line 915, in pins
    data = await state.http.pins_from(channel.id)
  File "/usr/local/lib/python3.6/dist-packages/discord/http.py", line 220, in request
    raise NotFound(r, data)
discord.errors.NotFound: 404 NOT FOUND (error code: 10003): Unknown Channel
#

Not sure why it's doing that

slender thistle
#

Such channel doesn't exist

Send full code

stray garnet
#

@broken shale rip

nimble temple
#
channelPins = await after
.channel.pins()
    pinned_ids = [message.id for message in channelPins]
    attachments = after.attachments

    if before.content == after.content and after.author != client.user and len(pinned_ids) == 50:
        oldest_pin = await after.channel.fetch_message(pinned_ids[-1])
        try:
            await oldest_pin.unpin()
        except discord.errors.Forbidden:
            await error(before, '''This channel has reached the maximum pin limit, Pin Archiver can't unpin the oldest message as it does not have the manage messages permission. This message has been archived but not pinned. ''')
unkempt moon
#

Let's say I have a MySQL table named "guilds" with a "discordGuildId" varchar(18) field. How can I fetch all of the entries that have a discordGuildId that the current shard serves? (as to not return rows from guilds the shard is not connected to)

quartz kindle
#

one option is to pass an array to the query, like SELECT * FROM guilds WHERE discordGuildId IN (array of guild ids)

#

idk if thats the most efficient method

unkempt moon
#

That doesn't seem efficient though

quartz kindle
#

another option is to use discord's formula somehow

unkempt moon
#

Imagine passing 2000 IDs through each time 🤔

#

The problem with the formula is that I store the ID as a string, not a number, so I don't think I can do math on it

#

Eh it might just be a necessary evil 🤔

onyx summit
#

You can use it as string

#

Afaik

quartz kindle
#

there must be a way, mysql is complex enough

onyx summit
#

Same result with string and with a number

unkempt moon
#

What you're doing there is JS though, not SQL

#

JS does type casting, SQL does not afaik

onyx summit
unkempt moon
#

Apparently I can type cast to INT/BIGINT though 🤔

#

Yeah that more or less solves my problem

barren crest
#

so the top works but has deprecation warning is the bottom not a option object?

#

message.guild.createChannel('🌍global💬','channel')
message.guild.createChannel({name: 'global', type: channel})```
rugged bramble
quartz kindle
#

@barren crest stable or master?

earnest phoenix
#

channel is not a type

#

also has to be in quotes

barren crest
#

stable

quartz kindle
#

Stable is createChannel(name,optionsObject)

earnest phoenix
#

i mean the bottom would also work (provided correct channel type)

quartz kindle
#

And as Luke said, channel type must be either text, voice, category, etc

barren crest
#

mk

#

norm i dont specify channel cause it does by default but will make it text

rugged bramble
#

how i add a custom emoji on a reaction with bot.

earnest phoenix
#

what library

barren crest
#

msg.onReaction

quartz kindle
#

Everything is optional except name

#

@rugged bramble you want to add a reaction to a message or you want to receive reactions when people react?

rugged bramble
#

i want to do a voting system so i want to my bot add a custom reactions example: this tickYes

quartz kindle
#

So first you send a message, then you add a reaction

#

Are you using discord.js?

rugged bramble
#

yes

quartz kindle
#

Default emojis must be put there as unicode

#

You can google for unicode versions of them, and copy and paste as a string

rugged bramble
#

i need to know i put in this custom emoji id

earnest phoenix
#

just pass that as a string

#

or get it from <client>.emojis with the id

quartz kindle
#

You can also get it from a guild

rugged bramble
#

@earnest phoenix Example i do this config.emojis(id)??

quartz kindle
#

The djs stable docs show this example: .react(message.guild.emojis.get('123456789012345678'))

rugged bramble
#

ye but emoji is on my server

slim heart
#

Guys stop

#

Scorpion please read the docs

quartz kindle
#

Then get your servers guild id

barren crest
#

😄

earnest phoenix
#

just pass the id into client.emojis.get("id") angeryBOYE

slim heart
#

If you just sent config.emojis(id) you need a thorough doc reading today please

#

Stop fripp

earnest phoenix
#

hardly

slim heart
#

For him it is pls delete

#

Let him figure it out on his own

broken shale
#

bot.shard.broadcastEval(msg.channel.send('hi')) is this how you're supposed to use broadcast eval?

slim heart
#

No

earnest phoenix
#

it has no reference to msg even then it would be wrong

slim heart
#

It also takes a string

broken shale
#

hm thought so gonna read up a bit

#

noticed

slim heart
#

Think of eval()

broken shale
#

also if running on 2 shards how would you specifically get the ping of shard 1 then shard 2

slim heart
#

Ask for values ping on both and the keys 0 and 1 for their shard ids

#

Since it returns in order as an array

barren crest
#
message.guild.createChannel({name:'userlog', type: 'text'})```
#

what in the world is wrong with this?

#

thats all it needs right?

slim heart
#

Name is first Param

barren crest
#

name and type

#

should be second?

slim heart
#

.create(name, opts)

barren crest
#

name is first 😄