#development

1 messages · Page 1405 of 1

stoic girder
#

How to make a bot?

south sinew
#

bot token?

sour steeple
#

Do u understand 'register bot'

stoic girder
#

That kinda makes no sense

tardy hornet
#

you are assuming right

south sinew
#

you would use that method

sour steeple
#

I need registeration bot codes

#

Do u understand now

faint prism
#

No

sour steeple
#

uh

hollow sedge
#

someone just give him the registration bot code

#

please

faint prism
#

I only have missile codes, sorry

sour steeple
#

uh

#

ok

hollow sedge
#

oof

sour steeple
#

no problem my friend

#

I'm just quiet now

hollow sedge
#

@sour steeple im sorry, idk why they aren't giving you the registration bot code

sour steeple
#

no problem thx

faint prism
#

I have no idea what he is asking for sad

hollow sedge
#

yeah i might just contact a moderator

#

cause that's messed up that they aren't giving the registration bot code

south sinew
tardy hornet
#

ty

south sinew
#

np

hollow sedge
sour steeple
#

thx Im searching this codes

#

ty

#

Finally I have a ask

#

Is there a problem with the glitch website or just me problem

hollow sedge
#

most likely a you problem

sour steeple
#

ok

viral spade
#

Türkçe bilen varmı birşey sorucam

sour steeple
#

thx

#

sor knk

#

ben varım

viral spade
#

ama dbl sormam lzm size değil

sour steeple
#

ok

#

türk yok

#

o zaman

#

xd

viral spade
#

botumda mute komutu ayarlamadan çalışmıyor bunlar mute çalışmıyor demesinlerde

hollow sedge
#

wth is going on lol

sour steeple
#

Turkish chat

#

:d

hollow sedge
#

im pretty sure it's english-only here

sour steeple
#

uh ok

#

@viral spade pm

hollow sedge
#

anyway saying "blank doesn't work" isn't really enough for someone to help you

tardy hornet
#

how do i fix that problem:

restive furnace
#

huh?

tardy hornet
restive furnace
#

that's not the error... that's just like saying "hey, a error happened"

#

screenshot above

tardy hornet
#

ik

#

idk how to fix the problem

restive furnace
#

can't help without the real error

tardy hornet
#

1s

restive furnace
#

can't find gyp file

tardy hornet
#

so i need to install gyp

#

?

quartz kindle
#

no

tardy hornet
#

then what?

quartz kindle
#

npm install -g windows-build-tools from an administrator cmd or powershell

#

(run as administrator)

tardy hornet
#

i did

#

that already

quartz kindle
#

did you wait for it to finish? did it say "ALL DONE"?

tardy hornet
#

i think i downloaded the 2015 one

quartz kindle
#

you dont need to download it manually

#

run the command again

#

from an admin powershell

tardy hornet
#

or cmd?

quartz kindle
#

it will not install if its already installed

#

so you can use it to confirm that it is installed

tardy hornet
quartz kindle
#

as long as its admin

tardy hornet
#

okay

#

will it say all done when its done?

#

all i see is that:

#

@quartz kindle

quartz kindle
#

it will say ALL DONE

tardy hornet
#

okay

quartz kindle
#

python is done, but visual studio is installing

tardy hornet
#

will it take like 10m?

quartz kindle
#

depends on your pc

#

can take 30min or more if you have a potato

tardy hornet
#

its not saying that its done but its not showing anything moving

#

i guess i will wait the 30

quartz kindle
#

its normal

tardy hornet
#

but will it fix it?

#

because i used it and it worked before

quartz kindle
#

yes it will "fix" it

#

sqlite is a C library, it needs to be compiled into an executable that node understands

#

thats why it needs build tools

#

some combinations of sqlite and node versions have a few "pre-built" binaries that can be downloaded instead, but usually recent versions dont have them yet, so it needs to be built from source

tardy hornet
#

@quartz kindle

#

its done

#

can i close it?

quartz kindle
#

yes

tardy hornet
#

didnt work

#

Tim

#

@quartz kindle

half dew
#

alright, soooooo my bot was declined TWICE now for not having a working help command
what is considered a "working" help command?

quartz kindle
#

a help command that works?

tardy hornet
#

tim, it didnt work

half dew
#

as far as i m informed, it works

quartz kindle
tardy hornet
#

okay

half dew
#

i have even made my bot show the help command in the status...

quartz kindle
tardy hornet
#

here you go tim

half dew
#

my bot doesnt executed anything if it doesnt have permissions and instead messages the owner to give the bot perms

quartz kindle
half dew
quartz kindle
#

if the user has dms disabled, he will never receive anything

tardy hornet
quartz kindle
#

help command should always work without any permissions, besides the basics

stoic hull
#

You can just check if the user has dms enabled.

tardy hornet
#

npm i better-sqlite3

#

new error tim^^^

half dew
#

alright, thanks for the help guys

#

time to delete my bot

stoic hull
#

Why?

half dew
#

cause its trapped in the verification limbo

#

and needed this boost to maybe someday get out of it

stoic hull
#

Don't delete it yet.

quartz kindle
#

and try installing there

tardy hornet
#

okay

quartz kindle
#

yes thats why i suggested it

tardy hornet
#

how do i change the name then lol

quartz kindle
#

did it work if you install it in a folder in C:/?

tardy hornet
#

idk

#

it always was there

#

okay i see the problem

#

its because the name

teal egret
#

לול אתה מישראל

tardy hornet
#

כן

tardy hornet
#

איזה בוט יש לך

#

@teal egret

#

@quartz kindle ty so much

teal egret
#

happy bot

#

ו happy bot mod

tardy hornet
#

show me

teal egret
#

שהשני עדיין לא שוחרר

#

איך?

tardy hornet
#

?

teal egret
tardy hornet
#

@teal egret DM me

teal egret
#

50 שרתים

tardy hornet
#

יפה

river thistle
#

problem with the discords api ?

#

takes years to connect my bot

hollow sedge
river thistle
#

ikr but nothings on it

quartz kindle
#

how long is "years"

#

how many servers is your bot in

tardy hornet
#

what is the html color of the moderator role?

earnest phoenix
#

"html color" what

tardy hornet
#

the #

earnest phoenix
#

hex

tardy hornet
#

yeah

earnest phoenix
umbral zealot
#

rgb(244, 68, 68) , actually.

earnest phoenix
#

oh

#

yeah mine is probably inaccurate because im using acrylic

umbral zealot
#

Inspect Element is neonblobjustright

tardy hornet
#

ty cry

cosmic robin
#

message.mentions.members.first().roles.add(muterole.id);```
so im trying this but Im getting the error ```UnhandledPromiseRejectionWarning: TypeError [INVALID_TYPE]: Supplied roles is not a Role, Snowflake or Array or Collection of Roles or Snowflakes```
earnest phoenix
#

think about what you're doing

#

fetch is a promise

#

await it

cosmic robin
#

ah ofc mb

quartz kindle
#

and the first parameter is not a function

earnest phoenix
#

oop

umbral zealot
#

looks like you should just replace fetch() with find() since roles are always cached anyway.

earnest phoenix
#

not with djs light

umbral zealot
#

Eww.

pure lion
#

Wdym eww

quartz kindle
#

why ew lmao

pure lion
#

Tim made that

placid iron
#

so i have this https://img.rovi.me/9HovB55coF.png and it works perfectly, no extra bot processes are created but it runs the image editing in a new process so it doesnt block the main one. However, when i do this https://img.rovi.me/6Wpucqd3Si.png ( https://img.rovi.me/OsbKzDLwLz.png this is in another file, image_gen.py ) It does decide to create a duplicate process of the bot's main script which obviously isn't what i want. i have tried it with the ctx.typing to see if that makes a difference but it didnt either so i have honestly no idea why it is deciding to work inside the command but not when it is in a new file

pure lion
#

How dare you disrespect tim

slim umbra
#

just use rust and then u have real big dick energy

pure lion
#

What if I don't want a dick nekohuh

quartz kindle
#

lmao

umbral zealot
#

I'm just not a fan of disabling caches just for the sake of saving memory then having people go "oh why isn't this available" all the time. But, obviously, that's a personal opinion.

pure lion
#

I do it because I know my shit

#

I don't that was a joke

quartz kindle
#

well, not everyone can afford needlessly large machines xD

pure lion
#

I still do it anyway

broken sentinel
#

Can somebody tell me how to host discord bot 24/7 free

pure lion
#

Not free

#

Ever

#

Check pins

umbral zealot
#

If by "needlessly large servers" you mean 128mb RAM, then... we have a different definition of "large" 😂

pure lion
#

My server has 2 gig 👀

cunning tendon
#

@broken sentinel there are some other free hosting options, but the best options are

  1. self host
  2. get a raspberry pi
  3. buy a server
broken sentinel
#

It can be free from visual studio code but my computer need to be turn on 24/7

pure lion
#

You don't need vscode

#

You're just using the console

#

Wait what does the ba part of bash mean bongo

quartz kindle
pure lion
#

Thicc

cunning tendon
umbral zealot
#

There are a whole lot of factors that can affect ram usage.

pure lion
#

A massive one is caching literally everything

quartz kindle
#

caching is the primary one

pure lion
#

Why cache when you can smash
~ Dice, 2020

quartz kindle
#

although discord did a good thing by disabling members from being cached at login if you dont have the intent

#

things arent as dire anymore

#

plus intents

umbral zealot
#

lol. I'm looking at my stats and there I see it... that 1.4GB on a thing I haven't rebooted in 3 months. Probs a memory leak in my code.

pure lion
#

Mind typing in neofetch

quartz kindle
#

how many guilds?

umbral zealot
pure lion
#

@umbral zealot how much ram do you have lad/lass?

umbral zealot
#

Eh, that's a pretty big server, I think 8gb on there? Used it to run a couple game servers over the years so I pay more than I really ought to

pure lion
#

That's a lo-

umbral zealot
#

That one was on 2 servers only so really it was a code problem. never updated to discord.js v12 so it just wasn't working probably.

#

I left the company I made that bot for and sent 'em the code, they can figure it out 😂

quartz kindle
#

xD

pure lion
#

Yes big brain

quartz kindle
#

but discord.js does in fact waste a lot of memory

#

every 100k members is like 100mb, every 100k channels is like 60mb

pure lion
#

Tim are you a react person or a vue person or an angular person YEEEEE

umbral zealot
#

Considering Etiket is on 60 servers including this one and only uses 98MB though...

pure lion
#

Wait lemme see how much mine uses

quartz kindle
pure lion
#

Ah

#

Epic

#

What do you use

quartz kindle
#

at the moment nothing

#

just html and css

pure lion
#

Dam

quartz kindle
#

but im looking into svelte

pure lion
#

That's coool

#

I like the look of that

cosmic robin
#
        if(!muterole) {
                const Embed = new Discord.MessageEmbed()
                .setColor(0xff009e)
                .setDescription('You need to create a role called "Muted" First')
                message.channel.send(Embed);
            }``` its now outputting ```TypeError: Cannot read property 'id' of null```
quartz kindle
#

you're still doing it wrong

#

.fetch() takes an id

#

it can only get a role by id

#

if you want to search roles by name, you need to use .cache.find()

cosmic robin
#

ah ic

earnest phoenix
cosmic robin
#

i tried just .find and it didnt work

earnest phoenix
#

it was like heroku or something

cosmic robin
#

ty

hollow prawn
#

could I possibly collapse this in a way, probably storing the runAndUptime = bot.channels.cache.get('ID'); inside a .json file such as my botconfig file?

earnest phoenix
#

you shouldnt be logging to discord in the first place

#

for error logging you should definitely check out sentry

hollow prawn
#

cba to use paid software, I don't think it should be much of a issue to log into discord as its the only app I'm actively on, everything else I just dont use, it shouldn't have much errors as well as I simply re-write all of my code to d.js v12

quartz kindle
#

there is no way to collapse that

#

besides using an object or an array

#

you cant store a channel in json, you can only store a string

hollow prawn
#

aight

quartz kindle
#

you could probably attach those somewhere tho

astral yoke
#

anybody know why this const bot = new Client({partials: ["MESSAGE", "USER", "REACTION", "CHANNEL", "CHANNEL"]}); makes message.author.bot null?

quartz kindle
#

like client.runAndUptime = bot.channels.cache.get()

#

@astral yoke whats your discord.js version?

hollow prawn
#

I could, but wouldn't that be essentially just the same as I'd have to define then error logs, every logs and all that

astral yoke
#

^12.3.1

quartz kindle
#

you should update to 12.5.0

astral yoke
#

Okay, just npm install discord.js?

quartz kindle
#

ye

#

is the message.author.bot from a client.on("message") ?

astral yoke
#

its from an updateMessage yeah

#

still errors with 12.5 @quartz kindle

quartz kindle
#

are you getting it from the old message or the new message?

astral yoke
#

im not to sure

quartz kindle
#
client.on("messageUpdate", (oldMessage, newMessage) => {
  console.log(newMessage.author.bot)
})
astral yoke
#

it errors with all my code that contains if(message.author.bot) not just message Update

#

messageupdate, messagedelete, anything that has if message author bot

quartz kindle
#

messageDelete wont have it if its not cached

#

messageUpdate wont have it in the old message if its not cached

solemn leaf
#

How can I remove someone from quick.db

#

like db.remove?

astral yoke
#

@quartz kindle so how would i properly cache it so it can check if message.author.bot?

#

db.delete(`sample_${message.author.id}`) @solemn leaf

quartz kindle
solemn leaf
#

can I make text thick in a footer?

astral yoke
#

i believe not

plucky dove
#

woaj

#

woah

astral yoke
# quartz kindle fetch the user

it just errors after error spamming console (node:18944) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of null

#

which there is the code you gave me

quartz kindle
#

so message.author itself is null then

#

not message.author.bot

astral yoke
#

so does that have todo with patrial message?

#

if i remove it it dosent error anymore

#

thats so weird

solemn leaf
#

will this work?

#

try { message.member.roles.remove(role); } catch { };

#

like say if their isnt the role

quartz kindle
#

but that wont work for messageDelete

#

its impossible to get more information about deleted messages if they were not previously cached

#
if(message.partial) await message.fetch();
if(message.author.partial) await message.author.fetch();
console.log(message.author.bot)
#

this should work everywhere else

#

for messageDelete you have to if(message.partial) return; instead

quartz kindle
solemn leaf
#

so await before it

#

try { await message.member.roles.remove(role); } catch { }

quartz kindle
#
try {
  await ...remove(role)
} catch(e) {
  console.log("failed to remove due to error:", e)
}
solemn leaf
#

I dont need to add anything in the catch bcs if it fails that means their isnt the role

#

and I dont need to do that so

quartz kindle
#

if you want to ignore the error its easier to use .catch()

#

message.member.roles.remove(role).catch(() => {})

#

its a one-liner

solemn leaf
#

ok

#

thanks

bronze bramble
#

Would anyone be able to assist me in hosting my bot on glitch

#

I have every file, I need to file them in a directory and then run the main.py

#

I’m inexperienced

errant perch
hollow sedge
#

no it doesn't?

#

not in general

zealous sable
#

I love how sucks pp is automatically meaning it’s bad KEKW 🌈

rustic nova
#

Most out of context yet WatameHeadbangFast

zealous sable
#

Just defending the 🏳️‍🌈

sudden geyser
#

the rainbow

#

was my savior when using a chromebook

opal plank
normal blade
#

Are VPS free

earnest phoenix
#

no

#

lul

normal blade
#

;((

#

i dont have money

earnest phoenix
#

me too

#

do u know how to code?

normal blade
#

i use heroku but used all dynos and cant use heroku anymore

#

i know how to code

earnest phoenix
#

gare u good at it?

normal blade
#

yeah

earnest phoenix
#

are*

#

want to help me

normal blade
#

eh

#

idk

#

i use pyhton

#

*python

earnest phoenix
#

u dont use vs

normal blade
#

i do

earnest phoenix
#

?

normal blade
#

VSCode

#

Python

#

is that what you meant

#

uhh

rustic nova
#

i just suggest moving to a vps instead of a free host

normal blade
#

what vps

rustic nova
#

because 1st: there aren't many free reliable hosts
2nd: quality comes with a price

normal blade
#

ok

#

What VPS

#

though

#

bluehost?

rustic nova
#

the provider mainly depends on what you want to spend

normal blade
#

ok

#

i dont have money and i cant spend so ill stay using heroku

#

wish there were free bot hosting servers

hollow sedge
#

That's understandable

solemn latch
#

sadly servers cost money and always will.

mild valve
#

how can i set a background image

rustic nova
mild valve
#

ty

wise quartz
#

how to make embed fields show one under another instead of all in one row?

#

(py)

mild valve
#
inline=False
wise quartz
#

didn't work

#

tried False n True

mild valve
#

i have no idea then

wise quartz
#

could be my end problem

pale vessel
#

Can we see your code?

wise quartz
#

nvm it worked

#

i accidentally added it to the other cmd

#

lol

pale vessel
#

noice

wise quartz
#

i do have another problem tho sec

slender thistle
#

I'm about to approach you with an intent of murdering you

wise quartz
pale vessel
#

You have lots of problem

wise quartz
#

n the colour

slender thistle
#

I'm curious what that is but I'm in comfy bed

pale vessel
#

Which command?

solemn latch
#

comfy bed, best bed.

wise quartz
#

i am not really sure just wanted to make an economy bot for fun

wise quartz
#

its too large to be sent here

pale vessel
#

Yeah and all of them? cash, bank. etc.

wise quartz
#

yeah those dont send

pale vessel
#

Hm

wise quartz
#

only the author

wind heart
pale vessel
#

Try debugging

#

print(key) and value before if key == "cash"

wise quartz
#

so no idea?

#

😩 debugging it is then

pale vessel
#

Just to see that you're receiving the data properly

wise quartz
#

ye i understand u

#

and i wanted to do that

#

but kept it as the last choice

#

cuz its boring af

pale vessel
#

cash is value

wise quartz
#

its a boolen

#

inside a dictionary

#

inside my db

#

boolean?

pale vessel
#

How can you get an amount from a value

wise quartz
#

wdym?

pale vessel
#

Never mind

wise quartz
#

lol

#

no explain

pale vessel
#

Python notlikeduck

wise quartz
#

cash is a value and cashName, startCash are other seperate values

#

if thats what ur meaning

#

or i am just dumb

#

OH if cash is True

#

damnit

pale vessel
#

So the starting cash is a boolean

wise quartz
#

nope

#

my db is like

pale vessel
wise quartz
#

a dict

#

and its made of keys n values

pale vessel
wise quartz
#

i check if the key is "this"

#

and if it is

#

then "this" is its value

#

basically reading the db

#

if i was using json or smthing

#

i have to get "cash" value to check if its True or False

pale vessel
#

Is it an int?

wise quartz
#

nope

#

a bool

#

startCash is an int

pale vessel
wise quartz
#

cashName is a string

#

lemme show u

pale vessel
#

But startCash is value

slender thistle
#

What the fuck

pale vessel
#

am I not understanding this correctly

slender thistle
#

Frankly, I'm lost just by reading this chat

wise quartz
#

lemme show u the db to understand

#

basically setup is a dict

#

i look for the key n values of it

#

if the key is "cash"

#

then my cash variable inside my cmd

#

is "cash" s value

#

so basically my "cash" value

#

is the value of my variable cash

#

inside my cmd

#

now

#

understood?

pale vessel
wise quartz
#
cash = True
cashName = "Cash"
cashIcon = ":dollar:"
startCash = 0
bank = True
bankName = "Bank"
bankIcon = ":credit_card:"
startBank = 0
leaderboard = False
leaderboardName = "Leaderboard"
leaderboardIcon = "null"
userPerPage = 5
shop = False
shopName = "Shop"
shopIcon = "null"
itemPerPage = 10
#

those are variables i defined in my code

#

basically i am getting the value from my db

slender thistle
#

if key is cash
then later
if key is bankname

wise quartz
#

and putting it to these vars

#

i am looping over all the keys in my db and if the key name is "cash" then i define its value to my cash variable

#

and then same thing for the other keys

#

and if its value is True then i read the stuff related to it

#

else i pass

#

understood?

#

🤣

#

it makes sense on my head atleast

slender thistle
#

There ain't a way key is cashName when it's nested in if key == "cash"

wise quartz
#

h..huH?

pale vessel
#

Lmao

slender thistle
#

The snippet flaze sent

wise quartz
#

ok u know what i'll make seperate childs inside the setup child and then loop over the child and its values and then check if the child is "that" and get "that" value

#

will loop better anyways

#

if that makes sense to u

slender thistle
#

If it works, it works.

zenith knoll
#

how do you get the name of a deleted channel?

#

because the event returns a partial channel obj which has Undefined as the name

rustic nova
#

once the channel is deleted, you can't get the name

#

unless the channel is cached

zenith knoll
#

uh so there is no way to get it?

#

i tried fetching the name from audits, but still undefined

wise quartz
#

i made something stupidly smart looking

#

wish me luck

rustic nova
#

"stupidly smart looking"

#

im getting mixed signals there

wise quartz
#

damn

#

it actually

#

didn't work

#

alr back to work

#

if i make a function

#

that returns either False or True

#

how do i check if it returned that or that?

#

if(function()):
doesn't seem to work apparently

slender thistle
#

if function():

wise quartz
#

aha

#

makes sense

#

somehow

#

a

#
def getCash(ctx):
        cashName = "Cash"
        cashIcon = ":dollar:"
        startCash = 0
        setup = db.child("guilds").child(ctx.guild.id).child("setup").child("cash").get()
        setupval = setup.val()
        if setupval is None:
            return False
        for key, value in setupval.items():
            if key == "cashName":
                cashName = value
            elif key == "cashIcon":
                cashIcon = value
            elif key == "startCash":
                startCash = value
            else:
                pass
        return True
#
@commands.command()
    async def test2(self, ctx):
        embed = discord.Embed(colour=discord.Colour.gold())
        if setup.getCash():
            embed.add_field(name=f"{cashIcon} {cashName}", value=f"Starting amount: ``{startCash}``")
        embed.add_field(name=f"~~Cash~~", value=":x:")
        embed.add_field(name=f"~~Shop~~", value=":x:")
        embed.set_author(name=ctx.guild.name, icon_url=ctx.guild.icon_url)
        await ctx.send(embed=embed)
#
Command raised an exception: AttributeError: 'function' object has no attribute 'getCash'

see what i ment by "stupidly smart looking"

slender thistle
#

setup is a function

wise quartz
#

its a class..?

#

class Setup(afasfasf

slender thistle
#

The exception text says otherwise

#

setup isn't the same as Setup

wise quartz
#

righhhhhhhhhhhhht

#

i knew ur a genuis

#
Command raised an exception: TypeError: getCash() missing 1 required positional argument: 'ctx'

it doesn't need self does it?

#

because if i add it it causes another error

#
Command raised an exception: TypeError: getCash() missing 2 required positional arguments: 'self' and 'ctx'
slender thistle
#

It requires ctx and I don't know why you made it require it

wise quartz
#

wdym

slender thistle
wise quartz
slender thistle
#

Since getCash is a method, it requires self, ctx to be its parameters

#

But you only pass ctx

wise quartz
#

that gives me another error

#
Command raised an exception: TypeError: getCash() missing 2 required positional arguments: 'self' and 'ctx'
#

^^^

slender thistle
#

Pain

#

How are you calling it

wise quartz
#

😆

slender thistle
#

Oh

wise quartz
#

if getCash():

slender thistle
#

Dear fuck God

wise quartz
#

oh no

slender thistle
#

Is it a classmethod

wise quartz
#

i messed up very bad didn't i?

slender thistle
#

Not really. Just a small flaw in the logic

wise quartz
#

its inside a class if thats what u mean

#

inside the Setup class

#

i changed setup.getCash() to Setup.getCash()

#

or should i remove it?

slender thistle
#

Well

#

Here's the funny thing

#

If it's not a classmethod, it requires an instance of the class to be used

wise quartz
#

English please

slender thistle
#

See Google on how class/staticmethods work in Python

earnest phoenix
#

tldr google how OOP works

slender thistle
#

that too

wise quartz
#

cant u explain it in 1/2 words or smthing

#

or is it that complex?

earnest phoenix
#

objects

#

that'll be $50

weary torrent
#

Can some 1 please send the code for the embed thing. Using Python language. So I can compare mine to. Bc idk wat i did wrong

earnest phoenix
#

no

#

debug your code

slender thistle
#

what did you do

weary torrent
#

how do I debug it??

weary torrent
#

wha??

earnest phoenix
#

follow the docs, use a debugger, print all errors you get

wise quartz
#

embeds are somewhat easily tricky

#

they get u sometimes

sudden geyser
#

Don't ask what. Ask why.

earnest phoenix
#

at least they're willing to debug in the first place

#

it makes my blood boil when people act like you're their slave to find the error and fix it for them

wise quartz
#

chill m8

#

just dont help them if u dont like too

sudden geyser
#

What's annoying is when someone pastes their code, the error message, and nothing else. Not even a "why doesn't this work".

wise quartz
#

uhm...

weary torrent
#

Srry Im kinda new to coding.

So... Can some 1 please tell me what I did wrong here and how can I fix it??

async def displayembed(ctx):
	channel = ctx.message.channel
	embed = discord.Embed(
		title = 'Title',
		description = 'This Is A Description.',
		colour = discord.Color.blue()
)

embed.set_footer(text='This Is A Footer.')
embed.set_image(url='https://danbooru.donmai.us/data/eea7e72b54ac9a60fb54b79e404a4639.mp4'),
embed.set_thumbnail(url='https://danbooru.donmai.us/data/eea7e72b54ac9a60fb54b79e404a4639.mp4')
embed.set_author(name='Author Name',
icon_url='https://danbooru.donmai.us/data/eea7e72b54ac9a60fb54b79e404a4639.mp4')
embed.add_field(name='Field Name', value='Field Value',inline=False)
embed.add_field(name='Field Name', value='Field Value',inline=True)
embed.add_field(name='Field Name', value='Field Value,'inline=True)

#await client.say(embed=embed)
await client.send_message(channel, embed=embed)```
earnest phoenix
#

you called it

wise quartz
#

from pass_context=True i am sure ur code is outdated

#

🤣

sudden geyser
#

client.send_message is not a thing anymore I think

wise quartz
#

told ya

earnest phoenix
#

more than likely copypasted from a third party source

#

sigh

weary torrent
#

No

wise quartz
#

wait all i had to do is @staticmethod above my function? @slender thistle

weary torrent
#

I am learning from a 1+ gear old playlist on yt xdd

On... How to code xdd

slender thistle
#

Maybe

wise quartz
#

ah tricky boi

weary torrent
#

Im very new.

#

To coding

#

xdd

earnest phoenix
#

ok

hasty mulch
#

Is there a way to get the traceback that comes up when reloading a cog to be sent as a chat message with Discord.py?

weary torrent
#

Yess

wise quartz
#

lmao

#

i knew it

weary torrent
#

it is Lucas?
@wise quartz

Yess

#

Xdd

wise quartz
#

he has a newer playlist try it

weary torrent
#

I skipped cogs one tho

wise quartz
weary torrent
#

My friend said wait until I know more coding

wise quartz
#

thats less outdated

weary torrent
#

Ok thxx

earnest phoenix
#

well yeah your friend is right

earnest phoenix
#

you're trying to run before you can walk

hasty mulch
wise quartz
#

its kinda complicated to explain

#

look for it on the docs

#

look for exception & traceback

hasty mulch
#

With those words?

wise quartz
#
try:
            client.reload_extension(ext)
        except Exception as e:
            exceptiondata = traceback.format_exc(limit=1).splitlines()
            ~~do this line urself~~
            ~~do this line urself~~
        if trace:
            for key, value in trace.items():
                await ctx.send(value)
``` @hasty mulch
#

thats an example

#

(unfinished)

hasty mulch
#

And then ctx.send(embed)?

wise quartz
#

u can just send the msg

#

ignore the embed part

hasty mulch
#

What do I call to send it?

wise quartz
#

i edited it

#

you need those 2 crossed out lines for it to work tho

#

figure them out urself

feral aspen
#

Hello.

#

Is there a way in the guildCreate event for the bot to create an invite when it joins a server and console log it?

rustic nova
#

That's a privacy breach

#

so no

feral aspen
#

I just usually like to ask the owners what they didnt like from the bot for them to remove it and how I can improve it in the future.

rustic nova
#

make that through a !suggest thing

#

but creating an invite for you to join through is a privacy breach

wise quartz
#

make a feedback feature thru ur bot private

#

(dms)

earnest phoenix
#

or have the suggestions in your bot support guild

wise quartz
#

mhm

earnest phoenix
#

if they don't post there, they don't care

feral aspen
#

Is it against tos for me to do that?

#

Or something against the rules?

rustic nova
#

both

weary torrent
#

@wise quartz

Can u please dm me a link to the new yt playlist.

#

I cant find it

earnest phoenix
#

follow official docs instead of youtube tutorials

wise quartz
#

man yt tutorials wont help u tbh

#

just mainly ask in help servers

#

and read the docs

#

and just mess around

crystal wigeon
#

hey

wise quartz
#

with what u know so far

weary torrent
#

Kk

crystal wigeon
#

umm does anyone know how to set up a winstond daemon?

wise quartz
#

wwhat?

feral aspen
#

What is that.

crystal wigeon
#

This was the basic template i found but im getting some super prototype error not able to figure it out

#

winstond?

#

winston logger http endpoint

#

instead of winston logging into a local file i want it to log into a server file

wise quartz
#

ah js

crystal wigeon
#

"winston" has the transporter.. apparently i need to set up winstond the deamon for it as well

#

the error is weird af man

wheat valve
#

when i use message.guild.members.cache.filter(member => member.presence.status === 'online').size i get numbers, but they're wrong. I use this same code for all online, dnd, idle, and offline, and all are wrong. I use discord.js

rustic nova
#

these are the cached users

wise quartz
#

damn the difference between py n js

zenith knoll
#

(node:11) Warning: Accessing non-existent property 'Message' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)

crystal wigeon
#

You might be importing a func(f1) that imports another func from a diff file (f2) the func in f2 might be importing func1 from f1

#

This causes circular dependency warning

#

And the func won't work

#

I've experienced this

zenith knoll
#

wdym

crystal wigeon
#

For example

wheat valve
#

how i would filter out the online members that arent cached then?

wise quartz
#

@rustic nova if i use static method it tells me my function is not defined. if i use class method it tells me that it requires the perameters and i dont even know if instance method is somehow useful or i am using it or not. (py)

zenith knoll
#

note the error only pops int console in my host

crystal wigeon
#

Let's say I have f1.js that exports func1
And f2.js exp func2.

If func2 is using a func1 and you trying to use func 2 inside func1 that happens. This is what I faced tho you might be having a different issue

#

Yeah

#

If the message func exists

slender thistle
#

@wise quartz what's the error you're getting

zenith knoll
#

when i run it on my pc theres no error

crystal wigeon
#

That causes a circular loop

#

Og

#

Ohh

wise quartz
#

@slender thistle OMG i thought the other person is u but u changed name

#

lmfao

crystal wigeon
#

Can you show?

slender thistle
#

kekw

wise quartz
#

so i tried staticmethod

#

and it didnt work

slender thistle
#

Fun

wise quartz
#

i am sure instance method is the one i was using

#

and i am not sure if i class method will help

#

which one should i be using

#

lol

slender thistle
#

Class method seems to be what you need but I'm very uncertain what could go wrong

wise quartz
#

ah ye i didn't use it correctly

#

so in class method i need c;s

#

cls

#

and @clssmethod

#

alr

slender thistle
#

You don't need cls though

wise quartz
#

owh its optional or what>

#

?

#

cuz it the docs it said u need it for classmethod

#

and self for instance method

#

and nothing for static method

#

alr gon remove it

slender thistle
#

Sec

crystal wigeon
#

f1.js

module.exports.func1 = () => {
  // do something
  func2()
}```

f2.js
``` import { func1 } from f2
module.exports.func2 = () => {
  // do something 
  func1()
}```

you get that warning when something like this occurs
wise quartz
#

yup classmethod gives me ur function is not defined

crystal wigeon
#

either import func2 from a diff file or func1

wise quartz
#

are u trying to help me?

crystal wigeon
wise quartz
#

we talkin py m8

#

ya js

slender thistle
#

Meh, use staticmethod

wise quartz
#

makeup your mind please

#

static didnt work

crystal wigeon
#

ah

slender thistle
#

I forgot the damn difference between them in Python

crystal wigeon
#

lmao

#

my bad

slender thistle
#

¯\_(ツ)_/¯

slender thistle
#

Aye just dug up an article

wise quartz
slender thistle
#

Open it in browser

wise quartz
#

the img?

slender thistle
#

Yeah

wise quartz
#

alr

#

no difference

wise quartz
#

it says that my func aint defined

slender thistle
#

Show how you're calling and creating it

wise quartz
#

ye sec

#
@staticmethod
    def getCash(ctx):
        cashName = "Cash"
        cashIcon = ":dollar:"
        startCash = 0
        setup = db.child("guilds").child(ctx.guild.id).child("setup").child("cash").get()
        setupval = setup.val()
        if setupval is None:
            return False
        for key, value in setupval.items():
            if key == "cashName":
                cashName = value
            elif key == "cashIcon":
                cashIcon = value
            elif key == "startCash":
                startCash = value
            else:
                pass
        return True
#

ignore the indention

#

its correct

#
    @commands.command()
    async def test2(self, ctx):
        embed = discord.Embed(colour=discord.Colour.gold())
        if Setup.getCash():
            embed.add_field(name=f"{cashIcon} {cashName}", value=f"Starting amount: ``{startCash}``")
        embed.add_field(name=f"~~Cash~~", value=":x:")
embed.set_author(name=ctx.guild.name, icon_url=ctx.guild.icon_url)
        await ctx.send(embed=embed)
slender thistle
#

Pass ctx in getCash

wise quartz
#

why dont i just make ctx: typing.Optional[ctx] = ctx

#

or that wont work?

#
class Setup(commands.Cog):
    def __init__(self, client):
        self.client = client
#

my class btw

slender thistle
#

Aye nah won't work

wise quartz
#

alr ctx it is

#

ye worked buuuuuuuuuuuuuuut

#
Command raised an exception: AttributeError: 'bool' object has no attribute 'items'
#

now getting that

#

lol

weary torrent
#

Is this correct??

on_member_join 
async def on_member_join(member): system_channel channel = member.guild.system_channel 
 await channel.send(f"Welcome to {member.guild.name}, {member.mention}!")```
wise quartz
#

nope

#
async def on_member_join(member):
weary torrent
#

how can I fix it??

wise quartz
#

ur indention is dramatically emotionally hurting to look at

feral aspen
#

Is anyone here professional in HTML iframes?

wise quartz
weary torrent
#

kk

wise quartz
#

do the specific channel sending urself alr?

weary torrent
#

What??,

#

U oh ye

drowsy epoch
#

How good is

wise quartz
#

what?

weary torrent
#

How do I do thatt xdd

Any 1 have any tutorials

#

xdd

wise quartz
#

docs man

drowsy epoch
# wise quartz what?

Discord Bot Maker is a powerful bot development tool for the #1 text and voice chat service for gamers: Discord. With this tool, you and your teammates can take your social experience to the next level!ExplanationOne of the most prominent features provided by Discord is the official support for bot accounts. In a matter of 20 seconds, anyone can...

Price

$9.99

Recommendations

1435

▶ Play video
wise quartz
#

how dare u send that

weary torrent
#

TRASHH

drowsy epoch
#

How good is it

wise quartz
#

these shits ruin the meaning of discord bots

drowsy epoch
#

Ik js, but for small bots that I don’t want to spend hours on would it be good

wise quartz
#

trust me its useless

weary torrent
#

I only onstalled that kinda thing once to see watHi it was. AND I INSTANTLY DELETED IT

THATS SHITT

weary torrent
#

U BETTER GO YEETUS DELEETUS ON THAT RIGHT NOW!!

wise quartz
#

python (ultra beginner) i'd say

wise quartz
drowsy epoch
drowsy epoch
wise quartz
#

use the docs ig?

#

does js have docs?

drowsy epoch
#

Yes

wise quartz
#

then search there

drowsy epoch
#

Ok

wise quartz
#

@slender thistle

Command raised an exception: AttributeError: 'bool' object has no attribute 'items'
``` the function works but now i am getting that
drowsy epoch
#

Can U get bots online like this

wise quartz
#

ye host them locally

#

or purchase a vps or whatever its called

#

or just host them on one of those free hosting websites

weary torrent
#

does this work??

async def on_member_join(member):
	await ctx.send(f"Welcome to {member.guild.name}, {member.mention}")```
wise quartz
#

should ye

weary torrent
#

Bc its now xdd

#

Not**

wise quartz
#

what did u define ur client as?

weary torrent
#

Do I need to make another part of code that sends it to a sertain channel??

#

what

#

??

wheat valve
#

unicode were you responding to Dragon? I think you misread their question?

wise quartz
wheat valve
#

I believe they were asking how to get their bot to show it on mobile,

weary torrent
feral aspen
#

I got a question. I am willing to make an iframe on my top.gg bot, and in that iframe, Im willing to put my website on it. Any way I can make it full screen, and not a small thing?

feral aspen
#
<html>
<body>
<iframe src="https://attitudebot.xyz/"></iframe>
</body>
</html>
wise quartz
wheat valve
#

yeah i think he was asking how to get it online on "mobile," though im not positive

weary torrent
#

How do I make embed messgaes??

With my bot

Ive looked everywhere on yt internet fruends in discord servers I tried myself to figure it out but... no hope xdd.

Discord.py

Any 1 have any ways i can get embed code to make embed messages??

wise quartz
#

aha...

wise quartz
#

this will take u directly to the discord.py embed docs

wise quartz
#

look it up somewhere

south sinew
#

Saying nobody knows isn't helpful

wise quartz
#

telling me that isn't helpful either

south sinew
#

Smh

wise quartz
#

we tied then

south sinew
#

Anyways, you want your iframe to fit the viewport

#

There is a stack overflow thread that goes over it

south sinew
#

I would eloborate but kinda hard on mobile

wise quartz
#

complicatedly understandable

south sinew
sick fable
#
  self._context.run(self._callback, *self._args)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback```
#

How to enable Tracemalloc

feral aspen
#

Thanks!!!

south sinew
#

Np

sick fable
#

@slender thistle

#

🥺

#

Please

willow mirage
#

._.

#

why ping him

sick fable
#

K

#

Lol

wise quartz
#

¯_(ツ)_/¯

#

😆

weary torrent
#

Is this correct??

async def loop_function():
    activity = discord.Activity(name=f"over {len(client.guilds)} guilds\nand {len(client.users)} users!", type=discord.ActivityType.watching)
    await client.change_presence(activity=activity)
loop_function.start()```
wise quartz
#

dude relax

#

you went from an embed to an event to and embed to a tasks loop

weary torrent
#

Srry xdd

#

kk

wise quartz
#

are you just copy & pasting random code that looks cool

south sinew
#

The man needs help, cut him a break unicode

wise quartz
#

or your doing something specific?

#

i just wanna know if he has something specific he wants to make or just playing around with code

#

not trying to judge or smthing

weary torrent
#

I syumbled across a website. with... 💩 tons of outdated code and I wanna see if any is correct

#

/ still works

wise quartz
#

aha

weary torrent
#

Also Im editing code aswell

south sinew
#

Yeah it really depends on what's changed library wise

wise quartz
#

but you'll need a loop if u want to make the bot change status

#

but its api abuse so dont

#

unless its like every 5m

#

or smthing

weary torrent
#

ohh

wise quartz
#

lol

weary torrent
#

I know y its not working. Ummmm

How donI make my bots ststus to Watching

wise quartz
#

watching what exactly?

#

owh...

#

thats nasty

#

grow up man

weary torrent
#

Xdd

wise quartz
#

ah nvm he's too young

pale vessel
#

What library are you using?

wise quartz
#

speak mah child

weary torrent
#

Current:

async def on_ready():
	print(f"{client.user} has logged in.")

	await client.change_presence(status=discord.Status.online, activity=discord.Game('》Prefix -《'))```

What I Want It To be:
Watching Prefix-
#

Ummm Ill send a sc

#

heree

south sinew
#

Wtf

wise quartz
#

activity=discord.Watching ?

#

i forgot it actually

#

but try that

#

OMG he remind me of my start

#

i started with PyDroid 3 too

#

and watching Lucas too

#

that was a year n half ago

#

damn those old memories

south sinew
#

Me out here 2 years ago making a shitty discord js bot and committing my bot token to github

hollow sedge
weary torrent
#

Is dis it??

wise quartz
#

an outdated tasks loop function

hollow sedge
#

What is that software

south sinew
#

Hype tf are you doing mate

wise quartz
#

go to the coding areas

#

area*

weary torrent
#

Ok

#

Now what

wise quartz
#

change activity=discord.Game to activity=discord.Watching

weary torrent
#

srrybi was brain dead xdd

wise quartz
#

not sure if that gonna work

weary torrent
#

Thats the 1st thing i tried

#

Doesntt work

hollow sedge
#

@weary torrent what is that tho

weary torrent
#

SaisnI need a module

wise quartz
#

lemme check the docs for watching precence

wise quartz
#

its a Python IDE

#

for mobile

south sinew
#

Oh god

wise quartz
#

that page he had was to pip install libraries

#

man i created a bot and it got like 21 guilds

#

my first ever bot

#

all on mobile

#

damn

weary torrent
#

Cool

wise quartz
#

suddenly closed it

#

cuz its code was freakin messy

hollow sedge
#

discord.Activity(type=discord.ActivityType.watching, name=message) @wise quartz

wise quartz
#

and the bot was kinda useless

#

who needs a multi-purpose bot anyways

#

lol

hollow sedge
#

Also you probably shouldn't even be coding on mobile

tribal siren
#
    if(!giveawayDuration || isNaN(ms(giveawayDuration))){
        return message.channel.send(':x: You have to specify a valid duration!');
    }```
hollow sedge
#

unless you must

tribal siren
#

it doesn't work

wise quartz
#

everything can be done if ur passionate about it

hollow sedge
#

That's why I added "unless you must"

wise quartz
#

jeez i talk gold

tribal siren
pale vessel
#

Voltrex Master: i've been coding my bot with mobile lolllll

tribal siren
#

sometimes a coded on mobile too

hollow sedge
#

Guys this is literally why I added "unless you must"

wise quartz
#

jk

hollow sedge
#

;(

wise quartz
#

i was supposed to work on my new project

#

and i spent 3 hours helping people here

weary torrent
#

await client.change_presence(status=discord.Status.online, activity=discord.Game('》Prefix -《'))

how can I make dat watching??

wise quartz
#
activity=discord.ActivityType.watching
weary torrent
#

await client.change_presence(status=discord.Status.online, activity=discord.ActivityType.watching'》Prefix -《'))

pale vessel
#

why does dpy do that

#

can you just do status="online" or something

wise quartz
#

lemme see how u add status

#

@weary torrent try that

#

if it didn't work then remove the string and try again

#

try different stuff

#

until it works

#

that way you'll learn better

weary torrent
#

I triedd xdd

wise quartz
#

did it work?

weary torrent
#

nooe

slender thistle
#

Jesus fuck

weary torrent
#

loll

#

Do u know?? @slender thistle

pale vessel
#

Isn't that kwargs

#

why is there a string at the end

#

python what

weary torrent
#

oh fuck nvm

slender thistle
#

Good lord

#

You people ever read docs

pale vessel
#

never mind that's *args

weary torrent
#

I have to put amontbof guilds and the watching status to swap em xdd

#

fuckk itt

#

xdd

slender thistle
#

Let's see

earnest phoenix
#

How to devlop

#

Bot

weary torrent
#

Any 1 know how to make it say how many guilds its in??

earnest phoenix
#

aeon help

#

?

pale vessel
#

len(bot.guilds) or something

slender thistle
#

To explain flazepe's advice, a client has .guilds property, which is a list of Guild objects (servers your bot is in)

pale vessel
#

oh that was right lmao

#

I'm so proud of myself

slender thistle
#

If you were smart enough to get into advanced Python before discord.py, you would know that a list has __len__() function that returns length of the list

wise quartz
#

len is a short for length