#development

1 messages · Page 543 of 1

keen drift
#

so why doesn't .send work?

mossy vine
#

no idea

amber fractal
#

And its supposed to send messages to a specific channel?

mossy vine
#

yes

keen drift
#

what's the return value

mossy vine
#

doesnt return anything

keen drift
#

...?

mossy vine
#

i mean

red spade
#

Maybe try console.log(client.channels.get(CHAN).name) to see if it's really the channel you meant

mossy vine
#

doesnt throw up any errors or anything

keen drift
#

well capture the return value

#

it should be a promise if it exist

gilded blaze
#
.send.catch(console.error)```
mossy vine
#

yes @red spade, it is the correct chanenl

amber fractal
#

I needed to add waits so that way it finishes

#

Its a promise?

mossy vine
#

@gilded blaze nothing

#

literally nothing

keen drift
#

console.log(client.guilds.get(client.channels.get(CHAN).guild.id).channels.get(CHAN).send(ans.message))

red spade
#

maybe check if .then event launches or not

inner jewel
#

client.guilds.get(client.channels.get(CHAN).guild.id).channels.get(CHAN).send(ans.message)

#

why?

gilded blaze
#

Fishy, that will return a pending promise

inner jewel
#

if you have the channel id

#

why do you get the guild

#

to get the channel by id again

mossy vine
#
Promise { <pending> }```
@keen drift
gilded blaze
#
.send().then(console.log)```
#

try that

red spade
#

yes indeed @inner jewel you could even directly get the channel with client.channels.get()

amber fractal
#

Thats what we needed.

inner jewel
#

try client.channels.get(ID).send(MESSAGE).then(console.log, console.error)

amber fractal
#

Its still pending when it tries to send.

mossy vine
#

WAIT WHAT THE FUCK

keen drift
#

yeah you can do that

mossy vine
#

i tried what @gilded blaze said, it logs the error, AND ALSO SENDS THE FUCKING MESSAGE

inner jewel
#

discord is a mess

#

amber fractal
#

Whats the error

inner jewel
#

it's possible to send an http error

mossy vine
#

(node:17084) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'then' of undefined

inner jewel
#

and still send the message

keen drift
#

...

inner jewel
#

oh

amber fractal
#

Lol

inner jewel
#

you copy pasted wrong code

keen drift
#

it should be send().then()

inner jewel
#

👏

#

try what i sent

#

client.channels.get(ID).send(MESSAGE).then(console.log, console.error)

#

.send.then() will never work

#

send is a function

#

it doesn't have .then()

keen drift
#

yes

red spade
#

yes send isn't a property

keen drift
#

natan high iq

mossy vine
#

okay so what i did is console.log(my_bullshit).then(console.log) and it sent the message FOR THE FIRST TIME and also threw the typeError

keen drift
#

what

inner jewel
#

console.log(my_bullshit).then(console.log)

#

doesn't work either

#

console.log doesn't return a promise

keen drift
#

log() doesn't have then

red spade
#

uhm what?

keen drift
#

client.channels.get(ID).send(MESSAGE).then(console.log, console.error)

mossy vine
#

okay i reverted to the previous working code and now it doesnt work again WaitWhat

keen drift
#

can you try natan's

mossy vine
#

im doing natans rn

#

worked for the first time, doesnt work again OMEGALUL

keen drift
#

any output

mossy vine
#

none

keen drift
#

what

#

are you sure it's even being called

mossy vine
#

doesnt send

#

when it threw a typeError it did send

#

i am facking confused

keen drift
#

first, console.log doesn't return a promise

#

so then won't work

#
  1. that's not natan's
mossy vine
#

oh.

keen drift
#

client.channels.get(ID).send(MESSAGE).then(console.log, console.error)

#

do exactly that, just replace ID and MESSAGE

#

and do not console log the whole thing

mossy vine
#

nothing

keen drift
#

screenshot of what you have now Thonkang

mossy vine
#

again, client.channels.get(CHAN) works as its supposed to

knotty steeple
#

i know what node module is that

#

for the question think

#

you should use terminal-kit

#

but enquirer is nice

mossy vine
#

its inquirer

keen drift
#

interesting

knotty steeple
#

who cares about spelling

mossy vine
#

yes fishy, its interesting and annoying

keen drift
#

what's the content of ans.message?

#

is it guaranteed to be what you type in

mossy vine
#

an inputted string

#

and yes, its what its supposed to be

keen drift
amber fractal
#

What is it supposed to send tho?

keen drift
#

very confusing indeed, no resolve return nor error return

amber fractal
#

Like what is ans.message

mossy vine
#

an inputted string OMEGALUL

#

i literally said it 3 messages ago

amber fractal
#

So your trying to take input in one server and send it to another

#

Channel

mossy vine
#

i take console input and send it to a channel, yes

amber fractal
#

I helped someone with this on stack overflow lol

mossy vine
#

well then help me on discord lol

amber fractal
#

They used readline

mossy vine
#

im not using readline

#

im using inquirer

#

and thats not the point

#

the point is that .send() doesnt work

#

so is there anyone that knows what the fuck is happening OMEGALUL

bright spear
#

any error?

mossy vine
#

as i said above, i got an error once and it worked that one time

knotty steeple
#

how do i make my eval not return object promise

mossy vine
#

since its an eval, i dont think you can

gilded blaze
#

Wait for the eval to resolve

#

like await eval()

empty owl
#

how do u react with an ID

knotty steeple
empty owl
#

message.react('401376452441931778') doesnt seem to work

knotty steeple
#

and sometimes i get object object

#

so not really problem solved

gilded blaze
#

What do you want? You are getting the object you need

#

JS is simply using the toString method to display it as a string

knotty steeple
#

i dont need it to do that

amber fractal
#

I got it to work for me @mossy vine

inner jewel
#

@empty owl try message.react('aaa:401376452441931778')

mossy vine
#

@amber fractal holy shit what did you do?

inner jewel
#

custom emoji reactions have the form name:id

empty owl
#

thanls

inner jewel
#

but name can be whatever

#

as long as it's a valid emoji name

empty owl
#

lool

amber fractal
#

Literally what you did

mossy vine
#

wait what

#

okay im gonna try that

amber fractal
#

Replace bot with client and the id and message obviously

#

I just use bot over client

mossy vine
#

i know

amber fractal
#

I figured

empty owl
#

@inner jewel Unknown Emoji

mossy vine
#

its uhm

#

not working

empty owl
#

when I do message.react('anam401376452441931778')

mossy vine
empty owl
#
message.react('a:nam:401376452441931778')```
amber fractal
#

Yea that

knotty steeple
#

thats not how you react to a message with custom emotes

empty owl
#
.then(message => {message.react('a:nam:401376452441931778')})```
mossy vine
#

@amber fractal lmao its still not working

empty owl
#

also nam is animated

amber fractal
#

Is CHAN a string

#

Of the id i mean

mossy vine
#

yes, it logs the channel perfectly but doesnt send

amber fractal
#

O

mossy vine
#

oH WAIT

empty owl
#

wait

mossy vine
#

CAN YOU NOT SEND MESSAGES IN ready EVENT?

knotty steeple
#

probably not

#

should be able to

empty owl
#

why tho

amber fractal
#

I dont see why you couldnt...

mossy vine
#

try running it in the ready event @amber fractal

empty owl
#

message isnt defined

#

prob

zealous veldt
#

Anyone know if it's possible to update the frequency of a preexisting interval created using setInterval in JS. Would it be better to just destroy the interval and create a new one with the new frequency? And if it is possible, could I do it from within the interval (Ping me)

empty owl
#

trigger

gilded blaze
#

You can't.

amber fractal
#

Send messages in ready event

mossy vine
#

now this is weird as fuck

amber fractal
#

When do you take ans.message?

mossy vine
#

in the ready event from an inquirer prompt

#

and yes, it is a string

knotty steeple
#

have you just tried ans

mossy vine
#

it wont work as message is a property of ans

#

okay so im doing channel.send('hi') and doesnt work

#

so it cant be a problem with the inquirer

amber fractal
#

Put this in your event after the send if(!ans.message){ console.log("test") } i want to see if it exists after trying to send

#

If it sends test then it doesnt exist... Obviously

mossy vine
#

doesnt send it

#

i log ans.message and its perfect

amber fractal
#

Alright so it does exist then

mossy vine
#

the channel variable is still perfect

#

but the send just breaks

amber fractal
#

Idk what the problem would be

mossy vine
#

even if i tell it to say 'hi' it still wont send

amber fractal
mossy vine
#

its exactly that

#

with stuff replaced of course

amber fractal
#

instead of CHAN try instead just the id, it shouldnt make a difference, but you never know

mossy vine
#

i just tried that

#

no change

amber fractal
#

What version are you running?

mossy vine
#

?

amber fractal
#

Of discord.js

#

Stable?

mossy vine
#

11.4.2

#

i think thats stable

amber fractal
#

It is... I think

keen drift
#

wew fun code

mossy vine
#

it shold be

#

ikr fishy

inner jewel
#

@empty owl get rid of a:

#

it's ALWAYS name:id

empty owl
#

no

#

its animated

inner jewel
#

regardless if aninated or not

empty owl
#

and

inner jewel
#

for reactions there's no a:

#

only for message content

empty owl
#

it was because I didnt have it in my discord

#

i wored lol

#

worked

keen drift
#

discord is funky with emojis

inner jewel
#

message content:
<a:name:id> animated
<:name:id> regular

reactions:
name:id

earnest phoenix
#

Oooh

knotty steeple
#

if i send a message and i want to edit it whatever was in the message first time will be in the edited message + what i add

#

i dont want it to be this way

#

how do i do that

#

eris

#

only happens with embeds

inner jewel
#

send message -> edit it and add an embed -> both content and embed stay?

knotty steeple
#

yes

inner jewel
#

try sending content: null

knotty steeple
#

nope

fierce thorn
#

Any1 know how to make something like quiz to be active while people are sending messages to channel

#

And when they stop it will wait like x questions and if no one sends message stop quiz

#

discord.js

rocky dagger
#

Has anyone made a contest bot so you can host a contest on your server? @ me or message me.

knotty steeple
#

giveaway?

#

whats a contest waitwhat

high anchor
#

Hey anyone who uses discordjs here

#

I'm trying to do an AJAX request in my reaction handler, then accordingly editing the message

#

But the scope is getting fucked up

#

Whereas my non-async reaction handling that edits the message is doing fine

#

With the async added in it's saying "edited" but the content of the message isn't changing

quartz kindle
#

i dont thing the name "ajax" applies here lol, but show your code

high anchor
#

sure

#

and yeah it's not ajax, mindslip

#
self.react.gif = function(reaction, user, config) {
        var reactions = ["⏹","⬅","➡"]
        var i = reactions.indexOf(reaction.emoji.name)
        
        if (i == -1) return
        
        var old = reaction.message.embeds[0]
        var current = Number(old.footer.text)
        
        var newEdit = new Discord.RichEmbed()
        newEdit.setTitle(old.title)
        var query = old.title.replace("GIF: ", "")
        
        if (i == 0) {
            newEdit.setTitle(query) //prevents further reacting
            reaction.message.clearReactions()
            reaction.message.edit({newEdit}).catch(console.error);
            return
        }
        if (i == 1) {
            current -= 1
        }
        else if (i == 2) {
            current += 1
        }
        if (current <= 0) return
        console.log(current)
        request.get(
        {
            url: "https://api.tenor.com/v1/search?q="+query+"&key="+process.env.TENOR_KEY+"&pos="+(current-1)+"&limit=1"
        },
        function (err, res, body) {
            if (err) {
                console.error(err)
                return
            }
            var content = JSON.parse(body)
            var gifs = content.results
            newEdit.setImage(gifs[0].media[0].gif.url)
            newEdit.setFooter(current)
            reaction.message.edit({newEdit}).catch(console.error);
        })
    }
#

sorry for the messy blob
i havent cleaned it up yet

#

I tried doing
reaction.message.channel.send({newEdit})
and it's throwing an empty message exception

obsidian ember
#

So I want to give a rainbow role to donators in my guild, and I just have a question. How slow does rainbow role have to be to not violate the ToS? is one colour change per second good?

inner jewel
#

it can have a delay of infinite seconds

knotty steeple
#

one color per second is horrible

inner jewel
#

to not break the tos

knotty steeple
bright spear
#

one color change per minute maybe?

#

that wouldnt be very useful tho

quartz kindle
#

@high anchor you need to turn it into an async function and use await whenever you do an async call

knotty steeple
#

every 15 minutes

#

yes

quartz kindle
#

you have several async calls in that function that are all being executed at once without waiting for any of them to complete

inner jewel
#

</quote>

high anchor
#

Ok i'll try that
I thought most of the embed setters were sync cause it worked fine with my other embed editors

knotty steeple
#

make n large then

bright spear
#

well many bots have 1 minute timers

high anchor
#

@quartz kindle Turns out the issue isn't with async

#

If there is no description set, discordjs regards it as identical and doesn't go through with the edit

#

The reason my other embed editing worked was because they had descriptions
Whereas this one didn't

#

Maybe i should post this on the repo

bright spear
#

question for eris people: do people generally use client or bot for the client

high anchor
#

for the variable name

inner jewel
#

.edit({newEdit}) is the issue

#

the { and }

sick cloud
#

@obsidian ember it's a sensitive topic, but something like every 3 minutes would be safe

#

@bright spear ik your muted but client is widely used, eris examples use bot but really, who in their right mind doesn't use client

high anchor
#

@inner jewel Oh, I see

#

Thanks!

inner jewel
#

why does the variable name even matter lmao

high anchor
#

And it seemed to work, until now. So I would have never noticed
Thanks again

inner jewel
#

send({x}) is the same as send({x: x})

#

so if the variable was named embed

#

it would work

high anchor
#

okay

inner jewel
#

but for embed builders you can drop the { }

high anchor
#

gotcha

#

god im stupid
i coincidentally named it to embed in the same commit where i added the description

slim heart
#

wait is there a way to log like any and all DiscordAPIError, like how client.on('error' works but it works with the things like "unkown message" and "missing permissions" etc. but i dont have to go through and add .catch(err=>console.log(err.message)) everywhere

earnest phoenix
#

how can i login as user, discordjs

#

client.login("email", "password") doesnt work

amber fractal
#

User accounts are against tos

earnest phoenix
#

i know

amber fractal
#

We cant assist

#

My discord account was terminated for it

earnest phoenix
#

i just need to know how to login

#

thats all

amber fractal
#

We still cant help you break tos

high anchor
#

@earnest phoenix this might help

#
earnest phoenix
#

lol, reason i came here is cuz google isnt helping

#

i cant find user token nor login with email

amber fractal
#

You came to the wrong place then.

earnest phoenix
#

seems like

keen drift
#

djs dropped that support in future versions

amber fractal
#

Finally did?

keen drift
#

it was dropped months ago

#

just not on stable

#

also I doubt anyone here will help you with user bot

amber fractal
#

If they did theyd be going against the tos too just sayin

keen drift
#

yeah idk about that part

unique iron
#

anyone know how to limit this API to not generate images from NSFW channels?

velvet cove
#

i want my bot to send a message in new servers it joins, what’s the best way to choose which channel to send it to?

#

oops and i’m using discord.js

amber fractal
#

You could get all channels and loop through it until it gains access to send to one. Not to all though. Its hard to do that sense they removed defaultChannel

bright spear
#

@velvet cove FYI people usually hate it when bots do that

visual zenith
#

@sick cloud i need help on the help menus

#

Like when I react the ➡ it doesnt change the embed

warm marsh
#

@visual zenith you require a collector if using discord.js and wait for the desired emoji

#

if any other language i have no idea

sick cloud
#

@visual zenith what error(s) are popping up?

visual zenith
#

Darn im on mobile

#

Cant access my code atm

sick cloud
#

mention me when you can then

dreamy charm
#

Uh so

#

I have a bot

#

That's all

amber fractal
#

.. 🤔

faint junco
#

Anyone know free hosing services? .-.

amber fractal
#

Heroku/Glitch

lament meteor
#

free and good host does not go well together

warm marsh
#

@faint junco your pc?

#

its this mad technique called don't turn it off.

#

Although AWS and AZURE have 12 month trials

blazing star
#

Didn’t AWS lower there trial to like 6 months?

amber fractal
#

Yes, it gave me 4.2.6

#

Not latest

blazing star
#

hmm

#

ill try and find the command

amber fractal
#

Thanks

blazing star
#

what ubuntu version?

amber fractal
#

16.04

blazing star
#

I have that version too

#

is curl installed

amber fractal
#

Im going to remove this node real quick

#

And I dont think so

blazing star
#

sudo apt install curl

#

which version to you want

#

the latest or the stable?

#

10 or 8

amber fractal
#

Stable

blazing star
#

hmm

#

ok

#

curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -

#

node 10 should work

#

if it breaks then install nodejs v9

#

I'm using v10 rn

amber fractal
#

Thanks :)

#

got 10.15 now

blazing star
#

nice

#

iirc node 11 is out

amber fractal
#

sudo apt install npm will install npm right?

blazing star
#

npm is automatically installed

amber fractal
#

Oh

blazing star
#

you can check the versions with node -v and npm -v

amber fractal
#

Just a new problem now

blazing star
#

Yes?

amber fractal
#

This used to work

#

Now its saying its not

blazing star
#

I think you need to reinstall discord.js idk

#

I dont use shards

amber fractal
#

It requires correctly

blazing star
#

strange

high anchor
#

Is there anything built into the API for checking the account ages of connections

blazing star
#

like the user account age, or?

high anchor
#

Yeah eg. the age of a connected twitter account

blazing star
#

you would need to use the twitter api for that

#

if they have one

high anchor
#

Ok thanks

blazing star
#

np

amber fractal
#

./index.js should just go back to the same file right?

#

Because its going to root

#

This vps stuff is so confusing

blazing star
#

I would put ur bots files in a folder

mossy vine
#

I think so

amber fractal
#

They are

blazing star
#

it should go into the project dir and require index.js

amber fractal
#

./index.js goes back 2 files

blazing star
#

wait it should go back one

amber fractal
mossy vine
#

What the

amber fractal
#

The require works goes to node_modules

blazing star
#

no

amber fractal
#

It does

#

I logged it

blazing star
#

it can require local files smh

amber fractal
#

It logged discord.js

blazing star
#

require is usefull because it can load node_modules, and local files

amber fractal
#

The require isnt the problem

#

Its the .index.js

blazing star
#

what discord.js version do you have?

amber fractal
#

table

#

Stable*

blazing star
#

ew, use master

amber fractal
#

Why

blazing star
#

its better

#

that aside

#

whats the issue

amber fractal
#

It worked

#

It goes directly to root

blazing star
#

hmm

amber fractal
#

Error: ENOENT: no such file or directory, stat '/root/index.js'
at Object.statSync (fs.js:851:3)

blazing star
#

try ../

amber fractal
#

same thing

blazing star
#

can you send the projects cwd?

amber fractal
#

?

blazing star
#

like the path

#

the cwd is the project path

amber fractal
blazing star
#

for eg: /root/project

#

./index should not be going to the root dir

amber fractal
#

It worked before I put it in to the vps

#

In heroku

#

It worked.

blazing star
#

o no heroku

amber fractal
#

The reason I moved.

#

All modules the same version

blazing star
#

that should not effect things

#

well it would if any big changes occurr

amber fractal
#

Any way I can log ./index.js with console.log to see if maybe its a problem with something else?

#

This isthe error ;-;

#

idk why it's going to root

#

And when I add a /mobilefriendly it works, but loops everything while going through the files. And errors a bunch of times

blazing star
#

how are you running the file?

high anchor
#

Check how you’re initializing

#

It may be an incorrect startup script path

blazing star
#

yea

amber fractal
#

node mobilefriendly/index.js

blazing star
#

thats why

amber fractal
#

Mb

#

shard.js

blazing star
#

you should cd into the dir

#

and run the file from there

amber fractal
#

I never use terminals

blazing star
#

cd mobilefriendly

#

node shard.js

amber fractal
#

My god

#

It worked

#

Thank you

blazing star
#

also

#

if you exit the terminal window your bot could go offline

#

depending on what terminal window you use

#

my recommendation is to use pm2

amber fractal
#

Its an online terminal...

#

Im on a chromebook ;-;

blazing star
#

oof

amber fractal
#

Thanks tho, just got everything working

knotty steeple
#

pm2 isnt a terminal

#

its a process manager

#

literally the name

earnest phoenix
#

Someone can help me ?

bright spear
#

@earnest phoenix never ask to ask, always just ask your question and wait

earnest phoenix
#

Okay, my bad sorry

#

Before:
-I use 'discord.js'
-I use file .JSON and read them

Here is my problem:
I want that my code verified if there is server's id in file witj:

if (message.content.startsWith(prefix_server[message.guild.id].prefix + ...)

before modified my code, all work perfectly but now, 2 problems are here:
API discord:

{ DiscordAPIError: Missing Permissions
    at item.request.gen.end (C:\Users\pc\Desktop\Bot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:79:15)
    at then (C:\Users\pc\Desktop\Bot\node_modules\snekfetch\src\index.js:215:21)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  name: 'DiscordAPIError',
  message: 'Missing Permissions',
  path:
   '/api/v7/guilds/521362591969312768/members/503970145279016971/roles/526732974478327809',
  code: 50013,
  method: 'PUT' }

JS:

if (message.content.startsWith(prefix_server[message.guild.id].prefix + `infobot`))
                                                               ^

TypeError: Cannot read property 'id' of null
    at Timeout._onTimeout (C:\Users\pc\Desktop\Bot\index.js:175:64)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

Someone know why i have they errors ?

sick cloud
#

don't use json

prime cliff
#

@earnest phoenix

  1. Says right there Missing Permissions
  2. Your guild object is null
earnest phoenix
#

My bot are all permissions :/
In .JSON file, the guild id are present

#

i can help you

#

@earnest phoenix

#

let prefix = prefix_server[message.guild.id].prefix

#

do that

#

Okay, i try this

#

if(message.content.startsWith(prefix + `infobot`))

#

don't work, same errors :/

#

what is the error?

#

Your json file is empty ?

#

No

#
let prefix = prefix_server[message.guild.id].prefix
                                             ^

TypeError: Cannot read property 'id' of null
    at Client.bot.on.message (C:\Users\pc\Desktop\Bot\index.js:171:46)
    at Client.emit (events.js:182:13)
    at MessageCreateHandler.handle (C:\Users\pc\Desktop\Bot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (C:\Users\pc\Desktop\Bot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (C:\Users\pc\Desktop\Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (C:\Users\pc\Desktop\Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
    at WebSocket.onMessage (C:\Users\pc\Desktop\Bot\node_modules\ws\lib\event-target.js:120:16)
    at WebSocket.emit (events.js:182:13)
    at Receiver._receiver.onmessage (C:\Users\pc\Desktop\Bot\node_modules\ws\lib\websocket.js:137:47)
    at Receiver.dataMessage (C:\Users\pc\Desktop\Bot\node_modules\ws\lib\receiver.js:409:14)

This error

#
{"527825294409859083":{"prefix":"t!"},"333949691962195969":{"prefix":"t!"},"264445053596991498":{"prefix":"t!"},"521362591969312768":{"prefix":"t!"}}

My json file

#

hmm

#

i do custom prefix on my bot and.. i dont have this error

#

This errors submited when new member joined server

#

you put your code in a event ?

#

the code is in:

bot.on('message', message =>
{
 //code here
})
lament meteor
#

also.... don't use a json db. it is not good, it can get corrupted

earnest phoenix
#

So what can use for custom prefix ?

#

mysql

#

its hard for beginner

#

stay on json

#

@earnest phoenix i do that on my old bot and its working

#

wait

#


  if(!prefixx[message.guild.id]){
   prefixx[message.guild.id] = {
     prefixes: "*"
  };
  }

  fs.writeFile('./prefixes.json', JSON.stringify(prefixx), (err) => {
   if (err) console.log(err)
})






  let prefix = prefixx[message.guild.id].prefixes```
#

I try this

#

Errors:

if(!prefixx[message.guild.id]){
                              ^

TypeError: Cannot read property 'id' of null
    at Client.bot.on.message (C:\Users\pc\Desktop\Bot\index.js:173:31)
    at Client.emit (events.js:182:13)
    at MessageCreateHandler.handle (C:\Users\pc\Desktop\Bot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (C:\Users\pc\Desktop\Bot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (C:\Users\pc\Desktop\Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (C:\Users\pc\Desktop\Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
    at WebSocket.onMessage (C:\Users\pc\Desktop\Bot\node_modules\ws\lib\event-target.js:120:16)
    at WebSocket.emit (events.js:182:13)
    at Receiver._receiver.onmessage (C:\Users\pc\Desktop\Bot\node_modules\ws\lib\websocket.js:137:47)
    at Receiver.dataMessage (C:\Users\pc\Desktop\Bot\node_modules\ws\lib\receiver.js:409:14)
#

Wtf

#

Owh

#

Its normal

#

You make that

#

Client.bot.on.message

#

Line 173

#

@earnest phoenix

late hill
#

Just read the error

#
TypeError: Cannot read property 'id' of null```
#

guild = null

earnest phoenix
#

This is not a error

#

Id is already defined in discord.js

late hill
earnest phoenix
#

The error is Client.bot.on

late hill
#

No xd

earnest phoenix
#

Yes

late hill
#

So I guess the first line of the error is just there for your entertainment

earnest phoenix
#

at Client.bot.on.message (C:\Users\pc\Desktop\Bot\index.js:173:31)

#

the error is that

late hill
#

That's where the error is situated

#

But okay

#

It's means the error is inside his

client.bot.on("message" => {
blablabla
earnest phoenix
#

wtf

#

client.bot.on doesn't exist

#

its client or bot

late hill
#

It's what his error says

earnest phoenix
#

bot.on("message"

#

okay

late hill
#

So it's probably there

earnest phoenix
#

@earnest phoenix Do you have edited ?

#

i have :

const Discord = require('discord.js')
const bot = new Discord.Client()

bot.on('message', message =>
{
//code here
})
#

On line 173 ?

#

if (message.content.startsWith(prefix_server[message.guild.id].prefix + 'infobot'))
But i try to delete bot.on('guildMemberAdd', member => and without that, it work

late hill
#

Wow what a suprise

#

You probably shouldn't use guild ID's to index your array

#

And you also probably shouldn't make your prefixes array an array of objects with just 1 property

#

Doesn't make much sense

#

If you actually want your bot to be good and working properly

#

Don't even try this writefile stuff

#

Go do some research on databases

earnest phoenix
#

Oh okay, thanks

#

@earnest phoenix why you add guildMemberAdd?

#

I want that my bot add role when a member join if the config autorole is enabled ans do nothing is it is disabled but that make errors so i delete it

#

Oh okay

#

Thanks for help c:

#

No problem

livid whale
#

UnhandledPromiseRejectionWarning: Error: 404 Not Found

#
    console.log(user.username);
});```
#

I get error when I use .getUser

earnest phoenix
#

Well the error is clear as day: the user was not found.

west raptor
livid whale
#

When users votes are reset

#

🤔

#

I want to add Rewards on vote for that I need Vote Reset time so bot will clean database

lament meteor
#

every month on the first day

livid whale
#

And daily votes ?

#

@lament meteor

lament meteor
#

im not sure

quartz kindle
#

i imagine daily votes dont have a fixed time

#

its probably 12 hours after the vote

livid whale
#

🤔

#

Means I vote now

#

So my vote will delete after 12 Hour

#

Then only I am able to vote

quartz kindle
#

not delete, just reset so you can vote again. and i dont remember but i think it was changed to 12 hours from 24

lament meteor
#

maybe using EST time tbh

#

idk

#

@bitter sundial how does the votes work? i think you should add that to the documentation

livid whale
#

Ya

#

Please add daily vote reset time in docs

bitter sundial
#

?

livid whale
#

It will help us to improve vote rewards

#

I want to know when daily user vote get reset

#

Like which time

lament meteor
#

how does the daily votes work

bitter sundial
#

12 hours from when you vote

lament meteor
#

ah ok

#

so it doesn't flush at a certain time

livid whale
#

12 hours after every user vote ?

bitter sundial
#

yea

livid whale
#

Like I vote for a bot now

#

So I can vote for same bot after 12 hours

lament meteor
#

yes

livid whale
lament meteor
#

well that is new info for me

livid whale
#

So I have to add 12 Hours MS

#

In database so bot will delete after 12 hours

lament meteor
#

ig

#

well that would eat a lot of memory

livid whale
#

Can anyone help me for discord oauth

lament meteor
#

tbh the 12 hour ms thing would eat a lot of mem

livid whale
#

🤔

#

@lament meteor can you help me with OAuth ? Login ?

lament meteor
#

what language thou?

#

i never coded a dbot in py but i know py. on the other hand i know how to make auth with js

livid whale
#

I want to make oAuth in php

lament meteor
#

sorry im not so good at php

livid whale
#

In node can you ?

#

Can you say process of oAuth working

#

So I can make in php

#

@lament meteor

quartz kindle
#

oauth is just a sequence of http requests, any language with internet access can do them

#

you just need a server thats listening to discord's redirect

livid whale
#

@quartz kindle you know php

#

?

quartz kindle
#

yeah

livid whale
#

So if I get any issue can you help me

quartz kindle
#

i havent done oauth (because i dont need it), but i can try

livid whale
#

A doubt

#

How to get ms time in moment

#

Current ms time

earnest phoenix
#

what is ms ?

livid whale
#

Milliseconds

earnest phoenix
#

you want to get the current time in milliseconds?

livid whale
#

Ya

earnest phoenix
#

language?

livid whale
#

Node

split dune
#

JAVASCRIPT, node isnt language plz ... stop

earnest phoenix
#

Node.js is a language

#

Javascript is too large

split dune
#

not, this is run-time environment

earnest phoenix
#

Node.js is simplified

split dune
#

Nodejs is runtime environment for javascript

earnest phoenix
#

Yeah

#

I dont know how to say that @split dune

#

But i dont speak english

#

from what i'm seeing from the docs you'd just want to use Date.now()

split dune
#

Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code outside of a browser. Typically, JavaScript is used primarily for client-side scripting, in which scripts written in JavaScript are embedded in a webpage's HTML and run cli...

runic hull
#

Can someone halp me? I can not get it to show how many servers my bot is running on 😦

livid whale
#

@runic hull which language you use ?

runic hull
#

python

livid whale
#

I don't know about Python Sorry

#

import aiohttp

dbltoken = "token"
url = "https://discordbots.org/api/bots/" + bot.user.id + "/stats"
headers = {"Authorization" : dbltoken}

async def on_ready():
    payload = {"server_count"  : len(bot.servers)}
    async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(url, data=payload, headers=headers)

async def on_server_join(server):
    payload = {"server_count"  : len(bot.servers)}
    async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(url, data=payload, headers=headers)

async def on_server_remove(server):
    payload = {"server_count"  : len(bot.servers)}
    async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(url, data=payload, headers=headers)
#

I see this @runic hull

runic hull
#

Okay thx

#

I can not run pip install dblpy on my vServer.

#
import discord
import aiohttp

bot = discord.Client()
dbltoken = "TOKEN_ALREADY_IN_HERE"
url = "https://discordbots.org/api/bots/" + bot.user.id + "/stats"
headers = {"Authorization" : dbltoken}

async def on_ready():
    payload = {"server_count"  : len(bot.servers)}
    async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(url, data=payload, headers=headers)

async def on_server_join(server):
    payload = {"server_count"  : len(bot.servers)}
    async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(url, data=payload, headers=headers)

async def on_server_remove(server):
    payload = {"server_count"  : len(bot.servers)}
    async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(url, data=payload, headers=headers)
 
bot.run(bottoken)
51|h2  | Traceback (most recent call last):
51|h2  |   File "/root/h2.py", line 6, in <module>
51|h2  |     url = "https://discordbots.org/api/bots/" + bot.user.id + "/stats"
51|h2  | AttributeError: 'NoneType' object has no attribute 'id'
51|h2  | Unclosed client session
51|h2  | client_session: <aiohttp.client.ClientSession object at 0x7f034fa174e0>
51|h2  | Traceback (most recent call last):
51|h2  |   File "/root/h2.py", line 6, in <module>
51|h2  |     url = "https://discordbots.org/api/bots/" + bot.user.id + "/stats"
51|h2  | AttributeError: 'NoneType' object has no attribute 'id'
51|h2  | Unclosed client session
51|h2  | client_session: <aiohttp.client.ClientSession object at 0x7f3adc1d9550>

[vServer]

#

😦

visual zenith
#

@sick cloud im on my computer now

quartz kindle
#

@runic hull this doesnt work url = "https://discordbots.org/api/bots/" + bot.user.id + "/stats" because bot.user.id does not exist yet

#

you need to do it inside the ready event

runic hull
#

I already fixed it.

quartz kindle
#

👍

amber fractal
#

How do you get things like cpu and ram usage

quartz kindle
#

best way would probably be to get them from your system

#

by executing a linux command using exec for example in node.js

amber fractal
#

I just keep having problems...

#

Im not sure why this exists now

#

It never used to happen

#

I'm trying to make a json file with prefixes for each guild so they can all have seperate prefixes, but I'm having trouble writing to the file

#

It reads it fine

#

Whoops

bitter sundial
#

if you want to use a . in your key, wrap it in quotes

amber fractal
#

Then it wont be the guild id

#

It will just be a string.

bitter sundial
#

oh I see

amber fractal
#

I tried ${message.guild.id}

#

as well

#

Thats the proper picture

bitter sundial
#

you should use bracket notation then

amber fractal
#

Can I write to files doing that?

#

Because thats what I was doing earlier

#

it never saved

bitter sundial
amber fractal
#

It works now, but it's overwriting the json file completely

#

I think I know how to fix that tho

blazing star
#

imo i would use a database for that, mongodb is a great option

amber fractal
#

I have no experience with databases.

#

I tried one

#

They confuse the hell out of me

blazing star
#

what did you try?

amber fractal
#

I dont remember lol, it was a while ago

#

I nearly got this done anyways

blazing star
#

nice

amber fractal
#

Got it all working

#

thanks for the help

#

I forgot to turn on my music throughout all of that :(

frozen tiger
#

Do you know how can I determine if a user has a certain permission just using the permission int?

blazing star
#

yes with bitwise masking

amber fractal
#

Do you need to use the int?

blazing star
#

Boolean(totalBits & bit)

amber fractal
#

its much easier to do message.member.permissions

#

Wait

blazing star
#

true

amber fractal
#

idk lib so

blazing star
#

but bitwise masking more fun

amber fractal
#

output: false

frozen tiger
#

@amber fractal I'm doing it in PHP using api calls

blazing star
#

oh php

frozen tiger
#

x)

amber fractal
#

Good luck, idek what that is

frozen tiger
#

oh, seems to be pretty ez

#

hahaaa

#

done

#

I wanted to check if for each guild, the logged user had the "Manage server" perm (to know if they can invite a bot) and here's how I did it in PHP (for those who wanna know) :

<ul>
    <?php
    $guilds = getGuilds($_SESSION['token']);

    foreach ($guilds as $guild) {
        ?>

        <li><?= $guild['name'] . ' (' . ($guild['permissions'] & 32) . ')' ?></li>

        <?php
    }
    ?>
</ul>
earnest phoenix
#

you say php i hear web vuln

frozen tiger
#

why tho

earnest phoenix
#

a better question would be why not

frozen tiger
#

I though php was designed to be pretty secure

earnest phoenix
frozen tiger
earnest phoenix
#

if you say your app runs on php most devs in general won't take take you as a proper dev

frozen tiger
#

well, I'm just tryin' to make a system just like mee6, dyno or Melijn to login through discord and manage the bot via a dashboard

earnest phoenix
#

use anything but php for that

frozen tiger
#

what else?

earnest phoenix
#

been there, done that, php is extremely unsecure and i leaked my bot's token in the early days

frozen tiger
#

hoooow

earnest phoenix
#

by it just being in the server's code

#

anyways

#

i personally use asp.net core, you can also use node or python

frozen tiger
#

bruuuh

earnest phoenix
#

my site is SPA running with react and asp.net core

blazing star
#

react is gud

earnest phoenix
#

agreed

#

react's routing is just 👌

rugged pond
#

Did someone know how to disable JDALogger ?

inner jewel
#
  1. you don't
  2. you don't
  3. you don't but in italic
rugged pond
#

I like the third choose

#

😂

keen drift
#

@frozen tiger PHP is not that bad, but beware there are some really stupid implementation

visual zenith
#

xD

keen drift
#

@frozen tiger pretty much any untyped system | dynamically typed | no type assertion is pretty bad when it comes to security

#

but if you know what you are doing, PHP is just as secure (PHP actually introduced type hinting which is phenomenal)

zealous veldt
#

PHP stands for Perhaps Only Facebook uses this

orchid raft
#

If a bot has, say, 3 shards, what does that mean? minx==noob

inner jewel
#

it has 3 separate connections to discord

#

each handling a part of the guilds

orchid raft
#

How do you do that

inner jewel
#

check the docs for your library

#

but you only need it if you have thousands of guilds

orchid raft
#

Makes sense

late hill
#

How does sharding handle DM's 🤔

#

Because a user can be on multiple shards right?

keen drift
#

dm goes to shard 0

late hill
#

o

#

Thanks

frozen tiger
#

How can I check (using api calls only, yeah again) if my bot is in a given guild, looking the api doc for 45min now but can't figure out how to do this

sick cloud
#

what lib

frozen tiger
#

no lib

#

that the problem

bright spear
#

just try to get the guild??

heady anvil
#

what very obscrure language are you using

bright spear
sick cloud
#

@frozen tiger once the guildCreate ws events are sent you should store them in a guilds collection or something. just find it from there

#

@bright spear unnecessary api call

frozen tiger
#

bruh

#

I have to use api calls

sick cloud
#

discord api specifies you should locally cache the guilds sent

#

you dont

gritty bolt
#

How can I auto edit a message every minute with data that is also being checked every minute and stored in a variable? I keep getting errors saying that I havent defined my guild even though it is directly next to my 'channels'.

sick cloud
#

you should be storing the guilds locally

frozen tiger
#

I'm doing a php dashboard

sick cloud
#

oh your not making a direct ws connection

#

could've mentioned that

#

but ok

#

yeah use the api endpoint

bright spear
#

cant you use one of the php libs?

frozen tiger
#

I was hoping not to do that

#

May affect performances

bright spear
#

well they might ban you for not using a lib if you accidentally spam the api

#

vetted libs protect against that

frozen tiger
#

Here's my goal :

Sign in through discord : Done.
List guild where the logged user can invite the bot : Done.
Mark those where the bot is already in : This is what I wanna do.

#

hmm, you're right

bright spear
inner jewel
#

why don't you use some form of IPC

#

to check the guilds the bot is in?

#

GET /users/@me/guilds with the oauth token

#

then send the ids to the bot

#

and have the bot respond with the guilds it's in from that list

frozen tiger
#

@inner jewel I planned to do that since advaith suggested to use a php library

keen drift
#

are you really using php for your bot Thonkang

#

what happened to your java stuff

frozen tiger
#

as I said, I'm going to make an online dashboard 😄

#

my java is gently running for now

keen drift
#

yeah so am I

#

but I'm just querying my backend for it

frozen tiger
#

wdym

keen drift
#

My backend exposes an API endpoint for my to query

frozen tiger
#

wow

keen drift
#

ex: api.reaction-role.com/v2/guild/:id

frozen tiger
#

Ooooh so your kinda making your own api to query information directly through your bot?

inner jewel
#

i do basically that but via nats

frozen tiger
#

this is way to hard for me, I'm a terrible java coder haha

#

not even able to make a decent piece of code lol

amber fractal
#

My bot keep making 2 instances. I just stopped it even and its still running 2

frozen tiger
#

are you logging twice in your code somewhere ?

amber fractal
#

No

#

The part that I stopped it via terminal and its still running is the real problem

frozen tiger
#

reboot ur computer

amber fractal
#

Its not on my computer

#

Ill reboot the vps tho

frozen tiger
#

reboot ur vps or whatever hosts your bot

amber fractal
#

Just rebooted it, its still online

#

Already regenerated the token

#

It finally shut off, but its weird

frozen tiger
#

your token may have leaked

#

and don't forget that timeout may take a while

amber fractal
#

upwards of a minute to shutoff is just odd tho

keen drift
#

@inner jewel so uh help me out h e r e

frozen tiger
keen drift
#

how well do you know hazelcast Thonkang

buoyant void
#

How would I get an object at a certain index in a collection? For instance, using

client.on('guildCreate', async guildAdd => {
    for (var i = 0; i < guildAdd.members.length; i++) {
        var userId = guildAdd.members[i].id;
    }
}

guildAdd.members[i].id is apparently? Not a function that works?

frozen tiger
#

fishy, can you tell me very quickly how can you make an internal api to use your bot as a gateway ? any tutorial, doc ?

keen drift
#

certain index?

#

collection is a map

buoyant void
#

oh damn

#

how do i use that

keen drift
#

map.get(key)

buoyant void
#

so it's guildAdd.members.get(i)?

keen drift
#

that's djs right?

buoyant void
#

yeah

keen drift
#

what you trying to do

#

@frozen tiger no tutorial unfortunately

frozen tiger
#

aw

#

how it works then?

buoyant void
#

Trying to loop through all users, and log all of their ID's in an object, push that object to an array, then send that array thing in to a JSON file

keen drift
#

So you trying to get all users in a guild?

buoyant void
#

On guild join

#

Yeah

#

On guild join, that is

keen drift
#

json.stringify(guild.members.values())

buoyant void
#

ooh

#

That gets all members?

keen drift
#

yeah Thonkang

#

@frozen tiger api calls to cache layer, done

buoyant void
#

I'm rart

frozen tiger
#

so in fact, you query information in your bot cache?

keen drift
#

Yeah

#

Otherwise you will hit Discord ratelimit

#

really quick

frozen tiger
#

just like querying a redis cache ? XD

keen drift
#

yeah

frozen tiger
#

wtf bro

#

soo

#

you need to update information pretty often in your cache

keen drift
#

yeah

#

most lib maintains a cache regardless

frozen tiger
#

yes but how can I access JDA cache via php ? hehe

keen drift
#

that u gotta ask natan or someone that knows jda

#

kek

#

but jda heavily cache based

frozen tiger
#

I saw in Melijn repo (I think) somehow a locale ip that may lead to JDA cache

#

but not sure at all

inner jewel
#

hazelcast?

#

i know it's a thing and that vertx uses it

#

and that's it

keen drift
#

vertx?

#

whomst've is that

buoyant void
#

what exactly does guild.members.values() return?

frozen tiger
#

so there is a way to access JDA cache via request @inner jewel ?

inner jewel
#

if you write code to expose it, yes

frozen tiger
#

oof

#

this is going way to far

inner jewel
#

this is what i use for my dashboard

#

well

keen drift
#

@buoyant void it returns an iterator

inner jewel
#

to check which guilds the user has permission in

keen drift
#

@buoyant void guild.members.array() is also available

frozen tiger
#

kotlin, yaark puke

inner jewel
#

scala*

frozen tiger
#

reoinveroin

keen drift
#

@inner jewel so uh what's vertx

buoyant void
#

ahh

#

.array() is what i needed

#

thank you

inner jewel
#

a lib

#

for writing non blocking™ event loop™ based applications™

zealous veldt
#

keen drift
#

@inner jewel link m e

zealous veldt
#

Natan™

inner jewel
keen drift
#

o this looks gey

inner jewel
#

it is

frozen tiger
zealous veldt
#

lol

keen drift
#

i'm trying to see what good memory data grid options there are

inner jewel
#

there's some nice stuff but then there's the http client that makes everyone puke

keen drift
#

currently I found apache ignite, hazelcast and gridgain

inner jewel
zealous veldt
#

lol

frozen tiger
#

sigh guess I'm gonna forget this dashboard projet for now

keen drift
#

lul

#

@inner jewel hey uh, how heavy is jvm overhead with memory

frozen tiger
#

dude this is way too complex

bright spear
#

or u could just make it in the same lang and lib you made your bot with

keen drift
#

and what do people mean when they talk about jvm waming up Thonkang

inner jewel
#

depends on your code

#

uhhh

#

the jvm starts slowly

frozen tiger
#

If somehow, I succeed to make a working one It'll be awful

inner jewel
#

it profiles your code when it's interpreting

keen drift
#

slowly Thonkang

#

o

inner jewel
#

then it can optimize it

keen drift
inner jewel
#

but the optimizer takes a while to kick in

#

so it can do optimizations after it has enough information

keen drift
#

one of the Discord outage announcement was like

#

waiting for cache to warm up

#

is it safe to assume they use jvm Thonkang

frozen tiger
#

@bright spear well, would be ez af but how do you make an online dashboard from java haha

inner jewel
#

not really

keen drift
#

is there another lang that does this

inner jewel
#

cache warming up is probably loading stuff into cache

keen drift
#

interesting

inner jewel
#

could be any lang

keen drift
#

warming is so vague

inner jewel
#

i know they use java for the DB

keen drift
#

which db Thonkang

inner jewel
#

cassandra is java

keen drift
#

o

inner jewel
#

most of the things you'll find out about "java uses too much memory" are either outdated or comparing it to eg optimized native code

#

or outright wrong

#

eg if you compare jda and d.js

keen drift
#

what about Minecraft Thonkang

inner jewel
#

because jda caches everything, members, users, etc

keen drift
#

why does Minecraft uses so much shit

inner jewel
#

and d.js doesn't

#

minecraft is shitcode

keen drift
#

kek

inner jewel
#

it literally is

#

mojang can't write good code

#

cc @cosmic plover World.java and redstone stuff

keen drift
#

my gpu is rendered useless on minecraft

inner jewel
#

minecraft uses an ancient version of opengl

#

because they don't update lwjgl

#

the lib supports newer versions of opengl but they stay on old builds that don't

bright spear
#

wot about bedrock

inner jewel
#

¯_(ツ)_/¯

bright spear
#

what language is bedrock even

inner jewel
#

c++

keen drift
#

wew

frozen tiger
#

what about windows 10 edition

#

kek

zealous veldt
#

ew

inner jewel
#

win10 is bedrock

zealous veldt
#

lol

frozen tiger
#

bruh

keen drift
#

time to play bedrock

frozen tiger
#

names're too complicated

#

so bedrock = win10 edition and java edition = normal version

keen drift
#

yes

zealous veldt
#

codenames are weird

#

windows longhorn

keen drift
#

2015 Razer Blade: Razer Blade

zealous veldt
#

yes

keen drift
#

2016 Razer Blade: Razer Blade

zealous veldt
#

when razer tells everyone the code name of a product and then explains what it does and shows it at CES

earnest phoenix
#

i have a question about

#

ok

#

i did this

    dbl.hasVoted(`${message.author.id}`).then(voted => {
        if (voted) {
            const voting = message.content.split(' ').slice(1);
            const votes = voting.join(' ')
            console.log(`Vote command is used | Server: ${message.guild.name} | Server ID: ${message.guild.id} | Channel: ${message.channel.name} | By: ${message.author.username}| Question: ${votes}`)
            
            if (!message.member.hasPermission('KICK_MEMBERS')) return message.channel.send('Only Moderators are allowed to use this command. Enable permission KICK_MEMBER for your role to access the command.');
            message.channel.send
            {
                if(!votes) return message.reply(`Invalid Usage: =>poll [Question]`)
                message.delete()
                let embed = new Discord.RichEmbed()
                .setAuthor('Voting | Poll')
                .setColor('0xFF5733')
                .setDescription(`Question: ${votes}`)
                .setFooter(`Created by ${message.author.username}`)
                message.channel.send(embed)
                .then(newmsg => {
                    newmsg.react(`✅`)
                    .then(() => {
                        newmsg.react(`❌`)
                    })
                })
            } 
        } else return message.channel.send({embed: {color: 65292, title: "Upvote", description: "Please upvote Vortex to access this command. [Click here](https://discordbots.org/bot/427484224074022945/vote)"}}).catch(console.error);
    });
#

i dont think i did it correct

#

cuz it says that dbl.hasVoted isnt a function

#

what do you have dbl set as

#
const dbl = require('dblapi.js');
inner jewel
#

you need to create a new instance of it

earnest phoenix
#

thanks natan

keen drift
#

good natan

earnest phoenix
#

natan knows all

#

XD

frozen tiger
#

Fishy, i'm completly lost.. Just can't figure out how can I make a gatewey api through java

#

this would be so easier to make my dashboard

inner jewel
#

how to do it is completely dependent on what you have

#

that's why there are no tutorials

#

you can get tutorials for pieces you'd use to make that

#

but for the whole thing there aren't any

#

because it's different for each bot

frozen tiger
#

I know it depends on what I wanna do

keen drift
#

never ask me for java advice

#

hue hue

frozen tiger
#

but the core how can I, for example, return guilds count via http://127.0.0.1:8888/api/guilds_count or something like this

keen drift
#

i'll just convert you to another lang

frozen tiger
#

uri is an exemple

inner jewel
#

if you want to do it via http, get a webserver

#

and host it in your bot's process

frozen tiger
#

alrigh

buoyant void
#

Any way to allow anyone with any role that has "Administrator" enabled to use a command? For now, I've been using specific roles

#

Discord.js

sick cloud
#

just use the permission

buoyant void
sick cloud
#

<GuildMember>.hasPermission('ADMINISTRATOR')

#

returns a boolean