#development

1 messages · Page 1703 of 1

opal plank
#

not unless its sent

#

most payloads sent by the ws only inlcude id

#

no a guild object

earnest phoenix
#

It only updates if it has that intent, it updates on connecting to the gateway and receiving a guild payload if it doesn't have it

#

Ecks dee

lament rock
#

ye

cinder patio
#

guild delete sends an entirw guils object?

opal plank
#

so unless you recieved an event with an updated count, or your lib adds them dynamically based on your events, you wont get an accurate count

#

i think it might feud

#

let me check

cinder patio
#

I doubt it

crimson vapor
#

I think it doesn;'t

lament rock
#

GUILD_DELETE only returns { id: string, unavailable: boolean }

quartz kindle
#

channel delete does tho

#

for some reason

earnest phoenix
#

hey feud you once said you can use discord api with an http server instead of weebsocket

#

i cant find any docs on that

lament rock
#

slash commands

cinder patio
#

It should be in the slash commands section

lament rock
#

no ws required for slash commands

quartz kindle
#

slash commands work via webhooks

earnest phoenix
quartz kindle
earnest phoenix
#

ight

#

might think bout adding that in v0.2.0

#

because ive spent too long on this bs

opal plank
#

yeah its only GUILD_CREATE as far as i can tell that includes the member_count with the payload

#

so it wouldnt update until a guild is unavailable

lament rock
#

getting an invite by rest gives an approximate_member_count which is good enough tbh

opal plank
#

whiuch would trigger another GUILD_CREATE payload when it comes back online

#

though making invites/fetching invites could potentially be bad too

lament rock
#

yeah

earnest phoenix
opal plank
#

im always wary of bots making invites

quartz kindle
#

because it may change at any time

lament rock
#

it's changed before when Discord changed their domain

opal plank
lament rock
#

although that already required a base url change for libs anyways

earnest phoenix
#

service outage?

#

moment

#

they mentioned smth bout that there

opal plank
#

that too

quartz kindle
#

its also possible that discord might have thought about load balancing it across geolocations but just never implemented it

vivid fulcrum
#

basically keeping you up to date with the gateway versions

opal plank
#

did it do v7?

#

or was it v6 the skipped one?

vivid fulcrum
#

but that's basically useless because if you go up a gateway version something is granted to break

lament rock
#

v7 didn't exist

#

v7 linked to v6

vivid fulcrum
#

good point

opal plank
#

its 7, yeah

quartz kindle
#

we dont talk about v7

#

:^)

opal plank
#

its like windows 9

lament rock
#

v8 is funny js number

earnest phoenix
#

Forbidden API version

quartz kindle
earnest phoenix
vivid fulcrum
#

wasn't it because internally it was all a mess

earnest phoenix
lament rock
#

guild_subscriptions moment

opal plank
#

funfact

vivid fulcrum
#

and it got fucked up with adding the games thing and removing it a few months later

opal plank
#

i actually got some unique errors

earnest phoenix
vivid fulcrum
opal plank
quartz kindle
#

guild_subscriptions was cool

#

started using it before djslight became a thing

opal plank
#

i managed to get 500's from discord

earnest phoenix
opal plank
#

indeed

earnest phoenix
lament rock
#

predecessor to intents. It was a step in the right direction, but it's deprecated now

opal plank
#

those are rate

earnest phoenix
#

rate

earnest phoenix
opal plank
#

shush

vivid fulcrum
#

rare

opal plank
#

typo

vivid fulcrum
#

it happens every week

earnest phoenix
opal plank
#

they say its rate

#

FUCK

#

ing

#

keyboard

#

argh

#

raRe

#

there

vivid fulcrum
#

remember when quarantine first started and discord was not ready for that big of an influx

earnest phoenix
#

I have seen that exact error in discord.js support server like 500 times

vivid fulcrum
#

so the api kept going down every other day

earnest phoenix
opal plank
#

cry

#

thats bullshit

lament rock
#

ShitServerException

opal plank
#

discord was crashing a lot earlier than that

earnest phoenix
#

I’m api banned from my welcome message so when they view my bot it will be offline

lament rock
#

PogYou

earnest phoenix
#

Gotta love how discord API throws an internal server error if you didn't send an object payload when banning someone

#

hmm yes, very good

quartz kindle
#

lmao

vivid fulcrum
#

fun fact

lament rock
#

I didn't know DELETE /guilds/:guild_id/members/:id required a body

vivid fulcrum
#

the gateway is so fucked and messed up that user tokens now have 2 ready events! one is READY and the other is READY_SUPPLEMENTAL that fills objects sent in READY

quartz kindle
#

wat

lament rock
#

What the fuck

quartz kindle
#

since when

earnest phoenix
vivid fulcrum
#

a few months

#

sec

lament rock
#

Oh. payload_json basically

vivid fulcrum
#

this is totally not my own screenshot

earnest phoenix
#

Bruh

quartz kindle
#

but

#

is that in the app?

lament rock
#

Guess it's just to fuck with client mods or other client implementations

opal plank
#

butt

vivid fulcrum
#

yes

quartz kindle
#

or in the api?

#

ah

vivid fulcrum
#

the client uses v8

quartz kindle
#

but the api doesnt have that

lament rock
#

Pretty sure they said not all official clients use v8 yet

quartz kindle
#

even in v8

vivid fulcrum
#

yeah

quartz kindle
#

so its an app only thing

vivid fulcrum
#

it's a user-exclusive event

earnest phoenix
#

Imagine if the client used v6 when they recommended v8

lament rock
#

Wouldn't be surprised

quartz kindle
#

it makes sense tho

vivid fulcrum
#

the client used v8 wayyyyyyyy before v8 was even publicly out

lament rock
#

They delayed forced v6 deprecation because not all official clients updated

vivid fulcrum
#

because of video streaming

opal plank
#

didnt cry tell you like, 10m ago?

crimson vapor
#

no one has helped you, please stop spamming that @mellow kayak

earnest phoenix
#

You asked that like 15 times now

vivid fulcrum
earnest phoenix
#

Kuuhaku did

opal plank
#

@mellow kayak ^^

vivid fulcrum
#

you already got told what and why, if you don't understand what that code snippet does, take a step back and learn python first

#

ok

#

i'm not lol

earnest phoenix
#

Man, centering text inside a rectangle in canvas is so much pain

vivid fulcrum
#

✨ imagemagick ✨

#

not at all

opal plank
#

just {text-align: center} bruh

lament rock
#

I tried using sharp to replace jimp and loading custom fonts was virtually impossible

earnest phoenix
vivid fulcrum
#

i interoped imagemagick in my old bot to generate images

#

super quick and painless

opal plank
#

in keyword should allow for that

lament rock
#

I need to switch to a native dep at some point, because jimp kinda sucks

opal plank
#

but thats py, not js, so its not my area

#

you welcome, i guess?

#

well time for booze for pain supressing!

#

actually

#

i cant

#

meds

#

fuck

opal plank
#

frick

quartz kindle
#

fork

round quiver
#

frock

umbral zealot
#

frak this.

round quiver
quartz kindle
#

fek

strong oak
#

How do I get rich precense on Replit

pallid garden
#

👀

strong oak
#

??

pallid garden
#

One way get rich doing youtube

strong oak
#

no

#

discord rich precense

rose warren
strong oak
#

i use replit

rose warren
#

That's a host not a lib

lament rock
#

bots accounts cant have rich presences

strong oak
#

i want one!!!

lament rock
#

Look at Discord's docs for the Game SDK or try and find some software that gives you options for one to run on your own computer

strong oak
#

i use replit

rose warren
#

Yeah bots can't have rich presences but you can have one on your own account (see my profile)

lament rock
#

the software that integrates with Discord's Game SDK has to be on the same machine as the Discord you're logged into with. So, it has to be on your PC

strong oak
#

i want one

shy turret
#

how would you detect if a text starts with an emoji (browser/plain js, not nodejs)

strong oak
#

i dont have one

#

i have a macbook pro

west falcon
#

adopted kids

strong oak
#

15 inch

#

i5

#

16gb ram

lament rock
strong oak
#

and 8gb vram

rose warren
shy turret
#

not discord bots, i mean plain js

lament rock
#

yes

strong oak
#

???

lament rock
#

the same methods apply

hard pasture
shy turret
#

whats the regex i suck at regex

rose warren
lament rock
#

look it up

strong oak
lament rock
#

if you're not gonna be on 24/7, then there's no need to host something 24/7

strong oak
#

ok gtg

rose warren
# strong oak i cant host 24/7

It's a separate process to your bot. Rich presence is a totally different thing. My bot is on a VPS. This rich presence is just a single file of code that runs on node in my terminal on my laptop.

#

@strong oak DM me. I'll send you the file when I get a chance

shy turret
#

screams at google

rose warren
shy turret
#

yah im doing stuff with

/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/gi
#

but im trying to do a startsWith instead

rose warren
#

I'd probably split the string into an array and check the first element

steep drum
#

startsWith takes a string? Not a regex

lament rock
#

in the expression, you can put a ^ before the (\u00a9

#

/^(\w+) ?/ matches the first word of a sentence because of the ^
/(\w+)$/ matches the last word of a sentence because of the $

lament rock
steep drum
#

I'm aware, but it sounded like they said they were supplying startsWith with a regex

lament rock
#

ah

earnest phoenix
#

you must have how many GB minimum for a music / radio bot ?

shy turret
vivid fulcrum
#

best is to run benchmarks locally

#

and calculate an approximation

lament rock
#

I manage over 3.5K guilds with roughly 1GB

#

closer towards 4k

#

It's not recommended to actively seek out and make a music bot, though because it's too competitive and requires very frequent maintenance

#

YouTube banning IPs if they request "too much" also doesn't help

earnest phoenix
#

x/

unreal estuary
#

i recently installed java on my pc and im trying to run a java file but it says javac is not recognized blah blah

lament rock
#

the main command is just java

unreal estuary
#

so how do i run a java file?

vivid fulcrum
#

also, with a lot of jdk distributions you need to add it to your PATH

unreal estuary
#

yeah i tried that

#

i followed most of these answers

vivid fulcrum
#

well

unreal estuary
#

LOL 1 sec

#

omg

lament rock
#

if java is indeed added to your path, you would just do java -jar file.jar where you replace file.jar with the file name

shy turret
# shy turret yah im doing stuff with ``` /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff...
let regex = /[\u{1f300}-\u{1f5ff}\u{1f900}-\u{1f9ff}\u{1f600}-\u{1f64f}\u{1f680}-\u{1f6ff}\u{2600}-\u{26ff}\u{2700}-\u{27bf}\u{1f1e6}-\u{1f1ff}\u{1f191}-\u{1f251}\u{1f004}\u{1f0cf}\u{1f170}-\u{1f171}\u{1f17e}-\u{1f17f}\u{1f18e}\u{3030}\u{2b50}\u{2b55}\u{2934}-\u{2935}\u{2b05}-\u{2b07}\u{2b1b}-\u{2b1c}\u{3297}\u{3299}\u{303d}\u{00a9}\u{00ae}\u{2122}\u{23f3}\u{24c2}\u{23e9}-\u{23ef}\u{25b6}\u{23f8}-\u{23fa}\u{200d}]*/ug;

I hate regex ok kthx google cya

vivid fulcrum
#

protip

#

download the json file, parse it locally, boom

lament rock
#

Regex is fun. I made a way to have native relative path resolution from node_modules exported functions using Error stack frames and regex

unreal estuary
#

oh no still not working

pallid garden
#

Someone need make game bot

#

lol

#

Like tetris

umbral zealot
#

Lol no

lament rock
#

tetris wouldn't work in Discord. Text based games come far and few

vivid fulcrum
#

at 1 fps!
per channel!

pallid garden
#

LOL

#

Poketwo a game as well

umbral zealot
#

Technically 5FPS but only if you want to risk being banned for rate limits

pallid garden
#

Catching pokemon

umbral zealot
#

So just like poketwo

#

What you're saying is someone already did it.

pallid garden
#

Yeah poketwo got more views

#

You can see it in top gg

umbral zealot
#

Yeah I'm aware

#

Did you have a development question?

pallid garden
#

Not i know just saying some one will make cool tetris game in discord bot that be neat

umbral zealot
#

Go do it yourself then.

pallid garden
#

Sorry cant code not smart enough

#

I do love games.

unreal estuary
#

i dont think im smart enough to be coding

umbral zealot
#

Ah well that's a shame then, no one's going to make this super awesome cool bot that's impossible but you, the layman, thinks can be done.

#

We must not be smart enough either to know how.

pallid garden
#

If someone good at coding they will some are smart.

forest snow
#

Hola

unreal estuary
#

i think im slighty less than average at coding

lament rock
#

The problem isn't: "no one is smart enough to do it"
The problem is: "It's impractical. It can be done, but it won't be user friendly at all"

unreal estuary
#

maybe alot

umbral zealot
#

Exactly, Ophidian

#

It would be utter shit

#

So no one smart enough to do it is dumb enough to do it.

pallid garden
#

Like patrick star he smart

#

lol

outer zenith
#

how are yall on this fine monday

lament rock
#

waiting for Discord to actually allow bots to seem native like a mockup they showed when they announced verification

outer zenith
#

my server is still stuck in verification 😭

pallid garden
#

Why

outer zenith
#

because theres a backlog

pallid garden
#

Its asking you put a number?

lament rock
#

true™️

pallid garden
#

@outer zenith

vivid fulcrum
#

or if they do manage to implement it, it won't live up to its expectations

#

just like slash commands

outer zenith
pallid garden
#

verification

outer zenith
#

why would it be in number

#

not server sry

#

bot*

pallid garden
#

Oh

lament rock
#

custom html would be cool. If they could at least sandbox it, have devs create their own UIs

#

not likely

pallid garden
#

Flash player is dead rip

lament rock
#

but a guy can dream

pallid garden
#

Love new html 5

lament rock
#

"new"

pallid garden
#

Like you playing a duelingbook website

pallid garden
#

They use to have flash player not no more

vivid fulcrum
lament rock
pallid garden
#

Adobe not making flash player

#

They still have shockwave

vivid fulcrum
#

there's a way to kind of "fake" custom UI elements

#

make your UI element an image, split it into custom emojis

#

hyperlink it in an embed description

#

this works on desktop

pallid garden
#

Java not bad for playing runescape

vivid fulcrum
#

on mobile the emojis just don't render at all

#

shows up as raw format

lament rock
#

mobile UIs aren't great

#

Even making embeds mobile compatible isn't fun

vivid fulcrum
#

this

#

the mobile app doesn't utilize screen space properly at all

lament rock
#

this embed used to extend further, but the bar would take multiple lines on mobile. Now it just fits

#

A little bit more painful for desktop users, but the experience is uniform across platforms

vivid fulcrum
#

that inconsistency in spacing is what made me just transfer all of my stats commands and stuff to image generation on my old bot

#

sure the performance suffered a bit

#

but it was worth it

lament rock
#

Might do that myself tbh, although the problem then becomes asset crunching for people on slower connections

#

Also, if you have to edit the message. Pain ensues

vivid fulcrum
#

good point

#

there's a way to also cicrumvent that, kind of? it's nasty but it works; upload the image elsewhere, return the attachment url, set it as embed image url

lament rock
#

yeah. That's what I did when I tried to make a game of sorts and have custom UI, but it sucked so badly. Clean up was also a chore and just bleh

lyric mountain
pallid garden
#

No

#

I never drink not your business

#

Stop saying that.

lyric mountain
#

...it's the first time I said

#

it's just that you've been there for about 30 min saying random things about flash and stuff

vivid fulcrum
#

sorry, not all bot developers

#

if you're mee6 or groovy, we love you

#

the rest can go fuck yourselves

lyric mountain
#

mee6 owns 60% of discord

vivid fulcrum
#

naur bc remember the bots tab in the guild settings?

#

they didn't have plans to make it dynamic

#

a static list of 4 bots

#

2 of which were from discord employees

#

and the 2 others were mee6 and groovy

#

favouritism at its finest

#

they don't care about bot developers

pallid garden
#

I heard microsoft bought discord

vivid fulcrum
#

they didn't

#

discord wants microsoft to buy them

pallid garden
#

I saw google news

lyric mountain
#

boogle news

vivid fulcrum
#

imagine not getting your news from techquickie

lament rock
#

it's fake news

#

and lol

vivid fulcrum
#

also

#

discord started sponsoring youtubers??

#

what's up with that

lament rock
#

They haven't been bought yet because Discord is not profitable at all

vivid fulcrum
#

plus if ms bought discord it would be mega awkward

#

3 apps that have the same goal

#

skype, teams, discord

pallid garden
#

I allow post link?

#

Ign news

vivid fulcrum
outer zenith
pallid garden
#

Ign never lie

lament rock
#

could

vivid fulcrum
#

bro are you blind

lament rock
#

not that they have

pallid garden
#

I know what they say could

#

Microsoft rich

#

And Amazon

#

Nintendo rich as well.

#

Because people buy nintendo switch

umbral zealot
#

I think someone is confusing this channel with #general

earnest phoenix
#

I struggle to answer the bot verification questions (Data Collection) x/

zenith terrace
#

guild id, userid, channel id, usernames, guild names, channel names etc

earnest phoenix
#

AHH ok

#

and the question "WHAT SYSTEMS AND INFRASTRUCTURE DO YOU USE?"

#

is if I do Js python ect ..?

vivid fulcrum
#

you don't have to shout :(

#

but yes and no

#

describe your infrastructure

#

what library your bot is using, where it's hosted etc.

#

things like that

earnest phoenix
earnest phoenix
#

I still have these 2 questions
"DOES YOUR APPLICATION UTILIZE OTHER THIRD-PARTY AUTH SERVICES OR CONNECTIONS? IF SO, WHICH, AND WHY?"
"WHAT IS THE PROCESS FOR USERS TO REQUEST DELETION OF THEIR DATA?"

sorry to bother you but I'm not very good in English x/

lyric mountain
#

right click + translate page

midnight pulsar
#

How does a bot retain from cache refresh? Ok i know that seems odd but iv seen emoji bots change their names to the user including avatar and post a message to only revert back and it stays.

vivid fulcrum
#

that's a webhook

earnest phoenix
#

it's the one that I didn't understand
"DOES YOUR APPLICATION UTILIZE OTHER THIRD-PARTY AUTH SERVICES OR CONNECTIONS? IF SO, WHICH, AND WHY?"

midnight pulsar
#

@vivid fulcrum appreciated the reponse, can you expand at all?

slender linden
#

does anyone know how to make a discord bot in .net 5 C#?

#

if so, can you help me? or direct me to the docs

slender linden
#

thanks

midnight pulsar
#

ha just on that

vivid fulcrum
#

related info: webhooks can change their username and avatar on any message creation

#

the discord client shows the webhook as a bot but it isn't actually a bot... or a user in the first place

midnight pulsar
#

appreciated. reading that part. would have never know its a webhook

vivid fulcrum
#

if you look carefully, you'll see that webhooks have no hashtag part that normal users do

#

and you can't message them

midnight pulsar
#

hopefully can migrate this into dsharpplus

vivid fulcrum
#

oh yeah dsp has full support for webhooks

midnight pulsar
#

not even looked into their webhook classes

#

wicked

#

cry one last quick silly question. with most things in programming you have a structure. can in send one request with name change, avatrt at once, or does every request have to be single

#

can i *

vivid fulcrum
#

you can do everything in a single request

midnight pulsar
#

coz i often get ratelimit which no one wants

slender linden
#

@vivid fulcrum u got any docs on C# .net 5 discord bot?

lyric mountain
#

like, you're supposed to understando what that means by now

#

that said, I really think discord verification should be about 500 servers or so

#

75 is too little to grasp the concepts about such stuff

onyx hare
#

how do i get my bot to prompt if a user enters a command thats not registered (Hey User you have tried to use a invalid command), i tried google but got "how to blacklist someone from using commands with quick.db"

vivid fulcrum
#

don't

#

unknown command messages are a horrible practice

onyx hare
#

oh

vivid fulcrum
#

if your user attempted to use an unknown command just don't respond

#

the user will know that the command doesn't exist because there's no feedback

#

and you save yourself a request, preventing a ratelimit in the long run

onyx hare
#

i do have one problem, been a problem ive overlooked when my unban command is used it unbans but doesnt send the unban message

tacit sequoia
#

Unban message?

onyx hare
#

this is what it looks like, the unban message never triggers

exports.run = async (client, message, args) => {
  if (command.guildOnly && message.channel.type === 'dm') {
    return message.reply('I can\'t execute that command inside DMs!');
  }
  if (message.member.hasPermission('ADMINISTRATOR')) {
        return message.channel.send(`**${message.author.username}**, You do not have permissions to unban someone`)
      }
      
      if(message.guild.me.hasPermission("BAN_MEMBERS")) {
        return message.channel.send(`**${message.author.username}**, I do not have permissions to unban someone`)
      }
      
      let userID = args[0]
        message.guild.fetchBans().then(bans=> {
        if(bans.size == 0) return 
        let bUser = bans.find(b => b.user.id == userID)
        if(!bUser) return
        message.guild.members.unban(bUser.user)
        if(unban)
        return message.channel.send(`**${message.author.username}**, I have unbanned the target user`)   
  })
};
exports.conf = {
  enabled: true,
  guildOnly: true
};
vivid fulcrum
#

if(unban) but you don't have a variable named unban anywhere?

odd stratus
#

What is unban defined as thinking_2

onyx hare
tacit sequoia
#

Is it even triggered, lol

onyx hare
onyx hare
vivid fulcrum
#

you return the unban promise

onyx hare
#

but now thinking of it if i just remove the if(unban) return it should catch onto the section above right?

vivid fulcrum
#

if(!bUser) this also seems incorrect

#

if it's not defined, unban

#

you're supposed to check if it's defined, unban

#
if(bUser)
{
  try {
    await unban;
    return send();
  }
  catch {
    //god knows what happened here
    return send();
  }
}
//bUser not defined here, user probably not banned?
tacit sequoia
#

Would y'all suggest using Windows or Linux to host your bot? I'm more used to Windows, never used Linux but it's cheaper

winged linden
#

Linux

#

Its simple when u get used to it

tacit sequoia
#

K, thanks

midnight pulsar
#

what a fucking update

#

eevne

#

here we go sorting out over 500 errors

#

nice one

odd stratus
lyric mountain
#

It's too complacent

#

That IF won't error because non-defined variables are falsey

earnest phoenix
#

How to log who used command in js

sudden geyser
#

Nah, the non-defined variable would error.

sudden geyser
lyric mountain
#

Or if you don't want long term storage, just console.log it

earnest phoenix
#

I'll send in log channel insted

#

console.log(${message.author.name} just used example command)

lyric mountain
#

I hope you don't mean "log ALL command usages"

#

Cuz you'd kill your bot quite quickly that way

earnest phoenix
#

how?

lyric mountain
#

Api ratelimit

#

You'd be nuking the discord api

earnest phoenix
#

I wanted to log only one command

lyric mountain
#

Still

sudden geyser
#

I recommend you avoid using Discord as a logging service.

earnest phoenix
#

So which should I use?

lyric mountain
#

Remember, you're not dealing with 10 or 100 users

earnest phoenix
#

Hmm 🧐

sudden geyser
#

You could use a local file or some online service that specializes for logging (or just has good stuff for that)

lyric mountain
#

You're dealing with tens of thousands or even hundred of thousands of potential users

earnest phoenix
#

Right

lyric mountain
#

Imagine if all use the command at the same time

broken matrix
sudden geyser
#

is their bot small

broken matrix
#

yes

lyric mountain
sudden geyser
#

You can use a channel for logging errors, but I personally recommend you don't

lyric mountain
#

What starts in a server ends in that server

broken matrix
#

Thats what i want to do

#

i only get 5 errors an hours (small bot)

lyric mountain
#

Small bot YET

sudden geyser
#

try going for 0 errors a month

broken matrix
#

look man im looking how to do it not if its a bad ide

#

idea

sudden geyser
#

bonus points if you go a year without errors

#

reward cookie

tacit sequoia
sudden geyser
#

This could be you!

tacit sequoia
#

Simply deleting a bot message after sending it results in an error when it's only deleted once

broken matrix
#

what bot are you running lmao

tacit sequoia
#

My twisted logic lol

broken matrix
#

lmao

tacit sequoia
#

Need to fix it 😭

lyric mountain
broken matrix
#

my server staff would like to be able to see errors

lyric mountain
#

Again, if it's per-server error logging it's fine, but don't try to make it N-to-one

tacit sequoia
lyric mountain
#

Check if a message exists before using the object

broken matrix
#

@tacit sequoia can you send me the code i cant find anything online for it

lyric mountain
#

Dont

broken matrix
#

can you not

tacit sequoia
#

It's just using discord.js webhook client

broken matrix
#

ahh

tacit sequoia
#

Set debug webhook token & id in config

#

¯\_(ツ)_/¯

#

Send any errors there

lyric mountain
#

You can't spoonfeed, that's why I said "dont"

tacit sequoia
#

Didnt spoon feed

lyric mountain
#

Would be happy to explain tho, but you didn't ask for it

#

Ik you didn't

tacit sequoia
#

Probably something I did wrong anyway which has some simple fix I havent though of

lyric mountain
#

You could also .catch it

tacit sequoia
#

And tell it not to throw an error? Wouldnt that be really messy

lyric mountain
#

Honestly, "unknown message" errors are as useful as dry hay

#

Log them at debug level if you must

tacit sequoia
#

Yeah

vast garnet
#

Hello, I do not send the Vote Message that I Set to the Value I Registered in the DataBase in the @ top-gg/sdk Module. So how do I set it?

#

Sorry, I'm Using Translator Maybe Wrong

waxen bough
#
      AccitroClient.on('typingStart', async (Next, EndChannel, EndUser) => {
        if (EndChannel.type !== 'dm') return Next(true)
        const End = this.ADMClient.Users[EndUser.id]

        if (!(End && End.OtherEnd)) return Next(true)
        const OtherEnd = End.OtherEnd
        const OtherEndChannel = OtherEnd.DiscordUser.dmChannel || await OtherEnd.DiscordUser.createDM().catch()

        if (OtherEndChannel) {
          await OtherEndChannel.startTyping().catch(() => {})
          await Sleep(5000)
          await OtherEndChannel.stopTyping()
        };

        Next(false)
      })
#

my bot won't stop typing

#

i waited about 30s

#

a minute has passed still typing

#

there's no typingStop event either

unique panther
#

My ban command wont work its showing a syntax error (discord.py)
@client.command(aliases = ["b"]) @commands.has_permissions(ban_members = True) async def ban(ctx,member : discord.Member,*,reason = "No Reason Provided"): await ctx.send(member.name + "Has been banned") await member.ban(reason = reason)

waxen bough
lyric mountain
#

What's your main language?

vast garnet
#

turkey @lyric mountain

round quiver
vast garnet
#

Turkey, Turkish ?

slender thistle
#

And send the traceback

earnest phoenix
#

hi

#

i'm new at webhooks and need a little help

#

do i run both the webhook and server together or are they separate

vast garnet
#

Hello, I do not send the Vote Message that I Set to the Value I Registered in the DataBase in the @top-gg/sdk Module. So how do I set it?
Sorry, I'm Using Translator Maybe Wrong

old cliff
#

how do I add a cooldown blacklist?
for example if a person spams a command cooldown for too long he will get blacklisted for 1 hour

long crow
#

Well, if you using javascript. You can use map or set or much better discordjs collection

vagrant prairie
#

@dry sapphire why u left me?

rose warren
#

Quick question about sharding. When it comes time to need to spawn a new shard, do I have to restart my bot for it to spawn or will djs do it automatically?

#

The only times I've noticed it created a new shard is when I've restarted it in the past.

#

I was just wondering if I left it alone would it handle the new shard creation by itself.

steel wedge
rose warren
#

Then please don't ping me lol

odd stratus
#

So yeah you pretty much gotta restart the bot I guess

#

I was stuck at 8 shards for a while and then restarted and it went to 11

rose warren
#

Yeah I've got the same settings and noticed the same thing. I guess having a shard that's "too full" isn't so bad then.

odd stratus
#

Yeah. I only restart nowadays if it’s a new feature being added or bug fix

#

I noticed it’s about 1 shard per 1k servers and it doesn’t seem to give any issues of being overloaded or anything

rose warren
#

I noticed auto typically allows for shards between 955 and 1,100 servers each

pale vessel
#

pardon?

#

What do you mean by "cookie manage"?

vagrant prairie
#

anyone wanna be a dev with my bot?

pale vessel
#

ask somewhere else

vagrant prairie
#

Oh ok....

lunar patio
#

I need my bot to send a reply if I use !cd with I'll remind you in 1m.. Then, after 1 minute, it replies with your cooldown is over..

cinder patio
#

okay, and?

lunar patio
#

that's it

long crow
#

What is your language?

cinder patio
#

you want us to write the code for you?

#

Get outta here

lunar patio
long crow
#

Cant help then, if it jajvascript can use map/set

warped swallow
#

Who can help me with bdfd?

long crow
rustic hamlet
#

we all love the snake

earnest phoenix
#

Is there a api wrapper for discord servers in python?

umbral zealot
#

"for discord servers" do you mean for bots?

earnest phoenix
#

no for discord servers

#

like not DBL

#

DSL

cinder patio
#

There isn't a top.gg api for servers

lusty quest
#

i think webhooks work for servers

earnest phoenix
#

we only have dsl roles

near stratus
rocky fossil
#

I m sure they have some limitations over scraping

feral perch
#

hey does anyone know the parameter to fetch the yt thumbnail with yt-search?

viscid prairie
#

Does the Discord User ID have the same number of digits?

pale vessel
#

Nope

viscid prairie
#

oww :(

#

thanks

tacit sequoia
drifting cairn
#

have i done something wrong? because it doesnt seem to be working

feral perch
#

hey does anyone know the string for thumbnail in ytdl core

quartz kindle
drifting cairn
quartz kindle
#

use the dev tools to see what classes are on the description

earnest phoenix
#

How to send message to another channel from eval?

quartz kindle
#

get the channel and send

empty pond
#

what to write in webhook url on top.gg

quartz kindle
#

your bots ip address or hosting url

earnest phoenix
empty pond
#

@quartz kindle how to get hosting url ?

earnest phoenix
#

Is it correct

quartz kindle
quartz kindle
empty pond
#

@quartz kindle heroku

quartz kindle
#

and your webhook port must be set to 3000

earnest phoenix
drifting cairn
#

what would i do if mine is hosted on aws? @quartz kindle

quartz kindle
#

channels.cache.get

#

not channel.get

earnest phoenix
#

o

quartz kindle
drifting cairn
#

public or private?

quartz kindle
#

public

drifting cairn
#

ok ty

empty pond
#
const Topgg = require("@top-gg/sdk");
const express = require("express");

const bot = new Discord.Client();
const topgg = new Topgg.Api("topgg-bot-token");
const webhook = new Topgg.Webhook("topgg1234");
const app = express();

bot.on("ready", () => {
    console.log("ready")
})

app.get("/", (req, res) => {
    res.send("pinging");
});

// const ap = AutoPoster('topgg-bot-token', bot); // your discord.js or eris client

bot.on("message", async(message) => {
    if(message.content.startsWith("!test")) {
        let voted = await topgg.hasVoted(message.author.id)
        if(!voted) {
            return message.channel.send("You have not voted me")
        }
        else{
            return message.channel.send("You have Voted Me")
        }
    }
})

app.post("/dblwebhook", webhook.middleware(), (req, res) => {
    // req.vote will be your vote object, e.g
    console.log(req.vote.username); // 395526710101278721 < user who voted
    client.cache.channels.get("820659008620593213").send("req.vote.username just voted me.")
});

app.listen(3000);

bot.login("bot-token")```
@quartz kindle will this work on test vote?
flat oak
#

Anyone using dblpy webhook votes here

#

?

quartz kindle
#

you have to add /dblwebhook to your url

empty pond
#

where to add /dblwebhook

quartz kindle
#

end of url

empty pond
#

Ok after .co/

quartz kindle
#

yes

earnest phoenix
drifting cairn
#

so for the webhook thing if im using aws do i put it like this IP:PORT/dblwebhook?

quartz kindle
earnest phoenix
earnest phoenix
crimson vapor
#

Hi Tim

quartz kindle
earnest phoenix
#

Oh

#

5000 means it's money

empty pond
#

@quartz kindle how to get username instead of id i tried req.vote.username but undefined came

quartz kindle
#

console.log req.vote

#

and see if there is a username there

#

if not, you have to fetch the user

earnest phoenix
#

I think it should be req.vote.user.username?

quartz kindle
#

vote.user is an id, so no

empty pond
earnest phoenix
#

Bro i just realized we are in an incorrect channel.

empty pond
#

There no one was replying so i came here

earnest phoenix
#

Ping Tim there

#

He will help

quartz kindle
#

you need to fetch the user

empty pond
#

@quartz kindle how pls tell like this?

bot.members.cache.get?

cinder patio
#

users

#

bot.users

empty pond
#

ok then

#

but wait how

cinder patio
#

Also you should probably fetch it, it's not guaranteed that's in the cache

empty pond
#

req.vote.bot.users.cache.get

#

or something else?

cinder patio
#

...

empty pond
#

lol

#

i am just a slow learner

quartz kindle
#

await bot.users.fetch(req.vote.user)

empty pond
#

ok

cinder patio
#

Are you though...

earnest phoenix
#

How to write out the server region?

#

With javascript

lusty quest
earnest phoenix
#

thx

whole ridge
#

d

marsh vale
#

d

#

d

#

d

#

d

earnest phoenix
#

exports.run = (client, message,args) => {
const Discord= require("discord.js");
const e=new Discord.Guild(client, data);
const server=e.region;
message.channeé.send(server);

}

#

data is not defined

#

:/

sudden geyser
#

Yes it’s not

umbral zealot
#

What are you trying to create a new guild like that

#

like why the heck

#

you can get the guild from message.guild

earnest phoenix
#

i want to write out the server region

#

bruh

umbral zealot
#

yes, get the guild with message.guild

#

then get the region from that

quartz kindle
#

wtf

#

oh

#

he saw the docs page for the guild object

#

and the top of the page has a guild constructor

#

he copied that lmao

tacit sequoia
#

Lol

earnest phoenix
#

yes xd

umbral zealot
#

learnjs moment

earnest phoenix
#

I am too idiot im just copy paste

quartz kindle
#

@-@

umbral zealot
#

Are you actually dumb, as in, lacking the mental fortitude to code, or are you just lacking the experience and knowledge to understand the code?
Because if you're actually just dumb, the only help we can provide in terms of bot coding is "don't code bots, use those that exist".
if you're just lacking experience, then there's a solution and it's "just take the time to learn javascript and you'll be fine".
Most people that say or think they're dumb, it's just because they're rushing into thinks head first and being overwhelmed by a lot of information all at once. Anyone would be!

earnest phoenix
#

I learned javascript bruh

quartz kindle
#

lol

tacit sequoia
#

Oop

umbral zealot
#

You can tell yourself that all you want, the above conversation seem to say otherwise.

tacit sequoia
#

Um

vast garnet
#

Hello, I do not send the Vote Message that I Set to the Value I Registered in the DataBase in the @top-gg/sdk Module. So how do I set it?
Sorry, I'm Using Translator Maybe Wrong

quartz kindle
#

yes, it looks wrong, i dont understand the problem

earnest phoenix
#

hm

#

i hate myself now

#

and this visual studio code too

#

Be confident and don't give up👍

quartz kindle
#

if you know js then its not that hard

#

first of all you have to start with what you have

#

what do you have?

#

a message object

#

so start there, go to the docs, look what a message object has

#

and continue from there

earnest phoenix
#

BRUH

#

const region= message.guild.region;
message.channel.send("A "+region);

#

ok i solved it :v

quartz kindle
#

yes good job :)

jovial nexus
#

HTTPError [FetchError]: request to https://discord.com/api/v7/gateway/bot failed, reason: connect ENETUNREACH - Local (0.0.0.0:0)
    at RequestHandler.execute (/root/bot/node_modules/discord.js/src/rest/RequestHandler.js:93:15)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  code: 500,
  method: 'get',
  path: '/gateway/bot'
}
```what happened here?
earnest phoenix
#

hm

quartz kindle
#

that error means your internet dieded

jovial nexus
#
    at RequestHandler.execute (/root/bot/node_modules/discord.js/src/rest/RequestHandler.js:93:15)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
earnest phoenix
#

How to translate to hungarian word?

jovial nexus
#

so

crimson vapor
earnest phoenix
#

what map?

#

const region= message.guild.region;

if(region=="europe"){
message.channel.send("Régió az európa");

crimson vapor
#

an object keyed with the regions

quartz kindle
#

make an object

#

with english regipns as keys

#

and hungarian regios as values

earnest phoenix
#

o_o

#

i use if() because i understand it

quartz kindle
#

an object is easier

crimson vapor
#

Well now that you know if statements, you should learn objects

earnest phoenix
#

hm

#

I can't find object thing

fleet radish
#

Hey

#

I calc. Member count from cache

#

Is there any way to get better accuracy

crimson vapor
#

Not really ish

fleet radish
#

aah

#

Like almost all bots shoe like perfectly accurate member count

#

mine says 20k

#

For a 55k server

#

now that's huge diff

crimson vapor
#

Not all members are cached

vivid fulcrum
#

^

fleet radish
#

Bruh not all is ok

#

but this is huge lol

crimson vapor
#

reduce each guild to get all memberCount

fleet radish
#

O

#

is there any other way to get memberscount

tacit sequoia
#

Use a for loop(or a foreach) for each guild and add up a member var from there if you really need it using amount of members

fleet radish
#

ohk

#

Wrong ping

tacit sequoia
#

Ok

fleet radish
#

it would yes

#

it would delete channel lmao

#

why would it not

earnest phoenix
fleet radish
#

it would delete teh channel where the message was sent

#

So change ut

#

it

earnest phoenix
tacit sequoia
#

Ya

earnest phoenix
#

yes

#

get the first object

fleet radish
earnest phoenix
#

i.e. .first()

#

a

zenith terrace
#

yes.delete() no?

earnest phoenix
#

idk

tacit sequoia
#

Yes

zenith terrace
#

well try it

earnest phoenix
#

._.

#

i give up bruh

tacit sequoia
#

Ok

earnest phoenix
#

ok

#

Why is that hard to code the delete mentioned channel? bruh

cinder patio
#

bruh

lyric mountain
#

it isn't?

earnest phoenix
#

it is

lyric mountain
#

isn't

earnest phoenix
#

is

cinder patio
#

Stargirl literally gave you the code

#

all you have to do is paste it

lyric mountain
#

look, the issue is that you're literally lost

#

it's a simple collection problem

#

the issue is that you're doing this: message.channel.delete(yes);

#

lemme read that for you

#

"Execute delete function in the channel object from the message object"

#

which can be humanized to "Delete the channel the message was sent in"

#

did you just delete your messages?

cinder patio
#

or you can just say that the delete function is bound to message.channel, which is the channel the command message was sent it

#

that's why you need to get the mentioned channel

earnest phoenix
#

yes because yes

lyric mountain
#

typical behavior

earnest phoenix
#

yikes

#

there was one problem

#

i didn't add () to yes.delete

#

🙃

lyric mountain
#

did you even understand the problem or just copied the answer?

earnest phoenix
#

you didn't even put yes.delete(); in the first place

#

i did in visual studio code

#

wot

#

without this ()

lyric mountain
#

for javascript?

earnest phoenix
#

do you know basic javascript?

#

yes

#

that's a lie

#

sometime i forgot to add () lol

#

you don't know basic javascript

earnest phoenix
lyric mountain
#

that isn't a d.js issue

cinder patio
#

Sigh... anyways

#

I have this array with elements, and each element has a weight and an amount. I'm looking for an efficient way to get N random elements from the array, taking into account the weight and the amount, if an element has an amount of 0 it shouldn't ever be returned by the function

vivid fulcrum
#

filter then randomly select from the filtered array?

#

i don't know what would be more efficient

#

that or re-running rand until you get an element that has > 0 amount

#

ideally you would cache the filtered array

lyric mountain
#

probably the random method is the most efficient

quartz kindle
#

weighted random aint so easy

lyric mountain
#

another way of solving that would be to create weight copies of the object and put in a list

#

then shuffle and get a random element

quartz kindle
#

or join all weights together and math.random a number out of the combined weight

#

and find the item with the matching number

cinder patio
#

^ that's what I'm doing

#

but combining both weighted and with an amount is kinda hard

lyric mountain
#

for amount it's fairly easy tho

#

.filter it

#

anything with amount <= 0 should be filtered out

onyx hare
#

i seriously thought this would work;


exports.run = async (message) => {
    if (!message.member.hasPermission("ADMINISTRATOR")) {
        return message.channel.send(
          "Sorry but you do not have permission to Delete Channels"
        );
      }
    message.react(":firecracker:")
    await message.channel.delete()
  }

err
TypeError: Cannot read property 'hasPermission' of undefined

pale vessel
#

message.member is undefined

#

log message

#

are you sure you have the correct params?

onyx hare
#

i did console.log(message) it didnt do anything when i used the command i might of missed it when it starts up tho

lament rock
#

I thought Message.member was nullable only

cinder patio
#

oh my go

pale vessel
#

they might have client as their first param without realizing

cinder patio
#

I'm never ever extending the Array class

#

ever

lament rock
#

why

cinder patio
#

filter, map and other similar methods return an instance of the class that is extending the Array class, not an instance of an array, and I'm storing some properties on the class, which are undefined when created by the methods

onyx hare
#

i cant go through my console it capped off after loading command kill i cant go further back to find the command @_@

shrewd magnet
#

hi

lament rock
#

You can override the methods to return Arrays

#

or proper return values of extensions of the class

sudden geyser
cinder patio
#

better off just storing the array as a property of the class tbh

#

instead of extending the class

lament rock
#

Then you'd have to implement most or all of Array's methods

cinder patio
#

the class isn't really meant to be used like an array though

onyx hare
sudden geyser
#

Try harder

quartz kindle
#

try harder better faster stronger

sudden geyser
#

Or look for some library that can do it for you

quartz kindle
#

if youre running your bot on windows you can configure the size of the console buffer

#

so you can uncap it

pale vessel
onyx hare
#

i added the fiile write it didnt write, nothing ever wants to work for me -_-

sudden geyser
#

Try, fail, retry, keep repeating step 2-3, succeed

quartz kindle
#

error maximum stack size exceeded

onyx hare
#

is this done right?

const fs = require('fs');
const path = require('path');
exports.run = async (message) => {
    console.log(message)
    if (!message.member.hasPermission("ADMINISTRATOR")) {
        return message.channel.send(
          "Sorry but you do not have permission to Delete Channels"
        );
      }
    message.react(":firecracker:")
    await message.channel.delete()
    fs.writeFileSync(path.resolve(__dirname, '../log/log.json'), JSON.stringify(message));
  }
quartz kindle
#

:^)

sudden geyser
#

Set stack size to -1

quartz kindle
#

100% cpu usage until oom

#

:^)

#

fail retry is an infinite loop

green kestrel
#

yayyyy got voice connection working in my lib 😄 now just gotta actually send some voice data!

zenith terrace
#

nice

cinder patio
quartz kindle
#

voice is so annoying

earnest phoenix
#

true

harsh blade
#

Yo, real quick, how do i check if a message is sent from a specific user (id)

#

discord.js

#

I Have it set per role and its annoying to always make a custom role 😭

cinder patio
harsh blade
cinder patio
#

yeah

harsh blade
#

Ty

onyx hare
#

i got the log to work... well it just logged everything in the guild... but not in the file it logged it on the console

zenith terrace
#

ok

lunar patio
#
await ctx.channel.send(f"{ctx.author.mention}, your cooldown is over!")```
I want use own emoji after over! . how?
lament rock
#

if it's a custom emoji, you use <:name:id>

#

if it's animated, it's <a:name:id>

harsh blade
#

Can i somehow surpress these errors?

umbral zealot
#

catch them

harsh blade
#

How

umbral zealot
#

using .catch() on promises

harsh blade
#

I Dont even know from where the errors come from :e

#

Our previous dev coded the bot

#

he got demoted shortly after

umbral zealot
#

it tells you though

#

literally it tells you the lines, index.js line 321 , index.js line 342...

median rain
#

Hi guys, how do I make top.gg user vote detection with my bot coded with python?

thick nexus
#

how i get a list of all members in all servers my bot is in

vivid fulcrum
#

loop through every guild -> fetch all members from guild -> access your member cache

umbral zealot
#

why would you need a list of all members? how would that be useful?

pale vessel
#

to increase their memory usage ofc

umbral zealot
#

obviously

median rain
#

how to track votes

umbral zealot
brave tendon
#

Which permissions does a bot need for its auto role to send messages?

I have ticked:

SEND_MESSAGES
MANAGE_MESSAGES
READ_MESSAGE_HISTORY
VIEW_CHANNEL

but when I try to enter a command the bot says

UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions

umbral zealot
#

send messages? just SEND_MESSAGES

#

what do you mean by "auto role"?

brave tendon
#

the role the bot creates when it joins a server

umbral zealot
#

Well you'll need MANAGE_ROLES, obviously

thorn seal
#

Hi I'm using discord.net and this piece of code works only if bot has actual administrator privileges

            foreach (SocketTextChannel channel in channels)
            {
                await channel.ModifyAsync(c => 
                {
                    c.SlowModeInterval = interval; 
                });
                await Task.Delay(250);
            }
```Am I doing something wrong? Or it really require admin privileges?
brave tendon
umbral zealot
#

... yes... to give roles you need manage roles...

brave tendon
#

yeah obviously tho 🤦‍♂️

#

but I still get the message with DiscordAPIError: Missing Permissions

rapid wharf
#

how to use more than one member in a command discord.py

near stratus
#

I'm using this code

if(message.member.highestRole.comparePositionTo(message.mentions.members.first().highestRole) > 0){
    //member has higher role then first mentioned member
    if(member.kickable){  //Just in case
        message.mentions.members.first().kick();
    }
}else{
    message.reply("You can't kick your senpai °^°");
}

Now I shouldn't be able to kick some higher ups
But I can kick anyone with higher role than me but when I try to kick Someone lower than me It doesn't do anything (no console no message nothing)

#

now what is wrong with this code

earnest phoenix
#

@median rain you can make a bot work with pure Py but you will not have features like embed ect

median rain
#

Hm ok

earnest phoenix
#

Unless you code your own library which is kinda pointless when DPY is there lol

#

Yeah

#

db.delete (para_$(msg.author.id), 1)
Why is all the money going?

placid meadow
#

finally got my global top10 working 😉

quartz kindle
#

nice

#

ur using a charting module for canvas?

placid meadow
#

wrote the module completely manual

quartz kindle
#

nice

#

thats what i do too

placid meadow
#

@quartz kindle

#

yep 😄

#

i could make them libraries ofc

quartz kindle
#

ye

#

mine is 800 lines long

placid meadow
#

what is? entire?

quartz kindle
#

but its kind of proprietary code im gonna use in future projects

#

the drawing module

placid meadow
#

i have a clock drawing module less then 100 lines 😛

quartz kindle
#

ye mines pretty complex

#

its for drawing astrological charts

placid meadow
#

never go too complex, simplicity is best

#

what lang tim ?

quartz kindle
#

js

placid meadow
#

if u can u could port the clock module? 😛

quartz kindle
#

if you want me to sure i guess xd

placid meadow
#

for your own ofc

quartz kindle
#

this is how my charts look like

placid meadow
#

thats pretty neat

#

how did u do the colors ?

#

i had to utilize the hsl2rgb

#

to get what i wanted

quartz kindle
#

ceverything is done with js canvas

#

the same used in browsers

placid meadow
#

had to write those myself

#
        Public Shared Function GetRaindowBrushes(limit As Integer) As SolidBrush()
            Dim v As Double = 0, inc As Double = 0.01, i As Integer = 0, result As New List(Of SolidBrush)
            If (limit > 0) Then inc = 1 / limit
            While v < 1 And i < limit
                result.Add(New SolidBrush(Colors.Hsl2Rgb(v, 0.5, 0.5).ToColor))
                v += inc
                i += 1
            End While
            Return result.ToArray
        End Function
quartz kindle
#

cool

placid meadow
#

not hard

#

the db design was a bitch tho

#

made a mistake in the base, had to change it later on

#

not wanted to loose the data

eternal osprey
#

hey

placid meadow
#

and a custom comparer, coz dotnet uses a Hashcode from the object that doesnt work with getting the right distinction between users

eternal osprey
#

i don't quite get this:

placid meadow
#

modulus

eternal osprey
#

how can 13 \ 4 equal 1?

placid meadow
#

its not division

#

its the modulo

eternal osprey
#

yeah i understand

#

but what is the modulus

#

what does it do

lament rock
#

it tells you what it does