#development

1 messages · Page 1463 of 1

gilded olive
#

like i have a command that would iterate over the bots guilds and fetch all the custom prefixes

next ridge
#

I'm using MongoDb and it isn't writing in schema

gilded olive
#

that took like 30 seconds when it when it's in 1 testing guild

next ridge
#

Just writes _id and _v without info

opal plank
#

isnt it better to do the standard way ghoul?

crimson vapor
#

Erwin how do you make the main export in ts a class?

misty sigil
#

so sorry

gilded olive
#

wym standard way

opal plank
#

fetch on startup, cache all => update on new entry + add to cache

opal plank
#

export default class

misty sigil
crimson vapor
#

o

opal plank
crimson vapor
#

export default class ClassName?

misty sigil
#

I fetch and store as required

next ridge
#

const mongoose = require('mongoose');

module.exports = mongoose.model('shopDATA', new mongoose.Schema({
itemName: { type: String },
itemID: { type: String },
itemPrice: { type: Number },

}))

opal plank
#

i rather fetch all on startup rather than querying every time/checking

next ridge
#

This is schema

#

But isn't writing

opal plank
#

since discord takes a hot second to connect, i do my own startup before the ready event is even emitted

gilded olive
#

in discord.py doing anything in on_ready(startup) is not recommended

misty sigil
#

@next ridge can I see how you’re writing it?

next ridge
#

      let newEntry = { 
      itemname: itemnamex,
      itemprice: itempricex,
      itemid: itemidx
        };
    
    let newDB = new itemDB(newEntry);
   await newDB.save();
        
#

This method works fine with other Commands

opal plank
crimson vapor
#

hmm

opal plank
#

to put it bluntly

crimson vapor
#

how can I use that with require then?

#

when I transpile

opal plank
#

export class a

a = default

//////////////

export class b
export class c
export default d

d = default

/////////////

export class e
export class f
export class g

no default iirc

#

you dont, requiring that way is a bitch

#

import resolves on require, not the other wya around

#

import is require().default

next ridge
#

@misty sigil You got problem in that code?

opal plank
#

import { thing } = require().thing

crimson vapor
#

is there any way to make requre().default just require()?

opal plank
#

no, you gotta import everything and get default

crimson vapor
#

hmm

#

guess I will just stick to no defaults

opal plank
#

use import for proper stuff

#

dont fuck with js until you compile it

crimson vapor
#

is it compile or tanspile?

#

idfk what to call it

opal plank
#

transpile*

crimson vapor
#

alr

misty sigil
#

e.g. itemEntry, itemID, itemPrice

crimson vapor
#

lol

earnest phoenix
#

tsc stands for typescript compiler iirc
typescript contains the word script in its name
and finally typescript transpiles down to js

opal plank
#

^^

next ridge
#

Wdym @misty sigil

crimson vapor
#

using mongoose? show your schema

next ridge
#

Ohh

#

I found

misty sigil
#

you need to keep it the same case between the schema and the entry

next ridge
#

Thankksss man

#

Ya.. I'm dumb sometimes

#

Thankss

crimson vapor
#

code worked

#

time to upload to gh

#

actually ima write a readme

cinder patio
#

I have to write docs for my library but I'm so fucking lazy

earnest phoenix
#

hey

#

how can i make my bot add three 0

#

to that time

#

add these 0 to the var tiempo

#

but idk how

cinder patio
#

like, add 3 zeroes at the end of the string? Because tiempo is a string

earnest phoenix
#

How can I know which shard the server is in? (discord.js)

earnest phoenix
#

that's the problem

#

THX!

#

i make this

crimson vapor
#

message.guild.shard or something iirc

earnest phoenix
#

ok

#

i go try

#

thx

outer perch
#

oh, btw

#

can someone explain what Shards do

#

i know I don't need them until 500+ servers or so

#

but I'd like to know how they work

gilded olive
#

Sharding is a nice way to split your bot to smaller, more manageable parts. It is recommended to only use this feature with big bots (1000 guilds or more).
Note that you are required to use this when your bot reaches 2000+ guilds.

cinder patio
#

Sharding also means connecting with multiple websocket connections to discord, with each websocket connection receiving events only from specific servers

odd stratus
#

How do I check if a member is deafened or not in voice chat with Discord.js?

earnest phoenix
#

How many servers are per shard?

#

500?

quartz kindle
#

Anywhere from 0 to 2500

crimson vapor
#

fuck I accidentally pushed node_modules

#

fucking 30k lines

quartz kindle
#

Lmao

crimson vapor
#

checks commits hmmmm 30k lines added

#

on my first commit

quartz kindle
#

Writes 30k lines in a few minutes

#

What a god

solemn latch
#

just like the movies

crimson vapor
#

the sad part is that ive been working on this for like 2 hours

solemn latch
#

^ such a good movie

solemn latch
#

o crap this is dev, sorry ;p

crimson vapor
#

rm .git -rf

modest smelt
#

Suppose someone does this !pythoncode {pythoncode} how do i process that code and return what happens?

true gulch
#

playingMessage = await queue.textChannel.send(🎶 Started playing: **${song.title}** ${song.url});

I want to embed this phrase. How do I do it

#

Discord.js

stark abyss
#

why isn't the font for "welcome" bigger

pale vessel
#

70px

#

No space

stark abyss
#

ohh

stark abyss
modest smelt
#

Suppose someone does this !pythoncode {pythoncode} how do i process that code and return what happens?

opal plank
modest smelt
#

pls help

pale vessel
#

Use eval()

true gulch
#

playingMessage = await queue.textChannel.send(🎶 Started playing: **${song.title}** ${song.url});

I want to embed this phrase. How do I do it

#

discord.js

pale vessel
#

Use MessageEmbed or the embed object

quartz kindle
true gulch
pale vessel
#

Yes, put it normally

quartz kindle
#

Target ES1990 and transpile your entire code to primitives

true gulch
#

Can you get the format?

past needle
true gulch
#

Oh

pale vessel
#

🥄

past needle
#

:c

#

who not

opal plank
past needle
#

oh god

opal plank
#

generated API types

quartz kindle
#

What the fuck

opal plank
#

not a single manual line

#

just TSC

#

a whole API documented under a single command with generated types

quartz kindle
#

How big is the file?

opal plank
#

1,09mb

quartz kindle
#

Duckin hell

opal plank
#

good luck manually typing a whole lib/api

#

scrub

drifting wedge
#

uhhh can i get linux system stats with subprocess in json form?

quartz kindle
#

Im not gonna type anything that requires 1mb+ file size only for typings

opal plank
#

if only you wrote stuff in ts and then transpiled

#

come to ts timmy

#

we got autogenerated code

earnest phoenix
#

🗿

opal plank
little anvil
#

yall does anyone know how to make a bot wait for the reply, or wait for cancel?

drifting wedge
#

i mean why not use ts?
isnt it just better js?

quartz kindle
#

Im am talking about autogen

little anvil
#

discordpy

opal plank
#

tell that to tim

drifting wedge
#

oh great!

little anvil
#

discordpy

#

ye

drifting wedge
#

alr so u have the wait for function

gilded olive
#

@modest smelt just use jishaku

quartz kindle
#

Im nt gonna give my users 1mb lib when i can give them a 5kb lib that does the same thing

little anvil
#

yeah

drifting wedge
#

and you can run a asyncio timer

gilded olive
#

jishaku is cool

drifting wedge
#

and if it passes the time, it just cancells

opal plank
drifting wedge
#

oh, wondering, is asyncio.sleep async?

#

one of my devs said its not

opal plank
#

but no time wasted on manually typing docs for 15h of your life while struggling to match js-ts

drifting wedge
#

but i think he;s just dumb lmao

little anvil
#

lol

gilded olive
quartz kindle
#

Contrary to popular belief, package file size matters

#

Why do you think request was deprecated

#

It was fucking 5mb

opal plank
#

this is only dev dependency btw]

#

the actual lib is way smaller

#

let me get size

quartz kindle
#

But isnt .d.ts in dist?

gilded olive
#

etc

#

you can do shell commands

#

and a lot of other cool stuff

#

would def recommend

hollow sedge
pale vessel
#

look at the name

opal plank
opal plank
#

@types is a different folder

gilded olive
#

you wanted a way to run python code

quartz kindle
#

But when a user instals your lib

opal plank
drifting wedge
gilded olive
#

you implement it by load_extension('jishaku')

modest smelt
opal plank
#

theres a shorter file in crate for them

quartz kindle
#

Does .d.ts not get included in the download?

drifting wedge
opal plank
#

they only get types when they --dev it

hollow sedge
#

fire that dev

#

jk

opal plank
#

im not brezelien

#

this shitty OS is a single language

drifting wedge
opal plank
#

i either crack another version of windows or deal with favela language

quartz kindle
little anvil
hollow sedge
#

hm ok

gilded olive
#

no

opal plank
#

cant even tim

gilded olive
#

that's not how you do it

hollow sedge
#

windows is free tho

quartz kindle
#

You can

hollow sedge
#

why do you have to do that

little anvil
#

enlighten me

crimson vapor
#

why do you need cracked windows?

opal plank
#

windows thought it was a great idea to do Windows Single Language Version

drifting wedge
hollow sedge
#

yeah

opal plank
#

where you cant change the system language

hollow sedge
#

why do you need cracked windows

little anvil
#

alr

quartz kindle
#

Ive changed single language to pro several times

gilded olive
drifting wedge
#

just looked at my github profile

gilded olive
#

this is how you check

#

then

drifting wedge
#

i have 2 public commits

opal plank
#

alright then, tell me how

drifting wedge
#

😦

hollow sedge
#

you install it

quartz kindle
#

Warez

hollow sedge
#

its free

drifting wedge
#

and i have like 3k private commits

#

lmao

opal plank
#

wdym Warez?

little anvil
#

im trying to make it record the users input

#

so not yes

gilded olive
#
try:
  await bot.wait_for('message', timeout=10, check=check)
except asyncio.TimeoutError:
  pass```
hollow sedge
#

actually nah

drifting wedge
#

yep!

hollow sedge
#

who even needs windows

gilded olive
#

then define bot.wait_for

#

then you get the content of it

little anvil
#

alr

opal plank
#

i got the original version of windows though

quartz kindle
#

Warez = pirate lingo for refering to cracked software, and also not allowed to talk about it here afaik

gilded olive
#
answer = await bot.wait_for('message', timeout=10, check=check)
answer = answer.content``` @little anvil
opal plank
#

thats the point though

hollow sedge
#

you could just proceed without a license

opal plank
#

i dont wanna crack it, i got the original version

hollow sedge
#

and have a fat watermark on your screen

umbral zealot
little anvil
#

alr

quartz kindle
#

Well you need to, but yoi dont need to format for it

hollow sedge
#

oh

earnest phoenix
#

Does anyone know if I can tell which shards I am in (discord.js - mongodb)

little anvil
#

somethings invalid

gilded olive
#

no

gilded olive
#

my oh my

earnest phoenix
#

yes

little anvil
hollow sedge
quartz kindle
crimson vapor
#

iirc its sharded over all of them

hollow sedge
#

OH WAIT

#

nvm

earnest phoenix
#

@hollow sedge Mongodb is already a shard

opal plank
gilded olive
#
@bot.command()
async def yes_ur_gay(ctx):
  await ctx.send("are you gay")
  
  def check(m):
      return m.content == "yes" and m.channel is ctx.channel
  
  try:
    await bot.wait_for('message', timeout=10, check=check)
  except asyncio.TimeoutError:
    pass```
#

@little anvil

opal plank
#

(likely not, but imma try anyway)

little anvil
#

alr

quartz kindle
earnest phoenix
#

this

gilded olive
opal plank
#

refactoring that library rn, if you can think of improvements

gilded olive
#

but i guess you found out

quartz kindle
#

Which one? Twitch?

gilded olive
opal plank
#

no, the one i made yesterday

earnest phoenix
#

how can I parse this text as normal text

The essentials from songwriter <a href="https://artists.spotify.com/songwriter/4iWkoTP4d2RfIx2Om0lx5p%22%3EGregg Wattenberg</a>, all in one playlist. <a href="spotify:genre:songwriters">Discover more songwriters on Spotify</a>.

return:

The essentials from songwriter Gregg Wattenberg, all in one playlist. Discover more songwriters on Spotify.
quartz kindle
#

Which one is it?

pale vessel
#

cHeErIO

opal plank
#

lemme grab linkus

gilded olive
#

i fix

quartz kindle
#

Im on the phone, but i ca try

little anvil
#

ty

pale vessel
#

require("cheerio").load("The essentials from songwriter <a href="https://artists.spotify.com/songwriter/4iWkoTP4d2RfIx2Om0lx5p%22%3EGregg Wattenberg</a>, all in one playlist. <a href="spotify:genre:songwriters">Discover more songwriters on Spotify</a>.").text();

hollow sedge
#

no

quartz kindle
#

Also i need to fix one of my bota that apparently has been broken for 2 weeks

#

Lmao

hollow sedge
#

the check function return is indented 4 spaces, the others are only 2 spaces

little anvil
#

i swear i hate indent erros with passion

gilded olive
pale vessel
#

oh there's a genshin api?

gilded olive
#

😢

hollow sedge
#

no mercy

gilded olive
#

:(

opal plank
pale vessel
opal plank
#

scraping data directly from their website is getting ratelimited

#

100%

earnest phoenix
#

was needed for spotify

opal plank
#

telling that from experience

pale vessel
#

Not from their site

#

and I save it to JSON

opal plank
#

dont ping genshin api, they ratelimit you on the 3rd request per day

pale vessel
#

Nah I didn't

opal plank
#

even with changed user agents

pale vessel
opal plank
#

its an ip ratelimit

gilded olive
gilded olive
pale vessel
#

Not fucking with genshin's API

opal plank
#

i am

#

its fun

#

routing a bunch of ips

#

i feel the pain of music bots

pale vessel
#

hell no

#

music bots have it hard

#

you need a lot of IPs

opal plank
#

which i do

pale vessel
#

and proxies

opal plank
#

which i also do

pale vessel
#

nice

crimson vapor
#

roki got ipv6 rotation on ytdl working

#

automatic™️

pale vessel
#

didn't he make a pr or was that for something else

crimson vapor
#

he did

pale vessel
#

merged?

crimson vapor
#

and still not merged iirc

opal plank
#

getting puppeteer and ipv6 rotation has been proving quite a hassle

gilded olive
gilded olive
#

and the source code for that is like 8 lines

pale vessel
#

wdym what

quartz kindle
#

@opal plank you pushed it 16 houra ago, and immediately started refactoring it?

opal plank
#

oooh, tim's back

#

yes

quartz kindle
#

Lol

#

Why

true gulch
#

Code

var playingMessage = await queue.textChannel.send(new Discord.MessageEmbed().setColor('ffeeff').setTitle("Every Music").setDescription(`🎶 Started playing: **[${song.title}](${song.url})**`).setImage(`https://img.youtube.com/vi/${song.url.split("v=").pop()}/maxresdefault.jpg`).setFooter("commands Prefix : ,"));
      await playingMessage.react("⏯");
      await playingMessage.react("⏹");
      await playingMessage.react("⏭");
      await playingMessage.react("🔁");
      await playingMessage.react("🔇");
      await playingMessage.react("🔉");
      await playingMessage.react("🔊");
    } catch (error) {
      console.error(error);
    }

    const filter = (reaction, user) => user.id !== message.client.user.id;
    var collector = playingMessage.createReactionCollector(filter, {
      time: song.duration > 0 ? song.duration * 1000 : 600000
    });

Error

abort(TypeError: Cannot read property 'createReactionCollector' of undefined). Build with -s ASSERTIONS=1 for more info.
(Use `node --trace-uncaught ...` to show where the exception was thrown)```

Why am I getting this error?
opal plank
#

cuz there were quite a few people waiting for it, so i published a working version(and some pacthes after i got some issues being pulled)

quartz kindle
#

Ah

pale vessel
#

That's in your try block?

#

You have to add the collector inside the try too

crimson vapor
#

ye

true gulch
#

@pale vessel yes

pale vessel
#

yes

opal plank
#

so now its gonna be standardised and improved for the next minor

quartz kindle
#

@opal plank dude....

#

My browser

#

Its opening index.ts in mx player

crimson vapor
#

yep

quartz kindle
#

Thinking its a video ts file

opal plank
#

wtf lmao

quartz kindle
#

Lmfao

opal plank
#

open as desktop

crimson vapor
#

what browser do you use?

opal plank
#

if tim says opera im quitting

crimson vapor
#

why?

opal plank
#

cuz ie and opera probably some of the shittiest browsers i can think of

crimson vapor
#

opera isnt that bad

#

at least opera gx

pale vessel
#

Tim: IE

crimson vapor
#

on his phone tho?

little anvil
#

any of yall know how to make a discord bot write to a text file

crimson vapor
#

fs.writeFileSync()

little anvil
#

not js

pale vessel
#

lol

crimson vapor
#

nvm

quartz kindle
#

Its an app called "naked browser"

#

Lmfao

pale vessel
#

wtf

gilded olive
#

.write()

little anvil
#

im not gonna ask

crimson vapor
#

the hell is that

opal plank
#

oh my how lewd

#

naked browser

little anvil
#

ok @gilded olive ty

gilded olive
#
file_object  = open("filename", "w") as f:
  . . .```
hoary junco
#

How can I make a button in css top.gg

gilded olive
#

you can take a look there for more info

little anvil
#

whats thw w for

#

*the

gilded olive
#

write

hoary junco
#

Because when I tried the text wasn’t showing

little anvil
#

o alr

gilded olive
#

it's called the mode

little anvil
#

a must be append

gilded olive
#

correct

hoary junco
#

Cogs making my bot ping 📈📈📈

lusty kindle
#

What does my bot secret client code do

gilded olive
#
# Python program to demonstrate 
# writing to file 
  
# Opening a file 
file1 = open('myfile.txt', 'w') 
L = ["This is Delhi \n", "This is Paris \n", "This is London \n"] 
s = "Hello\n"
  
# Writing a string to file 
file1.write(s) 
  
# Writing multiple strings 
# at a time 
file1.writelines(L) 
  
# Closing file 
file1.close() 
  
# Checking if the data is 
# written to file or not 
file1 = open('myfile.txt', 'r') 
print(file1.read()) 
file1.close() ``` @little anvil quick example from google.com
quartz kindle
#

@opal plank im not gonna look at it now, im at dinner with family and its too big to look at, besides fjck ts

opal plank
#

also

#

looking at that might be good for you tim, thats Google's standard Ts/Lib code

near ether
#

does anyone know why 1 shard of my bot is using over 110 mb of memory on launch? it doesnt even cache anything except stuff that d.js caches; what can i sweep?

hoary junco
quartz kindle
#

Btw isnt public default? Do you have to manually declare everything as public?

opal plank
#

just consistency

mellow kelp
#

I like doing it for better readability

opal plank
#

but i dont think you need to declare public if you dont want to

mellow kelp
#

Yea

quartz kindle
#

👍

mellow kelp
#

Just lime you dont have to add private to variables in, say, java

hoary junco
#

47373757363747284858286837(8629(629683638786353+8383(684(7367$;(8)847$;/‘iuirhenvjyiuhgnyituruejr = 1.3958385858

near ether
#

i remember tim sent this a while back and ive swept a good chunk of them, but its still consuming a ton of memory on launch and at a rapid rate post-launch
#development message

gilded olive
#

e

#

what will it do

mellow kelp
#

Bruh

hollow sedge
#

@earnest phoenix there are already a lot of good moderation bots

#

Check out dyno

gilded olive
#

ah yea thats true

quartz kindle
hollow sedge
#

You can customize with dyno

gilded olive
#

i mean sure i can make one for you

hollow sedge
#

If you're lazy then just add dyno

gilded olive
#

but hosting is your problem

hollow sedge
#

Loll

#

That's where it ends

#

Oh NVM it seems

gilded olive
#

just tell me what it will do precisely

hollow sedge
#

Enjoy your nitro ghoul >:(

hoary junco
#

</>

#

<>

mellow kelp
#

Pog

hoary junco
near ether
hollow sedge
#

I don't understand why he wants someone else to make a bot that he will host instead of just using dyno

mellow kelp
#

Kinda same

#

But if he wants to there he goes

true gulch
hoary junco
near ether
true gulch
#

try block

near ether
hollow sedge
#

@earnest phoenix you realize hosting is a monthly expense right?

quartz kindle
#

How often do you clear caches?

near ether
#

every 30 min

true gulch
#

@quartz kindle error pass

hollow sedge
#

Ok

hoary junco
#

What is the best cheap bot hosting?

outer perch
little anvil
#

omg

mellow kelp
#

I use heroku

little anvil
#

"'answer' referenced before assignment"

quartz kindle
outer perch
#

actually it's free

mellow kelp
#

If you just host 1 thing you should get enough each month

hoary junco
#

I’m not using heroku

outer perch
#

now, u can use Vultr it's pretty cheap

#

$5/m

quartz kindle
#

Vultr has very good disks

mellow kelp
#

Cool

outer perch
#

but Vultr gets expensive if you're european 😔

hoary junco
#

I’m not

quartz kindle
#

Do they charge vat?

little anvil
hoary junco
little anvil
#

def check(m):
return m.content == "yes" and m.channel is ctx.channel

try:
    answer = await bot.wait_for('message', timeout=5, check=check)
    answer = answer.contnet
except asyncio.TimeoutError:
    pass
#

heres the part causing it i think

near ether
outer perch
hoary junco
#

Try that

outer perch
#

Portugal is 23%

#

so I have to pay 8€ or so

hoary junco
#

USA?

outer perch
#

8€ = 10USD

outer perch
hoary junco
#

Nope

#

Oh ok

quartz kindle
#

In all guilds

outer perch
#

oh

near ether
outer perch
#

a thing I should be aware

quartz kindle
#

Yes

near ether
#

alright

#

will do

quartz kindle
#

What i do is this

#

clear users;
for each guild, clear members that do not exist in client.users

near ether
#

perfect, thanks so much man 🙏 ill lyk if it works out

hollow sedge
#

🙏

true gulch
#

The content of the error varies as follows.

abort(TypeError: Cannot read property 'on' of undefined). Build with -s ASSERTIONS=1 for more info.

I send the code to solve it. Can you upload files here?

little anvil
#

@hoary junco doesnt work

#

when i correct it

#

i get the answer error

hollow sedge
#

Post your code here

#

@little anvil

mellow kelp
#

indent problems

#

make sure your code is properly formatted ig

hollow sedge
#

If you have an indentation error and don't know how to fix it, you need to learn python

little anvil
#
@def check(m):
            return m.content == "yes" and m.channel is ctx.channel

    try:
        answer = await bot.wait_for('message', timeout=5, check=check)
        answer = answer.content
    except asyncio.TimeoutError:
        pass
        file_object = open("filename", "w")
        file_object.write(answer +", " + "<@" + {user.id} + ">")
        file_object.close()

        embed = discord.Embed(title="**Information Recorded**", color=0xfb821d)
        embed.set_footer(text=f"ID: {user.id}" + " · Made by Mr.dootdoot#6972")
        embed.set_thumbnail(url='https://cdn.discordapp.com/attachments/788451731221905499/789220518237962300/PemThumbnail.png')
        embed.add_field(name=":white_check_mark: Record Successfully!", value=f"thanks")
        await ctx.send(embed=embed)
hollow sedge
#

Why is there an @ before def check

#

Also return in the check is indented twice

mellow kelp
#

maybe its discord

#

code chunks in discord are pretty screwed up

hollow sedge
#

Well then you should fix the formatting before sending

mellow kelp
#

yea

hollow sedge
#

That still doesn't justify the @

true gulch
mellow kelp
#

i meant the other guy pogey

hollow sedge
#

@little anvil can you take a screenshot of your code and post it here

little anvil
#

@hollow sedge

hollow sedge
#

It's not..in a function?

mellow kelp
#

whats that pass doing there tho

hollow sedge
#

Where is the command function

#

That it's supposed to be in

little anvil
#

the entire command

#

?

hollow sedge
#

Yes..?

#

It honestly seems like you're missing a basic understanding of Python @little anvil

#

Might want to read up for a bit before making a discord bot

lusty torrent
#

How

hoary junco
# little anvil

bruh where’s the @mighty sapphireient.command()
async def check (m)

mellow kelp
hollow sedge
#

There's a ton of other problems

#

Even without that

#

set_field returns a new embed

hoary junco
#

bruh

#

ctx.channel..?

hollow sedge
#

Lol

hoary junco
#

Shouldn’t it be m.channel?

hollow sedge
#

No

hoary junco
#

Well

#

No

#

But ctx isn’t defined

hollow sedge
#

Yeah

hoary junco
#

I prefer client more then bot

high mesa
#

is there a way to get the bot username from its userid?

hoary junco
hollow sedge
#

you can just get the username

#

It's your bot

#

You don't need anything else

high mesa
#

well i want to assign role to different bot

hoary junco
high mesa
#

by mentiion that bot

#

like @tired lodge @crude grailbot thisRole

hoary junco
#

So

high mesa
#

oh no

hoary junco
#

First

#

Split the @ornate beacon from the id

hollow sedge
#

Wow you just @ a random person

#

Lol it's ok

high mesa
hollow sedge
#

They deserve it for having that username

high mesa
#

but when i do the same thing for bot user

#

it just return none

hoary junco
high mesa
hoary junco
#

tf is that

#

@ornate beacon

high mesa
#

if i user client.get_user(36...226) then i get a user (me)

hoary junco
#

why is there a :

#

Not a ;

high mesa
#

it is just a message

#

@mentionsome @mentionsomeoneelse

#

that what my bot see

hoary junco
high mesa
#

and i just parse it to a dictionary

#

yeah i did that

#

and it work for a normal user

#

but its not working for a bot user

#

user1 = client.get_user(int(x[3:-1]))

hoary junco
#

And what are you trying to do

high mesa
#

this is what i tried

#

just get the user so I can assign a role to that user

hoary junco
#

I mean idk

gilded olive
#

@drifting wedge he says hes legit

hoary junco
#

For what

gilded olive
#

why were you so rude tho lol

hoary junco
#

?

high mesa
#

just managing in general?

#

and curious

#

i intend this to be run on normal people user but i was testing on bot account

pale vessel
#

What

#

:monkaToS:

#

Nice discord mobile

hoary junco
pale vessel
#

Mobile bug

#

:monkaToS:

#

Again?

drifting wedge
pale vessel
#

There we go

hoary junco
#

:monkaToS:

mellow kelp
#

:monkaToS:

#

Bruh

drifting wedge
#

imagine theyres just a fat guy that works for botghost that does the bot stuff

#

like not even the bot, its jsut a guy typing the messages

hoary junco
#

I have give people nitro

mellow kelp
#

ok

drifting wedge
gilded olive
#

how is that body shaming

#

lol

regal creek
#

fat guy

gilded olive
#

"imagine there's some"

hoary junco
#

How is that body shaming

regal creek
gilded olive
#

y not

#

whos gonna take offense

mellow kelp
misty sigil
#

oi its jonmeyjou

#

hi

regal creek
#

I was never here okeh

regal creek
misty sigil
#

hi slave

regal creek
#

HEY IM YOUR STALKER AND YOU ARE MY UH UHHH TARGET

hollow sedge
#

What

true gulch
regal creek
true gulch
#

I tried running that command and it only got an error. I tried many times.

tulip ledge
#

prob client.on

#

I guess client isn't defined

#

@true gulch

gilded olive
#

@pure lion bat cmd pipenv shell pipenv install --dev pipenv install aerich init -t tortoise_configs.default.TORTOISE_CONFIG aerich init-db python main.py

#

i need these commands

#

to be run after the other

pure lion
#

mhm?

gilded olive
#

but i got no idea how

#

it opens cmd

#

but after that

#

nothing lol

#

idk how shit works 🗿

pure lion
#
pipenv shell 
pipenv install --dev 
pipenv install 
aerich init -t tortoise_configs.default.TORTOISE_CONFIG 
aerich init-db
python main.py```
#

just that

#

the cmd command just opens the windows terminal

gilded olive
#

bruh momento

pure lion
gilded olive
#

🗿

pure lion
#

yeah

#

code

#

ing

hoary junco
#

@everyone

earnest phoenix
#

Nice try

mellow kelp
#

I like how you can still get the purple font

hoary junco
#

I wasn’t even trying -_-

mellow kelp
#

like discord tries to troll us by making us think we can ping @everyone

lime cypress
#

how do i put an iframe in my markdown descripton

mellow kelp
#

<iframe></iframe>

#

Or does top.gg not support that

lime cypress
#

i guess

#

but i thought they did

mellow kelp
#

dang

#

i think i saw some bot description with an iframe

lime cypress
#

new question: does top.gg support iframe

#

(for non-certified bots)

mellow kelp
#

maybe just for certified bots

lime cypress
#

yeah :c

mellow kelp
#

that makes sense

hoary junco
#

Wdym. Y certified

lime cypress
#

becuase

#

thats what topgg

#

does

zenith terrace
#

Certified can use javascript iirc

hoary junco
#

I can’t do shit

mellow kelp
#

rejec css

#

return to markdown

hoary junco
#

I can’t even do a button

earnest phoenix
#

CSS === Certified Stupid Shit

zenith terrace
#

thats just ur problem cause I can use css fine

earnest phoenix
#

🗿

#

True

zenith terrace
#

@earnest phoenix qtqtqtqt

earnest phoenix
#

@zenith terrace qt

mellow kelp
#

yeah any bot can use css

#

its another thing if you know how to make something good out of id KEKW

earnest phoenix
#

Imagine being good at CSS

mellow kelp
#

imagine

#

sad backend noises

earnest phoenix
#

CSS is just like binary, hard to fuck with

lime cypress
#

wait

#

can non-certified bots

#

use iframe

#

or not

earnest phoenix
#

Hello

#

I No English

zenith terrace
#

@modern sable pretty sure non cert bots can use iframe yea?

pure lion
#

fek

earnest phoenix
#

Man

lost isle
#

does anyone know any good free hosts

#

onna tight budget

#

xdd

hoary junco
lime cypress
#

for non-certified bots?

hoary junco
#

Yea

dusky sundial
#

Free hosts are usually either a scam or too low performance to host a bot

hoary junco
#

I ain’t on some budget

dusky sundial
#

I personally use Vultr, they're the cheapest VPS's I could find and they work pretty well

hoary junco
#

Yea I heard of it

#

Imma try it

dusky sundial
#

About 100ms

hoary junco
#

With cogs?

dusky sundial
#

Ye

hoary junco
#

Ok pretty good

#

5$ ez

polar glacier
#

does anyone know how too fetch something from the audit log?

#

like i want too get the user that added a role

#

if ygm

hoary junco
#

So basically logs?

polar glacier
#

discord.js btw

#

yeah but not for that purpose

#

because on my server i have a role called legend and i dont want it so my mods can add the role and the user get the same reward

#

just dont know fully how too fetch audit log

analog tinsel
#

How i can change page background to dark or image?

#

Can anyone give me ex. Code?

tulip ledge
#

just do

#
body {
background-color: #000000;
}

lol I suck at css
(dont do that it'll make everything black)

analog tinsel
#

Its more crazy then what i need

#

Thanks for code ill try

earnest phoenix
#

@Alp#0820

body {
  background-image: url(**image url here**);
  background-color:#464646;
}```
sudden geyser
#

You either die a bug, or live long enough to see yourself become a feature.

crimson vapor
#

laughes in errors

gilded olive
#

laughs in "ill fix it tomorrow"

distant cobalt
#

how come the users handling is all wrong? i did js client.users.cache.size

earnest phoenix
#

use this

#

client.guilds.cache.reduce((total, guild) => total + guild.memberCount, 0);

slender thistle
#

Because cache

distant cobalt
#

?

#

okay

earnest phoenix
#

it works for me

#

wait

distant cobalt
#

Erm.

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

module.exports = {
    name:"stats",
    execute(message, args){
        const statsEmbed = new Discord.MessageEmbed()
            .setTitle(`:command: Photon's stats`)
            .setDescription(`These are Photon's Stats all around the world.`)
            .addFields(
                {name:"Ping 🏓", value: `${Date.now() - message.createdTimestamp}`, inline:false},
                {name:"Servers Handling 👀", value: `${message.client.guilds.cache.size}`, inline:false},
                {name:"Users Handling 👤", value: `${client.guilds.cache.reduce((total, guild) =>  total + guild.memberCount, 0)}`, inline:false},
                {name:"Bot ID 💡", value:`779130889565110343`, inline:false},
                {name:"Channels Handling 🔗", value: `${message.client.channels.cache.size}`, inline:false}
            )
            .setTimestamp()
        message.channel.send(statsEmbed)
    }
}```
#

my whole code

earnest phoenix
#

don't use ${}

#

for that code i gave you

distant cobalt
#

Okay

sudden geyser
#

It's 0 because you made a new client and tried using that

distant cobalt
#

okay

sudden geyser
#

when it has no relation to the client you're currently using

earnest phoenix
#

oh

distant cobalt
#

so i remove the new client

earnest phoenix
#

yes

sudden geyser
#

Use your existing client, like you did with message.client.guilds.cache.size

distant cobalt
#

okay

#

just put message. infront of the client

earnest phoenix
#

when you create the client for first time it's not necesary to create a new one

distant cobalt
#

ok

earnest phoenix
distant cobalt
earnest phoenix
#

np

distant cobalt
#

♥️

#

with the embed .addFields how do you make the add fields go 2 by 3

#

in a organized position?

earnest phoenix
#

at the final use

#

, true

#

set all of them to inline

distant cobalt
#

Okay

#

thanks

earnest phoenix
mellow kelp
#

poggers

#

wait what is toLocaleString for?

earnest phoenix
mellow kelp
#

o

#

cool stuff ngl

summer torrent
mellow kelp
#

yea

drifting wedge
#

font = ImageFont.truetype('PTSansCaption-Bold.ttf', 37)
OSError: cannot open resource

#

python

distant cobalt
#

How do you have the bot check how much memory is in the bot? (in MB)

errant hornet
#

What would I use for an and in a if in Node.js?
Like if (owner == true and mod == true) {}

summer torrent
#

&&

errant hornet
#

Isn't && or?

#

Because I use it as or a lot of times

summer torrent
#

&& is and

mellow kelp
#

&& is and

#

|| is or

summer torrent
#

yeah

distant cobalt
crimson vapor
#

what is this for?

distant cobalt
distant cobalt
crimson vapor
#

is it a bot? a webserver? what?

distant cobalt
#

A bot

crimson vapor
#

do you use sharding or discord.js-light?

distant cobalt
craggy pine
#

Probably a moduel

#

for sharding

distant cobalt
#

okay

#

how do i measure shards in my bot then?

#

wait

#

nvm

#

lol

#

i think the number is right

crimson vapor
#

discord.js-light is Tim's lib that is light on memory

distant cobalt
#

ok

crimson vapor
#

how do you find out how much data or the total size of files you have uploaded to github

distant cobalt
#

how do you track the amount of messages sent all together in every server? i tried js message.client.messages.cache.size

crimson vapor
#

do you want to save it, or just cache it?

hollow sedge
distant cobalt
#

cache it

crimson vapor
#

damn you're smart

#

ty

hollow sedge
#

Yw

distant cobalt
#

LIke the ammount of servers but instead messages

crimson vapor
hollow sedge
#

Woah

crimson vapor
#

now I remember that I once pushed my fucking test uploads

hollow sedge
#

There's a 1 GB repo limit I think

crimson vapor
#

ye

#

but I learned how to use .gitignore

summer torrent
#

how did you see that

distant cobalt
hollow sedge
crimson vapor
crimson vapor
#

I hate how I can't delete files from gh

hollow sedge
#

You can

#

You just can't delete folders

crimson vapor
#

I thouht it just makes a new commit

hollow sedge
#

It does

distant cobalt
hollow sedge
#

@crimson vapor why do you need to do that anyway

crimson vapor
#

and no thats not

#

I made a mistake

distant cobalt
hollow sedge
#

What did you do

crimson vapor
#

message.client.guilds.cache.messages

distant cobalt
#

Okay

crimson vapor
distant cobalt
#

lol

hollow sedge
#

Do git rm ./ -r --cached

#

After adding them to your gitignore

crimson vapor
#

will that remove from gh tho?

hollow sedge
#

You have to push it to github

#

But yes it will

distant cobalt
crimson vapor
#

hmm

#

idk then

distant cobalt
#

i did js message.client.guilds.cache.messages

crimson vapor
hollow sedge
#

@crimson vapor did that work

crimson vapor
#

im too scared

#

lemme pull another one to test

#

and then checkout

hollow sedge
#

Just copy the repo

#

Also everything is literally on github

crimson vapor
#

rn

hollow sedge
#

Why

mellow kelp
#

whoa

summer torrent
#

how

mellow kelp
#

Size: 309mb

hollow sedge
#

Why are you putting it on read-only tho

crimson vapor
#

wdym

hollow sedge
#

Wait was it already there

crimson vapor
#

its like long ago

hollow sedge
#

Nvm I'm just dumb

crimson vapor
#

nah the command didn't work

hollow sedge
#

Yeah hold on it's something like that

#

Let me find out

#

Worked for me

drifting wedge
#

font = ImageFont.truetype('PTSansCaption-Bold.ttf', 37)
OSError: cannot open resource
py

crimson vapor
#

I mean its old commits

#

like long ago

#

the command only removed new files

hollow sedge
#

Oh...

#

You might want to just create another repo then

crimson vapor
#

yea thats what im thinking

#

but like

#

300 commits almost

hollow sedge
#

I don't understand how you accidently committed that

crimson vapor
#

LOL

#

im not that good at git

hollow sedge
#

You should always run git status before committing

#

Was it just a few commits?

crimson vapor
#

idk tbh

hollow sedge
#

I think you can remove those

crimson vapor
#

I also forgot to ignore .DS_STORE

#

can you push a cloned repo to another repo?

hollow sedge
#

why 😢

#

you make me cry

#

pls use git status

#

also probably

crimson vapor
#

hmm

mellow kelp
#

hmm

#

how about using vscode git features

hollow sedge
#

^ that shows you too

mellow kelp
#

yea

hollow sedge
#

and theres gh desktop

mellow kelp
#

i use those all the time

#

is github desktop gud?

hollow sedge
#

well yeah

mellow kelp
#

pog

#

im gonna try it

hollow sedge
#

its good for its purpose..which is pretty simple

mellow kelp
#

that kinda makes sense

hollow sedge
#

you cant manage stuff on their though

earnest phoenix
#

let me introduce your opponent

mellow kelp
craggy pine
sudden geyser
#

I remember leaving my node modules folder on my desktop so it would upload and download.

#

ended up spending like 20-30 minutes waiting for it to download, big mistake

crimson vapor
earnest phoenix
#

theme of?

#

posh?

crimson vapor
#

of windows terminal

earnest phoenix
#

oh

#

i've just got acrylic enabled (0.2 opacity)

#

and #d8d8d8 foreground

crimson vapor
#

o

peak viper
#

Why this command is not working?

#
@client.command()
async def ping(ctx):
   await ctx.send(f'Pong! Your ping is `{client.latency * 1000} ms`!')
sudden geyser
#

You tell us. What isn't working about it?

peak viper
#

Yes

earnest phoenix
#

hey

#

how can i get a server list of where my bot is in?

#

on discord.js

#

??

#

@sudden geyser are you there?

soft violet
earnest phoenix
#

i already made it

delicate shore
#

Omg

soft violet
#

bro.

#

that's going to be hell

delicate shore
#
[
  {
    "artists": [
      {
        "external_urls": {
          "spotify": "https://open.spotify.com/artist/5a2w2tgpLwv26BYJf2qYwu"
        },
        "href": "https://api.spotify.com/v1/artists/5a2w2tgpLwv26BYJf2qYwu",
        "id": "5a2w2tgpLwv26BYJf2qYwu",
        "name": "SOPHIE",
        "type": "artist",
        "uri": "spotify:artist:5a2w2tgpLwv26BYJf2qYwu"
      }
    ],
    "duration_ms": 188520,
    "episode": false,
    "explicit": false,
    "external_urls": {
      "spotify": "https://open.spotify.com/track/18yTgk0VgjB9XDj8h2q6Td"
    },
    "href": "https://api.spotify.com/v1/tracks/18yTgk0VgjB9XDj8h2q6Td",
    "id": "18yTgk0VgjB9XDj8h2q6Td",
    "name": "JUST LIKE WE NEVER SAID GOODBYE",
    "popularity": 34,
    "preview_url": "https://p.scdn.co/mp3-preview/d5790004de973f83756311075125ffc965e522c8?cid=a46f5c5745a14fbf826186da8da5ecc3",
    "type": "track",
    "uri": "spotify:track:18yTgk0VgjB9XDj8h2q6Td"
  }
]```
I want to get the artist's name
#

so If I do array.artists
it gives this

"artists": [
      {
        "external_urls": {
          "spotify": "https://open.spotify.com/artist/5a2w2tgpLwv26BYJf2qYwu"
        },
        "href": "https://api.spotify.com/v1/artists/5a2w2tgpLwv26BYJf2qYwu",
        "id": "5a2w2tgpLwv26BYJf2qYwu",
        "name": "SOPHIE",
        "type": "artist",
        "uri": "spotify:artist:5a2w2tgpLwv26BYJf2qYwu"
      }
    ]```
soft violet
#

${client.guilds.cache.size} @earnest phoenix

delicate shore
#

How can I get the name

earnest phoenix
#

that's for quantity

#

i said list

#

LIST

soft violet
#

why would you want a list...

earnest phoenix
#

curiosiry

#

curiosity

soft violet
#

ok

earnest phoenix
#

and i already made it

mellow kelp
earnest phoenix
#

thx cholo

#

xd

delicate shore
#
<client>.guilds.cache.forEach(guild => {
<msg>.channel.send(guild.name)
})```
@earnest phoenix
earnest phoenix
#

i already made it

delicate shore
#

Oh ok

earnest phoenix
#

but thx

delicate shore
#

Mention not

earnest phoenix
#

wut

#

what the hell is that?

#

do you mean "No problem" or something like that?

delicate shore
#

Yess

earnest phoenix
#

Ok

delicate shore
#
[
  {
    "artists": [
      {
        "external_urls": {
          "spotify": "https://open.spotify.com/artist/5a2w2tgpLwv26BYJf2qYwu"
        },
        "href": "https://api.spotify.com/v1/artists/5a2w2tgpLwv26BYJf2qYwu",
        "id": "5a2w2tgpLwv26BYJf2qYwu",
        "name": "SOPHIE",
        "type": "artist",
        "uri": "spotify:artist:5a2w2tgpLwv26BYJf2qYwu"
      }
    ],
    "duration_ms": 188520,
    "episode": false,
    "explicit": false,
    "external_urls": {
      "spotify": "https://open.spotify.com/track/18yTgk0VgjB9XDj8h2q6Td"
    },
    "href": "https://api.spotify.com/v1/tracks/18yTgk0VgjB9XDj8h2q6Td",
    "id": "18yTgk0VgjB9XDj8h2q6Td",
    "name": "JUST LIKE WE NEVER SAID GOODBYE",
    "popularity": 34,
    "preview_url": "https://p.scdn.co/mp3-preview/d5790004de973f83756311075125ffc965e522c8?cid=a46f5c5745a14fbf826186da8da5ecc3",
    "type": "track",
    "uri": "spotify:track:18yTgk0VgjB9XDj8h2q6Td"
  }
]```
#

I want to get the artist's name
so If I do array.artists
it gives this

"artists": [
      {
        "external_urls": {
          "spotify": "https://open.spotify.com/artist/5a2w2tgpLwv26BYJf2qYwu"
        },
        "href": "https://api.spotify.com/v1/artists/5a2w2tgpLwv26BYJf2qYwu",
        "id": "5a2w2tgpLwv26BYJf2qYwu",
        "name": "SOPHIE",
        "type": "artist",
        "uri": "spotify:artist:5a2w2tgpLwv26BYJf2qYwu"
      }
    ]```
versed gulch
#

Aight who's good with timestamps?