#development

1 messages ยท Page 412 of 1

earnest phoenix
#

it's already done

low owl
#

So what makes your application different from the others?
How does it make you not use the abstract standards used in actual business?

elder rapids
#

Oh really now

earnest phoenix
#

yea

#

I just need a model

#

and location

#

tell mw what's the reason to use it

#

lets say all my actions will ever only need those headers

strange cliff
#

For my Discord.JS bot, I want to get each mentioned user from the message and have a member on each. The command expects one or two mentions. How would I go about doing this?

earnest phoenix
#

why implement something else

#

member of what guild

strange cliff
#

the guild of the message

earnest phoenix
#

the guild where the message was sent?

#

oh

#

that's pretty easy

#

message.guild.get(id)

#

then loop through the mentions

strange cliff
#

huh..?

#

I need either member or user

low owl
#

Well, there come a few things to my mind applying to all standards. First, they are tested. They just work. Second, the overhead is minimal. With todays technologies not noticeable in usage. Third, you save money. Fourth, if you have questions, there is a wide audience that can help you.

strange cliff
#

I want to extrapolate the IDs of each user, as they will be used in a database

earnest phoenix
#

it's not that they don't work

#

It's just a way to format my payload

elder rapids
#

Alright well if you want to make your own payload and protocol stuff then go ahead but imo it's more a headache than it's worth

earnest phoenix
#

I just don't think you're understanding

elder rapids
#

I fully understand ;P

earnest phoenix
#

I am 100% I don't need any more data in any of my payloads

#

it's a way to format data

#

nothing is to be done

elder rapids
#

ETF is also a way to format data

#

and a well accepted standard

strange cliff
#

The method I am currently using for fetching the mentioned users is:
target1 = client.users.get(Array.from(message.mentions.members)[0])

#

but it ends up as undefined

earnest phoenix
#

but if my application may ever only use those headers

#

why implement etf

#

headers/data

#

client.users = cached im not sure if that would work

#

@strange cliff

#

I think there was a method

#

to get a guild member

#

somewhere

#

Isn't it

#

guild.get

#

?

elder rapids
#

wew that's a spam

strange cliff
#

it may be.. I'll try

earnest phoenix
#

or maybe

#

guild.members.get <--- yea it's this

#

and then to get the mentions you just do message.mentions.users

#

if you want to loop through then you do message.mentions.users.array()

strange cliff
#

I'm still getting undefined from it. If I understood right, this should be my new line:
target1 = message.guild.members.get(message.mentions.users.array()[0])

earnest phoenix
#

message.mentions.users.array()[0] = user

#

you gotta add .id

#

get(<id>)

#
message.guild.members.get(message.mentions.users.array()[0].id)
#

try that

strange cliff
#

I feel like I am getting slightly closer... but now it appears to be dumping something else

#

Am I allowed to post a screenshot in this channel?

earnest phoenix
#

I think so

strange cliff
#

Oh wait..

#

I'm a stupid

quasi hearth
#

it appears to be logging the client?

earnest phoenix
#

lol

strange cliff
#

That's the output of console.logging the object

earnest phoenix
#

so did it work

strange cliff
#

It's working perfectly

#

Thank you woopsLovee

strange cliff
#

Is there a good single-line method to get either the user's nickname, or their normal name, depending on which is available?

#

I'm using nickname right now, and it returns null if there is no nickname for the user

sour wraith
#

what lib?

#

also this server is breakin mah bot because something returns null yet there should be a value for everything except the server icon GWsocksAngeryBob

strange cliff
#

discord.js

mental solstice
#

@strange cliff read up on condition variables

#

let nickName = user.Nickname != null ? user.Nickname : user.Username

#

Something like that, im not certain of the js syntax but your code would be close to that

elder rapids
#

You mean ternary operators?

earnest phoenix
#

js also has a null coalesce operator i think

#

let name = user.Nickname || user.Username;

quasi forge
#

Or you could simply use

#

guildMember.displayName

earnest phoenix
#

yea it would like exactly like that

#

"let nickName = user.Nickname != null ? user.Nickname : user.Username"

#

(the ternary operator usage, not the actualy library d.js code that is)

quasi hearth
#

how do you get votes?

mental solstice
#

Make a good bot people want to vote for

#

You can make a webhook server to accept incoming hooks from dbl.. or anywhere for that matter.

quasi forge
#

btw I need some help too

#

I keep getting insufficient perms error while the invite link asks for Admin perms

quiet bobcat
#

they might not give your bot administrator perms?

quasi forge
#

still it gives that error twice every second

gilded thunder
#

How can I mask links in an embed on Discord.py async?

earnest phoenix
#

markdown

restive totem
#
[meme](https://notameme.com/)
#

this way dude

lime arch
#

holy hell, thats a lot of declined bots in modlog!

empty steppe
#

haha yeah, does modlog also list approved bots?

knotty steeple
#

yes

#

@empty steppe

#

wait modlog

empty steppe
#

cool thanks ๐Ÿ˜ƒ

knotty steeple
#

no

#

if #logs it lists approved bots @empty steppe

#

modlog only has declined bots

empty steppe
#

ah okay got it

lime arch
#

poor guys they must have a TON of bots to go through each day

empty steppe
#

yeah looks like it, and they seem to be doing it quite timely

knotty steeple
craggy grail
#

Could you tell me the manual to create bot - timer

empty steppe
#

is there a convention or good practice for the Bot-Command Prefix?

ruby dust
#

try to come up with an easy-but-unique prefix so that it doesn't collide with other bot prefixes

ashen quail
#

So I am using this:

let cooldown = new Set()
let Mcooldown = new Set()

It says set is undefined, how do I fix it?

fresh cedar
ashen quail
#

Yes

#

lol

#

so what do I do then @fresh cedar ?

quasi hearth
#

In embeds, is there a way to make the thumbnail appear before the fields?

ashen quail
#

I don't think so

quasi hearth
#

darn

#

how do bots know when a user has voted for them?

low owl
#

DBL API?

floral stone
#

@low owl how so?

low owl
#

Huh?

floral stone
#

You pinged me.

low owl
#

Oh, the voodoo magic

floral stone
#

yep

#

how so

low owl
#

Well, I don't do much advanced Python so it kinda looked weird. But despite that, there are like 4 (or more?) loops in one method and things like that are most of the time are a good hint something is going on.

violet wyvern
#

Does anyone know how to create a say command in discord.js?

floral stone
#

All it does is get the default channel.

low owl
#

You also defined your lines by hardcoding them in and the overall behaviour of the method raised the impression that it does too much or does something I would normally not do. e.g. hard coding these strings and performing the checks.

topaz fjord
#

Get the users message content -> send it as the bot

#

Ez say command

floral stone
#

I could simplify it, possible. But the loops are there for a reason. It's a multi step process.

low owl
#

I'd split up the method into multiple methods then

floral stone
#

It would make it look cleaner, yeah. It works though.

low owl
#

Not like it matters for this specific case, but good code can be determined by 3 main categories. Readability, functionality and maintainability. While functionality clearly is there, it would be much more readable if it is split up and each method has a descriptive name. And it would be more maintainable because it's easier to find bugs and access smaller methods than seeing one big thing.

Just for future reference, if you work in this alone you can do whatever you want of course ๐Ÿ˜„

floral stone
#

But I can read it.

#

I did this alone though.

low owl
#

Yes, but if I was to work with you I'd need a "long" time to figure out what's going on

#

But yea, you do yours

#

Actually talking about functionality, what mainly made me think it's voodoo magic is that you have these strings hardcoded. I'd only determine a default channel by permissions and then just take the first one I come across.

#

I think it's a cool idea to also consider the names though. Have you ever heard of utility theory?

night imp
#

Hello ๐Ÿ‘‹! Does anyone have any suggestions for databases with the dblapi? I am using them to get votes and want to remove them in 24 hours

gilded thunder
#
# fight command
@bot.command(pass_context=True)
async def fight(ctx, user: discord.Member   ):
    action = ["whacks", "punches"]
    weapon = ["chainsaw" , "knife", "bottle", "meme"]
    embed=discord.Embed(title="Fight!", description="**{} {} {}** with a **{}**!".format(author.name, random.choice(action), user.name, random.choice(weapon)), color=0x176cd5)
    await bot.say(embed=embed)```
#

Only terminal error is my broken error handler.

ashen quail
abstract mango
#

@night imp i honestly think you could just store everything in a variable

#

in memory cache

#

:p

floral stone
#

@low owl that is what it does but it trys to find the channels like general or lounge first.

abstract mango
#

@ashen quail that's a report command not a buy command

ashen quail
#

ik

#

my bad

#

anyways I fixed it

civic quarry
#

@gilded thunder You use async ๐Ÿ˜ฑ

#

also, use f-strings, it's better and actually faster than format() ๐Ÿค“

#

it would look like
embed=discord.Embed(title="Fight!", description=f"**{author.name} {random.choice(action)} {user.name}** with a **{random.choice(weapon)}**!", color=0x176cd5)
It also does str converting on its own if needed

python 3.6

earnest phoenix
#

I want to know about this funny steam discord bot making application. https://store.steampowered.com/app/682130/Discord_Bot_Maker/ I think that is just kind of a scam because bot making is pretty easy tho.

Discord Bot Maker is a powerful bot development tool for the #1 text and voice chat service for gamers: Discord. With this tool, you and your teammates can take your social experience to the next level!ExplanationOne of the most prominent feature...

Price

$9.99

Recommendations

198

โ–ถ Play video
elder rapids
#

You'd be surprised

#

The program isn't really well made anyways

earnest phoenix
#

Yeah probably

#

What does that bot even use to make them

elder rapids
#

what do you mean what does the bot use to make them

floral stone
#

language

earnest phoenix
#

Yeah

floral stone
#

the language

#

10 bucks isn't worth a bot maker

elder rapids
#

It's not worth getting the program if you're thinking about it

#

It's also JavaScript

#

You'll be better off learning programming and making the bot by hand rather than using the program

floral stone
#

I am not

elder rapids
#

wasn't talking to you

floral stone
#

I already am

lament meteor
#

wait DBM uses d.js or eris?

elder rapids
#

d.js iirc

lament meteor
#

but what i know it looks gud but isnt gud

elder rapids
#

It's not good at all

lament meteor
#

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

elder rapids
#

It's useful for those that have absolutely no programming knowledge

lament meteor
#

but it isnt worth

elder rapids
#

But it also has terrible practices as a whole when compiling the whole bot together

lament meteor
#

learning is cheaper and can help u when ur doing other stuff

elder rapids
#

Convenience > Security in DBM's mind

gusty topaz
#

yes

#

it puts the token in an obscure location

#

which people miss

#

and put on github

#

which makes everyone sad

elder rapids
#

It's not even kind enough to include a .gitignore

#

and if it did people will be like "Wtf why is the bot not working when I redownload from github"

gusty topaz
#

honestly, I am surprised it doesnt pack up the entire bot into a single file

lament meteor
#

xD

gleaming summit
#

Is there any can solve problem about npm package?

topaz fjord
#

Explain

gleaming summit
#

oh

#

ok

#

Also my friend's prob

#

My friend made package with npm publish

#

And then

#

when he install it and try to require

#

ERR

topaz fjord
#

What's the error

gleaming summit
#

err was

#

not found

#

he checked the package.json file

#

wait a sec

topaz fjord
#

Did you check if it's on the website

gleaming summit
#

wait a sec

#

I'll ask to him

#

screen shot of when it installed

#

file: ../parser

#

@topaz fjord Not available on NPM website

#

Hue...

#

I solved ...

topaz fjord
shrewd hedge
inner jewel
#

you add two new listeners on every message btw

shrewd hedge
#

Hm

#

Where?

#

@inner jewel

solemn obsidian
#

60-66

inner jewel
#

also try using breakpoints/adding logging to see where it stops handling the command

shrewd hedge
#

Ok but then what do I change in these files?

#

*lines

inner jewel
#

move them outside the message handler

shrewd hedge
#

Ok

#

Thanks

solemn obsidian
#

do the exactly same as you did for the ready one

#

dont put them inside any function

shrewd hedge
#

Wait I think I got what you say

mental solstice
#

@quasi hearth did u get votes figured out?

shrewd hedge
elder rapids
#

.. wot?

#

That's not even like ... valid

shrewd hedge
#

Uh

elder rapids
#

They meant move it outside the ready

solemn obsidian
#

you move the client.on(....) parts outside ready

inner jewel
#

you should learn JS and read the lib docs/some open source bots

elder rapids
#

Not the actual function itself

solemn obsidian
#

just like ready currently is

slim heart
#

Okay... So, I have multiple js files for different functions of my bot and all of them login on startup... I'm guessing this is probably a lot of API spam and I'd like to avoid any problems... I keep everything in seperate files to avoid constant crashing from one section and ruining everything else but also being able to edit and restart specific parts of the bot instead of restarting EVERYTHING... I'm curious if there's a way to do this while still avoiding spam

elder rapids
#

Why in the heck are you logging into the gateway numerous times like that

inner jewel
#

^

elder rapids
#

Just include each file and hot-replace them when updates happen

#

Use try/catch and such to make sure nothing breaks your gateway

#

(and yes you can hot-replace interpreted languages e.g. JS)

slim heart
#

but also like my console is being spammed from multiple things and keeping them seperated is kinda nice too

elder rapids
#

Welcome to programming and running programs

#

Your log is meant to be spammed

slim heart
#

ver truth

#

but still

#

Is there like a way to log specific things into different places or somethin

elder rapids
#

Maybe? idk

slim heart
#

there's gotta be something tbh

elder rapids
#

Natan probably knows how to answer that

slim heart
#

if not someone should make it

elder rapids
#

I don't worry about logging to other places if I use JS so I don't know what's out there

#

(I imagine it could be as simple as opening a file for write and just keep writing to it)

#

But that also may not be efficient

slim heart
#

but like into seperate console windows

#

prolly a way of doing it with http requests over and over but like, ew

elder rapids
#

Log files

#

not console windows

inner jewel
#

proper logging

#

instead of just writing to stdout

slim heart
#

ik but like a console would be nice idk

elder rapids
#

Log files are better

#

stdout only lasts as long as the program is active

#

Even then I think the console has a limit

#

It can only log X amount of lines at one time (then starts removing old)

slim heart
#

ight ye

#

Also another question

#

Is there a way to store a content.match in a json so like store /(thisistest|thismaybeistest)/gi
in blah.json and then message.content.match(blah.whatever)

spring ember
#

Yes

#

Json array?

#

Oh wait what do you want to store?

slim heart
#

no like so i have swears.json and i want to put the whole content.match in there so i can spread throughout multiple content.match's

spring ember
#

Regex?

slim heart
#

ye

spring ember
#

Do you want to store the regex string?

#

It'a just a normal string

slim heart
#

so like this
swears.json:

"var": "/(thisistest|thismaybeistest)/gi"
}```
index.js:
```bot.on('message', async (message) => {

if (message.content.match(swears.var)) {

console.log("oof")

}```
#

but it just doesnt idk

uncut slate
#

you can't store regexes in a string

inner jewel
#

inb4 eval(json.key)

uncut slate
#

you have to call (new) RegExp on it

spring ember
#

So just add if content.match(new RegExp(...))

slim heart
#

and ... is swears.var or no?

uncut slate
#

not quite

#

right now swears.var is your regex literal (i.e. includes //g)

#

you just want it to be the pattern

slim heart
#

i can just do like content.match((thisistest|thismaybeistest)/gi)

inner jewel
#

also i'd avoid massive regexes

slim heart
#

but i have multiple content.match's that look for the same thing and i have to change all of them when i want to change it

spring ember
#

Use a set

gilded blaze
#

just make a new instance of regexp

spring ember
#

Set has O(1) check time, and regex is O(n)

trim plinth
#

thats some nice regular expressions

slim heart
#

no clue how, any of this works lmao sorry

spring ember
slim heart
#

ohohhh i see

#

so like var ye = new RegExp (all|mi|stuff)

inner jewel
#

no

#

new RegExp("all|my|stuff")

slim heart
#

mi*

#

alright imma try

#

and i just use content.match(ye) or no?

#

ayy

#

it works ๐Ÿ˜ƒ

spring ember
#

Try it and see

#

Nice

slim heart
#

thank u guys

glacial sentinel
#

I transferred my bot to a VPS server and sometimes there is a few seconds delay with the bot response, I tried logging when the command executes but that shows up instantly, even tho the response only shows after a few seconds.
It randomly does it, sometimes it responses instantly and sometimes there is that delay. Any ideas? Please @ me.

knotty steeple
#

@glacial sentinel that could be where the vps is located

glacial sentinel
#

What is the best location for it?

knotty steeple
#

well the US would be a good place

#

Chicago

#

idk

#

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

topaz fjord
#

ny is a good location

spring ember
#

Yes US is the best

topaz fjord
#

i get ~ 22ms

#

ping

#

at ny

glacial sentinel
#

So should I check the ping to see if it's the location or another issue?

elder rapids
#

My bot is in New Jersey and it runs very fast too Thonk

topaz fjord
#

@elder rapids wats ur ping

elder rapids
#

Uhh fast

#

What ping do you want

topaz fjord
#

nou

#

your bots ping

elder rapids
#

websocket latency ...?

knotty steeple
#

@glacial sentinel if you have bad ping you would have delayed response

topaz fjord
#

to dicksword

elder rapids
topaz fjord
#

latency

glacial sentinel
#

Yes so if the ping is fine then it's another issue right?

knotty steeple
#

yes

glacial sentinel
#

How do I check the ping in discord.js? xD

elder rapids
topaz fjord
#

<Client>.ping

inner jewel
#

there are two types of pings

#

that one is WS ping

#

there's also REST "ping"

knotty steeple
#

whats REST ping

elder rapids
#

If you want the REST "ping" aka ping to discordapp.com I'll have to quick login to my server

glacial sentinel
#

REST "ping"?

elder rapids
inner jewel
#
start = get_time();
await sendTyping();
rest_ping = get_time()-start;```
elder rapids
#

Which is what I get ๐Ÿ‘€

#

But also that too ^

#

Include ping to domain also

knotty steeple
#

which some people use to ddos bad websites

inner jewel
#

icmp ping barely matters tbh

knotty steeple
#

they ping the website a bunch of times

elder rapids
#

pffttt it does though

topaz fjord
inner jewel
#

ddosing with icmp packets

elder rapids
#

dosing*

#

tyvm

inner jewel
#

easier to spam http requests

topaz fjord
#

dicksword ip nice

inner jewel
#

they cost more to process

elder rapids
#

You must be in the same datacenter

inner jewel
#

that's cloudflare

glacial sentinel
#

My bot is located at the USA, is that good?

elder rapids
#

Yeah but CloudFlare being < 1ms

#

Or any ping really < 1ms

#

Means you're in the same datacenter

inner jewel
#

maybe same city

elder rapids
#

That's quite hard to achieve without basically being in the same datacenter

#

I guess same city maybe

knotty steeple
#

maybe same location

topaz fjord
#

@elder rapids magic

inner jewel
#

i get ~12ms to cloudflare

topaz fjord
#

im located in NY

glacial sentinel
#

@inner jewel What is get_time()?

inner jewel
#

pseudocode

glacial sentinel
#

and that is..?

elder rapids
#

wew

#

It's exactly as it says

#

pseudocode

glacial sentinel
#

so how to use it

elder rapids
#

You actually make the code that does what the pseudocode is doing

knotty steeple
#

wait

#

what

elder rapids
#

pseudocode is just an example of how real code would work

#

By no means is it even valid code

knotty steeple
#

lol

#

guess thats why its called pseudocode

#

can u link me to it

topaz fjord
glacial sentinel
#

I think there is something wrong

#

๐Ÿ˜‚

#

The bot is located at the USA, is that not a good location or is the host just crap?

slim heart
#

host prolly

topaz fjord
#

or its ur internet

#

the speeds

glacial sentinel
#

my internet?

knotty steeple
#

where in the USA tho

slim heart
#

its the bots ping

#

not his kek

glacial sentinel
#

^

topaz fjord
#

my vps have 500mbps network

glacial sentinel
#

What host are you guys using?

topaz fjord
#

Galaxygate

knotty steeple
#

SamuraiSolutions

slim heart
#

this is about normal

#

wait

glacial sentinel
#

Yea thought so :/

slim heart
#

YOO i just noticed my computer is 1 day behind LMAOO

glacial sentinel
#

Should I ask to move it to a diff location or just move host?

slim heart
#

1 day ahead*

glacial sentinel
#

USA Virginia state, Loudoun County is the current location

slim heart
#

all these messages said yesterday

#

The location shouldnt make THAT BIG of a difference

#

it's most likely your host

glacial sentinel
#

Yea.. :( rip

#

I switched hosts like 3 times

slim heart
#

Are you using like free hosts?

glacial sentinel
#

No it's a paid host

slim heart
#

oh yeah no

#

dont bother

glacial sentinel
#

with what

slim heart
#

Youd be better using a free trial host LMAO

glacial sentinel
#

really? which one lol

slim heart
#

i used to do that imma try and find it

glacial sentinel
#

The support said I could move it to UK or Singapore, will that help?

#

a free trial host for a whole vps server tho? sounds weird

slim heart
#

oh sheeet nevermind lmao

#

I thought you just meant for the bot

#

my bad

glacial sentinel
#

yea

#

just for the bot

#

is good too

#

how do I set it up tho if not with a vps server?

slim heart
#

it's not a vps

glacial sentinel
#

Okay so whats the host

#

is it like a discord bot host

slim heart
#

no it's some like command line hosting thing

#

i cant remember the site

glacial sentinel
#

ah okay

inner jewel
#

command line hosting WaitWhat

slim heart
#

or something leave me alone idk

glacial sentinel
#

hmmm I'm not sure, I dont want to change host again

#

If the ping is that high there is nothing that can fix it?

slim heart
#

its some cloud "layer" thing thats about all i can remember

glacial sentinel
#

oh wait wtf

#

maybe it took some time to load after restart

#

but it's still lagging like before

slim heart
#

ight ther ya guh

glacial sentinel
#

So what is the issue

#

๐Ÿค”

#

Yea it also didnt make sense before because I was logging when commands were executed and that was instant

#

but sometimes the response message just lagged a few seconds

floral stone
#

Pay for it

glacial sentinel
#

Pay for what

floral stone
#

hosting

glacial sentinel
#

I'm paying for it lol

#

It's a paid VPS server

floral stone
#

gud

glacial sentinel
#

So what could be the issue

floral stone
#

language?

#

@glacial sentinel

#

what's your code for ping

slim heart
#

also the host could be undergoing a large amount of stress at random times ya never know

glacial sentinel
#

client.ping

trim plinth
#

well free hosts can be just as terrible because they can go over even more stress because of more people flocking to them

glacial sentinel
#

It's paid

trim plinth
#

talking to @slim heart

slim heart
#

either way there's no real way to know ig

glacial sentinel
#

and if the host is slow than wont the ping be high?

trim plinth
#

yes

glacial sentinel
#

so what should I do lol

trim plinth
#

the higher the ping, the higher the latency is

floral stone
#

async: ```py
@bot.command(pass_context=True)
async def ping(ctx):
resp = await bot.say('Pong! Loading...')
diff = resp.timestamp - ctx.message.timestamp
await bot.edit_message(resp, f'Pong! That took {1000*diff.total_seconds():.1f}ms.')

**rewrite:**
```py
@bot.command()
async def ping(ctx):
    resp = await ctx.send('Pong! Loading...')
    diff = resp.created_at - ctx.message.created_at
    await resp.edit(content=f'Pong! That took {1000*diff.total_seconds():.1f}ms.')

Using Python 3.5 or below? Replace the f-strings with 'Pong! That took {:.1f}ms.'.format(1000*diff.total_seconds()).

(note: might be overall less precise than ?tag ping command*)*

trim plinth
#

hmm

glacial sentinel
#

oh I just did ping again and it's going around 300-500

slim heart
#

thats kinda normal i think

floral stone
#

is your ping command coded properly

slim heart
#

not the fastst

floral stone
#

300ms =.3 seconds fyi

glacial sentinel
#

client.ping is the code

slim heart
#

yes we know how ms work kek

glacial sentinel
#

well now it's 80

#

Idk it's so weird

#

I dont think it's an issue with the host

floral stone
#

300 isn't alot

#

300ms

slim heart
#

i said it isnt the best

glacial sentinel
#

yea I dont think its' soemthing with the host

slim heart
#

but its like, bareable

floral stone
#

it's fine

#

it's good

#

300 is good

#

if it's like 1k (1 seconds) then that's bareable

glacial sentinel
#

I tried logging a command and the log comes out instantly even if the response msg is with a delay

#

so the log will be instant but then the msg only a few seconds after sometimes

floral stone
#

It could be discord connection as well

slim heart
#

it depends on wut ur tryna do

#

cuz like i have a censor bot so it needs to be fast

#

but if its just like some play bot it doesnt have to be like 2ms (its a joke)

#

hollup does discord have their own discord bot?

glacial sentinel
#

I can dm you an invite if you want to see

#

It's really weird because it's not consistent

#

Sometimes the response is fast

#

sometimes it lags

slim heart
#

its most likely hostinger's stability idk

floral stone
#

^

#

I recommend digital ocean

inner jewel
#

any shared host can have highly fluctuating response times

glacial sentinel
#

@inner jewel It's a VPS server

slim heart
#

its still all hosted by the same machine

inner jewel
#

^

#

you can shove many users on a single physical machine

slim heart
#

thas why its __V__PS

devout matrix
#

wow

acoustic juniper
#

so quick question im trying to make a simple music bot but it joins the voice channel but plays nothing anyone know why?

spring ember
#

please use a paste service like hastebin

trim plinth
#

no u

spring ember
trim plinth
acoustic juniper
#

still do you know what's happening?

#

?

spring ember
#

I never used ytdl in js before sorry

acoustic juniper
#

o

lilac owl
#

How long does bot approval take?

spring ember
#

1 hr to one week

lilac owl
#

๐Ÿ‘

#

can I integrate the dbl API into my bot before it is approved?

#

so the server count and stuff will show up

spring ember
#

umm idk

floral stone
#

if you have an api token then I don't see why not

night imp
#

no

#

your api key will be given once it is approved

lilac owl
#

ok

acoustic juniper
gilded blaze
#

error?

acoustic juniper
#

none

#

and i checked the ytdl-core is installed with all dependincices

gilded blaze
#

what is server.queue[0]

acoustic juniper
#

oh i know why now

gilded blaze
#

well actually

#

you use object

#

instead of array

acoustic juniper
#

yeah how do you use object not array?

gilded blaze
#

var servers = {}; should be var servers = [];

#

i think

acoustic juniper
#

nope it doesn't work

#

btw i got a error

#
    servers.queue.push(args[1]);
                  ^

TypeError: Cannot read property 'push' of undefined
    at Client.bot.on (/Users/joe/Desktop/AI/index.js:39:19)
    at emitOne (events.js:116:13)
    at Client.emit (events.js:211:7)
    at MessageCreateHandler.handle (/Users/joe/Desktop/AI/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (/Users/joe/Desktop/AI/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (/Users/joe/Desktop/AI/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (/Users/joe/Desktop/AI/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
    at WebSocket.onMessage (/Users/joe/Desktop/AI/node_modules/ws/lib/event-target.js:120:16)
    at emitOne (events.js:116:13)
    at WebSocket.emit (events.js:211:7)```
gilded blaze
#

uhh

#

then idk

glossy mason
#

var servers = {}; should be that, not the suggested []

topaz fjord
#

servers doesnt have queue

acoustic juniper
glossy mason
#

They have an object called servers, and adds a queue array to them. (if I'm using the right words)

acoustic juniper
#

yup

glossy mason
topaz fjord
#

u didnt define what server.queue is

acoustic juniper
#

oh

#

how do you do that?

glossy mason
acoustic juniper
#

yeah

#

it says it doesn't know what push means

#
            ^

TypeError: servers.push is not a function````
topaz fjord
#

@glossy mason server.queue isnt a thing yet

acoustic juniper
#

@topaz fjord how do you make it a thing then

topaz fjord
#

o wait

glossy mason
#

Why not?

earnest phoenix
#

its a typo

acoustic juniper
#

where?

earnest phoenix
#

the last error you posted you were trying servers.queue.push... when it should be server.queue.push...

#

I'm talking about that one

acoustic juniper
#

yup works except it doesn't do anything

earnest phoenix
#

well that's another thing xD

tulip kraken
#

Where does it even add the link to the queue?

acoustic juniper
#

the server.queue.push(args[1])

#

it joins the voiceChannel then immedietly leaves

#

@earnest phoenix

#

@glossy mason it joins the voiceChannel then immedietly leaves

gilded blaze
#

oh

#

that's a problem with that package

#

probs

tulip kraken
#

There is also a known bug

#

from ytdl

#

not playing music

gilded blaze
#

can't download it fast enough to play the song

tulip kraken
#

ytdl is just broken

gilded blaze
#

yes

tulip kraken
#

right there

topaz fjord
#

did u update to the latest version

#

0.21.x or smth

tulip kraken
#

i am

#

idk about the guy with the issue

prime cliff
#

If it instantly leaves that usually means you dont have the opus lib, no sound was played or bad code lol

tulip kraken
#

in this case

#

whatever is in the queue

#

or the queue itself

#

is undefined

#

ive tested the code

#

and

#

well

#

There

#

so

acoustic juniper
#

?

#

how do you fixx it?

#

? @tulip kraken

tulip kraken
#

i dont know

quiet bobcat
#
server.queue.push(`${args[1]}`)```
#

idk if that will work

#

but it's worth a shot

uncut slate
#

you don't need that string wrapper

topaz fjord
#

@quiet bobcat hi cute boy

quiet bobcat
#

then it would be a string

#

you don't?

#

well then idk

topaz fjord
#

wait

#

isnt args[1] the second arg in the command

uncut slate
#

unless you purposefully want to toString it which you probably don't

#

yes

topaz fjord
#

and if there doing play <link>

#

they would need args[0]

tulip kraken
#

as i already said

#

ytdl is broken

#

its a known issue

topaz fjord
#

how is it broken if i got it to work

tulip kraken
#

well idk

#

my play cmd stopped working

#

worked fine

topaz fjord
#

the latest version helps

tulip kraken
#

ohh

topaz fjord
#

0.20.x

tulip kraken
#

i have latest tho

#

i just re-updated

#

okay so

#

im on latest

#

and

#

it doesnt work

#

it just instantly ends the stream

#

even after doing npm isntall

acoustic juniper
#

@topaz fjord args[1] is the second thing but the first args[0] would be play

topaz fjord
#

depends on the way you do it

#

i split my content into an array so args[0] would be the first part of the content for me

earnest phoenix
#

does this look like an RSA public key to you?

114887935139882574862728480767187394063659171930427504707340237699374996413020964063595438801252838859478074157817161266616611657540174621472059277047074195223243514118874837804786966449833761606439926477936379877837940856382634671827798781890419832426149959608466381224405333865310513505042556704799348206331
topaz fjord
#

you could say that

earnest phoenix
#

I'm using the bigint library

#

then I'm doing .toString()

#

but it looks different then normal rsa keys

#

maybe I need to encode it using anscii

#

It's just numbers

topaz fjord
earnest phoenix
#

that is correct I just think im missing a step

acoustic juniper
#

@topaz fjord but the first one would be the one that says play then the second would be the link so that had to be the link

topaz fjord
#

i cut out the command name

#

in my args

#

so its not included

acoustic juniper
#

o

acoustic juniper
#

so quick question is there a way to fix this or something else you could use that works?

quasi hearth
#

(discord.js) In a ReactonEmoji whats the difference between identifier and name?

abstract mango
#

for future reference you can use https://discord.js.org/#/docs/main/stable/general/welcome for docs

ruby dust
#

in discord.py, can ctx.guild be used in on_message and on_member_join events?

quasi hearth
#

@abstract mango I still dont understand what it means tho.

floral stone
#

@ruby dust if one of the arguments is ctx

abstract mango
#

@ruby dust at least i know for on_message, yes

#

the Message class should provide message.guild or similar

ruby dust
#

then I have to define the guild manually, thanks

abstract mango
#

(idk if it's Message but i'm assuming)

quasi hearth
#

like what would name look like, and what would identifier look like as a string

abstract mango
#

@quasi hearth .identifier is the emoji id

#

and .name is the name of the emote

quasi hearth
#

so name would be ":" + "foo" + ":"?

abstract mango
#

i'd say it'd be just foo

quasi hearth
#

ah, ok

abstract mango
#

i've never really worked with d.js because i use python most of the time

quasi hearth
#

should be similar tho right?

abstract mango
#

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

quasi hearth
#

what does bot.on('messageReactionAdd') do? I

inner jewel
#

nothing

trim plinth
#

listens to the event of somebody adding a reaction yeah, not like it does something

uncut slate
#

it would register a listener if you provided a callback, but you didn't

quasi hearth
#

well i do have a callback, but it doesn't log anything if i add a reaction to my message or log the correct emoji

earnest phoenix
#

is the message cached?

#

was the msg sent after the bot started?

quasi hearth
#

even if i sent a message after bot starts, nothing happens

trim plinth
verbal night
#

taking that

earnest phoenix
#

show us the callback @quasi hearth

quasi hearth
#

hmm, now it seems to be working :p

#
    console.log(rct.emoji.name);
    console.log("ping");```
floral stone
#

that's javascript

#

In the background: That is a point for Antonio. He's currently in the lead with 2 billion points in the game that everyone knows, POINT SOMETHING OUT WHEN NO ONE ASK!!!!

verbal night
#

removes those 2 billion points

floral stone
#

โค

verbal night
#

:D

earnest phoenix
#

y u do dis

verbal night
#

๐Ÿ˜ƒ

#

...it would appear i might be bored enough to remake JDA just for an open source project so i'm able to complete certain things easier >.>

low owl
#

Speaking of experience, you won't

verbal night
#

you're right xD i'm too lazy XD

low owl
#

That sounds like a great idea and surely solves your issues, but it's so much work

acoustic juniper
#

Yeah

verbal night
#

@low owl I have time, i just have to not be lazy and find a way to make it fit well with the project xD

low owl
#

It is such a big project you would need A LOT of time and dedication to analyse, design and implement, then reiterate.

verbal night
#

you underestimate just how little of a life i have ._.
i have the time xD

low owl
#

But do you have the dedication and experience? ๐Ÿ˜›

verbal night
#

experience eh, i mean JDA is open source so it's just a matter of redoing that code to fit with how i have the project setup, it would look completely out of place if it was just a straight up copy paste

dedication yea :p

acoustic juniper
#

Lol

verbal night
#

hell, even if it wasn't open source any decompiler would work >.>

acoustic juniper
#

lol

verbal night
#

true though xD

earnest phoenix
#

if you want it to fit a project you might write some wrappers instead of copy pasting the library and editing it and then lose the perk of staying up2date

verbal night
#

i'm probably out of date anyways so ๐Ÿคท

earnest phoenix
#

xD

verbal night
#

nothing new there xD

#

Yup out of date xD

low owl
#

I don't agree with your method of working ๐Ÿ‘€

verbal night
#

:p

#

@low owl I have the best method /s

inner jewel
#

any decompiler

#

if it was closed source they'd make it really hard to decompile

verbal night
#

@inner jewel That's not always the case

floral stone
#

Is it possible to edit an already define embed (assign to a variable) description?

abstract mango
earnest phoenix
#

"1 blocked message"

verbal night
#

:p

abstract mango
#

i block bots that conflict with my prefix mmLol

earnest phoenix
#

ahI see

verbal night
#

bestideaever

floral stone
#

I need to edit just the description.

abstract mango
#

pretty sure it'd work the same

#

just use description instead of title

floral stone
#

I don't want to remake the embed variable

abstract mango
#

oh

earnest phoenix
#

you'd need to upgrade to javascript for that

floral stone
#
        embed = self.bot.get_cog("Event").pika_embed(None)
        #edit embed desctiption to add something in front of it
        return embed```
abstract mango
#

you can just set the description property to something else

#

lul

earnest phoenix
#

my stats

abstract mango
#

same

earnest phoenix
floral stone
#

embed.description = "Welp"

#

That worked

abstract mango
#

np lol

#

obviously the embed will not update itself, btw

#

you have to await msg.edit(embed=embed)

floral stone
#

That's not what I'm looking for

#

I'm just trying to change the description of an already denied embed var

abstract mango
#

yeah

#

that's pretty much what i did. i changed the desc of the embed

#

wdym already denied

floral stone
#

defined*

ashen quail
elder rapids
#

wew

#

You're using ` for a string

#

Which conflicts with ``` that Discord needs

earnest phoenix
#

escape it like \`

#

xD

verbal night
#

:p

ashen quail
#

how would you check if a user reacted to a specific emoji?

topaz fjord
#

make a reaction collector

tiny turtle
#

My bot is on enough servers now I would like to make a !subscribe command and for those that do to have it send info to all the servers my bot is on/ Is there a way to make my bot itself act as a webhook for IFTTT? and does Ouath2 have anything to do with it? Pretty new to all this still and want to improve the experience for everyone that uses my bot.

earnest phoenix
#

anyone here experienced in cryptography?

#

Is it possible to verify an rsa mac/tag using only the public key?

ashen quail
night imp
#

late but ya know store the message you want to check as an async'd var

trim plinth
#

no

frail harness
#

no

#

no

#

stop

analog walrus
#

@earnest phoenix uhm discord.js not sure but Java its quite easy

fresh cedar
#

@ashen quail try adding, /global Set/ before you define your variable

#

/*global Set*/

#

ffs discord

ruby dust
#

if message.channel.category_id == 444270682549780500 is this a good check if the message was posted in a specific category?

low owl
#

Sure

little garnet
#

One message removed from a suspended account.

dire abyss
#

.

#

@frail kestrel

frail kestrel
#

??

dire abyss
#

@frail kestrel the mute command

frail kestrel
#

so?

#

Enter

#

ah shit not that bug

#

get out enter

#

show ur code btw ty

dire abyss
#

i havnt started it i'm not sure how to

frail kestrel
#

b

#

ok whats ur lib

dire abyss
#

js

frail kestrel
#

no

#

library

#

api wrapper

dire abyss
#

.....

frail kestrel
#

what

dire abyss
#

not sure what that is

frail kestrel
#

js is a language

dire abyss
frail kestrel
#

discord.js?!

indigo notch
#

JS is a scripting language

dire abyss
indigo notch
#

Discord.JS is bad, use Eris

dire abyss
#

discord.js

frail kestrel
#

ok

dire abyss
#

still typing

frail kestrel
#

can you be patient

dire abyss
#

sure hon

frail kestrel
#
  1. Presuming it's a mod command - you'd want to make it permission or role-based instead of anyone being able to use it
  2. Use member when checking for IDs or @mentions since users are global
  3. You may want to handle mute time (can be done with the ms module) and arguments (if there's not enough args provided in the message, do x)
dire abyss
#

thanks for the help i guess

frail kestrel
#

ok

#

'i guess'??

little garnet
#

One message removed from a suspended account.

severe socket
#

pages like?

acoustic juniper
#

so i'm trying to make a music bot with ytdl-core then i heard that ytdl-core stopped working, is there a alternative to ytdl-core? btw this is my code https://hastebin.com/umewiviyoy.php

earnest phoenix
#

can i have a good bot maker list cause i want to make a bot that can do everything

restive silo
#

there are no good bot maker that can "everything" you would need to code it

low owl
#

What do you need?

earnest phoenix
#

a link to make abot'

solid cliff
knotty steeple
#

xd

verbal night
#

:p

acoustic juniper
#

so i'm trying to make a music bot with ytdl-core then i heard that ytdl-core stopped working, is there a alternative to ytdl-core? btw this is my code https://hastebin.com/umewiviyoy.php

elder rapids
#

Lavalink or make your own shrug

#

When I had my music I didn't use ytdl core, I programmed it all myself even cipher shit

acoustic juniper
#

how do you do that?

brave bolt
#

you'll seem some language-specific alternatives in the readme

quasi forge
solid cliff
#

Remove script

#

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

quasi forge
#

__

elder rapids
#

Remove your scripting stuff

#

Exactly as it says

quasi forge
#

is there some way I can find out which part it finds malicious

elder rapids
#

... anything scripting related

brave bolt
#

do you have any browser extensions that could be affecting it?

elder rapids
#

Browser extension won't cause that

brave bolt
elder rapids
#

Unless the extension writes stuff into the textbox

brave bolt
#

yeah I was gonna say if it injects into the page it could cause it

quasi forge
#

nope nothing like that

#

extension free browser

brave bolt
#

what browser

elder rapids
#

I didn't say inject into page

#

I just said writes into textbox

quasi forge
#

nvm

#

I'll just stay with shitty detailed description

elder rapids
#

Just check your description for script stuff

#

It's not difficult ๐Ÿคท

#

<script> is forbidden unless you're cert and it also likely checks <button click> or something too

quasi forge
#

oh so that's why

#

I'll have to get cert now

#

๐Ÿคฆ

elder rapids
#

I highly doubt you need scripts

#

And if you do you can still iframe

topaz fjord
#

You could try using :active for button clicks etc

#

It won't be exact but close enough

orchid horizon
topaz fjord
#

Are u using it on a non cert bot

#

@orchid horizon

elder rapids
#

non-cert bot doesn't matter

orchid horizon
#

no

topaz fjord
#

Are u sure?

orchid horizon
#

it's @earnest phoenix

elder rapids
#

As long as the user submitting is certified it works

inner jewel
#

^

topaz fjord
#

inb4 dbl blocked font awesome

elder rapids
#

don't awesome

topaz fjord
#

sh

orchid horizon
#

oh I'm not certified on the website

#

that's probably why?

topaz fjord
#

Rip

elder rapids
#

If your user is not technically certified then prob

topaz fjord
#

Idk who can ad you the badge

#

Probs tonky

orchid horizon
#

ye

topaz fjord
#

ping

elder rapids
#

Yeah you don't have cert badge

#

Not cert according to the site

orchid horizon
#

well rip

elder rapids
#

Should have this next to your name

orchid horizon
#

yeah I don't

topaz fjord
#

Pingeth thy tonketh

orchid horizon
#

@bitter sundial

topaz fjord
#

Hes online so what can go wrong

orchid horizon
#

nothing at all

topaz fjord
#

Inb4 all ban

bitter sundial
#

oh

topaz fjord
#

Hey tonky

orchid horizon
#

uh oh

#

I mean hey tonkku

bitter sundial
#

-bots @orchid horizon

gilded plankBOT
#
Akira#4587
Bots

@mint hawk dblCertified
@smoky tree dblCertified
@half lichen
@buoyant lance

topaz fjord
#

So many bots

#

Am scared

orchid horizon
#

eh

elder rapids
#

AekaBot Offline ๐Ÿ‘€

orchid horizon
#

shh

topaz fjord
#

Wut if they do a random check

orchid horizon
#

let's hope they don't I guess

#

but it wouldn't be removed automatically, just a warning at first right?

elder rapids
bitter sundial
#

-bots @orchid horizon

elder rapids
#

They won't warn you for that

gilded plankBOT
#
Akira#4587
Bots <:dblCertifiedDev:401725450470031362>

@mint hawk dblCertified
@smoky tree dblCertified
@half lichen
@buoyant lance

orchid horizon
#

ah

#

thankee tonkku

topaz fjord
#

Tonky to the rescue

solid cliff
#

How wud I get total server count between multiple instances

restive silo
#

lang/lib

#

๐Ÿ‘€

solid cliff
#

Py rewrite mm

abstract crystal
#

len(bot.guilds) should do

solid cliff
#

that gets the instances guilds notLikeMiya

abstract crystal
#

welp then maybe make an api and send count there

native narwhal
#

Create a set and add all the guilds to it and then just get the length of it? I don't know ๐Ÿ˜‚

abstract crystal
inner jewel
#

doesn't work for big bots btw

abstract crystal
#

^ also that

inner jewel
#

i'd just save each shard's count in a database

restive silo
#

wait does d.py sharding not have a method to get stats on all shards eyesThink

inner jewel
#

easier and faster

#

no need to get all guilds each time you want to check

solid cliff
#

okai

abstract crystal
#

d.py gets all servers from all shards with len(bot.guilds), but I'm guessing (haven't tried it) that if you have separate instances of the bot it doesn't

#

did you use the token that was provided by DBL or the token of your bot?

#

@lilac owl

lilac owl
#

im moving my question to the API room lol, didnt see that

#

yes I am using the token

abstract crystal
#

๐Ÿ‘Œ

native narwhal
#

Which token ๐Ÿ˜‚ DBL's or Discord's? @lilac owl

lilac owl
#

DBL

#

when I run the post_server_count() method

#

you can see my code here

native narwhal
#

Did you try using any other method?

lilac owl
#

no, just that one (since its the only one my bot will be using)

native narwhal
#

Try as in to see if it is a problem with that method or maybe the token

abstract crystal
#

do you have postman, if you have, try it there

lilac owl
#

I have Insomnia, basically the same thing

#

lemme try hold on

#

whats an example of a request I need auth for?

native narwhal
lilac owl
#

doesen't require auth ๐Ÿคท

native narwhal
#

Does it not ๐Ÿ‘€

abstract crystal
#

@lilac owl you want /bot/{botid}/stats

#

and do a post request

native narwhal
#

Is post /bots/{bot.id?}/stats the only thing that requires authentication ๐Ÿ‘€

lilac owl
#

it wants a server_count parameter

abstract crystal
#

^ look up

lilac owl
#

it works fine ๐Ÿคท

abstract crystal
lilac owl
abstract crystal
#

huh, then it must be something with your token in the bot, maybe try printing it out and checking

#

or just the lib went bust, which is bad

lilac owl
#

lemme check

#

yep looks like the token is fine

abstract crystal
#

yikes maybe try another lib

lilac owl
#

are there any others?

low wasp
#

Just going to tell people now

i had issues using snekfetch to post/get stuff from DBL

i moved to okhttp (https://www.npmjs.com/package/okhttp) and that fixed the error of 403

not sure there is a python version.

abstract crystal
#

well (only thing and) the thing that works is aiohttp

verbal night
#

which language? @lilac owl

lilac owl
#

Python

#

you can see my code here

#

that deals with the dbl stuff

verbal night
#

lemme look around for ya