#development

1 messages ยท Page 316 of 1

umbral pelican
rustic grove
#

well too late XD

keen anvil
umbral pelican
#

Oh

#

Thought you meant bot id

next path
#

what is token?

#

xd

rustic grove
#

bruuuh

next path
#

I am just joking

rustic grove
#

how did you make your bot then

next path
#

Lol

rustic grove
#

XD

next path
#

** j o k i n g**

umbral pelican
#

Do token leaks always get posted in #moderators ๐Ÿ˜‚

rustic grove
#

```m.channel.sendMessage(client.guilds.map(g => '' + ${g.name} | ${g.memberCount} + '')).catch(console.error);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

SyntaxError: Unexpected string
at createScript (vm.js:74:10)
at Object.runInThisContext (vm.js:116:10)
at Module._compile (module.js:533:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3```

#

wtf

#

this was working before

rancid vector
#

...

surreal peak
#

eww js

rancid vector
#

xdx (im so bored rn

weary shoal
#

Are you concatenating strings? Wut

rustic grove
#

it is fixed

#

finnaly

rancid vector
#

Good job

rustic grove
#

took me like 1 hour talking to the devs of discord.js

#

since noone knew the error XD

rancid vector
#

xD

rustic grove
#

really i talked like 1 hour to them

rancid vector
#

The nobody know the error part is what i was referring to xD

rustic grove
#

xd

rancid vector
#

knowing*

rustic grove
#

it had nothing to do with the error somehow

rancid vector
#

xlel

rustic grove
#

it was somewhere else

#

XD

rancid vector
#

mmmmmmmmmmmmmmmmmmmmmmeeeeeeow

rancid vector
#

facepalm how long does getting a disscord app (from the developer page xD) to succeed? taking me a while xx

#

d

lost crane
#

huh normally this should go instantly (or am i getting something wrong here)

weary shoal
#

@rustic grove plz fix that string concatenation. Is no good

rustic grove
#

its good already

rancid vector
#

gigantic facepalm

earnest phoenix
#

@lost crane 5 seconds to open dev menu and create app with token Thinkeyes that includes filling details

lost crane
#

u also need to click "Create Bot user " or sth like that

rancid vector
#

facepalm again

lost crane
#

u got it now m8

karmic parcel
lost crane
#

or still struggling?

rancid vector
#

I'm still waiting for it to succeed so that I can create a bot user xD (the video I watched to get some help went instantly xd)

karmic parcel
lost crane
#

lul it shouldnt take that long thenking

karmic parcel
#

I'm not quite sure you know what you're doing

#

actually I'm quite sure you don't

lost crane
#

ok

#

so

#

click "New App"

#

fill details

#

and click "Create App"

#

then you should land on the app page

#

then click on "Create a Bot User"

#

in the popup click on "Yes, do it!"

#

after that where it says "Token: click to reveal" click on that

rancid vector
#

still taking a while (no app page yet xD maybe its my internet service)

lost crane
#

and there is your token

karmic parcel
#

if it's your internet service, how are you on here?

lost crane
karmic parcel
#

rip

rancid vector
#

meow~

karmic parcel
rancid vector
#

MROW MEOW

#

(sigh)

lost crane
#

wew your internet must be slow

rancid vector
#

or lagging af

karmic parcel
#

or you have no internet and this is a dream

rancid vector
#

************************************************facecooooooooooooouch

lost crane
#

inb4 inception

rancid vector
#

..

#

(sigh)

rancid vector
#

ugh

rancid vector
#

sigh...i guess URIs have to end with /discord (no comment, please)

#

ddd

karmic parcel
#

??

rancid vector
#

No comment please...lel

rancid vector
#

What do I do now that I filled everything in and hit the create app button xD It's supposed to go instantly right? well its not, so much for even TRYING

umbral pelican
slow idol
#

๐Ÿค”

earnest phoenix
#

XD

cyan wedge
#

@earnest phoenix oh hi discod.js is bad

earnest phoenix
#

fake

#

d.js is great if you have great memory control skills

#

also search for your mem leak code all the time

#

:P

cyan wedge
#

@earnest phoenix eris is great if u use it

#

xDDDD

earnest phoenix
#

i did use it

#

was shit

cyan wedge
#

driving in my car BEEP BEEP

earnest phoenix
#

your reason is almost full story

cyan wedge
#

whta

earnest phoenix
#

Ee..eris? GOD PLZ NO

cyan wedge
#

@earnest phoenix whats wrong with eris?

#

plase explain

earnest phoenix
cyan wedge
#

@earnest phoenix yes?

earnest phoenix
#

wtf is that ?

#

and Eris is a meme

cyan wedge
#

thanks for taking a picture of code

#

its javascript

#

lol

#

"eris is a meme"

#

to who

#

discord.js is the meme around discord

#

wtf is that ?

#

(its also javascript like what you i said above)

sinful jolt
slow idol
#

avait monkaS

cyan wedge
#

@sinful jolt wtf is that?

earnest phoenix
#

python

sinful jolt
#

^

#

Also that is "await" pycharm makes it look like a v for some reason

bitter sundial
#

whats the code

earnest phoenix
#

@earnest phoenix I am

#

That's easy.

#

Data is an array

#

each value is an object

#

ez

slow idol
#

for (datapacket in <datapacket>) ?

earnest phoenix
#

no

#

result[0].dailycount

#

result is an array

#

not an object

slow idol
#

Oh yeah, if it only returns 1 object then use that

earnest phoenix
#

^

lost crane
#

i use promisified stuff with mysql

#

what it returns for me is always a row array

#

but even without promisify with "mysql" you get (error, rows, fields) afaik

#

but u may use another mysql lib idk

slow idol
#

promisified? just make your own promise

#

Are you using async/await? It looks like you're pulling data which could take a bit of time to deliver to you

earnest phoenix
slow idol
#

hmm good question

earnest phoenix
#

i dont approve that shit code!!!

slow idol
#

-_-

earnest phoenix
#

module.exports = { query } !!!!

slow idol
#

y-yyyyes m-mm-mastterrr monkaMega

#

๐Ÿค”

#

Common sense would tell you no

#

Do a check

#

if (results[0] == null)

#

== null checks for undefined && null

earnest phoenix
#

the fuck is that check

#

i will ban you for any more shit code

slow idol
#

?

earnest phoenix
#

if (!results[0]) kthx

slow idol
#

everyone has different styles -_-

earnest phoenix
#

that isnt style

#

that efficient and high performance code

earnest phoenix
#

@vital lark I just got an error

#

That's not really usefull...

umbral pelican
earnest phoenix
#

?

#

I changed my code :

#

That should respond by Removed

#

?

bitter sundial
#

what's wrong

earnest phoenix
#

^

#

Look up

bitter sundial
#

can you log the settings

#

or the flairs

earnest phoenix
#

sure wait

bitter sundial
earnest phoenix
#

@bitter sundial the id.

bitter sundial
jolly heath
#

How can I check to see what servers my bot is in?

gilded plankBOT
#
Interritus#8425
Bots

@golden plinth

#
Bot info
ID

326363274881007637

Username

NewtonsCookbookBot

Discriminator

0684

Short Description

Newton's Cookbook Bot for Black Ops 3 Gobblegum Recipes

Library

discord.js

Prefix

!

Upvotes

1

Server Count

No server count

Owner(s)

@jolly heath

Links
jolly heath
#

Oh. That works too. xD Thank you

#

I see that someone in the discord.js server had said to do client.guilds.size just like you had but I'm a little stumped on where I would put that to be completely honest.

#

@vital lark

#

Just anywhere in the code? ๐Ÿ˜•

#

I'll message you the code?

keen anvil
inland hawk
#

xd

#

yea

fiery goblet
prime cliff
#

@fiery goblet Im making a starboard bot called starboat ๐Ÿ˜› but if you wanted to make your own have fun dealing with reactions and such xD

keen anvil
#

it's easy

#

I just made one

#

so did @grizzled sequoia

fiery goblet
#

im dumb

grizzled sequoia
#

Starboat?

#

Wait

#

Are you literally calling it starboat?

prime cliff
#

Yea

grizzled sequoia
prime cliff
#

Kek

grizzled sequoia
#

Mfw I've already finished mine eyesKang

prime cliff
keen anvil
#

plays all star remixes

prime cliff
#

Nice xD

keen anvil
#

btw it's actually Dank Stars

#

lol

earnest phoenix
#

-botinfo @weak jay

gilded plankBOT
#
Bot info
ID

314535029407481856

Username

Scripted

Discriminator

5047

Short Description

This is a moderator bot that comes with moderator commands and fun commands!

Library

Other

Prefix

D:

Upvotes

1

Server Count

No server count

Owner(s)

@robust yew

Links
prime cliff
#

Library other prefix D: ok that checks out

earnest phoenix
#

Other means that it is a different type of programmed bot

keen anvil
#

That's a redbot clone

earnest phoenix
#

well, it's still good for starters

weary shoal
keen anvil
#

No. you cannot submit clones unless they're heavily edited. These commands are PRETTY similar feelsthinkman

#

Also, that would make it d.py, not "other"

weary shoal
#

You can't just disable a few cogs and say it's your own bot

fiery goblet
#

I didn't see that

keen anvil
#

?

fiery goblet
#

On help command

keen anvil
#

Well, go look then lol

fiery goblet
#

I have lol

earnest phoenix
rustic grove
#

wow

#

really bro?

earnest phoenix
#

Can we not have this discussion.

keen anvil
#

Yes, thats a clone. Of redbot.

rustic grove
#

wow thats just....

#

:/

keen anvil
#

You need to change stuff or it's going to get removed. @earnest phoenix

weary shoal
#

You can't pass others work off as your own @earnest phoenix

keen anvil
#

Like, HEAVILY change stuff

earnest phoenix
#

ok

#

I get it

#

wait

keen anvil
prime cliff
#

Just ban him and kick the bot lol

rustic grove
#

hes already gone

#

rip

#

xd

next path
#

Damn

sinful jolt
#

I use a few red cogs like the economy but there completely rewrote to use rethinkdb and non blocking methods almost all red stuff is useless for any kinda high guild/user count or any kind of high cocurrency

#

kek 200k ids in json = 45sec commands

tame rivet
#

true

#

especially when half the moderator cog was originally written by me

sinful jolt
#

lol gg

#

@tame rivet the the soft ban on the original mod has been broken forever doesn't send a invite I made a pr long time ago something about needing to be tested before approved still broken ๐Ÿ˜„

tame rivet
#

lol

#

they mustve fucked it then

#

cause it worked when i made it

sinful jolt
#

"referenced before assignment"

tame rivet
#

gg

sinful jolt
#

ayyyy its yuki

#

i haven't talked to her in like months

#

@tame rivet i have a non blocking ver of that speed test should i make a pr?

tame rivet
#

probably, but the repo isnt listed

sinful jolt
#

meh i always searched git hub "red cogs" when i ran a red

tame rivet
#

same

#

half the docs are written by me

#

or the original ones were

sinful jolt
#

i dont think they changed much

tame rivet
#

same

sinful jolt
#

i havnt followed much

#

the red server is kinda toxic

#

i asked for help once was told to google it

tame rivet
#

ye, but there are some talented devs who i feel are a) lazy or b) being held back

sinful jolt
#

so i deleted red and made my own

tame rivet
#

yt deubg ctx.send('hi')

#

hngg

#

yt ping

sinful jolt
#

some of it is really good

#

some not so much

tame rivet
#

ye

sinful jolt
#

bots here?

tame rivet
#

nop

sinful jolt
#

mewping

#

ye

tame rivet
#

i need the fecking code to find a server

sinful jolt
#

hmm?

tame rivet
#

[m for m in set(self.bot.guilds())]

#

and then using that to find an name

sinful jolt
#

o

#

no idea

#

i get by id

#

!debug bot.get_guild(224946732113330177). default_channel.send('@everyone ๐Ÿบ')

#

ayy they listen here

tame rivet
#

ye but idk id

sinful jolt
#

you know the name?

#

guild = discord.utils.get(bot.guilds, name='Mew') sould work if you do

#

in theory anyway

keen anvil
#

Anyone else have install issues with libsodium?

tame rivet
#

nah PyNaCl is autoinstalled with d.py

cyan wedge
#

discord.js is ๐Ÿ’ฉ

fiery goblet
#

-bots @cyan wedge

gilded plankBOT
#
minemidnight#0001
Bots

@nocturne kelp

fiery goblet
#

-botinfo @nocturne kelp

gilded plankBOT
#
Bot info
ID

255832257519026178

Username

Oxyl

Discriminator

7994

Short Description

Multipurpose bot with music, moderation, and more.

Library

Eris

Prefix

o!

Upvotes

6

Server Count

No server count

Owner(s)

@cyan wedge

Links
fiery goblet
#

close ahhhahha

cyan wedge
#

what @fiery goblet

fiery goblet
#

saying discord.js is ๐Ÿ’ฉ and ur using a lib very close to it

indigo notch
#

eris is ๐Ÿ’ฉ it rips your MEM

fiery goblet
#

there is no tickYes lib

cyan wedge
#

@indigo notch you're dumb

#

what do you mean "rips your MEM"

#

have you even compared the memory usage between discord.js and eris

#

@fiery goblet same language

#

doesn't mean much

indigo notch
#

yep i did

#

it leaks

#

soo much

cyan wedge
#

@indigo notch what leaks

indigo notch
#

tbh

cyan wedge
#

please tell me

indigo notch
#

mem leaks

cyan wedge
#

when did you use eris?

#

what mem leaks?

#

lol

#

there are no mem leaks

indigo notch
#

2 weeks ago

cyan wedge
#

show proof

#

show proof

indigo notch
#

it also leeks noots (lenny)

#

i didnt screenshot

#

xd

fiery goblet
#

( อกยฐ อœส– อกยฐ)

cyan wedge
#

no it doesn't

#

lel

#

10k servers and I only use .8gb

#

if it leaks why are big bots like dyno and tatsu fine with memory

sinful jolt
#

Ruby > js

inner jewel
#

assembly >>>>>

cyan wedge
#

@sinful jolt no

#

native json is great

weary shoal
#

Is there a way to see what invite code a user used to join a guild?

#

In d.js

bitter sundial
#

I don't think the api tells you that

#

unless

#

you get how many times an invite has been used and cache that and then check again and see what changed Thonk

prime cliff
#

^

static oasis
#

how do I get my bot's memory usage?

earnest phoenix
#

Eris

#

๐Ÿคฃ

fiery goblet
#

DeletThis

Eris

sinful jolt
#

That's what I actually do with py is cache the invites ๐Ÿคท๐Ÿผโ€โ™€๏ธ I don't think discord it's self stores the info

static oasis
#

you don't just need eris

#

xd

keen anvil
#

@earnest phoenix Your SQLite handler is heavy looking for me. Is it all neccesary?

#

Or can I write my own that's not as complicated?

#

I just don't know enough about SQL to know what I need lol

bitter sundial
#

where is the SQLite handler

rustic grove
#

yay my bot is now 24/7!!!!

earnest phoenix
#

congratz

radiant plover
#

hacker

shrewd lintel
#

gratz

earnest phoenix
#

gratz

#

@keen anvil it looks heavy but it is small as bee movie in gif

keen anvil
#

Lol, wanna explain it to me then? ๐Ÿคฃ

fiery quail
#

I'm still confused about putting a server counter on the API

umbral pelican
fiery quail
#

Its JavaScirpt.

#

I'm confused.

umbral pelican
#

What's confusing about it FeelsThinkingMan

fiery quail
#

Don't know exactly what I'm suppose to do.

inland hawk
fiery quail
inland hawk
#

it give you a great example how you do it

#

omg lol

fiery quail
#
const exec = require('child_process').exec;
exec(`curl -X POST -H "AUTHORIZATION KEY GOES HERE" -H "Content-type: application/json" -d '{"server_count": "${client.guilds.size}"}' "https://discordbots.org/api/bots/${client.user.id}/stats"`);
#

Thats what I find

umbral pelican
#

Shove this in guildCreate and guildDelete events
Get key from website

const snekfetch = require('snekfetch')

snekfetch.post(`https://discordbots.org/api/bots/${client.user.id}/stats`)
  .set('Authorization', 'UR DBOTS.ORG KEY')
  .send({ server_count: client.guilds.size })
  .then(console.log('Updated dbots.org status.'))
  .catch(e => console.warn('dbots.org down spam @oliy'));
fiery quail
#

oo

#

I'ma need that

#

snekfetch

#

thingy

umbral pelican
#

it's already included

inland hawk
#

dude lol

fiery quail
#

Well I didn't know that

#

Please everyone facepalm.

inland hawk
fiery quail
inner jewel
sinful jolt
#

๐Ÿคฆ

cosmic plover
earnest phoenix
scenic crest
#

๐Ÿคฆ

next path
vital lark
fiery quail
#

Can anyone help me fix my splitting up the prefix and command so it will work with words and letters

#

I can only do like a 1 symbol one rn.

#
  let content = message.content;
  let text = content.toLowerCase();
  let author = message.author;
  let member = message.member;
  let args = content.split(" ");
  let argsLower = text.split(" ");
  let command = argsLower[0].replace(config.prefix, "");
lost crane
#

just check if it starts with the prefix

earnest phoenix
#
let args = content.split(" ").slice(1);
let argsLower = args.join(" ").toLowerCase().split(" ");
let command = content.split(" ")[0].replace(config.prefix, "");```
#

@fiery quail

lost crane
#

content.substring(0, prefix.length) === prefix

earnest phoenix
#

if (!content.startsWith(config.prefix)) return;

fiery quail
#

Its a multifile

earnest phoenix
#

make sure you have that

fiery quail
#

I have that.

earnest phoenix
#

ok?

fiery quail
#

Wait so

lost crane
#

ummm java has no startsWith kek

#

uhh

#

javascript

#

java has

fiery quail
#
  if (!message.content.startsWith(config.prefix)) return;
  let content = message.content;
  let text = content.toLowerCase();
  let author = message.author;
  let member = message.member;
  let args = content.split(" ").slice(1);
  let argsLower = args.join(" ").toLowerCase().split(" ");
  let command = content.split(" ")[0].replace(config.prefix, "");
earnest phoenix
#

yes it does

lost crane
#

kek

fiery quail
#

JavaScript.

lost crane
#

wew what

#

can

#

bots sendhere

fiery quail
#

$eval

#

Nope

earnest phoenix
#

JS has .startsWith()

#

git gud

lost crane
#

wew since when

earnest phoenix
#

ECMAScript 1

#

xD

inner jewel
#
return "Hi".startsWith("H");```

Evaluated successfully:

true```

lost crane
#

mhh

#

guess node trolled me in the past

earnest phoenix
#

Came out in ECMAScript 2015

lost crane
#

ahh

#

ye

#

i used node 5 once

inner jewel
#

copied from java

lost crane
#

there it didnt work

inner jewel
#

even the name is a copy

lost crane
#

that's why

earnest phoenix
#

Yeah, Node 5

#

there is Node 8

lost crane
#

i also used node 4 once

#

back then

#

good ol times

fiery quail
#

g_eval return "Test".startsWith("T");

#

;-;

inner jewel
#

fail

fiery quail
#
Goomster
Input :door: :arrow_left:

"Test".startsWith("T");

Output :door: :arrow_right:

true

#

:3

#
Goomster
Input :door: :arrow_left:

"Test".startsWith("B");

Output :door: :arrow_right:

false

#

cool

#

;3

lost crane
#

sry i started with javascript when ecmascript2015 wasnt a thing

inner jewel
#
return "Kek".charAt(0) == 'K';```

Evaluated successfully:

true```

fiery quail
#

Alright

#

I need your code

#

That you're using

#

keep your token out of it.

pliant mortar
#

ok

#
import json
import aiohttp
uri = 'https://discordbots.org/api'

class botsorgapi:
    def __init__(self, bot):
        self.bot = bot
        self.session = aiohttp.ClientSession()

    def __unload(self):
        self.bot.loop.create_task(self.session.close())

    async def send(self):
        dump = json.dumps({
            'server_count': len(self.bot.servers)
        })
        head = {
            'authorization': 'token',
            'content-type' : 'application/json'
        }

        url = '{0}/bots/327955834975813632/stats'.format(uri)

        async with self.session.post(url, data=dump, headers=head) as resp:
            print('returned {0.status} for {1}'.format(resp, dump))

    async def on_server_join(self, server):
        await self.send()

    async def on_server_remove(self, server):
        await self.send()

    async def on_ready(self):
        await self.send()


def setup(bot):
    bot.add_cog(botsorgapi(bot))
fiery quail
#

Alright

#

I'll send you what my discord.js looks like

pliant mortar
#

ok

fiery quail
#

Whats {0}

#

on the url part.

sinful jolt
#

Wait what don't that work for you?

pliant mortar
#

the uri

fiery quail
#
url = '{0}/bots/327955834975813632/stats'.format(uri)
sinful jolt
#

That's what I'm using

fiery quail
#

Hmm

pliant mortar
#

yeah

fiery quail
#

its saying shards

#

but not the server count

#

not even saying the server_count:

pliant mortar
#

yeah

fiery quail
#

thingy

pliant mortar
#

It sent the server count

#

"returned 200 for {"server_count": 18}"

sinful jolt
#

So that's all right ๐Ÿค”

fiery quail
#

But

#

its not sending to API

sinful jolt
#

it is tho

#

200

pliant mortar
#

yeah

fiery quail
#

hmm

pliant mortar
#

in another word

sinful jolt
#

Site issue?

fiery quail
#

Nah mines working

#

@atomic robin

pliant mortar
#

the API isn't receiving it

fiery quail
#

Mines working perfectly fine.

pliant mortar
#

yep

sinful jolt
#

Odd*

pliant mortar
#

what

#

it says server count

#

@sinful jolt

sinful jolt
#

I mean mine works*

pliant mortar
#

oh

sinful jolt
#

It's odd you'res doesn't

pliant mortar
#

maybe i should make new token

#

put that in instead

sinful jolt
#

Maybe but if it was token

#

It would be 403

earnest phoenix
#

henlo

#

live tech support is here

fiery quail
#

Lmfao just relize my bot has been broke for like the longest time now

pliant mortar
#

nothing works

#

i dont really know what to do at this point

keen anvil
#

whats the issue?

scenic crest
#

daddy is the issue

vital lark
#

@scenic crest is the issue

scenic crest
#

yeah

#

I am the issue

vital lark
#

ye

pliant mortar
#

no

#

an API issue

#

scroll up

pliant mortar
#

@keen anvil

pliant mortar
#

U people are really unhelpful

vital lark
#

lol

keen anvil
#

It's really REALLY not our job to be helpful. Go buy a spoon to feed yourself.

vital lark
#

^

weary shoal
#

@keen anvil with the straight fire insults

#

๐Ÿ”ฅ

keen anvil
#

my life ^

weary shoal
#

Just because you're ginger ;)

vital lark
#

Yes

sinful jolt
#

Thing is @keen anvil he is sending Server count that same way I do and getting a 200 but the site doesn't change I tried to help figure it out but I'm at a loss just as well

pliant mortar
#

nvm

#

I fixed it now

#

@keen anvil lose the salt man

keen anvil
#

Emo Barry - Today at 7:53 AM
U people are really unhelpful

pliant mortar
#

meh

#

i had elimation go to the other dbots server

#

they helped

#

xD

fiery quail
#

Anyone know how to use MongoDB and Node.js together?

keen anvil
#

tons and tons of tutorials out there since MEAN is big in webdev @fiery quail

#

google is your bff

fiery quail
#

I did

#

I didn't see anything

#

Mabye you can halp <3

#

Well I found this.

#
var MongoClient = require('mongodb').MongoClient,
  test = require('assert');
// Connection url
var url = 'mongodb://localhost:27017/test';
// Connect using MongoClient
MongoClient.connect(url, function(err, db) {
  // Get an additional db
  var testDb = db.db('test');
  db.close();
});
#

would that be correct?

earnest phoenix
#

There's your problem

#

you're using Python

#

switch to JavaScript and you'll be ๐Ÿ‘Œ

abstract mango
#

@earnest phoenix what are you looking for

#

yeah?

bitter sundial
#

I hope it's a selfbot

abstract mango
#

but is it on a seperate account

#

oh ok

#

anyways, I've never tinkered with get_user_info()

#

are you using the pip version?

#

oh ok

#

This can only be used by bot accounts.

#

(this means you have to use it on a discord api application's bot user)

cunning narwhal
#
using System.Net.Http.Headers;
using System.Text;
using (var client = new HttpClient())
using (var content = new StringContent($"{{ \"server_count\": {client.Guilds.Count}}}", Encoding.UTF8, "application/json"))
{
    client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("token");
    HttpResponseMessage response = await client.PostAsync("https://discordbots.org/api/bots/YOUR_BOT_ID_HERE/stats", content);
}```
 what's wrong here? this thing doesn't work for me.
do they mean by client the http client or
or discord client
surreal peak
#

what doesn't work

#

oh

#

client is your DiscordSocketClient @cunning narwhal

cunning narwhal
#

Ow

#

this "/*using (var client = new HttpClient())"

#

?

#

well if the "new AuthenticationHeaderValue("token");" "token" should be replaced to the real token and BotId replaced as well

#

and all the script stay as it is

#

...

#

It still doesn't work.

fiery goblet
#

no

#

token

sinful jolt
#

@earnest phoenix what exactly where you trying to do?

weak parrot
#

It isn't working for me either but then again that's my own fault for making a bot in 0.9.6

fiery goblet
#

update naw then

weak parrot
#

No cause my current shit doesn't work in 1.0 xD. Already started on a version to update it to 1.0 but I haven't worked much on that yet.

fiery goblet
#

-bots @weak parrot

gilded plankBOT
#
Timo Halofan#7092
Bots

@outer granite

fiery goblet
#

-botinfo @outer granite

gilded plankBOT
#
Bot info
ID

261647725999685632

Username

Cthuko

Discriminator

7912

Short Description

A random bot made for fun.

Library
Prefix

<

Upvotes

2

Server Count

No server count

Owner(s)

@weak parrot

Links
fiery goblet
#

Easy be able to make them commands again

weak parrot
#

There are more then just the ones shown by the <help command. That is why the bot says <info instead of <help

#

Plus I don't really mind it too much

fiery goblet
#

About?

weak parrot
#

It not posting server count

#

Because someone could always just use the command and see the server count

earnest phoenix
#

you need to post server count to get certified

weak parrot
#

I know but my bot isn't gonna get certified anyway.

vital lark
#

same

earnest phoenix
#

i know what bot i will make after video calls

#

pornhub bot that will stream porn over video calls

weak parrot
#

Sounds like a good idea ( อกยฐ อœส– อกยฐ)

inner jewel
#

i want it

earnest phoenix
#

keep your browser search history forever safe again with using discord pornhub bot today

#

no history or cookies or anything more just porn over video call

#

we arent responsible for any data leaks like who watches porn or other stuff like that

#

except your Discord cache, which is no longer safe from your parents

#

how will discord cache leak you are watching video

#

videos are streamed and dont get saved

#

Discord stores everything in cache. If you're looking at pictures, they get saved in cache as a random name without an extension

#

not streams tho

#

~~pictures go for @woven verge goldenLUL ~~

#

bbsendnudes

vital lark
#

hentai

prime cliff
#

hentaiheaven

vital lark
#

animesexscenes

sacred spade
#

Whenever I send n my servercount, it says that it cannot send the message

#

<@&304313580025544704>

earnest phoenix
#

@sacred spade If you want us to help you, you must give us more information about what hapenned.

#

You cant just say "It didn't work"

sacred spade
#

I was catching errors and then I get "DiscordAPI error: Cannot send message" all of the sudden

earnest phoenix
#

Ok?

keen anvil
#

and don't ping all the mods for that shit

earnest phoenix
#

^

#

That doesn't involve the API

sacred spade
#

Oh :p

#

Also

earnest phoenix
#

It even says DiscordAPI Error

#

not Discord Bots List API Error

sacred spade
#

That's the only thing using skfnetch

#

or whatever

earnest phoenix
#

...

sacred spade
#

and it was that

earnest phoenix
#

discord.js uses snekfetch as it's primary way to connect with discord

sacred spade
#

BUT thats what its trying to send, the server count

#

but it cant

#

bc of some person blocking it or something

earnest phoenix
#

DiscordAPI error: Cannot send message
This does not mean it can't post to Discord Bots List API

#

that means it cant send a message to a channel

#

please use the stackstrace to locate what is trying to send using snekfetch before assuming

sinful jolt
#

sounds like a lack of permissions in a guild

rustic grove
#

was my bot the only bot who had a high ping and was not working or some time cuz its fixed for some reason now

fiery quail
#

how to splice?

#

I'm making an afk command with json database but like the thing is I want to only splice the users afk status not like a whole bunch of them.

rustic grove
#

splice?

hollow shore
#

You get the index of that user, and then splice 1

earnest phoenix
fiery goblet
#

how do I setup rethonkdb ThonkingButCool

inner jewel
fiery goblet
#

tank im thonk that through

earnest phoenix
#

I want to create a 'verification' system, when someone changes too many things (ban, server icon, change name role) that ban him...

vital lark
#

waddle waddle

surreal peak
#

That's dumb

#

waddle waddle

#

But if you really want to create a shitty bot look for event handlers

vital lark
#

lol

#

waddle waddle

surreal peak
#

waddle waddle

vital lark
#

yes waddle waddle

earnest phoenix
#

@surreal peak An admin/friend of a server asked me to do it

surreal peak
#

search for event handlers then

#

how to handle events

#

do stuff with them

earnest phoenix
#

discord.js btw

#

Track audit logs ?

vital lark
#

waddle waddle

sullen wasp
vital lark
earnest phoenix
#

what lang

#

looks like java

#

yeah

#

dandg

cosmic plover
#

how in the name of fuck is that authorization?

#

and still, why 2 headers

#

@sullen wasp show me the whole code if you have it, without the token ofc

#

everything looks just so wrong

sullen wasp
#

No need but I was able to connect the token on the site

earnest phoenix
#

It's Content-Type, not Content-type

#

;)

sullen wasp
#

Ok

spare spruce
#

hey how i get bot send in 1 chat but not default chat like example #alert-stream chat, im making alerts from streamjar site i want know how make them alerts say in that channel only

earnest phoenix
#

@spare spruce what lang and lib

rustic grove
#

idk how to do this :/

#
const client = new Discord.Client();
const prefix = 'kk.'
const orders = [];
client.on("ready", () => {
  console.log('Ready!');
})

client.on("message", m => {
  if (!m.guild) return;
  let args = m.content.split(' ').slice(1).join(' ');
  if (m.content.startsWith(prefix + 'order')) {
    const order_id = Math.floor(Math.random()*9999*Math.random());
    orders.push(order_id)
    client.guilds.find('id','332086216138686475').defaultChannel.send(`Order: ${args} \norder id: ${order_id} \nFrom user ${m.author.username}`)
  }
  if (m.content.startsWith(prefix + 'decline')) {
    if (m.author.id === '206510551898128384' | m.author.id === '229563674375749633') {
      if (orders.includes(args)) {
        m.channel.send('test')
      }else {
        m.channel.send('failed')
      }
    }
  }```
#

can someone help me

#

the decline part

#

it responds with failed

#

;-;

rustic grove
#

nvm

#

figured it out

spare spruce
#

its discordjs v11.1 @earnest phoenix

static oasis
#

._.

spare spruce
#

?

static oasis
#

wat?

indigo notch
#

@rustic grove learn js thats how2 fix :_;

static oasis
#

^

rustic grove
#

i already fixed it bruh

#

look at what i say before telling me shit

earnest phoenix
#

@spare spruce well find or get that channel id and use it

sinful jolt
#

Anyone using socketio and flask?

vital lark
#

No.....?

keen anvil
#

choose for me

#

node.js bot, not a music bot

vital lark
#

If a Node.js Bot, Probs take the highest one

#

but Xeon is higher

#

so

#

idk xD

earnest phoenix
#

@keen anvil Choose the cheapest one

#

Node.js uses almost nothing

#

I am running 3 bots and 3 minecraft servers on my VPS, and only using 0.25% CPU usage

indigo notch
#

but you have a god vps

earnest phoenix
#

No

indigo notch
#

send me a thing to check cpu i want to check howmuch mine uses ;3 ( me no has pm2 )

earnest phoenix
#

top

#

Type that

#

I'm not using pm2 to check CPU usage

earnest phoenix
#

Input:

require("os").loadavg()[0];

Output:

0.19189453125
#

Mmm

#

10%

#

High af

indigo notch
#

but i have allt of other things running too

earnest phoenix
#

Ok also running a music bot

indigo notch
#

i think dst server web thigns and stuff

earnest phoenix
#

I'm*

indigo notch
#

node & my bots are taking up 0.01% CPU and 0.5% MEM

#

;D

#

and one of my 2 boats has been up for 6 days ;3

earnest phoenix
#

I use about 70% of my memory

#

I have 8 GB

fiery goblet
#

require('os').loadavg()[0]

0
earnest phoenix
#

Yea

weary shoal
#

s*eval require('os').loadavg()[0]

earnest phoenix
#

Lol

weary shoal
#

OwOP

#

Bots cant talk

fiery goblet
#

my vps is only using my vps

#

wait wut

weary shoal
#

nice

fiery goblet
#

i mean selfboat

weary shoal
#

Input:

require('os').loadavg()[0]

Output:

0
#

Whoa

fiery goblet
#

wuts on ur vps?

weary shoal
#

Input:

require('os').loadavg().join('\n')

Output:

0
0.02587890625
0
earnest phoenix
#

Input:

require("os").loadavg()

Output:

[ 0.31494140625, 0.25341796875, 0.20458984375 ]
fiery goblet
#

require('os').loadavg().join('\n')

0
0
0
earnest phoenix
#

Mmmm

weary shoal
#

hmm

fiery goblet
#

cuz it's only my selfboat on it

keen anvil
#

@earnest phoenix my CPU usage is at max lol. When you have image generation, music playback, and spam it tends to go up

earnest phoenix
#

Oh, ok

#

Still, get the top one on the list, then upgrade if you need it

karmic parcel
#

holy poop

sinful jolt
#

Always moar cores

#

And xeon > i7

keen anvil
#

@earnest phoenix they're the same price anyway lol

earnest phoenix
#

Oh

#

get better one xD

astral valve
#

I probably have to get a vps for my bot

sinful jolt
#

Is that wholesale?

vagrant owl
#

[help

fiery goblet
#

don't work here just try in testing channels

vagrant owl
#

i know ๐Ÿ˜Š

static oasis
#

how do I get a bot info using Discord Bot list's api?

#

using discord.js...

sinful jolt
#

GET /api/bots/:id

static oasis
#

....

#

and how to put into discord.js?

#

xd

sinful jolt
#

snekfetch im guessing idk i dont js

static oasis
#

._.

#

Discordie?

#

another js

#

well nvm

sinful jolt
#

lol

bitter sundial
#

lib doesn't matter

static oasis
#

yes

#

cuz idk how

sinful jolt
#

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

static oasis
#

xd

bitter sundial
#

lib is not the language

static oasis
#

hoyl fuck

#

holy*

bitter sundial
#

it only provides stuff for you that deals with discord

static oasis
#

fuck that helped

#

xd

bitter sundial
#

that answer is for browsers

sinful jolt
#

o fancy

bitter sundial
#

so you should use snekfetch

vital lark
#

browsers suck

bitter sundial
#

why can bots even see this channel

vital lark
earnest phoenix
vital lark
earnest phoenix
#

discORD

vital lark
#

ye

earnest phoenix
#

dickordโ„ข

vital lark
#

Dickswordโ„ข

sacred gull
#

Hi

#

@dreamy temple this one, i need to know how to mention an user with custom commands

earnest phoenix
fiery goblet
#

-owners @dreamy temple

gilded plankBOT
fiery goblet
#

ask him

sacred gull
#

If i want the bot to mention me, i can use this <@{{.User.ID}}>, but how can i mention other users?

#

Should i mention jonas or Luca actually mentioned him?

earnest phoenix
#

Luca didn't mention

#

Mention him

sacred gull
#

@frosty tinsel

#

Thanks

earnest phoenix
#

Embed mentions don't work, so it has to be an actual message

#

Yup

frosty tinsel
#

yo

sacred gull
#

Hi

earnest phoenix
#

He need help with your bot

frosty tinsel
#

he wants to mention another user using custom commands?

sacred gull
#

yep

earnest phoenix
#

I think so

#

๐Ÿ‘‹

frosty tinsel
#

like a fixed user? same user every time?

sacred gull
#

yep

frosty tinsel
#

then you can just use a normal discord mention

#

@sacred gull

#

put a \ in front of the mention and copy the result like i did above

vital lark
#

yep

sacred gull
#

@frosty tinsel

#

oh

#

and i paste that on the custom command?

frosty tinsel
#

yeah

sacred gull
#

and what if i want to mention a role?

#

@frosty tinsel

frosty tinsel
#

do the same thing, put a \ in front of the mention and copy the result

sacred gull
#

okay, thanks ^^

cinder sleet
#

Anyone have any idea how you do embeds in Python? I tried but I am getting strange results. Can't find anything on the internet :/

earnest phoenix
#

Does discord.py allow you to send raw JSON as a message? @cinder sleet

#

Like not the content of the message, but message data.

cinder sleet
#

@earnest phoenix I think so

vital lark
#

lol

earnest phoenix
#

If you can, visit the Channel category under the Discord Developers docs. It shows how to send an embed.

#

Actually, it shows the format for the JSON to send.

cinder sleet
#

Ok

sinful jolt
#

@earnest phoenix no

#

@cinder sleet python embeds are ez give me a sec I'll get you a example

cinder sleet
#

Ok thanks @sinful jolt

sinful jolt
#

embed = discord.Embed(description="ayy embed", colour=discord.Colour.magenta())
embed.set_author(name='sweet',
icon_url='http://someimageurl')
await bot.say(embed=embed)

cinder sleet
#

Thanks

sinful jolt
#

๐Ÿ‘Œ๐Ÿผ

cinder sleet
brittle kernel
#

anyone familiar with POSTing to this api?

#

i'm not getting any errors

#

idk what i'm doing wrong

earnest phoenix
#

What lib/lang are you using?

brittle kernel
#

js

#

discord.js

#

attempting to post with express and request

earnest phoenix
#

Where in the code are you posting the request?

#

It cant get a server count if you're loading the code before the ready event goes off

#

so it'd look like this:

client.on('ready', () => {
let request = require("superagent");
let dbots_token = "token_here"
request.post(`https://discordbots.org/api/bots/bot_id_here/stats`)
  .set('Authorization', dbots_token)
  .send({server_count: client.guilds.size})
  .end();
});
#

If your post is launching after it successfully logs into Discord, the only other thing i could think is wrong is your bot not being approved first. Because it wont post if the bot isn't approved

brittle kernel
#

still no errors

#

and nothing

#

the api docs show :clientid

#

idk if i literally need to put a colon

#

or if that shows you need to fill it in

earnest phoenix
#

you just need to fill it in

#

Wtf

#

You put the client id of your bot

brittle kernel
#

still nothing

earnest phoenix
#

And do a console.log('updated')..'

brittle kernel
#

it's not actually showing up on the site

earnest phoenix
#

So your bot is not approved?

brittle kernel
#

it is

#

s.ping

#

yeah

earnest phoenix
#

-bots @brittle kernel

gilded plankBOT
#
Kiru#6668
Bots <:certifieddev:308880841382297610>

@open oar certifiedbot

brittle kernel
#

it dmed

#

it is

earnest phoenix
#

-bots @brittle kernel

gilded plankBOT
#
Kiru#6668
Bots <:certifieddev:308880841382297610>

@open oar certifiedbot

brittle kernel
#

-bots

gilded plankBOT
#
TJDoesCode#6088
Bots

@silver marsh
@forest lark
@serene drum

earnest phoenix
#

Fuck

brittle kernel
#

it is

earnest phoenix
#

Ok but console.log at the end pls

brittle kernel
#

but it's not updating the site

#

and console.logging even if it didn't succeed?

earnest phoenix
#

PLS DO IT

brittle kernel
#

still nothing

#

and it logged

earnest phoenix
#

show us the code

brittle kernel
#

but the site won't update

earnest phoenix
#

I will let @earnest phoenix do it bc here....

#

do what

brittle kernel
#
//eslint-disable-next-line
const request = require('superagent');
const dbotsToken = 'mytoken'
request.post('https://discordbots.org/api/290228059599142913/stats')
  .set('Authorization', dbotsToken)
  .send({ 'server_count': 48 })
  .end();
console.log('done')```
earnest phoenix
#

Replace 48 with client.guilds.size, so its easier later on and you dont have to keep filling it in

#

Also where is that in the code

brittle kernel
#

this is manual

#

it's standalone atm

earnest phoenix
#

It'd be better to just put it in your ready listener and have it launch there and post with client.guilds.size

#

wait

#

Look where ur posting to

#

Ur posting to api/bot_id

#

instead of api/bots/bot_id

brittle kernel
#

i'm dumb

#

thanks

#

worked

earnest phoenix
#

nic

fiery goblet
#

i show error if u want me to

karmic parcel
#

pls

fiery goblet
#

k

indigo notch
#

learn d.js

#

xD

fiery goblet
#

xd

#

told ya im a noob

karmic parcel
#

is it because the if statement has no brackets

#

?

#

I think that's why, because it's expanding over one line with that if statement

#

without brackets

fiery goblet
#

oh im a dumbass

#

imma just delete that message

karmic parcel
#

lol

#

it's okee

#

shit happens

indigo notch
#

you cant let an embed twice

fiery goblet
#

u can

indigo notch
#

not in one cmd

#

you need to do embed = stuff

karmic parcel
#

You should be able to

indigo notch
#

after it

#

not let

karmic parcel
#

they are different scopes

fiery goblet
#

it also cuz i coded it on my ipad

karmic parcel
#

but yeah you could do a let embed = undefined on top or something

indigo notch
#

trying to find excuses

karmic parcel
#

but I don't think the let = would make a difference, idk I don't do that but I dont' see why it wouldn't work

fiery goblet
#

there another error now

#

facking semi-colons

#

i think i got that error covered

karmic parcel
fiery goblet
#

how do i grab kicks, bans from audit logs also with the reason?

indigo notch
#

fetch audit logs ULTRALUL

fiery goblet
#

im a noob

#

well, who uses manual ban and kick ;-;

indigo notch
#

me ULTRALUL

fiery goblet
#

but if they used another bot to kick, ban. how would i grab that

indigo notch
#

by fetching audit logs....

fiery goblet
#

ik but how?

sinful jolt
#

what lib?

indigo notch
#

read the docs

#

ULTRALUL D.js

sinful jolt
#

cant help

indigo notch
#

read that

sinful jolt
#

rtfd

fiery goblet
#

k

indigo notch
#

no..............................................................

earnest phoenix
#

Can you talk about developing your bot here? idk

#

im a nub

weary shoal
fiery goblet
#

no, u can talk about developing ur life here

keen anvil
#

I'm not going crazy, am I? setInterval(function () { dogapi.metric.send_all(metrics) }, 2000) this will execute dogapi.metric.send_all(metrics) every 2 seconds, correct? js btw

weary shoal
#

Yea

keen anvil
#

Then why tf is it not working ahhhhhhh

weary shoal
#

setInterval(dogapi.metric.send_all(metrics), 2000) should work too

keen anvil
#

mm true

#

so in theory

#
client.once('ready', () => {
    console.log(`[${new Date()}] ${client.user.username} loaded successfully.`)

    client.indexes = {
        'meme': {},
        'shitpost': {}
    }
    setInterval(dogapi.metric.send_all(metrics), 2000)

    client.user.setGame('plz help', 'https://www.twitch.tv/melmsie')
})
``` Once the bot connects, it should run that until the bot disconnects
weary shoal
#

yep

keen anvil
#

mmm so its a datadog issue somehow

#

thanks for confirming my sanity

weary shoal
#

is metrics defined first?

keen anvil
#

metrics is a global array of objects, yes

#
const guilds = client.guilds.size
const largeGuilds = client.guilds.filter(m => m.large).size
const users = client.users.size
const ram = (process.memoryUsage().rss / 1048576).toFixed()

const now = parseInt(new Date().getTime() / 1000)
const metrics = [{
    metric: 'jr.guilds',
    points: [now, guilds]
},
{
    metric: 'jr.users',
    points: [now, users]
},
{
    metric: 'jr.largeGuilds',
    points: largeGuilds
},
{
    metric: `jr.ram`,
    points: [now, ram]
}
]
#

ram usage is getting posted, but not any other metrics

#

๐Ÿค”

weary shoal
#

Is that outside the client.on?

bitter sundial
#

woah

weary shoal
#

Because if it runs outside the bots actual load it wont work

bitter sundial
#

you are calling the function as you're creating the interval