#development

1 messages · Page 1737 of 1

lavish bramble
#

What does this means?

sudden geyser
#

It means the API request was canceled.

#

I think Discord.js will cancel a request after a certain period of inactivity.

odd stratus
lavish bramble
#

Oki

broken matrix
#

How would i make a button on a website kick a member of my server?

#

Im very confused

lyric mountain
#

bind the buttom to the user object, when pressed send a request to the bot to make it kick the user by id

cinder patio
#

How can I turn an iterator to a slice in rust

vivid fulcrum
#

so you'd have something like

cinder patio
vivid fulcrum
# vivid fulcrum so you'd have something like

client makes DELETE request to your API (i.e. DELETE /api/kick/:guildId/:userId) -> your API extracts the user id and the guild id -> your API makes a request to discord with those params -> your API returns the status of the discord request

subtle river
#

no errors, it just doesn't register the &joinevent command when &startevent rps is run

dusky sundial
#

Nothing at all? Not even if you print something at the very start of the command?

subtle river
#

uhh

#

let me try that

#

hold on

#

@dusky sundial not even when I print something

#

hm

modest maple
#

this code is a yikes

#

lets go over a few things that are wrong

broken matrix
#

also im making this joke command to kick this one user in the server. idk how to make it only kick him

#
const data = fs.readFileSync('unti.json');
const user = JSON.parse(data);

  await user.kick();
#

thats part of the code

#

in the json

#
{
    "user": "196381315967352834"
}
modest maple
#
  1. await client.send_message(user, "Please select R, P, or S.") outdated code, this was changed 3 years ago
  2. context.send(f"{user} lost due to disqualification! Game Over!") this isnt awaited
  3. time.sleep(1) this will stop the entire bot not just the command, you need to use await asyncio.sleep(n)
  4. JSON is not meant to be used like this, please dont use it like a db, use SQLite at the least
#

@subtle river

subtle river
#

ah

#

thank you for the help

#

sorry

#

I am rather new

modest maple
#

oh and also response = client.wait_for("I'm waiting!", check=check) isnt awaited

subtle river
#

@modest maple how do I do #1 in the newest version? I got it from stackexchange

modest maple
#

await context.send

subtle river
#

...

#

I'm trying to DM

#

someone

modest maple
#

dont use stack overflow or anything similar for bots

#

yes and?

#

if you're trying to dm someone it's await user.send

subtle river
#

oh okay

#

thanks

modest maple
#

what's happening with your command is you run the first command and then deadlock your bot

subtle river
#

I'm still getting deadlocked @modest maple

modest maple
#

probably

broken matrix
#

i got this now

    let member = message.guild.members.fetch("196381315967352834");
    member.kick().then((member) => {
        const embed = new MessageEmbed()
        .setTitle('Kick Unti')
        .setDescription(`unti was kicked.`)
        .addField('Member', message.member, true)
        .setFooter('funny kick unti')
        .setTimestamp()
        .setColor(message.guild.me.displayHexColor);
      message.channel.send(embed);
    })
  "stack": "TypeError: member.kick is not a function
vivid fulcrum
#

fetch is a promise

tacit sequoia
#

Await it

broken matrix
tacit sequoia
#

await message.guild.members.fetch(......)?

broken matrix
#
  "stack": "ReferenceError: member is not defined
tacit sequoia
#

Then member isnt defined?

#

You have to show us something other than an error

broken matrix
#
     await message.guild.members.fetch("196381315967352834");
    member.kick().then((members) => {
        const embed = new MessageEmbed()
        .setTitle('Kick Unti')
        .setDescription(`unti was kicked.`)
        .addField('Member', message.member, true)
        .setFooter('funny kick unti')
        .setTimestamp()
        .setColor(message.guild.me.displayHexColor);
      message.channel.send(embed);
vivid fulcrum
#

well you didn't define member

#

you're doing the fetch but aren't storing it anywhere

#

so, it doesn't exist

tacit sequoia
broken matrix
vivid fulcrum
#

no

#

lol

#

literally just store the result of the fetch

tacit sequoia
#

Rn members is not defined

#

So define it with the results

vivid fulcrum
#

you really need to learn js, or rather how to think logically

tacit sequoia
#

Why are you trying to send message.member, an obj, as a field?

#

And message.member will be the author of the kick command, not the user kicked

broken matrix
#

the whole point of the command is a joke

#

its supposed to kick this 1 user in the server

#

when anyone runs it

vivid fulcrum
tacit sequoia
#

Ahhhh

tacit sequoia
broken matrix
#

yes

#

ik

#

Im trying to make it kick this one member

#

wait i fixed it

#

thank you all for the help tho

earnest phoenix
umbral zealot
#

Not JSON again!

earnest phoenix
#

but the way they thought thats user object ahahah

umbral zealot
#

That makes it even worse, but already using JSON is such a faux pas

earnest phoenix
#

hey json isnt bad?!

#

DONT tell me you DONT use JSON?

umbral zealot
#

As a database it's fucking horrible.

earnest phoenix
#

oh yeah

umbral zealot
#

Oh you're being sarcastic. got it.

earnest phoenix
#

yeh anyway

#

at some point i used ini as database

#

cant speak much here personally ahah

proven lantern
#

binary encoded json is good for databases

#

bson

earnest phoenix
#

why would u do that

proven lantern
#

mongodb did it

earnest phoenix
#

if you feel old fashioned use sqlite

umbral zealot
#

you can do json files as storage, but noobs don't do it right. They're not doing atomic reads and writes and conflict resolutions.

#

nedb does it fine. I've seen some modules that did it using external fs modules that properly do atomic IO actions. But most... they just "fs.readfile" like cavemen trying to rub 2 sticks together next to a natural gas vent.

earnest phoenix
#

but why would you need to use json as storage out of all the options

umbral zealot
#

"it's easier"
"I just want to learn"
"I don't understand sql"
"Databases are too complicated"
"I'm just testing!"

earnest phoenix
#

@solemn latch you made me wait solid 9 seconds to hear your side on that

solemn latch
#

I didnt mean to type here KEKW

earnest phoenix
#

you owe me 9 seconds

solemn latch
#

json db is bad mky, if someone needs help with a json db, then they have other priorities they should be taking on first 👀

solemn elk
#

I've got a question with requests. How do I make a body? I have this code


    r = requests.get(
        f"https://client.sweplox.net/api/userinfo?id={member.id}", headers=headers_dict)

    data = r.json()

    requests.post(
        f"https://client.sweplox.net/api/setresources?id={member.id}?ram={amt}", headers=headers_dict)

    await ctx.send(f"Added `{amt}` ram to **{member}**")

But it skips the requests.post part. I also heard that I need a "body" but I'm not sure how to do that.

umbral zealot
#

I'd wager by adding body=yourbodyhere in your post request?

#

just like you have the headers there

solemn elk
umbral zealot
#

you pass it exactly like the headers

solemn elk
#

body = {"id": member.id, "ram": amt}?

umbral zealot
#

Pretty sure it'll have to be a string though

solemn elk
#

ah yes

umbral zealot
#

No the entire body will have to be a string and not an object, I'm sure. unless python does that conversion automatically

solemn elk
#

i guess so

#
requests.post(
        f"https://client.sweplox.net/api/setresources", body={"id": str(member.id), "ram": str(amt)}, headers=headers_dict)
umbral zealot
solemn elk
#

lemme check

solemn elk
umbral zealot
#

What do you mean "just sends the message"

solemn elk
#

await ctx.send(f"Added {amt} ram to {member}")

#

it only sends this

#

but it doesnt update the data

umbral zealot
#

Ah well I don't actually know python so maybe it's a specific python thing with strings.

#

¯_(ツ)_/¯

solemn elk
#

oh

#

well

#

thank you

steep drum
#

i don't know python that well either but what do you get when you log r, data, and the result of the post?

steep drum
#

My guess is you set your views path somewhere else than where you're trying to render from

blissful coral
#

ik its messy, its compiled from ts

cosmic forum
#

Hello, may I get some feedback on my latest project? https://ad.aakhilv.me/

blissful coral
steep drum
#

i don't see where you set your view paths, for example, app.set('views', '/path/to/views');

blissful coral
#

I have a custom renderer

#

That I am using

steep drum
#

wdym?

blissful coral
#

I get the path directly

#

Shouldn't that work?

steep drum
#

that i don't know, i use pug template engine, similar to ejs i think, i haven't used ejs myself

#

and i set the views path

blissful coral
#

hm

solemn latch
#

does views even depend on the renderer?

blissful coral
#

Idk, I didn't set it when I ran it on my PC and it worked fine but on my vps it says fuck you

solemn latch
#

guessing its just linux vs windows?
try using ./ and ../ and whatnot rather than resolving a path?

blissful coral
#

I guess

#

let me try

#

with a ../

solemn latch
#

well nice woopics

#

doing a great job

#

only 10 seconds to load

blissful coral
#

Nice

#

I fixed it

#

Just by moving all the fucking pages to a view folder

#

cuz express won't let me do anything else

solemn latch
#

thats where they are supposed to be anyway when using ejs

blissful coral
#

yeah

#

could've smh

dusty axle
#

so i messed something simple up in my code I think but i have yet to sleep so I don't see my issue here:

#
@commands.command()
    async def lockall(self, ctx, channel : discord.TextChannel, time : str, *args):
        if not isinstance(ctx.channel, discord.TextChannel):
            return

        if not ctx.author.guild_permissions.administrator:
            return

        if ctx.guild.id in self.locked_channels:
            await self.bot.message_handler.send_message(ctx.channel, 'lockall_already', author=ctx.author)
            return
    
        time = time.lower()
        if not time[-1:] in Moderation.MUTE_MULTIPLIERS:
            await self.bot.message_handler.send_message(ctx.channel, 'lockall_badtime', user=member.mention, author=ctx.author) 
            return

        try:
            time_converted = int(time[:-1])
        except ValueError:
            await self.bot.message_handler.send_message(ctx.channel, 'lockall_invalid_number', author=ctx.author)
            return

        time_converted = time_converted * (Moderation.MUTE_MULTIPLIERS[time[-1:]])

        everyone_role_perms = ctx.guild.default_role.permissions
        everyone_role_perms.send_messages = False
        await ctx.guild.default_role.edit(permissions=everyone_role_perms)

        await self.add_locked_channel(ctx.guild, channel, time_converted)
        await self.bot.message_handler.send_message(ctx.channel, 'lockall_success', author=ctx.author, time=time)
        await self.bot.message_handler.send_message(channel, 'lockall_start', reason= ' '.join(args))
#

if anyone can see what i messed up lmk

#

pretty much lockall should only have a time value needed not a [Channel] & [Reason]
thanks ❤️

#

(I think its in the beginning but brain is dead atm)

sudden geyser
#

For steps 1 and 2, you should state that the tag needs to be in the tree (e.g. <head>) as opposed to words like "between" and "before the closing body tag.

blissful coral
#

discord.js client base with kurasuta sharding manager

quartz kindle
#

youre trying to transfer a full guild object

#

if youre using kurasut in worker mode, which i believe is the default, workers use structured cloning algorithm to serialize objects, which is more powerful than json but has different behavior

zenith terrace
#

its the bla man

quartz kindle
#

iirc json simply ignores or stringifies functions, but structured cloning errors out on functions

blissful coral
#

so what should I do insteda?

quartz kindle
#

dont transfer the full object

#

create a normal object with the propeties you want from that guild

heady ember
#

can i ask if someone has some improvement ideas for my logo?

quartz kindle
#

or stringify/jsonify the guild

#

iirc djs classes have a .toJSON() method

heady ember
#

noone said no, so i think its a yes 😄

sudden geyser
#

Twirp?

heady ember
#

yeee~

#

my bot

sudden geyser
#

I thought that said Turbo for a second

#

My eyes disappoint me

heady ember
#

looks good?

blissful coral
#

Finally I figured it out

#

Thx @quartz kindle

sudden geyser
#

Looks good

#

Though more spacing between the bird and the p would look better

heady ember
#

oke

#

ill try more space

#

better?

blissful coral
#

Actually, @quartz kindle... I am using the .toJSON() but I later on have to call roles#cache# in places from the guild object and I can't do that with toJSON() is there a work around for this?

sudden geyser
heady ember
#

thx 🙂

cosmic forum
sudden geyser
#

I'd suggest you let it default to the background by applying no background color (usually white), or make it some cool color that won't hurt the eyes.

cosmic forum
#

Ok, sure

sudden geyser
#

I don't mind the inline code being in red like head

dusty axle
#

cool color gradients look good too imo

sudden geyser
#

Try allowing the text to default to its preferred color (e.g. black). And instead of surrounding the inline code with a red background, remove the background and make that text red

cosmic forum
#

Ah ok

unreal kiln
#

is anyone good with py.

#

when i do for exemple !give @eager lake 9999999 it does not say anything but when i do !give @eager lake it says you have to specify the amout of coins you want to give

#

how do i fix that

dusky sundial
#

Hard to say without seeing your code

unreal kiln
#

@dusky sundial here is my give command code its just the give that is the issue

deep mantle
#

The return isn't in the if statement

#

So if it isn't equal to None it returns

dusky sundial
#

You need to indent your returns

unreal kiln
#

now it gives this

dusky sundial
#

There's still a return that isn't indented

unreal kiln
#

now that stars an indent/undent game

dusky sundial
#

what?

unreal kiln
earnest phoenix
unreal kiln
#

now it says i got this i was reformaint it like the video

quiet pawn
#

i cant figure out how to get my top.gg widget to only show server count

#

everytime i change the size nothing happens

dusky sundial
drifting shell
#

can you get a users online status without the presence intent?

twilit hemlock
#

Uninstall something in terminal?

#

I have all this

#

She’ll

#

Missing

unreal kiln
#

For coding

pearl trail
# twilit hemlock

try removing node_modules from your github because we don't need it. everytime you deploy your app to heroku, heroku will install all the modules in your package.json

twilit hemlock
#

Ok

#

I’ll see

#

How do you remove

#

I’m on GitHub app on phone

#

Nvm I see

pearl trail
#

oh, i don't think you can delete files through phone. need pc to delete all the node modules and commit it

twilit hemlock
#

I deleted directory

pearl trail
#

use .gitignore to ignore the node modules

#

oh

twilit hemlock
#

Or if I actually would delete

#

Sec

#

That good?

pearl trail
#

ah yes

#

now try to deploy again

twilit hemlock
#

Ok

#
  • Node version not specified in package.json
pearl trail
#

wait,

#

do you have "engines" inside your package.json?

twilit hemlock
#

uh

#

yea

#

sorry for late asnwer @pearl trail

#

waut

#

ni

pearl trail
#

i didn't see engine there. try adding

"engines": {
"node": "14.15.1"
}

after dependencies

deep mantle
ember dragon
#

hi i am trying to get my bot back online, and i had help with it a few hours ago and it does not seem to be working, can someone help

regal jacinth
#

Hi, how can i access the API in python so i can keep track of the number of votes of each person and when they can vote again ?

deep mantle
#

Why will it not go online

ember dragon
#

i cant get it online, i had the stuff right hours ago and it wont come online idk what i did wrong

#

i am doing node index but

#

PS C:\Users\hoove\Neos> node index
internal/modules/cjs/loader.js:883
throw err;
^

Error: Cannot find module 'C:\Users\hoove\Neos\index'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

#

@deep mantle thats whats happeining

deep mantle
#

I'm a python coder I can't help you sorry

ember dragon
#

oh

long crow
#

What the error say quite clear though. It cannot find the index.js

#

You sure on right folder

ember dragon
#

it was working fine hours ago

cedar crow
#

can someone help me with this error

ember dragon
#

i don't get why it would just stop working

earnest phoenix
#

who can help me

#

plz

#

I want to put the message clearly

#

Try just putting one of those special quotes instead of 3

#

I dont think you can format the msg the way ur trying to using three of them

twilit geode
earnest phoenix
#

oh k

#

ty

twilit geode
#

duh

earnest phoenix
#

it just \n

#

or

twilit geode
#

yes

earnest phoenix
#

the thing

#

``

twilit geode
#

in the string

earnest phoenix
#

k

#

ty man

twilit geode
#

wait who tf uses single quotes for strings

#

ew

earnest phoenix
#

....

#

?

twilit geode
#

"" is string
'' is character
`` is javascript hurts my head and java or any C language is better change my mind oh wait you cant

earnest phoenix
#

If I have an announce command, which posts announcements to the mentioned channel, would i need any permissions for that other than checking if the member can send messages in that channel

ember dragon
#

Finally got my bot online.

oak nymph
#

So I'm getting this error whenever someone reacts to the message in my reaction role command, how do i fix it? its working in my tester bot but not in my main bot :/, Here's the code where the error is coming : ```py
@client.event
async def on_raw_reaction_add(payload):

if payload.member.bot:
    pass

else:
    with open('reactrole.json') as react_file:
        data = json.load(react_file)
        for x in data:
            if x['emoji'] == payload.emoji.name:
                role = discord.utils.get(client.get_guild(
                    payload.guild_id).roles, id=x['role_id'])

                await payload.member.add_roles(role)

@client.event
async def on_raw_reaction_remove(payload):

with open('reactrole.json') as react_file:
    data = json.load(react_file)
    for x in data:
        if x['emoji'] == payload.emoji.name:
            role = discord.utils.get(client.get_guild(
                payload.guild_id).roles, id=x['role_id'])

            
            await client.get_guild(payload.guild_id).get_member(payload.user_id).remove_roles(role)```
lament rock
# twilit geode "" is string '' is character `` is javascript hurts my head and java or any C la...

", ' and ` all delimit strings in JavaScript with ` allowing for template strings. Single quotes are used internally for most strings and only uses double quotes when a single quote is included in the string.

JS makes little distinction between string delimiters with ` being the only exception, leaving the quote choice to be user preference. Discriminating against user preference is what's disgusting.

long crow
#

Lol, what the point bashing other prefered languange of programming?

#

Maybe just want some heated argument ig

ember dragon
#

lol

#

Whats wrong with this

lament rock
#

you should be putting that data in the .env file.

For future reference if something like that happens and you're certain you want that JSON in your code, you need to initialize it to a variable name

ember dragon
#

the .env file is where the bot token is

earnest phoenix
#

I use a json file

#

If you copy paste that into a json file and then require it in bot.js like this:

const { prefix } = require('JSON FILE')

Itll work

ember dragon
#

this is what the thing shows to do

#

{
"prefix": "!",
"token": "your-token-goes-here"
}

pale vessel
#

Yes, in another file

ember dragon
#

what another file

tacit jay
#

create config.json file

tacit jay
ember dragon
#

i did

tacit jay
#

const { prefix, token } = require('config.json');

pale vessel
ember dragon
#

well where does it go then

earnest phoenix
#

In a json file

tacit jay
#

lol

#

u need 2 files: index.js and config.json

#

or bot.js

#

like u want

ember dragon
#

i am using discord.js guide for it

tacit jay
earnest phoenix
#
  1. Create a file named config.json

  2. Paste the following into the json file:

{
"prefix": "!",
"token": "YOUR TOKEN"
}

  1. In bot.js, paste this at the top:

const { prefix, token } = require('config.json')

pale vessel
#

Trailing comma

earnest phoenix
#

Whats a trailing comma

pale vessel
#

Last property shouldn't have a comma after the value

#

It wouldn't be a valid json

earnest phoenix
#

Oh right

#

Yea dont put a comma at the end of the token thing

#

Thx for lmk

earnest phoenix
#

Can bash files use environment variables on replit?

rocky hearth
#

For frameworks like react or nextjs, why do we need to specify a root element like,

<div id='root'></div>
#

why dont we just select the body element, this will save a extra div element too.

#

like this

ReactDOM.render(App, document.body);
vivid fulcrum
pale vessel
#

lmao that card

quartz kindle
#

and only return the final result

tepid agate
#

why if I split some code into different folder why doesn't discord.js detect it

woeful pike
#

what does discord.js have to do with reading commands from folders

#

you don't tell your code to look for folders so it doesn't do that

vivid fulcrum
#

also

#

please

#

what's the point of using a map

#

when you're doing if else

woeful pike
#

lol

vivid fulcrum
#

the command variable is right there

#

the product of copypasta

woeful pike
#

this would be a good time to stop trying to write code and start trying to understand the code you've copied

sacred juniper
#

Can i use CSS for top.gg bacground

#

So ishould write on Bacground URL

#

Right?

zenith terrace
#

long desc

rocky moon
#

cant ping in footer?

clear marlin
#

nah

drowsy epoch
#

Is is possible to integrate a discord bot with statuspage.io so if the bot goes online it will show down time there?

vivid fulcrum
#

i mean, they have an API so of course

clear marlin
#

it can't find the message

#

thus "UNKNOWN MESSAGE"

vivid fulcrum
#

what's your code

pale vessel
#

o

#

thought someone posted a random code

vivid fulcrum
#

why are you using async but not awaiting ur promises

#

nvm

#

not await delete() to not block i guess

#

could it be that fetch is pulling from cache

#

lol

#

sec

#

it doesn't seem to be pulling from cache

#

oh

#

right

#

your problem is that, since you're not awaiting message.delete();

#

the code won't wait for it to complete

#

and it fetches the message that you're deleting with delete();

#

and passes it to bulkDelete

#

but at that point it doesn't exist anymore

#

so just await the message.delete();

clear marlin
prime mist
eternal osprey
#
client.on('messageReactionAdd', (reaction, user) => {
        if(user.id !== memberfirst){
            return 0;
        }
        if (reaction.emoji.name === "\u0031\uFE0F\u20E3" && m[0] == easy.results[0].correct_answer){
            message.channel.send("**Congratulations! You have answered this question right!**")
            s.delete({ timeout: 5000 })
            return 0;
        }
        else if (reaction.emoji.name === "\u0031\uFE0F\u20E3" && m[0] !== easy.results[0].correct_answer){
            message.channel.send("**You have guessed wrong... sorry!**")
            s.delete({ timeout: 5000 })
            return 0;
        }
        if (reaction.emoji.name === "\u0032\uFE0F\u20E3"  && m[1] == easy.results[0].correct_answer){
            message.channel.send("**Congratulations! You have answered this question right!**")
            s.delete({ timeout: 5000 })
            return 0;
        }
        else if (reaction.emoji.name === "\u0032\uFE0F\u20E3" && m[1] !== easy.results[0].correct_answer){
            message.channel.send("**You have guessed wrong... sorry!**")
            s.delete({ timeout: 5000 })
            return 0;
        }
    })```
does anyone know why my bot says "You have guessed wrong... sorry!" 2x after one answer?
#

while i just reacted to 1 emoji

#

please ping me if anyone knows what i am doing wrong here

rocky hearth
#

"2x after one answer" - what does this mean?

#

also you dont require the elses, if you're immediately returning form the function

cinder patio
#

that code can be boiled down to 2-3 lines

drowsy epoch
cinder patio
#
const emojis = {"\u0031\uFE0F\u20E3": 0, "\u0032\uFE0F\u20E3": 1};
if (reaction.emoji.name in emojis && m[emojis[reaction.emoji.name]] === correct_answer) {
   // Use answered correctly
} else {
   // User did not answer correctly
}
pale vessel
#

nerd

scarlet geyser
#

lol

tardy hornet
#

in quick.db, i use db.set to add items to user's inventories, how can i make that they could get more than one of the item's and that in the inventory it wont just be true or false, but the number of items

eternal osprey
#

like why does it have : 0 and : 1 after it?

umbral zealot
#

Why not just put 1 instead of true? I feel like this is exceedingly straightforward

tardy hornet
#

yes and then how can i see how many i got?

umbral zealot
#

get the value

#

and if you want to add more items, then you need to get the current value, add 1, then set it back

tardy hornet
#

but i dont know how to make it to show the amount

umbral zealot
#
db.get(`jet_${message.member.id}`)
#

This gets you the number

#

you can compare it with another number using normal math operations. >, <, >=. <=, etc

eternal osprey
#

this is what happens with my current code

cinder patio
# eternal osprey yah but i don't even get how this works tbh.

emojis is an object, \u0031\uFE0F\u20E3 is the unicode representation for 1️⃣ , so it's value is 0 (the first element in the array of answers), "\u0032\uFE0F\u20E3" is the unicode value for 2️⃣ , so it's index is 1 (second value in the array of answers).

This way by doing emojis[reaction.emoji.name you can get which answer they chose easily, and then compare it to the correct answer

eternal osprey
#

hmm alright

#

i just figured that i can use a reaction collector instead of a messagereaction event

#

that will save me lots of codes

cinder patio
#

You can also use awaitReactions, probably the bast way to do it

eternal osprey
#

hmm yeah

tardy hornet
umbral zealot
#

noice

tardy hornet
#

look

#

if its 0 its showing null

umbral zealot
#

What do you mean showing null

tardy hornet
#

how can i make that if its null it will say 0

tardy hornet
umbral zealot
#

Oh maybe you need to add some parentheses to tell JS that it's name + (item or 0) instead of (name + item) or 0

#

basically just like math, there's order of operation in javascript

#

so you have to do stringinventory += name + (db get || 0)

olive hearth
#

naww

rocky dagger
#

i have a code and i want to get the cmdUsage out of every command module but when i run this i just get undefined```js
const fs = require('fs').promises;
const path = require('path');
let cmdName = [];
let cmdModule = [];

module.exports = {
run: (client, message, args, getUserFromMention, Discord, logsID) => {

(async function registerCommands(dir = '../../commands') {

  const files = await fs.readdir(path.join(__dirname, dir));

  for(let file of files) {
    const stat = await fs.lstat(path.join(__dirname, dir, file));
    if(stat.isDirectory()) {
      registerCommands(path.join(dir, file));
    } else {
      if(file.endsWith('.js')) {
        cmdName.push(file.substring(0, file.indexOf('.js')));
        cmdModule.push(require(path.join(__dirname, dir, file)));
        console.log(cmdModule.cmdUsage);
      }
    }
  }
})()

},
description: 'help command',
cmdUsage: 'help'
}```

vivid fulcrum
#

wtf

olive hearth
#

if stringinventory is 0 return null, otherwise return stringinventory

#

@rocky dagger probably because you're not declaring .cmdUsage anywhere.

#

Not that i can see at least lol

#

just console.log(cmdModule) and see what the possible properties are.

olive hearth
#

Just do:
if (stringInventory==null) stringInventory = 0;

umbral zealot
#

I mean... the solution I gave was fine

#

what you're saying is seriously lame tbh 😛

#

I mean the code specifically

rocky dagger
olive hearth
#

Well, one: rude
Two: again, i misunderstood the question. Therefore your response didn't make sense.

#

Now it does, so i just look like a jackass.

#

Which is fine its my thing anyway. 💅

umbral zealot
rocky dagger
#
module.exports = {
  run: async(client, message) => {
    message.channel.send('Pong!');
  },
  description: 'ping command',
  cmdUsage: 'ping'
}```
#

and how did you know i had a ping cmd?

umbral zealot
#

because everyone has one

#

Ok well I don't see how this particular command would show undefined

#

are you sure you didn't forget to add cmdUsage to some other commands?

rocky dagger
#

then i would have gotten an error

umbral zealot
#

Depends. it could just literally show undefined in the output

#

because the command exists, but there would be no property called cmdUsage which would show undefined

earnest phoenix
#

Anyone has an idea of how to add permissions to my bot. I just created a bot for a server and they have an application system. They asked for a 'hold review' command and I created this ```js
client.on('message', message => {

let args = message.content.substring(prefix.length).split(" ");

switch (args[0]) {
    case 'hold':
        const holdapply = new Discord.MessageEmbed()
            .setColor('#6700a3')
            .setTitle("Apply held for review")
            .addFields(
            { name: "\u200B", value: "**Thank you for your applying process**, your request has been held to the apps team, you'll get a response if you got accepted! If you didn't get a response by 12 hours, this means you have been denied." },
            { name: "\u200B", value: "*Please don't ask if you have been accepted or denied, this will decrease your chance of getting accepted.*" },
            )
            .setImage('https://cdn.discordapp.com/attachments/784821281883291651/840186989336723456/Held_for_review.png')
        message.channel.send(holdapply);
        break;

}

})

#

I even want it to lock the chat for @every0ne when the -hold command runs

#

Thank you man

umbral zealot
vivid fulcrum
#

lol

#

stop copypasting code

rocky dagger
umbral zealot
#

But... I mean... ... that's just not possible Thonk

#

wait

#

are you sure cmdModule isn't the ARRAY?

#

can you try logging just cmdModule[0] ?

sonic basin
#

Can anybody help?

#

DO I need the server intent

#

if I have a level bot, that gets user ids, server id's

#

?

umbral zealot
#

There's no such thing as "server intents"

#

so what do you mean specifically

sonic basin
#

the members

#

yep

#

do I need it?

umbral zealot
#

Getting user and member data individually does not require member intents

#

What requires it is getting all members, or getting member events

#

Now, please note, Discord does NOT grant member intents for leaderboards.

sonic basin
#

so only getting the member and server ids and storing it on a computer, it is okay?

umbral zealot
#

Yeah, sure, that's fine

sonic basin
#

okay

#

thanks

#

so I mean that, if somebody sends a message, then it writes into a document the server id, and if the person is not in the list, then adds it too.

#

it's fine, right?

umbral zealot
#

Yep, that's how point bots usually work

sonic basin
#

just asking because I really don't want to get banned or something

#

ok.

#

thx

umbral zealot
sonic basin
#

I only store ids

#

and people can always ask me on the support server to remove them (idk is it makes sense)

tardy hornet
#
 if(db.fetch(`ph_${message.member.id}`, 5)) return message.channel.send("you already have a phone, you cant have 6")
#

its not working

#

i can buy only 1

#

and it sends it

tardy hornet
umbral zealot
#

if you could please not ping me for every problem that'd be great

#

I have a feeling fetch doesn't do a number comparison

#

I dunno, like, it feels like that isn't valid at all

#

So at this point I feel like you don't know JS and you're just mashing buttons

eternal osprey
#
Error: SQLITE_ERROR: near "-": syntax error
11|app  | Error: ENOENT: no such file or directory, open 'token.txt'
11|app  |     at Object.openSync (fs.js:462:3)
11|app  |     at Object.readFileSync (fs.js:364:35)
11|app  |     at Object.<anonymous> (/root/pokecards/src/app.js:10:12)
11|app  |     at Module._compile (internal/modules/cjs/loader.js:999:30)
11|app  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
11|app  |     at Module.load (internal/modules/cjs/loader.js:863:32)
11|app  |     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
11|app  |     at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
11|app  |     at Module._compile (internal/modules/cjs/loader.js:999:30)
11|app  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) {
11|app  |   errno: -2,
11|app  |   syscall: 'open',
11|app  |   code: 'ENOENT',
11|app  |   path: 'token.txt'
11|app  | }
```umm how is this possible
#

i literally have the txt in a reachable place

#

and running it on vsc worked fine

#

but on my vps it doesn't .

rocky dagger
#

i figured it out

#

i just had to add .cmdUsage at the end of cmdModule.push(require(path.join(__dirname, dir, file)));

pale vessel
#

Whatever you say man

umbral zealot
# twilit geode its still gross ¯\_(ツ)_/¯

Oh yes because ```c
printf(($"Color "g", number1 "6d,", number2 "4zd,", hex "16r2d,", float "-d.2d,", unsigned value"-3d"."l$,
"red", 123456, 89, BIN 255, 3.14, 250));

looks **much** better than \`\` of course. And so does ```java
String sf3=String.format("value is %32.12f",32.33434);

Ah yes so much cleaner and readable! Love it. kekface

slender thistle
#

What the fuck lol

vivid fulcrum
#

caveman concatenation way best /s

dusty axle
lyric mountain
#

tbf, ```java
String str = "Hello %s, your balance is %s coins and %s gems".formatted(
user.getAsMention(),
NumberFormat.getCurrencyInstance().format(atm.getCoins()),
atm.getGems()
);

is a lot more readable than
```js
let str = `Hello ${user.getAsMention()}, your balance is ${NumberFormat.getCurrencyInstance().format(atm.getCoins())} coins and ${atm.getGems()} gems`;
#

I'd not say one is better than the other, it really depends on use-case

copper cradle
#

I finally got my school's internet password

umbral zealot
#

I think it's basically personal preference, I really prefer JS template literals

copper cradle
#

I can access the router's panel lmao

#

fuck wrong channel

cinder patio
#

I like both

feral aspen
#

Does a break; in switch statements act as a return?

#

return await send() (new line) break;

cinder patio
#

in a way, yes, but only for the case block

feral aspen
#

Oh, sweet.

quartz kindle
#

break only stops the switch

#

return stops the entire function

feral aspen
#
return await send()
break;
feral aspen
quartz kindle
#

you dont need break if you return

#

you need break if you want to do something else after the switch

feral aspen
cinder patio
#
switch (1) {
   case 1: {
    console.log("1");
},
   case 2: {
   console.log("2... this executes too if you don't put a break in the previous case!");
}
}
quartz kindle
#

also return await is redundant, you dont need to await if you're returning

feral aspen
#

Alright, for sure. 👍

manic light
feral aspen
#

Thank you! 😊

earnest phoenix
#

I'm getting an error like this and part of me has too high latency do you have an idea?

manic light
#
i have 3200 server and 65 shard but im getting so much ratelimit. whats can i do ? ```
lyric mountain
#

what

crimson vapor
#

you should be using 3-4 shards not 65

#

what the fuck

earnest phoenix
#

65 Thonk

lyric mountain
#

65 shards for 3k servers?

#

you madlad

manic light
#

guys i was try 3-4 shard

lyric mountain
#

still too much

manic light
#

if i use 3-4 shard they cant use commands

#

cuz of ratelimit

lyric mountain
#

what kind of ratelimit?

manic light
#

they almost spamming..

lyric mountain
#

because most ratelimits are local not global

manic light
quartz kindle
#

you cant fix rate limits with sharding lol

lyric mountain
#

what command?

manic light
#

but when i use +60 shard

#

there is no problem like 3-4

#

shard

quartz kindle
#

you're doing something very wrong

manic light
#

ye ...

lyric mountain
#

yes, because you're suffocating so hard your poor vps that it's slowed down

earnest phoenix
manic light
#

i have 10gb ram ryzen 9 4core cpu

#

i dont think it was bad

lyric mountain
#

still

#

you need to fix the source of the problem, not bottleneck your process

#

what command was causing the ratelimit?

#

what does it do?

manic light
#

i cant figure out which one because i didnt getting ratelimit every time

#

i just see in console the user aborted a request

cinder patio
#

which commands are causing the ratelimit

quartz kindle
#

do you have any mass dm command?

lyric mountain
#

well, first of all go back to 2 shards (or 3 because disc's recommended is 1500 sv/shard)

quartz kindle
#

or something that sends a lot of messages?

dusty axle
manic light
#

i have code for dm but

#

its just sending 1 times

quartz kindle
#

listen to the rateLimit event

manic light
#

ah

quartz kindle
#

client.on("rateLimit", console.log)

manic light
#

i have another for dm

#

maybe that one

dusty axle
manic light
#

its daily rewards from webhook

lyric mountain
#

nah, that's fine

dusty axle
#

whatdo you use to access your VM btw?

lyric mountain
#

it doesn't happen too quickly to hit rtlimit

dusty axle
#

like putty, etc

lyric mountain
#

openssh

dusty axle
#

you shouldn't be maxing your resources but try mobaxterm and do the remote monitoring it will help you

earnest phoenix
quartz kindle
dusty axle
#

this is what mobaxterm shows

earnest phoenix
lyric mountain
earnest phoenix
#

and node v14.16.1

dusty axle
lyric mountain
#

ratelimit command?

dusty axle
quartz kindle
# earnest phoenix v12.5.3

v12 doesnt support stage channels, so that why it happens. just disable the debug event, or make it not log if the debug message contains "unknown type"

dusty axle
lyric mountain
#

what?

#

a simple terminal is enough for that

manic light
#

i just confuse

#

so whats i need do now

#

:D

#

getting ratelimit logs ?

cosmic forum
#

Anyone know how I can make a domain like discord.example.com redirect to a discord invite on Cloudflare?

lyric mountain
#

use CNAME

#

you still need a domain tho

lyric mountain
next ferry
#

If anyone need to count server stats on top.gg for your bot dm me i can help thumbsup

manic light
crimson vapor
#

what language @next ferry

manic light
#

maybe because that im getting on 2-3 shard

#

problems

lyric mountain
#

no

#

canvas is local, so it wouldn't create ratelimit errors

manic light
dusty axle
#

I messed something up here, it should only need a time and the command for ex. {prefix}lockall <time> but it is wanting a reason and a mentioned channel along with the time

@commands.command()
    async def lockall(self, ctx, channel : discord.TextChannel, time : str, *args):
        if not isinstance(ctx.channel, discord.TextChannel):
            return

        if not ctx.author.guild_permissions.administrator:
            return

@lockall.error
    async def lockall_error(self, ctx, error):
        if not isinstance(ctx.channel, discord.TextChannel):
            return
lyric mountain
#

is that code yours?

dusty axle
#

yeah

lyric mountain
#

really?

dusty axle
#

I can show the whole thing

#

its a bunch more lines

#

those are just the issue and error

lyric mountain
#

I mean, I know where the issue is

#

but you should too

dusty axle
#

at work rn xD

#

im a network specialist for a living so rn im trying to do Linux and than looking over at my python code going "can i just rm -rf" everything

#

so kinda at a code block I can't personally multitask or in this case "multicode"

#
async def lockall(self, ctx, channel : discord.TextChannel, time : str, *args):```
I believe its in here though just will need to look at again once home I guess
next ferry
#

@crimson vapor .js

pale vessel
#

@crimson vapor .js

crimson vapor
#

@crimson vapor .js

#

@next ferry use @top-gg/sdk and topgg-autoposter

next ferry
#

😂

#

I know i use this

#

I test your mind

#

😂

regal dove
next ferry
#

You asking for language

pale vessel
crimson vapor
#

yes so I can point you in the correct direction

next ferry
#

Oh yeah

regal dove
#

que es eso

#

:v

crimson vapor
#

uhh

regal dove
#

:'3

next ferry
#

You can help me i want to do vote required condition but 😭

crimson vapor
#

you can either fetch (they have a 15 min delay or something iirc) or you can setup a webserver using @quasi shale-gg/sdk and save votes to the database with a timestamp. Then you can fetch from the db where the timestamp is less than 12 hours ago and if its there they have voted

#

what the hell I literally typed @top-gg/sdk

zenith terrace
#

poor top

sonic basin
#

Hello!

#

I need help

crimson vapor
#

what do you need

zenith terrace
#

ice cream

crimson vapor
#

same

sonic basin
#

how can I add it to my git repo? I am using a new computer with linux

#

And I already have a repo

#

I just want to update a file

vivid fulcrum
#

it tells you

#

lol

pale vessel
#

😐

near stratus
sonic basin
#

I need this remote thing then?

sonic basin
near stratus
#

If you already have the repo created

#

Then git pull then git push

sonic basin
#

And now?

#

pls help, I'm not english

sonic basin
#

I need to do what it says?

crimson vapor
#

yes

sonic basin
#

It says this now

crimson vapor
#

do git pull

sonic basin
#

it says an error in the pull

#

can someone tell me all the commands i need to use?

#

please

#

i rlly need it

#

pls

copper cradle
#

and you're using linux??

sonic basin
#

i'm not english like i said

copper cradle
#

same

sonic basin
#

and I have no knowledge in git

#

so please help

#

I did it on my old pc

#

but for some reason it says errors

#

@crimson vapor or somebody help

crimson vapor
#

well they have unrelated histories

#

are you trying to push a different repo to yours?

sonic basin
#

no

#

I have a folder

#

that i have my bot in

#

and I just want to update my bot on github

#

I did it a lot of times

#

I only used git commit -a -m "my message" and git pull

#

it worked

#

but now idk how to use

still sky
#

add -f

crimson vapor
#

yikes

sonic basin
#

not working

#

nothing is working

#

bruh

#

please somebody a full guide

#

to which commands do i need to use

#

pls

#

after doing git pull origin master

#

please guys

#

at least in dm

#

but help me

#

I want to update it

copper cradle
#

if you already set it up then just do git pull -f

sonic basin
copper cradle
#

that looks like you either got an empty repo or u haven't set anything up

crimson vapor
#

git pull origin master -f

copper cradle
#

since you said u didn't speak english, are you trying to send data to your repo, or to download data from it

#

I know this question sounds dumb but I need to ask

copper cradle
#

there we go

#

push

#

not pull

sonic basin
#

ok

copper cradle
#

if you already made a commit u just have to push it

#

and since u already set the upstream to your repo you should be good to go

#

if u get anothet error then I can't help at all

#

because I'm busy doing some stuff

tired shard
#

so as db.push puts the item(s) i buy from my bot’s shop in my inventory... and when i want to sell whatever items i want that i have in my inventory, would I use db.pull? ping me with reply!!!! (the db is the var that is used for the const to require the quick.db package btw),
or do i use db.subtract... the buy file for buying items uses db.push

sonic basin
#

sorry lol

#

I just typed in some random text here idk why

#

so:

#

I got this error @copper cradle

copper cradle
#

git push --set-upstream origin master

sonic basin
#

with the text "origin" it did the same

copper cradle
#

you don't have to use levelbot11

sonic basin
#

i tried origin too

copper cradle
#

git push -f --set-upstream origin master

#

run this exact command

#

ffs

#

this happened because u don't know what you're doing, you already have data in the repo, use the -f flag to force the push

sonic basin
#

OHH IT DID SOMETHING

copper cradle
#

you already uploaded data to that repo, which made your local files be behind the latest commit, it's asking you to update, you only had to run git pull and that's it

sonic basin
#

ohh did it

#

thanks for the help

copper cradle
#

yet you somehow managed to end up running git pull --set-upstream...

sonic basin
#

i just needed to add the f

#

f

#

is the solution

#

🙂

copper cradle
#

no

#

the f forced the push

#

because you already had data in the repo

#

it made you loose whatever that data was

earnest phoenix
#

when you're bored so you make a calculator in react

copper cradle
#

lmao

#

I once made a stopwatch

earnest phoenix
#

cool

cinder patio
#

what's that?

eternal osprey
#

no nvm

#

is it possible to use a discordjs client and connect to it using a proxy?

rocky hearth
#

for db like firestore, how do I limit the creation of documents using firebase functions

#

I just want restrict some documents to be created on a condition from a firebase function

dusty axle
#

Can someone tell me what I messed up here for my top.gg description? the pill badge should be in red since its a warning

<dl>
<dd><code>.test</code> ╿  testing the <strong>test</strong><span class="badge badge-pill badge-warning">1 Hour Cooldown</span></dd>
</dl>
narrow fractal
dusty axle
#

I think it could be the dark vs light mode but unsure since you can't preview it

tribal raptor
#

aaand we just got nuked

rustic nova
#

Our Server currently seems to be getting raided, sorry for any Inconveniences

crimson vapor
#

made some changes

pale vessel
#

A JSON DB is a JSON DB, they say...

earnest phoenix
cinder patio
#

I prefer josh

crimson vapor
copper cradle
#

oh no

zenith terrace
pale vessel
#

who is this Jason and why do people hate him as a database?

crimson vapor
#

no clue

#

he seems like a great person

#

I was told he had short term memory loss tho

zenith terrace
#

@crimson vapor help pls ddunno how to use jason.db

crimson vapor
#

I don't understand

zenith terrace
#

DO NOT USE THIS IT WAS MADE AS A JOKE

crimson vapor
#

oh right

#

yeah people got mad at me

#

most notably Erwin and Evie

zenith terrace
#

inb4 it has 100+ downloads

crimson vapor
#

scrapers

copper cradle
#

Enable writing the file path, may cause random files to appear
lmao

crimson vapor
#

I prefer

It isn't very fast and is very memory inefficient.

copper cradle
#

inb4 somebody makes a toml database

pale vessel
#

cargo init

copper cradle
#

oh god

#

ini.db mmLol

wooden shoal
#

Does anyone have a real and working Token Gen?

#

I need it to test out my friends bot.

#

It's an Anti-Nuke

copper cradle
#

token gen?

wooden shoal
#

and he wants to see if it's bypassed by some nukers

cinder patio
copper cradle
#

uuh that's not how it works my dude

#

are you asking for bot tokens? wtf

wooden shoal
copper cradle
#

yeah don't do that

wooden shoal
#

In order to test the bot we would need to manually make 500 accounts and join them on a server

charred nest
#

self bots aren’t allowed

wooden shoal
crimson vapor
#

it is

copper cradle
wooden shoal
#

A Token Gen isn't a self bot

#

It's not something linked to an account

#

You can possibly make it a self bot

#

Anyways i'm not tryna manually make 500 accounts and I don't have a 500 member server to dispose of...

#

It's ok if I can't get one

copper cradle
#

then you're willing to manually join 500 accounts and using them to test your bot, but you're not willing to create them

charred nest
#

creating 500 accounts by using a bot is self botting & will get you banned off the platform

wooden shoal
#

Oh lord

#

Listen

copper cradle
#

inb4 they say "that's not a bot"

charred nest
wooden shoal
#

A Token Gen is a software used in cmd to automatically create discord accounts and save A LOT of time. It's not ran through discord bots.

#

This has to do with discord API, so I should prob go there.

#

Wondered is some people here had one.

charred nest
#

it’s ... still against ToS iirc. even if it’s not a bot account, that is the definition of self botting, as you’re creating a user account.

wooden shoal
#

Ok

copper cradle
#
  1. That's called an account generator
  2. Making mass accounts will just get your ip banned
  3. It's still against discord tos

Imagine this, you own a live chat service, and some random dude just starts to create 500 accounts in less than a minute, if u see no problem in that then I won't even bother

dusty axle
#

i used to have a friend that wrote self-bots and they could do token gens but bots can also do it had a friend that had his bot just connect to the clients and make them all do the same action

dusty axle
umbral zealot
#

We all know what's possible to do

#

it's just stupid to do so

#

So don't do it

dusty axle
#

yeah

#

take it from me my old acc got banned for a self bot never used one since than

wooden shoal
#

It's gonna be a pain just creating so many accounts manually

umbral zealot
#

you can't even USE Them

dusty axle
#

hey sometimes maunal pays off in the end

dusty axle
copper cradle
#

why would you need 500 accounts

dusty axle
#

they changed the library is all

umbral zealot
#

do you realise that in order to actually get many accounts to join fast you need to use selfbots?

wooden shoal
umbral zealot
#

There's better ways to test your antispam/raid bot

copper cradle
#

I did

#

but that's not a good reason to get 500 fucking accounts

modest maple
#

you also realise that basically non of us need need that many accounts TO TEST A BOT

#

you need like 1 ALT MAX

#

hell i dont even need 1 alt

wooden shoal
#

My friend developed an anti-nuke bot, we're gonna test how good it is against the best nukers.

umbral zealot
#

Hold up guys stop getting triggered and let's help them instead

wooden shoal
copper cradle
#

I smell something sketchy behind all of this

umbral zealot
#

What library are you using to make your bot?

dusty axle
modest maple
#

making a anti-nuke bot by nuking mmLol

wooden shoal
#

There's some nuke bots that can ban 500 people a sec.

wooden shoal
umbral zealot
#

Ok good

#

So instead of creating 500 accounts

#

All you need to do is to PRETEND they joined

wooden shoal
#

This ain't no anti-spam.

dusty axle
#

i literally have coded my bot as one...

umbral zealot
#

using client.emit('guildMemberAdd', { some fake user here })

#

there. Problem solved.

#

You can now test the bot

dusty axle
#

ah my b i thought you said anti-spam

umbral zealot
#

and not actually affect anything

copper cradle
#

put that shit in a for loop and you're good to go

umbral zealot
#

yep

#

Add timeouts to simulate slower joins

#

use a for i loop to specify how many

#

you can also simulate the message event in the same way

#

super easy. barely an inconvenience.

wooden shoal
#

I'm not simulating joins, I have to simulate bans, and good nuker bans a lot a second, and his bots reputation will be bad if it's bypassable.

#

Simulating one ban wont help either.

umbral zealot
#

what do you mean "simulate bans"

dusty axle
umbral zealot
#

You can ban users as fast as the global rate limits will allow IIRC, which is like 50/s

#

You can't make this faster, so, what's the point of simulating this?

dusty axle
copper cradle
#

what

#

why can't I send an official discord invite

#

oh yeah I'm a whitename now

umbral zealot
#

Because you're a filthy whitename, thanks

copper cradle
#

ffs

wooden shoal
# umbral zealot what do you mean "simulate bans"

Here, I don't think ur understanding me. I need 500 accounts to serve as Server Members, my friend wants to see how good his bot can protect those server members and how fast it'll ban a good nuke bot. The nuke bot will be mass banning these accounts.

umbral zealot
#

Ok but you don't need actual accoutns for this

#

literally do you NOT need them

narrow fractal
#

Bruh

umbral zealot
#

What specifically do you think you need to test with a mass ban? What part of the mass ban requires actual banning to test?

dusty axle
#

tbh

narrow fractal
#
print("Hello World!")
dusty axle
#

you only really need a handful of accounts

narrow fractal
#

Or webhooks lol

#

Idk

#

I dont use or make nuke bots

umbral zealot
#

webhooks aren't even remotely close to being relevant to this conversation

narrow fractal
#

I was joking Kekkers

dusty axle
#

and as far as massbans go as long as your in the ratelimit area your fine it also depends on how many resources it uses

earnest phoenix
dusty axle
#

mine personally can massban according to the ratelimit in a 21k member server

umbral zealot
#

yeah but this isn't what the conversation is about at the moment

earnest phoenix
#

yup

wooden shoal
umbral zealot
#

you don't need to worry about that

#

just literally ban them in a loop

#

discord.js will take care of ratelimits for you

dusty axle
#

^^

#

its a blessing in disguise

umbral zealot
#

It's all put in a bucket (queue) which properly handles ratelimit headers, so, you do NOT need to worry about banning a high number of members as fast as the ratelimits will allow

dusty axle
#

i personally use discord.py so unsure if there is something like that

umbral zealot
#

this is not something Discord will ever block you from doing, assuming you're actually following ratelimit headers (which discord.js does)

wooden shoal
#

client.on("guildBanAdd", async (guild, member) => {
  const log = await guild
    .fetchAuditLogs({
      type: "MEMBER_BAN"
    })
    .then(audit => audit.entries.first());
  const user = log.executor
  if (user.id === guild.owner.id) return;
  if (user.id === client.user.id) return;
  let whitelist = db.get(`whitelist_${guild.id}`)
  if (whitelist && whitelist.find(x => x.user === user.id)) {
    return;
  }
  guild.members.ban(user.id, { reason: 'Xyber| banned a member' })

})

Here's my event for banning, some bots can bypass this.

umbral zealot
#

Well yeah that's actually a bit your fault

#

because of your awaiting of the audit logs

#

¯_(ツ)_/¯

#

You're slowing this down because of that query

dusty axle
#

if bots can bypass might also be their role being above that bot but check what Evie said first

true juniper
#

Hey I know that free vps are not good but I can't pay for the good ones so can y'all suggest any? Except Heroku please

umbral zealot
#

So instead of that, you might want to consider having some sort of in-memory structure like a Map, which holds the bans on each guild in the last X seconds, to know if someone has banned recently. This will be many times faster than relying on the audit logs

umbral zealot
dusty axle
#

yeah

#

there are cheap good ones just gotta find them

#

lemme send you something helpful

true juniper
#

oof

pale vessel
#

don't buy those cheap and shady ones though

dusty axle
pale vessel
#

or those so called "panels"

true juniper
#

nah I can't buy anyways so :/

dusty axle
pale vessel
#

don't ever buy those

umbral zealot
#

Heroku can't save data and is complicated (and also requires CC)
Glitch bans you
Repl can be banned by Discord and is somewhat unstable
AWS and Google require CC
etc.
There's no good ones

dusty axle
#

I have went through probably 200+ providers

pale vessel
#

Why a VPN

umbral zealot
#

I got an OVH vpn 5 years ago and never stopped loving it

#

¯_(ツ)_/¯

dusty axle
#

different datacenters mainly

dusty axle
#

but also the backbone structures

pale vessel
#

huh

#

i thought we were talking about VPSes

wooden shoal
#

@umbral zealot Fixed

pale vessel
#

ok whatever bye

dusty axle
#

like OVH for example have a UDP vacuum

earnest phoenix
umbral zealot
#

repl.it , as in, you share IPs, so...

true juniper
#

Well yes, repl is unstable

umbral zealot
#

ip bans affect you

wooden shoal
#

Does anyone know how to set a guilds vanity URL with a bot in djs?

earnest phoenix
dusty axle
#

personally i use AWS due to scalability but yeah you need a CC

umbral zealot
true juniper
#

Oh, I'm 16 so can't get a CC rn

dusty axle
#

also they are dynamic servers which is a somewhat newer technology

umbral zealot
#

set it? I don't think you can

true juniper
#

Yeah, we can't

umbral zealot
#

I don't think bots can change the vanity URLs at all

true juniper
#

I think he meant something like dsc.gg

#

Idk tbh

wooden shoal
umbral zealot
#

ok and... ?

#

are you just re-doing this entire anti-nuker exactly detail-for-detail?

#

what's the point?

#

smh