#development

1 messages · Page 1473 of 1

pale vessel
#

and I think you should str() the ctx.author

hasty mulch
#

Ok

#

@pale vessel Thank you

quiet arch
#

how do i make a command that creates a role

guild.roles.create({
  data: {
    name: 'Super Cool People',
    color: 'BLUE',
  },
  reason: 'we needed a role for Super Cool People',
})
  .then(console.log)
  .catch(console.error);```
i know this works but  ```guild is not defined```
wet scroll
#

Define guild

quiet arch
#

how do i do that?

pale vessel
#

isn't this from the docs example

quiet arch
#

yes it is haha

wet scroll
#

Probably lmao

pale vessel
#

you can use message.guild

#

otherwise grab the appropriate guild from client

quiet arch
#

huh i dont understand 😅

quiet arch
#

o

#

thank u

hasty mulch
#

How do I raise an error in an argument that isn’t a Member. Ie:
mb!eject @LIPD Productions Inc.#1205
would function fine, while
mb!eject Test
would throw an error

#

Python again

hollow sedge
#

Can you share your current code for the command

#

You can just cast it to a member in the argument: member : discord.Member or member : discord.User

hasty mulch
#

One sec

earnest phoenix
#

who use canvas ?

#

pls

#

i need help

mellow kelp
#

me

#

but don't ask to ask, just say it

earnest phoenix
#

ok

hasty mulch
# hollow sedge Can you share your current code for the command
@commands.command(name='eject')
async def _eject(self, ctx, member: discord.Member):
    options = [
     'was an Imposter',
     'was not an Imposter',
     'was the Imposter',
     'was not the Imposter']
    if ctx.author.id in bot.blacklisted_users: return
    else:
        option = random.choice(options)
        print(f'Ejected {member}')
        print(f'{member} {option}')
        embed = discord.Embed(
            title='VOTE THE IMPOSTER OUT!',
            type='rich',
            description=f'''
{ctx.author.mention} ejected {member.mention}


*{member} {option}*
''')
        embed.set_author(name=ctx.author, icon_url=str(ctx.author.avatar_url))
        embed.set_footer(text="Developed by LIPD Productions Inc.#1205",icon_url=str(ctx.guild.icon_url))
        embed.timestamp=datetime.datetime.utcnow()
        await ctx.send(embed=embed)
    pass
#

Tag me when you respond, Cloud

delicate shore
delicate shore
#

Discord removed this feature

#

From mobile

hollow sedge
#

that was never a discord feature

#

You can only use that in embeds

#

And only bots can send embeds

delicate shore
#

No

pale vessel
#

It worked on mobile for some time

delicate shore
#

It was a feature

delicate shore
hollow sedge
#

Oh weird

#

When?

delicate shore
#

I'll show you

pale vessel
#

Probably a bug

hasty mulch
delicate shore
#

This ss is from 22nd nov

hollow sedge
#

Yeah it was probably a bug

#

They wouldn't have just added it back in and taken it out

hasty mulch
#

Oh, wait, I think it’s passing silently, hang on

hollow sedge
#

It's a security risk too, the users don't see what website they're clicking on

delicate shore
#

Yes

hollow sedge
delicate shore
#

But there was a confirmation

#

Just like the one on embeds

#

It asks are you sure you want to proceed

hollow sedge
#

Oh that would've been fine then

hasty mulch
stray root
#

uh

hollow sedge
#

Uh

stray root
#

how do i use dbl.webhook.on('vote'...

delicate shore
stray root
#

its not sending

hasty mulch
#

@hollow sedge This is all I had: ```py
elif isinstance(error, commands.BadArgument):
if ctx.command.qualified_name == 'tag list':
await ctx.send(':x: | I could not find that member. Please try again.')

hollow sedge
#

Can you share all of your code for that @stray root

#

Wait what?

#

No you don't have to make a global command handler for one command

#

Look at the link I sent you

hasty mulch
#

I like it that way

hollow sedge
#

Ok well then print the command name and see if it's matching what you put there

hasty mulch
#

Plus, if I see an error printed, I can easily add it in without taking half the bot offline

hollow sedge
#

Can you just print the error and the command name

hasty mulch
#

I fixed it

#

I just added an else and a ctx.send with what I wanted and it’s now working right

#

@hollow sedge

hollow sedge
#

Ok nice

earnest phoenix
#

I wonder if they have if ctx.author.id in bot.blacklisted_users: return in all of commands

pale vessel
#

yes

#

if it's in one command then it's most likely in other commands too

earnest phoenix
#

moment, they can do it in 1 step to apply that to all commands

#

My snipe command works fine when I run my bot on my own computer. It works with problems in virtual server

#

VDS?

#

VPS

#

virtual server

mellow kelp
#

sad docker noises

earnest phoenix
#

Any way to display a bot's guild count and user count on a website

#

Like is there discord endpoints to fetch that

weary widget
#

@earnest phoenix

#

that will give you the number of servers a bot is in

earnest phoenix
#

that's the cached one

weary widget
#

idk then

lusty laurel
#

i made a new bot in 2020 and that is comeing now

weary widget
#

did you import discord?

#

oh

#

yea you did

lusty laurel
#

yes i made

earnest phoenix
#

I mean im trying to display my servers size on a website

weary widget
#

did you install discord?

#

i mean like

#

with pip

lusty laurel
#

yes

#

i am not sure with pip

weary widget
#

ok

#

do you have windows?

lusty laurel
#

where can i download pip

#

yes

weary widget
#

ok open command prompt

lusty laurel
#

yes

#

i opened

earnest phoenix
weary widget
#

run this:

py -m pip --install

i think that's the command to install pip

#

@lusty laurel did it install pip?

lusty laurel
#

nope

weary widget
#

any errors?

lusty laurel
#

yes

weary widget
#

show me

lusty laurel
earnest phoenix
#

maybe i could try store the guilds size on a express web and fetch it

weary widget
#

oh wait don't put the two --

#

before install

#

py -m pip install

lusty laurel
#

okay its installed

visual olive
#

Seems like you already have pip installed

lusty laurel
#

but the error is not gone

#

from pycharm

earnest phoenix
#

pycharm has virtual env afaik

weary widget
#

try running this:
pip install discord

#

if you have pip it should work

earnest phoenix
#

why discord doe

lusty laurel
#

ok i made i think i must wait a litle bit

weary widget
pale vessel
#

didn't they reserve the discord package name

drifting wedge
lusty laurel
mellow kelp
#

whoa

#

big error

pale vessel
#

usually trailing slashes indicate a directory

earnest phoenix
#

discord is a mirror package for d.py

frigid oak
#

Pls quest command of dank memer bot is not working

Pls repair it
Because I have completed 50 days streak quest

For today it is 52nd day
These many days of my hardwork will go waste so please help

earnest phoenix
#

wow

#

vds gg

weary widget
frigid oak
#

Ok thanks everyone

visual olive
#

I was wondering, how can I make the bot webpage show in how many server the bot is? I have searched for it, but couldn't find it Confused

earnest phoenix
#

which webpage

drifting wedge
visual olive
lusty laurel
earnest phoenix
#

use top.gg's api to submit your bot stats

visual olive
#

Ah, thnx

mellow kelp
drifting wedge
#

does it make a difference?

mellow kelp
#

i dont think so

drifting wedge
#

i think its better

earnest phoenix
#

it doesn't matter

drifting wedge
#

cuz if i dont have the / in the route

mellow kelp
#

yea

earnest phoenix
#

i find the latter more aesthetically pleasing

weary widget
drifting wedge
#

if i do poggers/ it breaks/ 404

mellow kelp
#

unless you set an option in express i think

drifting wedge
#

but if i do, it works with or without

#

so prob gonna keep it

mellow kelp
#

k

merry perch
#

Alguém sabe como bate ponto no Discord?

earnest phoenix
#

english only

merry perch
#

Com o bot?

earnest phoenix
#

cum bot?

mellow kelp
drifting wedge
#

with the bot*

pale vessel
#

Cum

mellow kelp
#

chalice

weary widget
#

challenge

pale vessel
#

consume the

lusty laurel
#

i think its because im using version 3.9

weary widget
#

how do I make random to use variables or make the variable a number.

crimson vapor
#

huh

#

what do you need?

weary widget
#

ok so when i run the code as is

#

it doesn't like the vaiable

#

in the value = random.randrange(number)

pale vessel
#

What does .read() return

earnest phoenix
#

It's pretty self-explanatory, you need to cast it to int

earnest phoenix
pale vessel
#

br

earnest phoenix
#

or bytes

#

i'm not sure

pale vessel
#

of course

weary widget
#

all that's in the file is a number

#

one number

pale vessel
#

but it returns a string

mellow kelp
#

yeah

pale vessel
#

use int() ig

mellow kelp
#

you have to parse it to a number

weary widget
#

ok

#

lemme try that

hollow sedge
#

Python doesn't know that it's a number

lusty laurel
#

what is the best python version

hollow sedge
#

3.8 rn

mellow kelp
#

the latest one probably

#

(stable release)

hollow sedge
#

3.9 is the latest but it doesn't have much library support

mellow kelp
#

o

lusty laurel
#

yeah i got 3.9 and it was verry buggy

mellow kelp
#

makes sense

weary widget
crimson vapor
#

no

hollow sedge
#

Thats not how you cast something to an int

weary widget
#

oh

hollow sedge
#

it's int(string)

weary widget
#

ohhh

#

ok

crimson vapor
#

idk py but its probably int()

#

yea

tulip ledge
#

let channel = this.guilds.cache.get("766019210454892641").channels.cache.get("766019210454892644") cannot read cache of undefined, "this" is client

trim saddle
#

@weary widget int is supposed to be wrapped around what you want to be a number

hollow sedge
#

Also you don't need to set the encoding for that file

#

It's just a number

weary widget
#

thanks

tulip ledge
#

this it's in my client constructor

#

this is client basically

crimson vapor
#

unless you are extendinging the client

#

oh

hollow sedge
#

You're setting it equal to a file

crimson vapor
#

ok

hollow sedge
#

Oh nvm

#

The code you just sent is fine

earnest phoenix
#

note that the number variable still not an int though

hollow sedge
#

Don't you need to close the file though?

earnest phoenix
#

just use the context manager

hollow sedge
#

Yeah

trim saddle
#

@pale vessel do you know how to properly extend a map in typescript

hollow sedge
#

You do mean with open, right?

earnest phoenix
#

yes

trim saddle
#

oh shit he's clicking circles

crimson vapor
#

isnt it Map<K, V>?

crimson vapor
trim saddle
crimson vapor
#

oh

#

lemme see

trim saddle
#

google didn't help me with my error

pale vessel
#

are you making a collection for your lib

tulip ledge
#
  guilds: GuildManager {
    cacheType: [class Collection extends Collection],
    cache: Collection [Map] {
      '679398370917351441' => [Guild],
      '766019210454892641' => [Guild]
    }
  },
trim saddle
#

yes

pale vessel
#

LOL

tulip ledge
#

It had the guilds property

crimson vapor
#

wait

pale vessel
#

figures

crimson vapor
#

how are you extending it?

#

skull

tulip ledge
#

class TopazClient extends Client {

trim saddle
#
class Pile<K extends string, V extends any> extends Map<K, V>
crimson vapor
#

why extends string?

#

special string?

trim saddle
#

because idk who calls a map object by anything but a string

crimson vapor
#

true

#

but you could do K: string?

#

instead of extending a string

trim saddle
#

no that's an error

crimson vapor
#

oh

pale vessel
#

keys can be anything

#

for maps

trim saddle
#

ik

pale vessel
#

o

trim saddle
#

still using a string

crimson vapor
#

damn idk how to extend a map in ts

weary widget
#

ok so all my commands do not work when i have a on_message event. does anyone know why? i think its cause i have to close it or somthing.

trim saddle
#

if you're using the on_message event

#

you're wiping the default one away

earnest phoenix
#

Either process the command in your new on_message or register external listener so it won't override the default one

weary widget
#

I have one @cleint.event on_message and one @cleint.command

trim saddle
#

you have to include await bot.process_commands(<m>) in a custom message event

weary widget
#

that's the one i think

earnest phoenix
earnest phoenix
#

Message object

trim saddle
#

the message

weary widget
#

ah

#

thanks it works now

dusky sundial
#

I'm making a command where the user's username will be part of a url to an api request. The problem is that if they have weird characters in their it gives the error Command raised an exception: UnicodeEncodeError: 'ascii' codec can't encode character '\U0001f5a4' in position 36: ordinal not in range(128)
Anyone know a quick fix for this? Discord.py btw

trim saddle
#

are you opening a file?

mellow kelp
#

if you're using it as query parameter, you can use encodeURIComponent

#

oh wait

#

nvm

dusky sundial
#

@trim saddle I'm not opening a file, no

weary widget
#

it's an encoding issue

trim saddle
#

well you got a wonky character, most likely from setting encoding

dusky sundial
#

Yeah, I was wondering if there's a way to strip the wonky chars from the string

weary widget
#

I had this problem with a file open thing but try put "encoding = "utf-8"

#

idk if this will work

earnest phoenix
#

hi

hollow sedge
#

Why with io.open?

#

Python already has open in-built

hollow sedge
dusky sundial
#

I'm using

request = urllib.request.Request(url=url, headers=headers)
with(urllib.request.urlopen(request)) as req:

Can I add encoding in there somewhere?

hollow sedge
#

What are you trying to do

#

You probably shouldn't be using urllib

earnest phoenix
#

blocking moment

crimson vapor
#

@mellow kelp I added configuration so you can change POGGERS to any string in jason.db

weary widget
#

POGGERS

weary widget
trim saddle
#

@quartz kindle wake up i need you

hollow sedge
#

Requests is the go-to for synchronous requests and aiohttp is best for async requests

crimson vapor
#

tim doesnt know ts

#

Erwin does

dusky sundial
#

Well I'm getting some json data from a website

hollow sedge
#

Yeah use aiohttp then

mellow kelp
#

Poggers

dusky sundial
#

I'll try that then, thanks

weary widget
crimson vapor
#

no

weary widget
#

pain

#

why did they remove it

dusky sundial
#

I'm sure more opportunities to get it will come later on, but for now it's not possible

trim saddle
#

because users kept submitting spam bots for a badge

paper cliff
#

'cause of ppl submitting trash bots to get this badge

crimson vapor
#

yeah

weary widget
#

oh yea

trim saddle
#

and it was getting in the way of actual submissions

crimson vapor
#

many people who have it don't deserve it

#

and real devs don't have it

#

its kinda fucked

weary widget
#

don't they actually look at the bots

paper cliff
#

do you consider yourself as a real dev?

crimson vapor
#

but this is discord

slender thistle
#

Bo

#

Bo

#

No

weary widget
dusky sundial
#

I mean it was 100+ guilds to get it right?

crimson vapor
#

alekeagle doesn't even have it smh

weary widget
#

75 i belive

crimson vapor
#

dad bot dev

dusky sundial
#

Ah right

#

Should have been like 500+ imo

weary widget
#

wait so you can still get bot verified? but not verified dev

crimson vapor
#

yea

paper cliff
#

Yes

weary widget
#

w h a t

hollow sedge
#

@dusky sundial when you get to using aiohttp you can do response.json(encoding='utf-8') (you'll probably understand when you get there)

trim saddle
#

@quartz kindle squawk squawk i need help squawk

weary widget
#

but why would you setup a fake bot just to get a badge...

dusky sundial
#

@hollow sedge I'll try, thanks for the suggestion

#

People like badges

weary widget
#

yea ig

crimson vapor
trim saddle
#

yes

crimson vapor
#

damn

#

its kinda weird how it doesnt work

paper cliff
#

@trim saddle what are you trying to do

trim saddle
#

extend a map

#

in typescript

tardy hornet
#

anyone have the "what coding really is" computer puzzle meme

quiet arch
#

how do i put ' in message .send like js message.send('don't do it') i tought ```don't

paper cliff
#

but?

trim saddle
#

what are you doing

crimson vapor
#
message.send('don\'t do it')```
paper cliff
#

It's message.channel.send in Discord.js

crimson vapor
#

1 problem at a time

trim saddle
#

or just use double quotes

quiet arch
#

will not work

earnest phoenix
#

message.send(\'don't do it\')

paper cliff
#

wtf ^

crimson vapor
#

what the hell is that

quiet arch
#

o

#

thc

weary widget
#

don't do that

trim saddle
#

@earnest phoenix either help me with my problem or exist elsewhere

crimson vapor
#
message.send(\'don't do it\') ```
#

LOL

earnest phoenix
#

help or exist

#

the only two choices in life

#

@trim saddle what's the problem

trim saddle
#

extending a map in ts is weird and hard

earnest phoenix
#

agree

pale vessel
#

bro just look at discordjs collection source

quiet arch
#

doesnt work

hollow sedge
#

What is your current code

crimson vapor
#

isnt djs js

quartz kindle
#

wut

pale vessel
#

collection is in ts

crimson vapor
#

hello Tim

pale vessel
quiet arch
#
}else if (command == 'help'){
        message.channel.send('
        ping, pong hehe

        pray, pray for the pepe god
        
        prayspam, event more prays for the pepe god
        
        hmm, pepehmm
        
        dog, woof woof
        
        meme, who doesn't like meme'
        
        sick, cough cough
        
        poopoo, ooooo that was a nice poopoo
        
        nuke, world go brrrrrrrrrrr hehe')
    }```
hollow sedge
#

what

sudden geyser
trim saddle
#

use double qoutes at that point

hollow sedge
#

Use the backticks ` for multiline

sudden geyser
#

may want to escape that

paper cliff
#
}else if (command == 'help'){
        message.channel.send(`
        ping, pong hehe

        pray, pray for the pepe god
        
        prayspam, event more prays for the pepe god
        
        hmm, pepehmm
        
        dog, woof woof
        
        meme, who doesn't like meme'
        
        sick, cough cough
        
        poopoo, ooooo that was a nice poopoo
        
        nuke, world go brrrrrrrrrrr hehe`)
    }
pale vessel
#

is multiline ' even valid

quiet arch
#

thx

paper cliff
#

Use ` for multi-lines strings

hollow sedge
pale vessel
#

Right

quiet arch
#

works thank u

mellow kelp
#

i get hella confused with multiline ``

crimson vapor
#

its good tho

#

adds in \n

mellow kelp
#

when i send a multiline message, the second-to-last lines have an indent KEKW

quiet arch
mellow kelp
#

so i just use

#
[
  'Line 1',
  'Line 2',
  'Line 3'
].join('\n')
crimson vapor
#

lol

mellow kelp
#

wait

mellow kelp
#

really?

paper cliff
#

Yes

trim saddle
# quartz kindle wut
/home/skullbite/petals/lib/furpile.ts:6
        super()
        ^
TypeError: Constructor Map requires 'new'

i tried extending a map in ts and i keep getting this

mellow kelp
#

then ill just keep my current solution

#

you probably need a new instantiating your custom class

hollow sedge
trim saddle
#

i have it

mellow kelp
#

because messages with multiline `` have an indent

crimson vapor
#

I hate when people post code like this:
const fs = require('fs');
const data = JSON.parse(fs.readFileSync('data.json'))

#

its the worst

#

oh

quartz kindle
#

code?

crimson vapor
#

thats on purpose

hollow sedge
mellow kelp
#

o

#

how

crimson vapor
#

remove the indent

hollow sedge
#

^

#

it just keeps the structure of the string

mellow kelp
#

i don't put an indent KEKW

earnest phoenix
paper cliff
trim saddle
#
class Pile<K extends string, V extends any> extends Map<K, V> {
    constructor() { 
        super()
    }
    getRandom() { return this.size ? this[Math.floor(Math.random()*this.size)] : undefined }
    getAll() { return Array.from(this.values()) }
    find(search: (value: V) => boolean): V[] {
        const results = Array.from(this.values()).map((item: V) => {
            const res = search(item)
            if (res) return item
        })
        return results
    }
}

new Pile
export default Pile
mellow kelp
#

im gonna keep my solution

hollow sedge
#

Yeah it looks bad

paper cliff
#

I know, I don't like that either

trim saddle
#

y'all are filling the chat with boxes

mellow kelp
#

yea

hollow sedge
#

Who cares

mellow kelp
#

boxes are the best B)

earnest phoenix
#

@mellow kelp that's why i prefer \n unless the message is BEEG CHUNGUUS

paper cliff
#

foxes are the best F)

quartz kindle
mellow kelp
#

o

quartz kindle
#

also, not sure if ts allows new Class, you might need new Class()

trim saddle
#

do i really even need the constructor in this?

mellow kelp
#

nope

paper cliff
#

🤔

crimson vapor
#

one invokes it

#

lol

quartz kindle
#

you're only supposed to use new in your actual code btw, not in the exported file

crimson vapor
#

the other gives you an error

paper cliff
#

why the other one would throw an error?

trim saddle
#

ik

earnest phoenix
#

@trim saddle discord.js collection bois when they see Pile: Finally a worthy opponent!

trim saddle
#

i have the new in there as a test

crimson vapor
#

because your not fucking calling the constructor

crimson vapor
#

djs collections p hot tho

mellow kelp
#

yea

crimson vapor
#

jason.db better tho

mellow kelp
#

its like map but indexed right?

#

or am i wrong

crimson vapor
#

I think so

mellow kelp
#

by indexed i meant its ordered

paper cliff
#

I think

crimson vapor
#

how would new Class work?

earnest phoenix
#

:notes: On the first day of Christmas, MILLION and the weeb bois gave to us

pretty cool jason.db :notes:

mellow kelp
#

bruh

crimson vapor
#

is this something new

crimson vapor
#

lol

paper cliff
#

try new Date

earnest phoenix
#

@mellow kelp cough reactions

hollow sedge
trim saddle
#

@quartz kindle so i tried adding an argument to my constructor

hollow sedge
#

Because the new

trim saddle
#

same error

crimson vapor
#

hmmm

paper cliff
#

it doesn't throw an error

trim saddle
#

i'm convinced it's impossible

earnest phoenix
#

don't you need the parentheses

#

because the constructor needs to get called

trim saddle
#

you don't always need parenthesis

earnest phoenix
#

can you have a class with no constructor so it only inherits the methods

trim saddle
#

if the constructor has no required argument

#

yeah you can

earnest phoenix
#

cool

#

another drunk feature

hollow sedge
#

But will it call the constructor

paper cliff
#

Yes it will

hollow sedge
#

Epic

earnest phoenix
paper cliff
#

Javascript is epic

crimson vapor
#

js is good

hollow sedge
#

But javascript isn't

mellow kelp
#

ts is good

crimson vapor
#

wait

#

ok hear me out

paper cliff
#

But typescript isn't

mellow kelp
#

y

crimson vapor
#

ts is just microsoft js

earnest phoenix
#

well

#

yes

crimson vapor
#

otherwise known as typed js

#

and js is javascript

#

so therefore ts is just j

#

and j is just java

earnest phoenix
#

ts is js, but js is not ts

crimson vapor
#

ts === java

trim saddle
#

yeah i'm just gonna use map for the time being

crimson vapor
#

prove me wrong

mellow kelp
#

and java is written in c

earnest phoenix
#

java in $CURRENT_YEAR omegalul

crimson vapor
#

lol

earnest phoenix
#

i dont get it

ts is "compiled" to javascript according to the docs
but it's a transpiled language
and also a scripting language

the fuck is it

mellow kelp
#

and c is bcpl

pale vessel
crimson vapor
#

bruh

mellow kelp
#

yea

crimson vapor
#

ok I see now it is

#

proving me wrong

mellow kelp
#

ts is like a compiled language but the target is js

paper cliff
#

ts is converted to js

#

that's it

#

and Node.js is an interpreter for javascript

golden condor
#

Is there anyway to get the filters from lavalink (like speed and pitch) in JavaScript?

pale vessel
#

do you have the latest dev build

earnest phoenix
#

typescript more like javascript loggers edition

golden condor
#

Of what?

pale vessel
#

ll

golden condor
#

no

pale vessel
#

you need it iirc

golden condor
#

ok

#

I use shoukaku as my wrapper

pale vessel
#

you can DM timo

#

timo uses shoukaku too

crimson vapor
#

c# is microsoft java
ts is microsoft javascript

#

hmm

golden condor
#

Do you mean the other Timo?

pale vessel
#

ye

#

or just ping saya lmao

golden condor
#

Ok

mellow kelp
#

is image caching considered memoization

#

it is it just caching

old cliff
#

Is there a pillow alternative for js which supports gif manipulate?

pale vessel
#

wand

old cliff
#

Like canvas for gifa

mellow kelp
#

you can use gifencoder with canvas

pale vessel
#

oh js

#

oops

old cliff
#

It doesn't work for me

mellow kelp
#

you mean canvas and gifencoder?

pale vessel
#

well you did something wrong

earnest phoenix
#

ok i dont want to start a language war but hear me out

typescript > javascript > python > weebs in dbl

old cliff
#

Yes

mellow kelp
#

weebs in dbl

golden condor
#

I agree with that

#

But that's my opinion

mellow kelp
#

where does assembly go

old cliff
#

And how to get gif frames?

earnest phoenix
#

index.weeb

mellow kelp
#

hmm

#

about splitting frames idk

golden condor
old cliff
#

Gif frames module doesn't support canvas for node.js

earnest phoenix
#

JIF

old cliff
#

It supports pings and jpgs

pale vessel
#

what are you doing

earnest phoenix
#

Hi

crimson vapor
mellow kelp
#

i used canvas and gifencoder for a gif command

old cliff
#

This is not the meme channel

mellow kelp
#

so that does work

earnest phoenix
#

i need help

#

IT'S PRONOUNCED JIF DUMBOS

old cliff
#

I want to get frames of animated pfp and then manipulate

pale vessel
#

then use a package

#

get all the frames, make a loop

crimson vapor
pale vessel
#

and generate the gif

old cliff
#

The only package available doesn't work

pale vessel
#

what package?

mellow kelp
old cliff
#

gif-frames

pale vessel
#

I used gif-frames and have buffers working just fine

earnest phoenix
#

@crimson vapor noob

old cliff
crimson vapor
#

ok

earnest phoenix
old cliff
#

Rn?

crimson vapor
#

its still gif

pale vessel
#

an example

earnest phoenix
#

@pale vessel i never understood what process.f is

old cliff
#

wait lemme send my code

drifting wedge
pale vessel
old cliff
drifting wedge
#

hastebin pls

old cliff
#

ok

crimson vapor
#

I made shit dumb changes in code so now I have to rewrite like 200 lines POG

old cliff
#

it has problem in Canvas loadimage

earnest phoenix
#

@drifting wedge that usage of the word like :OMEGALUL:

old cliff
#

and code after loadimage doesn't work

pale vessel
#

Code, if you have nothing better to say, just get off this channel

#

I'm not trying to be rude but

#

¯_(ツ)_/¯

drifting wedge
#

to me?

crimson vapor
#

OExe are you american?

drifting wedge
old cliff
#

flazepe can you help pl;s ?

crimson vapor
#

ima assume yes based on how you used the word like

pale vessel
#

i'm eating rn

crimson vapor
#

anyway

#

flaze what are you eating?

drifting wedge
pale vessel
#

maybe @mellow kelp can help

drifting wedge
#

jk

pale vessel
earnest phoenix
#

lul

old cliff
#

image = await Canvas.loadImage(image);anythinig after this doesn't get executed

earnest phoenix
#

0exe can ye explain thy problem better

#

perhaps with some code too

crimson vapor
#

idk

crimson vapor
#

damn

drifting wedge
earnest phoenix
#

americans amirite

drifting wedge
#

basically the issue is when i have multiple arguments in the route

#

it breaks

earnest phoenix
drifting wedge
#

for example: the page's interactive banners arent clickable for example

crimson vapor
earnest phoenix
#

in the route of what?

drifting wedge
#

just the default code

crimson vapor
#

idk default code

drifting wedge
#

@app.route("/test/test/test")
def code():
return render template

#

this breaks

#

but with 2 test it works

crimson vapor
#

hmm

#

is guildID a constant or a variable?

drifting wedge
#

var

crimson vapor
#

hmm

drifting wedge
#

its like <var> i ask for it

#

might be that

crimson vapor
#

no idea tbh python kinda strange

#

english kinda hard

pale vessel
#

there's no constant or variable in python

crimson vapor
#

I mean

#

like

drifting wedge
#

look lemme try something rq lmao

crimson vapor
#

predefined or defined per route

drifting wedge
#
@requires_authorization
def showprofile():
    user = discord.fetch_user()
    name = f"{user.name}#{user.discriminator}"
    avatar = user.avatar_url

    return render_template("showprofile.html", user=name, avatar=avatar)```
#

this breaks

crimson vapor
drifting wedge
#
@requires_authorization
def showprofile():
    user = discord.fetch_user()
    name = f"{user.name}#{user.discriminator}"
    avatar = user.avatar_url

    return render_template("showprofile.html", user=name, avatar=avatar)```
#

this works

slender thistle
drifting wedge
#

no errors

#

just not clickable

earnest phoenix
#

ayy shivy entered the chat

slender thistle
#

Nah don't have hope in me

slender thistle
#

What happens when you open the route

drifting wedge
#

page loads

#

and css too

#

just the stuff isnt clickable

#

like 1 sec

#

wait wtf

#

now it doesnt even work

#

gimme a bit

mellow kelp
#

is css having a stroke?

drifting wedge
#

gimem a bit

tulip ledge
#
  var wb = XL.utils.book_new();
  
  var ws_data = [];
  ws_data.push([ "Username", "Weight"])
  let array = ["Vigintillion", "Thundeee", "Vexxing_Banana"]
  for (let i = 0; i < array.length; i++) {
      let userArray = new Array(2)
      userArray.push(array[i])
      userArray.push(Math.floor(Math.random() * 1500) + 200)
      ws_data.push(userArray)
  }
  var ws = XL.utils.aoa_to_sheet(ws_data);

  XL.utils.book_append_sheet(wb, ws, "SheetJS");
  XL.writeFile(wb, "players.xlsb");

So I'm tryna write some stuff to an excel document, everything worked untill now.... I added the for loop as I need to generate new rows for in the excel document and I got a heap limit error

mortal star
#

i am so stupid and sent message in wrong channel.)
anyone knows how i can use this feature for bot commands?
#commands message

cinder patio
old cliff
#

hey can I get help ?

#
async function frameTheFrame(Canvas,ctx,image,frame,width,height,ratio){
    let parsedImage = await new Canvas.Image();
    parsedImage.src = image;
    ctx.drawImage(parsedImage, (width * ratio - width) / 2, (height * ratio - height) / 2, width, height);
    ctx.drawImage(frame, 0, 0, width * ratio, height * ratio);

    return ctx;
}

It shows image hasn't finished loading
but however I am using await

honest perch
#

try ctx.toBuffer(); ?

old cliff
#

nah I only want the return in ctx

cinder patio
#

Crazy guess, but try await (parsedImage.src = image)

old cliff
#

nah

#

Canvas.loadimage(image); doesn't even work

mellow kelp
#

whats your code?

#

nvm lmao

#

um

#

pretty sure you shouldn't instantiate an image i think

cinder patio
#

Jaguar, loading images is not synchronous

honest perch
#

have you tried creating the canvas first?

cinder patio
#

@old cliff You have to do

 // Now you can draw the image
}```
#

Canvas.loadImage is basically a wrapper around that ^

lime gorge
#

Do any of you know of a good way to implement Jest in a Discord.js project?

#

Like, ways to mock API calls

#

Without doing everything from scratch

earnest phoenix
#

Jest?

#

wait

#

scratch?

mellow kelp
#

wat

umbral zealot
#

I haven't seen a way to do that with jest, and no one had bothered creating and maintaining a mock of the discord API.

#

That would be one hell of an annoying job tbh.

mellow kelp
#

yea

lime gorge
#

Eh, guess I'll make my custom helper for the scope I need

mellow kelp
#

would be great if there was an option tho

umbral zealot
#

Mocking so many calls? And websockets? Christ who has the time...

crimson vapor
#

that would be pain

mellow kelp
#

pain

lime gorge
#

Mocking a message/guild/channel object wouldn't be hard in itself, but yeah, full support of the Discord API would be painful

old cliff
#

ok what now my on ready event doesn't start

#

my bot unable to login.

#

hmm ratelimit ?

#

cause I restarted it like 100 times just within 10 mins

drifting wedge
#

i think i mightve found it

#

it breaks whenever the url has a variable

dusk sable
#

can sb help me with html

mellow kelp
#

just ask

#

but ok

dusk sable
#

i have buttons and if i resize them they get to the top left most corner, how can i change this to the center?

mellow kelp
#

idk whats your code or your css

#

or even the result

earnest phoenix
#

How can do webhook message when sw vote my bot?

dusk sable
#
<div style="width: 12em; height: 12em; background-color: aqua;">
        <button  id="testing">testbutton</button>
    </div>```
#

wait

mellow kelp
#

bruh i forgot what the em unit was

dusk sable
#
    width: 4em;
    height: 4em;
    color: black;
    text-align: center;
    padding: 5em 5em 5em 5em;
}
#testing:active {
    width: 3em;
    height: 3em;
}
earnest phoenix
mellow kelp
#

yes

dusk sable
#

i dont even know either

mellow kelp
#

so why do you use it

#

i just searched it up

#

2em means "2 times the element's font size"

dusk sable
#

hm

mellow kelp
#

i dont think thats what you want for that case

earnest phoenix
#

you should learn the units in css

#

daev, that is

opal plank
#

well this is new

#

wtf is even this?

dusk sable
#

tried it with px same problem

mellow kelp
earnest phoenix
crimson vapor
#

'https

mellow kelp
#

the superior protocol

#

'http

crimson vapor
#

yes

#

the very best

#

secure: "very"

mellow kelp
#

poggers: "yes"

earnest phoenix
#

encryption with a sequence of '

crimson vapor
#

im big brain and set secure to true when testing on localhost

earnest phoenix
#

so do i lmfao

#

i hate when firefox screams at me

rotund vale
#

What's the code to catch everyone in all servers that the bot is in than using client.users.cache.size?

dusk sable
#

can someone help me

crimson vapor
#

chrome got mad

earnest phoenix
#

chrome

#

ew

#

i have enough chromium apps on my pc i dont need chrome to chonk even more ram

#

:omegalul:

opal plank
mellow kelp
crimson vapor
opal plank
#

good catch, i didnt spot it cuz it wasnt on my code

#

it was being imported

crimson vapor
#

someone pushed not working code to prod?

opal plank
#

nah

#

thats being pulled from my remote db

#

one of the entries url was messed up

crimson vapor
#

oh

#

makes sense

opal plank
#

i was looking for it and didnt see it, so i assumed it was an internal issue

#

heres the culprit

crimson vapor
#

should I go through the pain of changing a lot of code, or should I just leave it in a almost working point?

mellow kelp
#

you mean refactoring code?

crimson vapor
#

no

#

the domain system for my uploader is shit but works

#

I want to change it

#

I want to basically just store subdomains and domain as a string in the user document in the db

#

but rn it is done differently so i have to change a lot of code

#

pain

sudden geyser
opal plank
#

PostgreSQL

Is there a way to retrieve a table's whole schema with a query?
i'd like see the columns including their constraints and types set for each column. Is it possible?

ember lodge
#

I am trying to make a button to download a .txt file, but it doesn't read the .txt file, i use nginx in ubuntu 20.04

#

Someone knows what is the error?

#

If so, please tell me :)

earnest phoenix
#

UnhandledPromiseRejectionWarning: Error: read ECONNRESET neden böyle bir hata alıyorum

#

Is there any easy way to cache mongodb quaries? I'm using js and mongoose

#

Why tho

earnest phoenix
#

Hmm, okay.

odd stratus
#

Say if a bot is in two servers, how can I check if a user on-join has a specific role in the other server or not?

sterile lantern
#

use the guild id

#

define the guild id, then check via client.on message

drifting wedge
#

hey, with flask, using <var> and getitng var in def routevar(var): breaks the page! anyone got any ideas?

pale vessel
#

new Date()

earnest phoenix
#

new Date()

heavy anchor
jovial nexus
#

does someone know how to auto restart pm2 with the update when you push a changue to github?

earnest phoenix
#

who use canvas pls and know how to insert an user profile picture ?

earnest phoenix
jovial nexus
#

?

earnest phoenix
#

launch pm2 with this and then when you will save , pm2 will auto restart

jovial nexus
#

when i push something to github it auto restarts?

#

u sure?

earnest phoenix
#

i think...

jovial nexus
#

and how pm2 know the repo?

earnest phoenix
#

how you did use pm2 before I said that ?

jovial nexus
#

dont use it, i just want to know how to when i changue the vps

earnest phoenix
#

oh ok

#

so I don't know if it will work

jovial nexus
#

like for example i think heroku had something like that, when you push a changue to the github repo the app auto restarts with the changues

#

and i want to do it with pm2 for automation

earnest phoenix
#

hmm

#

test what I said

earnest phoenix
jovial nexus
#

hmm but the repo is private, how is pm2 going to know when i make a changue?

earnest phoenix
#

🤔

#

don't know

#

Date.prototype.setHours() doesn't return the date itself, it returns milliseconds

jovial nexus
#

welp thanks anyways if someone know please @jovial nexus me

earnest phoenix
#

Your bot can't listen to github push events, that's not possible automatically until done manually

#

set up a github workflow

lyric mountain
#

Auto-restart is kinda pog actually

earnest phoenix
#

and do whatever you want from there

jovial nexus
#

then how heroku does it? and i dont mean the bot, i mean the host

lyric mountain
#

Like, your bot is gonna restart for every single push

jovial nexus
#

yes

mellow kelp
#

heroku uses a webhook

#

you can use that maybe

lyric mountain
jovial nexus
#

the bot is programed to restart at x hour every day

lyric mountain
#

If you use js, it'd be better to implement hot reload

jovial nexus
#

so restarts arent a problem

lyric mountain
jovial nexus
#

why?

earnest phoenix
#

you should also divide your push delivery system between production and development

#

don't run a dev version on prod

#

and vice versa

mellow kelp
earnest phoenix
#

hmmm

#

ok i'll test

jovial nexus
#

how much i need to wait for the growing error thing trying to verify the bot

tulip ledge
#

Hey does anyone here know something about galaxygate? I wanna get this play but it asks for a domain name?

solemn latch
#

they dont need a domain

#

gg have a support server if you want to use it, its listed on their site.

drifting wedge
#

it doesnt have to be a domain

#

mine's just "Titan"

#

no domain

rapid wave
#

guys can someone help me my bot cant show how many servers using shards

misty sigil
#

try console.logging shard?

#

and guilds isnt shard[1] its shard[0]

rapid wave
#

oh wait

lucid prawn
#
 client.on('guildMemberAdd', async (member) => {
  if (message.content.startsWith(prefix + "welcome")) {
(channel => channel.name === 'welcome');
    const { guild } = member

    const channelId = getChannelId(guild.id)
    if (!channelId) {
      return
    }

    const channel = guild.channels.cache.get(channelId)
    if (!channel) {
      return
    }

    const canvas = Canvas.createCanvas(700, 250)
    const ctx = canvas.getContext('2d')

    const background =  Canvas.loadImage(
      path.join(__dirname, 'Untitled-3.png')
    )
    let x = 0
    let y = 0
    ctx.drawImage(background, x, y)

    const pfp = Canvas.loadImage(
      member.user.displayAvatarURL({
        format: 'png',
      })
    )
    x = canvas.width / 2 - pfp.width / 2
    y = 25
    ctx.drawImage(pfp, x, y)

    ctx.fillStyle = '#ffffff'
    ctx.font = '35px sans-serif'
    let text = `Welcome ${member.user.tag}`
    x = canvas.width / 2 - ctx.measureText(text).width / 2
    ctx.fillText(text, x, 60 + pfp.height)

    ctx.font = '30px sans-serif'
    text = `Member #${guild.memberCount}`
    x = canvas.width / 2 - ctx.measureText(text).width / 2
    ctx.fillText(text, x, 100 + pfp.height)

    const attachment = new MessageAttachment(canvas.toBuffer())
    channel.send('', attachment)
  }
   })

can u help me

rapid wave
#

I mixed the shards by a mistake lmao

lucid prawn
#

i will not send the thing

misty sigil
#

do you have the intent?

#

GUILD_MEMBERS one?

umbral zealot
rapid wave
#

f

upbeat prairie
#

Guys, I cant understand the raw_add_role in the docs

#

Anyone can help?

hollow sedge
#

is that even a thing

#

what are you trying to do

stark abyss
#
      message.channel.send(embed).then(msg => {
        for(var i = 0; i < questions.length; i++){
          let collector = message.channel.createMessageCollector(filter, { time: 5000, errors: ['time'] })    
          
          collector.on('collect', async collectedMsg => {
            console.log(collectedMsg.content)
            embed.setDescription(questions[i])
            console.log(i + " i")
            msg.edit(embed)            
          })
        }
      })
    ```
I am struggling to have it ask questions more then 1
#

i am not sure how to do this, but that's what I coded and it's an epic fail

tardy hornet
#

why isnt it reacting with all of them?

earnest phoenix
#

because it doesn't work that way, put your emoji in an array then use forEach with Message#react

#

like: [emoji1, emoji2].forEach(a => msg.react(a))

heavy anchor
stark abyss
#

yeah I was thinking to do that as well but i wanna go through it multiple times that seems like it would work for once?

heavy anchor
#

No I have that setup with multiple questions

stark abyss
#

is that the same file as what it says in the error

odd stratus
#

Say if a bot is in two servers, how can I make it so if on a member join, if the member doesn't have a specific role in the other Discord server then to auto-kick it from the server they're trying to join?

I've tried one method right now, and it does auto-kick them but there's still one issue. It's still kicking them even though they have the role in the other server. Am I doing the condition check wrong or?

rapid wave
#

@stark abyss can you help?

stark abyss
#

no I am not capable to help you not that I don't want to

rapid wave
#

oof

odd stratus
#

Does anyone know the answer to my question?

stark abyss
#

from what It sounds it seems like you have issue getting user's role from other server

#

which is why it's kicking everyone but I have no idea on how you doing this so idek

odd stratus
#

Is it trying to find the roles in the server they're trying to join and not the other one?

stark abyss
#

well the first line only works if they have the role in that server

#

it's not a global thing

odd stratus
#

Do you know how I can make it global though?

stark abyss
#

i do not

#

Wouldn't you fetch that user from other guild and then their roles

odd stratus
#

Probably

#

Issue is idk how to lol

stark abyss
#

so find the user from the guild id and then fetch their roles

#

how to idk myself

verbal swift
#

would anyone know how to code a command that allows you to give default permissions to a user on a vocal? or an existing bot

eternal osprey
#

hey i have made a bot that sends the id and string (of the prodduct) to the cart.txt.

#

how would i implement that?

pale vessel
#

Use message.createReactionCollector() or message.awaitReactions()

#

Get the user id from the user object

eternal osprey
#

already done

#

basically i want to display all the text from result == message.author.id that used the command.

#

get what i mean?

crimson vapor
#

Are you using a txt file for storage?

#

@eternal osprey

eternal osprey
#

i've fixed it already.

#

nvm.

opal plank
#

those variable names make it sound like you sent 23 messages on the same code, which would likely mean your index is absolutely humongus, and if it is, i'd recommend reevaluating life choices

eternal osprey
#

i had one simple and fast question thno.

#
let z = " "
                  if (raid.is_exclusive == "1"){

                    let z = "BOOSTED"
                  
                  }
                
                  let text =
                 
                  
                    `**${name}** | **${varz}**  | **${z}**` +``` look eventhough the raid exclusive = 1 it wont show the z as boosted as it's defined out of the scope.
#

how would i fix that

opal plank
#

cuz you're obfuscating it. im amazed ur IDE didnt screech at you

#

if you want the first z to be BOOSTED, then dont declare it inside

#

z='BOOSTED'

eternal osprey
#
let z = " "
                  if (raid.is_exclusive == "1"){
                    let z = "BOOSTED"
              } 
                  let text =
           `**${name}** | **${varz}**  | **${z}**` +
                    "\n" +
                  
                    `**${raid.gym_name}**` +
                    "\n" +
                    `*${lat1}, ${lng1}*` +
                    "\n" +
                    `**${reactionEmoji5}: ** ${raid.level}  |  **${reactionEmoji4}: ** ${raid.cp}` +
                    "\n" +
                    `**Distance From Last Raid: ** ${lastcoordinatez} KM | ${closestz} Min CD` +
                    "\n" +
                    `**${reactionEmoji7} **${move1[1]}  | ${move1[2]}` +
                    "\n" +
                    `**Start: **${getFormattedTime(
                      raid.raid_start
                    )} | **Ends: **${getFormattedTime(raid.raid_end)}\n` +
                    `${reactionEmoji6}${reactionEmoji6}${reactionEmoji6}${reactionEmoji6}ⓅⓄⓀⒺⒽⓊⒷ${reactionEmoji6}${reactionEmoji6}${reactionEmoji6}${reactionEmoji6}` +
                    "\n";
                  let rawdata = fs.readFileSync("./data.json");
                  let channel1 = JSON.parse(rawdata);
                  let msg = await message.channel.send(text);
                  await msg.react(reactionEmoji1);
                  await msg.react(reactionEmoji2);
                  await msg.react(reactionEmoji3);
//I tried closing the } here, but it did not send the embed.

                  ```
opal plank
#

remove that let and dont use scopes like that

eternal osprey
#

the first let?

pale vessel
#

second

opal plank
#

remove all those

#

thats basic js dude

eternal osprey
#

but i would only have an if statement without any brackets..?

opal plank
#

yeah....?

eternal osprey
#
if (raid.is_exclusive == "1")

                   z = "BOOSTED"
                  
                  
                
                  let text =
                 
                  
                    `**${name}** | **${varz}**  | **${z}**` +``` It is not possible.
opal plank
#

why bother putting brackets if its a single thing?

#

your indentation is killing me, but yes

#

plase use prettier/linter

eternal osprey
#

i am

opal plank
#

clearly not

eternal osprey
#

i just was tweaking a bit

#

i will use it once i am done.

opal plank
#

also use === not ==

eternal osprey
#

so if the raid exclusive is not 1, it will just let z be ''

opal plank
#

correct

eternal osprey
#

but if it's an exclusive (equal to 1 ) it sends the boosted?

#

okay good to know!

opal plank
lusty kindle
#

How do i make a developer only command

#

If anyone can help please ping me

summer torrent
#

compare user ids

lusty kindle
#

K what one the id on my name or my discord id

solemn latch
#

the user id, not the tag

lusty kindle
#

K

ruby elbow
#

any of you also do web development or nah? (ping me if yes)

lusty kindle
#

Well i use bot designer app to code my bot

solemn latch
#

theres a few of us who do various forms of web development @ruby elbow

ruby elbow
#

Interesting Thonk Would you happen to be looking for a new project?

solemn latch
#

this isnt the place to find devs for projects

ruby elbow
#

I'm aware

solemn latch
#

then why ask 🤔

drifting wedge
#

does the amount of "args" in a flask route make a difference?

#

im having an issue where having more than 1 argument breaks the page, and same with having any variables

ruby elbow
#

Because there isn't a specific channel for that on the server, and this is where you tend to find developers in the wild

solemn latch
#

well, theres all kinds of places to hire devs 🤔

eternal osprey
#

how do i scan through a txt file to find all messages containing a certain word.

drifting wedge
#

load txt file

ruby elbow
#

Sure :)

drifting wedge
#

and looks for work

#

word*

#

load into var

eternal osprey