#development

1 messages · Page 335 of 1

median lintel
#

ok canvas

slow swan
#

i made an api to do all my image processing in python

neon pasture
#

GG

abstract mango
#

psst it was a contract

slow swan
#

hey you

abstract mango
#

lul

earnest phoenix
#

use graphicsmagick @median lintel

#

It's fast af

median lintel
#

i see

#

looks ez

earnest phoenix
#

yes

earnest phoenix
#

Hey

#

ANyone?

#

@here

#

@here @here

alpine plover
#

I don't think that's working, might want to quit trying.

#

probably disabled for a reason.

prime cliff
abstract mango
#

shhhhh

#

we're all dead

#

:^)

vale orbit
#

?

fossil oxide
#

@supple sage

abstract mango
#

@supple sage

inner jewel
#

@supple sage

restive silo
#

@supple sage

fossil oxide
#

😫

rich kiln
#

@supple sage

#

too late?

earnest phoenix
#

@here

#

HEY

#

Anybody

rich kiln
#

Someone ban this troll pls

earnest phoenix
#

Im not a troll lol

#

I have a question

rich kiln
#

so why trying to ping everyone lul

earnest phoenix
#

Just nobody responded

#

Because who would I ping for help

rich kiln
#

they'll hate you isntead of help you lol

earnest phoenix
#

I cant ping roles

#

so ¯_(ツ)_/¯

rich kiln
#

no one can

earnest phoenix
#

Exactly

#

So who would I ping for help

rich kiln
#

its annoying asf

earnest phoenix
#

Nobody ever checks this channel unless they are pinged

#

And just go on do not disturb

rich kiln
#

no one just wait till some1 magically appear

earnest phoenix
#

That could take hours

rich kiln
#

nah they do

earnest phoenix
#

And I have a life so I dont have hours

rich kiln
#

everyone has one lol

#

i dont think we are just pure A.Is

earnest phoenix
#

Ya dont say?

#

nickolas cage face here

#

Okay wait

#

How good are you with javascript

rich kiln
#

¯_(ツ)_/¯

earnest phoenix
#

Discord.js

rich kiln
#

its the same as using eris

#

eris > js < discord.js

earnest phoenix
#

Sooooo in other words you cant help me

#

Or can you?

rich kiln
#

i can

earnest phoenix
#

Okie

rich kiln
#

just say it lol

earnest phoenix
#

Willing to help?

#

Okay so

#

Im trying to do a string line for my bot to say

#

How do I insert, for example

#

To the strong, but put something after it

#

*string

#

And have the thing after it connect to the first part

#

Ill give an example

rich kiln
#

like

#

Kuroi#Id?

earnest phoenix
#

No

rich kiln
earnest phoenix
#

Im using VCS

#

Like

#

For example

#

How would I connect the last part to the first part

#

But still have it append the ID

rich kiln
#

well

#

you can use somenthing like

karmic lake
#

lel

rich kiln
#

` code `

earnest phoenix
#

?

karmic lake
#

Darnnabit

rich kiln
#

Example:

#

` Hello ${CODE HERE || msg.author.mention} How are you today?`

karmic lake
#

^

earnest phoenix
#

?

rich kiln
#

you cant put if statements there btws

earnest phoenix
#

Hm okay

rich kiln
#
`I am working, ${msg.author.mention}`

#

there you go

earnest phoenix
#

Thats not how mine works, but i get the idea

rich kiln
#

you dont need the <@ > part

earnest phoenix
#

Thank you!

rich kiln
#

np

earnest phoenix
#

Nope

#

Isnt working

#

It says "undefined"

#

.mention is only used for getting something from a mentioned user

#

🤦

#

Okay wait

rich kiln
#

lol no

#

.mention is to mention a user

earnest phoenix
#

No

rich kiln
#

yep

earnest phoenix
#

Not in what im using

#

Lel

karmic lake
#

?

#

what lib?

rich kiln
#

well i used djs once

earnest phoenix
#

Discord.js

rich kiln
#

and i'm sure it is like that

karmic lake
#

if its d.js

earnest phoenix
#

Its not

karmic lake
#

message.author

earnest phoenix
#

Ik

rich kiln
#

yeah

earnest phoenix
#

But how do I append

#

Like

rich kiln
#

that works too Thonk

#

${code here pls}

karmic lake
#

like next line?

earnest phoenix
karmic lake
#

🤔

earnest phoenix
#

How would I still append the value

rich kiln
#
`Hello ${msg.author}`
#

'-'

earnest phoenix
#

But have the last part connect to the first part

rich kiln
#

tho

karmic lake
rich kiln
#

no need to do + lol + bull shit

earnest phoenix
#

Yes you do

karmic lake
#

&&

rich kiln
#

just use `` isntead lol

earnest phoenix
#

Bruh

karmic lake
#

oop

earnest phoenix
#

Do you know discord.js

#

Lmao

rich kiln
#

its js

karmic lake
#

yes

rich kiln
#

lol

karmic lake
#

i know discord.js too

rich kiln
#

js itself

karmic lake
#

there is no need

#

lmao

earnest phoenix
#

"example" is the same as ``

rich kiln
#

no

earnest phoenix
#

Yes

rich kiln
#

🤔

earnest phoenix
#

Lol

rich kiln
#

🤦

#

go try it yourself first

karmic lake
#

^

rich kiln
#

then come back if anything is wrong.

karmic lake
#

^

#

shh

#

@rich kiln wyd

#

oops

#

this isnt general

#

xD

earnest phoenix
#

Somethings wrong

karmic lake
#

whats wrong?

#

are you getting an error?

earnest phoenix
#

Yes

karmic lake
#

explain your problem

#

and i can help with it

earnest phoenix
#

Cannot read "map" property of null

karmic lake
rich kiln
#

send code pls

karmic lake
#

^^^^^

earnest phoenix
#
('I am working, ' + message.author.id `>`);
rich kiln
#

omg....

earnest phoenix
#

I did your `` thing

rich kiln
#

nonono

karmic lake
#

lmfao

#

xDDD

rich kiln
#

its not like that tfw

#

its

karmic lake
#

^

#

you missed all that we where trying to say lmfao

rich kiln
#
(`I am working, ${message.author.id}`)
karmic lake
#

^

earnest phoenix
#

Interesting

#

Ill try it

rich kiln
#

you should

try {

} catch (e) {
return e;
}
#

too

earnest phoenix
#

As i thought

#

its the same as ''

#

I told you lol

rich kiln
#

nono

karmic lake
#

🤦🏻

earnest phoenix
#

Yes

rich kiln
#

'' is for string

earnest phoenix
#

It is

#

I just tried it

rich kiln
#

is for strings*

earnest phoenix
#

Wait

karmic lake
#

^

#

you came asking for help

#

so when we try to help

rich kiln
#

why dont you go to codecademy or maybe MDN?

earnest phoenix
#

('I am working, + message.author.id');

karmic lake
#

?

#

🤦🏻

earnest phoenix
#

Omfg

rich kiln
#

i just sent you

#

the code.

earnest phoenix
#

This is what you just told me to do

#

Jason

karmic lake
#

no

earnest phoenix
#

Thats not my code format

rich kiln
#

i'm not jason

earnest phoenix
#

JSON

rich kiln
#
(`I am working, ${message.author.id}`)
#

heres mine

earnest phoenix
#

Thats not my coding format

#

But ill try it

#

¯_(ツ)_/¯

karmic lake
#

🤦🏻

rich kiln
#

ok ok

karmic lake
#

your making my brain hurt

rich kiln
#

i'll link you to mdn rn.

earnest phoenix
#

AH WAIT

rich kiln
#

read this

earnest phoenix
#

Oh lol I get it now

#

Your simply injecting it directly into the string without disrupting it

rich kiln
#

r e a d i t

earnest phoenix
#

Lol all I wanted to know was the syntax

rich kiln
#

l o l

earnest phoenix
#

I prefer this instead

karmic lake
#

~~ m i s s i o n a c c o m p l i s h e d ~~

#

lmao

earnest phoenix
#

Lol all i wanted to know was the syntax

#

That was it xD

karmic lake
#

you said you prefer this

#

and sent us the welcome page

#

🤔

rich kiln
#

not yet

#

you need to read both

#

mdn and djs docs.

karmic lake
#

doit ^

#

read em

earnest phoenix
#

Well, thank you guys

karmic lake
#

so you dont run into anymore problems like this

rich kiln
#

we*

karmic lake
#

we ?

rich kiln
#

my brain is hurting asf rn

#

lol

karmic lake
#

mine is too

#

lmao

rich kiln
honest bane
#

How do I code if you can help me please message me

rugged girder
#

..

earnest phoenix
#

How do I intergrate an automated verification system (for Discord accounts) using the bot; Auttaja?

rapid flame
#

when rocketbot wants you to promise something... he wants you to promise pending xD

lament mantle
#

@fiery swallowTheFlash#5543 Now Live dev here... if you have questions about the bot, please go to the support server for the bot... (apologies for the delayed response)

abstract mango
#

kek

steep bolt
#

Having trouble updating my server count. Worked in the past, and I have since generated a bot specific token and slotted it into the Authorization header, but I'm getting a 401 "error": "Invalid auth"

#

It was working before the update

patent reef
#

What language do you use

steep bolt
#

Just making a raw request with Postman right now

#

Just want to confirm I need the user token and not the bot token?

#

** other way around

patent reef
#

yes

steep bolt
#

My bot's id would have changed, would it?

prime cliff
#

No the ID never changes

inner jewel
#

^

#

unless you make another bot account

steep bolt
#

oh shit, i was hitting the other discord bot site... haha

#

OOPS

honest bane
#

@here can someone help me i do not know how to make a bot please help me I beg

inner jewel
#
  1. learn how to code
  2. code a bot
steep bolt
#
  1. Google
inner jewel
#

no one's gonna teach you from scratch

#

at least not here

earnest phoenix
#
  1. don't be a dumbass.
wispy jolt
#

coding is fun tho

earnest phoenix
#
  1. install a good programming language onto your computer.
inner jewel
#

not always

#

especially when you have to refactor half the project

#

and by hand

#

because the changes were too big to regex it

earnest phoenix
#

May I ask a few (dumb) questions?

jagged plume
#

no question is dumb

#

only stupid

earnest phoenix
#

nou

jagged plume
#

wow

earnest phoenix
#

well uhh..
--is there any reasons why Server Guard (a Discord bot) is offline?

jagged plume
#

ask the bot owner

#

no idea

earnest phoenix
#

ok

prime cliff
#

-botinfo @livid hatch

gilded plankBOT
#
Bot info
ID

339865194408968192

Username

Server Guard

Discriminator

5492

Short Description

Server Guard is the most efficient way of combatting spam and verifying your Discord users are human.

Library

discord.js

Prefix

SG

Upvotes

7

Server Count

No server count

Owner(s)

@civic glen

Links
jagged plume
#

hello owo

prime cliff
#

Offline mmhhlol

earnest phoenix
#

mmLel

jagged plume
earnest phoenix
#

mmEme

jagged plume
#

that

earnest phoenix
#

mmMeme

#

so uhh, since Kyle's offline (yes, I did check right now)
--is it possible to create an account verification system with the bot; Auttaja? and how?

jagged plume
#

we arent bot experts

earnest phoenix
#

states they aren't an expert at bots.
possesses the Bot Developer and Certified Developer role.

#

Ok.

prime cliff
#

@earnest phoenix Just set your server verification level

earnest phoenix
#

I'm too gay for that

prime cliff
earnest phoenix
#

I just prefer the automated method with bots
--but thank You for the suggestion though.

prime cliff
#

That is built into Discord so its already automated

#

🤦

earnest phoenix
#

But I just prefer the bot method :v(
Fine I'II use the norme-ish method

#

:(

jagged plume
#

i mean im not an expert with every single bot

#

they all work differently

#

and you cant expect me to know how every single one of them functions.

earnest phoenix
#

anyone knows how to make a advanced ping command like ms

#

because i forgot how to

#

😦

#

lib: discord.js

prime cliff
#

ping command isnt advanced 🤦

earnest phoenix
#

i mean like with the ms

#

such as 90ms

#

what nvm i remember

inner jewel
#

get time -> send request to api -> on response calculate diff

earnest phoenix
#

well I'm going to make a verification system with DynoBot, is that ok?

#

also how do I create a verification system using DynoBot? I'm dumb when it comes to Discord bots, :/

#

xd

pale light
#

How do you get shard id from ShardManager Discord.js

#

e.e

rich kiln
#

@earnest phoenix pings will ever return millisecods tfw

#

welp, atleast if there isnt any api problems

#

but still its just <result> + "ms"

#

lol

karmic lake
#

"lol"

#

dont you dare

#

laugh at the amazing "CSS VIRAL"

fluid fable
#

h!ping

rich kiln
#

Honoka no ping

#

2 smart 4 her

earnest phoenix
#

im having trouble with o2auth links

rich kiln
#

Oauth2*

earnest phoenix
#

they keep saing no redirct URL as a error

#

saying*

rich kiln
#

Error name? Thonk

jagged plume
#

append &redirect_url=the_place_to_go_after to it

rich kiln
#

^

earnest phoenix
rich kiln
#

what are you even trying to do tho

earnest phoenix
#

im trying to reinvite my bot since it cannot delete channels without o2auth link

rich kiln
#

Oauth2*

#

anddd

earnest phoenix
#

@rich kiln used that

#

before

rich kiln
#

before

#

why dont you try again

earnest phoenix
#

i did it like oh ready a fews times and it didnt work

rich kiln
#

i dont think you need a uri

#

right now...

jagged plume
#

make sure you are using &scope=bot

earnest phoenix
#

using that

rich kiln
#

send link pl

earnest phoenix
rich kiln
#

uh

#

its working...

earnest phoenix
#

ok lemme try one more time

rich kiln
earnest phoenix
#

no the error happens when you invite it

rich kiln
#

is this bot yours?

earnest phoenix
#

yes

rich kiln
#

Bot+requires+code+grant.&error=invalid_request

#

Lol

earnest phoenix
#

i used another caulator

#

because of the other one not working

rich kiln
#

check your bot application dashboard

#

as i said you dont need a redirect Uri rn

earnest phoenix
rich kiln
#

wtf

earnest phoenix
#

but it required OAuth2 to delete channels.

rich kiln
#

Wtf no

#

it requires permissions.

#

what requires Oauth are dashboards like dyno's dashboard

earnest phoenix
#

it has the permissions

rich kiln
#

wtf

#

how would a bot need tfa Thonk

earnest phoenix
#

no

#

idea

rich kiln
#

try in other guild lol

earnest phoenix
#

i did

#

same thing

rich kiln
#

w t f Thonk

#

@karmic lake your turn bb

earnest phoenix
#

i think discord hates my bot

#

👀

#

@earnest phoenix is the guild 2factor enabled?

#

both of them?

brisk notch
#

it needs perms Thonk

earnest phoenix
#

Wist

brisk notch
#

from a mod that has 2auth

earnest phoenix
#

if it needed perms then it would be Missing permissions

#

@earnest phoenix its not missing perms

karmic lake
#

huh

#

im eating

#

why was i pongered

winged osprey
#

@earnest phoenix I believe you are getting that because you don't have 2fa enabled on your account

#

Altho, I had the same issue the other day when I have 2fa on

#

¯_(ツ)_/¯

earnest phoenix
#

qp.emoji("angry")

#

this doesnt work

#

qp is my message var

#

im trying to make a reaction.

languid dragon
#

qp.react(emoji_object) What lib are you using?

rich kiln
#

djs

earnest phoenix
#

"\😠" @earnest phoenix

#

\:angry:

fiery swallow
#

@lament mantle ah what? why did you ping me?

small solar
#

what kind of stuff can i do with the dbl api? could i make like a dbl command with stuff ?

lethal sun
#

yes

#

bot info and user info command

#

search for discord-bot-list

small solar
#

thx

trim steppe
#

Hey

#

Shilling your own module

#

There's an entire channel for that

ornate shadow
#

How can I convert user IDs into users?

#

I.e mentions

#

Using discord.js

bitter sundial
#

<@id> is a mention

#

@ornate shadow

ornate shadow
#

What if I wish to .tag it?

#

So I get its tag

#

Got it

#

bot.users.get(id).tag :D

lethal sun
#
economy.updateBalance(defineeuser + message.guild.id, parseInt(args[0])).then((i) => {
        });```

It says that **args** is not defined...
#

halp

uncut slate
#

not enough info

#

that's something with your code

lethal sun
#
economy.updateBalance(defineuser + message.guild.id, parseInt(args[0])).then((i) => {```
#

thats my addbal command

#

they are the same

#

@uncut slate

uncut slate
#

I doubt they are

pale light
#

anyone know how to make a mention prefix so when you mention the bot the bot responds

prime cliff
#

Thats easy just look for @pale light and @pale light

#

The second one is used when the bot has a nickname set

#

@pale light boop

pale light
#

k

prime cliff
#

Message.startswith("@pale light")

#

or something like that

pale light
#

I tried that Thonk

lethal sun
#

How to set-up a changable prefix? Thonk discord.js

rich kiln
#

msg.startsWith(msg.author)

#

done

#

bye

lethal sun
#

wow

rich kiln
#

@lethal sun set-up a database per guild

#

done

#

bye

lethal sun
pale light
#

Lollll

earnest phoenix
#

@sonic agate

#

rb!ping

pale light
#

rip

lethal sun
#

still doesen work

prime cliff
#

args is not defined you are doing something very wrong

lethal sun
#

?

#

?

slow swan
#

@lethal sun args is not defined

#

you need to fix that

lethal sun
#

@slow swan ik that but idk how to fix it

slow swan
#

you need to define it

#

maybe you should learn a programming language before you actually make a bot

lethal sun
#

wow...

pale light
#

let args = message.content.slice(prefix.length + <num).trim().split(/ +/g)

lethal sun
#

you dont have to define args manually

pale light
#

you don't

#

but maybe you should Thonk

lethal sun
#

i tried defining it but it said that args are already declared

#

smh

pale light
pale light
#

mention prefix ;[

topaz fjord
#

anyone have an idea

#
const prefixMention = new RegExp(`^<@!?${bot.user.id}>`);
    prefix1 = prefixMention.match(message.content) ? message.content.match(prefixMention)[0] + " " : prefix1;
#

trying to make a mention prefix

#
TypeError: prefixMention.match is not a function
    at Client.bot.on (C:\Users\Sid\Desktop\BobBot\bot.js:80:26)
    at emitOne (events.js:115:13)
    at Client.emit (events.js:210:7)
    at MessageCreateHandler.handle (C:\Users\Sid\Desktop\BobBot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (C:\Users\Sid\Desktop\BobBot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (C:\Users\Sid\Desktop\BobBot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:330:35)
    at WebSocketConnection.onMessage (C:\Users\Sid\Desktop\BobBot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:293:17)
    at WebSocket.onMessage (C:\Users\Sid\Desktop\BobBot\node_modules\ws\lib\EventTarget.js:99:16)
    at emitOne (events.js:115:13)
    at WebSocket.emit (events.js:210:7)
    at Receiver._receiver.onmessage (C:\Users\Sid\Desktop\BobBot\node_modules\ws\lib\WebSocket.js:143:47)
    at Receiver.dataMessage (C:\Users\Sid\Desktop\BobBot\node_modules\ws\lib\Receiver.js:389:14)
    at Receiver.getData (C:\Users\Sid\Desktop\BobBot\node_modules\ws\lib\Receiver.js:330:12)
    at Receiver.startLoop (C:\Users\Sid\Desktop\BobBot\node_modules\ws\lib\Receiver.js:165:16)
    at Receiver.add (C:\Users\Sid\Desktop\BobBot\node_modules\ws\lib\Receiver.js:139:10)
    at TLSSocket._ultron.on (C:\Users\Sid\Desktop\BobBot\node_modules\ws\lib\WebSocket.js:139:22)```
rich kiln
#

No

#

dont

#

its not new ReGexp tho

jagged plume
#

message.content.match not prefixMention.match

#

will fix ur error

uncut slate
#

@topaz fjord this is what I use, you might be able to do better

const match = msg.content.slice(0, 22).match(Bot.prefixRX);
const prefix = match ? `${match[0]} ` : msg.channel.guild.prefix;
#

Bot.prefixRX is a

new RegExp(`<@!*${this.client.user.id}>`);
patent reef
#

lol

small solar
#

if i have a string that is set as "0", how do i increase it by 1 or a certain amount?

uncut slate
#

string = ${parseInt(string) + 1}, depends on why you need that though

#

you could get away with just parseInt(string) + 1 too depending on how you're using it

small solar
#

hm, hold on ill try get the code im using

#

for every user i do this

if(!credits.get(message.author.id)) {
    credits.set(message.author.id, "0");
}
slow swan
#

why are you keeping it as a string?

uncut slate
#

ew

small solar
#

idk because then im putting it in a msg @slow swan

slow swan
#

then just turn it into a string then

uncut slate
#

you can store it as an int lul

#
Values must be "JSON.stringify()able", meaning they must be able to be converted to a string. This includes strings, numbers, arrays, and objects. Other Collections, Maps, or Sets cannot be inserted.

small solar
#

but how?

uncut slate
#

so just set it as 0

#

without the quote marks

small solar
#

oh ok

#

and then i can do + 1, + 100 etc??

slow swan
#

i wonder if javascript has something alike python's pickle

uncut slate
#

@small solar yes

small solar
#

ok thanks 😄

slow swan
#

hmm

small solar
#

so for an add credit cmd i can do this?

if (message.content.toLowerCase().startsWith(prefix + `addcredits`)) {
            let member = message.mentions.members.first();
            let args = message.content.split(" ").slice(2).join(" ");
            let string = credits.get(message.author.id);
            parseInt(string) + args
        }
uncut slate
#

that's pretty sick @slow swan

#

@small solar no

#

you need to re set() it

small solar
#

in the + args thing?

uncut slate
#

no

small solar
#

oh..

uncut slate
#

get rid of that, that's completely wrong

rich kiln
#
idk.set(parseItn(string))
#

done

uncut slate
#

not really, no

rich kiln
#

ikr i'm wrong bye

uncut slate
#

yeah you are

small solar
#

lol

#
        if (message.content.toLowerCase().startsWith(prefix + `addcredits`)) {
            let member = message.mentions.members.first();
            let args = message.content.split(" ").slice(2).join(" ");
            let string = credits.get(member.user.id);
            credits.set(member.user.id, parseInt(string) + args)
            message.channel.send(`:dollar: ${args} credits were added to ${member.user.username}'s balance.`);
        }
#

that good?

uncut slate
#

@small solar something along the lines of credits.set(id, credits.get(id) + n)

small solar
#

ah ok

#

that makes sense

uncut slate
#

drop parseInt you don't need that if you're storing them as integers

small solar
#

righto

#
        if (message.content.toLowerCase().startsWith(prefix + `addcredits`)) {
            let member = message.mentions.members.first();
            let args = message.content.split(" ").slice(2).join(" ");
            credits.set(member.user.id, credits.get(member.user.id) + args)
            message.channel.send(`:dollar: ${args} credits were added to ${member.user.username}'s balance.`);
        }
#

that good?

uncut slate
#

depends on how you're defining args, try and find out

small solar
#

okay

#

well its defined right there

#

let args = message.content.split(" ").slice(2).join(" ");

uncut slate
#

ya, won't work

small solar
#

oh

#

so i'd have to get an int of sorts from the msg

#

bc its gonna be a>addcredits @user 100 for example

uncut slate
#

mhm

small solar
#

:\

uncut slate
#

right now, args is a string

small solar
#

how would i do that? never worked with ints in messages

#

do i use something to convert it to an int?

jagged plume
#

parseInt, but that could error so u need to check if the args is a number first

small solar
#

this is getting more confoosing by the minute xD

jagged plume
#

not really?

small solar
#

well like idk how to do any of this thats why sadly

#

could i do

let args = message.content.split(" ").slice(2).join(" ").parseInt();
#

?

uncut slate
#

no

small solar
#

oh

uncut slate
#

parseInt(string)

#

currently, args is string

small solar
#

ah

#

i can use parseInt on the end though right or not?

#

?

earnest phoenix
#

parseInt can only select whole numbers at the start of a string

#

parseFloat can select decimals too

#

@small solar

#

also, parseInt isn't a prototype, it's a function

#

meaning, wrap the function around text that you want to parse

small solar
#

ok

earnest phoenix
earnest phoenix
#

finally my bot was approved

small solar
#

gg

outer copper
#

hello I have a problem with my CSGO-STATS.NET
on my servers that can help me ????

earnest phoenix
#

Hmm

outer copper
#

hi

#

where I find it

#

the api version

earnest phoenix
#

hold on

#

let me figure it out

outer copper
#

ok

earnest phoenix
#

@outer copper you're using discord.js right?

outer copper
#

I use the program discord on window

weak parrot
earnest phoenix
#

what

outer copper
#

sorry for my english i'm not good i can speak only one

earnest phoenix
#

lol

#

ok

outer copper
#

there is a french support

#

???

earnest phoenix
#

I don't speak French

outer copper
#

hum oki

#

I will translate to help me

crystal void
#

@earnest phoenix I have a problem with some of my commands...

#

message.mentions.users.first() is never working for me :/

#

could you help?

#

using discord.js library btw

earnest phoenix
#

I've never used message.mentions before

#

so I can't

#

sorry :/

crystal void
#

😭

#

know any1 who could help?

earnest phoenix
#

A lot of people here are more experienced though

#

I bet they know

crystal void
#

any reccomendations?

#

@earnest phoenix, @vocal sigil and @earnest phoenix anyone who could help me with message.mentions.users.first()
?

outer copper
#

where can I find the API of my servers

earnest phoenix
#

What language is that?

crystal void
#

discord.js

#

js

earnest phoenix
#

I do python

#

Sorry no idea

crystal void
#

oh :/

#

shoot

earnest phoenix
#

Btw did you just randomly ping people?

crystal void
#

know anyone who could help?

#

ye... xD

earnest phoenix
#

Actually several but I don't think anyone will give a shit

#

Js dudes are rude

#

#nooffence

crystal void
#

@noble hazel wanna help me?

prime cliff
#

They are only rude because people are stupid xD

earnest phoenix
#

Oh Bob you code c or Js

crystal void
#

@prime cliff could you help?

prime cliff
#

Nah

crystal void
#

-.-

earnest phoenix
#

@crystal void don't ping people

crystal void
#

sry

noble hazel
#

@crystal void ?

earnest phoenix
#

They'll get mad and will not help

crystal void
#

@noble hazel I need help with message.mentions.users.first() (js lib)

noble hazel
#

i dont do JS

prime cliff
#

Have you tried a thing called debugging your code its what all bot devs do Thonk

crystal void
#

oh... .-.

noble hazel
#

also

outer copper
#

my servers are in .exe I do not use it on js

noble hazel
#

lemme look into it

crystal void
#

ty @noble hazel

noble hazel
#

also, yeah

#

thats Jquery

#

if your tryign to do .first

crystal void
#

oh....

noble hazel
#

try doing

#

array[0]

crystal void
#

shoot

vocal sigil
#

GoN dm me

outer copper
#

{"code": 50041, "message": "Invalid API version"}

crystal void
#

message.mentions.users.array[0]?

noble hazel
#

uh

crystal void
#

ok @vocal sigil

noble hazel
#

message.mentions.users[0]

#

gets the first user in that list

crystal void
#

ok

#

gonna try that

noble hazel
#

also, i would try google

#

before asking here

crystal void
#

did

noble hazel
#

what did you search

crystal void
#

it's fd up...

noble hazel
#

heres a tip on how to google: language yourproblem eg js how to get first item in array

crystal void
#

I tried searching for this same thing, then how to pull mentions...

#

etc.

noble hazel
#

best to take a look at the docs for your lib then

#

see what the array contains

#

so for instance, if message.mentions.users contains an array of user objects

#

that means you get a user object for every item in the array

crystal void
#

thank you @noble hazel

noble hazel
#

just trying to help out

crystal void
#

😊

#

brb

noble hazel
#

oh another tip, dont ever go onto the API discord. they are all assholes.

crystal void
#

ik

#

banned me O_O

noble hazel
#

i was going to say, if you try to ask for help. they will shout at you for not knowing

outer copper
prime cliff
#

You dont install it you invite it

outer copper
#

he is already inviting

clear kernel
#

this is BOT development, not bot inviting/support

outer copper
#

but bot web page still gives
{"code": 50041, "message": "Invalid API version"}

prime cliff
#

Invalid api version lmao

outer copper
#

how can i change the api version ???

uncut slate
#

use a decent lib

#

lul

supple coral
#

Can somebody help me get the stats bot in my server

earnest phoenix
#

@queen apex

#

this?

prime cliff
#

Offline 😄

earnest phoenix
#

Guys?

#

I have a question

#

If anybody is even here

#

@here

prime cliff
#

O people online

earnest phoenix
#

Erm

#

How well do you know d.js

prime cliff
#

😏

earnest phoenix
#

?

#

@prime cliff

#

Hello?

prime cliff
#

Error could not find user

tawny lava
#

Same

prime cliff
#

@earnest phoenix i dont know d.js but i do know debugging and looking at the docs helps alot

earnest phoenix
#

Oh

#

I did though

#

I just want to know how to make a bot give a full list of servers that its in

#

I looked at the documentation and it didnt help

#

cough cough

#

@here

#

COUGH COUGH

#

chokes

#

X_X

umbral pelican
#

look harder

earnest phoenix
#

I did

#

I tried what the documentation said

#

It, of course, didnt work

#

I probably need an arry to manage the names data

#

Not sure how I would set that up though

earnest phoenix
#

Oh Ik that

#

Im pretty sure I need an arry

#

To manage the data

slow swan
#

@earnest phoenix have you considered learning a programming language first

earnest phoenix
#

@slow swan have you considered not stating the obvious

slow swan
#

yeah it is pretty obvious

#

maybe you should go learn one

earnest phoenix
#

I know one

#

But dats none of your buisness

#

Anywho

#

Other than mr. salty over here

#

Can anybody help?

slow swan
#

how am i salty

#

i only suggested that you learn the programming language you are trying to use

earnest phoenix
#

Okay are we really getting into this

#

Sir

#

Im not an idiot

#

I know I need to learn the language

#

But for the time being, I cant

#

So im trying to use what knowledge I have about it

#

¯_(ツ)_/¯

#

Is anybody willing to help?

#

And not just mock me?

slow swan
#

We don't like to help people who aren't willing to help themselves

earnest phoenix
#

🤦

#

I did help myself

#

If I didnt try everything, I wouldnt be here rn

#

But I tried everything, still isnt working

slow swan
#

ok

#

start here

earnest phoenix
#

Lol

#

Thats where I am atm

slow swan
#

so

earnest phoenix
#

Okay

slow swan
#

it takes a function

#

which should convert the Guild object into the data you need

earnest phoenix
#

So I think I would need to do bot.guilds.arry().name?

slow swan
#

so you need to make a function that takes the guild object as an argument and outputs the name of it

earnest phoenix
#

Wait

#

So bot.guilds.every().name

#

Hold on

slow swan
#

no

#

you need to make an array

#

of every guild name

earnest phoenix
#

🤔

slow swan
#

use bot.guilds.map(your function here) to do that

earnest phoenix
#

Interesting

#

Okay

#

Ah wait

slow swan
#

you need to make a function that accepts the guild object, and outputs the name (<Guild>.name)

prime cliff
#

You dont even know about arrays 🤔

earnest phoenix
slow swan
#

close

#

ever made a function before?

earnest phoenix
#

No

slow swan
#

alright

#

you want something like

#

g => g.name

earnest phoenix
#

Oh theres that syntax

#

The =>

slow swan
#

thats a small arrow function which accepts g and returns g.name

#

yeah

earnest phoenix
#

OH

#

So thats what that does

#

Okay

#

I get it

slow swan
#

so what do you have now

earnest phoenix
slow swan
#

alright now that makes an array of guild names

earnest phoenix
#

Alright

#

Wow

#

Okay thx

slow swan
#

to turn it into a string

earnest phoenix
#

Okay

#

Do I need the variables

#

Or since the arry is already created

slow swan
#

you can do it all in one line

earnest phoenix
#

Ah

#

Okay

#

What would go in the ()

#

Like what kind of value

slow swan
#

whatever you want to go between the guild names

#

so maybe

earnest phoenix
#

Oh!

slow swan
#

', '

earnest phoenix
#

Oh thats so cool

#

Wow thank you so much

#

Oh jeez

#

Im getting an unhandled promise rejection

#

This is my code

#

message.reply(bot.guilds.map(guild => guild.name).join(', '));

#

🤔

slow swan
#

that should work

earnest phoenix
#

Its getting an unhandled promise rejection

#

"Cannot read "map" property of null"

slow swan
#

bot.guilds is null Think

tawny lava
#

Did you call your Client bot or client?

earnest phoenix
#

Oh wait hold on

#

Lemme try the different client

slow swan
#

what

#

why do you have two clients

earnest phoenix
#

discord.client

tawny lava
#

Different client

earnest phoenix
#

That didnt work either

slow swan
#

@earnest phoenix no dont use Discord.Client

earnest phoenix
#

Oh

#

Okay

slow swan
#

thats the client that you construct

earnest phoenix
#

Which client

slow swan
#

you should have a variable

#

called bot or client

earnest phoenix
#

I have many variables

#

Yes

tawny lava
#

My gid

slow swan
#

<@&304313580025544704> help

tawny lava
#

banne PLO

earnest phoenix
#

I ahev the variable

#

*have

#

Bot and client

slow swan
#

Whats it called

inner jewel
#

bans

tawny lava
#

What

slow swan
#

can I see your code @earnest phoenix ?

tawny lava
#

You should only have one

slow swan
#

where you make the client

earnest phoenix
#

Im using commando as well

#

Thats why I ahve 2

slow swan
#

please dont include your token

earnest phoenix
#

*have

#

Ik

slow swan
#

You still should only have one client

#

at all times

earnest phoenix
#

const bot = new commando.Client(); const Discord = require("discord.js"); const client = new Discord.Client();

tawny lava
#

You don't need 2 clients for commando

earnest phoenix
#

Oh

trim steppe
#

ok im here to calm the situation

earnest phoenix
#

Which should I keep

slow swan
#

bot

earnest phoenix
#

Okay

#

Whats

#

Deleted the variable client

slow swan
#

can we remove this rosen man please

tawny lava
#

Can you mute / ban @lunar orchid

slow swan
#

@earnest phoenix make sure you replace all your code where it says client with bot

earnest phoenix
#

@slow swan Okay, its still not working though

#

Even with bot

slow swan
#

Can I see your whole code? (without your token)

earnest phoenix
#

Heres the command code

#

``const commando = require('discord.js-commando');

class ServerNamesCommand extends commando.Command {
constructor(client) {
super(client, {
name: 'servers',
group: 'cool',
memberName: 'servers',
description: 'Gives a full list of servers'
});
}
async run(message, args) {
message.reply(bot.guilds.map(guild => guild.name).join(', '));
console.log("Command run: Servers in " + message.guild.name)
}
}
module.exports = ServerNamesCommand;``

slow swan
#

oh you are in a

#

commando class

earnest phoenix
#

Yes

slow swan
#

i think you need to do like

#

etc

#

not sure how commando works

earnest phoenix
#

Whats "this"?

slow swan
#

this is just

#

this

#

it means the constructed class

earnest phoenix
#

Wait should I add back client then

#

Oh okay

#

bot.guilds.size works

#

So it must be the same code

slow swan
earnest phoenix
#

Yet

#

Itc ant read the "map" property of null

#

*cant

slow swan
#

where is the bot.guilds.size?

earnest phoenix
#

WAIT

#

Hold on have something that might work

#

Nvm

#

Alright

#

Its in my main bot index

#

bot.user.setGame(bot.guilds.size + " servers | Being Developed");

slow swan
#

let me just read some of the commando code real quick

earnest phoenix
#

Okay

slow swan
#

@earnest phoenix alright do this.client.guilds.map(.... you know the drill

earnest phoenix
#

Okay

slow swan
#

commando seems to place the bot object at this.client

earnest phoenix
#

message.reply(this.client.guilds.map(guild => guild.name).join(', '));

slow swan
#

that should work

earnest phoenix
#

Ill try it

#

YES

#

YEEESSSSS

#

It worked

slow swan
#

👏

earnest phoenix
#

Thank you so much xD

slow swan
#

np

#

just to note in the future you should have a nicer approach when people speak to you

earnest phoenix
#

Okay sorry >.>

#

Its just everyone on this server is very hostile to me

#

For some reason

#

I think its because im not very good with javascript

slow swan
#

no one active here is either

#

you're not alone

earnest phoenix
#

Okay >.>

pale light
#

Hm

#

why

earnest phoenix
#

anybody experienced with the api here?

#

like the discord api

slow swan
#

@earnest phoenix sure

#

whats up

earnest phoenix
#

nothin

#

fixed it

#

@slow swan

slow swan
#

alrighy then

placid flax
#

so if i had accidently fired up my bot using shards previously, would the website require me to post shard information..even if i dont have it? cause i cannot, cannot post server_count

#

and somehow copypasting my token back in made it work magically

#

w u t

earnest phoenix
#
const embed = new Discord.RichEmbed()
        .setTitle(prize)
        .setTimestamp()
        .addField("Time: " + time)
        .setDescription("React with:balloon:to enter the giveaway")
        .setFooter("Started at ");
    msg.channel.send({embed}).then(msg.react("🎈")).catch(console.error);``` who does it not react? ```js
Error: (node:4) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError: Unknown Message```
languid dragon
#

who?

#

maybe because
msg.channel.send().then((sent_msg)=>{ sent_msg.react(); })

restive silo
#

you were already told on the D.js server to look up Promises

#

because thats not how they work

devout jackal
#

guys, how can i get the message content?

#

like

#

when i send "xd" i want my bot to send "XD"

languid dragon
#

what lib?

devout jackal
#

.js

languid dragon
#

if message.content = "xd"
message.channel.send("XD")

devout jackal
#

kk

#

ill try

#

xd

bitter sundial
#

doesn't work here

devout jackal
#

why?

#

@bitter sundial why?

languid dragon
devout jackal
#

oh

languid dragon
#

usually reading rules helps :]

devout jackal
#

@languid dragon doesn't work

languid dragon
#

show code

devout jackal
#
if(message.content = "xd") {
message.channel.send("XD")
};
languid dragon
#

🤦

devout jackal
#

what now

#

actually

languid dragon
#

you go to the official javascript documentation and learn 2 code 👀

weak parrot
devout jackal
#

i know how to code

languid dragon
#

no you dont

#

LOL

devout jackal
#

but .contains or .startsWith doesnt work

#

@languid dragon that's rude, to judge by the cover

languid dragon
#

probably because thats not how the code works

#

im judging the book by the contents

#

you showed me code that clearly showed flawes in your knowledge of javascript 😉

devout jackal
#

l0L oK

languid dragon
#

It's safe to assume you dont know when you could simple read the documentation for help
i mean

weak parrot
#

Deni 2.0 when xD

languid dragon
#

AMIRITE?