#development

1 messages ยท Page 385 of 1

zealous forge
#

it's really hard when people won't just share but try that

weak parrot
#

I never said I wouldn't share I just don't see how any of the code would cause issues removing the iframe seems to fix the issue but that's probably one because the iframe makes the page as long as it is in the first place and the code you gave did stop it from repeating but it makes the image bloody huge in the background. I'll try with a smaller resolution in a second to see if that helps.
https://pastebin.com/This-Used-To-Be-The-Link-But-Now-You-Got-Thonked

#
<body background="https://cdn.discordapp.com/attachments/368412885078114307/397020079381807114/1440.png" style="background-repeat:no-repeat; background-size:1920px 1080px; background-attachment: fixed;" bgproperties="fixed">

Fixed the issue never mind

zealous forge
#

That is the solution that I gave ^

weak parrot
#

Ik but the resolution was a bit too high

#

Which was causing it to go off screen

zealous forge
#

I see

weak parrot
#

Thanks for the help

zealous forge
#

Np

mental willow
#

how do i get a pytho bot to react in โœ… and โŒ

earnest phoenix
#

someone can help me when I try to block a command with the upvotes of discordbots.org which includes an api gives me a 'pipe' error

const DBL = require ("dblapi.js");
const dbl = new DBL ("nope");
const Discord = require ('discord.js');
const snekfetch = require ('snekfetch');
exports.run = async (bot, message, args) => {
dbl.getVotes (true, 3) .then (voters => {
     let k = voters.includes (message.author.id)
if (! k) return message.channel.send ('** You must upvote this bot for unlock this command **! \ nUpvote Here: https://discordbots.org/bot/418702711043915776/vote')
   message.mentions.users.first ()! == undefined? person = message.mentions.users.first (): person = message.author
   const avatar = person.avatarURL
   const pls = snekfetch.get (`http://api.anidiots.guide/api/facepalm/?avatar=$ {avatar}`) .set ("token", "nope");
   message.channel.send ({files: [{attachment: pls.body, name: 'test.jpg'}]});
})
}
lethal sun
#

How can I check if the message author voted for a bot? Me is dumb so I dont get the API Docs.

#

@mental willow message.react?

earnest phoenix
#

Kyle!help

#

kyle!help

weak parrot
quiet bobcat
#

^

steel tinsel
#

how do i get a channel by input ID/#channelname?

earnest phoenix
#

What language foxthinking

steel tinsel
#

discord.js

worthy storm
#

Why do people ask here

#

Youre more likely to get help in a support area for your lib not some random development channel nekopensive

ruby dust
#

a lot of people hate dapi, like me

languid dragon
#

because people seem nicer here and tend to spoonfeed too much

karmic parcel
#

that's not a good thing that people spoonfeed though

low owl
#

Discord API is quite nice imo, at least the D.NET channel

#

No spoonfeeding but still helpful in the most cases

ruby dust
#

well in d.py channel, when you ask something most of the time you get an answer similar to "you don't know this!? go look at the docs, you cucc!"

#

not that literarelly, but it depends

heady zinc
#

in all channels

elder rapids
#

They don't even have answers to some of my questions or ignore me or say it's wrong to do that

#

But I mostly have the more advanced questions

solemn obsidian
#

The issue is people start coding from discord bots and dont have any knowledge on how to use those docs

#

90% of the issues are solvable by just checking the docs

earnest phoenix
#

I see.

#

nvm

nimble merlin
#

How do I stop a field in an embed from requiring a value???

earnest phoenix
#

Um, you don't?

#

All fields require a value

nimble merlin
#

that's annoying

#

is there any way to pass a value without adding any data (other than a space maybe?) into the value????

earnest phoenix
#

I doubt it

nimble merlin
#

I guess I could just add a line stop I guess?

earnest phoenix
#

That might work

nimble merlin
#

You know? Set the value to: value='\n'

#

yea, i'll try that...

earnest phoenix
#

Mhmm

nimble merlin
#

ok, thanks anyway ๐Ÿ˜ƒ

earnest phoenix
#

๐Ÿ‘

#

If I have a server id snowflake, is there a way I can get that server's icon?

inner jewel
#

you need to be in the guild

earnest phoenix
#

ugh effort

elder rapids
#

@solemn obsidian in the case of d.net documentation it's insanely garbage

#

It's auto-generated and sucks badly

solemn obsidian
#

well in that case its fair enough

#

(I mostly just see people asking simple things with d.js, no idea about other libs)

elder rapids
#

That I can understand but I hate d.net docs and could understand any confusion people get

buoyant shuttle
#

Anybody know how to keep a bot online 24/7?

ruby dust
#

VPS

nimble merlin
#

Buy a VPS from an online VPS service

buoyant shuttle
#

Em ok

#

Thanks

nimble merlin
#

Does anyone know how to allow users to customize a bot prefix for their server in d.py async???

ruby dust
#

I found the Anybody know part funny cause the majority of bot devs here host their bots 24/7 xD

#

use some sort of data storing file, a database prefered

nimble merlin
#

oh...ok...I better start learning how to do that ๐Ÿ˜ถ

ruby dust
#

I personally suggest you to learn SQLite3 since I'm using it

#

but there might be others that will give you other options

nimble merlin
#

ok...

inner jewel
#

the issue with sqlite is that it's not concurrent

#

so it doesn't scale for writes

#

reads can be concurrent iirc

nimble merlin
#

I'm clearly a noob....just saying...

inner jewel
#

concurrent = more than one at once

#

in this case

nimble merlin
#

ahhhh

ruby dust
#

just find a good source that teaches SQLite3 for python specifically in this case

nimble merlin
#

ok

#

I'll learn it when i'm a bit more advanced....for now people can just stick to T. or @compact hill .... the mention alone is enough....

#

Is there a way to change the background of your bot's page????

quiet bobcat
nimble merlin
#

thanks

quiet bobcat
#

np

nimble merlin
quiet bobcat
#

Yes

nimble merlin
#

k, thanks

earnest phoenix
restive silo
#

these are only the cached ones

topaz fjord
#

Ur cached

earnest phoenix
#

But why at the same time both my beta version + main cached just my server

restive silo
#

@topaz fjord no memes in here

earnest phoenix
#

I don't get it

restive silo
#

what these are only the cached members

#

fetch all members before to make sure you get it correct

earnest phoenix
#

But how two version of the bot cached the count at the same time

#

All members is OK

#

Just offline

#

Idk why

restive silo
#

i think i miss your point

earnest phoenix
#

This problem is only on my own server
In other servers its OK
Also I have only problem with offline member count

#

I'm losing my mind

#

What am I doing wrong

#

msg.guild.memberCount.filter(m => m.user.presence.status == "offline")

#

๐Ÿค”

restive silo
#

as i said try to fetch all members on that server before and aswell use the members presence over the users one

earnest phoenix
#

I did

#

Nothing

nimble merlin
#

OK, so, where do I put the HTML/Markdown code for a background image in the dbl page of my bot??? Is it detailed description or what???

topaz fjord
#

Fetch all members and iterate through them

#

@nimble merlin in the description box

#

Using the style tag

nimble merlin
#

oh, ok ty

#

ahhhh

earnest phoenix
#

What's wrong with this one:
msg.guild.memberCount.filter(m => m.user.presence.status == "offline")

nimble merlin
#

so, short description...yes???

topaz fjord
#

No

nimble merlin
#

oh

topaz fjord
#

In long description

nimble merlin
#

ok

#

for a background???

earnest phoenix
#

What's wrong with this one:
msg.guild.memberCount.filter(m => m.user.presence.status == "offline")
Sorry for ping @restive silo

topaz fjord
#

Yes

nimble merlin
#

k

#
<a href="https://imgur.com/u4TZIQL"><img src="https://i.imgur.com/u4TZIQL.png" title="source: imgur.com" /></a>
</style>``` why won't this work....or have I just made a mistake???
#

hello? Anyone still alive??? lol ๐Ÿ˜„

steel tinsel
#
case 'setlogchannel':
      
      args = commandbody.split(' ');
      
            let perms = message.member.permissions;
      let cdi = message.member.hasPermission("MANAGE_GUILD");

      if(cdi == false) return message.channel.send('You need manage server permissions in order to do this.');

      if(args.lenght < 1) return message.channel.send('Please specify a channel ID ');
      if(args[1].toString().lenght < 18) return message.channel.send('For now, channel ID must be a snowflake. Please refer to this link to see how to get what you need: <https://support.discordapp.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID->');
      
      guild.modlogchannel = args[1].toString();
      
       writeFileAsync('./guilds/'+guild.id+'.json', JSON.stringify(guild))
         .then(message.reply('Mod log channel set successfully. Please wait a while until the change is saved.'))
        .catch(console.error);
      
      
      break;```
#

how do i make it more user-friendly so teh user can supply something like #channel OR an ID?

shrewd totem
#

Discord.js?

nimble merlin
#
<a src="https://i.imgur.com/u4TZIQL.png" title="source: imgur.com" /a>
</style>``` Why won't this set a background for my bot????
steel tinsel
#

yes js

#

@nimble merlin that's not the way you do CSS

shrewd totem
#

@nimble merlin

  1. You can't use HTML tags inside style tag.
  2. That's how you set a link, not a background.
#

MoonlightCapital, you can use message.mentions.channels to get the Collection of the mentioned channels in a message, and use that in your command.

nimble merlin
#

oh

#

ermmm, how do I set the background then...i'm so confused lol ๐Ÿ˜‚

shrewd totem
steel tinsel
#
<style>
element {
background-image: url(IMAGE_URL);
</style>
nimble merlin
#

oh ok, ty ๐Ÿ˜ƒ

steel tinsel
#

obviously change element to what you want to set the background to

nimble merlin
#

yea

cinder junco
#

uh

#

does anyone have a good way to handle postgres in discord's enviroment

solemn obsidian
#

elaborate

cinder junco
#

lol

#

uh

#

i have a db connection that i need to access based on when an event needs it'

#

4 functions are monkey patched into the db api by me to build querys

#

whenever i call a function (even with reopening the connection) the client side interface throws an error that the connection is closed, then throws more that the connection is non existant

nimble merlin
#
button {
background-color: red;
href="https://discordapp.com/api/oauth2/authorize?client_id=423889279630966787&permissions=8&scope=bot"
}
</body>
``` Will this add a button to the long description???
cinder junco
#

you need to close your style tag

nimble merlin
#

ohhhh yeaaaaa

#

The button doesn't appear still lol ๐Ÿ˜„

cinder junco
#

you also need to use your button stlye in an actuall button

#

lemme write up a snippit

elder rapids
#

what is with the random href=?

nimble merlin
#

ok

#

oh sorry, i'm crap at HTML sooooo

#

I only started using it yesterday

cinder junco
#
<button href="https://discordapp.com/api/oauth2/authorize?client_id=423889279630966787&permissions=8&scope=bot">Click here to invite my bot!</button>```
#

ok

#

that might work

nimble merlin
#

ko, ty

cinder junco
#

did it work?

nimble merlin
#
<h3 style="color:lime">Ollie</h3>
<p style="color:blue">The only bot that you will ever need for Music, Moderation, Fun and Utility!</p>
<style>
<button href="https://discordapp.com/api/oauth2/authorize?client_id=423889279630966787&permissions=8&scope=bot">Click here to invite my bot!</button>
</style>
</body>``` what have I done wrong now???
cinder junco
#

take out the style tags

nimble merlin
#

I was about to ask that but OK

#

And one day my browser will load

#

yea, it worked

cinder junco
#

ok

#

can i see?

nimble merlin
#

sure

#

you want a scrrenshot or the links?

cinder junco
#

link if possib

nimble merlin
#

k

cinder junco
#

nic

#

nice

elder rapids
#

pst, you can't href on a <button>

cinder junco
#

by

nimble merlin
#

ty...the button doesn'nt work lol

cinder junco
#

lol

nimble merlin
#

oh

elder rapids
#

Has to be an <a>

cinder junco
#

u not using markdown

nimble merlin
#

ki

inner jewel
#

<a href="url">text</a>

nimble merlin
#

*ki

#

*ik

#

oh ok

deep parrot
#

<button href=ahyperlink> works fine for me</button>

nimble merlin
#

Jesus I can spell today.....not....

elder rapids
#

Also you need to fix your background lol

nimble merlin
#

ok ๐Ÿ˜ƒ

#

is it broken????

elder rapids
#

Very

nimble merlin
#

hmmm, how?

nimble merlin
#

It's a bit stretched for me

elder rapids
#

1080p monitor

nimble merlin
#

oh...weird....

#

ahhhh

#

how do I get the image to auto size...do I just change the size to auto by any chance??? lol ๐Ÿ˜„

digital nimbus
#

How to even make bots?

elder rapids
#

er there's this image stretch thing

cinder junco
#

@nimble merlin use markdown

nimble merlin
#

lol

elder rapids
#

It over-extends the image to keep aspect ratio and... resolution

nimble merlin
#

IDK markdonw lol

cinder junco
#

LOL

nimble merlin
#

what is this thing that you speak of @elder rapids

idle grail
#

Hi

#

How did this create itself

elder rapids
#

background-size: cover; or background-size: contain;

#

I think

nimble merlin
#

ok

idle grail
#

answer my question?

nimble merlin
#

idk

elder rapids
#

What do you mean create itself

#

You're running a sqlite server...?

#

and it created a database file

nimble merlin
#

lol ๐Ÿ˜‚

cinder junco
#

lol

elder rapids
cinder junco
#

๐Ÿ‘Œ

idle grail
#

@elder rapids No

#

It just created idek how

elder rapids
#
You're running a sqlite server...?
and it created a database file
idle grail
#

i refreshed and it appeared there

#

Oh

#

Is it fine if i delete it?

cinder junco
#

lol no

idle grail
#

wai

cinder junco
#

its your db file

#

it holds your data

idle grail
#

But

#

my db file is different

cinder junco
#

u sure

idle grail
#

Yes

elder rapids
#

You do realize databases have to store the info somehow

idle grail
#

sql.sqlite

cinder junco
#

๐Ÿ‘€

#

xd

elder rapids
#

This is a journal file

idle grail
#

thats my file

#

Yeah

#

WHY

elder rapids
#

It literally says it in the file name

#

What do you mean why

idle grail
#

but i don't need it

elder rapids
#

Yes you do

inner jewel
#

you do

idle grail
#

why

inner jewel
#

delete it and fuck your db

idle grail
#

i don't need a journal tho

elder rapids
#

Pretty much ^

#

The DB does

inner jewel
#

but the database does

cinder junco
#

it holds your data dont touch it

inner jewel
#

if something goees wrong

#

your dataset would be corrupted without the journal

elder rapids
#

Just like how a filesystem for your hard drive requires a journal

idle grail
#

Oh

inner jewel
#

you'd have to delete everything

idle grail
#

o.O

inner jewel
#

some SQL impls allow you to disable journals

idle grail
#

Oh

inner jewel
#

but it's not recommended

cinder junco
#

i like postgres

idle grail
#

So its good to have it and its actually necessary?

cinder junco
#

yesss

elder rapids
#

You are required to have it

idle grail
#

k then ;-;

elder rapids
#

Very necessary

cinder junco
#

extra files are not bad things

elder rapids
#

Well they're bad on your hard drive space

#

๐Ÿ‘

#

Which Glitch doesn't give much of right?

cinder junco
#

ye

elder rapids
#

I have a feeling you'll have problems in the future

idle grail
#

Lol

cinder junco
#

wait

#

one of you might be able to help me with this

idle grail
#

I don't store much in my db

#

or it would be out of sight

cinder junco
#
4 functions are monkey patched into the db api by me to build querys
whenever i call a function (even with reopening the connection) the client side interface throws an error that the connection is closed, then throws more that the connection is non existant```
idle grail
#

Oh yeah

#

how to authorize my bot

cinder junco
#

use a link generator

#

one sec

#

ill link u

idle grail
#

But

#

K

elder rapids
#

That's an interesting problem you got their penguin

idle grail
#

Thnx

cinder junco
#

ikr

elder rapids
#

Should say what your DB is. I don't think I'd be able to solve it though

idle grail
#

Frick

cinder junco
#

postgres

elder rapids
#

Never used it so I have to pass that on

cinder junco
#

rip

idle grail
elder rapids
#

So then whitelist it

cinder junco
#

@elder rapids its really similar

#

to sql

idle grail
#

Don't have admin pass

elder rapids
#

It's a perfectly safe site and actually Discord itself links to it

idle grail
#

lol

#

why would my dad give me

elder rapids
#

also wtf with HTTPS block and also why tf K9

cinder junco
#

agree

idle grail
#

idk

#

My dad sucks

cinder junco
#

wow

idle grail
#

ikr

cinder junco
#

dissin your dad

idle grail
#

Lol

cinder junco
#

@elder rapids any idea on how to keep a db connection alive in rb

elder rapids
#

ruby?

cinder junco
#

ye

elder rapids
#

I've never programmed ruby so no I don't know anything about that

cinder junco
#

oof

idle grail
#

I just know JS

#

Ahh my computer is getting slow as shit

cinder junco
#

what os

idle grail
#

Windows 7 Professional

#

Wait

cinder junco
#

have you considered using a lunix distro

idle grail
#

My dad put in a SUPER FUCKED UP SYSTEM

elder rapids
idle grail
#

Whenever i restart, my whole computer resets

#

I haven't restarted for a week

#

Maybe thats why its so slow

solemn obsidian
#

U could just do a query in specific intervals to keep the connection alive @cinder junco

cinder junco
#

gp

#

but with the stats i have rn, the connection gets bout 5 queries a sec

#

30 timeouts

#

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

idle grail
#

BTW here is the token the discord botlist gave me: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQxOTk0ODE4ODYyODQxODU3MCIsImJvdCI6dHJ1ZSwiaWF0IjoxNTIxNDM5NzI4fQ.MHTRJk18v2eQTHAUzVzD_nnPr3JjRZyO5lBdSEDxdpwWhat do i do with it

solemn obsidian
#

oh god

#

please reset it

idle grail
#

?

#

why

solemn obsidian
#

Because there is a reason why its called a token and is under sensitive box???

idle grail
#

I don't understand the enstructions

elder rapids
#

Reset that token

#

Right now

idle grail
#

K

earnest phoenix
#

If someone gets it they can control your bot. Simple.

idle grail
#

...

solemn obsidian
#

that isnt the bots token

idle grail
#

NO

#

Yeah

solemn obsidian
#

Only the dbl

idle grail
#

Not my bots token lol

earnest phoenix
#

I'm idiot

idle grail
#

Someone could post stats on it i guess

solemn obsidian
#

But u should still reset ot

idle grail
#

Done

#

now what do i do

solemn obsidian
#

@cinder junco How often do the timeouts happen?

idle grail
#

What do i do tho

#

;-;

#

i want to use the API

#

@solemn obsidian

solemn obsidian
idle grail
#

Anyone?

#

IKIK

#

I don't understant it tho

solemn obsidian
#

What exactly

idle grail
#

Whenever i type Authorization: (my token) into the search bar it just searches it

#

WHAT DO I DO

elder rapids
#

๐Ÿคฆ

idle grail
#

the instructions are crappy

solemn obsidian
#

No they are not

#

Where does it say to type that in the search bar?

idle grail
#

To a noob like me, they are

#

IDK it said header so i searched idk

solemn obsidian
#

You use whatever http lib you have and set the Authorization header to the token

elder rapids
#

header == search

idle grail
#

???

elder rapids
#

???

idle grail
#

No

#

HTTP header

solemn obsidian
#

not knowing what something means doesnt mean its docs fault they are bad

#

google it

idle grail
#

i did

#

didn't help

#

EXPLAIN TO ME

still cave
#

I recently finished the shard client for my bot, however, the way my bot works, different capabilities are called GuildSkills

solemn obsidian
still cave
#

They are managed per guild, is there a way to properly notate that on the bot listing?

idle grail
#

Ok but what code is required i have no idea

solemn obsidian
idle grail
#

IDK what code tho

solemn obsidian
#

We dont know what lang u are using

idle grail
#

I have no idea what that means

elder rapids
#

What do you mean @still cave ?

idle grail
#

js

solemn obsidian
#

And we dont like to spoonfeed

idle grail
#

ikik

still cave
#

@idle grail you appear to be frustrated, maybe you should take a break and come back after a little

idle grail
#

but i have no literal idea i am dumb pls help

solemn obsidian
cold harness
#

does anyone know how to make bots look like they're typing on discord?

idle grail
#

Oh

#

Oh

#

Do i not need to authorize it or whatever?

cold harness
#

i'm on python btw

idle grail
#

...

elder rapids
#

Send a request to the /typing API

idle grail
#

lol

still cave
#

@elder rapids basically the bot isnโ€™t a specific kind of bot, it can do maaaamy things and acts entirely different on a guild to guild level

elder rapids
#

But what do you mean portray on the bot list for that?

still cave
#

Like do I just not set its category or do I say itโ€™s just a general bot?

elder rapids
#

You mean with tags..?

still cave
#

Yeah

elder rapids
#

Just list whatever your bot does in the tags

idle grail
#
const dbl = new DBL('Your discordbots.org token');```OH SO DO I PUT MY TOKEN THING THERE ^
nimble merlin
#

I'm starting to feel a bit saddened that most devs have much more complicated, and far more functional bots whereas mine is crap and no-one even invites it...although it's only been on the list for 3 days Thonk

idle grail
#

Lol

#

same

elder rapids
#

Work harder Jack

nimble merlin
#

At least i'm not alone

earnest phoenix
#

hello wats dis

elder rapids
#

We didn't get to that spot in a day

idle grail
#

Mine is in 7 servers so

nimble merlin
#

you have good points

idle grail
#

@old pulsar <- this one

nimble merlin
#

Oh yea...

elder rapids
#

Pro-tip: Make a bot that everybody wants to invite and use. Innovate, change something, do it better

nimble merlin
#

Mines in 9 servers but about 6 are mine or my friends lol ๐Ÿ˜„

idle grail
#

i have a server leaderboard but whatever

#

;-;

earnest phoenix
#

lol i dont understand anything you guys are saying

idle grail
#

[info]

#

Oh no talking here lol

nimble merlin
#

That's the point @elder rapids idk what else I can do that can easily be done in d.py async...

earnest phoenix
#

I need a bsn bot

#

i mean ban

nimble merlin
#

My bot has that

elder rapids
#

What do you mean easily done?

idle grail
#

Lol

#

My bot has that

#

and kick

#

and unban

#

by id

elder rapids
#

@earnest phoenix search on the list

nimble merlin
#

idk...something that doesn't require data files rn

idle grail
#

so can ban anyone

earnest phoenix
#

ban user outside

nimble merlin
#

lol

earnest phoenix
#

?

elder rapids
#

Data files ..?

idle grail
#

Yeah

elder rapids
#

Specifics?

nimble merlin
#

like JSON files

elder rapids
#

Why are you using JSON files

idle grail
#

my bot bans by id so it can ban outside people

nimble merlin
#

for economy or custom prefixes etc...

earnest phoenix
#

need bot to ban outside server

idle grail
#

mine?

nimble merlin
#

if I do that...do I have to use a different language???

elder rapids
#

No

#

Use a database to store data, always

#

Never use json files

earnest phoenix
#

i need to be set the bot icon

#

2

idle grail
#

...

nimble merlin
#

@earnest phoenix that's against discord TOS

elder rapids
#

No bot will let you set their icon/profile picture

idle grail
#

Yeah

nimble merlin
#

ok..

idle grail
#

not mine never

earnest phoenix
#

i had one

#

but it gone

#

idk y

idle grail
#

Banned probably

elder rapids
#

Because it's probably abuse/against ToS

#

and it's a global icon too

#

Every server sees it

idle grail
#

yeah

nimble merlin
#

yea

earnest phoenix
#

if user can change icon so why no bot ?

nimble merlin
#

it's against TOS

idle grail
#

no

nimble merlin
#

cos bot's are owner by a user

idle grail
#

only the owner can change

nimble merlin
#

and the user has to spend sooooo many hours coding a bot

earnest phoenix
#

no no i want to own bot not code

nimble merlin
#

My bot has taken about 100 hours + to code so far...and it's it's kinda crap rn...altthough I have much to learn

elder rapids
#

First improvement, use a database

earnest phoenix
#

ok can u give me the link @elder rapids

nimble merlin
#

@earnest phoenix you have to code a bot to own it...otherwise the mods don't allow it onto discordbots.org

#

@elder rapids How do I set up a database!!!! ๐Ÿ˜‚

earnest phoenix
#

no i dont want add bot

nimble merlin
#

OML

earnest phoenix
#

I want use

elder rapids
nimble merlin
#

k

#

lol ๐Ÿ˜‚

elder rapids
#

Find a database that will suit your bot and your needs

nimble merlin
#

ok

elder rapids
#

Google setup on it

nimble merlin
#

ok

earnest phoenix
#

@elder rapids i dont want google can u just give link

nimble merlin
#

....

elder rapids
#

I wasn't talking to you Tempacc

nimble merlin
#

Jesus Christ OML.....

#

sigh

shrewd totem
#

๐Ÿ˜‚

nimble merlin
#

Like talking to a brick wall ey?

earnest phoenix
#

i just need a bot

shrewd totem
#

Add one then

elder rapids
#

So search the list then

nimble merlin
#

OMFG!!!!

earnest phoenix
#

i need a link to it

nimble merlin
#

๐Ÿ˜‚

elder rapids
#

This isn't even a channel to be asking about that

earnest phoenix
#

u need link to inv bot

shrewd totem
#

Link to which bot?

earnest phoenix
#

any1 dat ban user outside server

nimble merlin
#

it's against discord TOS they don't exist

earnest phoenix
#

oh

shrewd totem
#

Ban user outside server?

elder rapids
#

Ban user that's not in server?

#

That's not against ToS

idle grail
shrewd totem
#

THat's not against ToS

earnest phoenix
#

nvermind

#

i found it

shrewd totem
#

You can use my bot, see the link in my playing status. Ad xD

elder rapids
#

boi

idle grail
#

Answer my question???

elder rapids
#

That's bannable if you try and advertise

nimble merlin
#

yea

idle grail
#

No i put client in there too

#

at the end

#

so

#

would i need that interval thing if i put client on the dbl thing

#

Anyone?

shrewd totem
#

Don't use setInterval for that.

deep parrot
#

@idle grail you just posted that a minute ago :/

idle grail
#

Yeah it got lost boi

shrewd totem
#

Instead post stats on ready, guildCreate & guildDelete events.

elder rapids
#

bad

#

don't do that

#

EVER

#

Set interval is the way you should be doing it

idle grail
#

@shrewd totem yeah its in ready

deep parrot
#

@elder rapids what he said

elder rapids
#

You can even ask Oliy and he will tell you you should be using an interval to post stats

deep parrot
#

6

idle grail
#

Oh

#

Why not

shrewd totem
#

That's such a bad idea.

elder rapids
#

No it's not

deep parrot
#

^

shrewd totem
#

How?

solemn obsidian
#

ur just gonna spam api

elder rapids
#

^

solemn obsidian
#

and whoops, ratelimit

elder rapids
#

Which leads to ratelimits

heady zinc
#

the issue is not even ratelimit

idle grail
#

???

solemn obsidian
#

Even waiting 15 minutes is decent, you dont need live stats

heady zinc
#

it's just spamming the API for no reason

solemn obsidian
#

There is no point

heady zinc
#

you don't need a server count accurate in real time

idle grail
#

what

elder rapids
#

Not to mention I like to go by the notion that discordbots.org is a third party service and it does not need the most up to date information as it's only displaying it for show. Use your own service if you want to record the stats better

idle grail
#

i don't understand what is going on

shrewd totem
#

How's sending post events only on ready, guildCreate & guildDelete events spamming api! ๐Ÿ˜‚

elder rapids
#

spamming api*

#

and it is

heady zinc
#

is there a neeed to explain how is it spamming ThinkRaging

shrewd totem
#

Using setInterval is spamming

elder rapids
#

No it's not?

heady zinc
solemn obsidian
#

what if bot gets invited/kicked 60 times in hour?

idle grail
#

Lol

elder rapids
#

Where tf did you get the idea using setInterval is spamming

inner jewel
#

no

solemn obsidian
#

or w/e the limit is

idle grail
#

On ready is good tho right

inner jewel
#

setInterval is not spamming

#

and discord has already sent spams of guild joins

#

during outages

deep parrot
#

^

shrewd totem
#

But using setInterval is not efficient. And won't send correct guildCounts

heady zinc
#

setInterval(0) is spamming yeah

inner jewel
#

it will

solemn obsidian
#

How is it not efficient

heady zinc
#

"not efficient"

elder rapids
#

^

heady zinc
inner jewel
#

setInterval(()=>postStats(), 1800 seconds)

solemn obsidian
#

its only probably outdated by 10 minutes

#

But why do u need it realtime???

shrewd totem
#

Because it's not updated

deep parrot
#

1800 seconds?

#

heck spam

idle grail
#

...

elder rapids
#

Let me rephrase above to match what Trixter said

solemn obsidian
#

ok not 10 u get the idea

elder rapids
#

Not to mention I like to go by the notion that discordbots.org is a third party service and it does not need the most up to date information as it's only displaying it for show. Use your own service if you want to record the stats better

shrewd totem
#

@heady zinc you can't do setInterval 0, 1 is the minimum.

heady zinc
deep parrot
#

btw setInterval uses milleseconds

solemn obsidian
#

what

idle grail
#

Yeah ik

heady zinc
#

am done with this scrub *

idle grail
#

ok gonna answer my question or no

#

no?

#

;-;

deep parrot
#

No u we are not done with this yet

idle grail
#

ded I think we are

shrewd totem
#

We're done.

inner jewel
#

the recommended way is setInterval

idle grail
#

k

inner jewel
#

it's definitely not spam if you can do math

idle grail
#

Lol ik

inner jewel
#

and you don't need to post on join/leave/ready

idle grail
#

spam is different

#

I put it in ready

#

so...

inner jewel
#

ready + setInterval is fine too

elder rapids
#

ready is only fired once and that's where you set your interval. imo that's decent

inner jewel
#

^

idle grail
#

btw thats my 3rd setInterval there lol

inner jewel
#

guild joins may spam a lot

#

and you definitely don't want the 1h block

deep parrot
#

ur mom gey - Today at 22:19 ready + setInterval is fine too the way to go

idle grail
#

My bot isn't close to that popular guys don't worry

#

only 7 ded servers

elder rapids
#

Even if it's not, best practice

deep parrot
#

6

#

^

elder rapids
#

Especially if it's public

deep parrot
#

keyboard f ups

idle grail
#

ok

abstract crystal
#

why did you use help command on a popular prefix lul

idle grail
#

i did -help

#

and about 50 bots reply wtf

#

I needed to how how to view a bot's stats on Luca

#

@abstract crystal

#

whats luca's prefix

#

how to do it

#

i keep forgetting

abstract crystal
#

-botinfo @SomeBotttt

idle grail
#

Oh

#

lol

abstract crystal
nimble merlin
#

I have a feeling that learning to code a database for discord.py is going to be a nightmare...anyone got any suggestions for tutorials on it???

low owl
#

Learn SQL or whatever type of Database you seem fit and then learn a library that supports you in using it in your chosen language.

abstract crystal
#

why lol

#

simple library called dataset

nimble merlin
#

idk....never done it before....

#

never heard of dataset....that's a library?

abstract crystal
#

trust me it's simple

nimble merlin
#

ok...

abstract crystal
#

RickBot uses it for spam checking and setting keeping

nimble merlin
#

oh ok

low owl
#

Don't just use some library though, your database model will be shit

abstract crystal
#

turned out just fine

nimble merlin
#

I want my database to support discord.py so that when I run my .py file...they both link and function fully

abstract crystal
#

so dataset is your option

nimble merlin
#

ok

low owl
#

Yes and that is a pretty nice goal, but you should understand what dataset does and what technology it uses

#

Because otherwise your relations or tables will be ugly af

nimble merlin
#

is there anything that I have to download or extensions for VSCode???

abstract crystal
#

nope

low owl
#

๐Ÿ˜

abstract crystal
#

just pip install dataset

nimble merlin
#

simple enough

abstract crystal
#

@low owl yes i agree, but simple wins

nimble merlin
#

sooo, should I forget about MySQL??

#

or not?

abstract crystal
#

for a while yes

nimble merlin
#

ok

abstract crystal
#

but if bot grows a lot talking 20k+ then you should start finding alternatives

nimble merlin
#

ok...I don't anticipate a server count of 20K+ for a lonnnngggg time

low owl
#

Don't do it like me and run your database locally (testing purposes) then decide to use Docker and forget about your db and wonder why your data is not persistent bloblul

nimble merlin
#

hahahaha lol ๐Ÿ˜‚

abstract crystal
#

boohoo

nimble merlin
#

I'll try my best not to lol

abstract crystal
#

db stats if you want

nimble merlin
#

How exactly do I get started using dataset???? bloblul

abstract crystal
nimble merlin
#

k, thanks

abstract mango
#

what about it being sync though

#

that may as well just freeze your bot if it takes too long

nimble merlin
#

hmmm

#

I thought dataset was gonna be hard...but I was wrong...it's ludicrously hard...

#

I guess it's only hard cos i've never even heard of it before...

abstract mango
#

yeah

#

you probably just need to get used to it

#

i thought d.py was hard until i memorized all of the (basic/needed) methods and stuff

outer brook
#

I keep getting 403: Forbidden while posting server count

#

;/

nimble merlin
#

How do I find a users playing message (similar to how you find their id, name etc etc)

inner jewel
#

get it from a member

nimble merlin
#

?

inner jewel
#

users don't have presences

nimble merlin
#

so is it .format(member.presence)???

inner jewel
#

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

nimble merlin
#

lol

#

i'll give it a try

gilded blaze
#

is EMBED_LINKS the permission to send embeds?

heady zinc
#

yes

gilded blaze
#

thanks

earnest phoenix
#

How would I get my bots uptime in hms using discord js

#

hms = Hours Minutes Seconds

trim plinth
#

you'd have to do hms formatting yourself but it's bot.uptime to get the uptime in ms

earnest phoenix
#

๐Ÿค” ok

earnest phoenix
#

Hi
Can someone tell me how can I add some variables together in D.JS?
Like I have 2 vars and I want to do this:
A variable called: First
Another one called: Second
I want to do First + Second
I did this but it's not working:
${$tempVars(First)} + ${TempVars (Second)}}

cold harness
#

couldn't you just call two local variables and then reference them later in the loop?

earnest phoenix
#

I did at the short code I've sent
But not working

cold harness
#

lol this is why i use python

#

@earnest phoenix

var second = 6;```
earnest phoenix
#

?

cold harness
#

var x = first+second;

#

it appears to literally be that simple

earnest phoenix
#

Won't won't I think

cold harness
#

basiaclly use local variables and not temporary ones

earnest phoenix
#

I need temp

cold harness
#

why?

earnest phoenix
#

Because that's how I wrote my code

cold harness
#

most discord commands don't need more than 1 second of computation time

earnest phoenix
#

The value stored in temp var

#

Ik

cold harness
#

then switch all to local

#

it's bad practice to have a ton of data that you make then lose later

earnest phoenix
#

Temp var is gone after executing command

#

War

#

Haha

#

So I'll resend my question again

#

Hi
Can someone tell me how can I add some variables together in D.JS?
Like I have 2 vars and I want to do this:
A variable called: First
Another one called: Second
I want to do First + Second
I did this but it's not working:
${$tempVars(First)} + ${TempVars (Second)}}

fresh shuttle
#
    at Function.Module._resolveFilename (module.js:557:15)
    at Function.Module._load (module.js:484:25)
    at Function.Module.runMain (module.js:703:10)
    at startup (bootstrap_node.js:193:16)
    at bootstrap_node.js:665:3```
 When I try to start up the bot

Please ping me if you know
low rivet
#

@fresh shuttle discord.js?

#

send code

fresh shuttle
#

@low rivet thanks for then help but I got it working.

cold harness
#

does anyone know how to get a bot to edit its most recent message?

flat inlet
#

It doesn't look like discord.py has any way of fetching messages in a channel. You'd have to store the last message in a property like server.client.member.lastMessage and update that variable whenever the bot sends a message. @cold harness

cold harness
#

thx i noticed that

flat inlet
#

Does the use of a widget requirement for certification have to be on a website or github page? Can I put it in a command like >>status instead? <@&304313580025544704>

earnest phoenix
#

Display the widget on a github repo or a site

languid dragon
#

thanks

tawny lava
#

nice

flat inlet
#

I've already got my own version of status running on my website and the repo is private

#

can't really put it anywhere

steel heath
#

Hello

flat inlet
#

hi!

steel heath
#

I never use this channel until someone mentions me in here

flat inlet
#

Yeah sorry about that

sharp stump
#

Is it possible to use an iframe to embed my bots website in the long description?

uncut slate
#

Yes

muted oxide
#

also I am using requests for server count.

gilded thunder
#

Why doesn't this work?

# hackban command
@bot.command(pass_context = True)
async def hackban(ctx, userName: discord.User):
    await bot.say("User hackbanned!")
    await bot.ban(userName)
frail kestrel
#

remove space between pass_ctx and bool

gilded thunder
#

Ok.

frail kestrel
#

more pythonicโ„ข

gilded thunder
#

Autopilot.

frail kestrel
#

w0t

gilded thunder
#

Done this 3 times and just changed one thing for the 3 things.

frail kestrel
#

o

#

well

#

users are global

#

wait

#

r u banning users who aren't in the guild

gilded thunder
#

Member not found.

#

Hackban.

frail kestrel
#

thinking

#

checking for mentions?

gilded thunder
#

Bans users who aren't in the server.

frail kestrel
#

yes

jovial sable
#

Hello, how do I get discord heartbeat? I'm on javascript

uncut slate
#

Which lib?

bleak sapphire
#

how do i use a check permission in a if statement?

jovial sable
#

Discord.js

ruby dust
#

@bleak sapphire you mean checking if the message author has a guild permission?

bleak sapphire
#

yes

earnest phoenix
#

wat lib thou

bleak sapphire
earnest phoenix
#

ok bye. .. . .. .

bleak sapphire
#

lol

#

๐Ÿ˜„

earnest phoenix
#

i dont know py xD i had coded it like 3 years ago lol

ruby dust
#
if not ctx.author.guild_permissions.<permission>:
    return
```that would be how I isolate a command to a specific guild permission, you can look at the docs for a permission list
gilded thunder
#

How do I make command catergories or do I need to use cogs?

bleak sapphire
#

Ok ty

topaz fjord
#

What is this cogs people talk about

bleak sapphire
#

same lol

ruby dust
#

in d.py, you can have multiple files for one bot called "cogs"

bleak sapphire
#

owww

gilded thunder
#

Do I put cogs in a folder or the root?

#

Because I can't seem to load cogs.

#

I'm new to that btw.

bleak sapphire
#

how do i load cogs?

#

that might be a useful thing

ruby dust
#

I'm currently at work so I can't really show my code for it

bleak sapphire
#

oh ok sure

#

tnx for the if statement though

ruby dust
#

but basically

bleak sapphire
#

imma go check the docs now

ruby dust
#

you need to make a list object of files from the same directory and with for loop load all of them

zealous forge
ruby dust
#

iirc, the only way to have a "no inviter" is to make your server create that invite with your server widget

gilded thunder
#

Sounds right.

zealous forge
#

what about if the person leaves after creating it

#

would that remove the inviter?

ruby dust
#

it still going to return their current name and pfp

zealous forge
#

ok

#

ty

ruby dust
#

like how hackbanning works, you can still see the member even if they aren't in the server :^)

bleak sapphire
#

anyone knows how i can make it so that everytime i execute the command bellow it sends the server names to me in 1 message not like one by one

Code/Command :

@bot.command(pass_context=True)
async def servers(ctx):
    if ctx.message.author.id == OWNER_ID:
        servers = sorted(list(bot.servers), key=lambda s: s.name.lower())
        for i, server in enumerate(servers):
            await bot.send_message(ctx.message.author, "**{}**".format(server.name))
        await bot.say("Successfully sent you the servers im in")
    else:
        await bot.say(noperm)
frail kestrel
restive silo
#

a TypeError

frail kestrel
tardy hatch
#

Hello

#

Is possible to disable hetzner?

pulsar cairn
#

what is that

tardy hatch
#

Hetzner connection

pulsar cairn
#

idk

#

do i

#

also is that like german or someshit

tardy hatch
#

:)))

restive silo
#

i think thats a hoster

tardy hatch
#

Oh..

#

That can t be stopped?

pulsar cairn
#

does anyone know how to dm someone using JDA

solemn obsidian
#

hetzner is basically german ovh

#

but u probably want to elaborate on what do you mean "disable"

pulsar cairn
#

inb4 doesn't know what elaborate means

uncut slate
pulsar cairn
#

ok

clear hill
#

someone can help me?

weak parrot
#

1 Tip just ask what you need and people will help asking if someone can help will only delay the awnser ๐Ÿ˜‰

clear hill
#

How I Make Help Command

#

?

gilded thunder
#

What language?

clear hill
#

?

#

D.js

gilded thunder
#

Donโ€™t know, Iโ€™m D.PY.

#

Probably make an event handler and have a message send with the command list.

clear hill
#

๐Ÿ˜ฆ

solemn obsidian
#

just send a normal message with the contents describing the commands?

clear hill
#

yep

#

How I Make Help Command


module.exports.run = async (bot, msg, args) => {
...
}

module.exports.help = {
    name: "..",
    Type: ".."
    description: "..",
}``` I Use This!
solemn obsidian
#

msg.channel.send("my fancy help command")

tepid laurel
#

hey all, I was wondering
Could you guys help me out with this issue of mine
I'm trying to sort a map by a key's value
only the sort doesn't seem to actually sort it properly
members.sort((a, b) => b.totalXp - a.totalXp)

#

It didnt put the highest XP on top, or so

solemn obsidian
#

b.totalXp < a.totalXp && 1 || b.totalXp > a.totalXp && -1 || 0

#

If b has less xp than a, then a goes above in the array, if b has more than a then b goes above, if both have same amount then no change

#

.sort mostly just works based on the values it gets of 1/0/-1 telling it how to sort

tepid laurel
#

Ah I see,

#

but still the very first one is a member with 0 xp

#

and the second one is me

#

with the max xp

solemn obsidian
#

then i fucked, flip either the greater/less than signs or the 1 and -1 with eachother

tepid laurel
#

imma try thanks a lot

#

@solemn obsidian okay so the last part where you put 0

#

I changed that to b.totalXP == 0

#

and it did change the structure and sorted it in a way

#

BUT,

#

A dude with 57xp is on the lowest of the list

solemn obsidian
#

Why compare to 0?

tepid laurel
#

and myself I have 84 and am above him

#

so I am guessing that uh

#

It puts all 0's above everything or smthn

#

and then starts the rest

solemn obsidian
#

In the code i sent i compare if its greater or less than, so if it gets to that part it means xp for a and b is same

#

b.totalXp > a.totalXp && 1 || b.totalXp < a.totalXp && -1 || 0

tepid laurel
#

ah, I see, but then again, if I keep it that way it didnt sort it at all

#

@solemn obsidian

solemn obsidian
#

Do note if totalXp doesn't exist, it wont sort it

tepid laurel
#

oh lol that must be it

#

wait no

#

very sure it exists

#

it auto sets it to 0 if the data is empty

#

if there is data it sets the xp to it

solemn obsidian
#

Run the same code but add at the end .map(a => a.totalXp)

tepid laurel
#

@solemn obsidian So what do you think is wrong?

#

Cause you see the 0's aswell

solemn obsidian
#

b.totalXp > a.totalXp && 1 || b.totalXp < a.totalXp && -1 || 0

tepid laurel
#

oml

#

when spelling hits u in the face

idle grail
#

someone halp

tepid laurel
#

thanks fam

idle grail
#

;-;

tepid laurel
#

Guessing you are using a promise somewhere,

#

That rejects but not cached

idle grail
#

I used a promise only twice

#

one in a function

#

and another in a command

tepid laurel
#

yeah point it

solemn obsidian
#

something using snekfetch

tepid laurel
#

is*

solemn obsidian
#

snekfetch throws error

#

u dont catch it

tepid laurel
#

its unhandled

#

so error

idle grail
#

;-;

#

so how do i figure out where it is

tepid laurel
#

have you tried googling promise rejections

idle grail
#

Yeah it doesn't really help ;-;

tepid laurel
#

well,

#

guessing that you get that error its something like this

solemn obsidian
#

do u do any http requests

tepid laurel
#
somePromiseFunc().then(that => do something with that) < that failed
#

since its not like catched its gonna error, cause ur trying to use something that don't exist or so

idle grail
#

Yeah i only used promises twice and catched in both

#

and that error is occuring in a setInterval i think because it keeps happining like every minute or something

#

wait lemme try something

#

i think its the postStats thing because it started right after i put it in

tepid laurel
#

what is "postStats"

idle grail
#

dbl.postStats

tepid laurel
#

-_-

#

again

#

what is "postStats"

#

the code behind it

solemn obsidian
#

do u catch that func

idle grail
#

No

#

Do i have to?

solemn obsidian
#

there is ur problem

idle grail
#

๐Ÿ˜ฎ

solemn obsidian
#

but better reason why that error happens, ur dbl token is wrong

idle grail
#

IT STOPPED AFTER I REMOVED IT

solemn obsidian
#

(u should still handle the error)

idle grail
#

It is?

#

K

#

k

solemn obsidian
#

Unauthorized = token wrong

idle grail
#

Oh

#

it WAS broken lol

#

How do you even fucking copy it without messing it up

#

Need a copy button or an easier-to-select block of text ๐Ÿ˜ก

earnest phoenix
#

so im trying to make a npm package and this is my code:

#
module.exports = function () {
    request("https://bts.net.pl/random_image/api", function(err, link) {
                return link.body;
            });
    }   ```
idle grail
#

Only that much?

earnest phoenix
#

and example script:

console.log(rndimg());```
and it shows undenified
idle grail
#

Are you using JS

earnest phoenix
#

yeah

idle grail
#

k i could help a bit

#

i tried making a package once lol

earnest phoenix
idle grail
#

Lol

earnest phoenix
#

look code above

idle grail
#

ikik

#

Wait is that a file

#

@earnest phoenix

earnest phoenix
#

yes ๐Ÿคฆ

idle grail
#

also you might not want to do that too much

earnest phoenix
#

im making random image package

idle grail
#

returns a long list

#

Oh

#

:thonk:

earnest phoenix
idle grail
earnest phoenix
#

weird

#

for me it works

#

oh ur av blocked rip lol

#

and the long shit i can crap out

idle grail
#

ikik XD

earnest phoenix
#

i just only want fix

#

for undenified

idle grail
#

wait

#

try to munipulate it

#

@earnest phoenix

#

Also

earnest phoenix
#

?

idle grail
#

Are you going to use the file later on?

earnest phoenix
#

its a node.js package

idle grail
#

tbh i would write all the code in one file

#

wait its a package?

earnest phoenix
#

yes ๐Ÿคฆ

idle grail
#

Ok then you don't need the ./

earnest phoenix
#

ohh

#

but the problem

#

with undenified is in code

tepid laurel
#

Mate