#development

1 messages · Page 1633 of 1

livid lichen
#

I did await Bot.GetServerCount()

#

wait

earnest phoenix
#
     message.guild.channels.create('test')
     message.channel.overwritePermissions(args[0], { READ_MESSAGES: true, SEND_MESSAGES: false})
    .catch(console.error);

I have a error, the bot dosen't do the permissions for the role in the new channel :/

misty sigil
#

face the reality, there's no hiding frontend code

lusty quest
#

all ive figured out for now is how to use MongoDB as a storage for the localisations

pale vessel
#

Log results

livid lichen
#

Okay!

vivid fulcrum
#

you can do SSR, which prevents your end user from seeing your entire logic but you need to send code to the browser so the browser can render it

once you send it, the client has it and can view it freely

livid lichen
lusty quest
feral aspen
vivid fulcrum
#

sec

torpid crown
#

I just waana ask I have seted all the mod commands to only who had those permissions the perms are ban and kick who has one of them he will be able to run the command is this allowed too??

viscid gale
#

ok.. can you walk me through how you found it

slender thistle
#

You could load that into cache on bot startup

misty sigil
#

its that easy

lusty quest
#

if i update something

slender thistle
#

I see

vivid fulcrum
torpid crown
#

Uhh guys?

lusty quest
#

and i18n got a integration for it

slender thistle
#

Well, can't argue with that

viscid gale
feral aspen
misty sigil
lusty quest
#

but yea i could just use json or js files

vivid fulcrum
feral aspen
#

Aight! :)

#

I have to like fix 50 commands

sinful belfry
#

@vivid fulcrum try to be more polite to people, it is incredibly unpleasant otherwise, and you will end up getting yourself into trouble again

vivid fulcrum
#

i genuinely do not care

feral aspen
#

After I automatically used the VS search to replace them for me.

torpid crown
#

I have a other command called +bl wich is forces the bot to leave the server required a admin is this allowed guys??

vivid fulcrum
#

if people are clowning they're choosing to clown

#

idc

sinful belfry
#

well i suggest you take a step back from this channel for a bit

umbral zealot
misty sigil
#

it requires admin perms (user) to make the bot leave the server

slender thistle
#

I suggest you allow it only to bot owners

#

and not just anyone with Admin perms

misty sigil
#

thats what i'm gathering

lusty quest
#

they could just kick the bot?

misty sigil
#

^^ yea??

umbral zealot
#

They could definitely just kick the bot, yeah, lol

#

But asking for Admin permission from the person doing the command to leave the server is perfectly fine

torpid crown
lusty quest
#

you are not by any chance german right? bcs they like to overengineer simple stuff

livid lichen
#

@pale vessel[ [ 25 ] ] [ [ 7670 ] ] [ [ 7670 ] ] [ [ 7670 ] ] Alright so I assume half is servers and half is user count?

umbral zealot
#

As long as you tell the user what permissions are needed.

torpid crown
#

Okay

livid lichen
#

Wait

#

25 might be servers.

#

Yeah it is.

torpid crown
#

It needs ban or kick one of them to be run the commands that needs perms

viscid gale
# misty sigil network tab in chrome dev tools

ik im gonna sound like a real dunce here but i spent so much time thinking about the other things, like making the request chain something only the html loader follows, preventing global hijacking.. making sure you load it on a browser new tab.. and messed up royally.. next time when I present it I hope it'll at least be hard to find ;D

umbral zealot
#

That sounds about right.

misty sigil
viscid gale
#

hm..

misty sigil
#

it'll still be in the network tab

vivid fulcrum
#

anything you do on the front the client can see

#

sure you can send an encrypted version

vivid fulcrum
#

but the decryption code is still going to be there

#

use that, boom, i have access to your script again

#

if you're really this worried about people stealing your code you should just switch to SSR

viscid gale
#

yeaa.. it's gonna be hard.. but i aint gonna give up

viscid gale
vivid fulcrum
#

while SSR does share bits here and there, the end user doesn't have access to the entire script

viscid gale
#

that y im gonna try and try and try

#

not that i need to but i want to

livid lichen
viscid gale
#

so thanks for ur advise but i shall tryyyyyyyyyy

pale vessel
#

yeah, are you trying to get all member count across all shards?

livid lichen
#

Same with the member count.

vivid fulcrum
livid lichen
#

I'm quite new to sharding.

pale vessel
#

can you log results here?

livid lichen
pale vessel
#

Ah

livid lichen
#

Yeah.

pale vessel
#

But you didn't return the result

#

you only returned the Promise.all

livid lichen
#

Oh?

pale vessel
#
return Promise.all(promises).then(results => results.reduce(...))```
#

or simply add return in your case

livid lichen
#

I'll try and get back to you. Thanks for the help so far!

dark crest
#

hi i just buoght an vps server how do i run my bot 24/7 help me pls

zinc palm
#

Can I have code to make my bot hi

#

Lol

umbral zealot
dark crest
#

node.js

umbral zealot
#

Awesome. You can use pm2 in order to run a nodejs program and restart on error

dark crest
#

i boght vps already

umbral zealot
#

Ok. you already said that.

dark crest
#

so what is pm2?

umbral zealot
#

it runs a nodejs program and restarts it on error

dark crest
#

hooo

umbral zealot
#

in the VPS (a VPS is just a computer running a system, it's not magic)

dark crest
#

so i shood install the package pm2?

umbral zealot
#

yes

boreal iron
#

it's not magic
for a lot of people out there, it actually is

dark crest
#

ok thx

misty sigil
#

idk my vps seems pretty magical, how does it stay on almost 24/7

livid lichen
#

It now shows that my guild has... 07670 servers?

#

Last I checked, it was only 25.

pale vessel
#

lol

vivid fulcrum
livid lichen
#

lol

pale vessel
#

Try flatting the array

pale vessel
#

results.flat().reduce(...)

livid lichen
#

The usercount is correct but the 0 in fount is kinda strange.

pale vessel
#

Instead of results[0]

livid lichen
#

Okay!

#

@pale vessel It worked! Thanks for the help.

lyric mountain
#

Just read that entire unstealable front end code convo

#

Ngl that was an interesting sitcom

restive willow
#

discord.py: can I change an Embed's thumbnail size? I want it to be exactly 48x48

vivid fulcrum
#

you'll have to manually resize it in your code and upload it either to discord or somewhere else

#

then use that url

restive willow
#

yikes

lusty quest
#

does py got something like canvas?

vivid fulcrum
lyric mountain
#

Doesn't url params allow resizing server-side?

vivid fulcrum
#

uh

#

no

lyric mountain
#

Like, ?size=48

#

At least it works for avatars

restive willow
#

my url could be from anywhere tho

vivid fulcrum
#

that's only for grabbing avatars etc

lyric mountain
#

Oh, the image ain't from discord

#

I see then

vivid fulcrum
#

the size needs to be a power of 2 anyways so 48 wouldn't even work

lyric mountain
#

Welp, image manipulation + attachments will be ur only choice

restive willow
#

mad effort

#

ill just leave it

lyric mountain
#

No effort at all

#

Like, it's kinda easy to do that

restive willow
#

i mean its a really inconsequential thing i just thought it would be cool if every embed were similar size

river panther
#

helo guys :)

lyric mountain
#

But thumbnails have fixed size anyway

sick fable
#

Help me please

lyric mountain
#

No

river panther
sick fable
#

;<

lyric mountain
#

You didn't supply a question

river panther
#

^

vivid fulcrum
river panther
#

with what?

sick fable
# river panther with what?

Well, I coded a command which welcomes a user. Everything is fine and working but its not sending a welcome message

vivid fulcrum
#

i was kidding

sick fable
#

i also got intents enabled

restive willow
sick fable
#

Sur

#

sure

lyric mountain
#

"everything works right"
"is not sending wecome message"

Choose one

river panther
#

exdi

river panther
boreal iron
#

we need ur credit card number and it's CSC code, to help you

lyric mountain
#

You sure you have the intents enabled both on your bot and discord dashboard?

sick fable
river panther
#

wow

lyric mountain
#

404

sick fable
#

man wtf

river panther
vivid fulcrum
#

pastebin is 🚮

sick fable
#

try noe

vivid fulcrum
sick fable
#

now

lyric mountain
#

Earlier

river panther
#

what library are you using?

river panther
#

ah, idk python, i am djs

sick fable
#

;<

lyric mountain
#

Still, no code no help

#

And check the intents

sick fable
#

@slender thistle eh help me here

river panther
# lyric mountain Still, no code no help
@client.event
async def on_member_join(member):
    guild = ctx.guild
    wc_role = welcome_role
    channel = await client.fetch_channel(chnl)
    await member.add_roles(wc_role)
    embed = discord.Embed(title = f"A Wild {member.name} Appears!" , description = f"**You are our {guild.member_count}th member!**" , colour = discord.Colour.green())
    embed.add_field(name = '**•Member Name!**' , value = f"{member.name}")
    embed.add_field(name = "**•Id**" , value = f"{member.id}")
    embed.add_field(name = "**•Member Created at**" , value = member.created_at.strftime("%a, %d %B %Y , %I %M %p UTC"))
    embed.add_field(name = "**•Joined this server on**" , value = member.joined_at.strftime("%a, %d %B %Y , %I %M %p UTC"))
    embed.set_image(url = f"{member.avatar_url}")
    embed.set_footer(text = "Have Fun in this server! | Bot coded by Mr.Sloth#0007")
    await channel.send(embed=embed)
sick fable
river panther
#

why did you fetch channel?

slender thistle
#

Show your Intents and your client objects

river panther
#

just do message.channel

slender thistle
#

member

#

no message

sick fable
#

hmm

river panther
#

oh, idk py

#

i was just suggesting

#

thank you, the more you know

slender thistle
#

It's a member join event

#

So there's no message

river panther
#

oh, OH OOOOOOOH

#

yes i get it

sick fable
#

@slender thistle

river panther
#

charge your phone

lyric mountain
#

Also on code

#

Wait

#

Plane mode
Wifi
Bluetooth

Choose one

slender thistle
river panther
#

bharat mata ki jai

sick fable
#

i have wifi enabled in airplane node

river panther
slender thistle
#

Now show me how you are initiailizing your client and intents in your code

sick fable
sick fable
#

while the intents are enabled

#

it still doesnt runs

slender thistle
#

Just show your code

#

I don't specifically care if you used local or global variables

sick fable
#

ok

#

hold up

earnest phoenix
#

Hey

lyric mountain
#

Arnold

lethal trout
earnest phoenix
#
const Discord = require('discord.js');
const { deletionTimeout, reactionError, reactionSuccess, pinEmojiId } = require('../../config.json');

module.exports = {
  name: 'setlogs',
  description: `Crée des channels pour les logs du serveur.`,
  usage: 'setlogs (id du role Staff)',
  requiredPerms: 'ADMINISTRATOR',
  permError: "❌ Tu n'as pas la permission !",
  async run(message, args, prefix) {
    const staffRole = (args[0]);
    if (!args[0]) {
    let msg = await message.channel.send(`Conseil de pro : ${prefix}setlogs (id du role Staff)`);
    msg.delete({ timeout: deletionTimeout });
    return message.react(reactionError);
    }
     message.guild.channels.create('test')
     message.channel.overwritePermissions(staffRole, { READ_MESSAGES: true, SEND_MESSAGES: false})
    .catch(console.error);
  }
}

My command dosent work at 100%

lethal trout
#

why is this not workin?

lyric mountain
#

Wht

earnest phoenix
#

The bot dosen't do the permissions for the role in the new channel created

lethal trout
#

i want this cmd to work only in 1 server

lyric mountain
#

Boi

sick fable
lyric mountain
#

You cant negate that way

sick fable
#

@slender thistle

opal plank
#

you need to put it in parentehsis

lethal trout
#

like how to fix it?

opal plank
#

the whole thing

#

!"1234"

slender thistle
opal plank
#

since its true, (not an empty string)

slender thistle
#

Or just your client

sick fable
opal plank
#

it ends up being false === 'guildid'

#

which is always false

slender thistle
#

What is client

sick fable
#

client = commands.Bot(command_preux = "$")

#

here

#

prefix

slender thistle
#

Permission to strangle you

sick fable
#

sure

#

:D

slender thistle
#

Hold on

sick fable
#

I am sorry if i am Acting like a dumb bitch, i just didnt slept for some days

slender thistle
#

Nah no sweat

opal plank
#

i kinda told shiv i would NOT be using py syntax if i were to go there

sick fable
#

xd

opal plank
#

you'd see client, index.py, and a lot of other shit

lyric mountain
opal plank
sick fable
#

hmm

lyric mountain
#

Use !==

opal plank
#

kuuhaku

sick fable
opal plank
#

trying to teach them about how the operator works

#

rather than spoonfeeding them lul

lethal trout
slender thistle
opal plank
#

well, you take it from here

slender thistle
#

see how members is False?

opal plank
#

bye

slender thistle
#

Your members intent isn't enabled in your code

opal plank
sick fable
lyric mountain
#

Erwin, nooooo

sick fable
slender thistle
#

since you didn't pass any intents of your own, d.py defaulted them for you

slender thistle
#

Since you probably want the same intents but with members, two ways

lyric mountain
slender thistle
#

Actually just one

lethal trout
slender thistle
#
intents = discord.Intents.default()
intents.members = True```
lyric mountain
#

What does it mean?

slender thistle
#

then you pass intents to your commands.Bot object via intents kwarg

earnest phoenix
#
const Discord = require('discord.js');
const { deletionTimeout, reactionError, reactionSuccess, pinEmojiId } = require('../../config.json');

module.exports = {
  name: 'setlogs',
  description: `Crée des channels pour les logs du serveur.`,
  usage: 'setlogs (id du role Staff)',
  requiredPerms: 'ADMINISTRATOR',
  permError: "❌ Tu n'as pas la permission !",
  async run(message, args, prefix) {
    const staffRole = (args[0]);
    if (!args[0]) {
    let msg = await message.channel.send(`Conseil de pro : ${prefix}setlogs (id du role Staff)`);
    msg.delete({ timeout: deletionTimeout });
    return message.react(reactionError);
    }
     message.guild.channels.create('test')
     message.channel.overwritePermissions(staffRole, { READ_MESSAGES: true, SEND_MESSAGES: false})
    .catch(console.error);
  }
}

My command dosent work at 100%
The bot dosen't do the permissions for the role in the new channel :/
And no errors in the console 😦

lethal trout
#

it means if it is not the thing like !123 so it means if it is not 123

lyric mountain
#

No

#

! is a negator

#

Actually, an inversor

#

Js treats everything as booleans

#

So 0 is false

#

1 is true

#

"" is false

#

"a" is true

#

Okay?

#

!123 does not mean "not 123", it means "false"

#

Because 123 is not 0, so it's true

#

Inverse of true is false

#

See where we're getting?

earnest phoenix
#

oh wait

dark crest
#

help pls

zenith terrace
#

you see the problem now?

#

@earnest phoenix

earnest phoenix
#

yes

zenith terrace
#

ok

zenith terrace
earnest phoenix
lyric mountain
#

@lethal trout still here?

earnest phoenix
#

O_O

dark crest
lethal trout
earnest phoenix
#

Care suge pula?

lethal trout
#

i was reading the things u sent

#

ty bro

#

learnt alot

slender thistle
lyric mountain
#

So, given that logic, !someid === "123" is false

#

Because false is not equal to true

boreal iron
lyric mountain
#

"123" is true

#

!someid, unless 0 or "", is false

lethal trout
#

umm

#

ok

earnest phoenix
#

:/

#

and the args its the user to define the role id

lyric mountain
#

If you want to compare two values, you can't negate the value itself

earnest phoenix
#

in the command

earnest phoenix
# earnest phoenix ```js const Discord = require('discord.js'); const { deletionTimeout, reactionEr...

<GuildChannel>.overwritePermissions() doesn't take overwrites like that:
https://discord.js.org/#/docs/main/stable/class/GuildChannel?scrollTo=overwritePermissions

lyric mountain
#

You negate the comparison

lethal trout
#

ohk

#

ty bro

lyric mountain
#

=== compares if true and type matches

lethal trout
#

yea ik that

lyric mountain
#

!== reverses that

lethal trout
#

man u should get promoted

boreal iron
#

If create doesn't return a promise.

earnest phoenix
#

@lyric mountain Were you trying to explain this?

#

oh

lyric mountain
#

Well, kinda

boreal iron
#

Oh it does return a promise <GuildChannel>... there u go

earnest phoenix
boreal iron
#

That's why I was asking.

earnest phoenix
#

Refer to the permissionOverwrites option

boreal iron
#

GOD DAMN! YEAH

#

I WAS ASKING if wanna edit the permissions for the created channel or the current one.

#

and he answered:

the but create channel without errors but don't add permissions in the new channel

#

Impossible for me to understand what he meant.

earnest phoenix
#

By the "new channel" they're probably referring to the created channel which they want to add permissions to

boreal iron
#

lmao didn't even read the ending of his message

#

U SAW NOTHING!

river panther
#

how do i send an attachment in slash command?
i tried doing attachment://filename.png

earnest phoenix
#

but so

#

I want to:

#

the bot create a new channel

#

and the bot add permissions in the new channel

quartz kindle
#

you dont need to add permissions

#

you can create channel WITH permissions

earnest phoenix
#

yes but not works :/

boreal iron
#

yeah, what you did is, you tried to overwrite the permissions of the message.channel the current channel the messasge was sent not the new channel

quartz kindle
#

channels.create({ permissionOverwrites: { your permissions here } })

earnest phoenix
#

can I add the name of the channel too?

quartz kindle
#

yes

boreal iron
#

of course, lol

#

channels.create("channel-name", { permissionOverwrites: { your permissions here } });

earnest phoenix
dark crest
#

i dont understand how to update my node on my vps

river panther
# quartz kindle yes

hello sir, big fan, can you tell me how do i send an attachment in slash command?
i tried doing attachment://filename.png

vivid fulcrum
dark crest
#

yes

boreal iron
earnest phoenix
#

oh

#

so

boreal iron
#

or cry

lyric mountain
#

Permissions are per role

quartz kindle
vivid fulcrum
#

and follow what it says

lyric mountain
#

If you dont specify a role, it's for @everyone

earnest phoenix
lyric mountain
#

See second option in tim's print

lethal trout
#

umm it is not sendin to the logs channel

earnest phoenix
#

you are using light theme...

#

owo

lethal trout
#

oof

earnest phoenix
#

😮

lethal trout
#

i hate it

lethal trout
lyric mountain
lethal trout
#

why?

earnest phoenix
quartz kindle
lethal trout
lethal trout
lyric mountain
#

If your parents enforce light theme excuse me but they're douchebags

lyric mountain
#

Like, that only hurts your eye without reason

#

Will probably make you need to use glasses futurely

lethal trout
#

umm see

lyric mountain
#

At least use f.lux then

vivid fulcrum
quartz kindle
earnest phoenix
#

my eyes :/

quartz kindle
lethal trout
#

but it is not logging there

quartz kindle
#

we sent this link like 5 times already lol

lethal trout
lyric mountain
#

Snowflake, OverrideResolvable

earnest phoenix
lyric mountain
#

Author is a snowflake

dark crest
lethal trout
quartz kindle
#

same thing

boreal iron
earnest phoenix
#

awooo

#

yes

boreal iron
#

make sure to get/fetch it BEFORE for the case it doesn't exist

somber tulip
earnest phoenix
#

permissionOverwrites.map is not a function

#

:/

river panther
earnest phoenix
#
const Discord = require('discord.js');
const { deletionTimeout, reactionError, reactionSuccess, pinEmojiId } = require('../../config.json');

module.exports = {
  name: 'setlogs',
  description: `Crée des channels pour les logs du serveur.`,
  usage: 'setlogs (id du role Staff)',
  requiredPerms: 'ADMINISTRATOR',
  permError: "❌ Tu n'as pas la permission !",
  async run(message, args, prefix) {
    const staffRole = (args[0]);
    if (!args[0]) {
    let msg = await message.channel.send(`Conseil de pro : ${prefix}setlogs (id du role Staff)`);
    msg.delete({ timeout: deletionTimeout });
    return message.react(reactionError);
    }
     message.guild.channels.create("test", { type: 'text', permissionOverwrites: { id: '810846011299201054', READ_MESSAGES: true, SEND_MESSAGES: false }})
    .catch(console.error);
  }
}
#

there is not .map

#

😦

quartz kindle
#

read the example again

boreal iron
#

allow or deny the array including the permissions

somber tulip
boreal iron
#

I mean you just have to copy the example, as Tim said hashflushed

river panther
quartz kindle
#

no

river panther
#

oh, ok ok

quartz kindle
dark crest
#

x

#

but now

quartz kindle
#

if they dont, then you need to upload the files yourself and put the link in the embed

dark crest
#

-_-

river panther
quartz kindle
#

well i got no clue either

#

i never used slash commands

river panther
#

oh, ok

lyric mountain
#

Tim knows more than discord devs KEKW

somber tulip
dark crest
somber tulip
#

sudo npm install sqlite3

dark crest
#

same

#

-_-

quartz kindle
#

you're already root

#

dont use sudo

dark crest
#

so what to do?

quartz kindle
#

delete the node_modules folder

#

and try installing again

dark crest
#

ok

earnest phoenix
#

Hey! So my bot that just got sharding only displays the amount of guilds in the current shard in the bot status. How would I make it so that
the status will display the total number of guilds
not just from 1 shard

somber tulip
#

the error says you do not have permission

quartz kindle
earnest phoenix
quartz kindle
#

what have you tried? show code

earnest phoenix
#

wtf

quartz kindle
#

you put an invalid permission

#

or put it in the wrong place

earnest phoenix
#
     message.guild.channels.create('test', {
     type: 'text',
     permissionOverwrites: [
     {
         id: args[0],
       allow: ['READ_MESSAGES'],
       deny: ['SEND_MESSAGES'],
    },
  ],
})
earnest phoenix
#

this also needs to be changed but the how part i aint sure off,

quartz kindle
#

client.shard.fetchClientValues

earnest phoenix
#

ah

earnest phoenix
earnest phoenix
quartz kindle
#

^

earnest phoenix
#

thx

halcyon juniper
#

Hi, how can I create a bot using discord.py and make a new server using that bot when a certain command is executed?

earnest phoenix
quartz kindle
#

how did you use it?

#

thats the method you need to use

earnest phoenix
#

i put this for the status

quartz kindle
#

dont copy and paste it lol

earnest phoenix
#

and it still displays 800

#

e

quartz kindle
#

look it up how to use it

#

in the docs

earnest phoenix
#

aight

lyric mountain
#

So you might want to reconsider such feature

quartz kindle
#

isnt it 10?

umbral zealot
#

If memory serves me well it's 10, yeah

lyric mountain
#

Was it 10?

umbral zealot
#

over 10 guilds you cannot create any guilds.

lyric mountain
#

10 then

#

Wait, you got demoted evie?

umbral zealot
#

Yep

#

shit happens ¯_(ツ)_/¯

quartz kindle
#

wha

solemn latch
quartz kindle
#

rip

umbral zealot
#

I've been a bad girl and I got punished, that's life!

earnest phoenix
#

Sad

umbral zealot
#

Doesn't matter, I'm still here and I'm not going anywhere ^_^

#

Also the Notable Member role is removed and that's a bit sad 😦

quartz kindle
#

oh i didnt even notice

#

rip²

vivid fulcrum
#

f

earnest phoenix
#

ek

quartz kindle
#

nope

#

read the docs again

#

oh you're in the wrong doc

#

i updated the link to the right one 5 seconds later

#

but i guess you already had opened it

earnest phoenix
#

okiee

solemn latch
#

honestly though, it didnt really mean anything except for the like 2 normal members that had it.

wanton prism
#

Can someone help me about hosting? I have some troubles.

umbral zealot
#

Hey we were quite a few people that had it. But I guess it caused a bit of jealousy (and it wasn't clear why it was given either I guess)

umbral zealot
earnest phoenix
#

¯_(ツ)_/¯

#

kinda comes out with a loop of errors

quartz kindle
#

you're trying out stuff blindly without reading what it does right?

#

what are the errors

#

you're not using the return value

#

and guilds is not defined

earnest phoenix
quartz kindle
#

you left an open parenthesis

wanton prism
umbral zealot
#

literally any hosting can do t4hat

lyric mountain
#

Uh oh, i smell json db

quartz kindle
#

literally any non-free hosting service

blazing patrol
#

How do I make a hyper link

umbral zealot
earnest phoenix
#

is that

blazing patrol
#

In an embed

pale vessel
#

oh

#

[text](url "hover text")

lyric mountain
blazing patrol
#

Ok

lyric mountain
pale vessel
#

ya

lyric mountain
#

Cool

pale vessel
#

dank memer uses it

latent heron
#

tooltips have been a thing in discord for a while now

solemn latch
#

👀

pale vessel
#

then again it's electron

quartz kindle
solemn latch
#

totally going to deny a bot to try this 4head

earnest phoenix
wanton prism
quartz kindle
umbral zealot
#

There's some hints in the pins of this channel actually

quartz kindle
#

are you trolling?

earnest phoenix
#

no-

quartz kindle
#

then you should learn js a bit more

quartz kindle
#

digital ocean, ovh, contabo, vultr, galaxygate, google compute engine, amazon ec2...

#

many options to chose from

#

if you have a credit card, the best cheapest option is google compute engine

lyric mountain
#

Tim do be "ok google"

quartz kindle
#

Lol

vivid fulcrum
#

you can go even cheaper if someone gives you their referral code or something

wanton prism
#

oh cool, i will try to do something about. Thank you all for help, have a nice day ^^

grizzled raven
#

anyway

#

what do i do about mongoose connection timeouts or whatever

solemn latch
#

doesnt mongoose auto reconnect?

sage bobcat
#

One message removed from a suspended account.

umbral zealot
#

tsk tsk wrong channel for hugs again. 😛

feral skiff
#

Is using a bot to be able to ban/kick people ranked the same or higher against the discord api tos?

vivid fulcrum
#

it isn't

#

but you probably shouldn't allow it if it's a public bot

#

as your users might abuse it

#

scratch the might, they will abuse it

earnest phoenix
#

can somebody rate this

vivid fulcrum
#

terrible

lusty quest
#

where did you found this one? a PFP of a tech forum from 2004?

earnest phoenix
#

that is the word i searched

misty sigil
#

what is that supposed to be

vivid fulcrum
#

what is this supposed to be for

#

lmfaao

earnest phoenix
#

actual i have this

earnest phoenix
misty sigil
#

it genuinely looks like someone had a frantic half hour in ms publisher

#

theres way too much going on for a server icon

#

keep it simple

lusty quest
#

dont put to much details into icons, they get this small you wont be able to see it

vivid fulcrum
#

why not just a simplistic letter

#

the first letter of your server name

#

if the name is dev & debug make it d&d

#

apply a gradient on it

#

slight drop shadow

#

italic

#

boom

earnest phoenix
vivid fulcrum
#

i'm bored so i'm going to make a concept

earnest phoenix
#

which font should i use?

#

open sans?

earnest phoenix
vivid fulcrum
#

that's still horrible

misty sigil
#

way too much going on still

earnest phoenix
#

xD

vivid fulcrum
#

i was aiming for something like this

#

gradient + soft glow on a simple background

#

that's it

#

here's the png if you want it

earnest phoenix
#

would look like this

vivid fulcrum
#

that's horrid

earnest phoenix
#

very small

lapis geode
#

Does anyone know if there is a some type of js client.on functionality for if the bot is kicked from a server? Can't seem to find any info for it aPES_Cry Similar to client.on("guildCreate", (guild) => { for joining a server

earnest phoenix
#

guildRemove

lapis geode
#

bet, thanks boss

earnest phoenix
#

or this is horrible+ lol

misty sigil
#

oh my god

#

my eyes have been cursed

earnest phoenix
#

lel

#

i will set it as logo

stable nimbus
#

I’m trying to get a random number between two big numbers, say 100 and 500, I get an object promise back when using Math.floor(Math.random() * (Max - Min)) + min;

sudden geyser
#

they all look abhorrent but the third one is the best of them all

misty sigil
#

well that shouldnt happen

stable nimbus
#

Everything is defined however

ripe prairie
#

oof that one kinda hurts on the eyes

earnest phoenix
#

would you use this

misty sigil
#

no

#

too flashy

restive furnace
#

not really

earnest phoenix
#

or the upper

restive furnace
#

neither

misty sigil
#

neither

earnest phoenix
#

i am a noob lol

misty sigil
#

they're both shite in different ways

ripe prairie
#

talk about a tough crowd

stable nimbus
earnest phoenix
#

already changed

ripe prairie
#

i wouldn't necessarily call that epileptic

vivid fulcrum
#

i upscaled mine to 512, you have full permission to use it

ripe prairie
#

but it's definitely an eye sore

earnest phoenix
misty sigil
vivid fulcrum
#

the magic of gradients

#

gradients can make any basic design look very pretty

earnest phoenix
#

gradients are really cool if you have a good combination

river panther
sterile lantern
#
db.set(`${user.id}_thiefoutfit`, "purchased")```
im saving items like this, but all of a sudden people start loosing their items
earnest phoenix
#

software name is horrible + i think xD

sterile lantern
#

should it be saved as thiefoutfit_${user.id} (format i use for money)

earnest phoenix
sterile lantern
#

and im using quick db btw

sudden geyser
#

are you overwriting it

sterile lantern
#

no

#

it just fetches it

#

to ensure that they have it

earnest phoenix
#

you writer got stopped atm you rebooted

earnest phoenix
#

problem with bettersqlite3

sterile lantern
#

wym?

#

i didnt reboot

#

at all

earnest phoenix
sterile lantern
#

and it happened

vivid fulcrum
#

photoshop cc 2021

sterile lantern
#

im just gonna set it to a boolean value and hope that fixes it

earnest phoenix
vivid fulcrum
#

i have a student license

#

so everything's super cheap

earnest phoenix
vivid fulcrum
#

i don't think they're uh... very... intelligent per se

earnest phoenix
#

lol what a scam

vivid fulcrum
#

omegalul

pale vessel
ripe prairie
#

Xd

river panther
#

exdi

stable nimbus
heady sable
#

so I have a command which gives you a meme... and in the command, I want to have a way to have the bot react with a bookmark, and for around 1 minute, it would listen to anyone who reacted on the bookmark, and if they did it would do a function. Whats the best way to do this? (discord.py)

exotic galleon
#

Overview of my bot on top.gg
how do i add the place

cinder patio
#
async function a() {
  return 1 + 1;
}

Will return a promise even if you don't actually return a promise yourself

stable nimbus
#

Really?

cinder patio
#

yes

jolly mortar
#

does anyone know how to make a bot faster, so I made a fun bot where you mine blocks to level up by running &mine and it shows up an embed you can control by reacting to it but if 2 people are using it at the same time it slows down rlly bad, is there a way to make it run smoother?

#

it edits messages to the reaction

cinder patio
jolly mortar
#

we did

#

if 2 people play at the same time

#

on seperate embeds

#

it slows down both

stable nimbus
#

So when I do my set timeout, don’t async it?

exotic galleon
#

Overview to my bot on top.gg how do i add the place
ex;

cinder patio
stable nimbus
#

Okay

crimson vapor
#

@quartz kindle @opal plank wut are you guys no longer aqua names?

#

oh

cinder patio
earnest phoenix
#

hi

stable nimbus
stable nimbus
#

It probably doesn’t help that I’m missing one thing:
It’s inside of an entire asynced function so that way I can wait before setting a timeout

heavy marsh
#

ok so using d.js - v12.
I want to check if the text !d bump or !bump is typed. So all the others are false even if its included in a paragraph or sentences. Which means only those 2 exact words can be written.

What is the best way to do that?

stable nimbus
#

l still get object promises

simple zodiac
#

Hey I'm trying to make a command in discord.js, and I'm getting told that "message is not defined".
The if is like

if (message.content.startsWith(?test)) {
  //code is here
} 

The error is on the line that the if is on, saying "Reference Error: message is not defined"
I have the proper thing above in client.on('message') thing. Could i get some help with it?

cinder patio
heavy marsh
#

that or !bump

cinder patio
cinder patio
quartz kindle
simple zodiac
# quartz kindle show the "above thing" you have

It's

client.on('message', async message => {
 const timeTaken = Date.now() - message.createdTimestamp;
 if (!message.author.bot) 
     if (message.content.toLowerCase().startsWith('?'))
         console.log(`${message.author.tag} (${message.author.id}) used ${message.content} (${timeTaken}ms)`) // response time 
       //message.delete();
``` I have all of my if statements to make a new command under this.
heavy marsh
vivid fulcrum
#

other way around

heavy marsh
#

What other way around?

cinder patio
#

check if message.content is included in the array

heavy marsh
quartz kindle
#

also, for multi-line if's, use brackets

#

if(a) { continue here }

heavy marsh
#

so i can easily return it

quartz kindle
#

you can do if(a) continue here
only for single line things

cinder patio
# heavy marsh Is what I did wrong

yeah, because includes doesn't accept an array, and it's not appropriate for your problem because you want the message to only be !d bump or !bump

#

So you'd do something like this:

[a, b].includes(message.content)
#

or a === message.content || b === message.content

simple zodiac
# quartz kindle can you show the full error?
ReferenceError: message is not defined
    at /home/runner/choosebot/index.js:561:1
    at Script.runInContext (vm.js:130:18)
    at Object.<anonymous> (/run_dir/interp.js:209:20)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47

I don't understand it I'm really new to the bot coding, only part i got was the first line lol. Line 561 is the IF i had before

heavy marsh
#
if(!["!d bump", "!bump"].includes(message.content)) { message.delete().catch(() => {});
#

So like this?

earnest phoenix
#

uff bump reminder /helper

heavy marsh
stable nimbus
# cinder patio I can't help much if I can't see the code
message.channel.awaitMessages(filter, {
                            max: 1,
                            time: 300000,
                            errors: ['time']
                          }).then(message => {
                            message = message.first()
                            if(message.content == '1') {
                                 message.channel.send(`<@${message.author.id}> Is robbing the Fleeca Bank!\n||I will tell you how much you got (or would have gotten)! Give me about 30 seconds!||`);

                                setTimeout(function() {
                                    const amount = randomNum(max, min)
                                    return message.channel.send(`Hey <@${message.author.id}>! You made ${amount} from your bank heist!`);
                                }, 30000);
                            }
#

There we go

earnest phoenix
cinder patio
heavy marsh
earnest phoenix
heavy marsh
earnest phoenix
#

btw read the embed

cinder patio
stable nimbus
heavy marsh
#

I use my own bot to do that sooo

cinder patio
#

it's what makes the function return a promise

#

you don't need it

#

in that func you're not using await anywhere

stable nimbus
#

Okay

earnest phoenix
#

await Math.floor(Math.random() * (max - min)) + min;
};

#

this must be in a async funtion

cinder patio
#

no? Why await a function which doesn't return a promise

stable nimbus
#

No it doesnt because it just worked

sterile lantern
#

so uh somehow my db keeps doing weird stuff and changes the balances of users unexpectedly

stable nimbus
#

It works just fine without it and if I need it I can do it manually in the command.

sterile lantern
#

using quick.db

earnest phoenix
sterile lantern
#

i used dbl browser and fixed most of it

#

but its weird that its not writing properly

#

i think it has to do with an always on feature

stable nimbus
#

I'm not having this argument, Rule 1 of being a programmer: If it works, DON'T FUCK WITH IT!

#

Thank you @cinder patio

cinder patio
#

np!

earnest phoenix
cinder patio
#

No they won't

earnest phoenix
#

if his bot has 100k guilds

stable nimbus
#

Yeah I only have 700.

#

I'll worry about it when I need to.

earnest phoenix
stable nimbus
#

Its not your concern anyways.

earnest phoenix
tired panther
#

hi Guys!

earnest phoenix
cinder patio
#

There's absolutely no need in making that function async and awaiting functions which do not return promises, there are 0 advantages and it most likely actually makes your code slower

stable nimbus
#

No idea what the joinrate is, its meant for GTAV and RDR2 based roleplay servers so its random

tired panther
cinder patio
earnest phoenix
#

👀

opal plank
tired panther
#

😭

earnest phoenix
#

my bot only gets 10 guilds in 2 days

crimson vapor
cinder patio
crimson vapor
#

I don't think its just that

tired panther
opal plank
#

welp, it was nice to get some recognition even if it was temporary, but its not like anyone has ever asked for it, it was a nice touch but not something i would complain about

crimson vapor
#

agreed

tired panther
opal plank
#

ikr

solemn latch
#

well it was asked for on the github 👀

opal plank
#

cyan my fav color, lowkey

tired panther
#

buy roles with coins 🙄

earnest phoenix
#

role play bot

#

you are typing so long xD

opal plank
#

i meant as in:
its in a sense a reward, it might've been vague to acquire it, but it did serve its purpose to reward and provide some recognition to the members that partook in it.
i did see its flaws but they never occured, what i was expecting to happen was a rush of messages in #development and #topgg-api with people trying hard to get the role, which, in by itself wasnt bad unless it went too radical.
like i said, i dont think any notable member has ever asked for recognition of their doings, since most of us were doing it out of good will without a hidden meaning behind it, since the roles were created AFTER we were helping.
idk if there was any notable member added that wasnt a notable member within this server before the role was even added. but thats my 2 cents on the subject

earnest phoenix
#

lol

#

how would i like define member

#

sound dum but its been a while

cinder patio
#

You want the member to be the member that's banned?

earnest phoenix
#

basically it lists all members that are banned in your dms,

#

their tags

#

but, the member. isnt defined

vivid fulcrum
#

you're copypasting code from somewhere

#

you defined your ban object as b

tired panther
#

O.o

cinder patio
#

bans is a collection of BanInfo, which has a user property

earnest phoenix
#

seems like it
fetch the member with id

cinder patio
#

the member's banned, there's no member

earnest phoenix
#

oh i thought the executor

vivid fulcrum
#

the person responsible is only in the audit logs iirc
nvm
i just got what you were saying

cinder patio
#

in that context yeah, but they're trying to get the tag of the banned user

#

yeah the baninfo object only contains the user object of the banned member and the reason

earnest phoenix
cinder patio
#

yeah

#

it's a full user object

earnest phoenix
cinder patio
#

yes

tired panther
#

user contains id, created, flags, name, disc....

viscid gale
#

ok.. it FINALLY doesn't show up in the network tab dev tools for me, so I'm just reaching out again asking to try to see if you can find the script
btw u gotta let it open popup >:{ (dw, my repl is linked to my school email, my discord is linked to my personal email, nothing sus)

cinder patio
#

here we go again

viscid gale
#

bruh cmon.. just check uwu

cinder patio
#

I will cause I'm bored

viscid gale
#

i feel ya, i made it cuz im bored

cinder patio
#

still doesn't work on chrome though

viscid gale
#

naniii

#

u sure it isnt just showing the required modules cant load?

cinder patio
#

Required modules that MUST be...

#

that's what I'm getting

#

which makes no sense

viscid gale
#

i see..

cinder patio
#

I'm geting that on edge too now

#

now it works on edge

#

weird

viscid gale
#

like i said.. nothing sus but u gotta allow popups
here's y
having the iframe run the fetch still gets stored in the network tab, so i open a new popup

#

as in a whole new tab.. and have that tab alone run the request

#

a request from a different tab doesnt get stored in the parent tab's network bar

#

it sounds really hacky.. but so far it works(obvi gotta do something cleaner but I HOPE it's proof the world's not flat)

cinder patio
#

it's scetchy

#

sketchy*

viscid gale
#

ik.. but im planning on using ghost tabs to make it less scetchy?? eh rn it's just a hacky proof of concept

#

btw it doesnt load in the network tab right?

viscid gale
#

oyyy, if it works.. now's the time to ask for the repository :D

cinder patio
viscid gale
#

;]]]]

cinder patio
#

it is... look

viscid gale
#

??

cinder patio
#

look closely

viscid gale
#

hm

#

oof

#

hmm.. ok how did u do that? the window was to close before you could begin doing that

#

debug eh

cinder patio
#

there's an option on edge (and probably all chromium based browsers) which automatically opens the dev tools on all popups

#

and from there you can pause the script and go through each function call

viscid gale
#

but.. by the time u try to do that.. wouldnt the tab close before you even pause?

cinder patio
#

it automatically pauses mmLol

#

once again... you can't hide anything from the client

viscid gale
viscid gale
#

OOOOOOF

cinder patio
#

yeah definitely. If someone didn't bother to look into it more they wouldn't have found it

viscid gale
#

so it halfish works

cinder patio
#

but again you're just making it trickier to find

#

it can always be found

viscid gale
#

huh

#

i still believe >:{ ngl cuz this is fun to try

#

automatically pause.. how do i beat that?

cinder patio
#

you can't

viscid gale
#

waiit.... my function doesnt call something over there.. everything is quite async

#

as u saw the code urself

cinder patio
#

I don't know how that's relevant

viscid gale
#

so if I randomly set a timeout to THEN make openedWindow._pw=window._pw

#

automatically pausing would/should pause before the transaction is done

cinder patio
#

yes, it pauses before the request is made

#

but you can go back and forth the call stack

#

and execute functions one by one

viscid gale
#

holy

cinder patio
#

and you'll eventually execute that fetch function

#

and see the result 🙂

viscid gale
cinder patio
#

you are though... the functions inside the .then

viscid gale
#

one waits for openedTab._pw's text and the other waits for openedTab.xhd's text..

#

then the fetch happens

cinder patio
#

We're talking about the script that can be seen here, not the one that makes the popup

viscid gale
#

ik, ik, but you see the condition that makes it begin running?

#

if window._pw is a string

cinder patio
#

yeah?

viscid gale
#

and it takes that very string for the request

#

meaning that it may be like a function call but there's no trace

#

also meaning that if I have a random timeout, it might, JUST MIGHT be able to best automatic pausing

#

ik im being hopeful but i came this far

cinder patio
#

that's not how it works... the debugger is literally able to execute code expression by expression

viscid gale
#

the network log bypass proved that

quartz kindle
#

if you want to hide code from the user, its easy

#

just convert it to wasm

viscid gale
#

now for an automatic pause beater..

cinder patio
#

yeah but not the debugger

quartz kindle
#

:^)

viscid gale
quartz kindle
#

still, its way harder to reverse engineer wasm than js tricks

viscid gale
cinder patio
#

Did you try doing something with worker threads perhaps?

quartz kindle
#

try wasm + bytecode obfuscation lmao

viscid gale
#

if ur processing things for a game.. getting relative location might be tough but, if it's listening to keys, or mouse, or even displaying to the screen in any way(even canvas drawing)

#

those r relatively easy

quartz kindle
#

of even better, wasm + movfuscator

#

if thats even possible

viscid gale
quartz kindle
viscid gale
#

i worked so hard on the tampered side but the seen side is very hard

vivid fulcrum
#

i mean,, wasm is meant to work with js, not to be a replacement for it

viscid gale
#

oh hi cry the dude that said you can't get client side script not loaded on the network tab

vivid fulcrum
#

????????

viscid gale
#

👋

vivid fulcrum
#

when did i ever say that lol

viscid gale
#

when I was all like then i'd just have to hide it from network tab

#

the time after I realised how u found the code the first time

vivid fulcrum
#

i dont want you to paraphrase me, i want you to show me the exact proof where and when i said that

viscid gale
#

me who aint gonna scroll that far or do that search

#

ok buddy

viscid gale
vivid fulcrum
#

keep in mind

#

people don't have to even use the devtools

#

external network sniffers exist

#

i.e. wireshark

#

again

#

anything you send to the end user, the end user will have access to it

quartz kindle
#

split your payload into several chunks, on each page load send a piece of it and store it in a different location, ie cookies, localstorage, indexeddb, headers, etc

#

when they are all together, assemble them and summon exodia

viscid gale
quartz kindle
#

convert them to jsfuck then encypt them with different keys

#

make the keys depend on something stupid like exact number of seconds past a given minute

#

so the entire code can only run at specific times

vivid fulcrum
#

make it geolocked too

quartz kindle
#

or a modulo on the timestamp

vivid fulcrum
#

only accessible from a small town in kenya

quartz kindle
#

xD

cinder patio
#

lmao

viscid gale
#

for the tab to decrypt.. somewhere the decryptor has to load.. to load the decryptor in a way that the client cannot see.. well that's what im trying to do with any script shrugs

quartz kindle
#

everything will eventually be figured out

#

you are just adding layers on top of layers of annoyance to whoever wants to figure it out

viscid gale
cinder patio
#

SSR is exactly what you're trying to do lmao

#

like

#

just use SSR god damn

vivid fulcrum
#

this

cinder patio
#

why hide scripts from the client when you can just render the HTML in the server and just send the html

vivid fulcrum
viscid gale
#

server side rendering.. let's say you want clients to open websockets to the server.. how do you render that client-server connection server side?

#

that's even harder than what im trying to do

cinder patio
#

why would you want to hide that though? So it's only used by real clients trying to visit your website

vivid fulcrum
#

i've said it 3 times by now, i don't know what isn't clicking

you need to send the script to the browser so the browser can execute it, once you send the data, it's game over, the end user has it