#development

1 messages · Page 1614 of 1

umbral zealot
#
{ name: `🛠️ Info Commands`, value: `${'```' + infoCmds + '```'}`, inline: true },
#

eh, you get the picture

cinder patio
#

To get the unicode representation of an emoji you do \emoji

umbral zealot
#

yeah like \:tools: which is what I did here

earnest phoenix
#

\🛠️

#

😮

obsidian tartan
#

startswith first arg must be str or a tuple of str, not bytes

pale vessel
#

hm, try avatar=await self.bot.user.avatar_url.read()

#

not even sure if you can pass it like that in python

#

if not try py avatar = await self.bot.user.avatar_url.read() create_webhook(name='xyz', avatar=avatar)

wanton dust
#

I have done the custom status part but it's not showing the status

cinder patio
#

new thoughts

wanton dust
#

I have done the custom status in bot part but it's not showing the status

cinder patio
#

The form cards will (potentially) include a screenshot of the form too

earnest phoenix
#

wtf

#

(node:30640) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'find' of undefined
at Object.execute (/app/Commands/Moderation/baninfo.js:20:39)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:30640) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 9)

#
const bannedUser = bannedUsersArr.find((user) => user.username === args[0]);
#

i don't see the problem :/

#

bannedUsersArr is undefined

#

as per the error

cobalt spruce
#
Hey Admins and Mods! 

You may have heard about a feature for bots currently in beta called Slash Commands! Essentially, the way users interact with bots is about to become much simpler - it's as easy as typing "/" to bring up all the commands that bot can do. Slash Commands come with features like autocomplete, validation, and error handling. No more typing up memorized commands, which means bots no longer need to read user messages!

We're excited for how this update will unlock more fun with bots, and since we know many of you are careful with where and how you manage bot permissions, we wanted to give you a special heads up on what this is and what small actions you can take today to prepare for the upcoming release.

What this means for you
    - We are launching a new permission: "Use Slash Commands." 
    - Currently, if you've wanted to avoid bot spam in certain channels, you may have turned off read/send message permissions for bots. 
    - However, if those bots use Slash Commands in the future, you'll need to configure this new permission in order to keep your channels consistent with how they're set up today. Otherwise,  Slash Commands may be able to get around your old permissions setups. Commands are sent directly to the bot and not through reading user messages.
    - Go through your channels and decide where you do and do not want to allow Slash Commands to be used (yes #botspam, no #deleted-channel).

You can see this permission option today on desktop, and on mobile in a few days.

Thanks for all your hard work! 

P.S. Attached is a lil preview of Slash Commands in action.```
#

what do u think about this cry

earnest phoenix
#

slash command perms

cobalt spruce
#

ye

earnest phoenix
#

also they're on by default lol

tired panther
#

Does the guildmemberadd Event needs the member intent? when I just want to giveout the member.user object?

cobalt spruce
#

ik

cobalt spruce
earnest phoenix
#

all member related events require the server members intent

tired panther
cobalt spruce
#

as defualt perfix as well

earnest phoenix
#

wtf

#

wait

#

@earnest phoenix

const { MessageEmbed, MessageFlags } = require('discord.js');
const Keyv = require('keyv');
const bannedUsers = new Keyv(process.env.bannedUsers);
const { deletionTimeout, reactionError, reactionSuccess, pinEmojiId } = require('../../config.json');

module.exports = {
  name: 'baninfo',
  description: 'View details about a banned user.',
  usage: 'baninfo `username`',
  requiredPerms: 'BAN_MEMBERS',
  permError: 'You require the Ban Members permission in order to run this command.',
  async execute(message, args, prefix) {
    if (!args[0]) {
      let msg = await message.channel.send(`Proper command usage: ${prefix}baninfo [username]`);
      msg.delete({ timeout: deletionTimeout });
      return message.react(reactionError);
    }

    const bannedUsersArr = await bannedUsers.get(message.guild.id);
    const bannedUser = bannedUsersArr.find((user) => user.username === args[0]);
    if (!bannedUser) {
      let msg = await message.channel.send(`${args[0]} isn't banned.`);
      msg.delete({ timeout: deletionTimeout });
      return message.react(reactionError);
    }

    let color;
    if (message.guild.me.roles.highest.color === 0) color = '#b9bbbe';
    else color = message.guild.me.roles.highest.color;
    const banInfoEmbed = new MessageEmbed()
      .setColor(color)
      .setTitle(`${message.client.emojis.cache.get(pinEmojiId).toString()} Informations du bannisement`)
      .addFields(
        { name: `Defendant's name:`, value: args[0] },
        { name: `Issued by:`, value: bannedUser.author}
      )
      .setTimestamp();
    if (bannedUser.reason) banInfoEmbed.addField('Raison :', bannedUser.reason);
    if (bannedUser.unbanDate) banInfoEmbed.addField('Temps restant :', Math.floor((bannedUser.unbanDate - Date.now()) / 86400000) + 1);
    await message.channel.send(banInfoEmbed);
    message.react(reactionSuccess);
  }
}
earnest phoenix
coral token
#

how to do topgg vote

earnest phoenix
coral token
#

in discordpy

earnest phoenix
#

oh I see

#

good

cobalt spruce
sacred frost
#

I will not hide it, i'm not good with making bots, so it would mean a lot to me if someone would explain or paste the script that could make your bots send a random image or text after a specific command gets written by user. something like when i would say !cat then it would send me a random image of a cat i set up (btw i use python)

icy skiff
#

depends

#

do u want to grab a random picture from an api

#

or a random picture from an array set by yourself

mellow kelp
#

probably an api

icy skiff
#

if thats the case u must find said api

#

im sure there r tons of apis with cat pictures tho

sacred frost
#

Sorry i have no idea what either of those mean

icy skiff
vague smelt
#

So is the error message a temporary malfunction? And bot invites will be fixed? I checked the date of when that was said... that was like a week ago 😅🥲

icy skiff
#

since u seem to be pretty unexprienced i'd recommend just grabbing some cat picture links and setting an array and get the command to work tha way

#

then try using an api

icy skiff
#

what

vague smelt
earnest phoenix
#

Language: js
HI i am making a tempstorage for storing ids for a time.After the given time it deletes the vaule.how would it be possible with a constructor or exports?

solemn latch
#

just use a database

earnest phoenix
solemn latch
#

then a map/collection?

earnest phoenix
solemn latch
#

either, or just a variable

opal plank
#

i would still recommend a database

earnest phoenix
opal plank
#

with expiry

#

set the values to auto-expire after x time

solemn latch
#

i would database it too, but 🤷‍♂️

earnest phoenix
opal plank
#

read what i said

solemn latch
#

databases do that

earnest phoenix
#

I have to make a Ratelimit for my Custom Commands bot :c

opal plank
#

running settimeout or setintervals is going to unecesarrily increase load on your bot

earnest phoenix
#

Is it possible to customize or fetch ratelimits?

opal plank
#

what?

latent heron
opal plank
#

for what?

latent heron
#

blobpain yeah i agree with you bot

opal plank
#

slash commands?

#

ratelimits are different than commands ratelimiting

#

ratelimits are discord send messages

earnest phoenix
opal plank
#

ratelimig your commands locally has nothing to do with fetching ratelimits

#

what lib you using?

earnest phoenix
#

djs

opal plank
#

d.js should handle everything for you

#

you only need to ratelimit command usage

#

to make sure nobody spams it

#

thats it

solemn latch
#

If you want a cooldown, a map in a variable with expiry time is perfectly fine.

earnest phoenix
opal plank
#

or stop using d.js and move to detritus, they got command handler built in

opal plank
#

it just queues it

#

so await it

solemn latch
#

well, spam creating channels is api abuse even if the lib prevents an actual ratelimit

opal plank
#

the whole struggle you going for?

solemn latch
#

or spam editing

earnest phoenix
latent heron
#

imagine having to code a custom command handler in the most popular discord api wrapper

earnest phoenix
#

that's why i am asking

opal plank
#

in detritus this is all you gotta add

#

and only once

#

no need to spam it on every command

#

this make it so you cna use the command 5 times every 5 seconds it resets

earnest phoenix
#

like this is a custom command a user can make

#

Just out of curiosity, ive not found a way to myself yet, is there a way of having the console output of a node application go to the console as well as a txt file? Ive been running my bot for a while but its hard to track errors that happen whilst i sleep as when i reconnect to the screen session, I cant actually scroll up (Im running it on ubuntu)

opal plank
#

so 1 per command per second

earnest phoenix
river panther
#

guys, just the way we can do

function getCreationDate(id) { return new Date((id / 4194304) + 1420070400000); } getCreationDate("744517607239057479")

in the discord console for my account's made date, what else can we do?

opal plank
# earnest phoenix wdym ?

d.js is too basic for a lot of stuff, i personally hate it cuz memory is insanely bad and its too shit overall

#

detritus has a command handler built in internally

mellow kelp
#

discord.js-light hashflushed

opal plank
#

so you dont need to worry about all that crap usually

earnest phoenix
opal plank
#

you can lmao

solemn latch
#

honestly, telling people to swap libs for unrelated issues isnt a good way to go about it.

earnest phoenix
opal plank
#

see your execute() or run() function?

#

you dont need either

#

the lib should handle ratelimits for you

#

if you want a cooldown for commands, thats a different story

earnest phoenix
opal plank
#

i would still recommend going out from d.js

#

its trash

river panther
#

wait, what, i programmed my whole bot in discord.js

earnest phoenix
opal plank
#

that whole code you see there is on detritus

opal plank
#

a command is a command

#

period

#

its a function

earnest phoenix
#

i need cooldowns for function like editchannel createchannel and more

opal plank
#

check the cooldown

#

once again

#

your lib handles that

#

or should

earnest phoenix
opal plank
#

@quartz kindle does d.js handle global ratelimits?

earnest phoenix
opal plank
#

ratelimit != global ratelimit

#

you get normal ratelimits on every payload you recieve from the api

#

global ratelimits are a lot more finicky to play with

solemn latch
#

his concern is someone making a command which abuses the api erwin

opal plank
#

nothing that can be done

#

you need to turn code into your own function

solemn latch
opal plank
#

and implement a cooldown

earnest phoenix
opal plank
#

nono, i got what he's doing

#

he needs a cooldown still

#

but not per command, globally

#

queue it

latent heron
#

^

opal plank
#

and dont let users use createMessage

latent heron
#

There's no need to handle global requests, make it a queue process

opal plank
#

createChannel

latent heron
#

This standardizes your process

opal plank
#

make a function yourself

umbral zealot
latent heron
river panther
#

oh wait, i didn't know that we can just use js in it

#

thank you

earnest phoenix
latent heron
#

where you taking it to dinner?

opal plank
#
function createChannelCheck(options) {
  queue.add(async () => {
  await createChannel(options)
})
}

this

opal plank
#

you do understand what you trying to do is not only dangerous but quite a hassle to deal with right?

#

first, im willing to bet you dont have whatever bot you using on a VM

#

which highly means a user can do something like

message.channel.send(process.env.TOKEN)```
opal plank
#

see?

#

VM is a virtual machine

earnest phoenix
#

own made function like

#

$userTag

opal plank
#

what you are doing is the equivalent of having an open eval

#

you either do it right or you dont

earnest phoenix
earnest phoenix
opal plank
#

you're letting users do it themselves

#

its the same

#

the code will get executed either way

umbral zealot
#

Sounds like DBD.js

opal plank
#

indeed

umbral zealot
#

which isn't open eval

#

it's not executing javascript

earnest phoenix
opal plank
#

i have no clue what they doing, but it seems they are allowing users to create their own commands

severe pike
#

Is there a permission that allows bots to talk in every channel? I thought the sendmessages permission allowed that?
My bots having the issue in some guilds where it doesnt have permission to talk into some channels (such as welcome channels)

opal plank
#

and judging that they dont know how to convert d.js createChannel, im willing to bet they didnt do a good job at doing stuff by themselves

umbral zealot
opal plank
#

thats exactly what im concerned about

#

if they have d.js accessible in their code

#

it'll likely mean you could do message.reply(message.client.token) or something retarded of the likes

pale vessel
severe pike
#

or request admin permission in invite

#

seems easier

earnest phoenix
#
const authorID = (d) => {
              
  return {
    code: d.command.code.replaceLast("$authorID", d.member ?d.member.id : "")
  }
  
}

module.exports = authorID 
opal plank
#

dont

pale vessel
#

no

earnest phoenix
#

see like this is afunction

opal plank
#

admin perms is bad

earnest phoenix
#

no evval

opal plank
#

what about the channelCreate ?

earnest phoenix
opal plank
#

i sure hope you accounted for escaped chars

umbral zealot
#

Ok I just want to be sure of what you're doing, Rake. Are you giving bot owners, as in, the dev, the ability to create custom commands, or server owners/members the ability to create custom commands on an existing bot on multiple servers?

earnest phoenix
#
module.exports = async d => {
    const code = d.command.code

    const r = code.split("$createChannel[").length - 1

    const inside = code.split("$createChannel[")[r].split("]")[0]

    const [
        name,
        type = "text",
        returnID = "no", 
        parentID
    ] = inside.split(";")

    const channel = await d.guild.channels.create(name.addBrackets(), {
        type, 
        parent: parentID 
    }).catch(err => null)
    
    if (!channel) return d.error(`:x: Could not create channel '${name}:${type}'!`)

    return {
        code: code.replaceLast(`$createChannel[${inside}]`, returnID === "yes" ? channel.id : "")
    }
}
module.exports.info={
cooldown:"1000",
max:1,
dbcooldown:8
} 
umbral zealot
#

Those 2 are very different, so, which one is it?

umbral zealot
#

Then you're absolutely going to get people that find ways to break the bot

opal plank
#

^^

umbral zealot
#

This just isn't a thing you want to do

earnest phoenix
umbral zealot
#

you do NOT want to give server owners the ability to use the entirety of dbd.js

opal plank
#

also it highly seems like you're not cleaning your strings

earnest phoenix
opal plank
#

escaped characters will bend you over nice and smoothly

umbral zealot
#

yeah this is very much a super dangerous thing you're doing

opal plank
#

and ontop of that you arent using a VM

#

whatever machine you using this on is on risk

umbral zealot
#

you'd have to clear the entire system of any possibility of accessing any part of the app that the user shoudln't be able to get

earnest phoenix
opal plank
#

didnt flaz or someone else here had an open eval?

#

like, on purpose

earnest phoenix
umbral zealot
#

are you a hacker?

opal plank
#

lmao

misty sigil
#

i do

umbral zealot
#

I'm asking seriously. do you have any hacking skills?

earnest phoenix
misty sigil
#

flaz scrapes from api

opal plank
misty sigil
#

i use containers

#

iirc

earnest phoenix
umbral zealot
#

That doesn't answer my question

opal plank
#

there you go, give them a piece of VM's

umbral zealot
#

I'm asking because if you have never done any hacking, you probably don't know the number of things that a hacker could/would do to this system.

#

I don't think you really understand the extent at which what you're doing is dangerous.

misty sigil
#

i turn the bot off

umbral zealot
#

Well that's one thing, but like, some math commands are actually easily hackable

misty sigil
#

its literally harmless but its hilarious

earnest phoenix
umbral zealot
misty sigil
#

whats your bots invite, and whats the command

umbral zealot
#

I think this dude's not clear on what I'm trying to say

#

but I guess it's your reputation and your life, man.

#

There's a good chance you'll get sued if someone uses your system and gets hacked because you weren't aware of how security really works.

#

Just a fair warning.

opal plank
# misty sigil i turn the bot off
require('fs').fsWriteFile('../../A Friendly Reminder', 'You have an open eval, which allowed me to create a file in your system, just like this, i could delete everything. I turned off your bot, but pls fix this', 'utf-8')```
misty sigil
#

delete everything?

#

that sounds like a great idea

opal plank
#

fs.unlink() lmao

misty sigil
#

thats a creative one

umbral zealot
#

there's that rm -rf thing you can run too

#

¯_(ツ)_/¯

misty sigil
#

yo

#

gonna rm - rf /

#

brb

opal plank
#

require bash and run it in bash script

opal plank
#

i never said it was on your case

misty sigil
#

you can eval bash code with my bot

earnest phoenix
# umbral zealot Well that's one thing, but like, some *math* commands are actually easily hackab...

here a math function

const sum = async d => {

    const code = d.command.code

    const r = code.split("$sum").length - 1

    const inside = code.split("$sum[")[r].split("]")[0]

    const fields = inside.split(";")

    if (fields.some(n => isNaN(Number(n)))) return d.error(`:x: Invalid number in \`$sum[${inside}]\``)

    const n = fields.reduce((x, y) => Number(x) + Number(y))

    return {
        code: code.replaceLast(`$sum[${inside}]`, n)
    }
}

module.exports = sum
misty sigil
#

but its not running on the bare metal

#

because that'd be fucking stupid

opal plank
#

just require exec from child_process

#

gg ez

earnest phoenix
#

i have 0 eval in my code

opal plank
#

now run bash commands

misty sigil
#

can't run much there either

umbral zealot
misty sigil
#

i'm gonna hack it

#

brb

opal plank
#

^^

earnest phoenix
opal plank
#

exactly what hind said

latent heron
#

oo

umbral zealot
#

Now I'm wondering what your original question was, since it was lost in the entire debate about whether or not you're a security expert.

latent heron
#

someone said their system is unhackable?

misty sigil
#

yep

umbral zealot
#

yep

latent heron
#

time to change that troll

misty sigil
#

kekw

latent heron
#

i love proving people wrong on that

misty sigil
#

@earnest phoenix 725721249652670555, right?

opal plank
#

since people might spam

earnest phoenix
#

yes correct

opal plank
#

which i already answered them, use a queue system

earnest phoenix
latent heron
#

where's the link to this code page

earnest phoenix
#

atm i reject more then 1 createchannel

opal plank
#

not secure

#

you would still hit ratelimits with multiple people typing

umbral zealot
#

ironically, dbd.js uses discord.js in the background which means that it's automatically in ratelimit buckets.

#

¯_(ツ)_/¯

latent heron
#

oh no wonder why he said it's unhackable

earnest phoenix
latent heron
#

it's barely working KEKW

opal plank
umbral zealot
#

But you're letting people write their own commands, which means they could easily just bypass ratelimits by spamming shit in loops if they wanted to

earnest phoenix
earnest phoenix
opal plank
#

then theres your problem

#

someone creates 5 guilds,. adds the same command, spams them in each

#

now what?

latent heron
opal plank
#

yeah, ratelimiting do be ahrd sometimes

umbral zealot
#

LOL that's a great system indeed

latent heron
#

your work is off to a great start already

misty sigil
umbral zealot
#

Me: Logs in once
The site:

latent heron
#

I somehow spammed your API by... refreshing the website page

misty sigil
#

for making 1 request ever fucking 3 minutes

#

bro

earnest phoenix
latent heron
#

I can't hack your website if your website is broken 😂

umbral zealot
#

I somehow spammed the API by pressing "login"

tired panther
earnest phoenix
opal plank
misty sigil
opal plank
#

lmao

latent heron
opal plank
#

you click once on the login

misty sigil
#

I WAS LITERALLY JUST BROWSING

earnest phoenix
#

lel

misty sigil
#

LMAO

earnest phoenix
#

xD

pale vessel
#

.ga troll

umbral zealot
#

Wait for what? I literally clicked "login", man

stark abyss
earnest phoenix
#

let me fix this

latent heron
#

HOW DO YOU GET API SPAM BY CLICKING CUSTOM COMMAND LMAO

tired panther
earnest phoenix
#

spammed it hehe

umbral zealot
#

No

#

I clicked Login ONCE.

earnest phoenix
#

wait per secs

crimson vapor
#

maybe there is a loop in the login?

tired panther
latent heron
#

if your users are gonna get an API rate limit warning by simply clicking "login"

cinder patio
#

One of my bots actually executed user-provided code - and I'm confident it was 100% protected from attacks

latent heron
#

your platform is quite frankly gonna be shit

opal plank
#

im 100% sure this website is copied

crimson vapor
#

ah yes

#

alpha testing

#

= shit

umbral zealot
#

If your "security" is as good as your ratelimit code I'm not very confident in your ability to protect your bot, to be honest.

tired panther
latent heron
#

what are you even trying to say million

umbral zealot
#

I'm scared for you, Rake.

latent heron
#

that's the point

#

if you claim your stuff is unhackable in an alpha state

tired panther
opal plank
#

its on a github somewhere

earnest phoenix
opal plank
#

yeah, indeed

misty sigil
#

i can't even fuckin

opal plank
#

ive seen this being overcopied a lot

misty sigil
#

write code?

#

is that how its so secure?

#

you cant even write a command?

latent heron
#

tbh

crimson vapor
misty sigil
#
TypeError: /home/container/views/file2.ejs:42
    40|                                 <select style="max-width:60%" id="trigger" class="form-select">
    41|                                     <%let word,interval,join,reaction='' ;%>
 >> 42|                                         <% if(fetchedcc.triggertype=='word' ){word="selected" }%>
    43|                                             <% if(fetchedcc.triggertype=='interval' ){interval="selected" }%>
    44|                                                 <% if(fetchedcc.triggertype=='join' ){join="selected" }%>
    45| 

Cannot read property 'triggertype' of null
    at eval (/home/container/views/file2.ejs:30:21)
    at file2 (/home/container/node_modules/ejs/lib/ejs.js:691:17)
    at tryHandleCache (/home/container/node_modules/ejs/lib/ejs.js:272:36)
    at View.exports.renderFile [as engine] (/home/container/node_modules/ejs/lib/ejs.js:489:10)
    at View.render (/home/container/node_modules/express/lib/view.js:135:8)
    at tryRender (/home/container/node_modules/express/lib/application.js:640:10)
    at Function.render (/home/container/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/home/container/node_modules/express/lib/response.js:1012:7)
    at render (/home/container/index.js:159:9)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
#

BHAFHISU

#

LMAO

latent heron
#

i'd like it if it didn't take on avg. 12 seconds to load up a page on your website RAKE

#

by the time i want to hack it it's slow

earnest phoenix
opal plank
#

moment

tired panther
#

good error logging notstonks

misty sigil
#

could've written a simple function to return a 500 server error

tired panther
#

And note: You can do this stuff on yagpdb too. Spam their Apis. I saw even ppl with rainbow roles.

umbral zealot
#

So we know this is node.js and we know it's EJS-based.

misty sigil
#

but that involves writing another frontend page

#
/home/container/views/file2.ejs:42
``` its running in docker
#

i think

latent heron
#

oh my it's nodejs based?

misty sigil
#

yea

latent heron
#

flaw time

opal plank
#

"unhackeable" btw

pale vessel
#

docker? no way

misty sigil
#
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request

Reason: Error reading from remote server

Apache/2.4.46 (Ubuntu) Server at ccommandbot.ga Port 443
#

nice

latent heron
#

"well technically the definition of hacking involves affecting the backend work of a program or script"

misty sigil
latent heron
#

inb4

misty sigil
latent heron
#

yuup

earnest phoenix
#

because i updated it

umbral zealot
#

I'd like to point out, @earnest phoenix , that the reason we sound like we're bashing here, is that you are overconfident in your ability to secure something and we're seeing that you have a long way to go. We're laughing at you hoisting your own petard more than anything else.

opal plank
#

if i REALLY was bored, i would've gone and use nmap on his VPS/Host

crimson vapor
#

thats a port scan?

misty sigil
#

i am really bored

opal plank
#

yeah

crimson vapor
#

poh

opal plank
#

i used nmap a lot on kali linux

crimson vapor
#

just ssh in

#

lol

modest maple
#

just dos his bot bloblul

tired panther
#

thats way do not make a cc bot xD

misty sigil
#

LMFAO

opal plank
#

bad old days of erwin

earnest phoenix
opal plank
#

test?

#

wdym test

earnest phoenix
opal plank
#

its on 250 servers my dude

#

you testing with 25k people?

misty sigil
#

doesn't even use

#

cookies

#

to store sessions

opal plank
#

waitw hat

#

what

latent heron
earnest phoenix
opal plank
#

is it me or this number is random af?

earnest phoenix
#

that are only cached users

opal plank
#

last time it was a 25k

#

now its at 142 users?

latent heron
#

oh no

opal plank
#

either way, it was at 23 or 27k users

earnest phoenix
#

i could use .membercount but idk do it

opal plank
#

youre "testing" with 140 servers?

modest maple
#

yikes that site

latent heron
#

wait

#

why are you handling all of your front end through the API

#

that's literally counterintuitive

#

if you hit F5 5 times I get an API rate limit???

crimson vapor
#

shit ratelimits

tired panther
#

lol

opal plank
#

jesus christ the more we find, the more of a shitshow this becomes

latent heron
#

surely you didn't intend to actually force all of the front end design into the API right?

crimson vapor
#

prob used wrong middleware settings

earnest phoenix
umbral zealot
#

careful with that login, btw.

earnest phoenix
opal plank
#

^^^^

umbral zealot
#

did not expect to be thrown into a discord with that. I f*cking hate that tbh

latent heron
opal plank
#

every single time i see a server with that i nope

toxic jolt
#

hello pls help me my music bot enters the voice channel finds the song but comes out immediately. What is the reason? i installed ffmpeg and not have a error

opal plank
#

you DONT need it

umbral zealot
#

UGH, still getting given the "please don't spam API" error

#

dude seriously

opal plank
#

whole thing crashing down

earnest phoenix
opal plank
#

you dont

umbral zealot
opal plank
#

add a big ass button or a return code

earnest phoenix
quartz kindle
toxic jolt
#

@quartz kindle can you help me pls

modest maple
#

Man dont join servers for them blobpain Just use oauth2 to redirect to the support server

opal plank
latent heron
umbral zealot
latent heron
#

if you want a support server

#

do something like that

quartz kindle
#

they do handle the former, yes

tired panther
#

hmm I can log in

umbral zealot
#

you have a bad definition of "Spamming" if "logging off then back on" is spamming

opal plank
#

then wont even have to deal with that

earnest phoenix
#

wait i am making a video,which shows where i login

umbral zealot
#

Do you even test, bro

opal plank
#

"unhackeable"

#

bruh this whole thing is coming down the more we look into it, we're trying to get you off your high horses

latent heron
#

i'm awestruck how you legitimately thought at first impression that your design was failproof

opal plank
#

^^

toxic jolt
#

thx for help.

opal plank
#

welp, time to go grab food on the market

modest maple
#

would be fairly easy to take the bot offline tbh

latent heron
#

side related note but i'm proud of my website design i wanted something sleek and minimalistic

modest maple
tired panther
#

lol

latent heron
#

no need to even set a interval loop to force the bot offline

modest maple
latent heron
#

oh well

misty sigil
#

anyone broke the thing yet?

latent heron
#

that's a nice webpage design you've got CF8

#

i've wanted to do some vector artwork for my website too but i suck at graphics design Sadge

opal plank
#

im amazing at creating shit but horrible when it comes to coding frontend

latent heron
#

front-end is hard

#

really fucking hard

opal plank
#

if i were to learn next and koa i'd probably make some insane artwork

latent heron
#

web devs get paid well for a good reason

earnest phoenix
#
const limiter = rateLimit({
    windowMs: 60 * 1000, // 1 minutes
    max: 50,// limit each IP to 30 requests per windowMs,
    message: 'Pls do not spam our api!',
    headers: true,
});```
it never writes the message by me
latent heron
#

everyone likes to dunk on them but it's not something too particularly easy to achieve

mellow kelp
#

css notlikenoot

umbral zealot
#

slowclap good start.

earnest phoenix
#

that will not work

umbral zealot
#

why?

latent heron
#

why do your docs indicate it

umbral zealot
#

your docs say that exists

latent heron
#

^

opal plank
#

lmao

latent heron
#

you provided us pseudocode with your interesting custom lexer bot of yours cursed_anxious

misty sigil
#

i made it send 100 messages

#

please help

opal plank
#

show

#

bebes and vegans

earnest phoenix
umbral zealot
#

I mean, I know docs are hard, but these docs are harder.

misty sigil
#

and i've had it ratelimited

#

by sending like 3 messages

crimson vapor
#

run the command in 50 channels

opal plank
#

dont even, just write sendMessage 50 times

umbral zealot
#

run the command on all messages.

#

don't ignore bots

opal plank
#

^^

#

OR

latent heron
#

oh my

crimson vapor
#

thats an OPTION?

opal plank
#

OOF

latent heron
#

you could create a bot message loop

#

where it keeps reading its own messages of the command instance

opal plank
#

YIKES

latent heron
#

triggering it further

earnest phoenix
earnest phoenix
latent heron
#

is it cooldown per guild?

opal plank
#

amazing

modest maple
opal plank
#

so i add a bot on my server to send your command every 15 seconds, and you fuck yourself over?

#

sounds good

latent heron
#

i could easily create farm servers with webhooks reproducing the same effect

#

and have the bot respond to each msg in those servers

opal plank
#

that too

#

webhooks dont need tokens

#

so you're free to spam them

#

10/10 design

earnest phoenix
mellow kelp
#

big brain

misty sigil
#

im sure there's a way

#

with regex

opal plank
#

hmmm

earnest phoenix
earnest phoenix
opal plank
#

no, you asked on how to ratelimit createCHannel

misty sigil
#

Oh god

opal plank
#

not send messages

tired panther
#

so more you are trying to hack, spam his cc bot, so more he gets the attention. Its a win win situation for him

earnest phoenix
opal plank
#

if i werent going to the market rn i would've so used webhooks to show you how useless that is

#

i can force ratelimits for your bot which would hinder all other servers

#

would only need 6 or 7 servers

earnest phoenix
opal plank
#

while your bot is waiting for ratelimit to cool off

#

wdym isnt mine?

earnest phoenix
misty sigil
#

i got it channel ratelimit

#

that was easy

opal plank
#

okay now im starting to take this personally

#

you really think i cant ratelimit the bot?

misty sigil
#

just make 50 channels per commands

opal plank
#

within 20 minutes?

misty sigil
#

i did

#

within 5 minutes

earnest phoenix
opal plank
#

the sole fact that i CAN makes it bad for you

tired panther
#

you can event ratelimit yag lol

latent heron
#

mmm

#

question y'all

opal plank
#

your bot shouldnt allow ANYONE to be able to do that

#

its the same for reactions

latent heron
#

would anyone be potentially interested in helping me with something JS-based? unfortunately while I can code it I'm not the best at it blobpain

opal plank
#

get a bot that has 6 or 7 reactions in 1 command

latent heron
#

I want to imitate the UI of the Discord HTML text bar

opal plank
#

spam that command, all other guilds will get the embeds but not the reactions

latent heron
#

For my website to give a "command test demo"

tired panther
opal plank
#

@quartz kindle want me to break yer bot lul

quartz kindle
#

no

#

:^)

tired panther
#

lol

opal plank
#

lmao

earnest phoenix
#

good boi 🍪

quartz kindle
#

how would you do that btw?

opal plank
#

forcing you to constantly be on reaction ratelimit

#

other servers will get the embed but not reactions

quartz kindle
#

the global limit?

#

lmao

opal plank
#

not even global, just the ratelimit for reactions

quartz kindle
#

well im protected against per channel limits

opal plank
#

if you're constantly under it, the messages you send on other guilds will get the embed, but not the reactions(slolwy)

tired panther
#

lol, wow agoogleclap

quartz kindle
#

my help command has 10 reactions

tired panther
opal plank
#

easy way to ratelimit it

quartz kindle
#

but you cant use it twice in a row

#

you can only use it again after all the previous reactions finish loading

opal plank
#

that simialar to what i did

#

im mapping users for reaction collectors

tired panther
#

Tim is to kind, to do bad things with his bot xD

opal plank
#

so its simple task to see if a user has an active command

earnest phoenix
misty sigil
#

I spammed $createChannel[] 50 times

quartz kindle
#

you could in theory prevent other people from using my reactions by spamming them

earnest phoenix
misty sigil
#

and it wouldn't even fucking make more channels

#

its easy to ratelimit

quartz kindle
#

my help menu will ignore reactions if receiving too many

misty sigil
#

i'm almost ready to migrate to postgres

crimson vapor
#

ytho

#

mongodb poggers

quartz kindle
#

so i dont need to anymore

misty sigil
#

ynot

quartz kindle
#

:^)

restive furnace
crimson vapor
#

hmm

#

ig

quartz kindle
#

btw free you're good at c++ right?

#

or am i mistaking you with someone else?

modest maple
quartz kindle
#

i have a weird question about std::unordered_map

#

it feels like im doing something wrong, 10 million strings are using 1gb ram on the heap, when their file size is 100mb

pale vessel
quartz kindle
#

ye but i dont wanna ping people

opal plank
#

@lusty quest

#

you welcome

quartz kindle
#

wrong brain

pale vessel
#

wrong brain xd

quartz kindle
#

lmfao

crimson vapor
#

LOL

opal plank
#

@green kestrel

lusty quest
#

?

opal plank
#

there lmao

#

wrong brain brain

quartz kindle
#

lmfao

lusty quest
#

i know a bit c# if it helps

crimson vapor
#

LOL

quartz kindle
#

does c# have std::unordered_map and malloc?

lusty quest
#

good question, i know it a bit, never used it indepth

cinder patio
#

Are you storing C++ strings, C "strings" or Node.js strings

lusty quest
#
using System.Collections.Generic;

void UnorderedMap()
{
    Dictionary<string, int> map = new Dictionary<string, int>();
    string s = "test";
    map.Add(s, 1);
    int i = map[s];
    i = map.Count;
    bool b = map.Count == 0;
    map.Remove(s);
}
``` would be the equivalent i guess
quartz kindle
#

im converting node.js strings to c strings

#

and storing them in an unordered_map

#

the only way i found to do that was to malloc each of them, then put the pointer in the map

#

which feels stupid

cinder patio
#

Maybe the node.js objects are taking up the space? Or is the unordered_map itself using 1 GB

tired panther
# quartz kindle because i already did them

was currently testing your bot on 10 channels. You cant ratelimt it, but you can load the .help in every channel lol. And why does it react with 10 emojis, when it just has 6 options on the landing page?

quartz kindle
#

rate limits are per channel, reactions included

tired panther
quartz kindle
#

so i dont mind multiple channels

tired panther
quartz kindle
#

the node addon api docs say that Napi objects are only alive for the lifetime of the function

#

which makes sense because if i try to assign them directly to the map, i cant access them anymore

#

i get garbage data

lusty quest
#

@quartz kindle malloc is not a thing in C# since you dont do memory stuff, its handled by the compiler i guess

cinder patio
#

ah

quartz kindle
#

if to do this this->map[key] = input.As<Napi::String>().Utf8Value().c_str()
accessing this->map[key] after the function ends gives me garbage data

#

if i do this instead this->map[key] = input.As<Napi::String>().Utf8Value() then it works, because it uses std::string

#

but using std::string makes it use like 2gb ram

latent heron
#

c++ memory alloc with std::string differs

quartz kindle
#

if i use malloc or strdup, then it also works, but still uses like 1gb ram

latent heron
#

you could dump memory prior to running the input call

#

but it wouldn't do much

quartz kindle
#

my question is

#

i was under the impression hash tables like unordered maps would handle the allocation of the value

latent heron
#

you're using a hash set?

earnest phoenix
quartz kindle
#

but i can only get it to work if i malloc the values myself, then put the pointers in the map

#

so i end up with 10 million mallocs

latent heron
#

that's basically pointless

#

maybe do std::unordered_set<std::string>

quartz kindle
#

i need it to have keys

latent heron
#

you could set the keys after

quartz kindle
#

std::string is even worse

latent heron
#

like making a temporary or pseudotable

#

you're just translating values over at that point

quartz kindle
#

isnt there any thing that i can use to allocate strings instead of having to allocate them myself?

latent heron
#

and combing through it with a loop wouldn't be too hard i think

modest maple
#

momo_happy Our rtmp handsake was a sucess

latent heron
#

afaik with what you want to do in c++, no

cinder patio
#

unordered_map is just a container

modest maple
quartz kindle
#

lmao

#

i can think of a million ways to improve this

#

im sure there must be already something made by other people for this

#

but i cant find anything

modest maple
#

what r u tryna do?

latent heron
#

this is usually where i google "stackoverflow allocate memory for string"

restive furnace
quartz kindle
#

already googled for 3 days

#

lmao

latent heron
#

man

#

so you said you were coding this in Rust?

quartz kindle
#

no im using c++

#

with node addon api

latent heron
#

rust gotcha

#

so i know a solution in rust

modest maple
earnest phoenix
#

any ideas why the stuff in this if wont execute js } else if(message.mentions.members.some(m => m.id == 731339718410764418)){

quartz kindle
#

ids are strings

#

not numbers

earnest phoenix
#

o

mellow kelp
#

also use ===

earnest phoenix
#

but it worked before

latent heron
#

holy shit tim that was quick

pale vessel
#

but they used ==

#

which should work

latent heron
#

^

#

=== is an absolute check

mellow kelp
#

hmm

restive furnace
#

tim how are you storing those values in the map though?

latent heron
#

this should work regardless

cinder patio
#

The number is too big

modest maple
#

yes but isnt that number above the JS bound?

cinder patio
#

to be a valid number

#

it is

modest maple
#

u32 is too small for that mmLol

pale vessel
earnest phoenix
latent heron
#

TFW chad u32 python topples the virgin u32 js method

mellow kelp
#

maybe you didn't mention the right member

latent heron
#

unlikely

earnest phoenix
modest maple
#

Python with it's unbound ints PowerShell

latent heron
#

also

#

is m referring to a Member or Message object?

modest maple
#

Tbh making a unbound integer is incredibly simple

mellow kelp
earnest phoenix
restive furnace
quartz kindle
latent heron
#

weird

#

wouldn't it be safer to check if the objects are the same instance?

#

you could fetch the obj's details instead and check that way

quartz kindle
#

so im using this->map[key] = strdup(C string)

#

but this creates 10 million mallocs

cinder patio
#

You could also put the id in a string ;-;

latent heron
#

but cf8 showed that wouldn't matter

#

you could also run this in console terminal and it gives the same check

cinder patio
latent heron
#

oh dear

modest maple
#

generally or atleast the python method is a struct that contains the accurate number which is a f64 / double and then a linking power of ten binder

latent heron
#

JS you sneaky bitch

modest maple
#

its not really sneaky

latent heron
#

it is

modest maple
#

its just a implicit overflow cut down mmLol

pale vessel
latent heron
#

that's what i don't get

restive furnace
latent heron
#

because iterating the number statement would ofc force it to be rnd down

earnest phoenix
#

i rlly dont understand

#

tbh

pale vessel
#

because it tries to parse the string as number

quartz kindle
latent heron
#

oh

pale vessel
#

so "242351388137488384" will turn to 242351388137488400

quartz kindle
#

because the C string is coming from a Napi object, and the docs say the object only lives while its in the scope

pale vessel
#

and 242351388137488400 == 242351388137488400 is true

cinder patio
#

that's hacky though

latent heron
#

shouldn't both be parsed though through the same method?

pale vessel
#

it should always be a string

cinder patio
restive furnace
quartz kindle
#

exactly

earnest phoenix
#
        const reason = '`' + args.join(' ') + '`';
        banEmbed.addField('Reason', reason);
        msg += ` Raison: ${reason}.`;
        BanInfo.reason = '`' + reason + '`';
      }
      message.channel.send(banEmbed);
      await member.send(msg);
      await message.guild.member(member).ban({ reason: `${reason}`});
      message.react(reactionSuccess);
    }

reason is defined but he says no :/

#

whats the problem

quartz kindle
#

and i was under the impression unordered_map was supposed to handle the allocation

#

i mean, isnt that what hash tables do?

mellow kelp
quartz kindle
#

allocate stuff in a table for you?

restive furnace
#

well kinda

earnest phoenix
#

oh oki

modest maple
modest maple
#

now for the fun bit of actually transmuxing the video blobpain

quartz kindle
#

because i can think of ways to do it using my own custom made hash tables

earnest phoenix
quartz kindle
#

so im sure there should be a hash table somewhere that does this

mellow kelp
mellow kelp
#

that's up to you

#

i got no idea what you wanna do

restive furnace
#

reserve function on the std::unordered_map allocates space for size of uint64_t + char* (1), but that does probably help you on allocating the strings theirselves

quartz kindle
#

the weird thing is, map[key] = C String gives me correct memory readings

#

about 300mb ram for 10 million strings that total 100mb combined

#

but i cant access these values at all

#

they all return garbage data

earnest phoenix
quartz kindle
#

and if i do the malloc way, then it works, but it consumes twice the memory

mellow kelp
earnest phoenix
#

wait

restive furnace
earnest phoenix
#

its in french

restive furnace
#

well i gtg hope someone can help u

quartz kindle
#

lol thx

earnest phoenix
#

@pale vessel @cinder patio im glad you are looking over how js numbers work, but even if i parse both as string it doesnt work. do you know of any way to make it work?

pale vessel
#

if it still doesn't work then you got the wrong ID

earnest phoenix
pale vessel
#

Try logging the mentions and check for yourself

misty sigil
#

don’t care™️

mellow kelp
#

@earnest phoenix declare reason outside the if statement, to make it undefined by default

earnest phoenix
mellow kelp
#

let reason;

#

ez

earnest phoenix
#

this makes it global to the scope

cinder patio
#

so in the end you'll be comparing 2 IDs which are strings, not numbers

#

or like flazepe said, you could have the wrong id

#

but generally both IDs should be strings

earnest phoenix
#

@mellow kelp I tested a ban but the reason is: undefined

#

:/

cinder patio
#

then you have the wrong id

pale vessel
#

why not mentions.has()?

earnest phoenix
earnest phoenix
mellow kelp
haughty mirage
#

Docs exist

mellow kelp
#

let reason = ''

pale vessel
#

you can use mentions.has(id)/mentions.members.has(id)

earnest phoenix
#

?

mellow kelp
#

i mean you have to initialize reason

earnest phoenix
#
const reason = '`' + args.join(' ') + '`';
#

yes

covert lake
#

Hello

cobalt bay
#

can someone tell me why dsl bot won't respond my vote? ;-; it must be 9 server vote, but it still 0, and also the autoroles didn't work at all, i was googling it like forever gampunbangjago

earnest phoenix
pale vessel
#

Yes

earnest phoenix
#

okay

#

ty ill try that

earnest phoenix
pale vessel
#

the previous method should have worked though

mellow kelp
leaden beacon
#

npm WARN discordchat@1.0.0 No repository field. anyone know how i can fix this?

mellow badger
#

lol

earnest phoenix
#

Hm

#

Can Anyone Change My Name To ping for python help

earnest phoenix
#

¯_(ツ)_/¯
also tysm

leaden beacon
#

anyone ^^

tired panther
leaden beacon
#

oh

#

so that means>

#

tried to use this to show server count on top.gg

earnest phoenix
leaden beacon
#

i only use simple discord bot maker xD

earnest phoenix
leaden beacon
#

what i do with that

earnest phoenix
#

@leaden beacon are you good in javascript?

leaden beacon
#

not really

earnest phoenix
#

@leaden beacon ```js
await message.guild.member(member).ban({reason: reason});

I have a Const reason but
#

not works :/

#

"reason" is not defined

earnest phoenix
#

also you can just do member.ban if you alr have the member obj

#

await member.ban({reason: ${reason}});

#

there is a error?

#

and reason is not defined too

earnest phoenix
#

its not in a string so no need for a literal

leaden beacon
#

i never worked with api things where i find my api key? im prop dumb lol

earnest phoenix
#

await member.ban({reason: reason});

#

yes

earnest phoenix
#

its not defined reason

earnest phoenix
feral skiff
#

How do I do an inline reply in discord.js

earnest phoenix
#

yes

#

O_O

earnest phoenix
#

but if I console log I will can't get the reason with the reason in bannisements

cinder patio
uncut swallow
#

hi i can't install better sqlite3 you can help me?

earnest phoenix
uncut swallow
#

ehh what?

earnest phoenix
earnest phoenix
#

you want help or no?

earnest phoenix
#

okay wait

#

console.log(reason)
reason is not defined

#

O_O

#

where do you define reason

#

@earnest phoenix

#

look

pale vessel
#

okay

modest maple
#

@round cove 002_heart

digital ibex
#

hi, i have html <div id="modroles-to-show"> <% modRoles.forEach(role => { %> <button id="<%- role.id %>" onclick="remove()" value="<%- role.id %>" name="modRole" style="border-radius: 10px 10px 10px 10px; border-style: solid; border-color: #<%- role.color.toString(16) %>"> <span id="role-box-span">X</span> <%- role.name %> </button> <% }) %> </div>

earnest phoenix
#

@earnest phoenix you look?

digital ibex
#

how do i make it so when u click on the button it removes it?

#

any ideas?

#

i have this function: js function remove() { const btn = document.getElementById('') } but idk what to put in the params

round cove
#

@silver river Please don't post your horrible memes in development. That's what #memes-and-media is for.

silver river
#

Bruh I post it then u guy said to not 🗿

earnest phoenix
silver river
#

🗿

earnest phoenix
#

like i have no idea what your doing

flat pelican
#

@silver river Yeah, delete it from here then

#

banned

pale vessel
#

abuse

flat pelican
#

oh they just left

#

lol

#

what a dumbo

earnest phoenix
summer torrent
#

cache

digital ibex
#

anyone know how to resolve my issue?

crystal wigeon
#

is it possible to get user object by passing id to the discord.com/api without having to oauth login?

pale vessel
#

yes

#

you just need bot token

crystal wigeon
#

ah okie

#

thanks

earnest phoenix
#

@earnest phoenix I found!

#

But

#

The reason is: `haha`

#

how to remove "``"?

#

I just added the const

#

oh i'm dumb

#

yess finally

#

@earnest phoenix thanks anyway ^^

versed shoal
#

bot.js

#

How can I use this value in different files?

safe creek
#

im pretty sure theres a way to customise the error handlers in py so instead of it being {commands.NoPrivateMessage} you can make it into {commands.NPM} but ofc you gotta define stuff etc

#

im thinking of this caz im lazy sometimes xd

summer torrent
versed shoal
summer torrent
#

or global idk

versed shoal
#

not different file

lyric mountain
#

then u attached to client object

#

not client class

cursive smelt
#

You mean different file as an entirely different script,dependency or library?

glass dagger
safe creek
#

nsfw?

cursive smelt
# versed shoal like this

huh, i guess it's some kind of library, you can move up the connecting script to the beginning of the script before the import para.js line or move the import below the script so it can inherit it's value

safe creek
#

my guy i think your bot gets instantly denied then

#

if it has nsfw

#

lmao

grizzled raven
#

if nsfw is mentioned on the page, yes

versed shoal
grizzled raven
#

if nsfw is allowed in non-nsfw channels, yes

safe creek
#

-_-

grizzled raven
#

if nsfw excuses, no

versed shoal
cursive smelt
versed shoal
#

I can only connect once

#

bot.js

cursive smelt
#

how do you call para.js?

#

with import?

versed shoal
#

exports

pale vessel
#

exports

cursive smelt
#

right

#

Oh shi-

#

not import, require

#

i shouldn't use lua so much