#development

1 messages · Page 1986 of 1

spark flint
#
boreal iron
#

SHGUT IOUPPDSF

sudden geyser
#

It is a bad change imo (as stated above), but I don't think I'm going to convince you.

wheat mesa
#

I don’t think you can convince me on this one :p

quartz kindle
spark flint
#

i don't think its in regular djs yet

#

but isn't v14 coming out next week or some shit

quartz kindle
#

you can still use it in regular djs

#

by using raw stuff

boreal iron
# spark flint https://www.npmjs.com/package/discord-modals

You can also work with the api using djs

        client.api.interactions(interaction.id, interaction.token).callback.post(
        {
            data:
            {
                type: 9,
                data:
                {
                    title: "Feature customization",
                    components:
                    [
                        {
                            type: 1,
                            components: [component]
                        }
                    ],
                    custom_id: "modal_config"
                }
            }
        });
quartz kindle
#

^

lyric mountain
#

like this

wheat mesa
#
boreal iron
#

The only issue is, you also need to create your own (ws) event listener for the INTERACTION_CREATE create event

#

As djs one will throw an error for a modal itneraction

spark flint
#
  if(modal.customId === 'modal-customid'){
    const firstResponse = modal.getTextInputValue('textinput-customid')
    await modal.deferReply({ ephemeral: true })
    modal.followUp({ content: 'Congrats! Powered by discord-modals.' + `\`\`\`${firstResponse}\`\`\``, ephemeral: true })
  }  
})```
boreal iron
#
client.ws.on("INTERACTION_CREATE", async (interaction) =>
{
    if(!interaction.type || interaction.type !== 5) return;
    
    console.log(interaction, interaction.data.components[0].components[0].value);
});
#

You could create "another" event listener just for modals

earnest phoenix
#

v14 is literally right around the corner, so no need to really use those NPM packages or hacky methods

spark flint
#

will use v14 for it when its out

boreal iron
earnest phoenix
boreal iron
#

But makes djs a little bit useless

quartz kindle
#

fun fact: im testing raw socket performance in multiple discord libs, and djs is actually one of the fastest

earnest phoenix
boreal iron
#

SHUT UP

#

MR ERWIN

quartz kindle
#

detritus is the slowest according to my tests

boreal iron
#

Erwins ghost is everywhere

earnest phoenix
#

lol

boreal iron
#

ffs

earnest phoenix
#

SHUT UP TIMOTHY

wheat mesa
#

Detritus has great design though

#

Djs feels janky after using detritus

earnest phoenix
#

Detritus has become my sleep paralysis demon

green pebble
#

Btw did this work? Does importing stuff work? (Sry im jus tryna do smthg moderately similar)

wheat mesa
#

Not to mention it gets new features very quickly

#

And you basically have direct contact with the sole dev since it’s a small library (in terms of people that use it)

boreal iron
#

nobody cares ffs

quartz kindle
#

detritus might be great

#

but once you go raw, you never go back

sour summit
wheat mesa
#

Nothing can ever convince me to go to using the raw api after seeing the dumpster fire of docs that discord has

#

Not the worst I’ve seen though

earnest phoenix
#

Can't wait for discord.js' utility method .createAPerfectBotForMe()

boreal iron
sudden geyser
#

I like the raw api

#

almost

#

I like having the gateway and http requests abstracted away

wheat mesa
#

Discord is very finicky with their requests

sudden geyser
#

but more like an IO library where all the API calls are mapped

wheat mesa
#

I lowkey want to make my own lib just to learn but that’s a massive project and requires planning that I’m too lazy to do

lyric mountain
#

tf this useful

#

am delving groovy docs, I stumble upon stuff all the time

boreal iron
#

WOW HOW USEFUL

#

IMAGINE ADDING 86400s to the current timestamp (s)

#

To add 24h

earnest phoenix
#

tempo de execucao

boreal iron
#

How complicated

lyric mountain
#

why make big multiplications when u can just write in english

earnest phoenix
earnest phoenix
earnest phoenix
#

Turing complete esolang

earnest phoenix
quartz kindle
#

Read "Brainfuck" article on Esolang wiki.
This is a Brainfuck interpreter.

#

looks legit

boreal iron
earnest phoenix
#

Gotta love mediawiki, it's so damn old it doesn't even know how opengraph works

sudden geyser
#

I don't think they use opengraph

spark flint
#

is it possible to stop axios logging when it gets a 404 error

#

i'm using the anti-phish api which returns 404 when scam not detected

boreal iron
#

catch the errors?!

earnest phoenix
#

Check the response status, if it equals 404, return or just don't log

earnest phoenix
spark flint
#

i'm not logging anything tho

#

there is no console.log

sudden geyser
#

oh yeah they do

#

well they've customized it to hell

earnest phoenix
earnest phoenix
spark flint
#
        const response = await axios({
            method: 'post',
            url: `https://anti-fish.bitflow.dev/check`,
            data: {
               message: message.content
            },
            headers: { "User-Agent":"Blacklister - https://blacklister.xyz" }
        })

        if (response.data.match) {
            await message.delete()
            let embed = new MessageEmbed()
                .setTitle("Scam Message Deleted!")
                .setDescription(`<@${message.author.id}>, you can't send scam links!`)
            await message.channel.send({embeds:[embed]})
            await message.author.kick("[AUTOMOD] Scam link detected")
        }```
earnest phoenix
earnest phoenix
#

I presume it's an error, not a log

spark flint
#

yeah error

#

but under that

earnest phoenix
green pebble
earnest phoenix
#

Detritus has docs that make top.gg look good but all the bots I've seen made with it are actually pretty cool

#

Meanwhile djsguide

earnest phoenix
sour summit
sour summit
earnest phoenix
#

Please don't use important

boreal iron
#

Explain why, Indian tech supporter

#

Of course you gotta overwrite the privously loaded font family as you can't overwrite it

sour summit
green pebble
#

Ignore that it's mobile lol

#

While the link contains this

lyric mountain
#

the longdesc exists inside a div, you don't need to write a full html structure in it

#

and I don't think css import works there

sour summit
green pebble
boreal iron
#

A class name starts with a dot or hash for an ID

lyric mountain
#

head will be ignored entirely

#

and css import probably doesn't work at all

#

worth a try tho

sour summit
#

i can try for him

green pebble
green pebble
lyric mountain
#

so I don't need to update on both sites

#

didn't work at all

#

@boreal iron it doesn't stop getting better

green pebble
lyric mountain
#

that's some deliciously convenient lang

green pebble
lyric mountain
#

ye, iframe

#

embed too, but that one is deprecated by a long shot

#

without js to fetch the readme's plaintext and insert into longdesc I don't think I can

boreal iron
green pebble
lyric mountain
#

github pages uses normal .md files

#

basically a sub-repository in ur repo

boreal iron
#

haven't really follow this chat anyways, what is he trying to do anyway?

green pebble
sour summit
#

alright i made this work (kinda)

<style>
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

body * {
  font-family: "Montserrat", san-serif !important
}
</style>
boreal iron
#

remove the head tags

#

instead of any body children do

sour summit
#

try copying this to your code and the font you want should work, i recommend importing fonts from google fonts

boreal iron
#

html, body

spark flint
#

fun errors

green pebble
boreal iron
#

If you wanna import them from google, use the link element

green pebble
sour summit
spark flint
boreal iron
#

i recommend importing fonts from google fonts

sour summit
#

what are you achieving sir...

boreal iron
#

GOOGLE

green pebble
green pebble
sour summit
#

;-; ok tell me what do want like what font????????

boreal iron
#

wut

sour summit
#

how do you want the page to look like...

boreal iron
#

take a font you like or stay with the one topgg uses

sour summit
#

you talking to me or that guy...?

#

well i actually love metropolis and montserrat this is few of my design recommendations

boreal iron
#

aye

#

I'm using Montserrat, too

atomic kindle
#

Could someone suggest a good way of sharing a binary cache between child processes in node?

boreal iron
#

just as note, you shouldn't replace the font on the whole site, that can lead to issues with padding on buttons etc.

#

You should only apply to font family to the content

#

div.content *

sour summit
sour summit
boreal iron
#

Nope the class name mostly stays the same

lyric mountain
#

I like Hammersmith One, it's VERY readable even at absurdly small sizes

boreal iron
#

I mean to make sure, just wrap your entire description into a div giving it an ID

sour summit
lyric mountain
#

8px size

sour summit
#

yes wat lol

boreal iron
#

Nah didn't change my description for ages

#

.content as class name has ever been the same so far

earnest phoenix
#

why it just replaces ping

lyric mountain
#

"replaces ping"?

earnest phoenix
#

Yes

lyric mountain
#

what exactly am I supposed to look at?

#

ohhh I see

earnest phoenix
#

Ping: {ping} it replaced it Ping 836

lyric mountain
#

you mean the broken replacements there

earnest phoenix
#

Yes

#

I want replace userCount as ping

lyric mountain
#

why don't u just hardcode the fields instead of looping?

earnest phoenix
#

Can you show me how or wym

lyric mountain
#

instead of using two loops just build the embed normally

earnest phoenix
#

Its for translate

lyric mountain
#
anEmbed
  .addField("Some text", "Some value", true)
  .addField("Some text", "Some value", true)
  .addField("Some text", "Some value", true)
  .addField("Some text", "Some value", true)
  .addField("Some text", "Some value", true)
#

like this

earnest phoenix
#

So i cant build it normal

lyric mountain
#

you can

#

you don't really need a loop unless you plan on having variable amounts of fields

earnest phoenix
#

This thing working nice before i change my commands to constructor

lyric mountain
#

e x a m p l e

boreal iron
#

my gosh, fucking write the object yourself... lazy fools

earnest phoenix
#

What you're currently doing is replacing new instances of the strings, which the output becomes the last iteration

#

My brain stopped so that i cant translate what you said lol

lyric mountain
#

basically you're not updating the input string

#

so it always take the original string and replaces

#

repeats it for every value

#

so the final string is just the original string with the last value replaced

earnest phoenix
#

Yes thats why last object replaced only

lyric mountain
#

you don't need any loop there, but if you WANT to use loops, create an auxiliar variable to hold the updated string

#

then pass that variable during replacements, reassigning it

earnest phoenix
#

data.text.replaceAll(...) -> newData.text.replaceAll(...)

#

I cant data.text.replaceAll

#

As the initial value of the text property is data.text

#

Or i can

#

Idk

#

Let me explain, the text property in the newData object you've declared already holds the value of the data.text property, so instead of replacing the values in the string of data.text property and repeatedly re-assigning it to the newData.text property, replace the newData.text property

#

finally worked huge thanks to yall

lyric mountain
#

rip voltrex

earnest phoenix
#

Yep, that's correct, you're welcome

boreal iron
#

Voltrex in development... wtf is going on in general then?

earnest phoenix
#

FakE not driving... did something happen to the roads?

boreal iron
#

Yes... it's the time I'm usually not driving

green pebble
#

It's simple css tho... But I want it from the GitHub link I have

earnest phoenix
#

I don't think Top.gg allows you to import CSS from an outside source

green pebble
green pebble
lyric mountain
earnest phoenix
boreal iron
#

That fucking buildings and area looks like a shithole place like Africa or Detroit

earnest phoenix
#

That image is a perfect example of "When your CSS goes wrong"

boreal iron
#
<style type="text/css">
  @import url('https://source.file.css');
</style>
#

But you will most likely overwrite any selector, class or ID and fuck topgg up

#

More than it already is

#

Works at least in the preview, not sure if it's being filtered out later

green pebble
#

man i would love if there was some "official say" on this

boreal iron
#

Like I said it works for me, means it works

earnest phoenix
#

@woeful pike you got a say on this? Saw you in chat so, probably good to mention, they're trying to import CSS from an outside source in Top.gg long description and doesn't seem to be working

green pebble
sour summit
green pebble
#

or is it beacause we are trying from github?

woeful pike
#

we don't prevent external css as far as I remember

sour summit
boreal iron
#

importing div, table { border: 1px solid; }

#

Works, as I said

sour summit
boreal iron
#

discord thumbnail view

#

huh?

earnest phoenix
#

how can I get yesterday's date?

#

like date.now() but for yesterday

green pebble
near stratus
boreal iron
#

I'm not on Github, no I'm using my domain

earnest phoenix
#

ok ty

boreal iron
earnest phoenix
#

and for 12h ago it should be ```js
new Date(Date.now() - 126060*1000)

near stratus
boreal iron
earnest phoenix
#

ok

boreal iron
#

Oh I see ms

lyric mountain
#

12.hours.ago mmLol

earnest phoenix
#

@green pebble Can you show us what you're currently using in your Top.gg long description?

green pebble
green pebble
#

still no diff tho

boreal iron
#

Try a valid CSS file

#

Can you actually copy the text?

#

Can't copy the text from a screenshot

#

What does the pastebin style sheet contain?

green pebble
green pebble
boreal iron
#

lemme see, give me a sec

#

Yeah as I already said

green pebble
boreal iron
#

MIME type conflict

#

("text/plain")

#

not css

#

You need to import an actual CSS file

#

If you use Github, try the RAW data URL

sage bobcat
#

One message removed from a suspended account.

green pebble
#

but still the css hasnt change tho..

boreal iron
#

Browser inspect tool

green pebble
#

🤔

green pebble
earnest phoenix
#

isn't there a bit (just a bit) more accurate system? ```js
function isWin(type){
const h={"Common":0.9,"Rare":0.961,"Epic":0.98,"Legendary":0.99,"Champion":0.99}
return (h[type]<=Math.random())?"chr":"nada"
}

#

i've opened 150 chests and got only one card

#

and it was a common one

cinder patio
#

what do you want to do exactly?

#

What's your goal

wheat mesa
#

Seems like you’re giving it a 10% chance of getting a card

boreal iron
earnest phoenix
#

I want to give a person a random rarity card every x chests, I want the card to appear every random number of chests but not too many, i'm getting complaint of people opening like 2000 chests and only got 7 cards.

wheat mesa
#

From what you’re showing here, you’re just generating a random number and seeing if the type you’re looking for is greater or equal to that random number.

boreal iron
#

Content-Type: text/css

wheat mesa
#

The problem is that you pass in a type of card to get in the first place, I’m not sure how your system is designed but that’s likely the problem

#

Can you show the way you’re using the method?

green pebble
earnest phoenix
#

well nothing interesting

wheat mesa
#

I would also highly recommend using more descriptive variable names

earnest phoenix
boreal iron
wheat mesa
#

Because looking at this I still have no idea what it does

green pebble
boreal iron
#

alright

earnest phoenix
#

and, instead, give xp

wheat mesa
#

I’m not sure how to explain this well but here it goes

#

I assume that chss is a random card from a list of cards, yes?

earnest phoenix
#

i think

#

yes

wheat mesa
#

You’re selecting a card, then based on the rarity of that card you have a certain chance to get it

#

Each time you select a random card, if it’s a common card, you only have a 10% chance of getting the card

#

But as I said I don’t know how your system works so I don’t know what you’re doing to calculate whether you get a card or not

earnest phoenix
#

I'm doing that

#

i don't have more stuff like this

lyric mountain
#

if you already got a random card, why do you roll again to check whether you receive or not?

#

like, won't it pull the odds to the bottom?

wheat mesa
#

^^

earnest phoenix
#

To not give new cards easily

#

i have like 100 cards

lyric mountain
#

then reduce the odds of drawing a card

#

don't re-roll after someone draws it

#

2 rng rolls make it very likely to fail

earnest phoenix
#

Oh wait... I can store in the db how many chests opened and then give a card for every x chests opened, I can make a random number gen and if the opened chests match with the random number, it'll give the card and reset the counter. Will something like this work?

lyric mountain
#

it's like throwing a dice twice and trying to get 2 of the same side

earnest phoenix
wheat mesa
#

Let’s say you have a did

#

Die*

#

And you roll a 6

#

That’s a 1 in 6 chance of happening

lyric mountain
wheat mesa
#

But if you roll another die after that and get a 6, it’s a 1 in 36 chance overall to get 2 sixes in a row

lyric mountain
#

2 rolls, one to define what you get and another to define if you get to keep it

wheat mesa
#

You’re essentially rolling multiple dice with low probabilities on both, making it pretty much impossible to get your desired outcome

earnest phoenix
#

Oh then I should simply remove this?

#

but then the legendaries will have the same chance as common and others, right?

wheat mesa
#

I don’t think this is necessarily a simple problem, you need to rethink your design here

lyric mountain
#

like, between X and Y you get Z rarity

#

then just roll an rng between 0 and 1

#

like, from 0 to 0.4 you get a common, from 0.4 to 0.7 you get a rare, from 0.7 to 0.9 you get an epic and from 0.9 to 1 you get a legendary

earnest phoenix
#

wait what

lyric mountain
#

that way the table becomes:
Com = 40%
Rare = 30%
Epic = 20%
Leg = 10%

lyric mountain
#

each part representing a rarity

#

then roll rng between 0 and 1

#

the rolled value is the rarity you get according to how you split it

green pebble
# boreal iron alright

One last small doubt... If this works... Does it mean I can add a huuge css file and not be bothered of the desc char count? (Haven't tried so jus asking a possibility)

earnest phoenix
#

assuming rng is math.random, I think i understand a bit

wheat mesa
#

Rng just means random number generator

earnest phoenix
#

yeah ik

wheat mesa
#

Math.random generates a number between 0 and 1

#

(But not including 1)

earnest phoenix
#

oh

lyric mountain
wheat mesa
#

It’ll generate up to like 0.99999999999999999 or something like that

earnest phoenix
#

then what do you mean with rng?

lyric mountain
#

random number generator

wheat mesa
#

It’s a very small margin of error that you likely won’t have an issue with unless you’re going REALLY small probabilities

lyric mountain
#

Math.random() is a rng

#

anything that generates a random value is a rng

#

a physical dice is a rng

#

coins are too

lyric mountain
wheat mesa
#

(Pseudorandom but the point is still the same)

earnest phoenix
#

can't you guys send a simple example of it?

boreal iron
earnest phoenix
#

cough texts are confusing...

wheat mesa
#

Ok here I’ll give you an example

#

What is Math.random’s chance to generate a number less than 0.5

earnest phoenix
#

50%

#

?

wheat mesa
#

Yes

#

So then what would be the chance of generating a number less than 0.4

#

40%

lyric mountain
#

something like this (but with an object of course)

wheat mesa
#

The idea is that you’re splitting up 1 into multiple parts to get your probabilities

#

Think of it as splitting up 100% into different percentages

#

Like 100% can be broken down into say for example 10%, 30%, and 60%

earnest phoenix
#

I think I understand

#

will give it a try

earnest phoenix
lyric mountain
#

yes

#

like, in my example you'll just get the value itself, which could be used with indexOf if you use index-based rarities

#

otherwise u could use an object to get the actual rarity

earnest phoenix
#

ty

novel jetty
#

Can someone help me with this please?
Code:

const { MessageEmbed, Message } = require("discord.js");

const chatschema = require("../../Schemas/Chatbot");

module.exports = {
    name: 'messageCreate',
    
    run: async (client, message) => {

        await chatschema.findOne({ GuildID: message.guild.id }, async (err, data) => {

            if (!data) return;
      
            const fetch = require('node-fetch')
      
            if (message.channel.id !== data.ChannelID) return; 
            if (message.author.bot) return;
            if (!message.content) return message.channel.send("Please say something.");
            if (message.content.includes(`@`)) {
              return message.channel.send(`Please dont mention anyone`);
               }
        
            message.channel.sendTyping();
        
            fetch(
              `https://api.affiliateplus.xyz/api/chatbot?message=${encodeURIComponent(message.content)}&botname=${client.user.username}&ownername=Angel`)
              .then((res) => res.json())
              .then((data) => {
                message.reply({ content: `${data.message}`, allowedMentions: {repliedUser: false}})
              });
          });
    }
}

Error:

C:\Users\great\OneDrive\Desktop\Angelus-Slash\Events\Message\Chatbot.js:12
        await chatschema.findOne({ GuildID: message.guild.id }, async (err, data) => {
                                                          ^

TypeError: Cannot read properties of undefined (reading 'id')
    at Object.run (C:\Users\great\OneDrive\Desktop\Angelus-Slash\Events\Message\Chatbot.js:12:59)
    at Client.<anonymous> (C:\Users\great\OneDrive\Desktop\Angelus-Slash\Handlers\Events.js:23:54)
    at Client.emit (node:events:402:35)
    at MessageCreateAction.handle (C:\Users\great\OneDrive\Desktop\Angelus-Slash\node_modules\discord.js\src\client\actions\MessageCreate.js:26:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\great\OneDrive\Desktop\Angelus-Slash\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\great\OneDrive\Desktop\Angelus-Slash\node_modules\discord.js\src\client\websocket\WebSocketManager.js:351:31)
    at WebSocketShard.onPacket (C:\Users\great\OneDrive\Desktop\Angelus-Slash\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\great\OneDrive\Desktop\Angelus-Slash\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\great\OneDrive\Desktop\Angelus-Slash\node_modules\ws\lib\event-target.js:199:18)
    at WebSocket.emit (node:events:390:28)
    at Receiver.receiverOnMessage (C:\Users\great\OneDrive\Desktop\Angelus-Slash\node_modules\ws\lib\websocket.js:1137:20)
    at Receiver.emit (node:events:390:28)
    at Receiver.dataMessage (C:\Users\great\OneDrive\Desktop\Angelus-Slash\node_modules\ws\lib\receiver.js:528:14)
    at Receiver.getData (C:\Users\great\OneDrive\Desktop\Angelus-Slash\node_modules\ws\lib\receiver.js:446:17)
    at Receiver.startLoop (C:\Users\great\OneDrive\Desktop\Angelus-Slash\node_modules\ws\lib\receiver.js:148:22)
    at Receiver._write (C:\Users\great\OneDrive\Desktop\Angelus-Slash\node_modules\ws\lib\receiver.js:83:10)
boreal iron
#

Well guild is undefined

cinder patio
#

Make sure to check if guild is defined before doing anything else

novel jetty
#

I did try to define guild but it didnt help

wheat mesa
#

Means someone used it in DMs most likely

boreal iron
#

aye

novel jetty
#

const guild = message.guild;

wheat mesa
#

I don’t know of any other way message.guild would be undefined

#

You’re missing the point here

#

message.guild is undefined

boreal iron
#

as there's no guild available

#

I'm very concerned about what I actually see

#

Chatbot

#

also a database request everytime you receive a message event?

wheat mesa
#

My favorite!

boreal iron
earnest phoenix
#
How can i add function for example

message.success = () => {
this.reply("hello")
}

client.on("messageCreate", async(message) =>  {
message.sucsess()
} 

lyric mountain
#

since it'll go from 0.9 to 1, so 10%

earnest phoenix
#

oh ok

lyric mountain
#

the previous rarity will go from 0.7 to 0.9 exclusive

sudden geyser
earnest phoenix
#

where do I add the card's rarity?

sudden geyser
#

personally I recommend the function

earnest phoenix
#

where do I add the card's rarity

lyric mountain
#

yancode

earnest phoenix
#

I did it but i dont know how to export or import it

lyric mountain
#

and filter by value

sudden geyser
#

you don't export or import it

#

the file just has to be loaded in some way

#

so your edit is applied

earnest phoenix
#

It didnt actually

#

mesaage.success is not a function

boreal iron
#

typo?

earnest phoenix
#

I dont think so

#
let rareobj = { Common: 0.4, Rare: 0.7, Epic: 0.9, Legendary: 1, Champion: 1 }
const rolled = Math.random();
let chra = Object.entries(rareobj).filter(v => chss.rarity === v) ? "nada" : "chr";
``` something like this?
#

oh wait I didn't include rolled

#

where do I include it tho

#
let rareobj = { Common: 0.4, Rare: 0.7, Epic: 0.9, Legendary: 1, Champion: 1 }
const rolled = Math.random();
let chra = Object.entries(rareobj).filter(v => chss.rarity === v && v === rolled) ? "nada" : "chr";
``` I think like this
cinder patio
#

You could just use if statements

earnest phoenix
#

I can?

#

but I want to know if the above code will work

cinder patio
#

Object.entries() returns [[key, value]], so the function inside filter is wrong

#

filter always returns an array

#

so it'll always be chr whatever that means

#

rolled returns a number btw 0 and 0.99999, the odds of hitting exactly 0.4, 0.7 and 0.9 is very small

#

Legendary and Champion will never roll

earnest phoenix
#

I want it to hit 0-0.4 and like this 0.4-0.7

cinder patio
#
const num = Math.random();
if (num <= 0.4) {
   // Common
} else if (num <= 0.7) {
   // Rare
} else if (num <= 0.9) {
   // Epic
} else {
   // Legendary
}
earnest phoenix
#

oh

#

tysm

#

so it's like 40% chance of common and like this?

cinder patio
#

40% common 30% rare 20% epic 10% legendary

slim heart
#

What's the easiest way to set an outgoing IP for docker containers? I use iptables for doing it on accounts on linux with iptables -t nat -A POSTROUTING -m owner --uid-owner USERNAME -j SNAT --to-source [ip] but i can't figure out how to do it for individual docker containers
i tried doing iptables -t nat -A POSTROUTING -s 172.19.0.0/16 -j SNAT --to-source [ip] since 172.19.0.x is my local docker but i dont think i understood it correctly because it didnt change anything

earnest phoenix
#

why it doesn't push or add? i'm using this format ```js
profileModel.findOneAndUpdate({userID: message.author.id}, {$inc: {coin: amount, InfoCards: {[card6Low]: {exp: amoun33}}}});

cinder patio
#

InfoCards: {[card6Low]: {exp: amoun33}} is inside the $inc object

#

pretty sure it's supposed to be outside of it

eternal osprey
#

how can i get all reactions on a message using its id?

#

in v12

spark flint
#
const reportUser = async (userid, reason, evidence, anythingelse) => {
    try {
        axios({
            method: 'post',
            url: `https://api.blacklister.xyz/report/${userid}`,
            data: {
                reason,
                evidence,
                anythingelse
            },
            headers: { Authorization: "API KEY" }
        });
        console.log("User reported!")
    }
    catch (err) {
        console.log(err)
    }
}```
#

why doesn't that work

#

it logs User reported!

#

but no request is made

lyric mountain
#

Await?

spark flint
#

just done that

#

nothing different

lyric mountain
#

Try using postman

#

To see what ur sending

spark flint
#

i did it through thunder client on visual studio

#

it works

lyric mountain
eternal osprey
lyric mountain
#

Either id or unicode

wheat mesa
spark flint
#

v14 comes out next week KEKW

wheat mesa
#

At this point I guess you might as well wait for v14 but if you don’t swap to v14 then you’re a madman

earnest phoenix
earnest phoenix
lyric mountain
spark flint
#

but not when sent from the bot

lyric mountain
#

That means the issue isn't on the app's side

#

Try checking for possible port issues

#

Do u use nginx?

spark flint
#

i sent a request to my bots api manually and it worked

#

its cpanel so iara_shrug

lyric mountain
#

hm

#

is there any logging for inbound and outbound requests?

#

like, raw logging

spark flint
#

yep

#

MY IP - - [23/Feb/2022:21:11:48 +0000] "POST /report/testtttttttttttttt HTTP/1.1" 200 98 "-" "axios/0.24.0"

#

but nothing happened

lyric mountain
#

so it is sending

#

maybe cors is blocking?

boreal iron
spark flint
#

the exact same code for adding users (except /add not /report) works from axios

spark flint
#

my source is @earnest phoenix

boreal iron
#

Ah good to know, ty

#

Yeah Voltrex is trustable- sometimes

lyric mountain
boreal iron
#

If he isn’t drunk

lyric mountain
#

try breakpointing it

earnest phoenix
boreal iron
#

If he isn’t drunk

#

And I already got like no fucking time to do things

#

I could really cry

slender thistle
#

I don't get fucking time either... aubrey_cry

boreal iron
#

Guess I’m gonna resign my business, family and real life

woeful pike
#

??????????

#

dude what the fuck are the engineers at https://wasabi.com/ doing

This is an example page. It’s different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this: Hi there! I’m a bike messenger […]

#

omg everything they do is

#

so broken

#

I think I'm gonna move everything to cloudflare images

#

this is actually ridiculous

#

I'm crying

boreal iron
#

And google being yet again to the most used website

cinder patio
#

lmao I guess it checks if you suddenly lose internet connection

spark flint
woeful pike
#

they use godaddy, wordpress, lmfao

spark flint
woeful pike
#

I don't understand why their tech stack is set up like your aunts jewelry store

spark flint
#

they use wpengine

round cove
quartz kindle
#

what the fuck lmao

#

navigator.onLine exists

#

as well as window.ononline and window.onoffline

#

although those props only update if the browser actually makes a request

tribal plaza
#

hi

woeful pike
#

my nickname is actually [object Object] though

#

so idk why that would break the formatting

lyric mountain
#

try naming yourself a';DROP TABLE users;--

woeful pike
#

not really a responsible way of checking for injection vulnerabilities

#

please don't do this if you actually plan on doing pen testing lol

sudden geyser
#

no someone should

#

if someone gets mad just say it was ✨ for science ✨

round cove
#

"haha oops didn't think you'd have this (:"

woeful pike
#

it won't work 99.9% of the time but you'll wish it didn't when it does

#

this is one of the most interesting attacks I've seen in a long time https://www.youtube.com/watch?v=w-eJM2Pc0KI

HTTP requests are traditionally viewed as isolated, standalone entities. In this session, I'll introduce techniques for remote, unauthenticated attackers to smash through this isolation and splice their requests into others, through which I was able to play puppeteer with the web infrastructure of numerous commercial and military systems, rain e...

▶ Play video
#

http is so insane

spark flint
#

ok so dumb question time

#

i wanna return a json from a function

#

is it return {error:true, errormsg:response.data.errormsg}

round cove
#

Yes

#

object

spark flint
#

that didn;t work tho sus

#

undefined error

round cove
#

Uh?

#

Show the full error?

#

Or code even

#

and what you're using

spark flint
#
TypeError: Cannot read properties of undefined (reading 'error')
    at Object.execute (C:\Users\Churt\Desktop\Projects\blacklister\blacklister rewrite\events\modalSubmit.js:15:24)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)```
#

lemme grab code now

round cove
#
Basically...
  - Who's calling the function
  - What does the function do
  - How does the caller handle the data

spark flint
#

in utils.js js const reportUser = async (userid, reason, evidence, anythingelse) => { try { await axios({ method: 'post', url: `https://api.blacklister.xyz/report/${userid}`, data: { reason, evidence, anythingelse }, headers: { Authorization: "big bun's very epic api key" } }).then(res => { if (res.err) { return {error:true, errormsg:res.data.errmsg} } else { return {error:false} } }).catch(err => { console.log(err) }) console.log("User reported!") } catch (err) { return {error:true, errormsg: err} } }
in the code calling the function

            const resp = await reportUser(userid, reason, evidence, anythingelse)
            
            if (resp.error) { 
                await modal.deferReply({ ephemeral: true })
                modal.followUp({ content:`Something went wrong when submitting your report! \n \`${resp.errormsg}\``, ephemeral:true })
            }
            else {
                await modal.deferReply({ ephemeral: true })
                modal.followUp({ content:`Thank you for your report!`, ephemeral:true })
            }```
round cove
#

So resp is undefined.

cinder patio
#

reportUser doesn't always return an object

round cove
#

^

spark flint
#

ah

cinder patio
#

it returns an object only when there's an error, so you should just check if resp is not undefined

round cove
#

You're catching your error after you already wrapped it with try/catch

cinder patio
#

oh yeah you are trying to return { error: false }

hidden gorge
#

i keep forgetting are slash commands supported on discord.js v13

spark flint
#

alr i'll test now

hidden gorge
cinder patio
#

You need to return await axios... and also remove the .catch

round cove
#

^

sudden geyser
#

by supported do you mean via that .api stuff

hidden gorge
sudden geyser
#

ye

hidden gorge
#

nah

spark flint
#

that worked

round cove
#

poggers

austere surge
#

cool

sudden geyser
#

you're calling me

sudden geyser
#

I don't get this part

For counterexamples to these claims, consider Python classes, which are quite nominal despite being dynamic, and TypeScript interfaces, which are structural despite being static.

How are Python classes nominal in the way we think about nominal types? They're named, but are used dynamically (e.g. a Person and User class with a name property).

spark flint
#

is anyone here good at nginx

quartz kindle
#

idk about "good" but i know how to use it lol

spark flint
#
server {
    listen 80;
    listen [::]:80;
    server_name capy-cdn.xyz;

    location / {
        proxy_pass https://capy-cdn.ams3.digitaloceanspaces.com/;
        proxy_hide_header      Strict-Transport-Security;
    }
}```
#

is that correct

#

huhhh

boreal iron
boreal iron
#

Not sure how NGINX handles it but it might cause trouble

coral sigil
#

apparently it worked

spark flint
#

I got it working now

#

Still port 80, it’s just I was stupid

#

I left a transform rule there from the old CDN

coral sigil
#

so u will be using http?

spark flint
#

It’s Cloudflare proxied

coral sigil
#

oh, okay, sorry 👍🏻

hidden gorge
#

Hey guys mine and my friends suggestion bot keeps requiring administrator permissions but we didn’t even code it to how do we fix this i will send the index and other codes in a minute

spark flint
#

Easy

hidden gorge
spark flint
#

Code your own bot

hidden gorge
#

we are

spark flint
#

but we didn’t even code it

hidden gorge
#

we have a development team of 5 people

#

but we need help with this issue

#

we can’t find it

pearl trail
hidden gorge
#

we have other files

pearl trail
#

its just a file loading your events and commands

spark flint
lyric mountain
#

Fun fact, the bigger the team is the slower development will go

pearl trail
#

and which command that is requiring admin

lyric mountain
#

Unless you have a dedicate coordinator

hidden gorge
#

plus our team all has our own bot on top.gg

#

so uh we can’t find it

lyric mountain
#

I have a bot that has more than 2 million lines in source code, I know exactly where everything is

hidden gorge
#

oh lol

lyric mountain
#

How don't u know where it's requiring admin?

quartz kindle
#

do the commands require administrator? or does your bot invite link ask people for administrator?

wheat mesa
#

but we didn’t even code it

hidden gorge
#

we never coded it to require admin

lyric mountain
#

Top.gg doesn't decline admin in invite

wheat mesa
#

oh nevermind

lyric mountain
#

Afaik

pearl trail
wheat mesa
#

you meant something else by that

hidden gorge
quartz kindle
#

then you need to change the invite link lol

wheat mesa
#

that means you made the wrong invite link

quartz kindle
#

nothing to do with the code

hidden gorge
#

oh ok

pearl trail
#

💀

hidden gorge
#

oh crap i gotta call my friend

#

can we change the invite link on top.gg even though our bot already got approved?

pearl trail
#

yes

wheat mesa
#

btw if anyone has recommendations on what I should do to learn how to create parsers/lexers ping me

#

I'm just following a tutorial but I feel like I'm not going to get a lot of value out of that

sudden geyser
#

ask parm

#

he's been doing compiler work

#

when he's not having a playdate with lizard

spark flint
#

Not meaning to be rude but it really confused 5 verified bot devs that the bot being given admin on invite was from the url and not the code??

wheat mesa
#

I asked parm for advice already and it was helpful, just asking for more advice if anyone knows any

#

it's helpful to get input from multiple sources

lucid prawn
#
                messageCreate.guild.channels.create("♡ღ🌸Join To Create🌸ღ♡", {
                    type: 'voice',
                    permissionOverwrites: [
                        {
                            id: messageCreate.guild.id,
                            allow: ['VIEW_CHANNEL'],
                        }]
                })
})
#

it keeps making text channel

sudden geyser
#

yes that's what it's supposed to do

#

oh no it's not

#

Should be GUILD_VOICE I think

#

rather than just voice

lucid prawn
sudden geyser
#

Also supported: GUILD_CATEGORY

lyric mountain
#

I never really understood why d.js barely has any enum/constant for such stuff

sudden geyser
sudden geyser
#

Pretty much every constant value in the API has an enum in Discord.js

#

Or do you mean actual values like const GUILD_TEXT = 1

atomic kindle
#

Could someone suggest a good way of sharing a binary cache between child processes in node?

atomic kindle
#

Not exceeding 1 MB for each key.

#

And I plan on clearing it every minute.

#

@split hazel ^

lucid prawn
#
        if(!message.guild) return;
        const aiCh = db.get(`guild_${message.guild.id}_ai`) || null
        const resolveCha = message.guild.channels.resolve(aiCh) || message.guild.channels.cache.find(ch => ch.name === aiCh) ||  message.guild.channels.cache.find(ch => ch.id === aiCh);
        if(!resolveCha) return;
        if(message.channel.id !== resolveCha.id) return;
        
         if(message.author.bot) return;
        
        fetch(`http://api.brainshop.ai/get?bid=156057&key=26SY8BZqy2fJ3MAj&uid=1&msg=${encodeURIComponent(message.content)}`).then(res => res.json()).then(data => {
            message.channel.send({ content: data.cnt})
#

not sending

#

no error

quartz kindle
#

which requires a native addon

#

between worker_threads however there is SharedArrayBuffer

hidden gorge
atomic kindle
quartz kindle
# hidden gorge ugh

are you asking for help or are you just showing off your errors? the problem is suggest.js line 30 if you havent figured it out yet

cobalt junco
hidden gorge
wheat mesa
#

simple errors to debug? man I wish I had to deal with that

quartz kindle
hidden gorge
earnest phoenix
#

damn that sucks

#

My feelings go out to u

boreal iron
#

How would I actually reload the entire node app instead of restarting it?
By wrapping everything into modules, clear the cache and reload then?
That would also require to destroy each event listener because the will created again once the modules being reloaded.
Keep in mind when answering I need to pass multiple instances such an active gateway connection, database connection etc.

wheat mesa
split hazel
#

maybe you should tell him to focus on the code rather than pretty logs freerealestate

#

sorry just jealous my logs don't have ascii tables

sudden geyser
hidden gorge
#

it’s broken

earnest phoenix
#

how do you break a suggestion command

#

😔

hidden gorge
spark flint
earnest phoenix
spark flint
#

Lol

earnest phoenix
#

Sounds like I can make some bank if I join his dev tea

hidden gorge
#

AND MY DEVS GAVE UP WTF

earnest phoenix
#

😔

#

I don't blame em

spark flint
#

Me neither

#

Nowadays anything can get you verified

hidden gorge
#

@gusty ruin Still don’t get how you broke the command lol

earnest phoenix
#

👀

gusty ruin
#

mongodb be getting me messed up StressWarning

earnest phoenix
#

There is your issue

split hazel
#

that status bro

earnest phoenix
#

you're using mongodb

split hazel
#

that's your biggest issue

#

your status

gusty ruin
#

dont talk about it

#

👀

split hazel
#

ok:(

earnest phoenix
#

mongodb ass

#

dont use it

hidden gorge
#

ok how tf is mongo messing it up @gusty ruin is set that part up

pearl trail
#

use array db mmLol

split hazel
#

mongodb is op prove me wrong

earnest phoenix
pearl trail
#

ah yes

split hazel
#

I only use mongo for tiny projects

gusty ruin
#

using it is making me mess up

hidden gorge
sudden geyser
lyric mountain
gusty ruin
split hazel
#

😡

#

ever heard of bson

#

binary json

hidden gorge
split hazel
#

very efficient

#

prove me wrong

lyric mountain
gusty ruin
#

then how would you say "i connected to the db, how is that messing you up"

split hazel
#

,

lyric mountain
#

Oh wait, was it too overkill?

boreal iron
# sudden geyser that's the fun part: you don't really

Not speaking about globals and constants actually being the backbone of the app but all event listeners and associated included modules.

The only way I can think of is wrapping anything into modules and reload the shit after destroying each listener

hidden gorge
split hazel
#

bro I'll make a nested object...

hidden gorge
#

-leaves server-

sudden geyser
lyric mountain
sudden geyser
hidden gorge
sudden geyser
#

should be easy to just delete my account oops

split hazel
boreal iron
#

In other words I would like to start the same app as "independent" child process but passing my instances like arguments to it, except that everything else being reloaded of course

wheat mesa
split hazel
#
family = {
   son: {}, 
   daughter: {}, 
   mother: {}, 
   dad: null
   milk: Promise<pending>
}
lyric mountain
#

I'm afraid to ask how would you reference the parent from the child

boreal iron
#

Tf where is Tim if I need him

quartz kindle
#

wut

boreal iron
#

Huh there he is

sudden geyser
#

assuming you can walk back a document in mongodb

boreal iron
#

@quartz kindle

quartz kindle
#

good luck

boreal iron
quartz kindle
#

yes

#

lmao

boreal iron
#

ffs

sacred condor
#

what this

quartz kindle
#

well if you want to clone the process, you can run a child process in detatched mode, that way it doesnt die when the parent dies

#

but it will become inaccessible from whatever script you used to start it

#

like cmd, pm2, etc

boreal iron
#

Well I actually can’t create a child process and I want to kill the main process after

#

I think of it like a shard manager connecting to the database and gateway then spawns the rest as child process I can literally kill therefore reload in other words

#

But the connection instances will stay alive

#

As the manager (parent app) will stay active

#

process not app, my gosh

split hazel
lyric mountain
#

How would you find who are their parents then?

split hazel
#

unnecessary details

#

abstraction

boreal iron
#

What is so absurd in the text I wrote above that makes in impossible, Tim?

#

ffs now everyone is sleeping

#

Im living in such a mad world dsl

#

Tim, will you wake up if the donation sound on your phone rings? KEKW

wheat mesa
#

he thinks I sleep

#

I live in texas

#

texans never sleep

boreal iron
#

Just because you’re on crack 24/7

#

Answer my question then using Tim’s knowledge and sense

quartz kindle
#

lmao

boreal iron
#

My gosh

#

Please solve my dilemma by telling me I’m stupid or say yes, it works like I think it will

quartz kindle
#

i mean

#

if you have a master process that creates and kills child processes

#

then you connect to the master, it will basically never die

#

unless you need to restart the master

boreal iron
#

Yeah

#

The master creates the connection instances and the child is just listening to the events

lyric mountain
#

"Philadelphia programmer forces slaves to kill master for listening to events"

boreal iron
#

Once I emit the shutdown in the child, the master kills its child, spawns a new child and passes the connection instances

#

Or am I wrong here?

quartz kindle
#

if by pass you mean create a new ipc channel, sure

boreal iron
#

Well that’s actually a lot more going on than event listeners but it doesn’t make a difference here

quartz kindle
#

or create new outbound connections in the new child

boreal iron
#

I seems like I’m over complicating things I guess

#

After watching the docs and a few examples I’m going with a master process and children

#

Doesn’t seem to be complicated as well as the IPC

stiff nest
#

-credits

dry imp
stiff nest
lucid prawn
#

how do I make a command that shows all the working commands

#

that are in discord 13v

austere surge
lucid prawn
#

message

austere surge
#

how do you store your commands

lucid prawn
#

all in one folder

austere surge
#

like client.commands?

lucid prawn
#

yes

austere surge
#

ok

#

if you dont care about organization you can just map them

#

client.commands.map(cmd => { 'do something' });

#

if its an array you can use forEach instead of map ig

lucid prawn
#

I will organization them later just need to convert them to v13

earnest phoenix
#

v14 soon

austere surge
#

:agony:

#

some the changes look really annoying

earnest phoenix
#

certified detritus moment

austere surge
#

i do like the new embed name change thats just gonna be annoying

earnest phoenix
austere surge
#

almost everything is embedded :(

lucid prawn
#

how can I run all my commands at once?

austere surge
#

why

#

that sounds lke ratelimiting waiting to happen

lucid prawn
#

To check if my commands work or not and then it can dm me a list

#

so I can convert it

austere surge
#

just brute force test em like the bot reviewers do

#

or maybe one of them could do it xd

lucid prawn
#

I have 212 commands

austere surge
#

jesus

#

thats definitely gonna ratelimit

#

for a long time

lucid prawn
#

It's a big bot

austere surge
#

mine got 100

lucid prawn
#

plus we have

#

100 events

austere surge
#

what

quartz kindle
#

what you want is called unit testing, and its something you have to code yourself, ie code your commands in a way that is possible to execute them without having to receive messages from discord

lucid prawn
#

do you know someone that could help me?
idk how to do that

wheat mesa
#

you can create your own message object and args for testing purposes

#

sounds like a lot of work though

quartz kindle
#

if you dont know how to do that, better leave it alone, its not easy and takes a lot of time to get right, especially with how complex discord is

lucid prawn
#

can you do this stuff on repl

wheat mesa
#

discord's api is really vast

quartz kindle
#

you'd have to simulate events, and create dummy data

austere surge
wheat mesa
#

doing it for a few commands/events is feasible but it's really just going to cost you more time than it saves if you didn't plan for it ahead of time

wheat mesa
#

step 1: go to c# discord and cry about why no work for 5 hours before the dev of remora comes into the channel and tells you that you're a moron and did something wrong

#

step 2: cry

earnest phoenix
#

Gotcha

austere surge
#

alright

quartz kindle
#

dafuq is remora

wheat mesa
#

c# lib

earnest phoenix
#

c# discord lib

austere surge
#

making a discord bot in unity

quartz kindle
#

weird name

earnest phoenix
#

Not really

wheat mesa
#

it's possible to integrate a bot into a unity game probably

earnest phoenix
#

tim is also a weird name

wheat mesa
#

not very useful for obvious reasons but not impossible

austere surge
#

yeah

quartz kindle
#

go back to your cerulean gym misty

earnest phoenix
#

Time to ban people in game from discord less go!

austere surge
#

yeeee

earnest phoenix
austere surge
#

discord mod simulator in real time

earnest phoenix
#

it is where u belong

quartz kindle
#

uh, im already here

earnest phoenix
#

I know so I am telling you to stay here

#

no leaving

wheat mesa
#

misty is like russia rn

#

running into ukraine and then telling them to stay in ukraine

earnest phoenix
#

Waffle we aren't allowed to speak on russia here

#

mods dislike it

wheat mesa
#

what why :C

earnest phoenix
#

politics

sudden geyser
#

not russia ... russia

quartz kindle
#

blyat cyka jobany vrod

earnest phoenix
#

tim no more talking

#

go to jail

austere surge
#

:o

dry imp
#

rushia

wheat mesa
#

it's not politics >:C

austere surge
#

rushians

quartz kindle
#

its almost 3 am, i go sleep

austere surge
#

it almot 12am

lucid prawn
#

quick question: Yk how people stop the bot from crashing by sending an embed of all discord error. Is that possible?

sudden geyser
#

yeah but get ready cause you're all getting drafted

earnest phoenix
sudden geyser
#

dress up

wheat mesa
#

nah bro that's the perks of having diabetes

austere surge
#

process events

wheat mesa
#

I'll never get drafted

#

too many health issues

sudden geyser
#

they'll still force you

earnest phoenix
sudden geyser
#

acting disabled won't get you out

#

this time

wheat mesa
#

I'm not acting disabled I am disabled!

earnest phoenix
#

Just become paralyzed

austere surge
#

jump off a roof

#

no faking a disability now

earnest phoenix
#

pull a joe swanson get your legs shot out

sudden geyser
#

you could be amputated with your legs and arms gone and they'd still recruit you

dry imp
#

kamikaze

sudden geyser
#

I'd share a video but I know it's not appropriate to share

austere surge
#

dam

slender thistle
rustic nova
bright hornet
#

If i wanted to add time in my schema it should be {type: Date, default: Date.now() }? and how do i round of it to s, m, h, d

frigid warren
#

share your error message also

#

not just the code itself

crisp quiver
#

can anyone tell me how can i fix this

#

code: 'MODULE_NOT_FOUND',
requireStack: [
'G:\bots]\ghosty bot\src\imaginaryUncacheableRequireResolveScript

crisp quiver
#

how can i fix this

cobalt junco
crisp quiver
crisp quiver
#

index.ts

stiff lynx
#

I want to create channels with my discord.js v13 bot (In this way I give all the info at once).
How can I get the position for creating it in a specified category?

cobalt junco
cobalt junco
slender wagon
#

How do i make a gif only play once 🙂

#

on html

#

i need answers be4 it's too late

cobalt junco
split hazel
novel jetty
#

What does this mean?
Unhandled Rejection: FetchError: invalid json response body at https://api.affiliateplus.xyz/api/chatbot?message=Hello&botname=undefined&ownername=Angel reason: Unexpected token < in JSON at position 0

vocal canyon
novel jetty
#

I don't even have any json files except my config.json

cobalt junco
novel jetty
#

How can i fix it?

#

I tried const URL = URL but didnt work

pearl trail
#

maybe it's not a json?

#

just a plain text

cobalt junco
pale vessel
#

instead of using .json(), try .text() and log the result

split hazel
#

I just realised

#

making the user presence intent is pointless

#

you can easily make a self bot to steal that data anyways

#

the reason is probably reducing load

#

probably the reason for all privileged intents

boreal iron
#

Tell me more, tell me more - I swear I’m not gonna tell Discord anything about it KEKW

rustic nova
#

Instead of actual JSON data

split hazel
#

all self bot libs are outdated so dont use em

#

fork discordjs and add gateway support for users

#

cant say i have done that for legal reasons

pale vessel
#

what did you put?

novel jetty
#

.text()

pale vessel
#

can you show the code?

novel jetty
#
const { MessageEmbed, Message } = require("discord.js");
const client = require('../../index');

const chatschema = require("../../Schemas/Chatbot");

module.exports = {
    name: 'messageCreate',
    /**
     * @param {Message} message
     */
    run: async (message) => {

        await chatschema.findOne({ GuildID: message.guild.id }, async (err, data) => {

            if (!data) return;
      
            const fetch = require('node-fetch')
      
            if (message.channel.id !== data.ChannelID) return; 
            if (message.author.bot) return;
            if (!message.content) return message.channel.send("Please say something.");
            if (message.content.includes(`@`)) {
              return message.channel.send(`Please dont mention anyone`);
               }
        
            message.channel.sendTyping();

            const URL = `https://api.affiliateplus.xyz/api/chatbot?message=${encodeURIComponent(message.content)}&botname=${client.user}&ownername=Angel`;
        
            fetch(URL)
              .then((res) => res.text())
              .then((data) => {
                message.reply({ content: `${data.message}`, allowedMentions: {repliedUser: false}})
              });
          });
    }
}
pale vessel
#

use data

#

without message, just to see if you received proper result

lyric mountain
#

not on the site

novel jetty
slender wagon
#

Ah ok

pale vessel
#

weird

lyric mountain
#

if you must, there's a byte you need to set when re-encoding it, name's repeat iirc

#

value must be from -1 to 256

#

-1 means infinitely looping, 0 means no looping

pale vessel
rocky hearth
#

can we make a member join a thread?

pale vessel
#

i don't think so