#development

1 messages · Page 1687 of 1

zenith terrace
#

cant really help without code or error

umbral zealot
#

++auto-fix:an error

#

there I fixed it.

unreal estuary
#

ohh lol ok

#

so im setting permissions for a channel

#

and i get this

#

UnhandledPromiseRejectionWarning: RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.

#

the permissions im doing are

#

allow: ['VIEW_CHANNEL','MANAGE_CHANNEL','MANAGE_PERMISSIONS','CREATE_INVITE','SEND_MESSAGES','EMBED_LINKS','ATTACH_FILES','ADD_REACTIONS','MANAGE_MESSAGES','READ_MESSAGE_HISTORY']

umbral zealot
#

well you got at least one error here

#

MANAGE_CHANNELS

unreal estuary
#

ah

#

i just thought cuz it was a specific channel and not a category

#

was just doing these

umbral zealot
#

compare your list with the actual flags listed on in the docs.

unreal estuary
#

ik im doin dat

zenith terrace
#

but yea docs best to see the permissions

unreal estuary
#

oki

#

i think ill just do administrator

#

cuz it suits my needs

earnest phoenix
#

does anybody know how to get values from mongo in descending order using python

zenith terrace
unreal estuary
#

yes

#

for the channel?

slender thistle
#

Actually hold on

#

.sort("yourkey", -1)

unreal estuary
#
        if(!tickets) tickets = await message.guild.channels.create('tickets', { type: 'CATEGORY' });``` anyone know why it cant find the channel after its been created? it creates a new category every time the command is executed
#

its probably some dumb error

winter wraith
#

Hello, can you help me to send an image in an embed with a slash command please ( Python )

cursive dagger
#

alright so I have 2 mongodb collections
videos

{
  "_id": "uuid-here"
  ...
}

watched_videos

{
  "user_id": "uuid-here",
  "video_id": "uuid-here"
}

How would I get a random video (got random, just need check) and make sure the video isnt watched?

zenith terrace
#

try lowercase?

#

at c.type

unreal estuary
#

ok

#

ill try ♥️

#

it worked lol

zenith terrace
#

nice

unreal estuary
#

thanks that helped alot

dry pollen
zenith terrace
#

known thing that happens

#

team is trying to find a way to show the status of the bot

dry pollen
#

I see

#

Any known fix? Or is it just an issue with the python library at the moment

zenith terrace
#

nothing to do with the lib

#

bots use to show their status on the website fine whenever they were here

#

but due to discords 50 bot limit they were all kicked

dry pollen
#

wait wait

#

50 bot limit?

crimson vapor
#

iirc that was not a real thing

#

since I’m pretty sure my bot is in a server with like 10k bots

umbral zealot
#

They've been talking about it for a while and the reality is there's currently a 50 integration limit so bots with slash commands

#

It wouldn't be possible to have more than 50 bots with slash commands here, is what I mean

dry pollen
#

Yeah i doubt they will ever add a limit to actual bots

umbral zealot
#

which is already a solid limitation

#

Either way having bots here was crap, just a spamfest in some channels and constant DMs and invite messages and stuff

#

better off not having them

crimson vapor
#

I like how the bots are added now, I hate mudae and Dank Memer tho it sucks

dry pollen
#

So now my question is; how do some bots currently have their status shown?

umbral zealot
#

probably their status from the last time they were on this server

#

¯_(ツ)_/¯

crimson vapor
#

Bots that post get put as online iirc

dry pollen
#

Posting their server count?

crimson vapor
#

yes

dry pollen
#

My bots currently doing that & is marked as offline

crimson vapor
#

Then idk

earnest phoenix
# slender thistle .find().sort({"somekey": -1})

ahhh i figured that but now it says this error:
Command raised an exception: AttributeError: 'coroutine' object has no attribute 'sort'

here is my code:

    async def leaderboard_invites(self, ctx):
        rankings = await self.bot.invites.find({"guild_id": ctx.guild.id}).sort("invites", -1)
        i = 1
        embed = discord.embed(title='Invite Leaderboard', timestamp=datetime.now())
        for x in rankings:
            try:
                temp = ctx.guild.get_member(x["inviter_id"])
                real = x["invites"]
                normal = x["normal"]
                fake = x["fake"]
                left = x["left"]
                embed.add_field(name=f'``{i}.`` <@{x["inviter_id"]}>: **{real}** Invites (**{normal}** Normal, **{left}** Leaves, **{fake}** Fakes)\n')
                i += 1
            except:
                if i == 11:
                    break
                print(f'``{i}.`` <@{x["inviter_id"]}>: **{real}** Invites (**{normal}** Normal, **{left}** Leaves, **{fake}** Fakes))')
                await ctx.channel.send(embed=embed)```
crimson vapor
#

Idk py but I assume you didn’t await something

earnest phoenix
#

idk what else i should've awaited

crimson vapor
#

Idk py

dry pollen
#

Give me a moment to do some testing, I think you need to .flatten() the result before the .sort

earnest phoenix
#

hm ok

dry pollen
#

rankings = await self.bot.invites.find({"guild_id": ctx.guild.id}).flatten().sort("invites", -1) this might work

earnest phoenix
#

lemme try it

#

I get this Error [VOICE_CONNECTION_TIMEOUT]: Connection not established within 15 seconds. while trying to have my bot connect the voice channel, any idea what causes this?

earnest phoenix
#

same error

#

but with flatten

dry pollen
#

Can you just print the result of await self.bot.invites.find({"guild_id": ctx.guild.id})

earnest phoenix
#

ok

pseudo geode
earnest phoenix
#

so it didnt find the data

#

which doesnt allow it to do the rest of it

dry pollen
earnest phoenix
#

but there is data right there

woeful pike
dry pollen
#

sadge

woeful pike
#

there'll be a different system for submitting bot statuses later

#

probably in api v1 which will happen after summer

earnest phoenix
dry pollen
#

gotcha

dry pollen
earnest phoenix
#

if i have the data

#

right there

#

ah ok i fixed it, but now there is no data to sort from

eternal osprey
#

why is this still showing undefined?

#

What is wrong with the env file

crimson vapor
#

Did you load the env?

eternal osprey
crimson vapor
#

how

eternal osprey
crimson vapor
#

ok then do .prefix as he said ig

eternal osprey
#

i have saved everything in capitals

crimson vapor
#

Then perhaps the path is expecting exact path

#

I’m not too familiar with .env but you might need to surround the ! In quotes

eternal osprey
#

hmm that is not needed

#

wait whaaaaa

crimson vapor
#

Show your file structure

near plover
#

anyone happen to have a suggestion on the most accurate way to get # total users in (all) guilds?

umbral zealot
#

what library are you using?

near plover
#

JDA

umbral zealot
#

Ah then I don't know

sudden geyser
#

@near plover what’s your definition of the best method? Do you care about duplicates? Do you want to avoid caching all users?

#

If you don’t care about duplicates, you can iterate over all guilds (JDA.getGuilds()) and add up their member count (Guild.getMemberCount()).

#

If you do, you’ll need to cache all users and get the total (JDA.getUsers().length()). Note I haven’t tested these.

unreal estuary
#

so i made a discord bot online with plain client side js and im rlly proud of myself because i finally did something that isnt completely useless

#

its mostly useless

near plover
sudden geyser
#

It depends on how JDA implements updates. I'd assume it tries to be up-to-date via the gateway.

#

The member count method is usually chosen since it's more accurate in most cases.

crimson vapor
#

@quartz kindle I have a question about gc and shit, if I make like 100 EventEmitters and stop using them, will they be gc'ed?

woeful pike
#

not as long as you have references that can be used to reach the event emitters

crimson vapor
#

so say I have a command that creates a new eventemitter and after about 15 seconds it stops emitting any events, it will be gc'ed, or no because it still has listeners technically

woeful pike
#

how is the runtime supposed to know that the event emitter isn't going to emit events later

crimson vapor
#

is there a way for me to specifically say that, or would I have to remove the events command side after the timeout?

woeful pike
#
let object = { a: 1, b: 2 }
let alias = object;
alias.c = 3;
// other stuff
object = null;
// object STILL exists because there is an alias that still references it

as opposed to

let object = { a: 1, b: 2 }
object.c = 3;
// other stuff
// object exists
object = null;
// object is now garbage because there's no possible way to reach it
#

and by object here I don't mean the variable name object I mean the memory allocated for { a: 1, b: 2 }

crimson vapor
#

so if I want to get rid of the emitter, I would need to set the reference to null or something similar

woeful pike
#

you need to reassign the reference to make sure it can't be reached. This happens automatically for things like local variables in functions because they all go out of scope

crimson vapor
#

will read that ty

#

for an instance of a class, could I just do this = null technically?

#

well you can't reassign this can you

woeful pike
#

no a class cannot be responsible for its own garbage collection

crimson vapor
#

ok

woeful pike
#

nor should you do it even if it's possible (like in C++)

opal plank
#

Thats one downside, it doesnt, i can tell u what i did to implement my own

crimson vapor
#

yes, what did you do?

#

im attempting it with a class extending an EventEmitter

#

but the issue is that idk if it will be gc'ed

crimson vapor
opal plank
crimson vapor
#

oh lmao

#

ig that works

sturdy dock
#

how to check if a user has a specific role in a specific server by ID in JS? (i.e. "bot mod" role in a support server)

still flower
#

Define the guild/fetch it, fetch the member by id from the guild and check their roles

sturdy dock
still flower
#

client.guilds

#

but yes

#

Then provide the Id via string

#
  await ascGuild.members.fetch() //821127514969342002 Role named Developer

  const developers = ascGuild.members.cache.filter(dev => dev.roles.cache.has("821127514969342002")).map(dev => dev.user)```
sturdy dock
#

client.guilds.cache.get("id").members.get("userid").roles.get("roleid")

#

ah

#

got it, thanks!

still flower
#

This gets a guild then fetches the members then filters through them to find one with the specific role id then maps them

#

all good

sturdy dock
#

just what i needed 👍

#

thanks again

still flower
#

All good happy to help

sturdy dock
still flower
#

I’m not sure

#

You can probs await the line if you wanted

sturdy dock
#

got it

next ferry
#

noderequire("./env").config();//Loading .env ^

#

solve error plese

umbral zealot
#

well that's not valid js I guess

#

what's noderequire

#

also what's the actual error you failed to paste here

#

under the ^ ? that's pretty important

next ferry
#
ReferenceError: noderequire is not defined
    at Object.<anonymous> (F:\DISCORD\bots\REAL\index.js:1:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47
umbral zealot
#

alright great, so that's definitely not defined

#

where did you gather this from? a tutorial ? what?

next ferry
#

yes tutorial

umbral zealot
#

so that tutorial must have defined that line somewhere, no?

#

you didn't just pull it out of your hat, did you?

next ferry
#

can you explain i can i define

umbral zealot
#

since noderequire isn't part of nodejs it must be an external module or something that the person is using. pay attention to what they're doing, they're probably installing it or something

#

I don't konw what it's supposed to be

#

so I can't tell you how to define it

#

the tutorial should be doing that

next ferry
#

basically its calling to .env file

umbral zealot
#

yeah I can sort of guess

#

from the context

#

But what does the tutorial say it is or how it works?

next ferry
#

in node .js how can i call .env file

umbral zealot
#

Oh so we're going with "fuck that tutorial" then? Alright that works. dotenv is the module to do that.

crimson vapor
opal plank
#

@crimson vapor lemme know if my snippet gets confusing, but it should be very copy-pastable

#

its basically => start reaction collector => reactionAdd event listener => if reaction message.id has an entry in cache => run its function

fallen spindle
#

Is there a webhook to trigger when the bot is invited for a guild ?

vivid fulcrum
#

a webhook? no
an event? yes

next ferry
#

How can i create top.gg webhook for mt bot please explain

umbral zealot
#

right now you can't, it needs to be approved first

stark cape
#

how to make instagram commands?

sudden geyser
#

Does Instagram even have a public API?

opal plank
#

probably not

#

fuck whats up with instagram recently?

#

i recommended someone to make an instagram botg like 3 months ago

#

and now, every now and again i see someone mentioning it

vivid fulcrum
#

comment bots

#

everyone is wilding for them now because they can promote their page

#

that probably isnt the motive behind the question above though

simple zodiac
#

Hey could I get some help with something? I'm trying to make a channel in my discord server image-only, and, I'm not sure how to tell if a message has been edited after being sent. basically if you send anything other than an uncaptioned image it deletes it, but, people are still able to edit their messages and caption them. (Discord.js)

pale vessel
#

Message edit event?

simple zodiac
#

I think so? I'm not sure

#

Thats why im askin lol

pale vessel
#

If a message is edited, its edits property would have more than one elements

#

You can also just use messageUpdate event

simple zodiac
#

would you mind helping me like write that as code?

pale vessel
simple zodiac
#

thank you

#

Wait would you mind helping me with this? I edited my message in the channel and it still doesn't work. Would you mind helping me with like whats wrong?

client.on('messageUpdate', (newMessage) => {
  if (message.content !== "" || newMessage.content !== "") { // Message content "" just means it is an uncaptioned image.
    if (message.channel.id === "828097106400641065") {
      message.delete()
      message.channel.send(`Haha lmao <@${message.author.id}> just tried to send something in <#${message.channel.id}> how stupid. Don\'t they know this is an image only channel? What an idiot.`).then((msg) => {
        setTimeout(function() {
          msg.delete();
        }, 12000)
      })
    }
  }
})
pale vessel
#

isn't it oldMessage

#

new message would be the second parameter

simple zodiac
#

oh okay i deleted that part, didn't know i needed it

pale vessel
#

and I don't think you have message defined

simple zodiac
#

I do

pale vessel
#

Where?

simple zodiac
#

its in that same event

#

like

pale vessel
#

You should keep it seperated

#

That'll cause memory leak

simple zodiac
#

i'm not exactly sure how to do that really

pale vessel
#

client.on()
client.on() haha

simple zodiac
#

oh ok

#

so put that at the top

#

aswell?

#

with client.on message?

pale vessel
#

you out it outside message's client.on(), doesn't matter where

#

Just needs to be outside its callback function

simple zodiac
#

oh okay

#

aight

pale vessel
#

that event is triggered when a message is edited so it should be separated from the message event

simple zodiac
#

so wait do i change newmessage.content to oldmessage.content?

pale vessel
#

you should just check if newMesaage.content exists

#

if (newMessage.content) deleteMessage()

#

like that

simple zodiac
#

k

pale vessel
#

An empty string would be falsey

#

but if they edit their message, it'll be truthy and pass

simple zodiac
#

Wait would you mind if I resend my code? Idk if i did something wrong but it doesn't work still

pale vessel
#

Sure

simple zodiac
#
client.on('messageUpdate', (oldMessage, newMessage) => {
  if (message.content !== "" || newMessage.content !== "") { // Message content "" just means it is an uncaptioned image.
    if (message.channel.id === "828097106400641065") {
      if (newMessage.content) deleteMessage()
      message.channel.send(`Haha lmao <@${message.author.id}> just tried to send something in <#${message.channel.id}> how stupid. Don\'t they know this is an image only channel? What an idiot.`).then((msg) => {
        setTimeout(function() {
          msg.delete();
        }, 12000)
      })
    }
  }
})
pale vessel
#

You should replace your message variables

simple zodiac
#

wdym

pale vessel
#

it won't be defined anymore

#

message

simple zodiac
#

oh so do if oldMessage.content !== ""

pale vessel
#

hmm, new message perhaps

delicate zephyr
#

Wait

pale vessel
#

Old should always be empty

simple zodiac
#

a new client.on message?

pale vessel
#

you can just use if (newMessage.content)

pale vessel
simple zodiac
#

okay

pale vessel
#

you used message.content but message is never defined

simple zodiac
#

oh ok

pale vessel
#

it's either oldMessage or newMessage

simple zodiac
#

so do client.on('message', async newMessage => {...

#

old message would be unedited , right?

pale vessel
#

messageUpdate, not message

simple zodiac
#

i already have that

#

do i need another messageUpdate event?

pale vessel
#

Nope

#

Also, you copy pasted the snippet I gave, deleteMessage() is not valid

simple zodiac
#

oh okay

#

I can never be sure

#

that should be newMessage.delete() i assume?

pale vessel
#

Yeah

simple zodiac
#

alright

pale vessel
#

For your timeout delete, you can also use a shorter syntax which is msg.delete({ timeout: 12000 }) instead of using setTimeout

simple zodiac
#

oh cool

#

thanks

#

It still doesn't delete tho ACOSP_catcry

pale vessel
#

Where did you put the event

simple zodiac
#

right before my login, right after the complete end of the client on message

pale vessel
#

Can you show your new code

simple zodiac
#

yep

#
client.on('messageUpdate', (oldMessage, newMessage) => {
  if (message.content !== "" || newMessage.content !== "") { // Message content "" just means it is an uncaptioned image.
    if (message.channel.id === "828097106400641065") {
      if (newMessage.content !== "") {
        newMessage.delete()
      }
      message.channel.send(`Haha lmao <@${message.author.id}> just tried to send something in <#${message.channel.id}> how stupid. Don\'t they know this is an image only channel? What an idiot.`).then((msg) => {
        setTimeout(function() {
          msg.delete();
        }, 12000)
      })
    }
  }
})
pale vessel
#

You're still using message

simple zodiac
#

oh okay

#

I just changed them to what i (think?) they should be

pale vessel
#

actually you can remove that

simple zodiac
#

remove what

pale vessel
#

it's already handled by newMessage.content !== ""

simple zodiac
#

wait but remove what

pale vessel
#

the message.content !== "" || ...

simple zodiac
#

oh ok

#

so if old message !== ""

#

should be the only thing in there

pale vessel
#

the channel id comparison?

simple zodiac
#

wait im confused

pale vessel
#

that should be the top

simple zodiac
#

oh ok

#

here is my new code

client.on('messageUpdate', (oldMessage, newMessage) => {
  if (oldMessage.channel.id === "828097106400641065") {
    if (oldMessage.content !== "") { // Message content "" just means it is an uncaptioned image.
        if (newMessage.content !== "") {
          newMessage.delete()
        }
        newMessage.channel.send(`Haha lmao <@${oldMessage.author.id}> just tried to send something in <#${oldMessage.channel.id}> how stupid. Don\'t they know this is an image only channel? What an idiot.`).then((msg) => {
          setTimeout(function() {
            msg.delete();
          }, 12000)
        })
    }
  }
})
pale vessel
#

why oldMessage.content !== ""?

simple zodiac
#

i dont have message anymore

pale vessel
#

won't it always be empty?

#

you're trying to prevent idiots from editing the message

simple zodiac
#

yeah

pale vessel
#

so newMessage and you already have that

#

Below it

simple zodiac
#

okay

pale vessel
#

yeah remove it ig

simple zodiac
#

so i just need to make something inside the message event to do the same thing but only initially?

pale vessel
#

yeah, check if the message content isn't empty

simple zodiac
#

in the first message event tho right

pale vessel
#

Yuh

simple zodiac
#

k

pale vessel
#

and messageUpdate event will handle the edits

simple zodiac
#

ill see if this code works first

#

my things being weird

#

hmm still no ACOSP_catcry

pale vessel
#

Check your code

simple zodiac
#
client.on('messageUpdate', (oldMessage, newMessage) => {
  if (newMessage.channel.id === "828097106400641065") {
  // Message content "" just means it is an uncaptioned image.
        if (newMessage.content !== "") {
          newMessage.delete()
        }
        newMessage.channel.send(`Haha lmao <@${newMessage.author.id}> just tried to send something in <#${newMessage.channel.id}> how stupid. Don\'t they know this is an image only channel? What an idiot.`).then((msg) => {
          setTimeout(function() {
            msg.delete();
          }, 12000)
        })
  }
})
#

I'm not sure what's wrong

pale vessel
#

does it log anything in the console

simple zodiac
#

like you mean an error?

pale vessel
#

Yes

simple zodiac
#

no errors here

pale vessel
#

did you edit an old message

simple zodiac
#

yes

#

should i make a new message?

pale vessel
#

that's why, it isn't cached

#

yeah

simple zodiac
#

Alright

#

thank you lol

#

it worked

#

then i just gotta add the original code in the message event right

#

to prevent it from happening in the first place

pale vessel
#

Just a simple if (message.channel.id === "channel id" && message.content) message.delete()

simple zodiac
#

oh ok

#

thx

#

so much

pale vessel
#

You should also optimize your messageUpdate event code

frigid mountain
#

JavaScript

frigid mountain
brave tendon
#

hey

#

can someone help fixing a node request to a php script which returns a number?

pale vessel
brave tendon
#

somehow the console log is like this after sending the request

undefined
4
#

it should only be 4 but why is there an undefined?

pale vessel
#

Maybe you logged something else beforehand?

frigid mountain
pale vessel
#

The empty line?

brave tendon
#

it does not log anything besides the "4" that it gets from the request

frigid mountain
#

Like

Embed Name
Value
Value
Value
Value

frigid mountain
pale vessel
#

Yes

frigid mountain
pale vessel
pale vessel
pale vessel
crimson vapor
#

@pale vessel rate the code bro ```js
worker.awaitMessage = (ctx, filter, timeout) => {
return new Promise((resolve, reject) => {
const func = (m) => {
if (!filter(m)) return
resolve(m)
ctx.worker.off('MESSAGE_CREATE', func)
}

    ctx.worker.on('MESSAGE_CREATE', func)

    setTimeout(() => {
      ctx.worker.off('MESSAGE_CREATE', func)
      reject(new Error('Timeout Exceeded'))
    }, timeout)
  })
}```
pale vessel
crimson vapor
#

ye ik

#

just lazy

pale vessel
#

also ```js
worker.awaitMessage = () => new Promise(() => {

});```

crimson vapor
#

no

pale vessel
#

yes

pale vessel
river panther
pale vessel
#

I'm assuming the empty lines between the fields

brave tendon
#

\u200b i think was an empty line

river panther
#

ah, idk how to do that, i just do .addField("_ _", "_ _", false);

brave tendon
river panther
#

didn't know that

#

thamk

brave tendon
#

atleast thats the way i do it 😄

river panther
#

hmm

crimson vapor
#

I did ** **

river panther
#

how do you have a custom url for the share ex?

river panther
crimson vapor
#

@delicate zephyr's pyrocdn

river panther
#

eot

#

wait

#

this is our luke

#

he changed the pfp

delicate zephyr
#

Ye

crimson vapor
#

he got a gf

delicate zephyr
#

Indeed

crimson vapor
brave tendon
#

but it is invite only

#

idk why

crimson vapor
#

there are so many

#

honestly

river panther
#

can you invite me?

crimson vapor
#
delicate zephyr
#

I just made one with an easy to use interface ¯_(ツ)_/¯

crimson vapor
#

dont lie

delicate zephyr
#

shush

brave tendon
crimson vapor
#

interface needs lots of work still

delicate zephyr
#

yea

#

Its still easy to use

crimson vapor
#

ehhhhhhhhhhhhhh

pale vessel
#

Yeah, how do I change my password

brave tendon
#

if i have one left over i give it to you @river panther

crimson vapor
#

took me an hour to set up fucking ssl

crimson vapor
pale vessel
#

Yes

delicate zephyr
#

unless you use full strict

crimson vapor
#

it took an hour to figure out how to enable cf support

pale vessel
#

How do I change my passwd

crimson vapor
#

don't

pale vessel
#

Why

crimson vapor
#

you can't

pale vessel
#

Well yeah

rocky hearth
#

does Collection also supports Set?

river panther
#

i am clicking on register now but nothing happen

pale vessel
#

new Discord.SetCollection()

#

imagine

rocky hearth
#

Lol, I tried to find that! 😅

delicate zephyr
delicate zephyr
river panther
delicate zephyr
#

I'll be adding password resets later

river panther
#

is that website maded by you?

pale vessel
#

Pog

#

Luke you still using LastPass?

crimson vapor
#

why would he not

pale vessel
#

because lastpass is trash

crimson vapor
#

@delicate zephyr

pale vessel
#

since he had a paid subscription

#

1Password is 100% better

#

but whatever it's unrelated

crimson vapor
#

I might use 1Password if I can figure out multi devices

delicate zephyr
#

I cba to switch at this point

pale vessel
#

yea

crimson vapor
#

it should be easy

delicate zephyr
#

I write it off as a business expense anyway

crimson vapor
#

export and import

pale vessel
#

If it works it's fine ig

crimson vapor
#

yea

delicate zephyr
crimson vapor
#

password.txt moment @pale vessel

pale vessel
#

lol

#

I use bitwarden but if I have the money I'd go for 1Password

crimson vapor
#

yea

river panther
crimson vapor
#

no

#

he is working on making it payed

delicate zephyr
#

lol no

#

not that it would work

river panther
#

ah damn

pale vessel
#

and tonkku uses 1password too iirc

crimson vapor
#

he does

river panther
#

what do now?

pale vessel
#

yea I remember him mentioning that

river panther
#

is that a good name?

#

sm0l.thegreat

#

or

#

sm0l.thefailure

#

idk, you tell

pale vessel
#

sm0l.thegreatandthefailure

delicate zephyr
#

You missed the point of how that works

river panther
#

sm0l.thegreatfailure

delicate zephyr
#

left = domain name (google.com example)
right = subdomain

pale vessel
river panther
#

ye, so thegreat is the domain and sm0l is the sub

pale vessel
#

short and simple

river panther
#

breh

delicate zephyr
river panther
#

ah

rocky hearth
#

i got to know that, discord.js-commando is built in typescript, but why can't I find source code on github in ts?
There's only js files.

pale vessel
#

are you sure

#

check the definitions through vsc

crimson vapor
#

@delicate zephyr https://-.pyrocdn.com is valid according to your site

delicate zephyr
#

Ye ik

delicate zephyr
#

I will fix it million

crimson vapor
#

ok

delicate zephyr
#

I have other shit going on atm

crimson vapor
#

well

#

shiro + gf

delicate zephyr
#

Shiro is a bigger prio atm

crimson vapor
#

I understand

pale vessel
#

development more like pyrocdn-supoort

delicate zephyr
#

yea uh

#

Im moving in with my GF in like

#

3 weeks

#

so life is like

#

hectic rn

crimson vapor
#

POG

sage bobcat
#

One message removed from a suspended account.

delicate zephyr
#

gamer

crimson vapor
#

gamer?

sage bobcat
#

One message removed from a suspended account.

delicate zephyr
#

gaming

rocky hearth
sage bobcat
#

One message removed from a suspended account.

crimson vapor
#

LOL

crimson vapor
pale vessel
#

I don't think you're supposed to commit dist

#

do you all do that

#

just create a script

rocky hearth
#

only for heroku

pale vessel
#

hmm, but there's pre build script where you can use tsc

rocky hearth
#

does heroku compile ts files?

pale vessel
#

nop

#

you can make it to though

rocky hearth
#

how

brave tendon
rocky hearth
pale vessel
#

like js "scripts": { "pre": "tsc" } in package.json

#

nt sure if it was called pre or pre-build

#

could be something else

rocky hearth
#

prestart?

pale vessel
#

I haven't used heroku after I got a VPS

#

probably, you can try it out

#

just make sure typescript is installed

brave tendon
#

eh what do you mean with "missing the await"

crimson vapor
#

do you have number = await or number =

delicate zephyr
crimson vapor
#

use my implementation

#

its pog

delicate zephyr
#

nah

#

I'll build my own

#

because yes

crimson vapor
#

ewww

#

no gang wya

brave tendon
crimson vapor
#

ok

#

hmm

delicate zephyr
#

is the scope async

crimson vapor
#

its pog

delicate zephyr
#

I dont use ejs to render the page

#

so

crimson vapor
#

cringe

delicate zephyr
#

Again

crimson vapor
#

use ejs

delicate zephyr
#

I'll build my own

#

thank you

crimson vapor
#

reeeeee

delicate zephyr
crimson vapor
#

mans is gonna do it server side isnt he

delicate zephyr
#

I mean

#

No

delicate zephyr
#

Show where you're running that function

delicate zephyr
#

You need to await that

brave tendon
#

ahhh

delicate zephyr
#

or just .then()

#

one of the two

brave tendon
#

ahh okay

pale vessel
#

top level await PES_SadGePray

brave tendon
#

xD

#

sry im kinda new to js and co 😵

delicate zephyr
#

I also wanna have the ability to add more features to the paid plans

#

so

brave tendon
#

ahh its finally working

shrewd cliff
#

hi

unreal estuary
#

hi

earnest phoenix
#

Is this correct

client.user.setStatus("STREAMING")```?
lime grotto
#

self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)
What does webhook_path mean here?

unreal estuary
#

im not sure

earnest phoenix
spare portal
#

how would you be able to know if a message sent is the first one in the channel? in discord.js

brave tendon
#

can this be caused because it is in module.exports and something is messing with it?

#

console.log(result); is returning a 6

earnest phoenix
#

no

restive lily
#

Could anyone assist me with adding Pterodactyl Panel commnads to my bot? I do not understand it, or just some pointers.

restive lily
#

Pterodactyl Panel is a hosting thing, it can host anything from minecraft servers, to rust, to discord bots.

mighty ember
#

i do not know

lusty quest
restive lily
#

There already is an API integration

lusty quest
#

i havent used the panel in a few years, but if there is one where is the issue?

restive lily
#

So many good ones

#

Galaxygate is pretty good for VPS

solemn leaf
#

Aws-selfhosting

lusty quest
#

i use a Dedicated Root

solemn leaf
#

Pick a host that fits your needs

lusty quest
restive lily
#

My issue is it calls for like the panel panel its self when I dont own that, I just have access to my specific server

lusty quest
#

yea the api is not really designed for this usage i would say

#

they expect that you have the Panel hosted by yourself

marble juniper
#

I use azure lol

lusty quest
#

ohh wait no

#

you can

marble juniper
#

microsoft azure gang

restive lily
#

How so?

lusty quest
#

they point to spezific clients

#

did you have your API key?

restive lily
#

I have an API key to my account

lusty quest
#

you need to know your server id

marble juniper
#

nice

#

I have github student and they let you use azure with a 100$ credit and no credit card needed to sign up

#

which is very nice for my case

restive lily
marble juniper
#

mine is anti nsfw

#

its already verified

#

lol

lusty quest
#

should look like this

#

and respond with the stuff below

restive lily
#

Oh shoot, im in py, thanks for helping tho, very much appreciated

lusty quest
#

this uses curl in a linux terminal

marble juniper
#

lool

lusty quest
#

you can use it in pretty much every language that allows http requests

restive lily
#

My server must be weird bc its ID is crazy long, almost like a bot token

lusty quest
#

you just have to send the headers

restive lily
#

thanks

#

ill try to work on this

frigid mountain
#

They changed

.addblankField()

To~

.addField("\u200b", "\u200b")
restive lily
#

Yes, that was changed awhile ago

#

It annoyed me at first

lusty quest
#

for what?

#

github is not really an IDE its more an Code Share / Versioning platform
glitch is for hosting websites, but i think they got an build in IDE

#

most competent people here use a proper IDE like Visual Studio Code

frigid mountain
untold token
#

Visual Studio is an IDE
Visual Studio Code is like an advanced text editor with some extensions to make things easier. Like Notepad++ but better, or Atom.

lusty quest
#

it got deprecated over a year ago when V11 got deprectated lol

frigid mountain
#

Now I have to remember numbers

untold token
#

If I remember correctly, VSC was actually based on Atom.

frigid mountain
#

:dab:

frigid mountain
lusty quest
#

i wonder how many people cry now bcs theyre bots doesnt boot anymore bcs V11 is now dead dead

untold token
#

Probably not a lot if they understand what they're doing

lusty quest
#

there where already 3 or so yesterday

frigid mountain
untold token
#

Interesting

lusty quest
#

i self host my bot too and its 24/7

untold token
#

I just host mine on my GalaxyGate VPS

frigid mountain
lusty quest
#

why? just get a VPS

brave tendon
#

how can i make it that when a user triggers a command the bot waits for a promise to be resolved so that the promise can assign a value to a variable

lusty quest
#

make your command async and await

untold token
#

If you need a host I highly suggest GalaxyGate. There are guides available that show you how to host on Linux servers. I recommend Ubuntu Server as your OS.

untold token
lusty quest
#

ive started with Digitalocean, but they got at some point to expensive for what you get, now i have a dedicated root

untold token
#

yw

restive lily
#

I currently i have this in my bot.py in the on_ready, is it possible to put it in a cog?

await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="over you"), status=discord.Status.dnd)```
frigid mountain
#

When your phone is at 10 % but you a coder

Const phone = battery = 100%
/android.js 

Lol

lusty quest
#

exept you get a syntax error

brave tendon
#

I am giving up on the await thing I just can't get it to work...
https://i-am-sure-that.anime-thighs-are-the.best/​‌‌​‌‌​‌​‌​‌​‌‌​​‌‌‌​​​‌​‌‌‌​‌​‌​‌​‌​​​​​‌‌‌‌​‌​​‌​​‌​‌​​‌‌​‌​​‌​‌​‌‌‌‌‌

How in the world can I get it to work that the promise will assign the value to a variable so that I can use the variable later in the embed I spend like 2 hours now trying to fix it but I just can't

lusty quest
#

make your execute run async

opal plank
lusty quest
#

ohh wait yea

#

what erwin said

brave tendon
opal plank
#

then rest and come back tomorrow

untold token
#

It'll become an asynchronous function

opal plank
#
#

read this when your brain isnt fried

untold token
#

Then you can use await to make Promises return their actual value before doing anything with them

frigid mountain
#

Btw how do I get my bot to randomly mention a user

willow mirage
#

lmao can't believe how they fix the issue

opal plank
willow mirage
#

yap

#

the new Stage thingy

opal plank
#

yikes

#

detritus already added it

#

2 days ago

willow mirage
#

xD

opal plank
#

and i've been using it for a couple days to

#

reject discord.js, come to detritus.js

lament rock
#

Reject managed libs, make threaded workers yourself with modular libraries

earnest phoenix
#

is it possible to use discordjs in deno? It's written in tahpscrept and uses es6 imports so

opal plank
#

ts is js

#

so it should work no prob

#

though whats the point

earnest phoenix
#

deno doesnt have support for require

opal plank
#

use detritus instead which is ts already

earnest phoenix
#

and a whole lot of node only apis

lament rock
#

Just stick to commonjs flavor tbh

#

or manually change build target

#

then create your own libs to replace node libs :)

#

some node libs are exported to npm

brave tendon
#

@opal plank @untold token I fixed it in another way... I don't know if it is a good solution or not.. but I put the Embed Message which the bot was going to send inside the ```js
.then()

and for now it seems to be working since I just give the embed now the result
earnest phoenix
#

krista will love deno because it uses rust instead of cpp

opal plank
untold token
earnest phoenix
#

when your code is a complete mess but it does its job

opal plank
#

unless you using anything less than es5, theres no need to NOT use async/await

#

im telling you right now

#

fix that

lament rock
opal plank
#

otherwise soon you'll keep on nesting promises and get into callback hells

brave tendon
opal plank
#

basically: trust me, dont do that

#

you'll get into a rabbit hole

#

same for usin .json as database

brave tendon
#

not another rabbit hole

opal plank
#

your code will grow

lament rock
#

reply was not appropriate to use there

opal plank
#

and then you'll get the oh my code is too big now to change everything

brave tendon
#

i am fed up with the hololive rabbit hole and i dont need any other in the future

earnest phoenix
lament rock
#

bruh

earnest phoenix
opal plank
lament rock
earnest phoenix
brave tendon
#

I am pretty sure that if I would compete on the "shittiest code" I would get instantly banned from the server

earnest phoenix
#

same

#

IoI

opal plank
#

"friend of mine"

brave tendon
#

i dont know

#

i thought you guys could tell me

brave tendon
#

well

#

that remembers me of one of my coworkers

#

basically in the third year he quit the job because he was like "meh programming is not for me"

opal plank
brave tendon
#

he got a task to program a sql client for a customer and well.. it was a winform with only one form named form1.cs and in the form there were like 5k lines of code that did everything .. when I looked at it one time I saw another form called "methods.cs" well.. it was blank form and the code was all methods he had created before 🙂

lament rock
#

18.9MB jesus

brave tendon
#

I see

opal plank
#

wait a second

#

who was it

#

@thick gull yo

#

someone copying my code ^^

brave tendon
#

This certainly is my favourite.. guess which is inside these .txt files

opal plank
#

im pretty sure it was him that i gave the generator code

#

wait

#

no

#

was it flaz that did the thing

#

hmmm i think it was borbosso

lusty quest
opal plank
#

yeah

#

someone did it

#

mathew mnight be another one

#

someone actually generated thousands of shit like this for something

#

i dont recall who

opal plank
#

but i did send borboss the code to generate a dictionary

lament rock
earnest phoenix
#

I have a small problem: I made sure that when a member joins my server, his log name in the console, however, the event does not activate:

console.log(`${member.user.username} joined the ${member.guild.name} server !`)
});
opal plank
earnest phoenix
#

uh yes

#

thx lol

vivid fulcrum
#

probably not suggested

brave tendon
#
const embed = new Discord.MessageEmbed()
.setTitle("UwU")
.addField('placeholder','placeholder')

message.channel.send(embed);

as PapiOphidian already mentioned: field values in .addField can not be null or undefined since u will get an error that discord can't send empty messages or some shit

lament rock
brave tendon
#

yeah

#

it was just for him so he knows how to do a embed

lament rock
#

but it was invalid code

brave tendon
#

yes thats true

#

changed it

rocky hearth
#

what is the differennce in these two importing techniques?
import EventEmitter from 'node:events'
and
import EventEmitter from 'events'

earnest phoenix
#

Nothing

faint nebula
#

I'm having an issue

pastel tulip
#

How Many Time Take To Approve My Bot 🙂

#

ok sory

feral aspen
#

What is a great way to model the shop or the buy command in discord.js

#

Do I make a switch statement where args[0] will contain many cases meaning many items?

#

.. or is there a better way?

#

👀

vivid fulcrum
#

i already told you, it's not suggested

#

it's like trying to run a windows 95 program on windows 10

#

it might work, it might not

earnest phoenix
near stratus
slender wagon
#

it will work but you will run into problems

#

there is gonna be lots of outdated things

pastel tulip
#

lol

earnest phoenix
#

if(commandfile) {commandfile.run(bot,message,args)}
^

TypeError: commandfile.run is not a function
at Client.<anonymous> (C:\Users\James P\Desktop\SUPPORT BOT\index.js:43:34)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (C:\Users\James P\Desktop\SUPPORT BOT\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\James P\Desktop\SUPPORT BOT\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\James P\Desktop\SUPPORT BOT\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\James P\Desktop\SUPPORT BOT\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\James P\Desktop\SUPPORT BOT\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\James P\Desktop\SUPPORT BOT\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\James P\Desktop\SUPPORT BOT\node_modules\ws\lib\websocket.js:825:20)

How can i fix?

#

Your exported command object doesn't contain a run() method, you probably named it execute() or something

#

oh ok

#

thanks

#

thank you so much 🙏

inland isle
#

uws

earnest phoenix
#

if your code won't break on v14, yeah ig

earnest phoenix
earnest phoenix
#

i fixed it but thank you you guys are so nice. 🙏

#

im tired of people asking review my botum fast pleasssssse

earnest phoenix
#

and yes they cant do all the bots it takes time they are not the flash.

#

no one:
people in dbl: patience needed to wait for bot review === breaking into area 51

#

lol

#

IoI

#

btw do u review the bots after your bot was approved?

#

what

#

ok if the bot was approved do you help approve after?

#

we dont

#

we're not brs

#

(Bot ReviewerS)

#

ohhhh lol

#

IoI

#

also

earnest phoenix
#

lol?

#

????????????????????

#

that was an i not an L

rose warren
earnest phoenix
#

k

#

oooops?

#

question: is deno better than node

#

yes, only downside is you can't use npm packages in it

earnest phoenix
quartz kindle
#

you can use npm packages

earnest phoenix
#

Then yea, its just defined to be better than node

#

Created by Node.js's own creator, just rearrange node and vuala, deno mmLol

#

imma go make a discord interactions client in deno

earnest phoenix
quartz kindle
#

personally i dont like the idea of deno

earnest phoenix
#

it uses rust instead of cpp

#

dice would love that

#

The thing I love about it is top level await outside of module files

#

and importing from url

#

and tahpscript support

#

and 25mb total size

#

and.......

#

Node.js + all kinds of crazy features + type definitions

#

mmLol pogging

#

nodejs - shitcode

earnest phoenix
#

Gotta love how there is an open issue to implement native typings to Node.js still open to this day, then there's deno

cinder patio
#

meh

slender wagon
#

why is mongoose needed when using mongodb?

cinder patio
#

it's not

slender wagon
#

oh it isn't?

cinder patio
#

you can use mongodb without mongoose

#

mongoose just gives you the ability to define schemas for your documents

slender wagon
#

oh

#

basically makes it easier?

cinder patio
#

I'd say it makes it safer, not easier

slender wagon
#

oh okay

#

ima use it then

earnest phoenix
#

Mongoose is sometimes really buggy, just use mongodb itself

#

4head

cinder patio
#

Personally I use TS with mongodb so mongoose becomes completely pointless

slender wagon
#

oh

true ravine
#

Would I be correct in saying you can only fetch messages by ID if they are less than 2 weeks old?

woeful pike
#

if you're gonna use typescript with mongodb just go with a proper orm like typeorm

#

mongoose useless

#

the mongodb driver is already almost an orm by itself, if you don't need type safety why add anything on top of the driver

potent lotus
#

hi

urban cape
#

I am new to making a bot in node.js, but i have a simple question.
How to store the id from a message that was send by my bot.

pale vessel
#

what are you planning to do with it

urban cape
#

play a song
delete var a, if exist
send message which song is playing. and store this message as var a

vivid fulcrum
#

await the send call and assign it to a variable

#

your variable will then contain the message object

#

when you want to delete the message, call .delete() on that object (your variable)

#

it's a promise so you should probably await that too

#

async all the way down pattern

opaque seal
#

Do you guys think that it's a bad thing to make a bot DM the owner of a server when the bot gets kicked to ask him if he wants to keep saved the settings for that server?
(I've got controversial responses to that so I'm just wondering)

winged linden
#

dont think its a good idea ,anyway if the bot is kicked and doesnt share a server with the owner it will not be able to dm him

earnest phoenix
#

well i think it is good idea but idk

#

it has so much exceptions so i dont think it will worth it

#

just save the settings

rose warren
opaque seal
#

I was thinking of 24h kek

pale sapphire
rose warren
# opaque seal I was thinking of 24h kek

24h is good too. Whatever you think is best for your bot's users. But in any case it's pretty much impossible for your bot to DM the owner after being kicked unless they're in another mutual server.

opaque seal
#

yeah ik

rose warren
#

So the easiest option would be to store them for a while then delete if it doesn't rejoin

opaque seal
#

Where do you save the list of guild IDs marked for removal?

rose warren
#

In a separate db table

opaque seal
#

kk

#

I don't know, I like the poll idea tho xD

#

Because, I also send them a little poll about why they kicked the bot, if they wanna answer it

rose warren
#

But they won't receive it in 99% of situations

opaque seal
#

uhm true

#

I don't know

#

The only thing that's holding me back is the fact that I have to activate the private messages gateway intent

#

Which idk if it puts more "stress" on the bot

rose warren
#

If they kicked it, they don't want to hear from you or answer a survey. Just store the data for a while, state how long and what you store in your TOS and Privacy Policy, and delete it if it doesn't rejoin at a later date.

opaque seal
#

If they kicked it, they don't want to hear from you or answer a surve
Don't know about that honestly

opaque seal
rose warren
#

What lang are you using?

opaque seal
#

kotlin, JDA

rose warren
#

Not sure how that works for you then

#

It still doesn't solve the matter where the bot has left all mutual servers and won't be able to DM the owner of the server it was just kicked from.

opaque seal
#

Yeah I would just mark it for removal in that case

rose warren
#

Seems to be the best option

placid meadow
#

sup nice ppls 😉

#

i guess not then 😛

next ferry
#

my bot prefix is small r when i type Capitol R not responding how can i solve

vivid fulcrum
#

provide your code and your language

next ferry
#

discord.js

#

i give you simple ping cmd

vivid fulcrum
#

transform the message content

#

use toLowerCase on it

#

save that in a variable

#

and use that variable instead of the message content throughout the code

slim stag
#

gysu how to online the bots

river panther
#

bot.login(token)

#
slim stag
#

ok

#

like this mean

#

exempale
bot.login 1293492693hm

#

like this

#

exempel

slender thistle
#

What's the library you use

slim stag
#

you mean token

#

wait are you mean the bots been created @slender thistle

slender thistle
#

Yes

slim stag
#

that

slender thistle
#

What do you use to code the bot?

#

Which programming language?

slim stag
#

tehere said to me my friedn told me to build there

slender thistle
#

Do you know how a bot is actually made and run?

slim stag
feral aspen
#

Hi

slim stag
#

but how to run is using programer

#

im using to run with node.js

#

usely

river panther
#

i have something for you

slim stag
#

what

slender thistle
#

A Discord bot is generally (taking out slash commands combined with HTTP requests) an active websocket connection between a program and Discord, which exchange data between each other constantly

solemn leaf
river panther
sinful belfry
#

is that needed

slim stag
river panther
#

maybe just use botghost

slim stag
#

im so lagging

#

my wifi its 1 bar

feral aspen
slender thistle
#

Hence why you need to create a Discord bot account

river panther
#

and args makes it easier

#

and simpler

slender thistle
#

But in order to actually run it, you need to use packages that allow you to work with websockets and HTTP requests. This is where libraries can be used to simplify (abstract) that process, since it will do the basic stuff for you, like handling websocket calls

feral aspen
river panther
#

yes because args[0] might also be the command name depending on how you made the event handler for message

river panther
#

hmm, show me what command are you putting

#

like

#

how are you puttingit?

feral aspen
#

!warns to show the author warns and !warns <@user> shows the user warns.

#

But doesn't work for the author

#

Even though I defined the message.author as user

river panther
#

why will the user warn himself?

feral aspen
#

What?

slim stag
#

gyus the bot use can