#development

1 messages ยท Page 1641 of 1

sterile lantern
#

so ig ill have to just

vivid fulcrum
#

no no

sterile lantern
#

omit it from google forms

#

?

lament rock
#

If you wanted a regular expression only, the regular expression would be

data.content.replace(/@([^<>@ ]*)/gsmu, (match, target) => {
    if (target.match(/^[&!]?\d+$/)) {
        return `@${target}`;
    } else {
        return `@\u200b${target}`;
    }
});

If you wanted to use a built in method by Discord, you would add
https://discord.com/developers/docs/resources/channel#allowed-mentions-object to the payload

Discord Developer Portal

Integrate your service with Discord โ€” whether it's a bot or a game or whatever your wildest imagination can come up with.

cinder patio
#

Wait can webhooks even mention anybody?

sterile lantern
#

webhooks can ping everyone

lament rock
#

Yes they can

vivid fulcrum
#

the create message endpoint and executing a webhook have the exact same data parameters

#

the problem is that you're using zapier

#

idk if you can modify the payload

sterile lantern
#

yeah

#

rip

lament rock
#

Then my regular expression would work best

sterile lantern
#

how would i modify the data content in zapier ?

lament rock
#

use the replace method on the string you're sending

sterile lantern
#

this?

data.content.replace(/@([^<>@ ]*)/gsmu, (match, target) => {
    if (target.match(/^[&!]?\d+$/)) {
        return `@${target}`;
    } else {
        return `@\u200b${target}`;
    }
});```
lament rock
#

"poggers".replace("gers", ""); // "pog"

#

That's how replace works. data.content is a string

sterile lantern
#

i just want it to do @/everyone

#

so put / after @

earnest phoenix
#

So, I had a suggestion. Can you please make like a calculation command for the bot?
My idea would be that you type in your stake, the odd and then it automatically calculates the amount of money you earned. You deduct the stake from the money you earned and your profit will be shown. What do you guys think of this? :))

lament rock
#

Then you can make the regex yourself to replace "@" with "@/"

sterile lantern
ruby goblet
#

How do you change the picture of the "game the bot is playing?

sterile lantern
#

im not sure zapier would even take it

earnest phoenix
lament rock
ruby goblet
#

ah

#

ok

earnest phoenix
#

So, I had a suggestion. Can you please make like a calculation command for the bot?
My idea would be that you type in your stake, the odd and then it automatically calculates the amount of money you earned. You deduct the stake from the money you earned and your profit will be shown. What do you guys think of this? :))

This will be for the sports betting function of the discord bot

#

Anyone online here who is the moderator of the bot?

pale vessel
#

Go to their support server?

lone palm
#

Hey, [Java] can someone tell me how to best replace different things in a string? What i do is nonsense

lament rock
#

Chaining is pretty consistent across languages. What you could do to write less is put entries in a List and loop over and mutate the string based on the current entry in the List

thick nexus
#

im trying to get my bot to spit back a gif that you send but it doesnt work for some reason like if the link is weird idk

lament rock
#

Some websites that claim to host gifs might not actually be gifs

thick nexus
#

like this doesnt work

lament rock
#

doesn't tenor host video files

thick nexus
#

does it?

lament rock
thick nexus
#

like some gifs on tenor work

#

if you go

#

and like copy the image

lament rock
#

If you GET the link, what's the response, because Discord does processing on it's own side for link embed previews

thick nexus
#

uhh

pale vessel
#

this is what I had for my image stuff

#

hardcode xd

lament rock
#

checks out to me

thick nexus
#

cuz thats what the gif is rite

lament rock
#

Try flaze's code. You'll have to manually support some websites like tenor and giphy since they don't raw return GIFs by default. You'd have to get the raw url through scraping the body which is HTML

thick nexus
#

o

#

is that in .py lmao

#

im dum

#

hmm

pale vessel
#

you can do the same in py

thick nexus
#

ok

lament rock
#

just gotta ready python docs to see if there is a string index of method

#

then a method to return part of a string between two indexes

vivid fulcrum
#

aren't tenor and giphy protected by cloudflare

#

so there's a high chance you won't get to the site in the first place

pale vessel
#

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

lament rock
#

what does them being backed by cf have to do with anything

pale vessel
#

even so, tenor and giphy both has their API

#

I decided not to use it since I can just scrape

lament rock
#

Mood, but with Spotify

vivid fulcrum
vivid fulcrum
lament rock
#

Ah. Some sites that are backed don't display captchas or anything similar

#

Haven't personally seen tenor or giphy do it either

lyric mountain
#

cf only shows captcha if they find you suspicious

thick nexus
#

im to dum to figure out how to make that work lmao

wintry owl
#

its weird

#

because i just copypasted the style tag

vivid fulcrum
#

maybe the element classes / element order is different

wintry owl
#

that's what i thought, but i tried inspecting the elements and they have the same classes

vivid fulcrum
#

๐Ÿค”

wintry owl
#

i'll try looking again, maybe i'm just being a dum dum

vivid fulcrum
#

i guess it's best to ask a website moderator for this

wintry owl
#

yeah

umbral zealot
#

I don't think the website team members help users fix their custom CSS

#

They're busy, y'know, making the site ๐Ÿ˜›

#

Can you show us your custom CSS?

wintry owl
umbral zealot
#

import ? Thonk

#

that looks like sass

wintry owl
#

i'm importing fonts

umbral zealot
#

oh yeah maybe I'm just wrong lol

#

And you put this in a <style> tag in your bot's long description, same exact place?

wintry owl
#

waiit

#

inspecting the description the style tag doesn't even come up

#

but when it used to work it did

umbral zealot
#

Are you sure?

#

because it's not there...

wintry owl
#

yeah that's what i'm saying

vivid fulcrum
#

can you show what you have in your bot description

wintry owl
umbral zealot
#

I think it has to be at the very top

vivid fulcrum
#

this

umbral zealot
#

literally the first thing

wintry owl
#

but it's weird because it worked before

vivid fulcrum
#

if it still doesn't work, maybe it's just topgg's renderer not allowing mixing html and markdown

wintry owl
#

because i heard they're making some changes

umbral zealot
#

If it was because of changes, it would affect both bots, so no.

wintry owl
#

bruh

#

it works now

#

well, thanks, and sorry for wasting your time

#

but wait

#

hear me out

#

this bot has the style at the end of the description and it works

#

w h y?

zenith terrace
#

logic

umbral zealot
#

I know why, lol

wintry owl
#

that's why

#

:-/

#

i'm just stupid lmao

umbral zealot
#

in markdown, line returns create new "elements"

#

you need another line return there

wintry owl
#

yeah

umbral zealot
#

that's it. just \n in there ๐Ÿ˜„

feral aspen
#

Is there a way the user can mention a user args with ID but not bot.users.cache.get(user.id)?

wintry owl
#

i'm just dumb lol

umbral zealot
feral aspen
#

no like const user = <be able to mention a user with ID>

umbral zealot
#

uhm, no there's no other way than getting it from the user cache, no.

#

is that not working for you?

feral aspen
#

No, like I don't want people to rob other people at the same time, that user is not in the same server.

#

It's like, you know?

umbral zealot
#

No, I don't actually know what you mean

#

If you want to know if a user is on the same server, check their member object instead, maybe?

feral aspen
#

<user> = bot user's cache
!rob <user>
<user> is not in the same server, but does it anyway since it is from cache and not from server

umbral zealot
#

yeah check if they're in that server, instead of relying on just the user

feral aspen
#
if(!bot.guilds.cache.get(message.guild.id).members.cache.get(user.id))
#

?

umbral zealot
#

you don't need to get the guild from cache, you already have a guild

#

that's redundant

#

message.guild is already your guild

feral aspen
#

Ah.

#

Didn't understand how then...

earnest phoenix
#

What is the cheapest but best thing to host a music bot on

umbral zealot
#

There are a number of information on hosting in the pins of this channel

feral aspen
#
if(!(message.guild.id).members.cache.get(user.id)) return;
#

Is that correct?

hardy bough
#

napacam acil help

umbral zealot
#

stop spamming every channel with that

feral aspen
#

You need to verify your bot in order to add your bot to more servers.

umbral zealot
feral aspen
#

Damn.

feral aspen
umbral zealot
#

No it's not

tired panther
tired panther
feral aspen
#

๐Ÿ˜‚

feral aspen
tired panther
earnest phoenix
#

lol first check the guild and then the get the member

modern granite
#

Discord.py I can get user's avatar. Are there any libraries, that will help me edit that user's avatar to a photo?

earnest phoenix
#

if(message.guilds.cache.get(guildid)){

let fetch = await message.guilds.cache.get(guildid).members.fetch(userid)
}

quartz kindle
#

wat

feral aspen
#

What?

modern granite
#

what

tired panther
earnest phoenix
#

lol took long

#
if(clientguilds.cache.get(guildid)){
let fetch = await client.guilds.cache.get(guildid).members.fetch(userid)
}
else{
return
}```
tired panther
#
if(!message.guild) return
let user = message.guild.members.cache.has(userid) ?  message.guild.members.cache.get(userid) : null;
if(!user) return
feral aspen
#
if(message.guilds.cache.get(message.guild.id)){
    let user = await message.guilds.cache.get(guildid).members.fetch(userid)
} else{
return "Please Mention User?"
}
feral aspen
#

I guess.

earnest phoenix
tired panther
quartz kindle
#

^

feral aspen
quartz kindle
earnest phoenix
#

attitude bot too?

quartz kindle
#

well depends what you're trying to do

feral aspen
#

Like !hello <user>, <user> is an ID but not from bot cache

quartz kindle
#

await client.users.fetch(id)

tired panther
feral aspen
tired panther
tired panther
tired panther
feral aspen
#

!hi 2987450982304802
returns hi @feral aspen

#

but not if I go to another server and type the same ID and still returns the same user

#

only if the user is in the same server as the author

tired panther
earnest phoenix
#

@quartz kindle how do i disable events on djs-light?

modern granite
tired panther
tired panther
feral aspen
#

Ok

#

๐Ÿ‘

quartz kindle
#

dont go disabling everything tho

tired panther
quartz kindle
#

you might break something

feral aspen
#

Ok!

ancient nova
#

can anyone help, I wrote a head bobbing script in c# for my unity game, how do I detect if my character is moving so I can make it bob, only whenever character is moving? ps. I'm using a Character Controller component with mesh and my own movement script that uses velocity

misty sigil
#

Just use intents

earnest phoenix
quartz kindle
#

use intents

umbral zealot
ancient nova
#

can you lend me a link to the unity server please?

umbral zealot
#

Most peopel here just write javascript bots, you'll have very little chances of finding someone that knows how to fix a unity head bobbing script. lol.

ancient nova
#

I see

umbral zealot
#

Use google, I Can't link external servers (advertising rules and all that)

green kestrel
#

ok who wants to see the funniest fuckup ever.

tired panther
umbral zealot
#

or maybe in server discovery

modern granite
earnest phoenix
#

can you pls elaborate..

umbral zealot
earnest phoenix
#

unity game engine

tired panther
umbral zealot
#

Well neither am I NeonLmao

ancient nova
#

I mean it is working fine, but I used GetComponent to set it's bool to true whenever velocity increases, but I used that in a void Update() which updates every frame so it just turns on million of head bobbing script and makes it messy

tired panther
modern granite
#

am I in the ignore list?

umbral zealot
feral aspen
ancient nova
#

can anyone send me a link to unity's server in dms?

ancient nova
#

I tried searching nothing is coming up

umbral zealot
feral aspen
#

๐Ÿ‘

ancient nova
#

@umbral zealot I'm on mobile right now

green kestrel
#
if ($existing_hook) {
        /* Check this hook is still valid */
        $info = botApiRequest("webhooks/" . $existing_hook->webhook_id);
        /* We found an existing webhook */
        if (!isset($info->code)) {
                /* Webhook exists, update its token and exit */
                dbquery("UPDATE channel_webhooks SET webhook = '$1'", [("https://discord.com/api/webhooks/".$info->id."/" . $info->token)]);
                exit(0);
        }
}

so this code is fired from my bot's core each time it needs to create or update the webhook for a channel on game start.
The problem is its missing a WHERE statement, so each server starting a round of trivia inherits all the webhooks of every other server that came before it. There was a massive chain of hot potato of running game messages, by the time it stopped, the one on the end was receiving server had the messages of about 40 games in 10 languages

tired panther
#

Why does everyone call me mister? adontfeelsoblob

umbral zealot
#

smh

earnest phoenix
#
const { Client } = require('discord.js');
const client = new Client({ ws: { intents: ['GUILDS', 'GUILD_MESSAGES'] } });```
which intent do i need for guild,role,channel cache?
umbral zealot
#

because it's easy to find

earnest phoenix
vivid fulcrum
#

yes

earnest phoenix
#

oh thx

vivid fulcrum
#

you'll get all of that data in GUILD_CREATE

tired panther
quartz kindle
#

GUILDS means you have all of these

green kestrel
#

@earnest phoenix @tired panther the fuckup funny enough? lol

modern granite
#

can someone at least answer my question which was ignored for 3 times, 15 mins ago?

earnest phoenix
#

what did i do?

green kestrel
#

you said to elaborate

tired panther
quartz kindle
#

what was the question

earnest phoenix
tired panther
modern granite
earnest phoenix
quartz kindle
#

what do you mean edit a user's avatar to a photo?

green kestrel
quartz kindle
#

you mean image manupulation?

modern granite
quartz kindle
#

i believe the pil/pillow library does this

earnest phoenix
#

f that is rude

green kestrel
#

theres nothing wrong with using the word fuckup

modern granite
#

his command like pls wanted

earnest phoenix
#

yes that is image mani.

modern granite
#

okay

modern granite
quartz kindle
modern granite
#

finally.. after 20 mins, I can say thank you

earnest phoenix
modern granite
#

but

#

I said

#

at least say Yes I can, or no I can't

#

that message was ignored as well

earnest phoenix
#

that is discord ,that happens to everybody ,when there is a hot discussion

modern granite
#

ikr, but 20 mins, dude

#

ok nvm

#

the "problem" is solved

earnest phoenix
#

๐Ÿ‘

sage bobcat
#

One message removed from a suspended account.

vivid fulcrum
#

um

#

that isn't dsp related

#

or lib related

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

vivid fulcrum
#

because async main is in c#7.1

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

modern granite
vivid fulcrum
#

in IL code, await is actually GetAwaiter().GetResult() 90% of the time

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

green kestrel
#

hmm

#

quick straw poll who'd rather see a video guide of how to change a setting and who would rather read a page with pictures

#

when it comes to semi technical stuff like how to configure a bot

modest maple
#

gif over pictures, pictures over video, video over wall of text

green kestrel
#

so animated GIFs

sage bobcat
#

One message removed from a suspended account.

green kestrel
#

so I'm thinking first time they start a game without webhook permission it'll notify them by a one off embed with an image of what to change. it will only come up once and only if they have access to change it

modest maple
#

is this for your announcements?

green kestrel
#

for the one off announcement to encourage people to add the manage webhook permission

modest maple
#

it'd say use the announcement channels

#

webhooks really take a bite on your ip ratelimits as you get more of them

green kestrel
#

we got those but only a small subset of servers follow it

#

no, the webhooks are for game messages

#

I didn't see anything relating to IP limits on webhooks

#

just a limit of 30 per 60 secs per hook

modest maple
#

you're limited to the global ratelimit

#

but they're bound to the channels aswell

green kestrel
#

so how do github etc get away with it

#

they send millions

modest maple
#

they also have a ton of Ips and partnership with discord bloblul

#

so obvs you wanna handle errors like having more than 10 webhooks i think it is in a single channel isnt allowed

green kestrel
#

no, only one webhook per channel

#

on many different servers

modest maple
#

yes but it doesnt stop users adding their own

green kestrel
#

the bot won't send thru those though

#

and if it can't create one it defaults back to channel messages

modest maple
#

also btw dont do what i did and send files via webhooks at anything over like 20 hooks / sec

#

sweats Man cant deal with another cloudflare ban

green kestrel
#

lol

#

file uploads are done via standard channel messages

#

but is it possible that 20 messages a sec of any kind could bring the ire of CF?

modest maple
#

btw for you announcements you should just make the bot follow the announcement channel from your server to them

modest maple
#

i havent had any issues atm and im at like 40 embeds / sec

#

but with image uploads i get CF banned at like 20 /sec

green kestrel
#

hmm interesting

modest maple
#

and thats the story in how we switched to a CDN bloblul

green kestrel
#

so 40 embeds per second over 40 different channels on 40 servers?

modest maple
#

your limit at that point is the global limit

#

of 50/sec per ip

green kestrel
#

yeah this is what I'm going towards

#

you've seen triviabot run a game of trivia yeah

modest maple
#

nop

green kestrel
#

each of the question/answer embeds will be thru a webhook

#

I'll show you

modest maple
#

@green kestrel

#

if your bot is sending 50 messages a second globally (the global limit per ip)

#

using a webhook isnt gonna help it

green kestrel
#

but you are already sending well above the API rate limit

#

you said you send 40 per second

modest maple
#

yes

green kestrel
#

limit is 1 per 2 seconds

modest maple
#

no...

tired panther
#

but doesnt it collect it in a bucket?

modest maple
#

im sending at my global IP limit

#

of 40/s

#

my limit is 50/s

green kestrel
#

how have you calculated that

#

if I check the buckets on the headers I can't reach anywhere near that

zenith terrace
#

@green kestrel taco

green kestrel
modest maple
#

shrug Unless they changed the all requests ratelimit randomly it should be about 50/s

green kestrel
#

it's nowhere near, pretty sure of it

modest maple
#

as that's about your REST limit per account

green kestrel
#

not just for messages then

#

for all rest

modest maple
#

yes

green kestrel
#

I was referring purely to the limit for create message

modest maple
#

well that would be about 5/5s per channel

#

also bound at 50/s globally

green kestrel
#

so in that case, webhooks can create more messages per minute then sending them via the /channel/id/messages POST

modest maple
#

not really

#

you're sending these messages globally

green kestrel
#

5 per sec per channel is more than I'll ever need

modest maple
#

yes

green kestrel
#

its when I scale it up to many channels on many servers

#

tbh I make very few other API calls

#

everything is cached

modest maple
#

your global limit though is bound by the all requests rest limit

#

(im obviously not going to demonstrate any of this because im not testing in a production system bloblul )

green kestrel
#

I have that same problem

digital ibex
#

Hi

modest maple
#

But i can safely say that webhooks are bound at about 50/s but equally your bot should be bound by that globally as well

#

I mean if we really wanted to test this we could just go make a mass DM bot bloblul

digital ibex
#

not sure if anyone knows this but does anyone know how I can check if an epic games account exists? Iโ€™m on the dev thing but I cannot find it, is this public or?

green kestrel
#

ok s

#

so

#

@modest maple we've determined from you, and from dapi, that theres a 50 per second rate limit per ip, plus a 30 per channel per minute limit

#

i have 5 ips.

#

i wouldnt want to piss someone off though.

modest maple
#

I think you may if you dont ask them first

green kestrel
#

i'll think carefully about this, and perhaps ask some more staff i have in my contact list before i do anything.

modest maple
#

but honestly i dont see how you can be nearly hitting these limits

#

like your bot inst really big enough imo to see those sorts of limits

green kestrel
#

76000 servers playing hundreds of games at once, tons of outbound messages

quartz kindle
#

oh theres a 30 per channel per minute limit?

green kestrel
#

seems so

quartz kindle
#

interesting, havent heard of that

#

for all messages or only webhooks?

modest maple
#

I dont think that can be webhooks

#

otherwise i'd be ip banned / permanently banned by now

#

oh wait

#

you mean 30 messages per channel per minute

green kestrel
#

yes

#

on webhooks

modest maple
#

bonk yes thats a thing

tired panther
#

Bad for your Trivia bot adontfeelsoblob

modest maple
#

not really

#

it's only an issue if a bunch of webhooks already send there

green kestrel
#

if there are that many already sending to that channel it's not a good place to start a game on

#

you'd lose track of the question

modest maple
#

I mean ive never ran into other than once in production

tired panther
modest maple
#

its like a 1 in 1e-90 chance

#

edits are either the same as sending or worse

tired panther
green kestrel
#

edits are worse

#

and, the amount of messages the bot generates helps people's server activity figures

#

a fair few have used triviabot to aid them in getting partnered

#

I didn't think they'd count bots

tired panther
green kestrel
#

perhaps it's the interaction with the bot I dunno, I'm not partnered

tired panther
green kestrel
#

either way

#

the bot works fine

#

I'm not going to change that aspect of it, as nobody ever complains

#

if it ain't broke don't fix it ๐Ÿ˜‚

digital ibex
#

anyone know a solution to my problem?

tired panther
digital ibex
#

dis

unreal estuary
#

they want to check if an epic games account exists

green kestrel
#

@digital ibex to do it properly you need epic games oauth that comes with an epic games store developer account

digital ibex
#

theres a way around oauth but idk what it is

#

i've seen it done a few times

green kestrel
#

you could probably hack it in by looking for a profile page or something

digital ibex
#

on phishing sites, no im not creating a phishing site

tired panther
unreal estuary
#

how do you want to check if an account exists?

#

like by the epic username

digital ibex
#

email, username, phone number

unreal estuary
#

this works for name

#

u can do accountType as psn or xbl too

#

i found it on github

#

onemanbuilds/EpicGamesUsernameChecker

modest maple
#

when in doubt copy someone's code

unreal estuary
#

its not the code

#

just the url

#

but ok

digital ibex
#

is that just for fn or all of epic games

#

?

unreal estuary
#

all of epic

digital ibex
#

alr ty mate

unreal estuary
#

np

modest maple
#
    #[call]
    fn __call__(&self, opcode: usize, body: Vec<u8>) -> PyResult<()> {
        let (more_body, body) = match opcode {
            OP_SEND_NOTIFY => {
                return Ok(())
            }
            OP_SEND_BODY => {
                (true, body)
            },
            OP_SEND_BODY_END => {
                (false, body)
            },

            n => return Err(PyValueError::new_err(format!(
                "value {:?} is not a valid op code for sender", n
            )))
        };
#

rusty rust rust

digital ibex
#

wait one sec

#

if i wanna use their phone number or email, any ideas @unreal estuary

#

cuz thats just the username

modest maple
#

if thats not a protected endpoint im gonna be disappointed in epic games

digital ibex
#

i dont think it is tbh, rl has multiple phishing sites which detect if an account exists or not

tired panther
torpid crown
#

Should I trun off this

tired panther
#

yes

torpid crown
digital ibex
#

so i've been thinking

#

is there anyway i can find the email which is linked to the epic games account?

#

and vice versa

tired panther
#

remove it

#

Just gave them perm they need

digital ibex
#

any ideas @unreal estuary sry for ping

tired panther
torpid crown
tired panther
torpid crown
#

Okay I am trun off the perms that the bot don't need

earnest phoenix
#

i lisen the musicsquidwarddance

unreal estuary
digital ibex
#

yeah thats where i've been looking

#

cant find anything

unreal estuary
#

ah

sudden geyser
#

rusty rust rust
๐Ÿฆ€ ๐Ÿงจ ๐Ÿฆ€

vivid fulcrum
#

cursed

sudden geyser
#

crabs will reconquer

earnest phoenix
#

how do i reference client in a cog file (discord.py)

slender thistle
#

ctx.bot

#

or self.bot if you did self.bot = bot in the cog's init

stuck dawn
#

why it gives me this error?

#
try {
                let role = message.member.roles.cache.find(role => role.id === "807601966066302997");
                this.client.guilds.cache.get('806257288344109056').members.cache.get(candDono).roles.add(role);
            } catch (e) {
                console.log(e)
            } finally {}
umbral zealot
#

message.member can be undefined, if the member is not cached

#

you'll need to fetch them

#

message.guild.members.fetch(message.author.id) should do the trick, but it's a promise you have to await.

stuck dawn
#

let role = message.author.roles.cache.find(role => role.id === "807601966066302997");

#

will work?

#

with message.author?

umbral zealot
#

no no

#

you need to fetch the member

#

THEN get their roles

#

both need to be done

stuck dawn
#

ok let me do that

#

i dont know how to do that xD

solemn latch
#

do one, then the other

earnest phoenix
#

how do i update bot presence

stuck dawn
#

candDono it's a member id

#

on 806257288344109056 guild

#

i just want to add the role to candDono

earnest phoenix
#

use .get

stuck dawn
#

?

unreal estuary
#

whats the discord permission for mentioning everyone

vivid fulcrum
#

...mention everyone?

unreal estuary
#

oh is it lol

misty sigil
#

painfully obvious that one

unreal estuary
#

just thought cuz the name was longer

#

and i havent used it b4

stuck dawn
#

@umbral zealot

umbral zealot
#

yes?

stuck dawn
umbral zealot
#

you haven't fetched the member

#

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

#

like I said, the fetch is a promise which you need to resolve.

stuck dawn
#

but where do i apply member?

umbral zealot
#

You have the correct code

#

you just need to resolve the promise

stuck dawn
#

like here?

umbral zealot
#

no

#

fetch() returns a promise

#

you need to resolve the promise

stuck dawn
#

ok

stark abyss
#
const imdb = require('imdb');
const cli = new imdb.Client({apiKey: 'xxxxxx'});```
TypeError: imdb.Client is not a constructor
#

package imdb issue, or I am doing something wrong?

misty sigil
#

v14?!

misty sigil
#

but

#

latest version is 12.5.2 or somethin

#

lmao

lyric mountain
#

check for both <@ID> and <@!ID>

pseudo phoenix
#

how i use member.profile() what does???

sudden geyser
#

Maybe you meant to use use imdb-api instead of imdb

lyric mountain
lyric mountain
#

where did u see it?

pseudo phoenix
#

here are the profile function

sudden geyser
#

profile is only for user accounts.

#

and is deprecated

#

since automated user accounts aren't allowed

#

Are you trying to get the user's information, like name, creation date, etc.?

pseudo phoenix
#

yeah

sudden geyser
#

I think a discord.Member already has the necessary information (assuming member is an instance of that class)

slender wagon
#

um how do i check if a message was sent on dm's with discord.js v12

#
 if (message.channel.type === 'dm')
```?
zenith terrace
#

that should be it yea

slender wagon
#

aight thanks

gray ledge
#

short question:
for my bot I need an api request. I want to list all the "cute_names" of the profiles of a player.

#

I tried to use sth like: response['profiles'] but after that i dont know how to come 'deeper' to the cute_name

earnest phoenix
#

Just access the properties like you accessed the profiles property

gray ledge
#

you mean like that?
response['profiles']['0']['cute_name']

#

TypeError: list indices must be integers or slices, not str

gray ledge
#

figured it out now:
the problem was that I wrote the index (e.g. profile 0) as a string: '0'

subtle coyote
lyric mountain
sudden geyser
stuck dawn
#

@umbral zealot I FUCKING DID IT

#

thank you very much

earnest phoenix
#

anyone help me with my bot

#

it's giving me an error and idk how to fix it

sudden geyser
#

@earnest phoenix don't be afraid to ask for help

#

ask away

earnest phoenix
#

it gives me that and I've tried to redo it but it isn't working

sudden geyser
#

Can you show us the source code for lines 8 - 16

earnest phoenix
#

k

#

gotta resize my screen cause i put swears for the yk

sudden geyser
#

It's better if you copy and paste the source code here with code blocks like so:

```python
your code here
```

earnest phoenix
#

1 sec

#

def get_quote():
response = requests.get
("https://zenquotes.io/api/random")
json_data = json.loads(response.text)
quote = json_data [0] ['q'] + " -" + json_data[0] ['a']
return(quote)

#

what

sudden geyser
#

There's no need for you to use json.loads on the response text. You can just use the .json() method on the response.

#

But I think your issue is the line break

earnest phoenix
#

what version of py are you taking about

#

Not even about py lol

#

oh

#

so how would I go about changing it

#

Refer to the docs I linked and what Lite has told you

#

and it's so that if you do +quote itll randomly pick a quote and send it

sudden geyser
#

And remove the line break between the second and third line you shared.

earnest phoenix
#

Thought it was discord formatting. You can also add a backslash there if you really want it to be in the next line lol

#

there's not a line break

#

it's how small I put my screen

sudden geyser
earnest phoenix
#

no

#

oop

#

i typed b

#

lok

#

my sc game strong

sudden geyser
earnest phoenix
#

got it working

#

im gonna add facts if I can

#

like animal facts

#

omg i need help again @sudden geyser

sudden geyser
#

Like I said, don't be afraid to ask your question.

earnest phoenix
#

alr

#

so I did the same method but changed the link so it will get facts but it gives me an error about the json

sudden geyser
#

and the error is

earnest phoenix
lyric mountain
#

Can't u just ss?

sudden geyser
#

json is a module (like import json) and you're trying to access the .data property even though it doesn't have such a property. You don't need the json module in any of your cases since you can use response.json() to get an object parsed from the JSON.

earnest phoenix
#

so how would i type it

sudden geyser
#

I gave you the details:

You don't need the json module in any of your cases since you can use response.json() to get an object parsed from the JSON.
By this, it means the result from response.json() is your object (the same thing you'd get from json.loads(...)). So, if I expected the parsed JSON to have a key named "high" and a value of 5, I can do ```py
obj = response.json()
obj["high"] # result is 5

earnest phoenix
#

-_-

#

idk what that means

lyric mountain
#

You should learn python before attempting to make a bot with it

#

As with all langs

earnest phoenix
#

I learned it alittle

#

I made a small snake game

lyric mountain
#

Really?

earnest phoenix
#

ye

#

that was like 4 months ago and I never touched python again

#

untill 2 days ago

sudden geyser
earnest phoenix
#

where's the json link

sudden geyser
#

You cannot escape the responsibility of tomorrow by evading it today.

earnest phoenix
#

huh

lyric mountain
#

Basically, if you throw food down to the sink it'll eventually clog

earnest phoenix
#

ok how does that relate to coding

visual stream
#

Analogy

lyric mountain
#

If you ignore the lack of knowledge now you'll have a huge problem later on

#

Clogged source code

sudden geyser
#

It means you need to learn more Python before you can learn to solve your problem with JSON.

earnest phoenix
#

I don't feel like learning it for days for 1 thing that I'm ever gonna use python for

lyric mountain
#

Imagine bots being a 1 day project KEKW

earnest phoenix
#

there not

visual stream
#

JSON's really important either way

#

One of the most used human-readable text-data object languages

lyric mountain
#

Thing is, no code with purpose will ever be bug free

#

So you code now, then fix tomorrow, then upgrade the next day, then fix, etc

earnest phoenix
#

im just gonna look it up

#

bruh

#

Google and yt no help

lyric mountain
#

Lite literally gave u the answer

#

Both google and yt probably are too

#

But you lack knowledge to see the answer

earnest phoenix
#

exactly I need more help so just tell me instead of saying you have json and do json.(response)

lyric mountain
#

No

#

Spoonfeeding is not helping

earnest phoenix
#

mhm that's why I got to the 7th grade

#

dude once I learn something I don't forget it unless i feel like it

lyric mountain
#

Sure

earnest phoenix
#

so tell me once and you won't ever have to again

lyric mountain
#

No

umbral zealot
#

Then it should be super easy for you to just read docs

solemn latch
#

a huge part of development is learning stuff yourself.

sudden geyser
#

You need to help us by helping yourself first.

umbral zealot
#

You keep saying you have a perfect memory - just read the user manual once. Problem solved.

lyric mountain
#

Learning is learning, getting the answer is getting the answer

solemn latch
#

๐Ÿ‘€ suddenly a wave of people

lyric mountain
#

If you ask me how much is PI, it's 3,14159265...

earnest phoenix
#

not hard

lyric mountain
#

Did u find out PI number? Yes

#

Did u learn why you need it? No

umbral zealot
earnest phoenix
#

i used pie to solve area ๐Ÿ˜‚

lyric mountain
#

But what is PI? Why is it that value? What are the actual applications of it?

solemn latch
#

๐Ÿคทโ€โ™‚๏ธ

earnest phoenix
#

my school doesn't teach that lmao

lyric mountain
#

Exactly

solemn latch
#

who remembers anything from school anyway

lyric mountain
#

They told u the value, but didn't teach u why you use it

lapis geode
#

The powerhouse of the cell woo

lean crest
#

So, anyone had OAuth Link generator?

earnest phoenix
#

solve area

umbral zealot
lean crest
earnest phoenix
#

I just don't understand why it's wrong dude

sour flame
#

Best place to code an economy bot

umbral zealot
lyric mountain
lapis geode
#

Tutorial hell isn't a fun place innit PES_SadCat

quaint wasp
#

whats null?

umbral zealot
#

Go through a python tutorial if you've got a perfect memory. You can't eat your cake and have it too buddy, if you have a photographic memory then it'll be a breeze and you won't have to keep asking us for "examples"

umbral zealot
lyric mountain
#

hasta la vista value

sour flame
#

Anyone here know a place where I can code an econmoy bot

umbral zealot
lapis geode
#

undefined is the very best

umbral zealot
#

Undefined is not the same thing as null though

sour flame
umbral zealot
#

undefined means you haven't defined something. null means it's defined but has no value.

earnest phoenix
umbral zealot
#

Well sorry, that's how you're gonn have to do it

sudden geyser
lapis geode
#

didn't say it was either FlushedBruh

umbral zealot
#

we will not spoonfeed you answers constantly until you've integrated the entirety of bot creation systems

earnest phoenix
#

literly asked what 2 things

lean crest
#

Now I'm confused on the OAuth link generator :v

earnest phoenix
#

null

quaint wasp
#

so its like..

#

no value?

umbral zealot
quaint wasp
#

useless?

earnest phoenix
#

isn't 0 null

umbral zealot
#

No. 0 is zero.

sour flame
earnest phoenix
#

zero

#

what even is econemy bots

sudden geyser
umbral zealot
quaint wasp
#

I tryed username, tag, and still didnt work! (I kinda did read docs, still didnt figure it out.)

lean crest
umbral zealot
lean crest
#

Or did I need to put something on the code for the bot did the 2FA req?

quaint wasp
#

ya

earnest phoenix
#

right

quaint wasp
#

what about it?

earnest phoenix
#

don't know

umbral zealot
quaint wasp
#

o shoot

umbral zealot
#

use message.client instead

earnest phoenix
#

you don't make all bots in vsc

umbral zealot
#

No, but it's a great editor.

lyric mountain
#

You'll understand why we don't spoonfeed

earnest phoenix
#

cause people can get better than others

lean crest
lyric mountain
#

No

#

Just pay attention to the conversation

quaint wasp
#

again, cilent does go before message, right?

command.execute(client, message, args);

earnest phoenix
#

it's like not picking up a 2 yr that fell and hurt themself

quaint wasp
#

lol

umbral zealot
#

Not the bot. The bot owner. You.

earnest phoenix
#

trying to walk = learning
fell and got hurt = needs help

lyric mountain
#

No

lean crest
#

Alr, thx mate @umbral zealot

lyric mountain
#

No one can give you legs to walk

earnest phoenix
#

there not gonna sit there and cry for 10 minutes and get up

lyric mountain
#

You learn it yourself

umbral zealot
#

It's why we call it spoonfeeding

earnest phoenix
#

I've asked 2 times

umbral zealot
lyric mountain
#

Or someone holds you so you can learn but with safety and guiding

#

Who will hold you? The docs

earnest phoenix
#

I get help boom done im good

lyric mountain
#

No

#

You need to learn how to walk yourself

#

Alone or with guidance

earnest phoenix
#

ur parents help you

lyric mountain
#

Yes, they were my "docs" on how to walk

#

They didn't enter my brain and give me "how to walk" answer

earnest phoenix
#

they helped alot

lyric mountain
#

Yes

#

So do the docs

#

We're also here to help

earnest phoenix
#

ur not helping alot just complaining I asked twice and trying to prove your point

lyric mountain
#

But no one is gonna give you a oven hot answer

earnest phoenix
#

never said they would

lyric mountain
#

Yes you said

#

Thrice

umbral zealot
#

Spending more effort arguing that we should just help you than you should be spending actually figuring out the problem isn't helpful.

earnest phoenix
#

"thrice"

proven lantern
#

hi i can help

#

what's the issue here

lyric mountain
#

Thrice is twice + 1

umbral zealot
#

No idea I couldn't read the photo since this guy doesn't know how to take screnshots.

#

or copy/paste

earnest phoenix
#

dude im not going into my phone to copy then edit it

sour flame
#

anyone want to help meh code a econamy bot haven't done it before

umbral zealot
#

The snipping tool?

#

ShareX?

latent tundra
#

pls beg

umbral zealot
#

Help us help you, man.

earnest phoenix
#

discord is blocked in my computer

earnest phoenix
#

ever heard of a parent

lyric mountain
umbral zealot
#

But... you... have access to your browser....

lyric mountain
#

Like, the foundation

proven lantern
#

download google goggles to your phone and use that to copy the text

earnest phoenix
#

and

umbral zealot
earnest phoenix
#

not on my computer

umbral zealot
#

How the heck does the bot connect if the domain is blocked?

#

seriously this is ridiculous.

sour flame
#

I mean yes I started a bot

lyric mountain
#

It's the same thing, but you'll need a database

umbral zealot
lapis geode
#

Mongo PES_ThumbsUp

sour flame
lyric mountain
#

No

sour flame
#

kk

earnest phoenix
#

there's a sc

#

can ya read it now

lyric mountain
#

You're phonehosting?

umbral zealot
#

uhm

sour flame
earnest phoenix
#

no

lyric mountain
#

No

earnest phoenix
#

I took a ss with my phone of the code and cropped

lyric mountain
earnest phoenix
#

the error says you typed json.data[0] instead kekw, which is now fixed. So what's the issue?

lyric mountain
#

Choose your flavor

sour flame
#

I need a ss of database

lyric mountain
#

Do you know WHAT is a database?

sour flame
#

nah

umbral zealot
#

Then maybe you should go do a bit of research

sour flame
#

a structured set of data held in a computer, especially one that is accessible in various ways.

#

thats a database

umbral zealot
#

yes. it's a thing that stores data

sour flame
#

so how do you code one?

earnest phoenix
#

kinda worked

sour flame
#

on vscode

earnest phoenix
#

just get the value of fact

normal sage
#

I guess you could say JSON is a db, but it isn't that efficient, the files could get corrupted too often, and the data isn't encrypted.

umbral zealot
sour flame
#

got it

umbral zealot
#

You should stop saying that json "could" be a database. It muddles the conversation with beginners who are connvinced it can be

lyric mountain
#

You just copied that sql didn't u?

sour flame
lyric mountain
#

Don't

earnest phoenix
#

so basically I did it but the fact and length are there

lyric mountain
#

Is because you returned the json instead of its attribute

earnest phoenix
#

bruh

normal sage
#

@earnest phoenix You should use aiohttp for requests instead.

earnest phoenix
#

tf

lyric mountain
#

Not you

earnest phoenix
#

it's for meh

lyric mountain
#

Read those two links I sent u draconic

latent tundra
#

pls beg

lyric mountain
#

And research how databases work in general

earnest phoenix
#

those 2 work

lyric mountain
#

Yes

earnest phoenix
#

just +cat needs work

lyric mountain
#

Ah, welcome Mr. Knowledge, please have a seat!

earnest phoenix
#

bru, just get the value of fact

#

ur acting like i don't know but do know

#

I know i need to just don't know how so im gonna go figure it out

#

200

lyric mountain
#

We just told u how you figure that out...

earnest phoenix
#

well what's wrong

lyric mountain
#

Lack of knowledge

earnest phoenix
#

You got the value of a and q in the quote command, just do the same to the cat, but with fact

#

I returned json not atribute

#

bruh

lyric mountain
#

A json is a data structure

#

If you want a person inside a house, you return the person

#

You're returning the house

earnest phoenix
#

well thanks @earnest phoenix

#

now I can add unlimited pet facts

#

lol

lyric mountain
#

That's what they all think...

#

Mark my words

earnest phoenix
#

you have to find an API right

lyric mountain
#

You'll return here many more times

earnest phoenix
#

like to generate random

latent tundra
#

pls dep all

#

pls beg

lyric mountain
earnest phoenix
#

I personally wouldn't rely on API for something that you can do yourself, but that's just me

#

i was told to by yt and it's my first time

lyric mountain
#

Dead TN, you're bound to become a regular here and suffer the same fate as DAX and Smug

earnest phoenix
#

don't care๐Ÿ˜ƒ

lyric mountain
#

But we do

earnest phoenix
#

why do you care

lyric mountain
#

Because you'll bother us everyday, every single new feature

earnest phoenix
#

how do you even get stuff from github

umbral zealot
#

uh we search, read, understand, sometimes copy/paste.

#

unless you have a different definition of "get"

lyric mountain
#

You're not the first nor the last, I've been here long enough to see the destruction a simple spoonfeeding can cause

earnest phoenix
#

like getting a code from git hub there's alot of files and folders

lyric mountain
#

It's more addicting than hard drugs

umbral zealot
#

and if you're still too lazy to read docs just google for a "git cheat sheet" that should help

earnest phoenix
#

what about an image

#

would I put image

#

wot

#

if i was to get a dog image api and it randomly gave me a image what would I put in ['']

#

Just see the data structure.

#

It should be self-explanatory

#

structure

#

Dexter's been typing for like 10 minutes flushedalien

#

bruh ikr

#

ok

umbral zealot
#

Just ignore it

earnest phoenix
#

what's a good website for animal fact generators

#

HE STOPPED

rustic nova
#

he got yeeted

earnest phoenix
#

how do i get bot dev role

umbral zealot
#

After you've created a bot, submitted it to top.gg, and it gets approved, you get the role

earnest phoenix
#

oh sheesh

sour flame
#

I reach somewhere

lyric mountain
#

White theme

earnest phoenix
#

dark is better

sour flame
#

Waiting for this

sour flame
#

it finished

lament rock
#

you should create a package.json

earnest phoenix
#

I've done quotes catfacts and dogfacts

sour flame
#

It is a package.json

lament rock
#

package.json needs to be in the same directory as the package-lock.json

#

aka the root of the project

sour flame
#

kk

#

How it looking

opal plank
# sour flame How it looking

while it looks good so far, i would recommend not attachming much to your client, since you'll be passing it around quite often

sour flame
#

kk

opal plank
#

and requiring stuff as needed on the files

#

unless its a connection

#

then attach it

earnest phoenix
#

would I do ['image']

sour flame
#

kk

opal plank
#

would recommend using detritus instead of d.js btw mmulu

sour flame
#

I'm setting prefix now

opal plank
#

custom prefixes?

lyric mountain
#

Erwin erwin, ara ara

opal plank
#

look, gathering people for my cult

sour flame
#

any like ? + and more

opal plank
#

so, custom prefixes?

sour flame
#

yep

opal plank
#

if only it was this easy

sage bobcat
#

One message removed from a suspended account.

opal plank
opal plank
#

detritus has custom prefixes support

#

so you dont need to write your own

sage bobcat
#

One message removed from a suspended account.

opal plank
sudden geyser
# opal plank

You could remove the first expression in the if condition

#

Unless get errors for some reason

opal plank
#

indeed, but the thing is quite simple overall

#

it checks for prefix on every message, just return an array or string

#

and it'll check for all prefixes for you