#topgg-api

1 messages ยท Page 32 of 1

restive otter
#

๐Ÿ˜„ k thanks

austere swallow
#

No problem!

restive otter
#

If it says there is an update should I update?

#

Can I get a "13" role?

#

Why do almost all the Moderators have an under 13 role?

#

Is it like a joke thing?

loud gulch
restive otter
#

Actually I'm offtrack now, sorry.

austere swallow
#

OwO if you are really under 13 you can ask the mods for that role, you can get access to the cool kids club

#

And updates if you mean npm updates then its up to you but for the api it should automatically install the latest one

restive otter
austere swallow
#

Try running as root/sudo, as suggested

restive otter
#

Ok.

#

Don't ask why it's called fork-foam.

loud gulch
#

glitch?

restive otter
#

Idk?

loud gulch
#

how do you not know zoomeyes

restive otter
#

That's what I need help with.

#

glitch, what are you on? thatโ€™s a vps

#

vps?

#

nvm

#

Sorry, I'm just a person that managed to somehow make a bot.

#

ยฏ_(ใƒ„)_/ยฏ

#

try npm i -g npm

#

also npm installed so why?

#

Already did.

austere swallow
#

it needs to be run with root perms

#

sudo npm i -g npm

restive otter
austere swallow
#

npm updates @restive otter

restive otter
#

its glitch GWcmeisterPeepoShrug

#

Sudo is apparently not a command ;-;

#

ยฏ_(ใƒ„)_/ยฏ

austere swallow
#

Its alright then I guess, you don't need to update it

#

its optional

restive otter
#

kk

austere swallow
#

ugh don't show your token publicly

restive otter
#

Probably shouldn't be showing my token

#

Why does this have to be so confusing?

austere swallow
#

Are you referring to the token for dblapi.js?

restive otter
#

Yes.

austere swallow
#

Oh for that one you use the token from DBL, its found on the website where you added the bot

#

Go to your bot's own page and after you have logged in, the token can be found on the edit page

restive otter
#

Ok.

#

Do I have to do anything with the webhook part?

slate flame
#

Idk

restive otter
#

Have you even made a discord bot @slate flame ?

slate flame
#

Uh

#

Hmmmm

#

HMmMmMmmMmmMmmM

#

Maybe

restive otter
#

?

#

It's kinda yes or no.

#

Hey um, can someone like test by upvoting my bot?

#

Thanks

austere swallow
#

Webhooks are optional if your bot is pretty small (only in a few servers), but it will become required when your bot exceeds 1000 votes per month

restive otter
#

Ok.

#

Can someone upvote my bot?

#

I wanna see if I get the reaction in the console

little harbor
#

There's a test button on your bot's edit page

restive otter
#

Ok.

little harbor
#

At the bottom

restive otter
#

๐Ÿ˜„

#

Got it.

#

I didn't get a response.

little harbor
#

good bingYay

#

oof

restive otter
#

oof

#

Should this be in anything, or just at the top of the script?

const DBL = require('dblapi.js');
const dbl = new DBL(PRIVATE, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});
austere swallow
#

You will need to put the url in the bot edit page for it to work

restive otter
#

What url?

austere swallow
#

And since it is running a webhook server, you will have to port forward it/allow connections to that port for it to work as well

restive otter
#

ยฏ_(ใƒ„)_/ยฏ

austere swallow
#

The url which shows when your bot starts

restive otter
#

Ok.

austere swallow
#

Bear in mind that the first part should have your port forwarded IP

#

something like this http://<my-ip>:5000/ etc

restive otter
#

It's not port fowarded.

#

Can't be bothered

austere swallow
#

You'll have to forward it for it to work

restive otter
#

;-;

#

I guess I'm not having that then.

austere swallow
#

The webhook starts a server, and DBL has to have access to that server in order to send you the votes

restive otter
#

Any features I can have with API without port-fowarding?

austere swallow
#

You can retrieve your bots votes, check if a user has voted for the day

restive otter
#

That's what I've wanted to do this whole time.

austere swallow
#

As well as to post your server counts

restive otter
#

So can I have commands for users who have voted without having to port-foward?

austere swallow
#

Ok only difference between webhooks and no webhooks is that when someone votes, DBL will inform your bot if you have webhooks, otherwise you will have to check yourself if the user has votes

#

Yeah definitely

restive otter
#

Is there like a tutorial or do I just have to guess how to do this?

austere swallow
#

It means your bot is missing permission for a certain action, most likely being unable to send messages or do something in a channel

#

Yeah you can use this function, .hasVoted(id) to check if a user has voted for the day

restive otter
#

So lets say I go,

client.on('message', message => {
  if (message.author === client.user) return;
   if (message.content.startsWith(prefix + 'meme')) {
     if author.hasVoted(id) {
       message.channel.send('meme');

  }
});```
Will that work?
austere swallow
#

It has to be the DBL object

shut ibex
#

i like how 1 if is not the same as the others

austere swallow
#

Like in your case I guess its dbl.hasVoted(id)

restive otter
#

Ok.

vapid cape
#

if(if !== if) {if()} else {if()}

restive otter
#

So this?

client.on('message', message => {
  if (message.author === client.user) return;
   if (message.content.startsWith(prefix + 'meme')) {
     if dbl.hasVoted(id) {
       message.channel.send('meme');

  }
});
austere swallow
#

You're supposed to put your token that you got from the website there, replacing the 'Your discordbots.org token"

vapid cape
#

does if even work without () ?

restive otter
#

Yea ik.

#

But how come dbl has a red line?

vapid cape
#

if(dbl)

#

not if dbl

restive otter
#

k thanks

austere swallow
#

Aight for this lets move to #development, since your API issues have been solved

grand bramble
#

I need a good Google api

#

I need to search on Google the message.content

sand hazel
#

just scrape google

#

ยฏ_(ใƒ„)_/ยฏ

vapid cape
#

or use duckduckgo

#

they have an html version which is easy to scrape

sand hazel
#

I think Google has a search API but it ain't free

grand bramble
#

Duckduckwho

sand hazel
#

duckducksh00t

humble bison
coarse heath
#

Google has a search api and if you ahev your own domain you can have up to 100 searches a day for free

#

after that it's not free anymore

gilded summit
#

I never fully understood. Do I need to require http or express and listen on them for the vote webhooks, or I just need an open port?

arctic arch
#

there is another example

#

that just requires an open port

gilded summit
#

Hm

sand hazel
#

dbl has a built in http server

restive otter
#

Is there a preference for posting server count with or without shard count?

rugged sierra
#

@grand bramble
There is a good npm lib for scraping google, bing and Yahoo. Extremely easy to use

#

Called "images-scraper"

grand bramble
#

@rugged sierra but that's for images

#

And I need a full text search engine, not just one word

rugged sierra
#

Ohh thought it was for images

#

sry

grand bramble
#

I tried duckduckgo but it only has one word search, I need full text ๐Ÿ˜ 

azure pollen
#

if you want help with google API and other stuff like that try keep it in #development

long spade
#

Could it be that webhooks sometimes don't send the post request?

#

I have a user who voted twice and the webhook doesn't seem to be toggled

azure pollen
#

@arctic arch could answer that

long spade
#

Okay for Tonkku: I have a discord webhook where the DBL one points to. It is a PHP script and works alright
But sometimes people say that they voted, show me screenshots of the 'try again in 24h' but my webhook to discord was never triggered

#

It looks like this

hollow wraith
#

Is it paid hosting? Or free

long spade
#

paid lol it's my own VPS

hollow wraith
#

Only thing that makes sense is connection issues, do you have any incoming connections at the times people are saying their votes didnt go through?

restive otter
#

Hey

hollow wraith
#

๐Ÿ‘‹

sand hazel
#

There are cases of the webhook actually malfunctioning

#

I wish we had implementation like other platforms like Github, it retries payloads after intervals, and logs failed attempts

spiral torrent
#

Is there an event getting triggered once someone voted ?

reef apex
#

if you have a webhook set up, yes

long spade
#

@hollow wraith my log files don't show them up

last cedar
#
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});
``` When I tried to use this, it doesnt work :/
#

please helpl me

#

i tried to do the url

sand hazel
#

give context

last cedar
#

wdym give context

#

please explain more

#

i still dont understand what you meant

shut ibex
#

what doesn't work

last cedar
#

I didnt get User with ID ${vote.user} just voted! part in the terminal

#

like someone upvoted for my bot but I never got a response from my bot

hollow wraith
#

You have dbl defined properly.. etc?

last cedar
#

I did though

#

const dbl = new DBL('private', { webhookPort: 5000, webhookAuth: '42859358945' }, client);
?

#

rite?

hollow wraith
#

Running on your local machine? You may need to set up portforwarding in your router

last cedar
#

im running though glitch xD

hollow wraith
#

Whats the webhook auth..., client);

last cedar
#

?

hollow wraith
#

What is defined as client?

#

I dont see that being an argument in tonkkus example

last cedar
#

I need client in order for the post thing to work

#

post servers*

hollow wraith
#

Is that new?

last cedar
#

im not sure

hollow wraith
#

Can u remove it for now, make sure auth matches.. and is saved on dbl correctly

#

Then try a test

last cedar
#

still got nothing

hollow wraith
#

And public ip of your server is correct? For your link on dbl website

#

?

last cedar
#

still doesnt work :/

#

for some reason

hollow wraith
#

So you get the running notification?

#

Do*

last cedar
#

the glitch hostname is 0.0.0.0 ๐Ÿ˜ฎ

#

0.0.0.0:5000/dblwebhook

#

;o

#

is that rite?

hollow wraith
#

0.0.0.0 is not the public ip,

hollow wraith
#

Im not familiar with glitch. But there is some way to connect to it.. you need the ip address

#

Simple google search would probably lead u in the right direction

last cedar
#

do I search glitch ip address?

#

or something different

hollow wraith
#

Yeah, something along those lines

last cedar
#

still cant find it :/

hollow wraith
#

From what i read.. glitch changes your applications ip address?

#

If thats true.. this system wouldnt work for you

last cedar
#

thats mean i need a new host :/

hollow wraith
#

Or another way to get webhooks

last cedar
#

hmm

#

where can I go now

#

im lost

hollow wraith
#

There are some very simple php webhook tutorials on youtube

arctic arch
#

for glitch you need to use port 3000

hollow wraith
#

@last cedar ^^

arctic arch
#

and uncle drop the php, php is dead lmao

#

dont just point people using language A to specifically language B (that they most likely have no experience in) tutorials, everything can be done with multiple languages

hollow wraith
#

Well if his ip changes.. which is what i read.. than your way wouldnt have worked if he had to specify lol. And i direct people to the php, because u dont need experience, its literally like 5 lines of

raven zinc
#

php is no way near dead

#

but you can indeed do it in multiple languages

arctic arch
#

if you push someone learning language A to a completely different language B, they're quickly going to get overwhelmed and give up

#

dont be that guy

hollow wraith
#

I helped him the easiest way i knew how. If they require further help. Then ill help them there

#

Would be decent if you guys updated your docs and wrote webhook listeners in other languages

#

Discordbotlistjs

arctic arch
#

I write dblapi.js (JavaScript)

#

You'll need to ask Nik, Francis and veld to write webhook listeners for the Java, Python and C# libraries respectively

last cedar
#

๐Ÿค”

sand hazel
#

Does one have to send the DBL's password key thing over the wire

#

I feel like HMAC signature for the body approach would be more suitable

last cedar
#

hmm

arctic arch
#

the current system does its job keeping simplicity
however a v2 of webhooks might happen later with signatures and an option to use the current system

sand hazel
#

Yeah it's simple I agree, but just for good practice ๐Ÿ˜›

#

it's like sending private key over and over

restive otter
#

Can some1 give me an example how to setup the webhook for java

sudden rampart
#

you could use spark

restive otter
#

by using the api i have to use a tasktimer - so i guess webhook will be easier

sudden rampart
loud gulch
#

is that only a java thing or..

sudden rampart
#

also unrelated to webhooks but don't use Timer/TimerTask

restive otter
#

why

sudden rampart
#

timer is ancient code

#

and is inefficient

restive otter
#

what would u recommend to use instead ?

sudden rampart
restive otter
#

@sudden rampart if i understand it right - i have to make a get-request on the webhook url right ?

if someone for example voted then dbl will send a message to the webhook i have added in the website

#

is tat right ?

sudden rampart
#

dbl sends a post to your server

#

so, using the spark library i sent above

#
post("/the-path-you-want-for-your-webhooks", (req, res)->{
    var body = new JSONObject(res.body());
    switch(body.getString("type")) {
        case "upvote": handleUpvote(body); break;
        case "test": System.out.println("Test webhook received: " + body); break;
    }
    return null;
});


public static void handleUpvote(JSONObject body) {
    String userId = body.getString("user");
    String botId = body.getString("bot")
    String query = body.optString("query", null);

    doStuffWith(botId, userId, query);
}```
restive otter
#

:wait

#

how can you use var in java ๐Ÿ˜ฎ

sudden rampart
#

java 10

restive otter
#

oh

sudden rampart
#

local variable type inference

restive otter
#

still didnt check java 10 out

restive otter
#

@sudden rampart one last question pls <3

the path ... do i add there the link of the webhook url ? i dont get it rly

sudden rampart
#

if you run it, spark will start at port 4567

restive otter
#

thats right

sudden rampart
#

then, supposing you used post("/upvote", ...)

#

you'd put in the bot page the link as http://your.ip.goes.here:4567/upvote

restive otter
#

i dont have a website

#

for my bot

sudden rampart
#

you don't need one

#

you just need an ip

restive otter
#

ohh alright

#

thanks a lot โค

last cedar
#

what is the port for local machine?

sudden rampart
#

the port you chose?

last cedar
#

5000 rite?

#

or thats not it

restive otter
#

well i follow your steps but if i click on TEST nothing happening even tho i am waiting like 1 minute

#
        post("/upvote", (req, res)->{
            JSONObject body = new JSONObject(res.body());
            switch(body.getString("type")) {
                case "upvote": handleUpvote(body);
                break;
                case "test": System.out.println("Test webhook received: " + body);
                break;
                default:
                    System.out.println(body.getString("type"));
            }
            return null;
        });
   

    public static void handleUpvote(JSONObject body) {
        String userId = body.getString("user");
        String botId = body.getString("bot");
        String query = body.optString("query", null);

        getAPI().getGuildById("XXXXXXXXXX").getTextChannelById("XXXXXXXXXXXX").sendMessage("<@"+ userId + ">\n\n" + query).queue();
    }
sudden rampart
#

are you running it on your computer?

#

if yes, did you open the port in your router?

restive otter
#

oh good point - lemme check

sry for distracting u with such noobish problems ๐Ÿ˜

#

not working on vps

hollow wraith
#

@last cedar you have to use port 3000 apparently

#

For glitch

mystic wing
#

you can edit the source file if you want to also have a webserver on glitch (since it only gives one port)

clever rock
#

is webhook only capable of getting updates when someone voted? you cannot use it to request an array of last voters

arctic arch
#

that's what the REST API is for

restive otter
#

what would an example body look like on the webhooks?

#

like this?

{"bot": 362420439659708416, "user": 169275259026014208, "type": "upvote", "query?": ""}```
arctic arch
#

yes but the IDs are strings and the query one is just query, no ?

restive otter
#

oh

#

darnit they're strings

#

ok thanks

#

either im dumb or the test button isnt working

#

could someone help me please

robust olive
#

? means optional

restive otter
#

ah

#

sorry im new to all this stuff

#

stayed up all night last night trying to figure it out

arctic arch
#

have you saved before testing, is your host able to receive http requests?

restive otter
#

yes and yeah im pretty sure, ive tried with ARC but i cant get it to work on the test button

#

works when i do it on arc

arctic arch
#

whats the url you've set

restive otter
#

**obfuscated**

#

auth is just set to test for now

arctic arch
#

are you listening for get or post requests

restive otter
#

this is how im running it in arc:

#

it works there so i think i am

#

if you want i can paste my 3-4am php code here

restive otter
#

yeah ive tried so many different things at this point i have no idea what to do

restive otter
#

if anyone's there i'd still like some help please

restive otter
#

just an update: i removed the authorization stuff and it worked again, it seems that it doesnt pass it in the test

arctic arch
#

your check may be wrong or the password on the site is wrong

restive otter
#

oh well it works ยฏ_(ใƒ„)_/ยฏ

last cedar
#

Uncle, when I tried to put 3000 for webhookport, it showed an error

charred panther
#

I have no clue where to put this but is it ok to make it where a user needs to vote for the bot to use 1 command. Just this 1 command will be locked until they vote. All the rest are usable without voting

#

(I swear I read its ok somewhere but can't find it...)

restive otter
#

yes

#

itโ€™s in docs

charred panther
#

๐Ÿ‘

hollow wraith
#

Idk thats what tonkku said. Use your url for your app as the ip and port 3000 for glitch

arctic arch
#

you likely have something already running on port 3000

last cedar
#

๐Ÿค”

#

wdym i have something already running on port 3000

#

im confused :/

#

Uncle, like this? https://fallenthetaco.glitch.me/dblwebhook?

arctic arch
#

could you show us the error so we can actually help you

last cedar
#

what kind of error?

hollow wraith
#

And what error do get after trying to use port 3000

last cedar
#

wait

#

im changing the port in glitch rn

#
events.js:182

      throw er; // Unhandled 'error' event

      ^


Error: listen EADDRINUSE :::3000

    at Object._errnoException (util.js:1041:11)

    at _exceptionWithHostPort (util.js:1064:20)

    at Server.setupListenHandle [as _listen2] (net.js:1322:14)

    at listenInCluster (net.js:1370:12)

    at Server.listen (net.js:1466:7)

    at DBLWebhook._startWebhook (/rbd/pnpm-volume/f8bb7cfb-6ad4-45dc-8c36-50b8e0d0603b/node_modules/.registry.npmjs.org/dblapi.js/2.1.0/node_modules/dblapi.js/src/webhook.js:45:18)

    at new DBLWebhook (/rbd/pnpm-volume/f8bb7cfb-6ad4-45dc-8c36-50b8e0d0603b/node_modules/.registry.npmjs.org/dblapi.js/2.1.0/node_modules/dblapi.js/src/webhook.js:27:12)

    at DBLAPI (/rbd/pnpm-volume/f8bb7cfb-6ad4-45dc-8c36-50b8e0d0603b/node_modules/.registry.npmjs.org/dblapi.js/2.1.0/node_modules/dblapi.js/src/index.js:69:22)

hollow wraith
#

Address in use

last cedar
#

wdym address is in use ๐Ÿค”

hollow wraith
#

Something is already using port 3000

last cedar
#

๐Ÿค”

hollow wraith
#

Web server.. or something

last cedar
#

๐Ÿค” let me check.....

#

alright i think its working

#

it was the app.listen(process.env.PORT)

hollow wraith
#

And the verdict?

last cedar
#

the console cant seem to record a test :/

hollow wraith
#

Auth code in JS matches auth code on dbl?

last cedar
#

it still doesnt work :/

hollow wraith
#

Ok, what does your code look like now

last cedar
#

its massive xD

#

I have a lot of code before I added the webhook thing

#
const dbl = new DBL('private', { webhookPort: 3000, webhookAuth: 'password' }, client);
dbl.on('posted', () => {
  console.log('Server count posted!');
});

dbl.webhook.on('ready', hook => {
  console.log(`Webhook running with path ${hook.path}`);
    console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});
#

that^

#

but it doesnt work :/

#

doesnt show User with ID ${vote.user} just voted!

arctic arch
#

why do you have two console logs there

last cedar
#

just checking the thing xD

#

it really doesnt effect anything

#

@restive otter needs help with the upvote updates xD

#

lol

half summit
#

i don't get why people name their bots after themselves

arctic arch
#

try your url with http instead of https

last cedar
#

already tried that

#

doesnt work :/

arctic arch
#

you're sure the project id is that?

last cedar
#

project id?

#

fallenthetaco rite?

arctic arch
#

yeah

#

thats what shows up in the url after edit when you're editing?

arctic arch
#

you have another server running?

last cedar
#

no.....

arctic arch
#

that OK doesn't usually show up

hollow wraith
#

Fallen, try removing client when youre setting dbl

last cedar
#

res.sendStatus(200);

#

thats what I put inside the app.get('/', (req, res) => {

arctic arch
#

ok what is this app

hollow wraith
#

And im assuming.. 'private' is actually your dbl token

last cedar
#

no xD

#

i dont want to show it so i put it as process.env.private

arctic arch
#

that app looks like an express server thats running on the port 3000

last cedar
#

๐Ÿค”

#

i tried that xD

arctic arch
#

note that you don't make a new app, you use your existing app

last cedar
#

ik

#

i tried and it doesnt work

#

xD

robust wave
#

discord wont let me authorize bots
how do i fix that?

sick prairie
#

--setgame motherfuckers better stop bullying AngerKingz

#

--meme

#

what the hell

severe mist
sick prairie
#

oops

severe mist
#

Bots don't respond outside those channels

sand hazel
#

--setgame motherfuckers better stop bullying AngerKingz

#

I gotta say

#

very interesting

gilded summit
#

If I didn't set a Webhook Auth, do I need to define it in the constructor?

arctic arch
#

no

gilded summit
#

Thanks

restive otter
#

?sendembed

hollow wraith
#

Better delete that before u get threatened for not using #commands

tidal burrow
#

"threatened" sounds too extreme ๐Ÿ‘€

hollow wraith
#

Ikr

quick trellis
#

Oops! Error: 401 Unauthorized

#

why do i get this error when trying to connect?

loud gulch
#

it might be because of token

quick trellis
#

const dbl = new DBL(config.token2, client);

loud gulch
#

well idk GWcmeisterPeepoShrug

quick trellis
#

XD

#

any one?

#

jk im stupid

#

i used the bot token and not the db token

#

didnt see it

#

XD

restive otter
#

:p

restive otter
#

I have problem with API

#

Python

#

plz help

vapid cape
#

state your problem

restive otter
#

When i install dblpy

#

DBLPY needs aiohttp-1.0.5

#

maybe you need requests?

#

python3 -m pip install requests

#

wait

#

it dosent works ๐Ÿ˜ฆ

last cedar
#

im still stuck Uncle :/

#

using glitch

hollow wraith
#

Rekt. Would need to teamview probably.. although ive never done it.. but i think i understand

proud sphinx
#

oh no don't use requests with async operations available

#

also you need to revert to an older version of aiohttp or try the rewrite version d.py @restive otter

restive otter
#

@proud sphinx Thanks ๐Ÿ˜„

#

What's Wrong With This?
async def update_stats(self):
"""This function runs every 30 minutes to automatically update your server count"""
await self.bot.is_ready()
while not bot.is_closed():
logger.info('Attempting to post server count')
try:
await self.dblpy.post_server_count()
logger.info('Posted server count ({})'.format(self.dblpy.guild_count())
except Exception as e:
logger.exception('Failed to post server count\n{}: {}'.format(type(e).name, e))
await asyncio.sleep(1800)

proud sphinx
#

logger.info('Posted server count ({})'.format(self.dblpy.guild_count())

#

look at the )

#

logger.info('Posted server count ({})'.format(self.dblpy.guild_count())) is the correct way

#

you forgot to close one parentheses

restive otter
#

ohh xd

#

Thanks!

#

Now all works ๐Ÿ˜ƒ

proud sphinx
#

ur welcome ๐Ÿ˜ƒ

quick trellis
#

How can i make it so when someone votes on my bot i get a message?

sand hazel
#

webhook

quick trellis
#

what do i put here?

sand hazel
#

... the web hook?

#

lol?

quick trellis
#

where do i get the link from

#

dude im actually lost lost XD

mystic wing
#

ok so you know how your server runs at an address(ip)

#

you type in the name of the public up address

quick trellis
#

ok so the same name as i use for when i connect to the server?

mystic wing
#

with :5000/dblwebhook at the end and

#

Yes

#

With :5000/dblwebhook suffixed to the end

restive otter
#

you mean suffixed

quick trellis
#

hmm

#

so im hosting on aws and the link would then be my Public DNS (IPv4)

mystic wing
#

Yes, the ipv4

quick trellis
#

so
....compute.amazonaws.com:5000/dblwebhook

mystic wing
#

assuming ... is something yeah

quick trellis
#
const dbl = new DBL(my token, { webhookPort: 5000, webhookAuth: 'my password' });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://:compute.amazonaws.com:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});```
#

the last thing on url would auto fill in or?

#

so thats correct?

mystic wing
#

Yes

#

Well, the constructor isn't

#

Replace my token with your dblapi token

quick trellis
#

ik

mystic wing
#

and webhookAuth with what you put in the password field in your bot's edit page

quick trellis
#

yea

mystic wing
#

Yeah that should be all then

quick trellis
#

if i have multiple bots running on the same server. This wont fuck with the others right?

mystic wing
#

It shouldn't

#

But if you have other bots and want to use webhooks you have to run it on a different port

#

(For each)

quick trellis
#

good

#

yea i dont think i will do that so i guess im fine

#

but const dbl = new DBL('Your discordbots.org token', client);

#

im using also the post server things

#

if i do const dbl = new DBL('Your discordbots.org token', client, { webhookPort: 5000, webhookAuth: 'password' }); it wont error right or?

mystic wing
#

It shouldn't

#

Try it out

quick trellis
#

k

hollow wraith
#

The output to console has no effect on the webhook address, thats just to make you feel warm inside when the listener is ready. Where its crucial is in the dbl webhook url input on the bot page

quick trellis
#
              ^

TypeError: Cannot read property 'on' of undefined
    at Object.<anonymous> (/home/ubuntu/bot/DAindex.js:69:15)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
error: Forever detected script exited with code: 1
#

what did i do wrong?

#
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
  });```
#

nvm not working

#

what did i do wrong i swapped the client and settings

#

but that didnt fix it

#

Webhook running at http://0.0.0.0:5000/dblwebhook

#

how do i make it so it goes to the right server and not 0.0.0.0

#

@arctic arch

arctic arch
#

replace 0.0.0.0 with your public ip

quick trellis
#

but where?

#

do i have to make a new setting webhookHostname?

hollow wraith
#

Kiju

#

In your console, it doesnt matter what it says, as long as you have your correct public ip in the dbl bot page

quick trellis
#

wut

#

why dosent it work then

#

@hollow wraith

#

i put the url in the thing

#

and i used the public DNS (IPV4)

hollow wraith
#

Your public ip isnt exactly 0.0.0.0.. it would be the IPv4

quick trellis
#

as the link

hollow wraith
#

Not dns

quick trellis
#

o fuck

#

o fuck

#

but thats not a url XD

hollow wraith
#

Youre using something called aws right?

quick trellis
#

yes

#

ex2

#

ec2

hollow wraith
#

So there is a website for your bot tho?

quick trellis
#

i dont have a website

#

ec2

hollow wraith
#

Well a link*?

quick trellis
#

no now i tried with the ip number things

hollow wraith
#

And from what im reading.. have you set up the port for inbound traffic in Security Group?

quick trellis
#

idk

hollow wraith
#

Security Group under your Amazon Web Service Console

quick trellis
#

hmm

#

ok @hollow wraith what do i do here+

#

?

#

@hollow wraith how do i allowed the traffic that comes from discord bots?

hollow wraith
#

You just need to allow traffic on the port you specify for your webhooks

#

5000 or whatever

quick trellis
#

ok but how do i make it so its only discord bots?

hollow wraith
#

Source probably

#

Ive never used aws

#

Just searched google

#

Dont think you need to specify really though

quick trellis
#

k

sand hazel
#

You can enter a token on the site to be send with the webhook payload

#

Then just check it on the receiving side

quick trellis
#

where

#

and is this the source that i need to add http://0.0.0.0:5000/dblwebhook

#

@sand hazel

sand hazel
#

well is that the correct webhook address?

#

if it's, then yes

hollow wraith
#

If you put that into dbl. It will not work

quick trellis
#

no i didnt

#

thats what it console logs

sand hazel
#

then it's whatever your public ip is

hollow wraith
#

Ok, that should be fine as long as the webhook address you put into dbl points to your bot

quick trellis
#

i need to add it to the inbound but i cant

hollow wraith
#

Just save that. As is

quick trellis
hollow wraith
#

Ah.. no

#

The source would be the ip to DBL webhook sender

#

Best to just do Any

#

Or something

quick trellis
hollow wraith
#

What are your options in the source drop down

quick trellis
#

anywhere and my op

#

anywhere generate those 2 that i send before

hollow wraith
#

Well do anywhere and if it generates something.. just save it and hope it works lol

quick trellis
#

yea and i have bad luck XD

hollow wraith
#

Well we need to get to the point where youre trying to send test upvotes. And making sure the link is correct to aws

quick trellis
#

yea i just tested and it didnt work

#

i used this code type on the discord bots website IPv4 Public IP

#

@arctic arch @azure pollen could one of you guys help me with this cause im lost ๐Ÿ˜•

azure pollen
#

with what

quick trellis
#

getting the webhook to work

azure pollen
#

@arctic arch

arctic arch
#

so whats the problem right now

quick trellis
#

i dont know if i used the url og did the right security setting

arctic arch
#

show me your current setup

quick trellis
#

k

#

can i sent it in dms?

arctic arch
#

yes

naive ether
#

xd

restive otter
#

Python

#

Help

#

plz

sand hazel
#

just post to the api GWfroggyJerry

#

it's not hard

restive otter
#

Im new in Python xd

#

I dont know how it works xd

sand hazel
#

we even have a pylib GWfroggyJerry

restive otter
#

I have this

#
import dbl
import discord
from discord.ext import commands

import aiohttp
import asyncio
import logging


class DiscordBotsOrgAPI:
    """Handles interactions with the discordbots.org API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = 'TOKEN'  #  set this to your DBL token
        self.dblpy = dbl.Client(self.bot, self.token, loop=bot.loop)
        self.updating = bot.loop.create_task(self.update_stats())

    async def update_stats(self):
        """This function runs every 30 minutes to automatically update your server count"""
        await self.bot.is_ready()
        while not bot.is_closed():
            logger.info('Attempting to post server count')
            try:
                await self.dblpy.post_server_count()
                logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))
            except Exception as e:
                logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
            await asyncio.sleep(1800)

def setup(bot):
    global logger
    logger = logging.getLogger('bot')
    bot.add_cog(DiscordBotsOrgAPI(bot))
    print ('DiscordBotsOrgAPI is loaded')
#

It's correct?

sand hazel
#

well it's the given example

#

I'd assume it's correct

restive otter
#

So

#

i run bot

#

and it didn't works ๐Ÿ˜ฆ

sand hazel
#

big surprise

restive otter
#

xd

sand hazel
#

u didn't even modify any of the example

restive otter
#

...

plain timber
#

@restive otter did you put in ur DBL token?

last cedar
#

im still having trouble with the upvote thing :/

restive otter
#

@plain timber yes

plain timber
#

hm, did it log anythung?

spiral torrent
#

i mean i can save it myself once a user voted

#

but would be cool to have it in the api too

sullen nymph
naive ether
#

Hey

#

Ive got my api code

#

and found code I want

#

what now?

proud sphinx
#

Execute it every 30 minutes

naive ether
#

?

#

Im confused..

#

idk what to do

#

Someone tell me what to do with my code for server-count

#

@arctic arch I need help.

rigid dagger
#

What do you mean

naive ether
#

Ive installed

rigid dagger
#

Installed what?

naive ether
#

npm install dblapi.js

#

const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);

// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})

dbl.on('error', e => {
console.log(Oops! ${e});
})

#

What do I do with this

#

Ive put my api token for my bot in the thing...

#

What do I do with that code?

rigid dagger
#

dbl.post?

naive ether
#

?

#

What do I do with it?

rigid dagger
#

What do you mean with "What do I do with it?"???

naive ether
#

What do I do with the code..

#

Ive put my api key for my bot un the thing

#

the token

rigid dagger
#

Yes

#

then post it?

naive ether
#

To what?

rigid dagger
#

that code doesn't post it

naive ether
#

and how?

rigid dagger
#

To DBL

naive ether
#

Howwwww?

rigid dagger
#

there are things for this you know

#

some of those doesn't work though

prisma pendant
#

okay

#

so

#

how does one get upvote info

mystic wing
#

Webhooks

#

Preferably

naive ether
#

IM SOOO LOST

rigid dagger
#

why are you lost?

prisma pendant
#
async def get_upvote_info(**kwargs):
    onlyids = kwargs.get('onlyids', False)
    days = kwargs.get('days', 31)
##    print (await http.get_upvote_info(onlyids, days))
    return await http.get_upvote_info(onlyids, days)
#

eee

mystic wing
naive ether
#

Idk what Im doing..................................................................................

#

I have

#

Ive done it

#

Ive done my api key for my bot

rigid dagger
#

What part of it do you not understand?

naive ether
#

and pasted it into my

#

code

rigid dagger
#

Everything you need is in there?

naive ether
#

now what do I do with the code?

rigid dagger
#

You post it to DBL

naive ether
#

How though?

rigid dagger
#

jesus fucking christ

#

js

#

or javascript or whatever

#

look at like tonkku's example

#

paste

naive ether
#

Ive done that.............................

#

Ive looked in server-count..

rigid dagger
#

No, if you've done that there's nothing else to do

naive ether
#

wth?

#

??????????????????????????????????????????????????????????

#

Wtf...

mystic wing
#

Forster

naive ether
#

Im just dead...

mystic wing
#

Have you read the API docs

#

Yes or no

#

If you haven't read it

naive ether
#

Yes

#

I have read it

mystic wing
#

Discordbots api

#

fully

#

?

naive ether
#

Yea.

mystic wing
#

Not just skimming it

#

Ok explain where you are lost

naive ether
#

People say post it to DBL.

#

my code with the api token in a bit of the code

#

Ive done that, but how do I paste it to DBL?

#

am I dumb?

mystic wing
#

Yes the docs show how to

naive ether
#

They arent for me?

mystic wing
#

Literally the second section shows you how to post them

#

I hope this fixed your issue

naive ether
#

It did!

#

Thanks

#

I knew someone would help.

#

Nvm..

#

I give up.

mystic wing
#

if it is in a settimeout

#

It won't run immediately

prisma pendant
#

btw

#

whenever you press the link

#

this link

#

^^ is what you get

sand hazel
#

Try this one

prisma pendant
#

is the correct link

#

yea

#

I know. I'm just saying, :p

#

any idea on how to use the get_upvote_info ?

prisma pendant
#

yea I know

#

but

#

I'm a noob

#

anddd

#

I tried different ways

#

still didn't get it to work

#
async def get_upvote_info(**kwargs):
    onlyids = kwargs.get('onlyids', False)
    days = kwargs.get('days', 31)
##    print (await http.get_upvote_info(onlyids, days))
    return await http.get_upvote_info(onlyids, days)
#

didn't work

#

so I tried putting @unkempt gatet.command()

#

didn't work

spiral torrent
#

which version is this ?

#

there is no version badge

#

or do i take the version from the build.gradle ?

#

in this case 1.0

sand hazel
#

1.0

#

That's what Github releases say

prisma pendant
#

I got pinged

#

._.

sand hazel
#

@prisma pendant I don't do python, so I'm going to guess get_upvote_info({onlyids: true, days: 29})

#

ยฏ_(ใƒ„)_/ยฏ

prisma pendant
#

omg

#

okay

#

yea

#

you are probably right

sand hazel
#

no idea

#

@prisma pendant Actually it might be get_upvote_info(onlyids=true, days=29)

prisma pendant
#

but I tried that ._.

#

wait let me try it again

spiral torrent
#

aint working HYPERBRUH

prisma pendant
#

okay guys

#

I think I got it to work

#

but

#

i did:

votes = await get_upvote_info(onlyids = True, days = 1)
print (votes)
#

and it's returning the usernames as well as the avatar

#
Parameters:    

    **onlyids (bool[Optional]) โ€“ Whether to return an array of simple user objects or an array of user ids. Defaults to False
    **days (int[Optional]) โ€“ Limits the votes to ones done within the amount of days you specify. Defaults to 31

Returns:    

votes โ€“ Info about who upvoted your bot.
Return type:    

dict
#

._.

proud sphinx
#

umm wait what

prisma pendant
#

I did False

#

and I did True

#

they both return the same thing

#
{'username': 'Grandlad', 'discriminator': '1542', 'id': '242325428696514560', 'avatar': '256662e2aec1e07a761b44d64e1f027a'}, {'username': 'Mason Phantom (YWN)', 'discriminator': '0284', 'id': '171359861966110720', 'avatar': 'd30c97a7d70c1d4094179469de918960'}, {'username': 'DJPCaprio', 'discriminator': '4448', 'id': '264542868033634305', 'avatar': '8bdf453b26e89adaf933b600a6cfe60d'}, {'username': 'Prusso', 'discriminator': '8629', 'id': '251351879408287744', 'avatar': 'd25ddc4afdb93382e2e4b26b0321fdb2'}, {'username': 'mortalites', 'discriminator': '4498', 'id': '250442052142235648', 'avatar': '23471d85c136babb64cc9fadd0de8326'}, {'username': 'โ„ตโˆž', 'discriminator': '8275', 'id': '250019914889428995', 'avatar': 'dcb097303bc2ebd64056cd73103300e6'}, {'username': 'renedaking', 'discriminator': '2208', 'id': '234713782163603456', 'avatar': '548caab79188b04225c7706a77cc7904'}, {'username': 'mortalites', 'discriminator': '4498', 'id': '250442052142235648', 'avatar': '23471d85c136babb64cc9fadd0de8326'}, {'username': 'The Engineer of Two Cities', 'discriminator': '1815', 'id': '208371728177561605', 'avatar': '28ecb6e9fae05665a72b190ae48c338d'}, {'username': 'fusiondshadow', 'discriminator': '1345', 'id': '204356529472667648', 'avatar': 'b758e2006b190c16bceb886f51438a38'}, {'username': 'DJPCaprio', 'discriminator': '4448', 'id': '264542868033634305', 'avatar': '8bdf453b26e89adaf933b600a6cfe60d'}, {'username': 'Silver of Quick', 'discriminator': '1951', 'id': '262682004410204160', 'avatar': '94416e79e96e8e709d036769dc4a8d38'}, {'username': 'Prusso', 'discriminator': '8629', 'id': '251351879408287744',
#

._.

sudden rampart
#

onlyids was removed

#

the wrapper hasn't been updated

spiral torrent
#

then remove it from website temporally since its not working
or add a short notification in github

restive otter
#

@plain timber no

fallow nymph
#

I can't vview the websites API page on Windows Vista which is currently what I am stuck with. The page is just blank

harsh socket
#

get a better pc zoomeyes

fallow nymph
#

I do, my best one crashed again ๐Ÿคท

harsh socket
#

my advice would be to reload the page

fallow nymph
civic flare
#

wtf is that windows pc xd

fallow nymph
#

๐Ÿคฆ iv'e already said above

junior goblet
#

maybe try a different browser

harsh socket
#

opera

clever rock
#
Error: 409 Conflict
    at _response.transport.request.then (/home/davexdme/prod/node_modules/dblapi.js/node_modules/snekfetch/src/index.js:193:21)
    at process._tickCallback (internal/process/next_tick.js:68:7)

what do this error mean lol

arctic arch
#

what are you doing ๐Ÿ‘€

clever rock
#

one shard gets the votes

#

then other shards just sync with it

#

nothing weird

restive otter
#

what's api

sullen nymph
#

Use Google

restive otter
#

Is there any logs bot?

sullen nymph
#

Wrong channel for that question

restive otter
#

I don't know what you talking

sullen nymph
polar creek
#

how do i get the server count to show up using javascript and the api (please ping i have to mod my server)

prisma pendant
#

I'm still confused about the upvote command:

@bot.command(pass_context = True)
async def redeem(ctx):
    votes = await dblpy.get_upvote_info(onlyids = True,days = 1)
    print (votes)

It's returning all the votes (from the last 31 days)
How do I lock it to 1 day, & so its only ID's because its currently returning everything (username, avatar, id, etc.)

olive pecan
#

why is the upvote information limited to 1000 upvotes per month at dbl-python-library?

polar creek
#

how do i get the server count to show up using JavaScript and the api (please ping i have to mod my server)

arctic arch
polar creek
#

i did that it said something about creating a client

arctic arch
#

@prisma pendant that feature was removed and the library likely hasn't been updated

#

@polar creek what said

polar creek
#

the log

olive pecan
#

on the edit page of my bot on dbl, the webhook url can be an ip too, right?

arctic arch
olive pecan
#

okay

#

i'm just confused. i set up a server thingy (i'm new to the whole web dev stuff) using web.py and it responds when I go to 127.0.0.1:8080 in my browser and prints it in the console, everything's good

#

but it doesn't work from outside the network

#

neither when i try to visit my public ip (+ the port) in a browser or when I use the test function on the edit page of the dbl entry for my bot :/

#

i've disabled all firewalls i found and even set my computer to exposed host

#

nothing works

#

that's the code

import web
from threading import Thread

urls = ("/.*", "Votes")
app = web.application(urls, globals())

class Votes:

    def __init__(self, bot):
        self.bot = bot


    def POST(self):
        data = web.data()
        print('ding!')
        print(request.form)
        return 'Hello'



def setup(bot):
    t = Thread(target=start_listener)
    t.start()
    __votes_bot=Votes(bot)
    bot.add_cog(__votes_bot)

def start_listener():
    app.run()```
polar creek
#

@arctic arch what does this mean MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added. Use emitter.setMaxListeners() to increase limit

arctic arch
#

@olive pecan have you opened the port from your router's configuration?

@polar creek that means you have multiple ready events added for some reason

olive pecan
#

yep

#

the port isn't occupied by other apps either

#

and it's also not the threading thing, it also doesn't work without threading

#

and unfortunately i don't have a vserver yet to test with

arctic arch
olive pecan
#

it says it's closed

#

dammit

#

why

#

it's opened, wtf

#

and i know that port mapping works, i've opened a port for a minecraft server i sometimes host and it works

arctic arch
#

you got something wrong in your configuration

#

I can't really tell what from here

olive pecan
#

that tool say that also the port i use for hosting the minecraft server is closed

#

weird

arctic arch
#

the server's not on tho?

olive pecan
#

no, it isn't

arctic arch
#

its gonna say its closed if a server is not listening for it

olive pecan
#

oh, okay

#

i'm gonna turn on the server and see what it says

#

oh

#

yeah, now it says it's opened

#

YASS

#

i got it working

#

atleast it prints an error when I use the test function on DBL

#

the problem was that the bot used 127.0.0.1 instead of my local ip

olive pecan
#

i even got it working with flask, perfect

spiral torrent
#
    post("/webhook", (req, res)->{
        System.out.println("TESTTTTTTTT");
        JSONObject body = new JSONObject(res.body());
        switch(body.getString("type")) {
            case "upvote": handleUpvote(body);
                break;
            case "test": System.out.println("Test webhook received: " + body);
                break;
            default:
                System.out.println(body.getString("type"));
        }
        return null;
    });
#

may some1 can tell me my webhook aint working ?

#

i have enabled all ports also

arctic arch
#

did you save before testing

spiral torrent
#

sure

#

its just strange

timid nexus
#

Eyo Tonkku, I think webhooks are down atm.

arctic arch
#

fixed

timid nexus
#

ty โค

narrow charm
#

Is the api/bots/check endpoint ratelimited as well ??

uncut crystal
#

everything is ratelimited

narrow charm
#

ok, thanks for the info.

timid nexus
#

Tonkku

#

webhooks died again

summer oracle
#

webhooks are de....oh.

#

tfw i was editing my nginx config and test hooks dont arrive

arctic arch
#

fixed againโ„ข

timid nexus
#

ty

summer oracle
#

alright they arrived ๐Ÿ‘Œ

spiral torrent
sudden rampart
#

you're probably running a different version

spiral torrent
#

what u mean

sudden rampart
#

in source it's that

#

in production they aren't there

spiral torrent
#

i just updated it

#

cant be

#

oh lol

#

mobaxterm -.-

#

wondered how it can be possible ๐Ÿ˜…

restive otter
#

hello

#

what is wrong

steady charm
#

you have to post it yourself using the api

loud gulch
#

how to check if someone voted for my bot?

#

using dblapi.js

steady charm
#

its all in the documentation

mystic wing
#

@loud gulch either webhooks - preferred
or the API - usable for under 1k votes

loud gulch
#

im pretty sure my bot wont get over 1k votes

#

well now

#

so ill use the api for now

mystic wing
#

you can request if a user has voted by their id

loud gulch
#

thats what i want to do

shut ibex
#

but that only checks in the last 24 hours

mystic wing
#

using the lib - DBL.hasVoted(I'd)

young whale
#

Hold on, you can find out who upvoted your bot

#

o my god

loud gulch
#

its if you want to votelock a command

#

mostly

sick prairie
#

--eval message.channel.send('lol')

#

--eval

#

--reload eval

#

--reload

plain timber
#

@sick prairie bots can't send messages here

sick prairie
#

oh shoot

plain timber
#

this channel is only for discussing the DBL API

sick prairie
#

i forgot

plain timber
#

lol

toxic acorn
#

api displaying wrong server count

#

on the site says 19 but my bot is on 28

#

@ me when someone know how to fix ๐Ÿ˜„

loud gulch
#

@toxic acorn are you updating the serer count

toxic acorn
#

ye

olive pecan
#

is there a mistake on my side or is the test function for webhooks on the bot's edit site returning "500 Internal Server Error"?

loud gulch
#

seems like its on your side

#

since its webhooks

#

i dont really know so GWcmeisterPeepoShrug

olive pecan
#

hm

humble bison
#

it won't embed at all ;-;

ocean marlin
#

@humble bison ![Discord Bots](https://discordbots.org/api/widget/status/bot_id.svg) will embed the image

humble bison
#

didn't work for me but i'll try it again

ocean marlin
humble bison
#

Got it! You need to ctrl+v, but hold shift with it @ocean marlin.

charred lynx
#

Someone gives me API nsfw

humble bison
#

@charred lynx this channel is for the Discord Bots List API, use #development for that.

ocean marlin
#

Ah glad you got it

latent pebble
#

Why isn't the webhook test not sending anything?

#

I tested my php script for webhooks by visiting it and it works

calm torrent
#

dbl does a post not a get, are you aware of that?

latent pebble
#

yeah

#

I'm dumping post data

#

here's the script I'm using just to test and be aware of what I'll be receiving:

<?php
file_put_contents("post.txt", print_r($_POST, true), FILE_APPEND);
#

but I receive nothing

#

it doesnt get logged onto the file

#

but when I visit it I get an empty array (because I didnt send post data)

#

which should mean that it works

#

and that dbl just hasn't sent the test yet

smoky trench
#

I'm getting issues with not getting anything too

#

Sometimes I get votes, others are missed

long spade
#

@latent pebble I had that too, it isn't in the post

#

It's in php://input

latent pebble
#

well that worked

distant lodge
#

How does this work? I'm useless sorry

meager hatch
#

wait

#

IS the token generated by some kind of generic algorithm?

#

Because my dbl token is exactly the same to my token from another bot list

azure pollen
#

lul r u sure?

#

@arctic arch

meager hatch
#

oh, nope

#

forget it

arctic arch
sudden rampart
#

@meager hatch it's a JWT

#

iirc

arctic arch
#

yes

#

the beginning is constant

sudden rampart
arctic arch
#

nice token

proud sphinx
#

it would be a shame if someone stole it

sudden rampart
#

yes

#

totally not missing a part

proud sphinx
#

bruteforce mmLol

arctic arch
#

have fun

#

256 bits

proud sphinx
#

let's get ratelimited esketit

arctic arch
#

I wanna say you dont have to get ratelimited but I'm not gonna directly say it

chrome robin
#

...

arctic arch
#

what's the version of the module?

#

it should be 2.1.0 (or newer)

chrome robin
#

module?

arctic arch
#

dblapi.js

chrome robin
#

I putted ^1.0.0 and this installed 1.2.3

#

What the version I should put to download?

arctic arch
#

^2.1.0

chrome robin
#

ok

#

will try

#

Do I need to create a webhook

#

or the code create automatically?

#

@arctic arch

arctic arch
#

you need either webhookPort or webhookServer in your options to use webhooks

chrome robin
#

but do I need webhook to see if someone votes?

#

@arctic arch

arctic arch
#

that's the recommended way but you can use dbl.getVotes, it just has some restrictions

chrome robin
#

So I can create a database where I put the current votes of each one and check when they do the command if they have current+1 right? @arctic arch

arctic arch
#

probably

chrome robin
#

@arctic arch Thx for your time!

ornate jacinth
#

/bots/:id/check seems less-than ideal because it doesn't tell during which period that vote is valid

#

So you have no real way of distinguishing one vote from another

#

providing the timestamp at which the vote occurred is a good idea

dark pine
#

Is it just me, or are webhooks not working?

potent plank
#

they work perfectly fine for me

smoky trench
#

webhooks only sometimes work for me

#

really annoying

restive otter
#

fuck you

dark pine
#

I feel like that's whats happening to me too

#

they only trigger sometimes

restive otter
#

Why?

snow fiber
#

Must be a bug, I'm also noticing my stats not changing in my bar

restive otter
#

Ye

scenic cape
#

Try sending it as a raw request with a JSON body instead when using postman, works for me when doing it that way

surreal junco
#

Pretty sure you are supposed to post json and not put it in the header so yeah

arctic arch
#

^

#

gotta be json