#development

1 messages · Page 1877 of 1

drifting wedge
#

i mean he wanted to make a bot

solemn latch
#

you need to know how to use python to understand how to make a bot in python.

you cant swim for the swim team without knowing how to swim first ^_^

drifting wedge
#

not neccessarily learn python

lyric mountain
solemn latch
#

and it was slow for you

drifting wedge
#

shiv got very angry

drifting wedge
drifting wedge
#

worked out well

solemn latch
#

I remember you taking weeks to learn concepts that take a few hours to learn

drifting wedge
#

true

lunar lance
#

do u know sus?

#

or just from asking questions

#

@drifting wedge

drifting wedge
#

woo is cool

#

he had a mc server we used to play a lot on

lunar lance
#

ohh

solemn latch
#

We both where quite active in this channel when 0exe was learning.
its how I started to learn py myself(even though I never used it kek)

drifting wedge
#

and shiv

#

omfg shiv was so pog

#

he helped so much

solemn latch
#

ye

drifting wedge
#

i was indeed stupid to do bots before learning python lol

ancient nova
#

sus

drifting wedge
#

but it ended up okay ig

wooden kindle
#

ello

#

@pale vessel ARE U AWAKE

pale vessel
#

I am not

feral aspen
#

Quick question..

pale vessel
#

Why use that? Use a library like node-fetch

feral aspen
#

Did I forget JS or can I not access this.

#

I'm using var since I have no idea how tf I'm accessing it.

#

For antonyms.

pale vessel
#

You need to include that code inside the callback function

#

Inside response.on("end"), specifically

#

Alternatively, wrap the whole call inside a Promise and resolve the object on end

#

Honestly, just use a library to request

feral aspen
#

Bruh.. If I add that code inside that .on('end... I can't access randomAntonyms.

earnest phoenix
#

define it in a global scope then

quartz kindle
#

you cannot access callbacks outside of its block

#

thats why you use promises

#

the only way to return the value back to the outer scope is to wrap it inside a promise and await it

drifting wedge
#

whats the method to change nicknames in dpy?

delicate zephyr
#

@modern sable

modern sable
#

handled by woo

drifting wedge
#

@lunar lance

lunar lance
ancient nova
#

help

        for (const listenerFile of listeners) {
            const listener = require(`../listeners/${listenerFile}`);
            console.log(
                "══════════════════════════════════════════\n" +
                "Loaded: " + listener.name
            )
            this.on(listener.name, (...args) =>  {
                listener.exec(...args, this);
            });
        }
``` I use this to get all the listeners working inside a certain folder right? the "this" is another name for the client, how can I make it so the "this" only works inside the other code I'm about to send and not in the other args that I am using as text for the event strings, please please I spent like 3 hours on this I cannot get it to work I beg you
```js
module.exports = {
    name: "guildDelete",
    exec: async (guild, client) => {
         //code for exmple client.login(token);
    }
}
``` the "guild" will the the "...args" in the code above and the client will the "this" so I can actually use the "this" as client to code some stuff. PLEASE
#

...anyone

pallid jungle
eternal osprey
#

why can't i copy guild ids anymore??

#

is that removed?

solemn latch
#

make sure dev mode is on

earnest phoenix
#

If so, your code seems fine; what's the problem?

solemn latch
ancient nova
#

that's why I'm passing "this" to the exec thing

#

so it can execute the code inside the event

earnest phoenix
#

Completely ignored my question bruh

ancient nova
#

I was just answering

#

._.

#

by cache not being defined

#

I use this piece of code

#
exec: (client, guild) => {
        const channel = client.channels.cache.get('770505348339466250');
        channel.send(guildJoined);
}
earnest phoenix
#

It wouldn't

#

Arrow functions does not change this keyword's behavior

earnest phoenix
#

And you're using (client, guild), not (guild, client)

ancient nova
#

yea it returns my manager, and to get client itself I have to do client.manager.client again, however in other events, with legit the same exact code client returns actual client

ancient nova
earnest phoenix
ancient nova
#

I know...

#

so is it impossible to fix and I am doomed for eternity or is there a simple fix I am too dumb to understand

#

cause I'm seriously injuring my brain right now

earnest phoenix
hollow edge
#

whats happening with the discord bots? can anyone explain?

earnest phoenix
#

Why not just pass <Manager>.client to your event listener??

ancient nova
#

how though

#

those are two separate scripts

earnest phoenix
#
this
  .on(listener.name, async (...args) => {
    await listener
      .exec(this.client, ...args);
  });
#

You said it returns your manager, so your this keyword must be passing the manager instead of the client

ancient nova
#

whenever I try to console.log "this" in the manager it returns an object Object reference, tried to use json.stringify to read it but it broke the bot

#

I don't understand though, I have the same code in the "message" event right? I pass the same client to all of the commands, and somehow magically they all work

#

I'm confused

earnest phoenix
#

Can you show both of the message and guildDelete events' listeners?

ancient nova
#

sure

#

module.exports = {
name: "message",
exec: async (client, msg) => {

#

this is the thing in message event

#

I legit pass it to a code that executes commands await command.exec(msg, args, client);

#

and somehow it works and passes normal client as it supposed to be

#

but somehow it doesn't do that for guildDelete and guildCreate events

#

also this is the thing guildDelete has exec: async (client, guild) => {

#

sorry for the mess I'm just kinda tierd

#

been tryna fix it for hours now

#

you there? @earnest phoenix

earnest phoenix
#

That doesn't even show anything, just the parameters, I meant the code; if it works in other event listeners and not those 2, you're probably using something wrong

ancient nova
#

it's really messy

#

can I end it to you in dms?

earnest phoenix
#

Sure I guess

quaint wasp
#

why people say js is slow when it can do these

earnest phoenix
lyric mountain
earnest phoenix
#

I wonder

#

nvm im too lazy

#

I was going to do that in go but

quaint wasp
#

nvm C++ can do it like ectreamly fast

#

extreamly*

earnest phoenix
#

do it in C

boreal iron
lyric mountain
#

cry about it

boreal iron
#

I do KEKW

wheat mesa
#

lmfao

lyric mountain
#

I tried to do it

#

But cpp is fckin disgusting

#

Hell to get a simple epoch millis

earnest phoenix
#

java is by far better

boreal iron
#

Hahaha… stop the jokes dude, I’m done freerealestate

quaint wasp
#

Oh

earnest phoenix
#

If I do discordClient.guilds.cache I see the collection of guilds (see screenshot)

#

but if I use discordClient.guilds.cache.get(886299243114016808), I get undefined

#

why is that?

#

(discordjs v13)

boreal iron
#

Make sure to pass the ID as string not as integer

discordClient.guilds.cache.get("886299243114016808")

#

And always use fetch not get btw. as if the guild isn’t available in your cache already it will be fetched from Discord if possible

old cliff
#

guilds are always in cache unless you tweak the cacheFactory

earnest phoenix
crystal wigeon
#

Is this true?

rose warren
crystal wigeon
#

So I can't use YT to play music,mmm

earnest phoenix
#

how can I make my bot show how many servers its in

#

@rose warren

earnest phoenix
#

yes

#

it says n/a

#

and I need it in js

#

not discord.js

#

i checked the document

#

there is only discord.js python java and other things

#

but no java script

rose warren
earnest phoenix
#

I checked

#

there isnt one for java script

rose warren
earnest phoenix
#

this is discrd.js

#

nvm Ill just right it myself

#

and btw it litteraly says its discord.js in the code

rose warren
#

Oh I see. Just post to the API directly then

earnest phoenix
#

how

rose warren
earnest phoenix
#

ok

rose warren
#

Ask in #topgg-api if you need help or have questions

#

Don't ping anyone though

earnest phoenix
#

OK

#

oops

limpid oxide
#

I'm getting an error whenever I run my code:

Traceback (most recent call last):
  File "main.py", line 9, in <module>
    import discord, os, shutil, asyncio, json, topgg, aiohttp, time
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/topgg/__init__.py", line 24, in <module>
    from .client import DBLClient
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/topgg/client.py", line 36, in <module>
    from discord.ext.commands.bot import BotBase
ModuleNotFoundError: No module named 'discord.ext.commands.bot'```
earnest phoenix
#

it didn't worked

slow terrace
#

Hello, anyone know how to delete a global slash commands ?

cinder laurel
#

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

client.on('ready', () => {
console.log(Logged in as ${client.user.tag})
});

const mySecret = process.env['token']
)

client.on('message', msg => {
if (msg === "ping") {
msg.reply('pong')

}

});

#

i keep getting the error

#

SyntaxError: Unexpected token ')'

#

help

earnest phoenix
#

also pls use codeblocks

cinder laurel
#

whats code blocks?

cinder laurel
earnest phoenix
earnest phoenix
#

because i dont see any

cinder laurel
cinder laurel
#

this is what its showing so far

hollow loom
hollow loom
hollow loom
vagrant sorrel
#

hey guys has anyone got their bot verified here?
I need help in filling up the form..

vagrant sorrel
#

thanks

reef stump
#

hi

high crown
#

I'm trying v13 and I'm having errors

#

can anyone help 🥲

#

anyone here?
pls

#

v13 sucks

#

oh wait

#

still the same

novel snow
#

Yeah I could try that, but now I am stuck with resetting the timer, You got any ideas?

boreal iron
#

v13 sucks
It doesn’t but you need to read the change log before updating something

novel snow
#

@boreal iron ey men you smartest here probs, You know how to reset the timer of a collector so it resets every time it collects something?

boreal iron
opaque seal
high crown
#

I'm not able to update node

#

🥲

high crown
slim kiln
grim aspen
#

or in package.json put 16.x

placid briar
slim kiln
slim kiln
dire gull
#

Hi

lunar lance
#

shut up

dire gull
#

omg omg pls give me

lunar lance
#

how would i fix this? trying to get my bot to send a dm to somebody

lyric mountain
outer perch
#

can I add a json to .env?

#

so i can hide the auth for the DB

slim kiln
lyric mountain
#

why would you even need to mix 2 formats?

lyric mountain
outer perch
#

forget, I'll add as a string then use json parse

lyric mountain
#

bruh

#

you don't get the root of the issue here

slim kiln
lunar lance
#

why is ctx gray (trying to get my bot to send dm to someone who uses the command)

lyric mountain
lunar lance
lyric mountain
#

mean that it is not used anywhere

lunar lance
#

so how do i fix that

lyric mountain
lyric mountain
lunar lance
#

oh

lyric mountain
#

unused variable is not an error

lunar lance
#

so its supossed to be like that?

lyric mountain
#

also no

#

the only way to get event info is through ctx

#

it's virtually impossible not to use it somewhere inside the event

lunar lance
#

oh

#

so how would i fix this?

#

bruh shut uppp

#

@rose warren

earnest phoenix
#

For the past week, I've been doing slash command tests on a special server, so I was using the guilds commands and everything was working fine. However, today I want to publish them on the global commands but no command is displayed, what can I do? (PS: I have no error and I have successfully launched the file to deploy the commands)

My script when i push in global commands:

(async () => {
    try {
        await rest.put(
            Routes.applicationCommands(config.clientId),
            { body: commands },
        );

        console.log(commands.length + " commandes viennent d'être enregistrés avec succès !");
    } catch (error) {
        console.error(error);
    }
})();```
lyric mountain
#

did u invite with slash scope?

earnest phoenix
#

use app command

lunar lance
lyric mountain
#

you need both bot and interactions scopes

earnest phoenix
#

oof ok thx

lunar lance
#

ok frick this im too dumb with python to make a bot whats a good site/app to learn python with?

lyric mountain
lunar lance
#

ty

#

wait its free right

#

i know this site

lyric mountain
#

some are

lunar lance
#

yeah yeah man beginner friendly

#

how do i do this?

earnest phoenix
#

read the tutorial again but slowly this time

#

that's how i learn stuff

timber fractal
#

so i used this code, trying to make the bot leave the vc and delete the queue if it was alone in the vc after x ms (in this case 100) but it doesnt work, can someone help me?
code; https://srcb.in/W8UieqDp9H

lyric mountain
stray seal
#

I have been running the same code for 2 months. Can someone tell me why i am just now getting an error?

earnest phoenix
#

@stray seal rate limited

#

you are sending too much stuff

stray seal
green kestrel
#

yay, slash commands almost done 🙂

#

now just gotta wait for the date where we can apply for message intent ig

earnest phoenix
#

if i use the raw http interactions endpoint for slash commands how do i recieve guild members and channel messages etc?

green kestrel
#

@woeful pike mind yeeting pls?

#

^^

#

ty ty 🙂

lyric mountain
#

the most important part got cropped out

stray seal
#

@lyric mountain ^

lyric mountain
#

errr

#

reload ur token, now

stray seal
#

My friend is having this issue. He tried to get on top.gg but he don't got a Phone. Can you help him?

lyric mountain
#

bruh

#

before we continue, reload the token

#

really, you just posted it there

stray seal
#

I did

drifting wedge
#

the issue is that your ratelimited

#

there

lyric mountain
#

show where it is accessing guild

earnest phoenix
#

You cropped out the line that caused the error

stray seal
earnest phoenix
#

@quartz kindle am i doing a right thing by using cloudflare workers for a bot

quartz kindle
#

you want to go websocketless?

#

sure you can, but you wont be able to do everything

earnest phoenix
#

i could use replit but mongodb uses the only available port so uptimerobot fails

stray seal
#

Full error log

earnest phoenix
#

look for a file that seems like you wrote it

stray seal
#

My friend did

#

Would you like to talk to him?

#

He cannot join this server

lyric mountain
#

why?

earnest phoenix
#

Ok it seems like you are making s nitro scam bot

#

The folder name is New Nitro

stray seal
#

lol

stray seal
lyric mountain
#

could be something like nqn

lyric mountain
earnest phoenix
#

Me

#

I don't have a SIM card because I don't need one

stray seal
lyric mountain
earnest phoenix
#

buy a sus voucher

#

protection from ejects

stray seal
#

@earnest phoenix @lyric mountain can you help my friend or not.

lyric mountain
#

not without the code

earnest phoenix
#

I am too busy

#

bye

lyric mountain
#

event.js

stray seal
#

So i can make a group with my friend.

#

So you can help him

lyric mountain
#

nah

#

just show what is in line 23 in Events.js

earnest phoenix
#

Censor your token

#

And send everything else

lyric mountain
#

if a token is in line 23 you have serious issues

stray seal
stray seal
# stray seal

where we don't need to code
[9:51 AM]
we need to just simply do

#

Added to that is that comment ^

earnest phoenix
#

what even is that

#

botghost 2.0?

hollow depot
#

everytime my bot joins a server, it should send a message in the guild.systemChannel, usually it does correctly, but sometimes it crashes even if i have a trycatch, this is my code

try {
 guild.systemChannel.send({ embeds: [
  { 
    color: '#be2edd', 
    title: 'Thank you for adding me!', 
    description: `Thank you for adding me to \`${guild.name}\`!\nTo get a list of all commands type \`.help\`.\n **Note: the owner commands are         not listed.**\n`, footer: { text: `The bot\'s owner can see all the servers the bot is in.` }, 
    timestamp: new Date() 
      }
    ] 
  }) 
} catch (e) { console.log(e) }```
stray seal
#

lol

vivid fulcrum
#

the try catch is useless because you're not awaiting the send

#

send returns a Promise

hollow depot
#

that makes sense, im stupid

lyric mountain
hollow loom
#
const { SlashCommandBuilder } = require('@discordjs/builders');
const discord = require('discord.js')
const superagent = require('superagent')

module.exports = {
    data: new SlashCommandBuilder()
    .setName('chat')
    .setDescription('Chat with the bot')
    .addStringOption(option =>
        option.setName('input')
            .setDescription('The input chat with the bot')
            .setRequired(true))
    async execute(interaction, client) {
        const res = await superagent.get(`api.popcat.xyz/chatbot?msg=${option}&owner=Kweeper&botname=Depression+X`);
        const embed = new discord.MessageEmbed()
            .setTitle('Chat with depression.')
            .addFields(
                { name: 'Input', value: `${option}.`, inline: false },
                { name: 'Response', value: `${res.response}.`, inline: true },
            )
            .setColor('RANDOM')
        await interaction.reply({ embeds: [embed], ephemeral: true});
    },
};

unexpected token async

earnest phoenix
#

@hollow loom you're missing a comma

hollow loom
#

oh bruh

earnest phoenix
#

after setrequired

hollow loom
#

ok ty

stray seal
woeful pike
earnest phoenix
lyric mountain
stray seal
#

Can someone help me with my issue?

stray seal
lyric mountain
#

your friend uses a botmaker, so only people that can help him are those who also use that botmaker

#

so he's out

lyric mountain
#

you issue is ratelimiting

stray seal
#

I sent my code error for my bot

stray seal
timber fractal
#

so i used this code, trying to make the bot leave the vc and delete the queue if it was alone in the vc after x ms (in this case 100) but it doesnt work, can someone help me?
code; https://srcb.in/W8UieqDp9H

stray seal
#

And how have i never had issues beofre today?

lyric mountain
#

looks like a IDENTIFY ratelimit

#

since it errored during client creation

stray seal
#

How i fix this?

lyric mountain
#

you don't, just wait

stray seal
#

Again, it never happened until today.

stray seal
lyric mountain
#

did u restart the bot a lot today?

stray seal
lyric mountain
#

how many shards?

stray seal
#

Last restart was yeserday

stray seal
lyric mountain
#

ok, 1 then

#

hmm

#

and hide yo token

stray seal
#

My friend was testing it, to see my code, and did my prefix (c!) and it was not showing anything. I went in my code, and was turning the code on and off, i click "Run" again and this happened.

stray seal
#
bot.run('TOKEN IS HERE')
#

My token is on that line

earnest phoenix
#

@lyric mountain should I make a slash command generator GUI for detritus

lyric mountain
#

like, 5 lines above and 5 lines below

lyric mountain
#

actually, how'd that work?

earnest phoenix
#

¯\_(ツ)_/¯

stray seal
#

That is all

#

Not py

#

Bunch of Enters

#

lol

earnest phoenix
timber fractal
#

other lines that contain code?

lyric mountain
stray seal
lyric mountain
#

well, idk what to say

#

if there's nothing around bot.run then it's definitely a IDENTIFY ratelimit

earnest phoenix
#

I already made a working slash command options generator then deleted it so it can't be that hard

stray seal
#

Should i show 400 - rest

#

Let me get line 400 - 430

lyric mountain
#

yesterday there was an outage in discord

#

that causes bots to spam api trying to reconnect

earnest phoenix
stray seal
#
    membercountembed.set_author(name="Current Member Count", url="https://servercleaner.deathjones.repl.co", icon_url="https://cdn.discordapp.com/attachments/853262975514968084/866659453617438730/server_cleaner.png")
    membercountembed.set_footer(text="Server Cleaner", icon_url="https://cdn.discordapp.com/attachments/853262975514968084/866659453617438730/server_cleaner.png")

    await ctx.send(embed=membercountembed)


#-----------------------------------------------------------------

@bot.event
async def on_guild_join(guild):
    channel = guild.system_channel
    embed = discord.Embed(colour=discord.Colour(0xd0021b), url="https://discordapp.com", description="Thanks For Inviting Server Cleaner, Read Bellow To Get Started With Me.")

    embed.set_author(name="Server Cleaner", url="https://discordapp.com", icon_url="https://cdn.discordapp.com/attachments/853262975514968084/866659453617438730/server_cleaner.png")
    embed.set_footer(text="Server Cleaner", icon_url="https://cdn.discordapp.com/attachments/853262975514968084/866659453617438730/server_cleaner.png")

    embed.add_field(name="Prefix:", value="My Prefix Here Is c!", inline=False)
    embed.add_field(name="Getting Started:", value="To Get Started With The Bot We Recommend Running c!setup. ***TO BE DEVELOPED***", inline=False)
    embed.add_field(name="How To Get Help:", value="You Can Get Help By Doing The Command c!help Or Can Join The Discord Server.", inline=False)

    await channel.send(embed=embed)










bot.run('TOKEN')```
lyric mountain
#

probably caused a temporary identify ban

#

it can range from 1 hour to 1 day

stray seal
lyric mountain
#

all u can do is wait

stray seal
#

People in my discord are blowing up, trying to use the bot

lyric mountain
#

there's usually a header that tells how much time to wait

stray seal
#

What do i say about this? I dont even know what Identify Ban is...

lyric mountain
#

IDENTIFY is the endpoint used to connect to discord

#

you have a limit of 1000 IDENTIFY requests per day iirc

earnest phoenix
#

so that's how i broke my extinct lib multiple times while testing

lyric mountain
#

if you can somehow grab the request itself u can see how much time is left to unlock it

#

idk why dpy doesn't state it tho

stray seal
#

What do i announce

#

For my server.

#

I am banned from the code? Like..

lyric mountain
#

no

#

say due to yesterday's outage you bot got blocked from logging-in temporarly

stray seal
#

ok

lyric mountain
#

you should try to retrieve how much time is left

stray seal
lyric mountain
#

try making a simple login code with djs

#

ik djs logs how much time is left

stray seal
#

I dont know how to do that...

lyric mountain
#

@earnest phoenix your turn

stray seal
#

lol

#

@earnest phoenix

#

How do i do that?

earnest phoenix
# lyric mountain try making a simple login code with djs
const ref = React.createRef();
ReactDOM.render(
document.querySelector("#root"),
<ChakraProvider>
<ChakraInput onChange={e => ref?.current?.innerText = `client.login("${e.target.value}")} placeholder="Enter your bot token" />
<ChakraText ref={ref} />
</ChakraProvider>);
lyric mountain
#

wtf is that

stray seal
#

lol

earnest phoenix
#

Now suffer poor vue stan

lyric mountain
#

KEKW react.js

#

vue*

boreal iron
#

Poor Kuuhakwooagboku

stray seal
#

@earnest phoenix if i copy that, it will work?

#

Is that js or node?

lyric mountain
#

but jokes apart, he just need a simple login code to see IDENTIFY ratelimit retryAfter header

earnest phoenix
#

Yeah

#

It will work

stray seal
#

OK

#

Is that js or node?

earnest phoenix
#

If you import chakra ui react and react dom properly

earnest phoenix
stray seal
#

I use replit

#

Uplaoding it

earnest phoenix
#

esbuild the code

#

then run it in html

#

wait i forgot to add a root div brb

stray seal
#

So confused

stray seal
earnest phoenix
#

it's not normal javascript

#

it's JSX

stray seal
#

WTF

#

ok

#

There is no JSX on my client

#

Let me try HTML

earnest phoenix
#

lmfao

stray seal
#

Nothing is happening

earnest phoenix
#

JSX needs to be converted to normal javascript with a bundler

stray seal
earnest phoenix
#

Also I am using npm libaries without requiring them

stray seal
earnest phoenix
stray seal
#

Where do i add that at?

lyric mountain
#

can't yall just use d.js or detritus

earnest phoenix
#

what

#

oh yeah

stray seal
earnest phoenix
#

i was working on a bot analytics page

earnest phoenix
stray seal
#

Can i just get the JS code please.

earnest phoenix
#

pay 5$

stray seal
#

@lyric mountain

#

So..

lyric mountain
#

idk d.js lul

solemn latch
#

we dont spoonfeed code here

grim aspen
#

https://discord.js.org/#/ imma just put this here

lyric mountain
#

he got IDENTIFY ratelimited

solemn latch
#

ah

stray seal
#

So...

lyric mountain
#

we're trying to grab the retryAfter header

stray seal
#

We are trying to fix this.

lyric mountain
stray seal
#

And, i dont know how to do it.

lyric mountain
#

and he codes in python

grim aspen
#

i do not know if logging in via the bot would show the ban on the console

lyric mountain
#

so we're trying to make a simple login code so he can see the full request

stray seal
#

^

lyric mountain
#

but idk d.js

solemn latch
#

its 24 hours isnt it?

lyric mountain
#

and JDA would be too overkill

lyric mountain
grim aspen
#

ok, i know what happened

lyric mountain
#

he said the bot stopped logging-in today

grim aspen
#

this seems to be an issue with repl.it

lyric mountain
#

so probably he left the code running during yesterday's outage

#

which spammed the api alas giving IDENTIFY ratelimit

stray seal
lyric mountain
#

ye

stray seal
#

When did it happen?

rose warren
grim aspen
#

@stray seal what did it say on the console?

earnest phoenix
#

@lyric mountain Here's a pure js version of the generator you never asked for

<input id="token">
<p id="code"></p>
<script>
document.querySelector("#token").onInput = e => document.querySelector("code").INNERHTML = "client.login(" + e.targrt.valur
grim aspen
#

the error code?

lyric mountain
stray seal
rose warren
#

Each time you try to identify beyond the limit the timeout increases

lyric mountain
#

whenever an outage like that happens many bots get locked out afterwards

#

I always shutdown the code until it settles

stray seal
#

AM or PM?

lyric mountain
#

neither, that's 24-hour

stray seal
#

I did not even know that TBH.

stray seal
stray seal
grim aspen
#

that's not discord.js

lyric mountain
#

...that's not the issue

#

py doesn't show how much time left until ratelimit goes away

#

we're tying to retrieve that time

#

actually

#

you could just make a http request to discord

solemn latch
#

thats what I was thinking, but wasnt sure what you need to identify

lyric mountain
#

login bot

rose warren
# stray seal This is my first time this happening.

That's not what I mean. You get rate limited after the 1000th identification within 24h. Each attempt beyond 1000 will increase the rate limit timeout. So 1001 will add some extra time to wait, 1002 will add more, 1003 adds more again. So basically your timeout could be longer or shorter depending on when you stopped trying to identify. In my case it blew up to 72h because my bot had a stupid simple error loop because of an unavailable guild in the middle of the night and it got stuck in the error loop until the morning. That's how I ended up with 72h to wait, because it had done well over 1,000 identify attempts.

grim aspen
#

have you tried using a sleep function?

lyric mountain
#

most libs try to reconnect after losing connection to api

stray seal
grim aspen
#

i mean that's to solve the rate limit in the future

lyric mountain
#

during outages, it results in infinite loops

stray seal
solemn latch
#

If you want to send a manual identify request

stray seal
#

What is this code for?

grim aspen
#

it temporarily delays an execution

stray seal
boreal iron
#

It's the payload you have to send to identify yourself.

boreal iron
#

(stringified JSON)

#

Property body

lyric mountain
#

...he probably doesn't know how to send http requests tho

grim aspen
#

lemme simplify, it times out the request for a certain amount of seconds, it kind of helps reduce a chance of being ratelimited

stray seal
stray seal
#

I really dont

solemn latch
#

in this case you dont really need to worry about the intents

stray seal
#

Kinda new to code.

lyric mountain
#

that isn't a js file, it's a json payload

#

use something like postman

stray seal
young storm
#

if it will take about one week to review someones bot, my bot isnt hosted 24/7 because it is using uptimerobot and requires network 24/7

#

so will it be declined if not online 24/7?

lyric mountain
solemn latch
lyric mountain
#

to be real, I'm starting to think that d.js will be easier for that purpose

solemn latch
#

it doesnt need to be 24/7(but really should be)

stray seal
#

brb

young storm
#

oh because im trying to look for a host that will keep it up 24/7

grim aspen
#

a vps

young storm
grim aspen
young storm
#

all your code is public

grim aspen
#

repllit won't keep everything up

young storm
#

so basically as long as the bot is online when you guys are reviewing it it's ok?

grim aspen
#

i use replit as a sandbox for code testing though and regen bot token after everytime i'm done

#

yes

stray seal
young storm
#

yh but i can put my pc on as soon as i arive at home

#

because it will be online if the pc is on and is getting network

slender thistle
#

Is it safe to assume that I have to serve my vue package as static file on my website for it to work?

solemn latch
# stray seal Is this what i need?
const { Client, Intents } = require('discord.js');

const client = new Client({ intents: [Intents.FLAGS.GUILDS] });

client.once('ready', () => {
    console.log('Ready!');
});
client.once('rateLimit', RateLimitData => {
    console.log(RateLimitData.timeout, RateLimitData);
});

// Login to Discord with your client's token
client.login("TOKEN HERE");

should do for getting your ratelimit data

lyric mountain
#

if it login sucessfully then it's an error in ur code

#

if not, the error will contain how much time left before ratelimit goes away

stray seal
wheat mesa
#

Outdated node version

solemn latch
#

repl 😠

stray seal
solemn latch
#

always making life hard

stray seal
solemn latch
#

node -v

wheat mesa
stray seal
solemn latch
#

djs v13 requires 16.6.0

stray seal
#

What do i do then?

earnest phoenix
wheat mesa
#

There’s a couple methods to update node on replit

stray seal
grim aspen
#

try node 13.x and discord.js ^12.5.3

wheat mesa
#

No

stray seal
#

I am a PY user lol

wheat mesa
#

Don’t do that

stray seal
#

What do i do then lol

grim aspen
#

i fixed it that way

wheat mesa
#

I don’t know how to update replit’s node version, I don’t use it

#

But I know there’s a couple ways that exist

grim aspen
#

replit doesn't support the latest version

wheat mesa
#

It doesn’t by default, but there’s some ways to trick it into getting later node versions

grim aspen
#

actually i do. the new slash commands make me lose braincells

stray seal
#

What do i do?

wheat mesa
#

The new slash commands are going to be pretty much forced by April 2022

grim aspen
#

that won't stop me

#

hopefully

stray seal
#

So.....

grim aspen
#

also don't you have @floral flarecordjs/rest as a node package?

#

oops

wheat mesa
#

This ^^^

wheat mesa
#

Don’t worry about that rn

stray seal
#

@solemn latch here:

Ready!
#

That the Console says

solemn latch
#

not a ratelimit then

stray seal
solemn latch
grim aspen
#

Wait I saw something about line 600 or something

stray seal
# solemn latch read this <@!824377837162070016>

Can you answer this?

I have been running the same code for 2 months. I finally desided to upload to topgg. I uploaded it for review, and the bot went offline. No biggy, i turned it back on. Then, today my friend wanted to see it, ran the prefix (c!) and nothing was happening. I went inside the replit to see what the errors were, and there was none. I desided to restart the code, so i hit "run" to turn it off, then "run" to turn it on. After this, that is when i got all these errors.

#
discord.errors.HTTPException: 429 Too Many Requests (error code: 0): You are being blocked from accessing our API temporarily due to exceeding our rate limits frequently. Please read our docs at https://discord.com/developers/docs/topics/rate-limits to prevent this moving forward.
grim aspen
#

429

stray seal
#

From the log.

grim aspen
#

So you were probably unratelimited

stray seal
grim aspen
#

Like the rate limit was lifted

vivid fulcrum
#

you did too many actions too quickly and got ratelimited

#

you likely caused an API ban

grim aspen
#

Check your code

stray seal
#

I can send all the code, if y'all would like.

grim aspen
#

You might’ve overlooked something

wheat mesa
stray seal
wheat mesa
#

From what it looks like you’ve been api banned

#

Too many requests

#

(Temporarily at least)

stray seal
hybrid cargo
stray seal
hybrid cargo
stray seal
#

My code.

hybrid cargo
#

You dont get ratelimited for no reason

stray seal
earnest phoenix
#

i want to make website like top.gg

wheat mesa
#

Ew dpy

earnest phoenix
#

not exct same

stray seal
#

@earnest phoenix DM me.

earnest phoenix
stray seal
#

@hybrid cargo, i dont think it is ratelimit, we ran a code a there is no errors on the code. It logged right in

earnest phoenix
#

i want to make website like top.gg
not exct same how to make

solemn latch
stray seal
solemn latch
#

429 is ALWAYS a ratelimit

grim aspen
#

The thing is you were. You got your rate limit lifted

hybrid cargo
#

Ur error message clearly states you have exceeded the rate limits

solemn latch
stray seal
#

How do i fix this then?

#

I am getting a lot of angry people

wheat mesa
#

Frequently hitting more than 120 requests per second

wheat mesa
#

Interesting

hybrid cargo
# stray seal How do i fix this then?

well, first u gotta wait till u get unblocked. second find which code of urs sends multiple requests. Or find if ur bot is running on multiple instances

stray seal
#

I never had this issue on my other bot (Demox), and it has THOUSANDS of lines of code...

hybrid cargo
#

Welp... i have no idea since

solemn latch
#

lines of code is not the number of api requests

hybrid cargo
#

code lines doesnt necessarily mean that it should hit ratelimit

stray seal
#

@solemn latch look at this:
I said "Can i see you code?" (to that kid)
They said "I cannot show you, as it is private. I want this like top.gg."
HAHA

stray seal
#

Let me see if my team can find the issue

#

Is there a way to find out how long until i am unblocked?

solemn latch
#

are you still getting the error?

stray seal
#

Yes, still getting the error

solemn latch
#

is it as soon as the bot starts?

#

do you have a cooldown system, and/or logs?

stray seal
stray seal
wheat mesa
solemn latch
#

for example, if someone runs a command 3 times in a few seconds does your bot stop them from running more?

#

someone easily can just spam your bot with commands until it hits ratelimits if you dont

stray seal
solemn latch
#

possibly it then

stray seal
#

It is in 3 servers ATM

#

All servers i am in

solemn latch
#

are you spamming presence changes?

stray seal
#

My test server, the Bot Emoji Server, and the Main

solemn latch
#

or spamming anything on startup

stray seal
#

Nope

#

I hit "run" then i watch the code run

#

Because it is cool

solemn latch
#

are you sending messages on startup?

stray seal
solemn latch
#

does py have a ready event?
do some basic logs during it to see if it runs

stray seal
#

I start sending 3 minutes after i see the Bot Info (how many servers it is in, members, etc. I have it showing in the Console lol).

wheat mesa
#

py definitely has a ready event

stray seal
#

I dont have a shard ID

solemn latch
#

hmm?

#

neither of the links i sent involve shards

stray seal
#

discord.on_shard_ready(shard_id)
Similar to on_ready() except used by AutoShardedClient to denote when a particular shard ID has become ready.

Parameters
shard_id (int) – The shard ID that is ready.

solemn latch
#

your in the wrong section

#

on_ready, not on_shard_ready

stray seal
#

ok

solemn latch
#

you already use the ready event anyway.

@bot.event
async def on_ready():
    await bot.change_presence(activity=discord.Game(name='c! | https://servercleaner.deathjones.repl.co', url='https://www.twitch.tv/discord'))
    DiscordComponents(bot)
    print('Server Cleaner Is Ready!')
    print(len(bot.users), " Members")
    print(len(bot.guilds), "Server/s")
#

is all that logging?

stray seal
#

Yes

#

The bot is up

grim aspen
solemn latch
#

yep

grim aspen
#

figured

#

i wonder if some data was not cached

stray seal
#

Thanks!!

solemn latch
#

👀

#

that wasnt supposed to be a fix

stray seal
#

lol

solemn latch
#

probably just needed to restart your bot

stray seal
#

ok

#

brb

wheat mesa
#

Off topic, but turns out making my own recursive version of Math.pow in Java is 5x faster than the built in Math.pow

solemn latch
wheat mesa
#

Interesting

stray seal
#

Yeah, it worked

wheat mesa
#

Probably because it takes the power as a double whereas mine takes it as an int

rich copper
#

I have a problem can anyone help
actually I have created a game in discord.py tic tac toe
when i play for second time it is not responding can anyone help

wheat mesa
#

Because mine can’t calculate powers that aren’t whole numbers

#

Either that or I’m benchmarking it completely wrong

wheat mesa
#

Literally running 10^4 1 billion times and comparing how long it takes

#

My function takes 4000ms whereas Math.pow is taking 19000ms

wheat mesa
#

Your bot could be not responding for a billion different reasons

solemn latch
#

Also I dont think a ton of py devs are on right now.

wheat mesa
#

Yeah

#

Especially after the death of dpy

solemn latch
#

the python server might be more helpful

wheat mesa
#

Well, “death” of dpy

solemn latch
#

what happened to dpy?

rich copper
#

ok

#

thanks

grim aspen
#

they discontinued the d.py package

solemn latch
#

ah

wheat mesa
#

Yeah

rich copper
wheat mesa
#

People have made their own forks and stuff

rich copper
#

Thats why

solemn latch
#

any other python packages?

wheat mesa
#

There’s probably a different library

solemn latch
#

ah

wheat mesa
#

That people are swapping to

#

Since dpy will no longer support new features

solemn latch
#

imagine djs dies 👀

wheat mesa
#

The world would be saved

grim aspen
#

then i would be screwed

rose warren
#

Tim would save us

solemn latch
#

tbh probably would be good for js devs long run.

grim aspen
#

although it would save me my braincells

wheat mesa
#

Probably

solemn latch
#

tims new lib would actually save us

wheat mesa
#

It would give more attention to the smaller libs with really good features

grim aspen
#

you know what, i should make my own discord package for a different programming language

solemn latch
#

c# needs a new one from what ive heard

grim aspen
#

fine

sage bobcat
wheat mesa
#

C# has a couple libraries

stray seal
#

With d.py being down for good, can i use Slash Commands?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

wheat mesa
#

I thought Remora and D#+ were good already

sage bobcat
#

One message removed from a suspended account.

grim aspen
#

what programming language doesn't have a discord package

sage bobcat
#

One message removed from a suspended account.

grim aspen
#

tf is that

sage bobcat
#

One message removed from a suspended account.

wheat mesa
#

D.net is the C# equivalent of djs though from what I’ve heard

sage bobcat
#

One message removed from a suspended account.

grim aspen
#

oh

wheat mesa
#

Fortran

#

Asm smirk

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

wheat mesa
#

F#

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

wheat mesa
#

Where’s my Scratch library

solemn latch
#

scratch has one

wheat mesa
#

Nahhhhh

#

No way

sage bobcat
#

One message removed from a suspended account.

grim aspen
#

wtf scratch?

solemn latch
wheat mesa
#

Oh

#

That’s not actually scratch though

#

That’s just block styled programming

grim aspen
#

vuejs?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

solemn latch
#

its scratch based isnt it? as scratch is open source

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

wheat mesa
#

Brainfuck

quartz kindle
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

stray seal
wheat mesa
#

Oh god

solemn latch
#

no its not good

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

grim aspen
#

i can't believe someone coded that

sage bobcat
#

One message removed from a suspended account.

solemn latch
#

do i try? lel

quartz kindle
#

anyone made a bot in lolcode?

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

would be fun

sage bobcat
#

One message removed from a suspended account.

wheat mesa
#

What about Moo

solemn latch
#

moo 😠

quartz kindle
#

you can probably import c++ libs in lolcode

wheat mesa
#

C++ is a brainfuck enough in itself I don’t need some sort of abstraction on top of that

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

grim aspen
#

imma become a zig package developer

sage bobcat
#

One message removed from a suspended account.

wheat mesa
#

Get paid that hefty salary of $0 per year

#

💪

sage bobcat
#

One message removed from a suspended account.

grim aspen
#

no

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

grim aspen
#

let's see how far i can get

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

grim aspen
#

too late

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

I am sorry for your eyes

function isTriangle(a,b,c)
{
   return a + b + c > 0 && !(a >= b + c || b >= a + c || c >= a + b);
}
quartz kindle
#

nice

earnest phoenix
#

i want to maake website like top.gg

earnest phoenix
#

I suggest starting with JavaScript

#

downhill learning curve

#

i lnow html

#

know

earnest phoenix
#

what is a tag

#

for what

opaque seal
earnest phoenix
#

because my computer class never taught us in the entire 1.2 years i went there

earnest phoenix
earnest phoenix
earnest phoenix
grim aspen
# sage bobcat One message removed from a suspended account.

Zig packages are just Zig source trees, requiring a root file.
Packages are imported with @import("package-name") without the .zig extension.
Packages have the same visibility rules as other source files, they just don't need to be in a relative directory to your own source tree.
Each package has their own dependencies, so packages might use a same-named package that is backed by different source files.

#

got that from documentation

earnest phoenix
#

use your html skills to make a website like top.gg

#

¯_(ツ)_/¯

#

but whayt about api

#

watcher

#

login

#

@earnest phoenix

#

you need to learn backend for that

grim aspen
#

🤔

earnest phoenix
#

im very new

#

backend = stuff that runs behind the scenes on the server

#

frontend = your website

lyric mountain
#

but nice job

earnest phoenix
#

hi kuuhaku

#

you came just in time for another cursed code block of mine

#

should I do the honours?

lyric mountain
#

aw shit here we go again

earnest phoenix
lyric mountain
#

nah, that's mild

earnest phoenix
lyric mountain
#

mostly unformatted, but still mild

#

isn't <Array>.sum() a thing in js?

earnest phoenix
#

well i think it's time to send a screenshot of a chakra ui button

#

brb

sage bobcat
#

One message removed from a suspended account.

lyric mountain
#

isn't it %b?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
lyric mountain
#

idk if java has it too

#

never tried to print a raw boolean

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

lyric mountain
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

lyric mountain
#

you cant directly print a boolean in c?

sage bobcat
#

One message removed from a suspended account.

next rain
#

Question for the bot devs, are you able to import tables from websites that contain data and put them into channels ?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

grim aspen
#

come onnnnn

#

give up, you aren't getting anywhere with doing that

sage bobcat
grim aspen
#

i am, but i am a little confused by 'source trees'

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

sage bobcat
old cliff
sage bobcat
#

One message removed from a suspended account.

old cliff
#

But its easier to use an api

sage bobcat
#

One message removed from a suspended account.

old cliff
sage bobcat
#

One message removed from a suspended account.

lyric mountain
#

ic

sage bobcat
#

One message removed from a suspended account.

next rain
sage bobcat
#

One message removed from a suspended account.

next rain
#

that'll import the data?

old cliff
#

What exactly?

next rain
#

can I PM ? would that be easier?

old cliff
#

Nope

lyric mountain
#

after I discovered C doesn't have an easy way of getting epoch millis I don't get impressed on how raw C is anymore

next rain
#

its from a website

#

but I want to import the data into a discord channel

#

it regularly updates & refreshes data at certain time periods

lyric mountain
#

do they have an api?

old cliff
next rain
grim aspen
#

you know what screw it, my feeble brain doesn't do well with zig

next rain
old cliff
#

Then learn that first if you want to make it by your own

next rain
#

I wouldn't mind paying someone tbf

rose warren
livid jackalBOT
#

@next rain

You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.

grim aspen
#

i know a couple companies that teach programming

rose warren
#

Wouldn't recommend paying anyone on Discord. That usually ends badly.

#

Use one of the sites above.

lyric mountain
#

codeacademy, udemy, w3schools, mozilla, baeldung

grim aspen
#

do not start with me

next rain
stray seal
#

I got ghost pinged...

lyric mountain
rose warren
boreal iron
#

I heard the Indian tech support is a good choice. Totally no scam at all.