#development

1 messages · Page 1857 of 1

boreal iron
#

Use it?!

ocean jolt
#

how!?

solemn latch
boreal iron
#

Wtf do you wanna do?

#

Oh topgg API…

ocean jolt
#

This is the method...So I need to put that in my config.json...?

solemn latch
#

in the authorization header

ocean jolt
boreal iron
#

Does he wanna do an API call?

solemn latch
#

no idea

boreal iron
ocean jolt
#

lol

solemn latch
#

assuming they know what they want to do if they are getting their token

solemn latch
ocean jolt
#

I wanna setup a system, In which someone who votes my bot, receives a dm from the bot

solemn latch
#

you dont need a token for that

boreal iron
#

Well then you wanna work with webhooks you’re receiving from topgg, creating an instance of your bot, fetch the user ID you got from topgg using your bot, send a message to the user

ocean jolt
ocean jolt
solemn latch
ocean jolt
#

and when do we need a token?

solemn latch
#

when making api requests to top.gg

#

not receiving requests

ocean jolt
#

ohh

boreal iron
ocean jolt
#

Here, Uh we have a create a webhook in a channel right??

solemn latch
umbral lake
#

Hey, for the slash commands: ```js
const Discord = require('discord.js');
const { deletionTimeout } = require('../config.json');

module.exports = {
name: 'Soon...',
description: 'aaaa',
type: "CHAT_INPUT",
options: [{
name: 'YouTube',
type: 'STRING',
description: 'no',
required: true,
}],
async run(client, interaction) {
console.log(interaction)
interaction.followUp(no...);
}
}

I don't see the slash command on my server, my handler: 
index.js: ```js
client.slashCommands = new Discord.Collection();
fs.readdirSync('./Applications').forEach(file => {
    const slashCommand = require(`./Applications/${file}`);
    client.slashCommands.set(slashCommand.name, slashCommand);
  });

    client.on("ready", async () => {
        await client.guilds.cache
            .get("848100598908846110")
            .commands.set(client.slashCommands);
        // await client.application.commands.set(client.slashCommands);
    });

my event interactionCreate: ```js
const Discord = require('discord.js');
const db = require('quick.db')
const { defaultPrefix, deletionTimeout, reactionError, suggestionPending, suggestionApprove, suggestionDecline } = require('../../config.json');

module.exports = async (client, interaction) => {
if (interaction.isContextMenu()) {
await interaction.deferReply({ ephemeral: true });
const command = client.slashCommands.get(interaction.commandName);
if (command) command.run(client, interaction);
}

solemn latch
#

you need to actually code a receiver(or use one of the libraries on the docs)

ocean jolt
boreal iron
#

Keep in mind webhooks will be send from topgg to your endpoint.
That means you have to setup your firewall properly if it doesn’t allow all incoming connections already

solemn latch
ocean jolt
rose warren
boreal iron
#

Not really as if someone wants to call you he needs your number
And if someone wants to visit you at home you need to open the door

solemn latch
#

it may help to learn about http requests, and webhooks before trying to use them.

boreal iron
#

Alright gtg my motor cycle screams to be driven smirk

#

Just ping Woo, he will assist u

solemn latch
#

AngryDoggo im already mad at my own code but sure

boreal iron
boreal iron
#

And the circle of life closes

ocean jolt
solemn latch
#

atTim

ocean jolt
#

ah I know I am kind of being dumb, But I really need help with these stuff topggSob

solemn latch
#

What part are you having issue with?

ocean jolt
#

WEBHOOKS..

#

how to setup

solemn latch
#

so just everything?

ocean jolt
#

yeah to be honest...

solemn latch
#

where are you hosting? vps/home/repli/heroku?
do you have any firewalls?

#

what library are you using for your bot

ocean jolt
solemn latch
#

I dont think they allow webhooks as a free platform.
do they provide you with an ip?

#

op, yeah they allow it through subdomains on port 2000

#

youll want to use port 2000 rather than 80

ocean jolt
#

okay.....lemme see

wooden ember
#

how would one go about updating d.js?
i have somehting like v12 installed from whats got to be like 3 years ago now
i have 3 bots running on my server 2 are privet but one is public
they all work fine but i was trying to get a bot to play a sound through a discord chat but it never worked (this was a while ago so i cant remember the specifics)
but I wonder if it was the d.js version was out dated. anyway, how easy is it to update? do i just run the install command again and t will install again like on other things or do i have to do it manualy?

#

its been a while since i have messed around with javascript or d.js so sorry if i seem incompetent.
also im running centos7 on the server

tulip ledge
#

To update the package just run npm i discord.js@latest, you will have to convert everything to work with the new features/changes

wooden ember
#

bruh i forgot about that

#

what is the latest stable version? and ho much pain do i have to do through to recode my things to work with it?

tulip ledge
#

v13.1

#

I suppose not too much if you don't use slashcommands

#

If you intend on using slashcommands

#

which will be mandatory in the future

wooden ember
#

it will?

tulip ledge
#

I suggest taking this opportunity to convert it

#

Yes they're planning on making message a privileged intent

wooden ember
#

thats just dumb slash commands are so clunky

tulip ledge
#

I actually prefer them

wooden ember
#

fair enough but personaly i like just typing commands out

earnest phoenix
wooden ember
#

there are some things that look better as slash commands like when you have to have more than one variable on a command and it gives you hints but other than that they just feel bulky

wooden ember
#

is that a stable/ longterm reliece? cuz I thought that was only the even numerd versions or is that wrong?

earnest phoenix
#

v13 is now stable

wooden ember
#

fair enough

#

also wow node it on version 16 now?

tulip ledge
#

16.7

#

to be exact

wooden ember
#

i have a feeling my system has been neglected a bit

tulip ledge
#

ye they went from 14 to 16 rlly fast

wooden ember
#

lol

#

but then its not as bad as my dads voip server thats never been updated since it was first setup in 2004

#

to make matters worce the system is just a second hand pentium 3 unit we got for a fiver and it still has the original hdd in it that is running on hopes and dreams at this point

#

but eh thats irrelevent for this channel but thx for the info

earnest phoenix
#

npm i -g n

#

n latest

wooden ember
#

will that break d.js v12 in the mean time?

#

cuz i bet im gonna have to do all this at one go and if thats the case ima take the opertunity to install another os (ubuntu server) cuz centos is eol aparently

inner fulcrum
#

i still use v12 lmao

#

djs

wooden ember
#

same

#

i just get stuff working and forget about it

inner fulcrum
#

v13 is still kinda buggi for me

earnest phoenix
#

Does someone know a good lesson for learn make bot dashboard

tulip ledge
#

You can use express

#

To talk with an api

earnest phoenix
#

I need youtube video or something like this

tulip ledge
#

you want to secure it with a jsonwebtoken based on the login info of the user through discord

#

Look tutorials about that up

earnest phoenix
#

Bc idk how can i code with compatible with api

inner fulcrum
#

is there a npm package for slash-commands for node v13

tulip ledge
#

not sure but you can use the interactionCreate event

#

and then you can check if it's a slashcommand using payload.isCommand()

inner fulcrum
#

i am talking about package gun_1

tulip ledge
#

Well, I'm not sure you can look it up on npm

inner fulcrum
#

OMH U ARE SO SMART

#

DAMN

tulip ledge
#

I have no clue if that's sarcastic or not

earnest phoenix
#

Is this the proper way to raise this exception?

#on_command_error event 
@bot.event
async def on_command_error(ctx, error):
  
  if isinstance(error, CommandNotFound):
    await ctx.send(error)
tulip ledge
#

I don't code in py but I'd think that CommandNotFound needs to be a string

#

dont kill me if I'm wrong tho

sudden geyser
#

You probably didn't import CommandNotFound

#

@earnest phoenix

earnest phoenix
earnest phoenix
#

I update to the last mongoose version and:

 error TS2349: This expression is not callable.
  Each member of the union type '{ (filter: FilterQuery<GUILD>, update: UpdateQuery<GUILD>, options: QueryOptions & { rawResult: true; }, callback?: (err: NativeError, doc: any, res: any) => void): Query<...>; (filter: FilterQuery<...>, update: UpdateQuery<...>, option
s: QueryOptions & ... 1 more ... & ReturnsNewDoc, callback?: (err: NativeError, d...' has signatures, but none of those signatures are compatible with each other.

52                     const data = await guild.findOneAndUpdate({id : ctx.guildId}, {lang : 'es'}, {
#

ok I solved it

- export default mongoose.models.GuildInfo || model<GUILD>('GuildInfo', Guild);
+ export default model<GUILD>('GuildInfo', Guild);
wicked pivot
#

max options on this ?

sudden geyser
#

25?

tulip ledge
#

Yes

#

25 is the max

#

5 action rows per message -> 5 buttons or 1 select menu per row and 25 options in a select menu

worn sonnet
#

Can someone answer it?

wooden ember
#

does anyone know what is hapoening here?

#

cuz i sure as hell dont

quartz kindle
#

on ubuntu/deb you can run sudo apt install build-essential

wooden ember
#

ah cool

#

im on centos so i assume i use yum instead of apt?

pale vessel
#

Try sudo yum groupinstall 'Development Tools'

#

Nm don't

#

That installs all development tools

wooden ember
#

bruh

quartz kindle
#

easier to install all tho

#

thats what build-essential does as well

pale vessel
#

I c

wooden ember
#

welp whatever it is its installing

pale vessel
#

That was the first stack overflow answer

wooden ember
#

bruh ive been googling this error for hours howd you get an answer so fast

#

or are you on about the dev tools thing

quartz kindle
#

the error is make: cc: command not found

#

cc is a compiler

wooden ember
#

ah fair enough

#

i have centos minimal so that makes sence

quartz kindle
#

if it was not found, then building tools like compilers are missing

wooden ember
#

indeed

quartz kindle
#

usually compilers and makers have a lot of other dependencies and utilities, so just installing gcc usually isnt enough

wooden ember
quartz kindle
#

yes

wooden ember
#

cool

quartz kindle
#

130mb should be fast on a vps

wooden ember
#

self hosted

quartz kindle
#

rip

wooden ember
#

indeed

quartz kindle
#

how fast is your internet?

wooden ember
#

like 2Mb/s

quartz kindle
#

rip²

#

wait

wooden ember
#

3 on a good day

quartz kindle
#

MB or mbps?

wooden ember
#

megabits not megabytes

quartz kindle
#

rip³

boreal iron
#

lol mpbs

wooden ember
#

indeed

#

its cuz my internet is adsl and has to go through like 7 miles of copper

boreal iron
quartz kindle
quartz kindle
boreal iron
#

mbps

#

Not mpbs

#

Damn nobody got it

wooden ember
#

the good thing is as soon as i build a new voip server we can switch to fibre but i have to install analogue interface cards and the software for that lost suport ing like 2012 so there are errors left right and center

quartz kindle
#

did i write mpbs?

#

Lol

#

im slightly dyslexic sorry

wooden ember
#

yeah but i understood what you ment

wooden ember
quartz kindle
#

i surrender

#

i accept my arrest

boreal iron
quartz kindle
#

:^)

#

hey you win some you lose some

boreal iron
#

Aye

#

It’s probably your turn next time

wooden ember
#

welp 30 seconds left for the download

quartz kindle
#

ay that was fast

wooden ember
#

lol

#

its only the bandwidth is crap my ping is awsome

boreal iron
#

lol crying about 30s…
You don’t know the times when ISDN started with 56kbit/s

wooden ember
#

but thats only when no one else is using the internet

quartz kindle
#

everytime you got randomly disconnected, you'd have to pay again

wooden ember
quartz kindle
#

usually happened several times a day

wooden ember
#

and it was intermittent too so it was like that for like 6 months

quartz kindle
#

i got my router eaten by ants once

boreal iron
#

Hehe still remember the time when accidentally opening the web browser on old mobile phones at a time internet flats didn’t exist

wooden ember
#

every time a technission came round it magically worked

#

enfuriating

quartz kindle
#

rip

boreal iron
#

Which did cause a bill as fat as a lexicon

wooden ember
#

but then the wire just snapped and they replaced the wire

#

oop downloads finnished everything is varifying

boreal iron
#

Playing snake on a Nokia, accidentally opening the browser and boom bankrupt

quartz kindle
#

xD

wooden ember
#

and done

boreal iron
wooden ember
#

and opus is installing properly now by the looks of it

quartz kindle
#

because my mobile was always prepaid

#

it could eat all my credits, but i never kept too many of them

boreal iron
#

Ah yeah

#

Makes sense tho

wooden ember
#

bruh i just have pay as you go on my phone and i just dont buy data

quartz kindle
#

same

wooden ember
#

is this important?

pale vessel
#

Yes

boreal iron
#

It’s a little better nowadays still fucking expensive here in my country

quartz kindle
#

not much important

#

but you can run audit fix like it says

wooden ember
#

what is that cuz ive had warnings like that on other pakages but it rarly affects things

quartz kindle
#

usually these warnings are about packages possibly interfering with each other because some dumb ass decided to mess with native prototypes

#

some are can be actual vulnerabilities but its rare

wooden ember
#

so this is some one elses problem and makes no odds cuz im just truing to make a privet discord bot for a meme?

quartz kindle
#

these vulnerabilities are about very specific situations

wooden ember
#

ah

quartz kindle
#

for example a regex package that has a vulnerability where if your program accepts regex input from users, they could abuse the regex engine on that particular package to do something

wooden ember
#

ah fair enough

#

welp the bot finaly works and plays my mp3 files

#

thx guys for the help

quartz kindle
#

👍

wooden ember
#

nice

rustic nova
#

no

vital carbon
#

development

sage bobcat
#

One message removed from a suspended account.

harsh nova
#

mods know

stoic dock
#

imagine coming here to talk smh

drowsy crag
#

im developing

rustic nova
#

Please keep this channel development related

stoic dock
#

same

misty sigil
harsh nova
#

what are you developing

final obsidian
#

hi so the discord css isnt working

hollow valley
#

kinda sus

misty sigil
#

anyways does anyone know an efficient way to link 2 servers together

drifting shell
#

i blame matthew

vital carbon
misty sigil
#

fucking hell sam

vital carbon
#

nice

final obsidian
sage bobcat
drifting shell
misty sigil
harsh nova
#

like a text channel that connects the servers?

sage bobcat
#

One message removed from a suspended account.

misty sigil
#

server 1 tries to send something to server 2’s client because of game stuff

#

how do I get server 2 to send to client

drifting shell
misty sigil
sage bobcat
#

One message removed from a suspended account.

drifting shell
#

hello

misty sigil
#

hi

final obsidian
drifting shell
#

she wasnt talking to you matthew, go away angeryBOYE

final obsidian
#

so heres my code

misty sigil
#

big master server

harsh nova
#

cant you use something like http to send whatever you need between the servers?

misty sigil
#

Yea I think I’ll do that

#

server registers with coordinator server

harsh nova
#

yea

misty sigil
#

server then registers all clients with coordination server

harsh nova
#

just make sure you have the networking secured so no one does some server trolling

misty sigil
#

ofc

#

gonna use 2fa

#

lmao

harsh nova
#

neat

misty sigil
#

gotta get those security secured

final obsidian
misty sigil
#

ok I’m gonna go to sleep now

harsh nova
#

gn

rare mist
#

On JDA is there a way of catching any exception that might occure anywhere?

opaque seal
#

ask in their server

rare mist
#

I asked in the JDA server but they were as unseful as Axe without the head

sudden geyser
rare mist
#

😦

sudden geyser
#

Of course, you have the RestAction and try/catch. I'd suggest it's bad practice to just catch anything from everywhere.

eternal osprey
#
 const links3 = uavcodes.split('\n');
  const link3 = links3[Math.floor(Math.random() * links3.length)];``` I have this code that randomly sends a link
#

how would i send multiple ones at the same time>

#

for example 3 links at the same time instead of 1

sudden geyser
#

If you don't care about duplicates, just pick a random one again. If you do, you could write a loop that checks if the random selected value has already been picked before.

eternal osprey
#

how would i create the loop?

#
for (let i = 0; i < links3.length; i++) {
  text += links3[i]
}```
#

like this, just a normal for loop?

quasi hearth
#

pretty much

sudden geyser
#

No, because it has to repeat indefinitely until 3 valid values have been selected.

eternal osprey
#

ty!

eternal osprey
quasi hearth
#

maybe something like:

const links = [/*some list of links*/];
let text = "";
// repeat 3 times or until no more links
for (let i = 0; i < 3 && i < links.length; i++) {
  const randomIndex = Math.floor(Math.random() * links.length),
    random = links[randomIndex];
  text += random + "\n";
  // remove used link
  links.splice(randomIndex, 1);
}
pale vessel
#

So long

sudden geyser
#

Yeah like that

eternal osprey
#

it's not an array i am reading from

#
const uavcodes = fs.readFileSync('./uavcodes.txt', 'utf8');
  for (let i = 0; i < args1[0][3]; i++) {
  const links3 = uavcodes.split('\n');
  const link3 = links3[Math.floor(Math.random() * links3.length)];
  g.send(`Hey ${g}! Here is(are) your key(s): \n`+link3)
  const index3 = links3.indexOf(`${link3}`);
  if (index3 > -1) {
 links3.splice(index3, 1);
 let newLinks3 = links3.join('\n')
 fs.writeFileSync('./uavcodes.txt', newLinks3);
 
}
``` ignore the strange names
quasi hearth
#

it was a string, separated by new lines, right? That can be quickly turned into an array

eternal osprey
#

anyways i am successfully sending the codes, however it is only removing 1 code from the text file

twin kettle
#

guys wuts the best License to keep my github project private

quasi hearth
eternal osprey
#

imagine if it generated code1 and code2, it would only remove code1 from the file

twin kettle
twin kettle
lyric mountain
#

you don't need a license at all if it'll stay private

twin kettle
#

@quasi hearth u got a better idea to host a bot in github ?

lyric mountain
#

you cant host a bot on github

#

github is a git repository

quasi hearth
twin kettle
quartz kindle
#

running the code in github actions

#

lmao

eternal osprey
quartz kindle
#

because you didnt update the uavcodes variable

#

also that code is very inefficient

eternal osprey
quartz kindle
#

you are writing to the file yes

#

the variable is not the file

#

the variable is a copy of the file

#

uavcodes is a copy of the file and links3 is a copy of uavcodes

#

you change links3 and the file, but the uavcodes copy is untouched

eternal osprey
#

huh

#

but wait

earnest phoenix
#

Bruh did tj really change his name

#

oh no he didn't

blissful coral
#

This is in development?

earnest phoenix
#

wrong place

#

my bad

#

Thought I was in general lawl

blissful coral
#

This makes no sense

#

How

sudden geyser
#

how did you call it

blissful coral
#
fetchLeaderboard('547938713280446474').then(console.log)
crimson vapor
blissful coral
#

was testing something

earnest phoenix
#

doesn't static make it so you can use it without initalizing the class

blissful coral
#

Yes

crimson vapor
#

it does

blissful coral
#

Anyways

#

Any idea why that wouldn't work?

#

page = 0 limit = 1000 and somehow it is opposite when logged?

crimson vapor
#

you did fetchLeaderboardByPage(guild, 1000, 0)

#

maybe

blissful coral
#

no

earnest phoenix
#

probably mixing stuff up somewhere

blissful coral
#

I didn't

earnest phoenix
#

seems like page and limit switched somehow

crimson vapor
#

oh

blissful coral
#

In ts file

#

wait

#

nvm

#

I fixed

earnest phoenix
#

lawl

thorny flume
#

ds.js@13 is giving me this error:

ReferenceError: AbortController is not defined

sudden geyser
#

You need Node.js v16.6

blissful coral
#

How long does it take for the npm registry to cache a update so I can install it?

#

Been 2 minutes and I cannot install the new version of a package

#

Nvm its working

thorny flume
#

where can i see updates of the ds.js@13?

rose warren
#

On the Github repo

#

You'll have the release notes

thorny flume
#

okay

#

thanks

thorny flume
#

ds.js@13:

module.exports = async (client) => {
    client.user.setPresence({
        status: 'online',
        activity: {
            name: `testing || ${process.pid}`,
            type: 'WATCHING'
        }
    })
}
#

not function

sudden geyser
#

It details all changes between v12 and v13

quartz kindle
thorny flume
#

okay

earnest phoenix
#

surprised they didn't split it up like everything else
client.user.presence.set()

#

be another useless thing

sudden geyser
#

Why is it called ActivitiesOptions

#

Why not ActivityOption

thorny flume
#

what

#

plataform?

#

lol

#

now you can set the platform your bot is playing on

#

lol

quartz kindle
thorny flume
quartz kindle
#

wdym "what is the tab"

#

i dont understand the question

thorny flume
slender thistle
#

URL you mean

quartz kindle
#

ah the url?

frail zenith
thorny flume
#

ok

#

thanks

twin kettle
#

anyone know heroku ?

quartz kindle
#

knowing as in knowing what it is, yes

twin kettle
#

...help

boreal iron
#

Did you already take a look at the mentioned logs?

exotic comet
#

How can I make that a header?

outer mist
#

I am not able to use dank memer, can anyone help me out with it?

livid jackalBOT
#

@outer mist

Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Discord" button on the bot's page of the bot you need support for, not the "Join Discord" button at the top of our website. If there isn't a button that says Support Server, the server invite is invalid or you were banned from the bot's support server, then we can't help you. Sorry :(

outer mist
#

Thanks bro 😊

drifting reef
#
@client.event
async def on_dbl_vote(data):
```Umm.. how do i make this log the votes in a specific channel in my main server
pale vessel
drifting reef
sudden geyser
#

well what is data

drifting reef
sudden geyser
#

then let's start there

#

on_dbl_vote is some event

drifting reef
#

k

sudden geyser
#

and you're probably using a library for it

drifting reef
sudden geyser
#

So check the library to see what data is supposed to be

drifting reef
#

i cant find the docs

sudden geyser
#

and bam, now you know what it is

drifting reef
#

ok

sudden geyser
#

So data["user"] will return the ID of the user who voted

#

So you could fetch that user with your client instance.

#

And send the message to the channel.

drifting reef
#
@client.event
async def on_dbl_vote(data):
  votechannel = commands.get_channel(880294980076326933)
```Well, now am i right so far?
pale vessel
#

What's commands

drifting reef
pale vessel
#

Aren't you supposed to get the channel from client?

drifting reef
#

oh u mean commands.bot

#

ok ok

pale vessel
#

Literally client

drifting reef
#

i understood

#

client.get_channel()
right?

drifting reef
# pale vessel Literally `client`
@client.event
async def on_dbl_vote(data):
  votechannel = client.get_channel(880294980076326933)
  voteEm = discord.Embed(title="New vote!", description="", color=discord.Colour.red())
  voteEm.add_field(f"{data.user} has voted for the bot!")
  await votechannel.send(embed=voteEm)
```Is this right now?
pale vessel
#

Try the test button

drifting reef
pale vessel
#

Next to the save button

#

I believe

drifting reef
pale vessel
#

In the webhook section?

drifting reef
drifting reef
#
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")
bot.topgg_webhook.run(5000)
#

Someone help?

weary dune
#

can anyone help me with the javascript topgg sdk as im currently getting an error for the topgg package being undefined, even though i have it installed via npm

feral aspen
#

Haii.

#

I'd like to ask.. when I type !eval bot.users.cache.size;, it keeps increasing and increasing.

#

Meaning it keeps caching more users.. but is it possible to show the top amount immediately.

cinder patio
#

Every guild has a memberCount property, add each guild's memberCount

earnest phoenix
#

how do I check if a str is a valid link

#

I mean I could put .startswith('https') or sum but what about the other type of urls

rose warren
#

If you want to know if it's a valid page and returns a 200 status you'd have to fetch it

earnest phoenix
#

hm

#

and then

rose warren
#

So only way to know is to fetch

earnest phoenix
#

good idea lemme do that

#

wait

#

I can also do one more thing

#

but well if its a valid link only then I'll process the code further or just return None

#

thanks for the idea tho

rose warren
#

You could do a regex on it instead but that will only tell you if the link is formatted correctly, not if the site / page exists

earnest phoenix
#

indeed that's what I was thinking rn

#

how do I do the if statement in one line

rose warren
#
if (true) //code here
#

JS

near grotto
#

it's showing error

earnest phoenix
#

@near grotto 1. you are running a copy of an open source bot. 2. There should be no space around =

near grotto
#

still it's showing the error

#

actually

#

it cannot import the token from process.env

earnest phoenix
#

Yeah

#

Because you typed npm start instead of pressing run button

#

Console commands cannot use env

#

Try changing your .replit to run="start command" @near grotto

hard walrus
#

I want to prohibit using commands without voting how can I do it? (aoi.js)

inland lava
#

Sup

hard walrus
quartz kindle
#

you have to write in the aoi.js server

earnest phoenix
#

When will be discord.py new version be released?

sacred aurora
#

anyone know what kind of encryption is this?

const decrypt = (t) => {
  let a = "eST4kCjadnvlAm5b1BOGyLJzrE90Q6oKgRfhV+M8NDYtcxW3IP/qp2i7XHuwZFUs";

  if (t.replace(/[\t\n\f\r]/g, "").length % 4 == 0) t = t.replace(/==?$/, "");

  for (var r, x = "", u = 0, e = 0, c = 0; c < t.length; c++) {
    r = t[c];
    r = a.indexOf(r);
    u <<= 6;
    u |= r;
    e += 6;
    if (24 === e) {
      x += String.fromCharCode((16711680 & u) >> 16);
      x += String.fromCharCode((65280 & u) >> 8);
      x += String.fromCharCode(255 & u);
      u = e = 0;
    }
  }

  if (12 === e) {
    u >>= 4;
    x += String.fromCharCode(u);
  } else if (18 === e) {
    u >>= 2;
    x += String.fromCharCode((65280 & u) >> 8);
    x += String.fromCharCode(255 & u);
  }

  return x;
};
#

^^ this is the decrypt function, and i want to reverse it to encrypt

quartz kindle
#

looks like a custom base64 with non-standard order

quartz kindle
#

its missing remainder resolving, so it only works in blocks of 3 chars, but its easy to fix
EDIT: finished version ```js
function encrypt(text) {
let a = "eST4kCjadnvlAm5b1BOGyLJzrE90Q6oKgRfhV+M8NDYtcxW3IP/qp2i7XHuwZFUs";
let r = "";
let n = 0;
let b = 0;
for(let i = 0; i < text.length; i++) {
n += 8;
b <<= 8;
b += text.charCodeAt(i);
if(n === 24) {
r += a[b >> 18] + a[(b >> 12) & 63] + a[(b >> 6) & 63] + a[b & 63];
n = b = 0;
}
}
if(n === 16) {
r += a[b >> 10] + a[(b >> 4) & 63] + a[(b << 2) & 63];
} else if(n === 8) {
r += a[b >> 2] + a[(b << 4) & 63];
}
return r;
}

feral aspen
#

Hi.

#
let itemToUse = args[0];

if (!itemToUse) {
    embedError.setDescription("❌ Please mention the item ID that you want to use.");
    return await message.channel.send({ embeds: [embedError] });
};

const validItem = !!items.find((val) => val.id === itemToUse.toLowerCase());

if (!validItem) {
    embedError.setDescription("❌ The item ID you entered is invalid.");
    return await message.channel.send({ embeds: [embedError] });
};
#

args[0] is equal to attitudeCOIN and val.id is equal to attitudecoin, but why is it returning true in the second if statement.

cinder patio
#

you're a disgrace to humanity

quartz kindle
sacred aurora
#

although there's a weird undefined at the end

#

nice its fixed now

short comet
sacred aurora
#

thanks again tim

quartz kindle
#

👍

eternal osprey
#

how do i send an embed and immediatelly saving its id to a database?

#

with other words, how do i get the id lol

slender thistle
#

a = send_message(...)
a.id

#

An embed belongs to a message

jovial nexus
#

is there a way in djs v13 to get to the resource only having the player (in voice)

earnest phoenix
#

Does anyone know what to do about this issue? My bot is using slash commands as the default prefix. The issue is people keep kicking it since the prefix isn't /. What should I do?

rose warren
charred wyvern
#

Settings for: {{guild['name']}}

#

I kept this in my html code H1 tag

#

bu the guild name doesnt appear

feral aspen
#

OH.

#

I'm so sorry my bad.

jovial nexus
#

how can i get the volume down only having the player in djs/voice v13?

umbral lake
#

hey, when I set commands to my server: js client.on("ready", async () => { await client.guilds.cache .get("848100598908846110") .commands.set(client.slashCommands); // await client.application.commands.set(client.slashCommands); });
my bot has an error missing access he is admin

pale vessel
#

That doesn't matter, did you invite the bot with the applications.commands scope?

eternal osprey
#

let a = await message.channel.send(helpembxd)
        console.log(a)```how do i find it;'s embed id.
earnest phoenix
#

Should I make it clear that / is not the bot's prefix on Top.GG?

rose warren
earnest phoenix
#

Oh ok

rose warren
#

Don't get caught up in the stats. Just build a good bot with unique features.

earnest phoenix
#

Ok, thanks

quartz kindle
#

embeds dont have ids

rose warren
#

I think they mean the id of the bot's reply message

narrow sedge
#

Discord Bots can't edit other peoples messages right?

#

Someone from another server say they can edit other users messages

cinder patio
#

they can't

ruby valley
eternal osprey
#

how do i remove all reactions from an embed?

eternal osprey
slender wagon
#

has anyone ever worked on a tipping crypto bot?

ruby valley
#

I think you can loop through a list of reactions and remove them one at a time

#

Pretty sure that's how I managed to do it

dusky light
#

Hey, can someone help me with my code?

        if(err) throw err;
        if(data) {
            message.channel.send(new MessageEmbed()
            .setTitle(`${user.user.tag}'s Warns │ ` + bot.user.username)
            .setDescription(
                data.Punishments.map(
                    (w, i) =>
                    `\`${i + 1}\` | Moderator : ${message.guild.members.fetch(w.Moderator).user.id}\nReason : ${w.Reason}``
                )
            )
            .setColor("RED")
            .setFooter(`Angefragt von × ${message.author.tag}`, `${message.author.avatarURL()}`)
        )
    } else {
        message.channel.send(new MessageEmbed()
        .setDescription("Dieser User hat noch keine Verwarnungen!")
        .setColor("GREEN")
        );
        }
    });```

Im getting this error: ````\`${i + 1}\` | Moderator : ${message.guild.members.cache.get(w.moderator).user.id}\nReason : ${w.reason}`     
                                                                                              ^
TypeError: Cannot read property 'id' of undefined```
near grotto
#

which language is this? I found it on discord dev portal static void UpdatePresence() { DiscordRichPresence discordPresence; memset(&discordPresence, 0, sizeof(discordPresence)); discordPresence.state = "Playing Solo"; discordPresence.details = "Competitive"; discordPresence.startTimestamp = 1507665886; discordPresence.endTimestamp = 1507665886; discordPresence.largeImageText = "Numbani"; discordPresence.smallImageText = "Rogue - Level 100"; discordPresence.partyId = "something"; discordPresence.partySize = 1; discordPresence.partyMax = 5; discordPresence.joinSecret = "something"; Discord_UpdatePresence(&discordPresence); }

ruby valley
#

Looks like Java

vivid fulcrum
#

no lol

#

cpp

#

memset is a cpp keyword

#

and there's pointers

near grotto
#

ohhh

#

how do I add discord_rpc.h ?

ruby valley
#

Anyone know how to have a bot detect when someone is live on twitch

rose warren
#

Check their presence activities

#

You'll need the presence intent

ruby valley
#

Damn don't have presence intent

#

Guess I'll figure something else out since it took 6 months to get members and I'd rather not wait that long

rose warren
wheat mesa
#

I think there’s a way to receive an event when a certain streamer goes live using the twitch api iirc

ruby valley
#

I'll look through the Twitch api though I'm thinking since I'm trying to have the bot change it's status when I'm streaming, I might be able to do some stuff with batch

rose warren
#

Yeah. You might want to verify it's actually their Twitch account though.

#

I'm pretty sure there are bots that exist already where you can just follow streamers and get notifications.

wheat mesa
#

If it’s just for you, you could just run a simple command every time you start streaming so the bot can change its status

ruby valley
#

I've got a few ideas

rose warren
#

Yeah that's easier imo

wheat mesa
#

If you don’t want to bother with a more complicated solution that is

ruby valley
#

I like doing stupidly complicated stuff so I'm down to figure something out

#

Probably going to see if I can use some batch to simultaneously start the stream and make the bot do something

dusky light
#
        if(err) throw err;
        if(data) {
            message.channel.send(new MessageEmbed()
            .setTitle(`${user.user.tag}'s Warns │ ` + bot.user.username)
            .setDescription(
                data.Punishments.map(
                    (w, i) =>
                    `\`${i + 1}\` | Moderator : ${message.guild.members.fetch(w.Moderator).id}\nReason : ${w.Reason}`
                )
            )
            .setColor("RED")
            .setTimestamp()
            .setFooter(`Angefragt von × ${message.author.tag}`, `${message.author.avatarURL()}`)
        )
    } else {
        message.channel.send(new MessageEmbed()
        .setDescription("Dieser User hat noch keine Verwarnungen!")
        .setColor("GREEN")
        );
        }
    });```

Can someone help me? - When I run the command **Moderator : ** is undefined. ![Hmm](https://cdn.discordapp.com/emojis/814543161313460244.webp?size=128 "Hmm")
boreal iron
#

fetch() returns a promise

dusky light
#

Ouh, that's right. And how can I fix it?

#

I'm sitting on this one thing since 1h xD

boreal iron
#

await it inside your arrow expression

#

const moderator = await …fetch()

haughty bough
#

Hello. Does anyone know any libraries or any other ways to do unit tests on bots?

lyric mountain
#

language?

haughty bough
#

js/ts

earnest phoenix
#

i recommend jest

quartz kindle
#

you mean like testing api events and such?

earnest phoenix
#

never used it

quartz kindle
#

idk if there is an updated discord api mockup

earnest phoenix
haughty bough
quartz kindle
#

yeah i think the only good solution is to make your own tests

lyric mountain
haughty bough
#

é o jeito

#

Thank you guys

lyric mountain
#

dnd

misty sigil
earnest phoenix
#

Hi can anyone help me to add embeds, say and add reaction on bot created in discord bot clint

outer perch
#

no one answered in the official D.JS discord, I'll send the question here:

how can I put a button's .setDisable to true after anything gets selected on a select menu?
I don't want to update every component, just one, and that's the OK button for confirmation/saving

quartz kindle
#

you have to set it in the response

feral aspen
#

In slash commands.. is this possible with sub commands?

!use // command name
!use <item A> <amount>
!use <item b> <@user> <amount>
#

I have like 30 items.. like fck me.

nova basin
#

Help me please

module.exports = ({
name:"game",
code:`
$djseval[const opponent = message.mentions.users.first();
const minigames = require('discord-minigames')
minigames.startBattle(member, message)
$onlyif[$mentioned[1]!=;{description:Mention someone to play against!}{color:FF0000}]

`})
outer perch
feral aspen
nova basin
#

._.

near stratus
quartz kindle
feral aspen
#

I'm sorry but I haven't understood anything.

near stratus
#

I was Googling for "Thomas has never seen such a shit before" meme

outer perch
feral aspen
nova basin
quartz kindle
quartz kindle
#

you have to set all components

outer perch
quartz kindle
#

its the same as when editing an embed

feral aspen
quartz kindle
#

you have to send a new embed to replace the old one

outer perch
#

with embeds I can splice fields for example

quartz kindle
#

you still have to clone the existing embed

outer perch
#

yeah... ;-;

quartz kindle
#

you can do the same with the buttons

nova basin
quartz kindle
#

you can clone them and edit them

nova basin
near stratus
#

@nova basin I saw your code then I saw the npm library you mentioned then I saw your code again
Then look nothing similar
Like nothing at all (nothing)
Is that even djs ?
It looks like something like bdfd tho

nova basin
#

It's not bdfd ._.

near stratus
#

It looks like more bdfd than djs

nova basin
#

There is no package called bdfd.js I am wrong?

quartz kindle
#

thats the aio.js bullshit or something

nova basin
#

I use aoi.js

quartz kindle
#

bdfd = bot designer for discord, which is based on dbd.js which is based on discord.js
dbd.js is outdated and abandoned, and aoi.js is the new version of dbd.js afaik

nova basin
#

The code is discord.js so I don't see the problem ????

near stratus
#

Hey @quartz kindle can you please put your replit (The node16 one) code to GitHub ?

near stratus
near stratus
nova basin
#
const opponent = message.mentions.users.first();
const minigames = require('discord-minigames')
minigames.startBattle(member, message)
#

It's discord.js ?

near stratus
#

Also that code is too short to tell it's djs

charred wyvern
#

Settings for: {{guild['name']}}
I kept this in my html code H1 tag
bu the guild name doesnt appear

#
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>settings for: {{guild['name']}}</h1>
    <img src="https://cdn.discordapp.com/icons/{{guild['id']}}/{{guild['icon']}}.png">
    
</body>
</html>
tulip ledge
#

is it ejs?

#

That you're using

#

or just html

charred wyvern
#

HTMl

tulip ledge
#

because you need to use ejs to use vbariables

charred wyvern
#

How do I use that?

tulip ledge
#

And that {{ }}

#

is reactjs

#
wheat mesa
#

If I wanted to get started with web dev, should I start off with react?

tulip ledge
#

React is rlly fun

#

Doesn't really matter what framework you pick, idk

#

I use react

#

it's fun but quite complicated

near stratus
tulip ledge
#

Well ofcourse

near stratus
#

And JavaScript

#

Learning react before js is like learning to fly a plane before being born

tulip ledge
#

Pretty sure I've seen Waffle talk about js here before

#

are there any alternatives for bootstrap to style?

near stratus
#

tailwind ?

#

I saw a lot of ppl use it

tulip ledge
#

that's it

#

I knew there was one but couldn't find it

royal portal
#

why does my site shows 'suspicious' on virustotal

quartz kindle
#

because you're sus

royal portal
#

no im not

#

im using github pages

quartz kindle
#

sus

royal portal
#

help cryangeryBOYE

tulip ledge
near stratus
wheat mesa
#

My HTML is trash though

#

I understand the basics I just struggle with divs

royal portal
#

i'll ask again later

#

you guys bully me cryangeryBOYE

tulip ledge
near stratus
lyric mountain
#

it's a trap

near stratus
#

@wheat mesa ^^^

wheat mesa
#

I’ll look at that once I get home

#

I’ve been needing to start learning web dev

quartz kindle
#

react is a trap

near stratus
#

how ?

#

It's just HTML
with js inside {}

lament rock
#

bloated

wheat mesa
#

Oh no not another debate on frameworks!

lament rock
#

Just use templating like pug

wheat mesa
#

I hear “react is good”

lament rock
#

🐶

wheat mesa
#

Then I hear “react is bad”

#

Then again I suppose it’s based on opinions of varying experience

tulip ledge
#

react is good

wheat mesa
#

I’ll probably start off with react purely due to its popularity

lament rock
#

just because it's popular doesn't mean it's good

wheat mesa
#

I’m aware

#

I’ve seen djs

sudden geyser
#

I don't see what's wrong with React.

solemn latch
#

I feel like react is probably really good, I'm just too lazy to learn it

sudden geyser
#

To me it is

tulip ledge
#

I love react

#

its so fun

lament rock
#

Discord mobile uses it making it instantly bad

#

That's not my whole basis for disliking it

solemn latch
#

Discord mobile is bad?

sudden geyser
#

I like that it's reactive like SwiftUI and Jetpack Compose is, making state easier to reason with

lament rock
#

quite slow to update as well

#

you have to be in the betas just to get current features

solemn latch
#

That's just discord though

inner fulcrum
near stratus
lament rock
#

I'm aware

solemn latch
#

It's like calling html bad because many sites use html poorly

lament rock
#

PHP

wheat mesa
#

PHP: Professionally-Hated Programming

sudden geyser
#

php is fine

dusky light
#

Hey, I've a big problem!
When I warn someone and want to list the warn's of the user XYZ it sends me every warn's from the server, just with an other username PeepoShrug

const bot = new Client();

const db = require('../../models/warns');

module.exports.config = {
    name: "warns",
    aliases: []
}

module.exports.run = async (bot, message, args) => {

    if(!message.member.hasPermission(['ADMINISTRATOR', 'MANAGE_MESSAGES'])) return message.channel.send(':x: Du hast keine Rechte, um den Command zu benutzen!')
    const user = message.mentions.members.first() || message.guild.members.cache.get(args[0])
    if(!user) return message.channel.send('Der User konnte nicht gefunden werden!')
    const reason = args.slice(1).join(" ")
    db.findOne({ GuildID: message.guild.id, User: user.id }, async(err, data) => {
        if(err) throw err;
        if(data) {
            message.channel.send(new MessageEmbed()
                .setTitle(`${user.user.tag}'s warns`)
                .setDescription(
                    data.Punishments.map(
                        (w, i) => 
                        `\`${i + 1}\` | **Moderator:** ${message.guild.members.cache.get(w.Moderator).user.tag}\n**Reason:** ${w.Reason}`
                    )
                )
                .setColor("RED")
                .setTimestamp()
                .setFooter(`Angefragt von × ${message.author.tag}`, `${message.author.avatarURL()}`)
            )
        } else {
            message.channel.send('Der User hat keine Verwarnungen.')
        }

    })
}```
quartz kindle
#

what name?

dusky light
#

the username

#

like this PeepoShrug

quartz kindle
#

you said it shows up with a different username

#

what username does it show?

dusky light
#

the username of the user, i mentioned

quartz kindle
#

it shows the mentioned user instead of the moderator?

dusky light
#

No.. I gave Wolfo an warn...
Then I requested his warn's everything is fine like you see...
But then if I request my warns Wolfi
It shows me the same warn's I gave Wolfo

quartz kindle
#

check if they are saved correctly in the database

#

console.log(data)

dusky light
#

This is, what he give's me, when I want to look up my warns.
(And there are NO warns under my name!)

quartz kindle
#

then you are saving them wrong

dusky light
#

uhm- let me show you

#

This is my Schema:


let WarnSchema = new mongoose.Schema({
    GuildID: String,
    UserID: String,
    Punishments: Array
})

module.exports = mongoose.model('warns', WarnSchema);```
#

And that's my code

#

(for the warn command)

quartz kindle
#

why are you doing Punishments.unshift()?

hallow finch
#

(node:2547) UnhandledPromiseRejectionWarning: ReferenceError: content is not defined

#

what did i do wrong here?

#

im trying to make a bot that sends random topics

quartz kindle
#

its not content that is undefined

grand slate
#

define content

quartz kindle
#

its message

hallow finch
#

add message in (client)
so (client, message)

#

?

quartz kindle
#

depends how you are calling the function

dusky light
#

@quartz kindle | Got it, gonna fix my DB saving tomorrow. But thanks for helping

quartz kindle
#

👍

hallow finch
#

(node:2836) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'content' of undefined

#

i got this now

lyric mountain
#

are you trying to get content of a slash command message?

hallow finch
#

yes

lyric mountain
#

you can't

hallow finch
#

what do i do

lyric mountain
#

slash commands don't have messages linked to them

lament rock
hallow finch
#

ok so what shall i change?

summer torrent
#

they are not messages

lyric mountain
#

use slash events instead of message events

lament rock
#

Maybe not traditional messages, but they are still "messages"

summer torrent
#

what do you want to do

lyric mountain
#

with it u can get the slash params

lyric mountain
#

they are direct triggers basically

lament rock
#

isnt there a message prop on the interaction

summer torrent
hallow finch
#

sorry im a newbie i dont really know what to change

#

im only 14 and learning

#

can u tell me what to do

lyric mountain
#

only author, guild, member and params

#

and other common stuff

hallow finch
#

where do i put slash events?

lyric mountain
#

var 😩

hallow finch
#

do i remove message ? im confused

rose warren
#

Has anyone used Laravel for web dev?

hallow finch
#

no

#

does anyone know what to do?

lament rock
#

oh. I'm thinking of buttons having a message prop

#

interactions are weird

lyric mountain
#

buttons do have

#

only slashes don't

slender wagon
#

I am starting to work on a discord bot after a long while, i am tryna implement a command handles is that gonna be the same thing even if i am using slash commands

sudden geyser
#

It may depend on the shape of the data/library you use, but it's still the same process.

#

A command handler is just a way to parse a set of commands into a structure so you can conveniently use them.

slender wagon
#

discord.js

sudden geyser
#

I don't know how Discord.js handles slash commands.

#

So you should consult the documentation.

slender wagon
#

okay thx

wicked pivot
#
[
{"user":"363402633752477696","name":"coucou"},
{"user":"363402633752477696","name":"test"},
{"user":"363402633752477696","name":"blabla"},
{"user":"363402633752477696","name":"max"},
{"user":"363402633752477696","name":"maxx"}
]```
#

get by name ?

#

(on array)

sudden geyser
#

Provide more context please

wicked pivot
#

get {} on [] by name on {}

sudden geyser
#

great

#

Just use .find and check if the .name matches

boreal iron
wicked pivot
#

I couldn't be simpler

sudden geyser
#

No that's a great way to put it

#

tells me everything

lyric mountain
#

then you could just do <collection>["the name"]

low bone
lyric mountain
#

===

near stratus
#

I wonder if ppl still use ==

boreal iron
#

Sure why should the data type matter in this situation?

lyric mountain
#

who knows

#

given how weirdly js behaves it's better to minimize possible issues

boreal iron
near stratus
#

it's better to use isEqual() then

lyric mountain
#

plus your linter is gonna shout the hell out of u for not using ===

boreal iron
#

Pfff only hardcore coding is coding

#

No linter, no debugger, no syntax highlighting

near stratus
lyric mountain
#

without ctrl z

boreal iron
#

++

boreal iron
#

Let’s not cross the line lmao

near stratus
quartz kindle
#

without tabs and auto-indent

boreal iron
#

No no no… don’t go crazy boy

quartz kindle
#

without text color

#

all characters are the same color as the editor background

#

essentially, invisible characters

crimson vapor
#

can I assign a property to a function in js

#

I can, right?

#

something like ```js
function someFunction () {
return 'string'
}
someFunction.x = 'another string'

low bone
#

function is object so, i guess u can xD

#

@lucid trench i feel your pain, editing for djs update
i spent half a day doing same and not even sure if i covered them all

lucid trench
#

i have to make 150 cmds

low bone
#

i had 300+ js files to do

lucid trench
#

lol

low bone
#

i used sometimes mass replacement when there was pattern

#

i recommend you using it to skip some portion

#

using regex
and replace within all files

crimson vapor
#

I went through like 30 files or so

#

but I standardized everything to like send('content')

low bone
lucid trench
#

its pain

#

but i see the positives

low bone
#

but don't expect doing this for all djs functions xD

lucid trench
#

like loads of slash cmds

#

lol

proven lantern
#

is the userUpdate event triggered when a member leaves the server or has their account deleted? could user.username be null in that case?

client.on('userUpdate', async (oldUser, user) => {

quartz kindle
#

it shouldnt trigger in those cases

quartz kindle
#

show code

#

why are you importing something with the same name tho?

#

how did you import the class in the actual code?

#

ye

#

a default export only works with import not require

#

to use it with require you have to use export = class

#

ex

#
declare module 'mymodule' {
  class MyClass {
    constructor()
  }
  export = MyClass
}
#

yeah

#

thats what i do for my npm libs

#

idk if thats the proper way for internal files, its mostly for libs with their own package.json and etc

#

ye

#

yeah

#

same as the main but .d.ts

#

hmm

#

how are you testing it?

#

is it gonna be an npm lib?

#

put it on github, then npm install from your github

#

and test it as an installed lib

#

you dont need the full url

#

just npm install name/reaver.db

#

try closing and reopening vsc

#

xD

patent orchid
#

Hello

#

Hi, I have a discord bot and I was wondering if anyone knows how to do something like this

sudden geyser
#

look in your language's standard library for getting information about the machine

#

ram/cpu bar is just a calculation and padding it with filled text vs. unfilled

patent orchid
sudden geyser
#

What programming language are you using

patent orchid
#

JavaScript

sudden geyser
#

For example, console.log("1".padStart(10, "?")) returns ?????????1. Node.js has some APIs for getting your machine information in the os module, but you can use a library if you want something easier.

patent orchid
#

Ok

sudden geyser
#

The point of the pad function is so you can pad one end with some text to give it that bar effect.

patent orchid
sudden geyser
#

yah

patent orchid
sudden geyser
patent orchid
#

Ok

quartz kindle
#

you want the system's total cpu and memory or the cpu and memory that the bot is using?

eternal osprey
#

hey i am installing pm2 and trying to check whether it's installed, but it is not:

#
root@Kudos5128:~# pm2

Command 'pm2' not found, did you mean:

  command 'gm2' from deb gm2 (4:10.0-1ubuntu2)
  command 'pmi' from deb powermanagement-interface (0.3.21)
  command 'wm2' from deb wm2 (4+svn20090216-4build1)
  command 'pm' from deb powerman (2.3.5-1build2)
  command 'pms' from deb pms (0.42-1build4)
  command 'pom2' from deb libpod-pom-perl (2.01-3)
  command 'pmc' from deb linuxptp (1.9.2-1)
  command 'pmw' from deb pmw (1:4.30-1)

Try: apt install <deb name>

root@Kudos5128:~# apt install pm2
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package pm2
root@Kudos5128:~# npm install pm2

up to date, audited 180 packages in 1s

10 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
root@Kudos5128:~# pm2 start

Command 'pm2' not found, did you mean:

  command 'pm' from deb powerman (2.3.5-1build2)
  command 'pmw' from deb pmw (1:4.30-1)
  command 'pmc' from deb linuxptp (1.9.2-1)
  command 'pmi' from deb powermanagement-interface (0.3.21)
  command 'pom2' from deb libpod-pom-perl (2.01-3)
  command 'gm2' from deb gm2 (4:10.0-1ubuntu2)
  command 'wm2' from deb wm2 (4+svn20090216-4build1)
  command 'pms' from deb pms (0.42-1build4)

Try: apt install <deb name>

wheat mesa
#

Did you do npm install pm2 -g to install it?

quartz kindle
#

you have to install it with -g

boreal iron
#

_u saw nothing oldEyes _

wheat mesa
#

I saw everything oldEyes

earnest phoenix
#

Hi , i need help for the kdbot (offline)

rose warren
#

Is it your bot? Are you the bot developer? @earnest phoenix

earnest phoenix
#

No its not my bot

rose warren
#

Dblwrongserver

livid jackalBOT
#

Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Discord" button on the bot's page of the bot you need support for, not the "Join Discord" button at the top of our website. If there isn't a button that says Support Server, the server invite is invalid or you were banned from the bot's support server, then we can't help you. Sorry :(

earnest phoenix
#

K

low bone
wheat mesa
#

Okay, I'm getting started with react. Anyone recommend any editors other than VSC for React (for web development)?

sudden geyser
#

Emacs

#

IntelliJ

#

etc. won't matter what IDE you use.

lyric mountain
#

I personally recommend intellij since it has direct integration with react

#

(only on ultimate version)

wheat mesa
#

Also would it be a good idea to go ahead and use typescript instead of yucky javascript for react

#

or is that a no no

rose warren
#

What's the maximum number of channels for a server?

lyric mountain
#

idk, js feels more natural for react

lyric mountain
wheat mesa
rose warren
#

That counts categories as channels I guess

lyric mountain
#

ye

rose warren
#

Alright ty

sudden geyser
rose warren
#

It's actually 500 channels per server with 50 max per category apparently.

topaz sphinx
#

is anyone good at discord api

#

this dumb https://discord.com/api/v8/applications/<my_application_id>/commands api endpoint is eating trough my brain, it keeps spitting out 400 no matter what i do

earnest phoenix
#

Wasn't it 500

topaz sphinx
#

no its 400

earnest phoenix
#

Oh Mac figured that out already lawl

earnest phoenix
topaz sphinx
#

just noticed kekw

pale vessel
#

are you doing a GET request

earnest phoenix
#

make sure its a post req

#

O wait

#

no

pale vessel
#

a GET request is fine too

earnest phoenix
#

I misread it and thought he was setting commands

#

lawl

pale vessel
#

But it looks like a POST or PATCH request

#

since 400 is bad request

topaz sphinx
#

well

earnest phoenix
#

ye

topaz sphinx
#

here it says it should be a post request

pale vessel
#

doesn't help

#

You must have done something wrong in the code

earnest phoenix
#

Showing code is likely more helpful

topaz sphinx
#

not sure what to show when it's identical to what's shown in discord.com

#

however

#

i got it to work trough postman now

#

which is... disappointing

#
import requests


url = "https://discord.com/api/v8/applications/<application id>/commands"

# This is an example CHAT_INPUT or Slash Command, with a type of 1
json = {
    "name": "ds url",
    "type": 1,
    "description": "Reverse search from image URL",
    "options": [
        {
            "name": "URL",
            "description": "The image URL",
            "type": 3,
            "required": True
        }
    ]
}

# For authorization, you can use either your bot token
headers = {
    "Authorization": "Bot <token>"
}

r = requests.post(url, headers=headers, json=json)
print(r)
earnest phoenix
#

well

topaz sphinx
#

i just realised the command

earnest phoenix
#

you have to actually put your application ID where it says application id

pale vessel
#

the command name isn't have a space

earnest phoenix
#

^

pale vessel
#

it's \w- with up to 32 characters

topaz sphinx
#

how does discord distinguish slash commands

pale vessel
#

type 1

topaz sphinx
#

wat?

pale vessel
#

what do you mean lol

topaz sphinx
#

ah no numbers or whitespaces and underscores

#

but

pale vessel
#

you can have underscores

topaz sphinx
#

lets say 2 bots has /help

pale vessel
#

it shows two of them

earnest phoenix
#

Slash commands are split up in the menu under their respective bots

topaz sphinx
#

ugh