#development

1 messages · Page 1230 of 1

earnest phoenix
#

@drifting wedge repeating the same question doesn't mean someone will answer
https://google.it is 24/7 help

hazy sparrow
#

@strong fractal you can for example if you want to click on the center of bp just click on p and press the left arrow key
@strong fractal ^

earnest phoenix
#

@earnest phoenix No I mean like learn how to send emails, use a keyboard, browse the web, manage files, etc
@faint prism i self-learnt bot development and programming from home and my computer classes taught me only microsoft excel

drifting wedge
#

@drifting wedge repeating the same question doesn't mean someone will answer
https://google.it is 24/7 help
@earnest phoenix read topic

#

ive googled it dummy

earnest phoenix
#

then

#

i'm a senior level dev while we just got programming as an actual separate class

#

lol

hazy sparrow
#

breh i forgot i was fixing my give command

#

cya

earnest phoenix
#

breh i forgot i was fixing my give command
@hazy sparrow don't worry you're not alone this is the 49th day I forgot to setup mongodb

#

don’t rely too much on SO
@swift umbra i don't i rely on MDN and pinging @Tim#2373 and #development mmLol

slender thistle
#

SO is eh

#

grey area

delicate shore
#

@quartz kindle I even do try catch but

4|index  |                                                                                                                                                                                   
4|index  | abort(DiscordAPIError: Cannot send messages to this user). Build with -s ASSERTIONS=1 for more info.
4|index  | (Use `node --trace-uncaught ...` to show where the exception was thrown)

again this error

earnest phoenix
#

A random guy in my server said this:
My favourite language is JavaScript
I call it Java for short

#

what's your code

faint prism
#

what is object java
@swift umbra JavaScript or Java?

delicate shore
#

yes

faint prism
#

No

#

Reee

earnest phoenix
#

@delicate shore the user is a bot or the user has blocked your bot for being dumb KEKW

delicate shore
#

@delicate shore the user is a bot or the user has blocked your bot for being dumb :KEKW:
@earnest phoenix yes but i don't want my bot to restart if that error happens

#

but it is

earnest phoenix
#

again

#

what is your code

delicate shore
#

idk

earnest phoenix
#

???????

hazy sparrow
#

what

faint prism
#

???

delicate shore
#

i mean idk where error is happening

#

Which part

earnest phoenix
#

@earnest phoenix yes but i don't want my bot to restart if that error happens
@delicate shore you didn't handle the promise rejection

delicate shore
#

of the code

earnest phoenix
#

just send the code

#

wherever you're attempting to send a dm...?

#

we're gods

hazy sparrow
#

then show whole code?

delicate shore
#

wherever you're attempting to send a dm...?
@earnest phoenix many times

earnest phoenix
#

no

#

show the token

delicate shore
#

then show whole code?
@hazy sparrow 4K lines Mega_Shy

hazy sparrow
#

@hazy sparrow 4K lines :Mega_Shy:
@delicate shore hastebin?

delicate shore
#
dbl.webhook.on("vote", vote => {
  console.log(vote);
  try{
  
    if (bot.uptime) {
      bot.users.fetch(vote.user).then(user => {
  
  
  
  
        const thanks2 = new Discord.MessageEmbed()
          .setColor("RANDOM")
          .setImage(
            `https://cdn.glitch.com/f0d0daf5-a981-4bd1-bb7b-a3bdc2cd20db%2Fthank-you-437x230.jpg?v=1596176778617`
          )
          .setTitle("**Thanks For Voting! :)**")
          .setDescription(
            `Thanks for voting ![love](https://cdn.discordapp.com/emojis/736194392305434704.webp?size=128 "love"):. You now have access to all the filter commands in music !!`
          );
  
        user.send(thanks2)



      bot.channels.fetch("739081152807305308").then(channel => {
        const thanks = new Discord.MessageEmbed()
          .setColor("RANDOM")
          .setImage(
            `https://cdn.glitch.com/f0d0daf5-a981-4bd1-bb7b-a3bdc2cd20db%2Fthank-you-437x230.jpg?v=1596176778617`
          )
          .setTitle("**Thanks For Voting! :)**")
          .setDescription(
            `Thanks for voting ${user.tag} ![love](https://cdn.discordapp.com/emojis/736194392305434704.webp?size=128 "love").\nIt is super apricated!`
          )
          .addField(
            `You watching can upvote me too!`,
            "[Upvote me on top.gg!](https://top.gg/bot/716985864512864328/vote)"
          );
        channel.send(thanks);

        let Tet7 = bot.guilds.cache.get("690557545965813770");

        let upvoter = Tet7.roles.cache.find(role => role.name === "Upvoter!");
        let mo = Tet7.members.cache.get(vote.user);
        mo.roles.add(upvoter);
        setTimeout(() => {
          mo.roles.remove(upvoter);
        }, 43200000);
      });


    });


  }
}catch (err){
console.log(err)
}
});```

This is one time
#
bot.on("guildCreate", async guild => {
  try{
  bot.channels.cache
    .get("738415384511905913")
    .send(
      "![love](https://cdn.discordapp.com/emojis/736194392305434704.webp?size=128 "love")![love](https://cdn.discordapp.com/emojis/736194392305434704.webp?size=128 "love")I got added in a new Guild! `" + guild.name + "`" + `This guild is epic! My Guild count ${bot.guilds.cache.size}`
    );
  let finalowner = guild.owner;
  const helpembed3 = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setImage(
      `https://cdn.glitch.com/f0d0daf5-a981-4bd1-bb7b-a3bdc2cd20db%2Fthank-you-437x230.jpg?v=1596176778617`
    )
    .setTitle("**Thanks For adding me mate :)**")
    .setDescription(
      "**I cannot be more happy then being added in your server**"
    )
    .addField(
      "Need Support?",
      "[My Support Server](https://www.invite.gg/blacksheep)"
    )
    .addField(
      "Wanna know my commands?",
      "[My Command List](https://blacksheep.glitch.me/commands.html)"
    )

    .addField(
      `Love me ![love](https://cdn.discordapp.com/emojis/736194392305434704.webp?size=128 "love")!`,
      "[Upvote me on top.gg!](https://top.gg/bot/716985864512864328/vote)"
    )
    .addField(
      `Love me a lot ! ![love](https://cdn.discordapp.com/emojis/736194392305434704.webp?size=128 "love")![love](https://cdn.discordapp.com/emojis/736194392305434704.webp?size=128 "love")![love](https://cdn.discordapp.com/emojis/736194392305434704.webp?size=128 "love")!`,
      "[Support my Development](http://bit.ly/sheephelp)"
    );
  finalowner.send(helpembed3);
  
    }catch(err){
      console.log(err)

}});```
#

second time this

#

and its probably second one

quartz kindle
#

None of your .send() is caught lol

earnest phoenix
#

that's also literally unreadable

hazy sparrow
#

@delicate shore hastebin?
@delicate shore did you read what i said

delicate shore
#

it is ?

quartz kindle
#

Its not

earnest phoenix
#

use a bin service, anything other than pastebin

quartz kindle
#

All your .sends are open to errors

delicate shore
#

i have the whole code

#

in try catch

#

the event

hazy sparrow
#

why are everyone against pastebin

earnest phoenix
#

you're forgetting that send is a promise

quartz kindle
#

Thats not how try catch works

delicate shore
#

oh

quartz kindle
#

Let me explain

earnest phoenix
#

why are everyone against pastebin
@hazy sparrow trackers, ads, pay for features that should be free, eye rape theme by default

hazy sparrow
#

wait what is not eye rape by default?

sudden geyser
#

It's because you have other sites that are better in every other aspect that people don't use

#

like hastebin

earnest phoenix
#

it's light theme by default

sudden geyser
#

then against hastebin fails everytime to guess the language so I have to type the extension in the url

delicate shore
#

Yes

hazy sparrow
#

ok i again forgot i was fixing my give command oh god

earnest phoenix
#

i have dark reader so it genuinely does not matter to me but it kills to read someone's code only to be eye raped by a white theme

hazy sparrow
#

cry wanna see light theme discord? KEKW

earnest phoenix
#

no thanks

#

:(

delicate shore
#

yes no thanks

strong fractal
#

cry wanna see light theme discord? KEKW
my worst dream

hazy sparrow
#

i heard that they changed it to be a lot darker

sudden geyser
hazy sparrow
#

OH GOD

strong fractal
#

OOOOOOH

#

@sudden geyser how are you alive!?

sudden geyser
#

quite daring of you to think I'm alive after seeing that

hazy sparrow
#

@sudden geyser are you ok bud

strong fractal
#

I love how people make memes about discord themes

hazy sparrow
#

it isnt a meme it actually hurts my eyes

strong fractal
#

@hazy sparrow it is a meme, but it actually hurt eyes ;(

quartz kindle
#
try {
    send() // doesnt catch
    await send() // catches
    send().catch() // catches
    send().then(() => { // doesnt catch
        send() // doesnt catch
        await send() // error, not async
        send().catch() // catches
    })
    send().then(async () => { // doesnt catch
        send() // doesnt catch
        await send() // doesnt catch
        send().catch() // catches
        try {
            send() // doesnt catch
            await send() // catches
            send().catch() // catches
        } catch(e) {}
    })
    send().then(() => { // catches
        send() // doesnt catch
    }).catch()
    await send().then(() => { // catches
        return send() // catches
    })
} catch(e) {}
```@delicate shore
strong fractal
#

@hazy sparrow even discord itself probably can’t beat light theme

hazy sparrow
earnest phoenix
#

chrome yuck

hazy sparrow
#

yea internet explorer is better

sudden geyser
#

vivaldi

earnest phoenix
#

@delicate shore god use hastebin

#

i've genuinely been enjoying firefox a lot more for the past year, it has advanced tracker protection, built in pip mode etc.

#

i even had my own fork running a few months ago

hazy sparrow
#

guys im gonna help blind people brb

earnest phoenix
#

i'm using ||my browser gives me free rewards and i know 100% of people will google the name instead of clicking my referral so dm me if you want the referral link|| browser

#

though i do use a chrome css to alter the look of firefox in order to make it look like chrome

hazy sparrow
delicate shore
#

wow @polar flower thank you

#
dbl.webhook.on("vote", vote => {
  console.log(vote)
  
      bot.users.fetch(vote.user).then(user => {
  
  
  
  
        const thanks2 = new Discord.MessageEmbed()
          .setColor("RANDOM")
          .setImage(
            `https://cdn.glitch.com/f0d0daf5-a981-4bd1-bb7b-a3bdc2cd20db%2Fthank-you-437x230.jpg?v=1596176778617`
          )
          .setTitle("**Thanks For Voting! :)**")
          .setDescription(
            `Thanks for voting ![love](https://cdn.discordapp.com/emojis/736194392305434704.webp?size=128 "love"):. You now have access to all the filter commands in music !!`
          );
  
          try{
        user.send(thanks2)

      }catch(err){
        console.log(err)

      bot.channels.fetch("739081152807305308").then(channel => {
        const thanks = new Discord.MessageEmbed()
          .setColor("RANDOM")
          .setImage(
            `https://cdn.glitch.com/f0d0daf5-a981-4bd1-bb7b-a3bdc2cd20db%2Fthank-you-437x230.jpg?v=1596176778617`
          )
          .setTitle("**Thanks For Voting! :)**")
          .setDescription(
            `Thanks for voting ${user.tag} ![love](https://cdn.discordapp.com/emojis/736194392305434704.webp?size=128 "love").\nIt is super apricated!`
          )
          .addField(
            `You watching can upvote me too!`,
            "[Upvote me on top.gg!](https://top.gg/bot/716985864512864328/vote)"
          );
        channel.send(thanks);

        let Tet7 = bot.guilds.cache.get("690557545965813770");

        let upvoter = Tet7.roles.cache.find(role => role.name === "Upvoter!");
        let mo = Tet7.members.cache.get(vote.user);
        mo.roles.add(upvoter);
      
  })
})
      })
    ```
#

Why am I getting an error here

#

of syntax

earnest phoenix
#

use a bin

delicate shore
#

ok

earnest phoenix
#

it's unreadable on discord

quartz kindle
#

youre still not catching them correctly

delicate shore
#

oh

#

oh wait

#

i am

#

nvm

polar flower
#

Why did u ping me lol

delicate shore
#

I didn't even saw the catch

#

Why did u ping me lol
@polar flower Wait what
I meant to ping @quartz kindle lmao

quartz kindle
#

Lmao

polar flower
#

😂

quartz kindle
#

Why is there another tim

split hazel
#

bootleg tim

delicate shore
dusky mason
#

nobody helped me

wheat mesa
#

me too

hazy sparrow
#

what did i miss when i went to take a dump

split hazel
#

lewd

orchid pasture
#

whut wrong

split hazel
#

anyways off topic

drifting wedge
#

how can i layer images?

#

using pillow?

orchid pasture
#

idk

quartz kindle
#

If pillow ia anything like canvas

drifting wedge
#

its similar

quartz kindle
#

Then there are no layers

drifting wedge
#

like i should paste one of top of another?

quartz kindle
#

You just add another image on top

drifting wedge
#

yea

quartz kindle
#

Yes

drifting wedge
#

thats what i mean

#

so rn im making a background

quartz kindle
#

So just load the image and draw it on top of the other

drifting wedge
#

epic

#

also, should i convert the background to rgba?

#

fundob4.paste(fundo, (0, 0), fundo)

quartz kindle
#

Idk try it with and without

drifting wedge
#

fundob4 is the backhround

#

and fundo is the card

#

i paste the card on top of the background?

quartz kindle
#

Yes i guess

drifting wedge
#

ill try

quartz kindle
#

On canvas it would be drawImage

#

Idk whats the pillow equivalent

thick gull
#

docs tm

earnest phoenix
#

Hi

#

-bots

gilded plankBOT
drifting wedge
#

can i like make a box, and align text on the right of the box?

earnest phoenix
#

But,

drifting wedge
#

with pillow

earnest phoenix
#

I'm waiting verify

#

@earnest phoenix read pins of #support and bots aren't allowed outside of testing channels

#

oh ok

#

what this error mean: AttributeError: '_io.TextIOWrapper' object has no attribute 'delete'

#

await check.delete()

#

@earnest phoenix send the code

#
async def activity_check(self):
        """ check the activity of the moderators """
        while not self.client.is_closed():
            embed=discord.Embed(title="Activity CHECK", description="If you moderate right now please say `!active`. You have 60 seconds.", color=0xff0000)
            embed.set_author(name="CHECK!!!")
            activity_channel = self.client.get_channel(753624687589982278)
            check = await activity_channel.send(embed=embed)

            with open("server/activity_check.json") as check:
                ac = json.load(check)

            last_check = ac['check']

            ac['check'] = 1    

            with open("server/activity_check.json", "w") as check:
                json.dump(ac, check, indent=4)

            sleep(7)    

            ac['check'] = 0    

            with open("server/activity_check.json", "w") as check:
                json.dump(ac, check, indent=4)

            await check.delete()    

            await sleep(3600)```
#

@earnest phoenix

#

i said send the code so someone else might be able to help i dunno paithon

thick gull
#

paithon

#

painthon

sudden geyser
#

I think check gets turned into _io.TextIOWrapper because of you giving it the same variable name when you're opening the json file.

#

Variables in Python as bound to their function scope, rather than the scope of a statement.

#

Then again, with statements call a special function when the scope of the statement goes out of bounds.

drifting wedge
#

how can center something in a box?

faint prism
#

Some day, this will save me, I just know it.

private const string IDIOT_DEV = ".... **The dev set this reply to be too long for discord. Please call him an idiot!**";
//...
        public string HelpCommand()
        {
            string helpText = HelpTextProvider.Read();

            if (helpText.Length > MAX_REPLY)  // 2k char limit
            {
                helpText = helpText.Substring(0, helpText.Length - IDIOT_DEV.Length) + IDIOT_DEV;
            }

            return helpText;
        }
hazy sparrow
#

guys is there a way to delete everything stored in my quick.db database? i want to reset my xp system for everyone

earnest phoenix
#

delete the .db file

faint prism
#

I'm sure

misty sigil
#

just delete the .sqlite file

earnest phoenix
#

guys is there a way to delete everything stored in my quick.db database? i want to reset my xp system for everyone
@hazy sparrow delete your bot from discord done mmLol

misty sigil
faint prism
#

wait, just one collection?

#

or entire db?

hazy sparrow
#

one table

#

oh wait no

faint prism
#

just get a list of all keys, and for each one call the DELETE db call on it

hazy sparrow
#

the entire db

faint prism
#

oh, then just delete the entire db and restart

hazy sparrow
#

delete what

#

the file?

faint prism
#

the record

#

or the db file

#

whatever approach you're doing

hazy sparrow
#

where can i find the db file?

earnest phoenix
#

json.sqlite

#

that's the file

hazy sparrow
#

what

#

json.sqlite?

faint prism
#

if deleting the database file is too difficult for you, try just iterating over every record and deleting it

earnest phoenix
#

json.sqlite is the file which quick.db uses to store data
quick.db is literally a wrapper for better-sqlite3

hazy sparrow
#

ok that works too

#

ty

earnest phoenix
#

lmfao

#

that does not JUST include the xps

#

it includes everything you stored in quick.db

#

you've been gnomed mmLol

hazy sparrow
#

i JUST have the xp system stored in my quick.db

earnest phoenix
#

nvm

hazy sparrow
#

and wait if i restart my bot will the json.sqlite appear again?

misty sigil
#

Yes.

hazy sparrow
#

ok cool

#

ty again

earnest phoenix
#

and wait if i restart my bot will the json.sqlite appear again?
@hazy sparrow unless you do shit with quick.db again

misty sigil
#

?

earnest phoenix
#

yeah

hazy sparrow
#

i just deleted it wish me luck GWslippyPeepoW

earnest phoenix
#

it will appear again

#

good job

#

you deleted everything you stored in the XP system for every single guild for every single user

#

hope you enjoyed

#

you cannot recover a file on a remote VPS

hazy sparrow
#

yup thats what i wanted

#

its only been a day since i added it anyways

earnest phoenix
#

what the fuck

hazy sparrow
#
 message.channel.send(`**${taggedMember.user.username}**has**${db.get(`${taggedMember.id}mybal`)}** bowbucks`)

it says person has null bowbucks when they have 0, how can i make it say person has 0 bowbucks instead?

faint prism
#

not renaming json.sqlite -> json.sqlite.bak

misty sigil
#
 message.channel.send(`**${taggedMember.user.username}**has**${db.get(`${taggedMember.id}mybal`)}** bowbucks`)

it says person has null bowbucks when they have 0, how can i make it say person has 0 bowbucks instead?
@hazy sparrow use ?

earnest phoenix
#

set the value to 0

#

bruh

hazy sparrow
#

use what

misty sigil
#

?

#

use ?

hazy sparrow
#

you saying use "?" or "use?"

misty sigil
#

value ? "yes" : "no"

hazy sparrow
#

ohhh

#

like that

copper gyro
#

Can I use C++ to make bots?

hazy sparrow
#

ok lemme try that

#

@copper gyro ofcourse

misty sigil
#
copper gyro
#

How

earnest phoenix
#

@hazy sparrow deoends if there is a api

#

for code refrence

misty sigil
#

??

hazy sparrow
#

there are apis for C++

earnest phoenix
#

for discord?

hazy sparrow
#

yes

earnest phoenix
#

oh yea

#

it should work

misty sigil
#

@earnest phoenix you’d need SSL

earnest phoenix
#

wut?

#

wuts that

slender thistle
#

Doesn't repl.it already give you an HTTPS link

earnest phoenix
#

yeah

misty sigil
#

ssl certificate

earnest phoenix
#

but my actual express.js server isn't https

slender thistle
#

Does express.js support TSL certificates?

pure lion
#

Not how it works

#

Nope

earnest phoenix
hazy sparrow
#

wait so is it gonna be

 message.channel.send(`**${taggedMember.user.username}**has**${db.get(`${taggedMember.id}mybal`) ? "null" : "0"}** bowbucks`)
pure lion
#

That's just the web app, you can't put ssl on that

earnest phoenix
#

wait

#

it does support HTTPS

#

am i drunk

pure lion
#

Yes

earnest phoenix
#

i'm a muslim i can't be

pure lion
#

I'd use something like nginx to proxy it

misty sigil
#

@hazy sparrow no

pure lion
#

Because that's far more secure

earnest phoenix
#

wtf

#

||use mah freaking referral|| website said the website does not support HTTPS Thonk

slender thistle
#

You are supposed to reverse proxy from an HTTPS webserver to an HTTP server

misty sigil
#

value ? value : "0" // if value is null

slender thistle
#

or that's how I've heard it works, at least.

earnest phoenix
#

link me MDN docs for the ? operator please

misty sigil
#
pure lion
#

Bruh

hazy sparrow
#

i read that alr

pure lion
#

@earnest phoenix it's an if statement that lost weight

misty sigil
#

lmao

earnest phoenix
#

@earnest phoenix it's an if statement that lost weight
@pure lion they went to the gym to get ABSOLUTELY RIPPED

#

huh

pure lion
#

true ? "the value is true" : "the value is false"

earnest phoenix
#

https://code913.repl.co does support https but ||use mah freaking referral|| says it ain't

pure lion
#

I'm not going to use your damn referral

earnest phoenix
#

k

misty sigil
#

nobody’s gonna use your fuckin referral

slender thistle
#

Referral links fall under ads

earnest phoenix
#

most people google the name of the website even if you give them the referral link so i always goto reddit cuz redditors have brains that a guy is indirectly begging you to click on a link
this ain't #development now

wheat mesa
#

How can I use discord.js to check if the channel that a message is sent in is a DM?

earnest phoenix
#

How can I use discord.js to check if the channel that a message is sent in is a DM?
@wheat mesa TextChannel.type == "dm"

pure lion
#

@wheat mesa <message>.channel.type=="dm"

earnest phoenix
#

will be back in a few seconds

#

back

#

@wheat mesa the link above shows what TextChannel.type returns and you can easily check if it is a DM

wheat mesa
#

Thank you

#

🙂

hazy sparrow
#

wait so is it gonna be

 message.channel.send(`**${taggedMember.user.username}**has**${db.get(`${taggedMember.id}mybal`)"null" ? "null" : "0"}** bowbucks`)

im confused

pure lion
#

@hazy sparrow null not "null"

earnest phoenix
#
TextChannel.type == "dm" ? TextChannel.send("no DMs mate")
pure lion
#

But no

drifting wedge
#

lets say i have a box area and i want to center text in PILLOW in the center

#

how would i do that?

hazy sparrow
#

ok ty

drifting wedge
#

or align it to a side

#

like the right side?

earnest phoenix
#

using the pillow thingy?

pure lion
#

@drifting wedge get the co ordinates of the box here

drifting wedge
#

send here?

strong fractal
#

Yes

drifting wedge
#

ok

#

well just an example

#

10,10, 20,20

strong fractal
#

@drifting wedge pillow is a great library though

drifting wedge
#

and if i want to align to the right sude of it

earnest phoenix
#

hewwo Kibizoffs

drifting wedge
#

@drifting wedge pillow is a great library though
@strong fractal i respectfully disagree

strong fractal
#

@drifting wedge well, you are wrong

drifting wedge
#

ive been struggling with this shit for like 3 days

#

this is what i have to far

strong fractal
#

Lmaooo, well, it is hard for beginning, but it is useful

drifting wedge
#

u see how the xp number is like messed up

earnest phoenix
#

ive been struggling with this shit for like 3 days
@drifting wedge struggling? you will struggle with EVERYTHING in programming

hazy sparrow
#

wait pillow is also a image manupilating thingy?

drifting wedge
#

yea

strong fractal
#

@earnest phoenix Apple, do you want just to insult people or smth?

drifting wedge
#

and i sleep in it

earnest phoenix
#

gtg make a small canvas template for you to use @drifting wedge
lil' gift

strong fractal
#

If she doesn’t succeed in smth

drifting wedge
#

its a brain and image manipulation tool

hazy sparrow
#

so pillow is easier or canvas?

strong fractal
#

It doesn’t mean she won’t succeed in anything else

earnest phoenix
#

@earnest phoenix Apple, do you want just to insult people or smth?
@strong fractal i didn't

strong fractal
#

@drifting wedge struggling? you will struggle with EVERYTHING in programming

#

👁️👄👁️

drifting wedge
#

ok well can anyone help

earnest phoenix
#

the people that say I HATE THIS SHIT IT IS TOO HARD can never succeed in programming

drifting wedge
#

i want to align text

zenith knoll
#

hey

#

whats the error

drifting wedge
#

me?

zenith knoll
#

i mean

#

my error

#

lol

wheat cloud
#

^ Dont download that

#

it may have a virus

zenith knoll
#

fine ill type it

drifting wedge
#

its a txt

zenith knoll
#

its too large

hazy sparrow
#

so its

          message.channel.send(`**${taggedMember.user.username}**has**${db.get(`${taggedMember.id}mybal`)null ? null : "0"}** bowbucks`)

```?
wheat cloud
#

use pastebin

zenith knoll
#

kk

wheat cloud
#

use pastebin

hazy sparrow
#

use pastebin
@wheat cloud hastebin*

drifting wedge
#

i dont think txt can be viruses

#

use hatebin

zenith knoll
hazy sparrow
#

dont use pastebin

wheat cloud
#

its a txt
@drifting wedge there is something called a download and execute payload (in the foreground the txt file would open, but in the background a virus would get executed 🙂 )

zenith knoll
#

why

earnest phoenix
#

use hastebin

hazy sparrow
#

use hastebin

earnest phoenix
zenith knoll
#

whyyyyyyyyyyyy

drifting wedge
#

@drifting wedge there is something called a download and execute payload (in the foreground the txt file would open, but in the background a virus would get executed 🙂 )
@wheat cloud wow good to know

zenith knoll
wheat cloud
#

It literally tells you what to do 🤣

#

download python

zenith knoll
#

how

#

lmao

#

it says

#

i have a python.exe

drifting wedge
#

ok

slender thistle
#

Add Python to PATH when installing it

hazy sparrow
#

so its

          message.channel.send(`**${taggedMember.user.username}**has**${db.get(`${taggedMember.id}mybal`)null ? null : "0"}** bowbucks`)

```?
drifting wedge
#

well first LP

#

second download python

wheat cloud
#

"You need to install the latest version of Python."

#

"Error: Could not find any Python installation to use"

hazy sparrow
#

@misty sigil am i correct?

zenith knoll
#

Add Python to PATH when installing it
@slender thistle wat

#

im new to this sorry

#

im coding in discord JS

#

not py

hazy sparrow
#

but it requires python to download

zenith knoll
#

tf

wheat cloud
earnest phoenix
#
const { createCanvas } = require("canvas");
var canvas = createCanvas(1000, 200);
var ctx = canvas.getContext("2d");
ctx.fillStyle = `rgb(0, 0, 0)`;
ctx.drawRect(0, 0, 100, 200);
ctx.fillStyle = "rgba(255, 255, 255, 0.5)";
ctx.drawRect(500, 150, 450, 25);
message.reply(new Discord.Attachment(canvas.toBuffer(), "image.png"));

@drifting wedge smol template for making a rank card in canvas

zenith knoll
#

thx

#

lemme red

earnest phoenix
#

@zenith knoll he's talking to bow pro

zenith knoll
#

ho9w

#

he pinged me

slender thistle
#

see that tick

drifting wedge
#

the card works

#

but the isuse is centering text

#

or aligning text in a box

slender thistle
hazy sparrow
#

no one is answering me question smh

earnest phoenix
#

@slender thistle finally i am not alone in this terrible server where people only complain about people using Windows 7

zenith knoll
#

whars the Python’s install directory?

hazy sparrow
#

im in windows 7 ultimate not windows 7 lol

#

its still trash to

slender thistle
#

I can rant about Win7 support for some programs I want, but it's not worth it

zenith knoll
#

i have 2

#

a python27 and 37

#

folder

#

with python . exe in bvoth

wheat cloud
#

use 3.7

earnest phoenix
#

a python27 and 37
@zenith knoll wait you live in the future?

restive furnace
#

py -3 command to run python3 cmd

zenith knoll
#

k

wheat cloud
#

@restive furnace -3 is not an argument

restive furnace
hazy sparrow
#

asking for the 5th time is this correct

          message.channel.send(`**${taggedMember.user.username}**has**${db.get(`${taggedMember.id}mybal`)null ? null : "0"}** bowbucks`)

wheat cloud
#

asking for the 5th time is this correct

          message.channel.send(`**${taggedMember.user.username}**has**${db.get(`${taggedMember.id}mybal`)null ? null : "0"}** bowbucks`)

@hazy sparrow why dont you test it

hazy sparrow
#

oh yea lemme try that

acoustic bridge
#
@client.event
async def on_member_join(member):
    guild = member.guild
    if guild != guild_id:
        return

Situation: bot is in 2 servers, but he should only send welcome messages in the one, i replace the (guild_id) with, how do i fix it?

wheat cloud
#

@restive furnace

restive furnace
#

py -3

earnest phoenix
#

ctx.drawRect is not a function in canvas?

restive furnace
#

not python -3

earnest phoenix
#

fillRect bruh

wheat cloud
#

py: command not found...

#

lol

restive furnace
#

unless you're on mac/linux, then it is python3

zenith knoll
#

what is ther directory for my python37?

#

C://something/python37

#

like

#

whats default

hazy sparrow
slender thistle
#

@acoustic bridge What's guild_id

restive furnace
#

where python @zenith knoll

acoustic bridge
#

uhh the server i want to send the messages in

zenith knoll
#

look

#

ss

wheat cloud
#
whereis python```
hazy sparrow
#

where am i supposed to put the }

zenith knoll
#

ok

#

lemme do that

restive furnace
#
whereis python```

@wheat cloud that work mac

acoustic bridge
#

so if a member joins a different server, the bot wont send the welcome message in that server, @slender thistle

zenith knoll
#

PS D:\dbots\newbot> whereis python
whereis : The term 'whereis' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • whereis python
  •   + CategoryInfo          : ObjectNotFound: (whereis:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
slender thistle
#

I just asked what you defined guild_id as

acoustic bridge
#

a specific guild

#
guild = member.guild
    if guild != 625061517859225647:
        return
slender thistle
#

so

acoustic bridge
#

somethings wrong

#

when the member joins that guild

slender thistle
#

comparing a guild object against an integer

acoustic bridge
#

I see

zenith knoll
#

PS D:\dbots\newbot> whereis python
whereis : The term 'whereis' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • whereis python
  •   + CategoryInfo          : ObjectNotFound: (whereis:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    
    

i was supposed to do whereis python?

acoustic bridge
#

How do i fix guild then?

slender thistle
#

guild.id

zenith knoll
acoustic bridge
#

if member.guild_id != ... ?

#

ahhhh

#

Alright, will try

zenith knoll
#

can i get help lmao

drifting wedge
#

how can i align text in a box in PILLOW?

zenith knoll
#

?

#

dude ur clowning

pale vessel
#

didn't tim answer you?

zenith knoll
#

^

drifting wedge
#

no

#

i didnt see it at least

#

ill check ty

zenith knoll
#

🤣

#

lol

pale vessel
#

never mind

zenith knoll
#

ok

earnest phoenix
#

link me MDN docs for canvas API drawImage() please

fervent goblet
#

is there a way to get channel mentions with discord.js?

pale vessel
#

mentions.channels?

zenith knoll
#

can i gfet help

#

?

pale vessel
#

yes you can

fervent goblet
#

idk if thats a thing tho

drifting wedge
#

nope

zenith knoll
#

PS D:\dbots\newbot> whereis python
whereis : The term 'whereis' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • whereis python
  •   + CategoryInfo          : ObjectNotFound: (whereis:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
pale vessel
#

it is

drifting wedge
#

he didnt

fervent goblet
#

ok

pale vessel
zenith knoll
#

when i try to find pythom

hazy sparrow
pale vessel
#

show code

earnest phoenix
#

thanks @pale vessel you're my pineapple canvas helper

hazy sparrow
#

me?

pale vessel
#

yes

earnest phoenix
#

@hazy sparrow show template expression

pale vessel
#

wait

hazy sparrow
#

ok wait hold on a sec

pale vessel
#

never mind

earnest phoenix
#

it is a string

pale vessel
#

it's in there

earnest phoenix
#

the place where the error happened should be smth like:

`${not ended`
pale vessel
#

no he got it right

#

but this

earnest phoenix
#

that's not right

hazy sparrow
#
const db = require("quick.db")

module.exports = {
    name: 'work',
    description: "flip a coin!",
    
    execute(message){
      if (message.author.id == 542278740537769985) {
      const taggedMember = message.mentions.members.first()
      if(!taggedMember) {
      const bal = new db.table(`${message.author.id}mybal`) 
      
      message.channel.send(`you currently have **${db.get(`${message.author.id}mybal`)}** bowbucks`)
      }
      if(taggedMember){
          const bal = new db.table(`${taggedMember.id}mybal`)
          
          message.channel.send(`**${taggedMember.user.username}**has**${db.get(`${taggedMember.id}mybal`)null ? null : "0"}** bowbucks`)
      }}
    }
      
    
     
    }
earnest phoenix
#

module.exports

pale vessel
#

escape the `

earnest phoenix
#

has it ended

pale vessel
#

that's.... correct?

#

i don't get this

hazy sparrow
#

escape the `
@pale vessel where?

pale vessel
#

add \

hazy sparrow
#

i don't get this
@pale vessel dont worry it works

pale vessel
#

before all `'s inside `

hazy sparrow
#

i dont understand aa

pale vessel
#
${db.get(`${taggedMember.id}mybal`)null ? null : "0"}** bowbucks`)```
#

what do you mean by this?

zenith knoll
amber tulip
#

does anyone have the css code to make the icon move up and down?

zenith knoll
#

\ \

#

for the ``

earnest phoenix
#

@pale vessel loadImage() returns a Promise, how would I use it in ctx.drawImage(image, dx, dy) waitWhatSpinwaitWhatSpinwaitWhatSpin

pale vessel
#
`something \` inside \` something `
#

@hazy sparrow

hazy sparrow
#

oh wait hold on

pale vessel
#

add await

#

resolve the promise

earnest phoenix
#

does anyone have the css code to make the icon move up and down?
@amber tulip that's the <marquee> tag in HTML not CSS

pale vessel
#

or use then but that's wack

earnest phoenix
#

also spoonfeed

pale vessel
#

marquee is old af

earnest phoenix
#

yeah

pale vessel
#

don't use that

earnest phoenix
#

obsolete

#

yet i still use it

pale vessel
#

also, i'm pretty sure he wants keyframes

amber tulip
#

where do i put the marquee

pale vessel
#

nono

near ether
earnest phoenix
#

loadImage() returns a Promise, how would I use it in ctx.drawImage(image, dx, dy)waitWhatSpinwaitWhatSpinwaitWhatSpin

pale vessel
hazy sparrow
#
          message.channel.send(\`**${taggedMember.user.username}**has**${db.get(\`${taggedMember.id}mybal\`)null ? null : "0"}** bowbucks`)
```am i correct?
misty sigil
#

no

earnest phoenix
pale vessel
#

code

earnest phoenix
#

ok

amber tulip
amber tulip
#

like this one

cinder patio
#
10
/ \
5  15
   / \
   6  20

This should be a correct binary search tree, right? Leetcode is telling me it's not a valid binary tree.

fervent goblet
#

im drawing a massive blank does anyone know what this is?
message.mentions.channels.[something that gets multiple mentions]

pale vessel
#

it's a collection

#

(mentions.channels)

fervent goblet
#

ik there is something that puts it in array

#

i forgot what it was

pale vessel
#

collection.array()

hazy sparrow
#
${db.get(`${taggedMember.id}mybal`)null ? null : "0"}** bowbucks`)```

@pale vessel its supposed to get the thing and make it 0 if its null

pale vessel
#

oh

#

i see

fervent goblet
#

ty

misty sigil
#

@hazy sparrow
db.get ? db.get // this gets if true : "0"

#

iirc

earnest phoenix
#

resolve the promise
@pale vessel so basically loadImage(url).then(img => img.image);? The npm package wiki shows that it returns Promise<Image> so I think Image is a property of the Promise returned. Not very experienced with Promises I am (pun intended)

pale vessel
#

can you use await?

hazy sparrow
#

bruh am i drunk today

zenith knoll
#

what does this ratelimit event output mean?
@near ether slomode? rate limit?

#

like

#

u used api too much

#

ig

pale vessel
#
const image = await loadImage(url);
ctx.drawImage(image, 0, 0, w, h);```
hazy sparrow
#

can someone spoonfeed that one line mmLol

pale vessel
#

like this

#

you can do the same for .then too

near ether
#

ik but im not sure how i interpret that output

opal plank
hazy sparrow
#

...

opal plank
pale vessel
#

you don't need ternary for that

hazy sparrow
#

oh

#

got it

pale vessel
#

if it's falsy then it would be zero

earnest phoenix
#

you can do the same for .then too
@pale vessel uhhh kthnxbai

restive furnace
#

nitro flex lol

pale vessel
#

yikes

earnest phoenix
#

lol

hazy sparrow
#
          message.channel.send(`**${taggedMember.user.username}**has**${db.get(\`${taggedMember.id}mybal\`) || "0"** bowbucks`)

restive furnace
#

mehh i had nitro 4 times, and nothing special in reality

earnest phoenix
#

lemme test loadImage() with my avatar URL

pale vessel
#

add }

#

close the template expression

#

@earnest phoenix js loadImage(url).then(image => ctx.drawImage(image, ...));

earnest phoenix
pale vessel
#

but you must continue your code in the .then

#

that's why await is more poggers

earnest phoenix
hazy sparrow
#

close the template expression
@pale vessel ik that but i cant find where to add it

pale vessel
#

after "

hazy sparrow
#

oh

#

got it

#

ty

pale vessel
#

try to understand what that code does

restive furnace
#
nothing.then(b => b.then(c => c.then(d => d.then(e => e.then(() => undefined)))));```
#

:+1:

hazy sparrow
#

it just becomes a part of that string

pale vessel
#
const foo = false || "value";
foo; // value
#

same goes for null, undefined and other falsy values

#

it'll pick "value"

#

if there's no balance, it will pick "0" instead of null in your case

hazy sparrow
#
          message.channel.send(`**${taggedMember.user.username}**has**${db.get(\`${taggedMember.id}mybal\`) || "0"}** bowbucks`)

pale vessel
#

yes

earnest phoenix
#

@pale vessel yes i will ping you for all canvas stuff ctx.drawImage() does not take JIFs? waitWhatSpin waitWhatSpin waitWhatSpin

pale vessel
#

correct

earnest phoenix
#

uhh k

hazy sparrow
#

no

earnest phoenix
#

i need someone without nitro here so i can test his pfp in canvas
koya always returns JIF avatars if available

hazy sparrow
#

yes
@pale vessel it still shows that error thing

slender thistle
#

without Nitro here

pale vessel
#

you know what

earnest phoenix
#

@pale vessel still no work

#

wow much doge talk

pale vessel
#

try js message.channel.send(`**${taggedMember.user.username}**has**` + (db.get(`${taggedMember.id}mybal`) || "0") + "** bowbucks");@hazy sparrow

hazy sparrow
#

Oki wait

amber tulip
#

does anyone have the code to make the Bot Icon float up and down?

earnest phoenix
#
const { createCanvas, loadImage } = require('canvas');
const canvas = createCanvas(1000, 200)
const ctx = canvas.getContext('2d');

loadImage("https://cdn.discordapp.com/avatars/542278740537769985/0ab0e7693625d4b34acc7fc2f70ffdb6.png?size=4096").then(image => ctx.drawImage(image, 250, 250, 250, 250));
ctx.fillStyle = "rgb(0, 0, 0)";
ctx.fillRect(0, 0, 1000, 200);
ctx.fillStyle = "rgba(255, 255, 255, 0.5)";
ctx.fillRect(500, 140, 450, 30);
const fs = require("fs");
const out = fs.createWriteStream(__dirname + '/test.png')
const stream = canvas.createPNGStream()
stream.pipe(out)
out.on('finish', () => console.log('The PNG file was created.'))

@pale vessel this still does not draw the image

hazy sparrow
#

do i have to include that + too?

pale vessel
#

wait bow

amber tulip
#

does anyone have the code to make the Bot Icon float up and down?

pale vessel
#

now

#

i edited it

earnest phoenix
#

does anyone have the code to make the Bot Icon float up and down?
@amber tulip spoonfeed spoonfeed

amber tulip
#

apologies, i just don't really know what to do

hazy sparrow
#

oki wait

amber tulip
#

and i'm not prepared to learn a whole programming language just to make an image float

pale vessel
#

like i said you need to continue your code in .then if you use .then

earnest phoenix
#

await won't work

amber tulip
#

i dont even know where to start

earnest phoenix
#

for some reason if i put my code inside async () => {} it never logs anything in the console

pale vessel
#

then use ```js
.then(image => {
ctx.drawImage();
ctx.fillStyle = ...

earnest phoenix
#

even when i do console.log()

#

@pale vessel lemme test

pale vessel
#

continue your code inside then

hazy sparrow
#

it works @pale vessel ty so much

pale vessel
#

` inside ` is really confusing

#

i tend to avoid those, even if they can be escaped

earnest phoenix
#

ok

amber tulip
#

can someone please help me make the icon move up and down.

earnest phoenix
#
/home/runner/test/index.js:7
ctx.drawImage(image, 250, 250, 250, 250);
                                       ^

SyntaxError: missing ) after argument list
amber tulip
#

please

earnest phoenix
#

can someone please help me make the icon move up and down.
@amber tulip PLEASE FIGURE OUT SOME STUFF ON YOUR OWN INSTEAD OF FLOODING CHAT

#

not minimodding i am literally screaming

misty sigil
#

HELP HIM FIGURE IT OUT

amber tulip
#

look bro, i don't know where to get started.

i just want some help pleasde

misty sigil
#

FFS

amber tulip
#

god.

#

thank you matthew

pale vessel
#

what do you need help with?

misty sigil
#

right I’ll see if I can find something

#

can someone please help me make the icon move up and down.

amber tulip
#

it's all i want

misty sigil
#

icon referring to top.gg bot icon I believe

pale vessel
#

in your bot's description? in your website?

amber tulip
#

like this

pale vessel
earnest phoenix
#

how can I do a spotify api access token renewal?
the token expires in 1 hour.

pale vessel
midnight blaze
#

ah

#

hey

#

flazepe

earnest phoenix
#

look bro, i don't know where to get started.

i just want some help pleasde
@amber tulip then why are you repeating the same question multiple times and flooding chat

pale vessel
#

yeah hi

amber tulip
#

because nobody is helping me

pale vessel
#

swinsor, i did help you

amber tulip
#

well, not till now

earnest phoenix
#

still don't get why it ain't drawing the image

amber tulip
#

sorry yeah i meant that

pale vessel
#

oh okay, my bad

#

still don't get why it ain't drawing the image
@earnest phoenix what did you do

earnest phoenix
#

i'll try JSON.stringify() the image parameter

pale vessel
#

no don't

earnest phoenix
#

got it

amber tulip
#

idek how to change the specific css for the image

#

if there is

misty sigil
#

There is.

pale vessel
#

you use the html <style> tag

earnest phoenix
#

i am drawing the background for the canvas AFTER loading the user pfp and drawing it
i am so fucking dumb

misty sigil
#

should be able to find it by inspecting the page iirc

midnight blaze
#

why are you doing that, when you have no clue about css

#

just keep it how it is

hazy sparrow
#

guys is canvas better or pillow

amber tulip
#

why are you doing that, when you have no clue about css
@midnight blaze because i want something to look cool?

midnight blaze
#

it wont look cool when you are a beginner

pale vessel
#

canvas is javascript and pillow is python

amber tulip
#

thanks for the help @misty sigil @pale vessel

earnest phoenix
#

uhh stil not working

ember lodge
#

Someone knows an api or a package for NodeJS to know if a photo is similar to another one?

misty sigil
hazy sparrow
#

Ok I didn't knew that

pale vessel
#

jimp

earnest phoenix
amber tulip
#

it wont look cool when you are a beginner
@midnight blaze that's why im trying to get help with it finger_guns_cool

pale vessel
hazy sparrow
#

is there any other image manupulating thing for javascript?

ember lodge
#

Thanks

earnest phoenix
#
ctx.fillStyle = "rgb(0, 0, 0)";
ctx.fillRect(0, 0, 1000, 200);
loadImage("https://cdn.discordapp.com/avatars/542278740537769985/0ab0e7693625d4b34acc7fc2f70ffdb6.png?size=4096").then(image => ctx.drawImage(image, 250, 250, 250, 250));
ctx.fillStyle = "rgba(255, 255, 255, 0.5)";
ctx.fillRect(500, 140, 450, 30);

@pale vessel

pale vessel
#

like i said

#

continue it inside the then

earnest phoenix
#

ok

pale vessel
#

not just canvas, there's sharp, lwip and more

#

sharp is more efficient and faster than canvas

#

also, jimp but it can be slow

hazy sparrow
earnest phoenix
#
/home/runner/test/index.js:9
ctx.drawImage(image, 250, 250, 250, 250);
                                       ^

SyntaxError: missing ) after argument list
``` this is coming
pale vessel
#

jimp is pure javascript

midnight blaze
#

sharp is really faster?

pale vessel
#

yeah it is

earnest phoenix
#

fuck me

#

i am so dumb

pale vessel
#

no i'm straight

midnight blaze
#

I guess I have to upgrade all my script from canvas to sharp

#

yes, I am str8

#

we saw that

pale vessel
#

you don't need to

#

canvas is really fast too

earnest phoenix
#

i found out that i was drawing the background on top of the avatar THEN I FIXED IT AND PRESSED CTRL + Z WHY CS_AlphabetW CS_AlphabetHCS_AlphabetY

thick gull
#

can you make a box in canvas and then center text in it?

pale vessel
#

yes

midnight blaze
#

then press ctrl + y

thick gull
#

what baout like

#

breaking the text

pale vessel
#

you make a function for it

#

use ctx.measureText()

thick gull
#

:angy;

#

okay

midnight blaze
#

flazepe: entering a lvl 1 field while being lvl 100.

earnest phoenix
#
const { createCanvas, loadImage } = require('canvas');
const canvas = createCanvas(1000, 200)
const ctx = canvas.getContext('2d');

loadImage("https://cdn.discordapp.com/avatars/276060004262477825/80ec456b92db2eabbcca79bd9bf07ee6.png?size=4096")
.then(image => {
ctx.fillStyle = "rgb(0, 0, 0)";
ctx.fillRect(0, 0, 1000, 200);
ctx.drawImage(image, 250, 250, 250, 250);
ctx.fillStyle = "rgba(255, 255, 255, 0.5)";
ctx.fillRect(500, 140, 450, 30);
const fs = require("fs");
const out = fs.createWriteStream(__dirname + '/test.png')
const stream = canvas.createPNGStream()
stream.pipe(out)
out.on('finish', () => console.log('The PNG file was created.'))
});

@pale vessel master, one of your disciples is in serious trouble
help him
please_sign_bean

#

i'll use Image class from canvas

zenith knoll
#

hey

#

uh

#

i dont get it

#

lmao

#

after searching on google for a bit

#

cant find oythoin

midnight blaze
#

@earnest phoenix can you explain to me, why you are doing it this way and not edit your picture on photoshop and simply load it?

earnest phoenix
#

@earnest phoenix can you explain to me, why you are doing it this way and not edit your picture on photoshop and simply load it?
@midnight blaze do you think a bot can use photoshop

midnight blaze
#

wait, let me see

#

that picture

#

so you want to get the avatar and edit it, right?

#

ah, ok, then, sry, I didnt know what kind of picture it was

hazy sparrow
#

how do i check who has the most "xp" in quick.db?

earnest phoenix
#
const { createCanvas, loadImage , Image } = require('canvas');
const canvas = createCanvas(1000, 200)
const ctx = canvas.getContext('2d');
let img = new Image();
img.src = "https://cdn.discordapp.com/avatars/276060004262477825/80ec456b92db2eabbcca79bd9bf07ee6.png?size=4096";
img.onload = () => ctx.drawImage(img, 0, 0)

This outputs:

ReferenceError: image is not defined
  1. I have defined Image.
  2. Why does it say image in lowercase.
midnight blaze
#

fetch the data and sort it in an array

hazy sparrow
#

fetch the data and sort it in an array
@midnight blaze me?

midnight blaze
#

yep

earnest phoenix
#

why am i sodumb

hazy sparrow
#

Oh ok, ty!

#

@earnest phoenix probably because you used image not Image

cinder patio
#

Fetching all data means loading it into memory. This is why quick.db is bad. SQLITE provides a native way of getting it, (MAX).

hazy sparrow
#

Doesesnt quick.db uses SQLite?

misty sigil
#

yes

cinder patio
#

yes, it does

#

But quick.db's api is very limited.

hazy sparrow
#

Yea thats true

midnight blaze
#

why not mongoose. Quickdb is not really that good anyway. I only used it for one day

cinder patio
#

Yes, quickdb is bad, but you can still use SQLite. quickdb isn't the only SQLite wrapper

earnest phoenix
#
ctx.fillStyle = "rgb(0, 0, 0)";
ctx.fillRect(0, 0, 1000, 200);
ctx.fillStyle = "rgba(255, 255, 255, 0.5)";
ctx.fillRect(500, 140, 450, 30);
var img = new Image();
img.onload = () => ctx.drawImage(img, 0, 0);
img.onerror = err => { throw err }
img.src = "https://cdn.discordapp.com/avatars/276060004262477825/80ec456b92db2eabbcca79bd9bf07ee6.png?size=4096";

Just,
CS_AlphabetW CS_AlphabetH CS_AlphabetY DOESN'T THIS WORK

thick gull
#

i only use quickdb for small projects

cinder patio
#

I suggest checking out Sequelize. It's not only a SQLite ORM but also supports other databases

midnight blaze
#

@earnest phoenix wait for flazepe 🙏

#

xD

thick gull
#

@earnest phoenix what is your error

earnest phoenix
#

i am drawing the background before drawing the image

thick gull
#

? ? ?

#

async?

earnest phoenix
#

@earnest phoenix what is your error
@thick gull there is no error

#

else the program would have exited before saving

hazy sparrow
#

I suggest checking out Sequelize. It's not only a SQLite ORM but also supports other databases
@cinder patio sequelize is hard af for me i might learn it later

earnest phoenix
#
img.onerror = err => { throw err }
img.src = "https://cdn.discordapp.com/avatars/276060004262477825/80ec456b92db2eabbcca79bd9bf07ee6.png?size=4096";
const fs = require("fs");
const out = fs.createWriteStream(__dirname + '/test.png')
const stream = canvas.createPNGStream()
stream.pipe(out)
out.on('finish', () => console.log('The PNG file was created.'))

It is saving the file AFTER telling canvas to throw an error if there is.

#

If it can still save the file then there is no error

#

@pale vessel our canvas savior and messiah

midnight blaze
#

tim is like super advanced with canvas, but he isnt online

cinder patio
#

So, fs saves the image before canvas is able to manipulate it? I don't really understand your question

earnest phoenix
#

no

#

fs saves the file after all the canvas shit is done

cinder patio
#

Then what's wrong?

earnest phoenix
#

idk

#

canvas hates me ig

midnight blaze
#

@earnest phoenix just wait for someone who is more experienced with it 👀

earnest phoenix
sinful belfry
#

@late meadow read the rules

earnest phoenix
misty sigil
#

thanks starman

sinful belfry
#

no self promotion in this server ty

late meadow
#

ok

#

sorry oops

misty sigil
#

WHY DIDNT U READ THE RULES

late meadow
#

thanks for deleting

misty sigil
#

reasons why dbl needs a 2 minute verification period.

midnight blaze
#

no read rules why

late meadow
#

it was meant for another server😩

midnight blaze
#

dbl needs a quiz when you join the server and they ask you about certain rules

#

ez

sinful belfry
cinder patio
#

Code, you haven't described your problem at all. All you've said to me is that canvas hates you. How doesn't your code work? What are you expecting it to do / what does it actually do?

earnest phoenix
#

Code, you haven't described your problem at all. All you've said to me is that canvas hates you. How doesn't your code work? What are you expecting it to do / what does it actually do?
@cinder patio read my previous messages

#

me is buzy rn writing a big-ass post on repl.it

cinder patio
#

I am not sure if that's how you load images, does the image load?

earnest phoenix
#

maybe

#

i copy pasted the loading and src thingies from the wiki and replaced the URLs and dx dy shit properly
copy pasted code is supposed to work right

cinder patio
#

Why don't you try using the loadImage method? I've used it before and it works fine

earnest phoenix
#

ok

faint prism
cinder patio
#

What's the actual image produced by canvas?

earnest phoenix
#

idk

#

lemme make it a buffer

pale vessel
#

why don't you use canvas.toBuffer()

earnest phoenix
#
FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.
 1: 0xa093f0 node::Abort() [node]
 2: 0xa097fc node::OnFatalError(char const*, char const*) [node]
 3: 0xb8407a v8::Utils::ReportApiFailure(char const*, char const*) [node]
 4: 0x7fb7eddec45b Image::SetSource(Nan::FunctionCallbackInfo<v8::Value> const&) [/home/runner/test/node_modules/canvas/build/Release/canvas.node]
 5: 0x7fb7edde7a49  [/home/runner/test/node_modules/canvas/build/Release/canvas.node]
 6: 0xbf0239  [node]
 7: 0xbf2027 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
 8: 0x13cf119  [node]
#

img.onload = () => {ctx.drawImage(img, 0, 0, 250, 250); console.log(img.toBuffer())}

pale vessel
#

ran out of memory?

earnest phoenix
#

idk

pale vessel
#

you don't need image

#

the class

#

use loadImage

#

the first code you sent should have worked

#

you should use canvas.toBuffer() and send using MessageAttachment

midnight blaze
#

that is how I do it as well O:

cinder patio
#

I think code's way of loading the image is correct, but at the same time, loading the image is done via a callback, so this:

const fs = require("fs");
const out = fs.createWriteStream(__dirname + '/test.png')
const stream = canvas.createPNGStream()
stream.pipe(out)
out.on('finish', () => console.log('The PNG file was created.'))

This executes before the image is loaded, because it's not in the callback function (the "onload" event")

earnest phoenix
#

with console.log(canvas.toBuffer());:

<Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 03 e8 00 00 00 c8 08 06 00 00 00 7b e7 cb 4f 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 ... 78986 more bytes>
pale vessel
#

yeah

#

go back to the first code you mentioned me

cinder patio
#

You should put the rest of the code in the callback

earnest phoenix
#

I'm feeling proud I made two people older than me sit and waste their time trying to fix my weird problem

midnight blaze
#

how do you know that they are older?

earnest phoenix
#

DONE

midnight blaze
#

flazepe is only 13, he is just a prodegy

earnest phoenix
#

You should put the rest of the code in the callback
@cinder patio YES IT WORKS NOW

midnight blaze
#

xD

earnest phoenix
#

💋

midnight blaze
#

gg

pale vessel
#

bruh img.src is slow

earnest phoenix
cinder patio
#

It's the same thing as loadImage, internally the exact same thing is done afaik

lethal raptor
#

is there a way that if i upvote the bot it will get the user and send dm?

midnight blaze
#

use dark mod at least

#

pls

pale vessel
#

hmm okay then

#

gg

earnest phoenix
#

@midnight blaze dark mode only works inside the IDE not on talk page

midnight blaze
#

ah, true

earnest phoenix
#

is there a way that if i upvote the bot it will get the user and send dm?
@lethal raptor #topgg-api

pale vessel
#

nah there's dark mode

midnight blaze
#

didnt use repl for a long time

lethal raptor
#

ok

midnight blaze
#

instead of img.src
why not const picture = await Canvas.loadImage('./unbenannt.png');
? Or am I missing something. I have just never seen anyone using img.src

cinder patio
#

laodImage is a promise version of that

#

same thing, but a promise

earnest phoenix
midnight blaze
#

yes, but isnt that better in this case? Or it doesnt matter which one you use in the end

cinder patio
#

I don't see why it would be. Both versions have their pros and cons, but mostly it's a visual preference

earnest phoenix
#

@cinder patio i want to hug you right now man

#

laodImage is a promise version of that
@cinder patio laod

cinder patio
#

🤗

earnest phoenix
#

instead of img.src
why not const picture = await Canvas.loadImage('./unbenannt.png');
? Or am I missing something. I have just never seen anyone using img.src
@midnight blaze my function ain't async and i don't want to put everything inside .then() wait i am putting everything inside the callback function for img.load anyways

#

gtg guys

#

how to disable "typing_start" event in discord.js v12 ? (clientOptions.disabledEvents doesnt exists anymore)

pale vessel
#

intents

clear arrow
#

how can i get if a user has nitro?

misty sigil
#

you can’t.

#

at least not precisely

sudden geyser
#

I think you'd use the ws.intents client option

misty sigil
#

unless you use some sort of oauth

clear arrow
#

like with boost level or smth

misty sigil
#

yes

#

That’s another way

clear arrow
#

BOOSTER_LEVEL_1 i tried this and its not working

misty sigil
#

<member>.premiumSince

pale vessel
#

note that it's based on the guild so it can be different than what you see in their profile since that's global

clear arrow
#

uum ok

acoustic bridge
#

why does it say unexpected unident for @client.command() ?

pale vessel
#

you unindented unexpectedly smart

acoustic bridge
#
#Setup
@client.command()
async def setup(ctx):
    try:
        channel = client.get_channel(an id)

        embed = discord.Embed(
        title = "title:",
        description = "descrp",
        colour = discord.Colour.green()
        )

        embed.set_image(url="an url")
        await channel.send(embed=embed)
#

it marks the @

clear arrow
#

another one, how can i get the device that user is on?

#

like mobile web desktop

pale vessel
#

presence.clientStatus

clear arrow
#

ReferenceError: presence is not defined

earnest phoenix
#

@fast trench No worries, I figured out what was wrong, I didn't put {embed:greet} at the end of my greetmsg

#

thanks anyway

pale vessel
#

define it

#

don't just copy paste

misty sigil
#

<user>.presence.clientStatus

pale vessel
#

get the member's presence ^

#

depends on the library

fast trench
#

Sounds good

clear arrow
#

uh yea, its working

#

thanks!

earnest phoenix
#

Hello

#

Back

clear arrow
#

@misty sigil and how can i put it in embed?

#
        switch (member.presence.clientStatus) {
      case 'desktop':
        clstatus = 'x'
        break
      case 'web':
        clstatus = 'xx'
        break
      case 'mobile':
        clstatus = 'xxxxxxxx'
        break
    }```
#

its not working

earnest phoenix
#

How do I unban a user through a normal user not through a bot?

misty sigil
#

let clstatus;

earnest phoenix
#

I have access to audit log

clear arrow
#

i get undefined in embed

misty sigil
#

aye i see what happened

#

is member a user?

clear arrow
#

yes

earnest phoenix
#

@misty sigil i meant through the actual discord app not through code or bots or all that jazz

misty sigil
#

its under bans

clear arrow
#

const member = message.mentions.members.last() || message.guild.members.cache.get(user.id) || message.member;

misty sigil
#

member.user

#

thats a member

#

a user is user data

#

a member is guild-specific

clear arrow
#

uuh ok

#

wait

stark abyss
#

just wondering but how hard is to shard a database and discord bot stuff?

cerulean ingot
#

does anyone have a name idea for my bot, its a moderation, economy, fun, utility, and welcome/leave bot

stark abyss
#

um

#

what do u like?

faint prism
#

just wondering but how hard is to shard a database and discord bot stuff?
@stark abyss shard a database?

cerulean ingot
#

any suggestion helps

stark abyss
#

that's a thing right thisIsMyLifeNow

cerulean ingot
#

i want something that people will add to their server

faint prism
#

I think so

stark abyss
#

i c

#

um

#

do you like anime!

faint prism
#

You probably don't need to shard a database, but I could see a client.
What makes you think you need to shard part of your application?

stark abyss
#

ComplexBot there

clear arrow
#

member.user.presence.clientStatus @misty sigil

cerulean ingot
#

i dont watch it but would like to name a bot off if it

stark abyss
#

You probably don't need to shard a database, but I could see a client.
What makes you think you need to shard part of your application?
@faint prism I don't I am just wondering how hard it would be

#

For future

#

idk

native osprey
#

const Discord = require('discord.js');
const bot = new Discord.Client();

const token = 'Token code';

bot.on('ready',() =>{
console.log('This bot is online!');
})

bot.login(token;)

#

Why do this here not work?

misty sigil
#

that isnt enough info

#

"DOESNT WORK"

#

give us an error

#

😩

sinful belfry
#

(that semi-colon at the end should be outside of the brackets btw)

proven lantern
#

do i need Ban Members permission for my bot to check if a user is banned? I have these permissions, but my bot is getting a missing permissions error.

misty sigil
#

audit logs iirc

sinful belfry
proven lantern
#

mmkay, trying it out

sinful belfry
#

you need BAN_MEMBERS

cerulean ingot
#

does anyone have a name idea for my bot, its a moderation, economy, fun, utility, and welcome/leave bot. any suggestion helps, i want something original and something attractive.

proven lantern
#

nooo!

sinful belfry
#

you can probably figure out what the equivalent is for ur lib

proven lantern
cerulean ingot
#

var token

sinful belfry
#

@native osprey reset your token again

cerulean ingot
#

and you just leaked it

sinful belfry
#

stop sending it lol

#

it's basically a password

fervent goblet
#

bot.once

cerulean ingot
#

idk js

#

but i know a small amount

#

i think its var token

fervent goblet
#

no

sinful belfry
#

that's just a variable

cerulean ingot
#

yeah

#

isnt that what you want

#

idk i code in python

fervent goblet
#

its not because he is using on instead of once

sinful belfry
#

once?

#

it's 'on' because it is an event listener

fervent goblet
#

its once in sure

warm marsh
#

You'd use once when an event is fired once, on is used for constantly listen.

sinful belfry
#

ah

fervent goblet
#

^

sinful belfry
#

that makes sense

warm marsh
#

It makes no difference though.

proven lantern
#
    console.log(`a member is banned from a guild`);
});``` can i use this without `Ban Members` permissions?