#development

1 messages · Page 1352 of 1

slender thistle
#

I'd say look into an async mongo wrapper once you're actually facing issues with blocking

indigo flax
#

bot*

faint prism
#

Well now you've hit one of the main issues

indigo flax
#

ok

#

@pure lion

#

i can get the connection string

hollow sedge
#

I'd say look into an async mongo wrapper once you're actually facing issues with blocking
@slender thistle oh ok thanks

fluid basin
#

also just saying using mongoose isnt very portable

pure lion
#

austin

indigo flax
#

?

pure lion
#

install the mongoose package

fluid basin
#

if you move to another lang you will need to learn the syntax either ways

#

lol

indigo flax
#

wait can we do this in dms or no

faint prism
#

idk how you got to +1GB without a tokenization error

indigo flax
#

so the notes are saved

pure lion
#

fine

faint prism
#

I suppose caching

fluid basin
#

afaik mongodb free tier is 500mb no?

hollow sedge
#

it is

#

atlas is 500mb

fluid basin
#

wondering how 1 gb gonna fit even

faint prism
#

Use sqlite db then

nocturne sparrow
#

how i can show my bot's prefix in python

hollow sedge
#

you could just download the db

faint prism
#

But I feel you probably want nonrelational

#

how i can show my bot's prefix in python
@nocturne sparrow just append the variable to a string

nocturne sparrow
#
from discord.ext import commands
import discord
class bot_cat(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.Cog.listener()
    async def on_message(self, message):
     

        if "prefix" in message.clean_content.lower():
                await message.channel.send(f"{bot.command_prefix}")
def setup(bot):
    bot.add_cog(bot_cat(bot))

#

i am trying this

#

but giving error

faint prism
#

f"{bot.command_prefix}" instead of just bot.command_prefix?

slender thistle
#

What the fuck

fluid basin
#

chill shiv

faint prism
#

lmao

slender thistle
#

Calm is me

#

Okay

#

Why are you using a separate on_message listener just for the prefix

jovial nexus
#

How can i restart all the shards but not the bot?

faint prism
#

I couldn't say that with a straight face, shiv

slender thistle
#

Neither could I. My face is the definition of disappointment in life and I definitely shouldn't be here in the first place

faint prism
#

ok

pale vessel
#

ok

umbral zealot
#

cool story bro

pale vessel
#

is this the auger we know and love?

earnest phoenix
#

hehehe, i sent token

faint prism
#

yes

earnest phoenix
#

i deleted

sudden geyser
#

auger evolved

earnest phoenix
#

TypeError: Cannot set property 'commands' of undefined
at /home/runner/Kano-BOT/index.js:12:16
at Script.runInContext (vm.js:130:18)
at Object.<anonymous> (/run_dir/interp.js:209:20)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47Hint: hit control+c anytime to enter REPL.

#

anyone here

faint prism
#

i deleted
@earnest phoenix It's invalid anyways

pale vessel
#

still rocking that 💻

earnest phoenix
#

know why

#

is error

faint prism
#

You know it

umbral zealot
#

yeah you're trying to get the property commands of something that's undefined.

jovial nexus
#

How can i restart all the shards but not the bot??

pale vessel
#

wot

earnest phoenix
#

anyone have

#

a index.js

#

to send me

#

i dont find a good index.js

faint prism
#

you code the javascript source

fluid basin
#

uh we dont 🥄 here

#

you can go github and try

faint prism
#

anyone have that "fundamental misunderstanding" copypasta for bots link

fluid basin
#

though not a good idea

jovial nexus
#

^^

pure zealot
#

One message removed from a suspended account.

earnest phoenix
#

/home/runner/Kano-BOT/index.js:56
if (message.author.bot) return;
^^^^^^

SyntaxError: Illegal return statement
Hint: hit control+c anytime to enter REPL.

#

now it's like this

#

i hate when give me error

faint prism
#

Illegal return statement
Uhoh, calling the cops

earnest phoenix
#

anyone here knows any tutorial at youtube of python

#

python bot

steel violet
#

I'm trying to get all the members from my guild in my logs and this is what happens when I run the command

indigo flax
#

hey

#

who knows mongoose

#
mongoose.connect("mongodb+srv://The:Bot@tg.mx0br.mongodb.net/TG?retryWrites=true&w=majority
")
mongoose.connection.on("connected", () => {console.log("Connected to mongoose.")}
mongoose.connection.on("error", err => {console.error(err)}```
#

that shows

#
/home/container/server.js:3
mongoose.connect("mongodb+srv://The:Generator@tg.mx0br.mongodb.net/TG?retryWrites=true&w=majority
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

SyntaxError: Invalid or unexpected token
    at wrapSafe (internal/modules/cjs/loader.js:931:16)
    at Module._compile (internal/modules/cjs/loader.js:979:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
    at Module.load (internal/modules/cjs/loader.js:879:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47
steel violet
#

You are trying to connect to you cluster?

weary socket
#

Why is my Bot shown DND?

steel violet
#
``` @indigo flax
pale vessel
#

hmm

indigo flax
#

@pure lion ^ is that the error

earnest phoenix
#

SyntaxError: /home/runner/Kano-BOT/config.json: Unexpected token / in JSON at position 19
Hint: hit control+c anytime to enter REPL.

#

what's the error now

#

😦

weary socket
#

Why is my Bot shown DND?
@weary socket .

faint prism
#

change your presence or status rather

umbral zealot
#

@steel violet what happens when you run the command?

weary socket
#

change your presence or status rather
@faint prism Ah my Bot is all the time Disturbe.....So only put it online?

faint prism
#

Not sure what you just said, but you change it typically via the setStatus iirc

steel violet
fluid basin
#

184 server

indigo flax
#

i found the issue @steel violet

fluid basin
#

you need GUILD_MEMBERS_INTENT

indigo flax
#

its cause ") was on a new line

#

so it was like

#

we

#

gfw

#

esg

#

rew

#

g

steel violet
#

I have more than 2 users in my guild so I don't understand

indigo flax
#

oops

#

it was like

#

codereigierhgeiurhgeiurhgiurhgieruhgierwuhgiwer
second part of the code

fluid basin
#

@steel violet you need guild members intent enabled on bot settings page on discord

faint prism
#

Are you stroking out

indigo flax
#
mongoose.connection.on("connected", () => {console.log("Connected to mongoose.")}
                                                                                ^

SyntaxError: missing ) after argument list
    at wrapSafe (internal/modules/cjs/loader.js:931:16)
    at Module._compile (internal/modules/cjs/loader.js:979:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
    at Module.load (internal/modules/cjs/loader.js:879:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47```
steel violet
#

@fluid basin

fluid basin
#

then use the intent

steel violet
#

It is already enabled

errant perch
#

mongoose.connection.on("connected", () => {console.log("Connected to mongoose.")})

umbral zealot
#

Discord started enforcing the GUILD_MEMBER intent requirement TODAY
If your bot has stopped being able to access cached members, you don't have access to the privileged Guild Member Intent. You need to fetch the member manually.

GUILD_MEMBERS is a privileged intent, it is not sent to bots that have not been allowed to use it. You need to request this privileged intent from Discord through https://dis.gd/contact (general request), or figure out how to fetch members only when necessary.

errant perch
#

b

indigo flax
#

ok thx

fluid basin
#

when connecting to gateway

umbral zealot
#

@steel violet perhaps your bot isn't actually requesting it?

errant perch
#

bot.users.cache.get("331222209299349504").send("embed"); bruh is that why this isnt working

faint prism
#

Bot says: "embed"

errant perch
#

shut up

fluid basin
#

error please

faint prism
#

?

#

That's what it would say

#

You're passing in a string

errant perch
fluid basin
#

the user is not cached then

faint prism
#

that user isn't in the cache

indigo flax
#

ive never used mongoose before, someone is teaching me

errant perch
#

theb

indigo flax
#

when i start the bot

#

it says

#
(node:15) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
Connected to mongoose.```
#

idk if thats an error

#

or a success

earnest phoenix
#

pass the option that is says to

fluid basin
#

Connected to mongoose.
well idk, it says its connected

errant perch
#

but why wouldnt the user be cached Thonk

#

just get cached bruh

dense veldt
#

Hello

fluid basin
#

you can fetch it

#

bot.users.fetch

errant perch
#

then the id

#

i suppose

fluid basin
#

ye

#

check the docs for more info

errant perch
#

pk

#

ok

umbral zealot
#

Discord started enforcing the GUILD_MEMBER intent requirement TODAY
If your bot has stopped being able to access cached members, you don't have access to the privileged Guild Member Intent. GUILD_MEMBERS is a privileged intent, it is not sent to bots that have not been allowed to use it.

If your bot is not verified you can go turn on the GUILD_MEMBERS intent in the Bot section of the dev portal, or you can fetch the users manually.

If your bot verified, need to request this privileged intent from Discord through https://dis.gd/contact (general request), or figure out how to fetch members only when necessary.

errant perch
#

you you are verified

indigo flax
#

my bot only says

#

that

#

theres 37 users total

#

but

umbral zealot
#

See what I literally just posted, Austin.

indigo flax
#

its in a 10k member server

#

(node:15) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:15) UnhandledPromiseRejectionWarning: Error [GUILD_MEMBERS_TIMEOUT]: Members didn't arrive in time. at /home/container/node_modules/discord.js/src/managers/GuildMemberManager.js:314:16 at Timeout._onTimeout (/home/container/node_modules/discord.js/src/client/BaseClient.js:83:7) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)

errant perch
#

its not verified tho

fluid basin
#

ah ok you need the guild members intent

#

then no choice

#

you gotta wait till its verified

steel violet
#

It don't works anymore since yesterday for me

indigo flax
#

ah ok

umbral zealot
#

So turn on the GUILD_MEMBERS intent, @steel violet

fluid basin
#

yes since today they applied the update

umbral zealot
#

it was turned off for everyone this morning by default.

uncut river
#

someone help me figure out why my ready.js event isn't working. i even commented everything out and just put console.log and it won't appear, but the rest of my bot still works

umbral zealot
#

definitely a lib problem, Fyrlex.

uncut river
#

discord.js

steel violet
#

So turn on the GUILD_MEMBERS intent, @steel violet
@umbral zealot I'll try

umbral zealot
#

yeah so ask on the discord.js server

uncut river
#

i did

umbral zealot
#

they gotta fix the lib so it works without the guild_members intent on.

indigo flax
#

thanks

steel violet
#

thanks Evie

indigo flax
#

now it works

umbral zealot
#

👍

#

Note that it's probably a good idea to not rely on GUILD_MEMBERS. If your bot ever gets verified and you ask for it just for stats command, they'll deny it

indigo flax
#

its not only for stats command

umbral zealot
#

They're not going to keep sending you half a million member's data just for a stats command.

fluid basin
#

@uncut river d.js version?

uncut river
#

12

#

latest

fluid basin
#

hrm interesting then

uncut river
#

i'll regenerate token just in case

steel violet
umbral zealot
#

yes

#

then general request

#

But they will not give you access to privileged intents just for a stats command

#

so you better be damned sure you have a better use case than "I wanna know how many members I got"

fluid basin
#

you need some legit reason for guild members intent

#

same goes for presences

#

if you're bot is already discord verified and has the checkmark, just open a support ticket with discord

steel violet
#

It's not just a stat command, it's an economy part for all users

fluid basin
#

it will be up to them to approve or deny your request

umbral zealot
#

What specific reason do you have to get all guild members for economy?

#

if it's just a leaderboard, you'll also get denied.

solemn latch
#

i dont see why you need all members for economy

dense patio
#

discord.js v12

Error [SHARDING_READY_TIMEOUT]: Shard 0's Client took too long to become ready.

happening on multiple bots on this vps

#

changed nothing in the code, randomly started this morning

umbral zealot
#

the ready event is fucked on d.js at the moment.

dense patio
#

oh i see

#

how though

fluid basin
#

ask the devs

solemn latch
#

I forget what the fix is

dense patio
#

how would the ready event be broken? wouldn't i need to update the package to apply any changes they make

steel violet
#

i dont see why you need all members for economy
@solemn latch
For an automatic addition of money

solemn latch
#

you should be able to do that just with your database no?

dense patio
#

thanks ❤️

steel violet
#
            let auto = await money.getAutoadd(id);
            if (auto == 0) return;
            else {
                const list = client.guilds.cache.get(id);
                list.members.cache.forEach(async member => {
                    console.log(member.id)
                    const now = new Date();
                    let datenow = (`${now.getUTCMonth()${now.getUTCDay()} ${now.getUTCHours()} ${now.getUTCMinutes()}`);
                    let time = await money.getTime(member);
                    let datefuture = await money.getDate(member);```
umbral zealot
#

discord.js waits for guild_members to arrive and they never arrive if you do'nt have the privileged GUILD_MEMBERS intent on.

solemn latch
#

thats a lot slower than doing it through a single database call.

dense patio
#

oh hold on, the client does start after a while, but when it starts it logs an incorrect user count and non-message events aren't working (they were working before)

kind brook
#

Hello

steel violet
#

thats a lot slower than doing it through a single database call.
@solemn latch
An other idea maybe?

umbral zealot
#

@dense patio
Discord started enforcing the GUILD_MEMBER intent requirement TODAY
If your bot has stopped being able to access cached members, you don't have access to the privileged Guild Member Intent. GUILD_MEMBERS is a privileged intent, it is not sent to bots that have not been allowed to use it.

If your bot is not verified you can go turn on the GUILD_MEMBERS intent in the Bot section of the dev portal, or you can fetch the users manually.

If your bot verified, need to request this privileged intent from Discord through https://dis.gd/contact (general request), or figure out how to fetch members only when necessary.

dense patio
#

lovely.

#

this is such a pain for smaller bots

kind brook
#

Is there any bot which will automate the roles

umbral zealot
#

You had 2 months to prepare, so...

dense patio
#

at least i won't have to worry about my main bot breaking

umbral zealot
#

¯_(ツ)_/¯

dense patio
#

oh true

#

i haven't been paying attention to these things

#

didn't think it would affect me like this

#

excellent, now it works

#

thanks a lot

umbral zealot
#

👍

dense patio
#

this is for my main bot, which is verified

sudden geyser
#

You probably weren't whitelisted to use those intents.

#

You'd need to contact Discord to request them if you need them.

dense patio
umbral zealot
#

yep

#

Either figure out how to do without the intents, or request them.

sudden geyser
#

Though you may have a hard time actually getting intents

#

My friend needed them for a lot of their commands and still didn't get them sadly

umbral zealot
#

the intents are given for features that aren't "stats/profiles/leaderboards" or very simple things.

dense patio
#

seriously.

#

this is terrible

#

why would they do this

feral kiln
#

Hi! What are the rate limits on things such as reactions, roles and messages? I want to see if I'm exceeding it with something or if some commands should require a cooldown.

sudden geyser
#

There are ways to work without intents which doesn't feel like a hack workaround

fluid basin
#

check the channel pins, there are some information there @feral kiln

#

also ratelimits are the maximum, and sometimes it doesnt really need to be at that speed

#

realistically

#

you still can fetch users individually without intents

dense patio
#

There are ways to work without intents which doesn't feel like a hack workaround
@sudden geyser do you know how?

#

hm

sudden geyser
#

You use the API to get your data. Intents are for gateway.

dense patio
#

well my main issue is that pretty much all of my commands can be used by typing a user's username to get their id, etc.

fluid basin
#

yup

#

then add a fetch

#

i mean

#

use fetch

#

instead of .get(id)

dense patio
#

oh excellent

#

i already fetch them

#

so it should still work?

fluid basin
#

then thats fine

dense patio
#

alright awesome

#

thanks

fluid basin
#

you can always test it out

merry beacon
#

would keyv be a good thing to use for bot economy?

umbral zealot
#

It would be one of many possible storage systems, sure.

#

should be sufficient.

merry beacon
#

and would there be anyway to retrieve all keys from keyv

#

or would I have to use some other dependency

#

cus i used keyv for economy

#

and im trying to make a leaderboard

umbral zealot
#

it doesn't have a way to list the keys?

merry beacon
#

it can't get all keys

#

it can get one key, but not all

umbral zealot
#

well then you're fucked and keyv isn't going to work for you.

willow mirage
#

HELP ME

merry beacon
#

lol

willow mirage
#

my fucking CSS is not reloading

merry beacon
#

ok

#

clear cache

willow mirage
#

HOW

fluid basin
#

use a proper database instead of keyv?

merry beacon
#

what would u recommend lol

errant perch
#

my bot is at 72 servers and has both intent options checked

#

i didnt ask or anything

umbral zealot
#

sqlite, enmap, quick.db would be a step up.

errant perch
#

they were just there

fluid basin
#

mongodb is great if you like working with json

#

and for structured databases then look at evie's message

merry beacon
#

but sqlite/enmap/quickdb are only from memory right?

fluid basin
#

no?

#

they are stored in files

merry beacon
#

ok

umbral zealot
#

yeah they all store in files.

merry beacon
#

um i wanna use like an actual database, like i legit have a postgres db that i wanna use

#

soo..

umbral zealot
#

sure, pgsql is fine.

fluid basin
#

then you can use a driver

#

yeah

merry beacon
#

ok

#

im kinda noob at this ngl

#

but ur sayin i could use a driver for enmap

#

and use that to store in PG?

umbral zealot
#

no, enmap uses sqlite in the background.

merry beacon
#

ok

#

maybe ill try sequqlize

#

*sequelize

earnest phoenix
#

hey

#

anyone here

#

have handler command

#

to put after const?

sudden geyser
#

You'll have to be more specific.

earnest phoenix
#

if yes, send me in private, i need

errant perch
earnest phoenix
#

Lite

#

handler

#

is the command

#

to put after const

sudden geyser
#

I don't understand what you're asking for, so refer to the guide woogie posted.

earnest phoenix
#

to commands be ok

#

oh ok

#

thanks ❤️

solemn jolt
#

Why i get this eror in log?

errant perch
#

your bot is missing permissions

#

what command are you running when you get that error

solemn jolt
#

this command is run costomCommand

umbral zealot
#

So, that command has something it needs permission for, that it doesn't have

#

¯_(ツ)_/¯

errant perch
#

like

#

whats the code in the command

#

or you can just say what it does

solemn jolt
#

Ok thank you bro 👍

errant perch
#

uh

#

your welcome

umbral zealot
#

they probably figured it out 😄 ¯_(ツ)_/¯

errant perch
#

ok lol

lone jolt
#

.

gentle lynx
#

what does this error mena

#

mean

#

this is the code

#

i'm trying to make my own command handler

pale vessel
#

forgot a . so it's trying to find the module from the process root

gentle lynx
#

thanks!

earnest phoenix
#

u ply gensi=hin impact

#

why she take ur sisiter

umbral zealot
sudden geyser
#

forgot a . so it's trying to find the module from the process root
@pale vessel does it really look in the process root, or the root of the file system

pale vessel
#

for me it checks for the process root

#

it's weird, fs does it differently for example

#

sometimes i need to use __dirname for fs

subtle kiln
#

Hello! I was wondering: Does message IDs are unique across every guilds or there can be 2 messages that have the same ID if they are posted on different guilds?

boreal iron
#

Nope they’re unique as well as client and guild IDs

subtle kiln
#

thanks

indigo flax
#

is anyone good at mongoose

pale vessel
#

perhaps

#

why not just ask the question

earnest phoenix
#

Promise {
<rejected> Error [TOKEN_INVALID]: An invalid token was provided.
at Client.login (/home/runner/Kitana-BOT/node_modules/discord.js/src/client/Client.js:205:52)
at /home/runner/Kitana-BOT/index.js:76:8
at Script.runInContext (vm.js:130:18)
at Object.<anonymous> (/run_dir/interp.js:209:20)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
[Symbol(code)]: 'TOKEN_INVALID'
/home/runner/Kitana-BOT/index.js:40
client.login(process.env.TOKEN); //Ligando o Bot caso ele consiga acessar o token

#

why it's happening this?

pale vessel
#

your token is invalid

solemn latch
#

probably an invalid token

pale vessel
#

check your .env file

umbral zealot
#

clearly the token is invalid

pale vessel
#

as the error says

umbral zealot
#

in your .env file it must be exactly TOKEN=yourtokenhereiwthnospaceorquotes

sick fable
#

I want my bot to print out my custom status like I am listening to Spotify so it should show "Listening to Spotify". I tried my code but it showed None as an outcome

#

I am sending the code

pale vessel
#

check your intents too

sick fable
#
async def userinfo(ctx, member: discord.Member = None):
	member = ctx.author if not member else member
	roles = [role for role in member.roles]
	
	embed = discord.Embed(title = f"{member.name}'s Userinfo!" , colour = member.colour , timestamp = ctx.message.created_at)
	
	embed.set_thumbnail(url = member.avatar_url)
	embed.set_footer(text = f"Requested by {ctx.author.name}" , icon_url = ctx.author.avatar_url)
	embed.add_field(name = f"**Name**" , value = f"{member.name}" , inline = True)
	embed.add_field(name = "Discriminator" , value = f"{member.discriminator}")
	embed.add_field(name = f"**Nickname**" , value = f" {member.display_name}")
	embed.add_field(name = "Id" , value = f"{member.id}")
	embed.add_field(name = "Activity" , value = f"{member.activity}")
	embed.add_field(name = "**Account Created On**" , value = member.created_at.strftime("%a, %d %B %Y , %I %M %p UTC"))
	embed.add_field(name = '**Joined This Server On**' , value = member.joined_at.strftime("%a, %d %B %Y , %I %M %p UTC"))
	embed.add_field(name = "**Roles**" , value = f" ".join([role.mention for role in roles]))
	embed.add_field(name = "Bot?" , value = member.bot)
	await ctx.send(embed=embed)```
umbral zealot
#

you need the presence intents for this to work, as a starter.

sick fable
#

?!

umbral zealot
#

enable the Server Member Intents checkmark in your bot's application page.

pale vessel
solemn latch
#

all the sources

earnest phoenix
#

Promise { <pending> }
Hint: hit control+c anytime to enter REPL.
[Error: ENOENT: no such file or directory, scandir './events/'] {
errno: -2,
code: 'ENOENT',
syscall: 'scandir',
path: './events/'
}
/home/runner/Kitana-BOT/index.js:37
files.forEach(file => {
^

TypeError: Cannot read property 'forEach' of undefined
at /home/runner/Kitana-BOT/index.js:37:15
at FSReqCallback.oncomplete (fs.js:156:23)

#

the error is this now

#

the token i changed

umbral zealot
#

hey remember when we told you that you should learn javascript. 😕

earnest phoenix
#

yes, i learn something

#

but is so difficulty

umbral zealot
#

clearly not enough, this is a basic error

earnest phoenix
#

i lost my commands

#

i lost my handler command

#

my index command

umbral zealot
#

it takes months to learn a language. not "less than a day and I'm back at asking everyone to fix my stufF"

earnest phoenix
#

i am making everything again

#

i made a bot with more 20 commands of economy, and everything

#

but i lost him, i think i deleted 😦

umbral zealot
#

But you can't troubleshoot a simple "undefined" error?

solemn latch
#

you should look into git

umbral zealot
#

it means you didn't learn anything. You need to get through a course.

solemn latch
#

or version control

old cliff
#

Can anyone solve my issue ?

umbral zealot
#

you need to return something from the async functions

#

and/or await the function

#

right now it's not awaiting anything

old cliff
#

please can you explain ?

#

I can't comprehend it

umbral zealot
#
async function checkField(message,prev){
    let filter = m => m.author.id === message.author.id;
    return message.channel.send("Do you want to add another field ? (yes/no)").then(() => {
        message.channel.awaitMessages(filter, {
            max: 1,
            time: 30000,
            errors: ['time']
        })
        .then(async message => {
            message = message.first();
            if(message.content == "yes"){
                var field = await getField(message).then(async field => {
                    prev.push(field);
                    var newField = await checkField(message,prev).then(async field =>{
                        if(newField.length>0){
                            prev.push(newField);
                        }
                        return prev;
                    });
                });
            } else {
                return prev;
            }
        })
        .catch(collected => {
            console.log(collected);
            return message.channel.send('Failed to create embed');
        });
    });
}
#

you were missing the return keyword

#

inboth

old cliff
#

But it says it returns a message ?

#

ok lol

umbral zealot
#

no it didn't return the message before

#

you weren't returning the first one

#

so it was just... executing it withjout waiting for it

old cliff
#

Yes I see

#

but how to carry that value from the then function to outside ?

umbral zealot
#

you get the return value from await checkField and you should have it

hasty mulch
#

Anyone know why if ChannelCategory.id == ID1 or ID2: is saying that ChannelCategory is not defined?

#

In Python

old cliff
#

Do I also need to get it from then functions ?

pale vessel
#

well, did you define ChannelCategory?

hasty mulch
#

Of course

#

It’s ripped right from the docs

pale vessel
#

where did you define it

#

-in your code

hasty mulch
#

@pale vessel Docs have it as discord.ChannelCategory and I already have discord imported

pale vessel
#

what are you trying to do

hasty mulch
#

Limit a command to certain categories

pale vessel
#

can you show the code

hasty mulch
#

Yeah, give me two minutes?

#
@bot.command(name='seal')
@commands.guild_only()
async def _seal(ctx):
    if CategoryChannel.id == 740625967143452673 or 740723809069564056 or 740622346800463974 or 741754307216408656 or 741750821871550562:
        await ctx.send(':x: | This command can only be used in rp!')
    if CategoryChannel.id == 741756076126634076:
        await ctx.send('(Wrong command! `r!rp-set-seal` or `r!rp-set-unseal` is the correct ones to use)', delete_after=7)
    if CategoryChannel.id == 741756975762767962 or 741757122919792722 or 759865025774616636 or 743584376490557471 or 741757326045872158 or 741757481390178315 or 741757599233605712 or 759213005183123488:
        await ctx.send('(Ships cannot be sealed by the bot. Use [#741756142916468868](/guild/264445053596991498/channel/741756142916468868/), [#747578010278035536](/guild/264445053596991498/channel/747578010278035536/), [#741756219064189029](/guild/264445053596991498/channel/741756219064189029/), <745682027667390505#>, or [#741756303814426768](/guild/264445053596991498/channel/741756303814426768/).)', delete_after=7)
    if CategoryChannel.id == 741756416754319450 or 741756718471446579:
        await ctx.send('(Wrong command! `r!areaseal`)', delete_after=7)
    else:
        print('A room has been requested to be sealed...')
        channel = ctx.bot.get_channel(742179037643800596)
        await ctx.message.delete()
        await ctx.send('*the room has been sealed*')
        await ctx.channel.edit(topic="ROOM IS SEALED")
        embed=discord.Embed(
            type='rich',
            colour=discord.Color(0x339BFF),
            description=f'''
**ROOM SEALED:**
#{ctx.channel}

**ROOM SEALED BY:**
{ctx.author.mention}
'''
            )
        embed.set_footer(text=f'ID: {ctx.author.id}')
        embed.timestamp=datetime.datetime.utcnow()
        embed.set_author(name=ctx.guild.name, icon_url=str(ctx.guild.icon_url))
        await channel.send(embed=embed)
        print('Success!')
    pass
#

@pale vessel

pale vessel
#

well, you didn't define CategoryChannel

#

what is it supposed to be

hasty mulch
#

Wdym by what’s it supposed to be?

pale vessel
#

what do you think CategoryChannel is?

hasty mulch
#

The Category’s ID

pale vessel
#

the channel's category?

errant perch
#

was ist next.js?

midnight brook
#

How do you get the URL of a rich presence asset?

hasty mulch
#

@pale vessel discord.TextChannel?

pale vessel
#

those are classes

hasty mulch
#

Still saying not defined

midnight brook
#

How do you get the URL of a rich presence asset?
I have the application ID and the asset ID

pale vessel
#

you're supposed to get those properties/channels via objects

#

you don't create them using the constructor

#

if you want the message's channel, it's ctx.channel for example (iirc), not discord.TextChannel

#

ctx.channel itself is a discord.TextChannel

hasty mulch
#

So ctx.category would be the category

pale vessel
#

not quite

#

you need to get the message's channel

gentle lynx
#

how can i get index.js

pale vessel
#

textchannels can have the category_id property

earnest phoenix
#

how to get the first few options in a js map?

pale vessel
#

you would the channel using that id

hasty mulch
#

Ok, so channel.category_id

pale vessel
#

yes

hasty mulch
#

Alright

pale vessel
#

you can use guild.get_channel(id) to get the category channel as an object

sudden geyser
#

@gentle lynx there shouldn't be three dots.

pale vessel
#

just make sure channel.category_id exists

hasty mulch
#

I’ll try it when I get back to the box

gentle lynx
#

yeah what should I do

sudden geyser
#

../ will point to the Commands directory.
../../ should point to the process root directory.

pale vessel
#

that's all i can do to help honestly, i only used d.py once and it was just a bunch of elifs lmao

sudden geyser
#

So you're probably looking for ../../index.js

gentle lynx
#

thanks

earnest phoenix
#

how do you get the first few options in a node.js map

sudden geyser
#

use .slice

#

oh a map

pale vessel
#

map?

sudden geyser
#

confusing. What is a map

pale vessel
#

i guess get their values and slice

#

[...map.values()].slice(0, 3) or something

earnest phoenix
#

It's because slice doesn't work for maps

pale vessel
#

yeah

uncut river
#

could a possible reason for my bot takign extra time to load is because it's trying to fetch members even though it doesn't have the intent?

pale vessel
#

yes

uncut river
#

i have debug logs if anyone could help with that

pale vessel
#

that's totally the reason lmao

uncut river
#

good to know, thank you!

earnest phoenix
#

when i use .slice

uncut river
#

how can i go about getting proper user.cache count? i have a command that displays it and some private voice channels so i can quickly see

tardy hornet
#

how to get the first member that got mention avatarURL

uncut river
#

i tried on ready.js to fetch all inside the cache

tardy hornet
#

${message.mentions.first().avatarURL}

#

like that?

solemn latch
#

client.users.cache.size
will display the users in cache

earnest phoenix
#

@uncut river You can enable fetchAllMembers to true if you are using discord.js to get all memebers to cache

pale vessel
#

they don't have the guild members intent.

uncut river
#

not if i don't have the intent enabled

sudden geyser
#

@earnest phoenix client.users is a collection and using .filter returns a new one.

uncut river
#

i can't use that anymore

#

i just applied, i didn't realize i didn't need it

sudden geyser
#

You could use the .first(n) function to get the first N elements in the collection.

pale vessel
#

.filter().filter() 🤔

uncut river
#

could having

bot.users.cache.keyArray().forEach(async (u) => {
      await bot.users.fetch(u)
    });```
in ready.js work?
earnest phoenix
uncut river
#

or some different form

earnest phoenix
#

When i use it without .slice
yes with the 2 .filter

pale vessel
#

you're fetching already existing users

#

also, don't use async inside forEach

uncut river
#

will do, so there's no way to manually fetch all users without the intent anymore?

earnest phoenix
pale vessel
#

there is, only by IDs

#

you can't get all members at the same time anymore

uncut river
#

ah

#

sadge

pale vessel
#

but that's the thing, where are you going to get the IDs in the first place

uncut river
#

a lot of developers did not realize they needed this

pale vessel
#

that is true

#

they just see the word badge and applied as quick as they can lmao

#

not saying all of them but some

tardy hornet
#

please someone answer me!!!

how to get the first member that got mention avatarURL

uncut river
#

is there a way to get around the loading either?

pale vessel
#

what loading?

tardy hornet
#

aah

uncut river
#

i didn't do it for the badge, i verified so i wouldn't get limited

pale vessel
#

yeah, that's nice

uncut river
#

remember i said my start time is incredibly long

pale vessel
#

yes, you have to remove fetchAllMembers, did you do that?

uncut river
#

ah no i did not remove

pale vessel
#

you have to

prisma oriole
#

<Message>.mentions.members.first().user.avatarURL iirc @tardy hornet

ionic dawn
#

I updated my bot once and started slowing down everything, the reason was a wrong interval

pale vessel
#

otherwise it'll try to fetch all members

ionic dawn
pale vessel
#

and boom, timeout for each guild

tardy hornet
#

<Message>.mentions.members.first().user.avatarURL iirc @tardy hornet
@prisma oriole ty

prisma oriole
#

np

uncut river
#

@pale vessel 2 second start time now

#

thanks!

#

91 users cached

pale vessel
#

very nice

uncut river
#

sad

#

should be 140,000

pale vessel
#

yeah, that's unfortunate but at least it's working

#

you'll only get members that talk, mentioned, in VCs, the ones that you manually fetch, and probably some more

#

discord.js lazy cache everything

hasty mulch
#

@pale vessel Ok, that worked. Now, what is the equivalent of LUA’s else if?

pale vessel
#

but it's probably for the best now that we don't have any other way

#

i'm not familiar with lua, sorry

molten yarrow
#

@earnest phoenix slice works but u need to remap it again

const slice = new Map(Array.from(oldmap).slice())
hasty mulch
#

What is that elif you were talking about?

pale vessel
#

What is that elif you were talking about?
@hasty mulch python

earnest phoenix
#

ok thanks

hasty mulch
#

Yeah, but what does it mean?

pale vessel
#

else if

#

there's no else if in python, they have elif

hasty mulch
#

So, it is the equivalent of LUA’s else if?

solemn latch
#

python, those weirdos

pale vessel
#

not sure

hasty mulch
#

It is

sudden geyser
#

we bite

#

we feed off whitespace

pale vessel
#

get away from me!

hasty mulch
#

You literally just said that elif is else if, lol

pale vessel
#

it is?

sudden geyser
#

its elif

pale vessel
#

i'm not sure what you're trying to convey.

hasty mulch
#

Yeah, I asked what it meant and you said else if

pale vessel
#

🤔

#

elif means else if, yes

hasty mulch
#

Anyway would elif prevent all three of the if statements from running?

#

At the same time?

#

@pale vessel

faint prism
#

elif
Unamusedcrosoft

pale vessel
#

aaahah

tardy hornet
#

how do i make that if the avatar is moving it will show that

#

the dynamic

faint prism
#

?

tardy hornet
#

how do i make the dynamic true?

solemn latch
#

depends on the lib

tardy hornet
#

lib is not a lang right?

faint prism
#

no it isnt lol

solemn latch
#

its a library

tardy hornet
#

forgot whats lib mean then lol

#

javascript

solemn latch
#

discordjs, discordpy, eris, dnet

faint prism
#

library - Code someone else makes to make your life easier
language - A way to write machine code in a human readable format

tardy hornet
#

discord.js

solemn latch
tardy hornet
#

im in discord.js

solemn latch
#

just put the dynamic: true option in your options

tardy hornet
#

but i want to put it in a command

#

avatar command

solemn latch
#

as an argument?

#

like !avatar dynamic

#

?

tardy hornet
#

no i mean

#

i have a avatar command

#

and if they got nitro

#

i want it to send it moving

faint prism
#

It's a gif

solemn latch
#

yeah, just set your options for get avatar to dynamic

faint prism
#

Are you talking about a GIF

solemn latch
#

yeah, he is, but the option is called dynamic to get the relevant one automatically

earnest phoenix
#
{
"rates":{
"TRY":8.1529749831
},
"base":"USD",
"date":"2020-10-27"
}

how can i get the value "TRY": 8.1529749831, without using body.rates.TRY.

solemn latch
#

why do you not want to use body.rates.TRY

earnest phoenix
#

because i can't

solemn latch
#

why 🤔

earnest phoenix
#
    if (args[0].toLowerCase() === 'çevir') {
        if (!args[1]) {
            message.channel.send(degerbos)
            return
        }
    const dovizcevirici = `https://api.exchangeratesapi.io/latest?symbols=${encodeURI(args.slice(1,2).join(' ').toUpperCase())}&base=${encodeURI(args.slice(3,4).join(' ').toUpperCase())}`;
    let DCbilgi = await fetch(dovizcevirici).then(url => url.json());
            
    //if (!DCbilgi.rates) return message.channel.send(`**${message.author.tag}**: Geçersiz para birimi.`)

    const embed = new MessageEmbed()
        embed.setColor(autimatic)
        embed.setAuthor(`Döviz`, bot.user.displayAvatarURL({dynamic: true, size: 1024, format: 'png'}))
        embed.addField(`Dönüştürüldü`,`${args.slice(2,3).join(' ')} ${encodeURI(args.slice(1,2).join(' ').toUpperCase())} = ${DCbilgi.rates[encodeURI(args.slice(3,4).join(' '))]} ${DCbilgi.base}`)
        embed.setTimestamp()
        embed.setFooter(`${message.author.tag} | © ${bot.user.username}`, message.author.avatarURL({dynamic:true}))
    message.channel.send(embed)
    }
#

my code

#

/döviz çevir USD 1 TRY

#

undefined

#

I want to pass ${encodeURI(args.slice(3,4).join(' ').toUpperCase())} as body.rates.[HERE]

#

body.rates.args.slice(3,4)

#

like

solemn latch
#

rates[HERE]
not
rates.[HERE]

molten yarrow
#

body.rates[args.slice(3,4)]

earnest phoenix
#

okey.

#

i am trying

faint prism
#

debugging in chrome devtools is OP

solemn latch
#

im trying to get better at helping, tim does such a good job that im stealing his style

tired panther
#
 const userexist = await client.shard.broadcastEval(`this.guilds.cache.get("692021327283879957").members.cache.get("${message.author.id}")`);
``` error ```
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'members' of undefined
    at eval (eval at _eval (C:\Users\shahn\3D Objects\Botcode\sharding\node_modules\discord.js\src\client\Client.js:391:12), <anonymous>:1:44)    
    at Client._eval (C:\Users\shahn\3D Objects\Botcode\sharding\node_modules\discord.js\src\client\Client.js:391:12)
    at ShardClientUtil._handleMessage (C:\Users\shahn\3D Objects\Botcode\sharding\node_modules\discord.js\src\sharding\ShardClientUtil.js:185:82) 
    at process.emit (events.js:327:22)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)
#

having a problem xD

faint prism
#

guild is undefined

tired panther
#

ah wait one sec,

earnest phoenix
#

i'm still getting an undefined error.

#

${DCbilgi.rates[args.slice(3,4)]}

molten yarrow
#

try with ${DCbilgi.rates[args[2]]}

earnest phoenix
#

same

molten yarrow
#

than u need to promise it, its not fetched and you already sending the message

earnest phoenix
#

i guess there is something wrong with me. ${DCbilgi.rates["TRY"]} also doesn't work.

molten yarrow
#

move your whole embed inside

.then(url => url.json()
//HERE
);
pale vessel
#

say what now

earnest phoenix
#

😄

tired panther
#
 const invitePossiblites = await client.shard.broadcastEval(`${guild}.channels.cache.filter(cha => cha.permissionsFor(${guild.me}).has('CREATE_INSTANT_INVITE'));`);
``` Why is this not working?
#
nhandledPromiseRejectionWarning: SyntaxError: Unexpected identifier
    at Client._eval (C:\Users\shahn\3D Objects\Botcode\sharding\node_modules\discord.js\src\client\Client.js:391:17)
    at ShardClientUtil._handleMessage (C:\Users\shahn\3D Objects\Botcode\sharding\node_modules\discord.js\src\sharding\ShardClientUtil.js:185:82)
    at process.emit (events.js:327:22)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)
#

error

molten yarrow
#

remove the `

tired panther
#

where? in broad casteval @molten yarrow ?

molten yarrow
#

my bad sorry :3 never used broadcastEval xD

tired panther
#

xD

earnest phoenix
#

it works.

buoyant aspen
#

I'm trying to get the bot's avatar URL. However, client.user.avatarURL doesn't work... What should I use?

faint prism
#

how doesn't it work

buoyant aspen
#

Not a well-formed URl

molten yarrow
#

.avatarURL()

buoyant aspen
#

ah

#

thanks

earnest phoenix
#

ok

pale vessel
#

it could be null, use displayAvatarURL() if you want to get its default avatar if no custom one is available

thin cedar
#

Good evening, I have a problem my bot is already checking but I cannot activate its

faint prism
#

Are you verified and whitelisted?

#

The thing that is in bold and says NOTE?

thin cedar
#

I don't know i use google translate and when i translate everything it doesn't mean anything

buoyant aspen
#

How could I check the discord.js version from the package file? Obviously, package.dependencies.discord.js won't work.

faint prism
#

I don't know i use google translate and when i translate everything it doesn't mean anything
@thin cedar It is optional, and it is granted by Discord developers exclusively when you meet a criteria

tired panther
#
 channel.send(\n**Owner ID** ${guild.owner.user.id} \n**Owner Tag** ${guild.owner.user.tag})
#

that iss a guild create event why does it not work?

#

@faint prism there come user of null ...

faint prism
#

what

tired panther
#
TypeError: Cannot read property 'user' of null
    at Client.<anonymous> (C:\Users\shahn\3D Objects\Botcode\sharding\bot.js:106:105)
    at Client.emit (events.js:315:20)
    at Object.module.exports [as GUILD_CREATE] (C:\Users\shahn\3D Objects\Botcode\sharding\node_modules\discord.js\src\client\websocket\handlers\GUILD_CREATE.js:33:14)
    at WebSocketManager.handlePacket (C:\Users\shahn\3D Objects\Botcode\sharding\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)     
    at WebSocketShard.onPacket (C:\Users\shahn\3D Objects\Botcode\sharding\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
    at WebSocketShard.onMessage (C:\Users\shahn\3D Objects\Botcode\sharding\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
#

@faint prism that error

faint prism
#

dunno. looks like guild.owner is null

tired panther
#

it is not working more since today

#

one day ago it worked

#

it sent this message before 10 hours

#

and from then one it did not work

#

ah found the problem , new discord js intent

uncut river
#

when ur bot cpu usage is .2% cuz you forgot to get guild members intent

tranquil copper
#

Anyone here knows the error that the bot is online but is not responding (JDA)

radiant vigil
#

I made a url shortener command with discord.js

const TinyURL = require('tinyurl');
const uri = message.content.slice(12)
if (!uri.length) {return message.channel.send('Non hai inserito un link.')}
TinyURL.shorten(uri, function(res, err) {
if (err)
console.log(err)
message.channel.send(`Ecco il tuo link: ${res} (${uri})`);
})}```

Is it correct? Becausa this command returns some errors on my cmd
tranquil drum
#

any other JDA devs running into issues with their bot this morning?

#

ayy I'm with you @tranquil copper

tranquil copper
#

@tranquil drum TF JDA is acting weird

#

i just hit 10k servers

#

and now

#

thanks god

#

It started this night when my bot was acting weird with the server count

#

and then it broke

tranquil drum
#

I thought it was server count related too but my test user is broken too

tranquil copper
#

and now its not answering anymore

tranquil drum
#

Only in like 5 servers and it's also having the same problem

tranquil copper
#

Do you know anything to solve it

tranquil drum
#

I guess JDA is broken with latest Discord API or something

tranquil copper
#

lemme use 3.0 lol

sudden geyser
#

intents™️

tranquil drum
#

Ahh yeah intents fixed it

#

@tranquil copper

#

just use GatewayIntent.DEFAULT if you don't need extras

tranquil copper
#

okay

#

how to set it @tranquil drum lol

tranquil drum
#

JDABuilder.createDefault(token) if you just need DEFAULT

#

instead of the old new JDABuilder()

tranquil copper
#

im sharding

#

cause 10k servers

tranquil drum
#

it'll work with sharding

#

im sharding too lol

tranquil copper
#

im working with shardbuilder

tranquil drum
#

shard builder is deprecated 😦

tranquil copper
#

or tell me how to use jda builder and sharding at once

tranquil drum
#
JDABuilder.createDefault(token)
                    .useSharding(Loader.SHARD, Loader.NUM_SHARDS)
tranquil copper
#

okay thanks

tranquil drum
#

I don't have a shared state manager though

tranquil copper
#

And what does the first int at usesharding do? @tranquil drum

#

How to shard with JDABuilder @tranquil drum

tranquil drum
#

that's the shard id

#

@tranquil copper

tranquil copper
#

wait found a way arround it

steel violet
#
    list.members.cache.forEach(member => console.log(member.id)); ```
This gives me 2 of 40 id on the guild, with GUILD_MEMBERS intent Enabled and verified by Discord
```const client = new Discord.Client({ ws: { intents: ['GUILD_MEMBERS', 'GUILD_MESSAGES', 'GUILD_MESSAGE_REACTIONS', 'GUILDS', 'GUILD_WEBHOOKS'] } });```
#

I don't understand

fervent goblet
solemn latch
#

looks like something broke when playing the track

fervent goblet
#

well duh

earnest phoenix
#

How can I read both the attached file and the url.

let qrcode = `http://api.qrserver.com/v1/read-qr-code/?fileurl=${encodeURI(args[0]) || encodeURI(message.attachments.first().url)}`;
solemn latch
#

I dont understand, you want the fileurl query parameter?

boreal iron
feral arch
#

Hi!

#

How could I access to the properties of every command defined as a Commando framework command?

rich ether
#

if anyone could help me out

#

that would be great

earnest phoenix
#

you're missing parentheses

rich ether
#

fr

#

where

earnest phoenix
#

take a guess

rich ether
#

....

#

fml

earnest phoenix
#

😉

sudden geyser
#

hint: look at where the error is pointing

rich ether
#

im dead ass fucking sped

acoustic fossil
#

Countdown to night command

faint prism
#

wha

#

Did you pull that from a textbook or something

solid snow
#

does anyone know why guild.owner.user.username doesnt work anymore all of a sudden

solemn latch
#

intents update iirc.
guild.owner wont automatically be cached on startup

solid snow
#

damn ok thanks

#

kept getting lots of error all of a sudden

solemn latch
#

yeah, intents are now enforced

umbral zealot
#

Discord started enforcing the GUILD_MEMBERS intent requirement TODAY
If your bot has stopped being able to access cached members, you don't have access to the privileged GUILD_MEMBERS Intent. GUILD_MEMBERS is a privileged intent, it is not sent to bots that have not been allowed to use it.

If your bot is not verified you can go turn on the GUILD_MEMBERS intent in the Bot section of the dev portal, or you can fetch the users manually.

If your bot verified, need to request this privileged intent from Discord through https://dis.gd/contact (general request), or figure out how to fetch members only when necessary.

faint prism
#

oh snap

rich ether
#

ya intents fucked up my old music bot

faint prism
#

that explains my count issue

umbral zealot
#

Discord will not give you privileged intents just so you know how many people are on your bot's guilds though

#

just remove this feature if it's your only reason for needing this.

faint prism
rich ether
#

bahahha

#

toxcity counter

#

nice one

faint prism
#

Uses a machine learning model trained for detecting text sentiment
🙂

rich ether
#

my music bot got all fucked when intents came out

merry beacon
#

Would keyv be a scalable way to maintain an economy

#

in other words,

#

is keyv crap for bot economy

#

im using objects (as value) to store ppls inventories

buoyant aspen
solemn latch
#

bitfields follow rules, you cannot put any random thing within those rules

buoyant aspen
#

so... what might have triggered it?

#

The last interaction was a PATCH request that responded 200

faint prism
#

I usually see bitfields and discord in conjunction with roles

buoyant aspen
#

seems to be encountered whenever anyone but me sends a command, but IDK even where to start debugging

faint prism
#

on the command handing probably

merry beacon
#

Would keyv be a scalable way to maintain an economy
in other words,
is keyv crap for bot economy
im using objects (as value) to store ppls inventories

buoyant aspen
#

Found the issue. It's checking if a user has the false permission lol

faint prism
#

sounds like an invalid bitfield lol

solemn latch
#

keyv is just a wrapper isnt it?

umbral zealot
#

no I think it's a full on thing

solemn latch
fading siren
#

how can i show the number of servers on the bot page?

near stratus
#

how can i show the number of servers on the bot page?
@fading siren on your website ?

fading siren
near stratus
#

IDK , mine was there from beginning

#

sorry

solemn latch
earnest phoenix
#

Is there like a php guy here?

#

Getting annoyed of one thing

near stratus
#

Is there like a php guy here?
@earnest phoenix I think I can help with PHP

earnest phoenix
#

It's kinda annoying

#

I'm basically doing a small POST request

#

And in the field

near stratus
#

Okey

earnest phoenix
#

I put Y%T"S22jT&=y>>=

near stratus
#

What does the error say

earnest phoenix
#

Then it goes to timeout for some reason

#

and if I remove the " in it, everything works fine

faint prism
#

I don't remember PHP looking so unfriendly

earnest phoenix
#

I mean

#

It's kinda weird

#

Because if I just make the same thing

near stratus
#

and if I remove the " in it, everything works fine
@earnest phoenix Try replacing with %22

earnest phoenix
#

On a local server everything works fine

#

It's a password, can't choose it

@earnest phoenix Try replacing with %22
@near stratus

near stratus
#

It's a password, can't choose it
@near stratus
@earnest phoenix Oh it was post (I thought get)

earnest phoenix
#

It does not even make the request to the file

#

It's Pending

near stratus
#

Just use rawurlencoder

#

And then decode it again

#

https://www.php.net/manual/en/function.rawurlencode.php
Get help from here

earnest phoenix
#

The request to the file is not even being made when submitting

near stratus
#

Are you using curl to make request ?

earnest phoenix
#

Why dont u use body

#

Instead of throwing everything in url

#

It's a form btw

near stratus
#

It's a form btw
@earnest phoenix HTML ?

earnest phoenix
#

Yea

#

Then a request to PHP script

#

Basically a register form ASshrug02

near stratus
#

Yea
@earnest phoenix Are you using AJAX ?

#

Or direct

earnest phoenix
#

Direct to PHP file

random wyvern
#

Can anyone help me figure out why I cant get my MemeBot to work? Been offline for a few hours now for me.

Was a bot already made-

solemn latch
#

not sure why lovo sent you here

#

🤔

random wyvern
#

Not sure either, cant contact the creators and other people seem to have made it work. No one let me know what they did.. so Ive just been sitting here.

solemn latch
#

lots of bots went down because of an update to the api. you can ask the bots owner to fix the bot

#

otherwise it will remain down 🤷‍♂️

random wyvern
#

I cant add them as a friend :/

near stratus
#

@earnest phoenix Then you shouldn't have any problem with the code like:

<form method="POST" action="main.php">
    <input name="uname"/>
    <input type="submit" value="Submit"/>
</form>
earnest phoenix
#

true

umbral zealot
#

Its up to them to figure it out there's nothing we can do, @random wyvern

random wyvern
#

Well, at least I tried. Thank you-

earnest phoenix
#
<body class="main-bg">
         <div class="login-container text-c animated flipInX">
            <div>
               <h1 class="logo-badge text-whitesmoke"><span class="fa fa-lock"></span></h1>
            </div>
            <h3 class="text-whitesmoke">Please Login</h3>
            <p class="text-whitesmoke">By logging in, you accept our <a href="//studio.spacelab.club/legal/privacy-policy" target="_blank" class="text-spacelab">Privacy Policy</a> and our <a href="//studio.spacelab.club/legal/terms-of-service" target="_blank" class="text-spacelab">Terms of Service</a>.</p>
            <div class="container-content">
               <center>
                                 </center>
               <form class="margin-t" method="POST" action="/login.php">
                  <div class="form-group">
                     <input name="username" type="text" class="form-control" placeholder="Username" required>
                  </div>
                  <div class="form-group">
                     <input name="password" type="password" class="form-control" placeholder="*********" required>
                  </div>
                  <div class="form-group">
                     <center>
                        <div class="g-recaptcha" data-sitekey="6LfkvsYZAAAAAMbM5HZJ-6T410DvIx2dqNGbNumX"></div>
                     </center>
                  </div>
                  <button type="submit" class="form-button button-l margin-b">Sign In</button>
                  <p class="text-whitesmoke text-center"><small>Do not have an account? <a class="text-spacelab" href="./signup">Sign Up</a></small></p>
               </form>
               <p class="margin-t text-whitesmoke"><small>Copyright © 2017-<span id="currentYear">2020</span> - Spacelab Studio | All rights reserved.</small> </p>
            </div>
         </div>
   </body>

But I do have an issue with this

#

well that's some big code part lmao

near stratus
#

and the PHP uses

$un = $_POST['uname'];
echo($un);
#

??

#

Something like this ?

#

Don't post the whole code here

earnest phoenix
#

basically when i submit with password Y%T"S22jT&=y>>= it won't request the file /login.php

#

in that code part

faint prism
#

<center> is deprecated, isn't it

near stratus
#

Just try making a Request with curl in your terminal

#

To check if the /login.php is working

earnest phoenix
#

<center> is deprecated, isn't it
@faint prism nah

#

at least it does it's job Troll

near stratus
#

Also check the directory
./ or /

faint prism
#

it is in html5

earnest phoenix
#

well, does it's job so idrc

near stratus
#

it is in html5
@faint prism Who cares we'll use CSS anyway

faint prism
#

replaced by

text-align: center
near stratus
#

replaced by

text-align: center

@faint prism doesn't work for boxes

earnest phoenix
#

To check if the /login.php is working
@near stratus It does work, just remove the " from the password and it works fine

faint prism
#

there is a lot of ways to center elements

earnest phoenix
#

It's because of that god damn "

near stratus
#

Then use Js to replace the " with a certain symbol (ex:%22) and then in PHP again change %22 to "

#

there is a lot of ways to center elements
@faint prism I know 3

faint prism
#

w3schools lists a bunch of methods

near stratus
#

Anyway, How long does it take for a bot to be approved or declined ?

solemn latch
#

8+ weeks

waxen tinsel
#

1350+ hours

near stratus
#

So they just keep pinging my bot to check if it stays alive through that time ?

faint prism
#

no

#

If it isn't online when they randomly decide to review it, it's denied

near stratus
#

If it isn't online when they randomly decide to review it, it's denied
@faint prism That's almost same

earnest phoenix
#

what is the reason the bot sees members offline?

faint prism
#

Not really, but okay

earnest phoenix
#

@earnest phoenix Discord gateway intents SlidingParrot

waxen tinsel
#

"Almost same" picardgiggle

earnest phoenix
#

@earnest phoenix Discord gateway intents :SlidingParrot:
@earnest phoenix So is there anything I can do

#

Yes

#

Add needed intents to your bot and code

solemn latch
#

note, presence intents are privileged

#

i figured it out

#

lol

tardy hornet
#
case 'test':
  const premium = [
    '723081690792067143',
    '707997274722140261',
    '369742714855620618',
    '712666880115998730',
  ]
  if(message.member.id !== premium){
    return message.reply('you cant use it')
  }
    message.reply('sup mate')
    break;```
will it work?
earnest phoenix
#

tias

onyx flume
#

@humble gyro my bot was rejected on top.gg because it was offline today, I have been waiting 5 weeks and just because its bugging today because of an outdated JDA it got declined. I am putting the bot online once the VPS has restarted, can it be rereviewed please?

humble gyro
#

yea it can

#

add it to the queue again

solemn latch
#

ouch

onyx flume
#

Thanks, this was honestly the worst time to review it

faint prism
#

I feel that

tardy hornet
#
case 'test':
  const premium = [
    '723081690792067143',
    '707997274722140261',
    '369742714855620618',
    '712666880115998730',
  ]
  if(message.member.id !== premium){
    return message.reply('you cant use it')
  }
    message.reply('sup mate')
    break;```
will it work?

@tardy hornet will it work?!?!?

#

no it dose not

hollow sedge
#

why did you ask if you were just going test it

tardy hornet
#

i test it before

#

but idk why i thought it will be better asking that instead why its not working

solemn latch
#

its always better to give us correct and relevant info

#

if something doesnt work, its better to say so

chilly bison
#

@lucid nova

lucid nova
#

Hello everyone,
I have a really big problem! My bot is starting and is online, but it doesnt answers any messages I send and it doesnt find any users and servers. Please help : (

#

@lucid nova
@chilly bison hey

chilly bison
#

@lucid nova what language?

lucid nova
#

My mother tongue is german, but my english is pretty fine, i think

chilly bison
#

no I meant like python

solemn latch
#

programming language

chilly bison
#

or node

lucid nova
#

ohhh

#

java

faint prism
#

Not sure how I feel about that pfp tho

#

send code

lucid nova
#

The bot worked in the past, but when I restarted it today, it stops working. The code doesnt even have changed

hollow sedge
#

My mother tongue is german, but my english is pretty fine, i think
@lucid nova loll

boreal iron
solemn latch
#

the discord api had some changes

faint prism
#

^

#

breaking changes imo

earnest phoenix
#

API v7 => API v8

#

They really broke some bots

#

you need to enable intents

solemn latch
#

those bots deserved it Thonk

lucid nova
#

the discord api had some changes
@solemn latch Yeah, but my code doesnt make any error messages

faint prism
#

do you have something like

try {
//  ...
}
catch(exception) {
  // doing nothing
}
earnest phoenix
#

Not having intents don't cause any errors, you just don't receive the events

#

Enable them if you're willing to

lucid nova
#

The bot is online, but it doesnt know any users or servers

earnest phoenix
#

you need to enable intents

#

specifically the privileged server members intent

faint prism
#

that's verified only though right

earnest phoenix
#

nope

faint prism
#

oh sick

earnest phoenix
#

all bots can use it up to 100 guilds

#

after 100 you need to get verified

faint prism
#

70
neat

earnest phoenix
#

nevermind the limit is 75 now apparently

#

that or discord misinformed us

onyx flume
#

Gotta wait another 5 weeks for review of bot, because it went offline because 1 functionality was depricated and made the VPS crash, the day of review. Just shoot me now angeryBOYE

earnest phoenix
#

nevermind discord misinformed us

faint prism
earnest phoenix
#

it's 100 guilds

waxen tinsel
#

@onyx flume more like 4.8 mil seconds at the very least rn

onyx flume
#

Really?

#

But my VPS aint back up yet

prime fjord
#

Um how do i use 5he bot mudae

waxen tinsel
#

Well then you have 4.8 million seconds to get it back up

#

@prime fjord how do you what?

prime fjord
#

Use the bot mudae

#

I just added it to my server and idk what to do

waxen tinsel
#

-wrongserver

prime fjord
#

Ah damn

#

Ty

waxen tinsel
#

@zinc fable

gilded plankBOT
#

@prime fjord

Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Support Server" button on the bot's page, not the "Join Discord" button at the top of our website. If there isn't a button that says Join Support Server, then we can't help you. Sorry :(

zinc fable
#

just incase

prime fjord
#

Ty

onyx flume
#

Hmm oh well, just gotta wait 👍

abstract perch
#

Anyone having delay times when starting up bots?

earnest phoenix
#

That depends on what your bot does at startup, mine doesn't have any delay

abstract perch
#

It was fine yesterday

#

I had 0 delay

#

Apparently that ruined it

earnest phoenix
#

It might be because of the intents enforcement

#

Have you enabled your intents?

abstract perch
#

ugh yeah

#

let me check again

merry shuttle
#
client.on('guildCreate', theNewGuild => {
    theNewGuild.owner.send('')
})```
#

why is it send of undefined...

misty sigil
#

owner isn't cached?

merry shuttle
#

ah

#

thanks

abstract perch
#

@earnest phoenix yeah, I have them enabled but nah

#
    const client = new Client({ ws: { intents: ['GUILDS', 'GUILD_MESSAGES'] } });```
earnest phoenix
#

@merry shuttle owner can't be undefined btw, it's null

merry shuttle
#

yeah?

earnest phoenix
#

That's not how you enable intents @abstract perch

#

It requires a bitfield

abstract perch
#
const client = new Client({ ws: { intents: Intents.ALL } });```
#

?

earnest phoenix
#

No, (new Intents()).add(["GUILDS", "GUILD_MESSAGES"])

lucid nova
#

How do I use an older API version with jda in maven. My bot doesnt work anymore. pls help

abstract perch
#

like I said, yesterday it was working perfectly fine

sonic lodge
#

it's not an error, it's just a warning that you're using old api

abstract perch
#

Yeah

sonic lodge
#

just change ensureIndex to createIndexes

abstract perch
#

I will, but my problem is that starting up the bot takes around 4 minutes

#

I never had that issue

sonic lodge
#

oh well idk how to solve that

abstract perch
#

Yup

#

if my bot leaves all the guilds, it will start instanly

blissful coral
#

something with intents?

#

maybe?

abstract perch
#

nope

hollow sedge
#

How many guilds is your bot in

abstract perch
#

1

#

It's a bot for testing

#

trying something brb

#

yeah, tried with my old bot which had no issues

#

still the same issue

#

idk what's causing it honestly

blissful coral
#

hmmm

abstract perch
#

probably the Token?

#

probably discord Api?

#

who knows