#development

1 messages · Page 1785 of 1

lament rock
#

dont need to put it in a string

spark blade
#

He used it in a string

lament rock
#

unless you want to add more characters into the string

spark blade
#

When i put map without the strings it fails

opal plank
#

assuming name is a string

#

but thats beyond the point

lament rock
#

big assumption, yes

opal plank
#

he asked why that snippet wont work

lament rock
#

in which you gave an answer and I nitpicked a little

#

perfectly balanced

opal plank
#

fair

spark blade
#

MessageEmbed field values may not be empty.2:43 AM

opal plank
boreal iron
#

Didn’t have enough patience to go on yesterday… oldEyes

tawny rune
#

How can I check for voice channel updates?

#

I have

    @Cog.listener()
    async def on_voice_state_update(self, member: Member, before: VoiceState, after: VoiceState):
        print(member.id, before.id, after.id)

But nothing is printed

prime mist
#

Do you have intent added?

tawny rune
#

Which intent specifically

spark blade
tawny rune
#

I do have all intents enabled, just checked

prime mist
tawny rune
#

Woah

#

Never heard of that

#

How would I enable it though

earnest phoenix
#

How can i add thumbnail ?

#

I tried setThumbnail(member.displayAvatarUrl()) but doesnt work

pale vessel
#

It's displayAvatarURL(). If member is actually a GuildMember, use member.user.displayAvatarURL()

tired panther
#

Yeah, I have the same problem, The requests on the api, works from outside, but not from the node itself

#

The Web Server is active, requests from outside work and tried with server ip and the port too

opal plank
tired panther
crystal wigeon
#

hey quick question

#

does spawning mutliple culsters improve performance and latency?

serene cliff
#

why is the security bot down

tired panther
serene cliff
#

@tired panther

tired panther
serene cliff
#

yh

#

security

#

this bot

tired panther
#

Join their Support Server

serene cliff
#

it sends me here

tired panther
#

sure?

kind thicket
#

Kinda ironic that its offline

pale vessel
#

Eh, it would be ironic if the bot is called "Uptime Bot"

#

I guess if it's offline it can't provide "Security"?

boreal iron
#

you never know

#

Just throw out some bad words and see smirk

crystal wigeon
rocky hearth
#

what does, setInterval returns, a number?
if yes then what is this?

#

@types/node says it returns this

boreal iron
#

Basically an interval ID

#

To identify it

#

For example in cases you wanna stop it

rocky hearth
#

so what is this Timeout thing

crystal wigeon
#

just an interface name?

boreal iron
crystal wigeon
#

so, i have one more question

#

lets say i have 2 cpus and 2 works have spawned, p1 is being executed by worker1 and needs to take some time 60 secs. if the same function is called. now worker1 is busy so worker 2 picks it up. what happens if the same function is called the third time?

vital rock
#

Hey I want a music bot

prime mist
#

Cool.

quartz kindle
flat copper
#

How can I make dashboard?

unreal tapir
#

(dont worry i already reset the token) does my bot's commands not work because of the prefix?

#

the command:

flat copper
#

Message event?

rocky hearth
narrow fractal
unreal tapir
rocky hearth
flat copper
#

I want to host my website for free any idea

#

With domain link
.xyz or etc

unreal tapir
#

xyz is pretty cheap

#

so i suggest that

polar adder
#

Hey i have a doubt in web development

slender thistle
#

Doubts are healthy

#

Now what does your doubt happen to be

polar adder
polar adder
slender thistle
#

So what's the iissue

sick agate
#

why

polar adder
#

Why the image is not getting fetched

sick agate
#

you can see the console if something is logged

slender thistle
#

Are you sure the path is correct?

polar adder
polar adder
sick agate
#

¯_(ツ)_/¯

polar adder
#

Can you say where i am missing? 😫

#

@slender thistle hey reply

#

@sick agate reply 😟

slender thistle
#

Try to make the path relative from wherever you import the image

thorn nexus
#

discord.js
how to set GuildMember.voice.setMute(false) if the participant is not in the voice channel?

pale vessel
#

you can't

thorn nexus
#

I have a mute command. it turns off the microphone for the participants if someone turns it on for them. when removing the mut, I cannot turn on the microphone for the participants if they are not in the voice channel at that moment. how can this be fixed?

jaunty ledge
#

how to play music

pale vessel
#

or basically any service that offers music

unreal tapir
#

in my coded should i use msg or message?

marble juniper
#

doesn't matter

#

use what u want

#

it doesn't make a difference

stiff lynx
#

anyone that can pass me Nicole's account?

summer torrent
zinc fable
#

Yup theyre dming me, ty pandaheart

stiff lynx
#

for getting bot accepted It must works without any permition?

#

at least I know and I have a month to change my code

zenith terrace
#

you can have commands that need permission

stiff lynx
#

my bot was declined bcs removed the reaction in a embed pages

zenith terrace
#

wym by removed, from the decline reason the reactions did nothing

unreal tapir
lyric mountain
#

wrong bot token

unreal tapir
#

nope

#

i regenerated it

#

and put it back in the code

#

oh i found the problem

#

nvm

#

looks like i didnt find the problem

lyric mountain
#

I mean, the error states that the token is invalid

stiff lynx
#

this Is the reason, declined for a line of code

#

but for example, for moderation and clear message, how can work without manage message?

narrow fractal
hexed vortex
#

hello, i have a problem where whenever someone sends a message without the activator i get a error as well as my work command isnt working. everything was fine till i made the work command and ive been looking over and over again at my code yet i still cant find the problem
https://hastebin.com/winolafoha.js

#

error for the work command

#

error when someone sends any messae without the activator

boreal iron
#

Well then just return the event if the content doesn’t start with your activator aka. prefix.

#

You’re declaring and using args, command without checking it they actually exist or at least contain items

tired panther
#

hmm, someone pinged me Pika_Think

#

-The Welcomer api is hosted on the ptero node

  • The Bot is hosted on the same ptero node, but on a other port

When I try to send a request to the Welcomer api from the Premium bots, it fails with the error Econn reset/refused

But, when I send a request from my Pc or a another machine, then the request is successfull

maybe this gives you more information

royal herald
#

is md5 safe?

earnest phoenix
#

Hi again, how do I make my bot to check for pings?

client.on('message', message =>{
        if (staff.includes(message.author.id)) return;
        if(message.author.bot) return;
        if(message.channel.type === "dm") return; 
        if (message.content === "<@ID>") {
          message.reply("Please **don't** ping Moderators unless It's an emergency.")
          }
        });

mike

wheat mesa
#

Wdym by pings, like specific role pings, @ everyone or @ here pings, or a specific user being pinged?

earnest phoenix
light lodge
#

@gilded plank

wheat mesa
#

As in, any user, or a user that you specify

earnest phoenix
boreal iron
#

holy fucking shit... PSU1 fan @ 10k rpm pandasad

earnest phoenix
#

Literally <Message>.mentions.has(<ID of a user/role/channel>)

#

OH

summer torrent
boreal iron
#

Unix timestamp?

summer torrent
#

yeah

boreal iron
#

alright, good to know

summer torrent
boreal iron
#

Local timezone or UTC?

summer torrent
#

local probably

boreal iron
#

Yeah as the docs says

#

oh with flags, in different formats... nice

summer torrent
#

2011

#

oh nvm

pale vessel
#

use latest canary

silk ridge
#

<t:13069566:R>

#

i can see it as i m using canary

#

😉

#

is this a bug @summer torrent ?

summer torrent
#

update it

#

or Ctrl + R

#

wait no its not a bug

silk ridge
#

if it was i would report it

#

i have passed bug hunter test now need to report bug huh -_-

#

@summer torrent how is this = <t:13069566:R>

#

my uncle born that time -_-

rocky hearth
#

is it true that, doing arr.length = 4 to remove elements in js, doesnt gets garbage collected

#

u mean to remove it, or disable it?

earnest phoenix
#

How can i copy an object X and create another field called Y in updateMany? Mongodb

silk ridge
rocky hearth
#

I hvnt tried it but I think, u should be able to re-add the components with same configs. when u get interaction

lusty quest
rocky hearth
#

oh wow, thx to clarify

unkempt wedge
#

pog

crimson vapor
#

so its more correct ig

pale vessel
#

what garbage is it going to collect then

crimson vapor
#

me?

unreal tapir
#

if i do node . and my bot comes on will my bot be on as long as i have an internet connection and my pc is on?

unkempt wedge
#

as long as internet and pc stay and you don't close cmd

sudden geyser
#

Not always.

unreal tapir
#

ok

unkempt wedge
sudden geyser
#

Or Discord could just disconnect you

unreal tapir
#

yeah im gonna get a host then

unkempt wedge
unreal tapir
#

should i use PebbleHost or Vultr

unkempt wedge
#

i've never heard of either being used for discord bots

sudden geyser
#

Discord occasionally disconnects bots for whatever reason

unkempt wedge
#

i'd get a vps

unkempt wedge
#

@unreal tapir get a vps, or if you need a free option use heroku or repl

unreal tapir
#

ok

lusty quest
#

and the "Free" VPS suck

#

they limit what you can do

unreal tapir
#

I only use bot ghost when im making bots for dumb servers

lusty quest
#

lol

unreal tapir
#

bc no one knows where they store the tokens

lusty quest
#

then just buy a Raspberry PI and run the bots on them

unreal tapir
#

ok

#

also how do i fix this

lusty quest
#

you have 2 instances running of the same bot

unreal tapir
#
const Discord = require('discord.js')
const client = new Discord.Client();
const config = require('./config.json');

client.once('ready', () => {
    console.log('Ready!')
})

client.on('message', message => {
    if (message.content === '>ping') {
        message.channel.send('Pong.');
    } else if (message.content === '>beep') {
        message.channel.send('Boop.')
    }
});

client.login('token');
lusty quest
#

its not directly code related

unreal tapir
#

O ok

#

I get it

#

ok its fixed now

#

you guys really nice here

lusty quest
#

most are

lucid prawn
#
 let path = window.location.pathname;
window not defined

then I did

let window = " ";

then

cannot read property 'pathname' of undefined
#

can you help pls

lucid prawn
#

I tried that in repl in said go to html so i did

unreal tapir
lusty quest
#

you use " to define a string use `

lucid prawn
#

ok

lusty quest
#
"${string}" //-> Will print ${string} 
`${String}` //-> Will print whatever your value holds
```you can see the difference here
lucid prawn
lucid prawn
crimson vapor
earnest phoenix
lucid prawn
#

ok

lucid prawn
unreal tapir
#

how do i fix i will Send code in a second

earnest phoenix
lusty quest
#

replace " with `

unreal tapir
#
   } else if (message.content === '>serverinfo') {
        message.channel.send('Server name: `${message.guild.name}`\nTotal members: `$message.guild.memberCount`');
    }
lusty quest
#

yea this wont work

lusty quest
#

see the difference?

unreal tapir
#

ye

#

ok so i was supposed to replace the '' with ``

lusty quest
#

yea

unreal tapir
#

ohh ok

lusty quest
#

well there are 3 ways to define strings in js, but only one allows you to parse in values

#

a workaround would be joining the values to the string

lucid prawn
lusty quest
#
message.channel.send("Server name: "+message.guild.name+"\nTotal members: "+message.guild.memberCount);
```this would also be valid
unreal tapir
#

dont go to wio's status

#

youll regret it

lusty quest
#

nah its just woo doing its thing

earnest phoenix
#

Just __dirname, not global.location.__dirname

lucid prawn
#

ok

lucid prawn
earnest phoenix
#

To the route's callback?

lucid prawn
#

yes

earnest phoenix
lucid prawn
signal estuary
#

Do you know a way, I can save mutes, so my bot will unmute them correctly in time?
At the moment I am using a time out:

 setTimeout(async () => {
                                    try {
                                        member.roles.remove(role);
                                    } catch {
                                    }
                         }

But if you are using another command while this timeout is running, the timeout will abort
I can use a database if this is an solution. Any suggestions?

earnest phoenix
worn sonnet
#

can we add albums to our playlists on spotify?

#

i'm tryna use spotipy

unreal tapir
#

if i kill the terminal in my code editor will my bot go offline in a couple minutes?

unreal tapir
#

ok

#

its kinda lagging my pc

lucid prawn
worn sonnet
worn sonnet
lucid prawn
worn sonnet
earnest phoenix
#

Not sure how you could send a callback to for it to open a tab to those routers because the structure of the callbacks is unknown, you could additionally use puppeteer

unreal tapir
#

ok whats best free bot host

earnest phoenix
solemn latch
unreal tapir
#

Yea my bots gonna only be in one server

#

Its like sounds utilities

signal estuary
lucid prawn
unreal tapir
#

would i make my repl.it repl public or private

lucid prawn
#

use a host

earnest phoenix
earnest phoenix
tulip ledge
#

query GetCommunityGuides($input: {championId: Int, role: String, userName: String}!) { this is the first line of my graphql query, I get an error with the { is there any other way of defining the types? I'm using JS not TS

earnest phoenix
#

merhaba

signal estuary
#

How can I fix this?

var client = new Discord.Client({
    partials: ['MESSAGE', 'CHANNEL', 'REACTION']
})
earnest phoenix
#

türkçe yardım eden var mı ?

signal estuary
#

??????

signal estuary
sudden geyser
#

You'd have each one of the parameters be separate.

sudden geyser
#

e.g.

query GetCommunityGuides($championId: Int!, $role: String~, $username: String!) {
  # ...
}
west spoke
#

lol

tulip ledge
#

they need to be put in as an object tho

#
    const variables = {
      input: {
        "championId": 23,
        "userName": "XXX",
        "role": "TOP"
      }
    }
sudden geyser
sudden geyser
tulip ledge
#

well yes, there is a custom type for input but since I'm using js and not ts I can't use that type

#

thats why I need to find a solution

signal estuary
sudden geyser
#

It would be easier to solve if I knew the structure of the field you're using it for.

opal plank
tulip ledge
#

well I'm new to graphql

#

Idk what u mean with structure

#

its not my database it's me requesting to an endpoint

#

I sent u the query in dm

worn sonnet
#

Umm is there any way I get notified whenever a track is added to a playlist in Spotify

#

I'm using python

tired panther
#

Does someone know how I could keep my mongodb cached documents uptodate without a change stream?

digital swan
# polar adder

u know if u press the print screen button it takes a picture of ur screen so u dont have to whip out ur phone

worn sonnet
sudden geyser
wooden kindle
#

hey im kinda new to coding and wondering if someone can help me!
im trying to add the feature to my bot +welcome-set (#channel)
i know how to do it so it sends it in 1 channel with the id and i was wondering if someone could
maybe give me some one can just give me the code to it as i need help

This Is The Channel ID One I Did

    member.guild.channels.get('channelID').send("Welcome"); 
}); ```
worn sonnet
signal estuary
sudden geyser
opal plank
signal estuary
sudden geyser
#

The general way to subscribe to new updates would be through a websocket connection.

#

But I don't see any use of that in their public API.

worn sonnet
#

I guess so BC they do have one for app I think

opal plank
#

remove the {}

sudden geyser
#

There's polling (where you repeatedly send requests to check for changes), but it's not as efficinet.

signal estuary
signal estuary
worn sonnet
#

Well then I do need to store the previous data then compare

#

And all

#

This was the first thing I thought

opal plank
worn sonnet
#

But then if there's some way to get the update directly from the Spotify

#

It would be good

opal plank
#

@signal estuary n

#

fuck

#

there

#

wrong clipboard

signal estuary
#

cant find in the docs which one I need

opal plank
#

interactionCreate

sudden geyser
signal estuary
#
const client = new Discord.Client({
    partials: [
        'MESSAGE', 'CHANNEL', 'REACTION'
    ],
     ws: { intents: ['interactionCreate'] } 
})
require('discord-buttons')(client)
const { MessageButton, MessageActionRow} = require('discord-buttons')
opal plank
#

pretty sure its _

#

or uppercase

#

it depends on the library

crimson vapor
#

hi

signal estuary
earnest phoenix
#

INTERACTION_CREATE is an event, not an intent; if you're trying to use components, either read the documentation or search up on your error if you're getting one

west spoke
#

reading docs might help y'know

wooden kindle
#

i just need some sort of code that helps me with per server welcome messages

lucid prawn
solemn latch
earnest phoenix
lucid prawn
earnest phoenix
#

Then rip

lucid prawn
#

ik

opal plank
#

if you dont specify the intent on the gateway you just wont receive it

lucid prawn
earnest phoenix
earnest phoenix
opal plank
#

they need the intent for that in order to receive the events

#

which is why their buttons arent working

#

cuz they didnt specify ANY intent

#

so the event never triggers

earnest phoenix
#

So they just didn't specify any intents, I thought you meant they don't have the "interaction" intent and I was confused

lucid prawn
sudden geyser
earnest phoenix
#

@signal estuary You gotta need a few intents to receive that event, GUILDS, GUILD_MESSAGES and GUILD_WEBHOOKS, specify these on your client options and test it; add other intents if you also need them

lucid prawn
earnest phoenix
earnest phoenix
lucid prawn
feral aspen
#
message.channel.send(new MessageEmbed().setDescription("This is a description of an embed."));

How can I get the message ID of this so I can edit it?

earnest phoenix
lucid prawn
#

my index.js is having this problem

require is not defined

my node having this problem

signal estuary
#

My bot doesnt react to this. No errors no message just nothing:

client.on('interaction', async interaction => {
    if (!interaction.isCommand()) return;

    if (interaction.commandName === 'ping') {
        const row = new MessageActionRow()
            .addComponents(
                new MessageButton()
                    .setCustomID('primary')
                    .setLabel('primary')
                    .setStyle('PRIMARY'),
            );

        await interaction.reply({ content: 'Pong!', components: [row] });
    }
})

Does anyone know why?

earnest phoenix
#

There's no event called interaction

#

interactionCreate

signal estuary
earnest phoenix
# signal estuary still nothing

Have you tried logging anything before the if statements to see if the event is emitted? If it doesn't log anything then you're still missing intents

earnest phoenix
#

Then yea, you're missing intents

#

May you show us your client options?

opal plank
#

they still havent changed the event name voltrex

earnest phoenix
#

@signal estuary you gonna change it?

signal estuary
earnest phoenix
#

And the result?

signal estuary
#

And this is from today

earnest phoenix
#

That's strange, the event was supposed to be called interactionCreate not interaction

#

Anyway, did it still work?

lucid prawn
earnest phoenix
opal plank
#

BUT HAVE YOU GUYS HEARD OF A BETTER LIB THAN DJS CALLED DETRITUSJS? ITS GREAT LIB, SHOULD SWITCH

earnest phoenix
boreal iron
opal plank
#

we got large bot scaling
sharding
great chache
customizable cache
faster startup speeds
16x sharding support
slash commands handler
buttons helper and builders

and much much more

#

wink wink

boreal iron
#

all the cash that goes into your wallet right now...

earnest phoenix
opal plank
#

evie is working on one

earnest phoenix
opal plank
#

"scalable lib"

#

129 minutes to log in all shards vs 8 on detritus

earnest phoenix
#

it takes for me 4mins for 4 shards

#

Oh god oh fuck, Erwin about to talk about detritus 24/7 in development

opal plank
#

you started it

#

you reap what you sow

lucid prawn
# earnest phoenix No idea about that

this is the index

var app = require("app")
var bw = require("browser-window")

app.on("ready", function () {
     mainWindow = new bw({
        width:640,
        height:440,
        resizable:false,
         icon:"asset/wireless_tower_2.png"
    })
    mainWindow.loadUrl("file://"+__dirname+"/index.html");


})
opal plank
earnest phoenix
opal plank
sudden geyser
#

yah

#

I think it's very douchy though (no hard feelings)

opal plank
#

why? its not my lib

#

nor do i know the owners

earnest phoenix
opal plank
#

nor do i get paid

opal plank
#

php

sudden geyser
opal plank
proven lantern
#

is it possible to use discordjs to create a generic invite to the discord server that is not linked to a channel?

opal plank
#

but new people see it once and prob never again

#

if you have an apple, and a rotten apple, which would you praise and recommend to eat?

#

i use djs as a comparison since its what everyone uses it

#

not my fault the lib is in that sorry state

proven lantern
#

i use Tims library

opal plank
#

even the original devs left it

proven lantern
#

discordjs-light

opal plank
#

takes 4 months for them to add stuff

lucid prawn
opal plank
#

5 if you consider lib devs have access to private beta before they are even out

#

to give them a head-start when the changes are deployed

#

you dont see that in ANY other libs

sudden geyser
#

I don't mind criticizing one library and praising the other, but constantly doing that gets annoying (for casuals).

opal plank
#

d.py, drb, none of those libs have the struggles djs goes thru

#

in all honesty, its less about detritus and more about finding an actual good lib, eris or djs light

#

in the state its shipped in, djs is shit

opal plank
earnest phoenix
#

If erwin was paid to shit on d.js, he would be a billionaire now

proven lantern
#

so are invites always tied to a channel with discordjs?

opal plank
#

im referring it more as memes or to actual new people

sudden geyser
earnest phoenix
opal plank
#

pretyt sure invites are tied to channels always

proven lantern
#

dangnabit

opal plank
#

even from here

#

pretty sure it just dumps you on the default channel

#

or the first one

#

i never actually checked which channel it picks when you do this

lyric mountain
#

it sends to default channel

lucid prawn
proven lantern
#

is the default channel always the first item in the channels array?

lyric mountain
#

nope

#

you define it

#

or used to

proven lantern
#

is there a way to get that default channel?

#

for any guild

lyric mountain
#

getDefaultChannel() in JDA

#

idk about djs

proven lantern
#

i guess a guild could have no channels

opal plank
proven lantern
opal plank
#

idk how this is in d.js

#

this screenshot is from detritusjs

proven lantern
#

how dare you

#

give me hope

opal plank
#

sorry, djs is shit lmao

#

i use the better one

lyric mountain
#

oh yeah, first channel in array

#

mb

opal plank
#

so it is the first channel huh

#

i guess you could channels.first() ?

proven lantern
#

they add the check for read permissions

opal plank
#

actually

proven lantern
#

against getPublicRole

opal plank
#

that'll lead to categories

proven lantern
#

so iterate through the channels until i find a channel with read permissions with whatever the getPublicRole is

#

i wish discordjs did that for me

#

isn't the public role always @everyone

opal plank
#

not sure if u can change it

#

but if its there, there should be a reason for it

#

unless its just there as a easy placeholder for the variable

lyric mountain
#

public role is always everyone

proven lantern
#

java people are just planning ahead for if/when discord lets you change it

lyric mountain
#

that's one of the best things about getters tbf

#

not to say the data processing you can add to them

proven lantern
#

just dont use member functions that rely on the state of the object

#

when i write java i never use models. only List and Map

lyric mountain
#

by models you mean objects/classes?

proven lantern
#

POJOs

lyric mountain
#

oh, barely anyone use them nowadays

#

that's why they're called POJO

proven lantern
#

no beans either

#

beans are too sneaky

prime mist
sudden geyser
#

embrace to pojo

opal plank
#

imma say it and run

#

embrace detritusjs

proven lantern
opal plank
earnest phoenix
signal estuary
#

When I am trying to send a button, I get this error: TypeError: resolveString is not a function

proven lantern
#

nice, i'll have to move over to that library at some point

opal plank
#

@proven lantern

opal plank
#

if u got questions about it, like, structure wise(not code wise), its better to ask there

signal estuary
opal plank
#

cake should be back today/tomorrow

opal plank
#

discord bots in php sounds fun

earnest phoenix
opal plank
#

sounds like pain tho

proven lantern
#

mark zuckerberg likes php

lyric mountain
#

what would be "advanced bot"?

proven lantern
#

facebook put a lot into php because of him

earnest phoenix
sudden geyser
proven lantern
#

my bot is advanced

lyric mountain
#

jokes aside, pixel stuff it pretty basic

#

and way less complex than it sounds

proven lantern
#

pixels and colors are magic

lyric mountain
#

nah

proven lantern
#

r+g+b = white?

lyric mountain
#

pixels are defined as p = 0xRRGGBB

proven lantern
#

weird colors

lyric mountain
#

aka hexadecimal

#

but instead of #RRGGBB it's 0xRRGGBB

proven lantern
#

0-f

lyric mountain
#

that's to show channels

#

not actual values

proven lantern
#

0 means no color

lyric mountain
#

for example, a blue pixel would be 0x0000FF

proven lantern
#

f means MAX COLOR!

#

color to the MAX

lucid prawn
lyric mountain
#

f means 16

proven lantern
#

no

lyric mountain
#

yes

proven lantern
#

lol

#

means 15

lyric mountain
#

16

proven lantern
#

means 12

lyric mountain
#

f is the 16th digit in hex

sudden geyser
proven lantern
#

9 -> a -> b -> c -> d -> e -> f

lyric mountain
#

oh, yeah, hex starts with 0

#

so 15

proven lantern
#

9 -> 10 -> 11- > 12 -> 13 -> 14 ->15

#

hex has 16 digits

#

including 0

lyric mountain
#

yeah yeah sherlock

proven lantern
#

the romans didn't like 0

lyric mountain
#

I already said that 4 messages above

proven lantern
#

they disagreed with it

latent heron
#

pain

#

there are so many things wrong with this

proven lantern
#

what language is that?

lyric mountain
#

but anyway, pixel processing is dead easy when you figure out you're not supposed to directly manipulate the rgb value directly

#

but extract its channels, manipulate them individually and re-pack them into rgb

latent heron
#

python

#

i'm currently rewriting my command code for my bot

lucid prawn
latent heron
#

now i've chosen an even worse method

#

making my commands as classes

proven lantern
#

scala?

#

python

sudden geyser
proven lantern
#

annotations were banned from ecma script

#

people wanted to add annotations to JS

sudden geyser
#

but why

proven lantern
#

people want to see the world burn

sudden geyser
#

they also wanted to add typing to javascript

#

then that got thrown out

lyric mountain
#

the world would be brighter with javascript types

sudden geyser
#

Am I living on the opposite side of the earth

#

because all I see is darkness

lyric mountain
#

damn

#

please wait 12h while we fix your issue

sudden geyser
#

localization would like to know your location

unkempt wedge
earnest phoenix
#

merhaba ben şöyle bir şey yaptım fakat botum sesli kanaldan çıkmıyor ben çıktığımda.

#

hello, I did something like this, but my bot does not come out of the voice channel when I leave

#

why ?

west spoke
#

your ID wouldn't be in newstate, it would be in oldstate

proven lantern
opal plank
#

also for a boolean you should use .has

#

not .get

proven lantern
#

msg.guild.channels.fetch()

earnest phoenix
#

not for a specific channel

#

every voice channel the bot is on

#

translate ile bu kadar oluyo galiba

west spoke
earnest phoenix
#

To sum up, how should I write the code finally?

proven lantern
#

message.guild.me.voice.channel.leave();

earnest phoenix
#

trying ...

west spoke
#

what the fuck

#

is that

earnest phoenix
#

What should I write instead of 'get'.

proven lantern
#

has

west spoke
earnest phoenix
#

bot

west spoke
#

ah

proven lantern
#

get returns the value in the map. has returns true if there is a value for the key

west spoke
#

so yeah, you want a boolean, so use has, or if you use get check to see if it's 0 or null

earnest phoenix
#

I don't understand exactly what to do 😄

west spoke
#

we're telling you what you need to do

#

we won't spoonfeed you

earnest phoenix
#

I'm confused

unkempt ocean
#

btw code works perfectly on me

proven lantern
#

i'd get the guildId from newState and then use the discordjs client to fetch the guild. then do guild.me.voice.channel.leave();

earnest phoenix
#

bende mi sıkıntı var yaw

proven lantern
#

const guild = await client.guilds.fetch(newState.guild.id)

unkempt ocean
#

you sure that's the correct id of your bot

earnest phoenix
#

get yerine has mı yazam

earnest phoenix
#

)ingilizce mi konuşmam gerek ?)

unkempt ocean
#

please use English only in this channel though

#

it works fine with get()

earnest phoenix
opal plank
unkempt ocean
#

oh

west spoke
unkempt ocean
#

you're right

opal plank
earnest phoenix
#

I'm really confused.

opal plank
unkempt ocean
opal plank
proven lantern
opal plank
#

when you typing it out it should tell you it can be null/undefined

proven lantern
#
/* Emitted whenever a user changes voice state - e.g. joins/leaves a channel, mutes/unmutes.
PARAMETER    TYPE             DESCRIPTION
oldMember    GuildMember      The member before the voice state update
newMember    GuildMember      The member after the voice state update    */
client.on("voiceStateUpdate", function(oldMember, newMember){
    console.log(`a user changes voice state`);
});
west spoke
#

GuildMember.guild would return the guild object, I think

#

unless js is fucking wild

#

which is probably the case

opal plank
#

ts would tell you lul

proven lantern
#

js is the best language

#

puts all typed languages to shame

opal plank
#

js is good when typed

#

otherwise its a clusterfuck of --yolo

west spoke
opal plank
#

js is literally the definition of this emote

#

it just runs it, even when things are wrong

#

then you have to wait until your code reaches that error so you can finally fix a bug

west spoke
#

yep

opal plank
#

be it by a user or a bad event

proven lantern
#

are you talking about oop?

opal plank
#

im talking about typescript

#

which is js

signal estuary
#

The bot isnt sending the buttons and I dont know why:

var Discord = require('discord.js');
const { MessageButton, MessageActionRow } = require('discord.js')
exports.run = async (client, msg, args) => {
    const row = new MessageActionRow()
    .addComponents(
        new MessageButton()
            .setCustomID('primary')
            .setLabel('primary')
            .setStyle('PRIMARY'),
    );
    msg.channel.send("test", [row])

}

hes just sending "test"

opal plank
#

js is amazing, but its just too lenient

#

bad for coding, good for executing

#

if u write good code, it'll work flawlessly and amazingly

#

howver if youw rite bad code, it wont tell you

#

it'll just run it

#

thats where typescript comes, so when you are coding, you can see errors like that

#

for example, you guys dont know if that payload is a member or another event

proven lantern
#

just make sure not to let people write bad code in your codebase

opal plank
#

ts would tell you what type of event object you're recieving

#

along with its types

proven lantern
#

js will tell you that too if the library was written in ts

#

ts is great for libraries

opal plank
#

for example this

untold token
#

doesn't have to be written in ts\

#

doesn't jsdoc do that too

opal plank
#

intellisnce in general

#

partially

#

not fully

#

ts comes in for that

#

specially cuz djs does have ts declaration files

#

theres no real reason not to use Typescript in all honesty

#

you can set its configs to be lax(aka you wouldnt notice the difference from js) and simply enjoy the intellisence

proven lantern
#

the best way to organize your code is to make a bunch of different functions that each have their own file

#

1 file = 1 function

opal plank
#

burn it with fire

unkempt wedge
#

and gasoline

proven lantern
#

this needs to be refactored

opal plank
#

AND es5 syntax

#

use import/exports, its been a thing since es6

#

named exports will be your salvation

proven lantern
#

my nextjs project is es5

opal plank
#

fat rip then

proven lantern
#

bot is not

opal plank
#

funny its called nextjs but its not nextjs

proven lantern
#

bot is nodejs

opal plank
#

its oldjs

proven lantern
#

i have 2 js projects

#

wait

opal plank
proven lantern
#

they think they are ESNext, but they will get shut down like they always do

#

dont try putting annotations in ES

#

i'm using vercel's nextjs

#

the real nextjs

#

my project doesn't have a config file

#

oh, nextjs does support es6

opal plank
#

@drowsy crag free ban

#

speedrun before the other mods yoink your ban quota

#

frick, aurel got it

drowsy crag
#

ayo

opal plank
#

aurel already beaned

drowsy crag
#

fuck hope all my homies hate hope

unkempt wedge
opal plank
#

yes, lets go with that

unkempt wedge
#

short

opal plank
#

bonk

unkempt wedge
unreal tapir
#

how to handle fame

earnest phoenix
#

How can limit user to use command for example they wanna send me messages but i wanna let them to this one more time
Im using discordjs and quick db

unkempt wedge
#

lmao

unkempt wedge
unreal tapir
earnest phoenix
lyric mountain
unreal tapir
#

prefix is not defined??

earnest phoenix
#

Idk how to do it lol

lyric mountain
sinful thistle
#

Alright so, I'm wondering if the client is for the bot id

#

I'm noob at this

unkempt wedge
#

I'd recommend WOKCommands

lyric mountain
#
ID     |  USAGES
12345  |    3
12645  |    0
12521  |    1
16832  |    1
12249  |    0
12128  |    2
#

then just get the row by user id

sinful thistle
#

you talkin to me?

#

or infinity

lyric mountain
#

once the user use the command decrease the usages and save to db again

#

you

sinful thistle
#

oh

#

so this part is the bot id?

lyric mountain
#

oh wait

#

not u

#

tyrone actually

sinful thistle
#

...

#

I hate you

lyric mountain
sinful thistle
#

OH

lyric mountain
unreal tapir
#

if (!message.content.startsWith(prefix) || message.author.bot) return;
^

ReferenceError: prefix is not defined

wha

lyric mountain
#

define prefix

#

and don't copypaste code

sinful thistle
#

Does anybody know a site to recommend for bot hosting?

#

I cant seem to find one

lyric mountain
#

answer is "none"

#

unless by site you mean service

#

afaik there are only 3 sites that allow bot hosting directly on it

#

those being glitch, replit and heroku

#

all 3 have their pros and cons

#

and a helluva more cons than pros

unkempt wedge
#

there's some that sell bot hosting but they're not very good kek

unkempt wedge
lyric mountain
#

still don't tbh

sinful thistle
lyric mountain
#

I cant count how many times I rewrote my old code just to find there was actually a better way to do it

#

remember: you're better than your old self

sinful thistle
#

Do any of those sites do bot hosting for free?

lyric mountain
#

all 3 are free

sinful thistle
#

O

lyric mountain
#

but note this part

and a helluva more cons than pros

unkempt wedge
#

i've used heroku and repl but i recommend repl

#

also heroku has paid versions if you want

lyric mountain
#

dont pay heroku, it's so overpriced that you could buy 2 vps with the price of it

unkempt wedge
#

i haven't checked prices lmao

#

idk

#

anyone here have experience with linode? i've heard its good

sinful thistle
lyric mountain
#

is that repl?

sinful thistle
#

glitch

lyric mountain
#

if youre going to use glitch just go repl

sinful thistle
#

alr

lyric mountain
#

glitch actively tries to kill bots on their service

sinful thistle
#

sheesh

lyric mountain
#

they publicly said they dont want bots there

unkempt wedge
#

repl doesn't tho

#

right?

lyric mountain
#

ye

sinful thistle
#

can you dm me the site?

lyric mountain
#

repl took the burden out of glitch

#

they're probably going to go back on that futurely

#

bots severely clutter free hosts

lyric mountain
#

literally

sinful thistle
#

alr

sinful thistle
unreal tapir
#

When i do node . and do my ping command >ping i get the error ReferenceError: prefix is not defined and i cant find a way to define it

lyric mountain
lyric mountain
earnest phoenix
#

Not best but good

unreal tapir
earnest phoenix
#

But you need uptimer if you wanna use glitch

#

And glitch bans uptimersumm

lyric mountain
#

you're literally going against their ToS by doing it

earnest phoenix
lyric mountain
earnest phoenix
#

Glitch smd

#

I am using uptimer bot on glitch

#

They could not detect me yet Troodon_Hehe_Boi

lyric mountain
#

they probably detected

#

you and 8218940 other users

#

you're just in the queue

earnest phoenix
#

@violet wolf

#

Yes maybe

lyric mountain
#

oh wait

#

that's you

#

mb

#

I keep mistaking your pfp with jordan's

wheat mesa
sinful thistle
lyric mountain
sinful thistle
#

alr

#

@lyric mountain i'm guessing this is it?

lyric mountain
#

well, that's the template code

sinful thistle
#

alr so hows it gonna for like the code

sinful thistle
lyric mountain
#

kinda

#

do you know how discord.js works or total newbie?

sinful thistle
#

I'm noob at it

#

I'm learing tho

#

learning*

sinful thistle
#

lol

#

new*

lyric mountain
#

I recommend reading more about discord.js and javascript in general

south sinew
#

is there any typings for lavalink or should I just make a typings lib myself

umbral mist
#

anyone in support?

fresh verge
#

How do you do image manipulation? (Discord.JS).

unkempt wedge
#

and also you should watch Worn Off Key's video about it

#

he is big pogger man

lusty quest
#

does someone know if js already supports 64bit unix time?

sudden geyser
#

Kind of?

latent heron
#

finally

#

no more reactions boohoo

slender thistle
#

Lmaooo gratz man

winter patrol
#

Can anyone help me out?

opal plank
#

just ask the question

winter patrol
#

I can't delete the published server

pale vessel
#

@opal plank Hello

opal plank
winter patrol
#

And I want to recreate everything I made

pale vessel
#

discord-rose

opal plank
#

context

winter patrol
#

I wanted to advertise my server in top.gg like creating a voting system and all

#

So I did the steps as instructed in it

#

Now I want to delete everything and start the setup linking with vote tracker

#

To get detailed and personalized info

opal plank
#

so you using another bot for it?

#

instead of DSL

winter patrol
#

It track votes yes

opal plank
#

then you should ask in that bot's support server

winter patrol
#

I don't know the commands of dsl

opal plank
#

ask in #support then about it, they are better fit for questions regarding DSL

winter patrol
#

I refer to this

#

When I clicked on delete it said error 403 forbidden

opal plank
#

are you logged in?

winter patrol
#

Yep

opal plank
#

hmmm, then im not sure

#

like i said, its better to ask in #support about it

winter patrol
#

I already did it

opal plank
#

and?

winter patrol
#

They said to delete invite in dsl

#

And I can't get that part

#

And do you know the commands of dsl?

opal plank
#

i do not

pale vessel
pliant gorgeBOT
#

Pong!

pale vessel
#

That's all I think

slender thistle
#

Anyone here ever worked with Dash components in Python?

flat copper
#

Buttons is not showing in android.

#

Is it available for android??

pale vessel
#

Is your client up-to-date?

flat copper
#

?

sick agate
#

shows for me (Beta)

near stratus
worn sonnet
#

Hey i got stuck with syntax in python

#

like

#
                            '2NeSirLM2VHQW4upn0nMfB',
                            '6sx0aPkil4NYXKAbnMsoxg']
    'id_2': [element_1, 2 ,3]}
#

i wanna add the new elements to the list

slender thistle
#

some_dict['0rBH2H5umr45M9IpxNIhuo'].append

#

or whichever list you need

worn sonnet
slender thistle
#
>>> d = dict(mykey=[1,2,3])
>>> d
{'mykey': [1, 2, 3]}
>>> d['mykey'].append(4)
>>> d
{'mykey': [1, 2, 3, 4]}
worn sonnet
#

smth is really wrong with me now

slender thistle
#

😛

earnest phoenix
#

@near stratus how you made this reply style ?

copper cradle
#

that's what replies look like

sly sierra
#

does anyone know any pat api's XiangPat

rocky hearth
#

I'v a obj like this

const obj = {
  fun1: (a: A) => {},
  fun2: (b: B) => {},
}

const AB = // A | B

I want the AB to be of type A | B. How can I extract the types from the parameters

flat copper
rocky hearth
#

message.mentions.users

#

i just guessed, u hvnt provide any errors

#

😄

#

can u see the difference

cinder patio
opal plank
#

A must be defined somewhere

cinder patio
#

what's that question

opal plank
#

since its an explicit declaration, you need to import it from whatever you assigned it

rocky hearth
#

I know, but I want to extract it instead

opal plank
#

but if its implicit, you have to import it the same

#

i dont think you can

earnest phoenix
#

My bot reply like that

opal plank
#

i dont think IN keywords for functions

earnest phoenix
#

Seems op reply Troodon_Hehe_Boi

rocky hearth
#

there's a utility type Parameters<>, which might help I guess

opal plank
#

thats a very rare and non standard way of doing it tho

#

questions like that are rarely answered here

#

the only people i know that use typescript quite througouhly to be able to answer that would be me, feud, xetera and perhaps tim

#

both me and feud said we dont know

rocky hearth
#

ooh, actually this worked
Parameters<typeof obj[keyof typeof obj]>[0]

#
const obj = {
  fun1: (a: string) => {},
  fun2: (b: number) => {},
}
type aa = Parameters<typeof obj[keyof typeof obj]>[0]
cinder patio
#

why would you ever need to use thiiiiis

opal plank
#

this is almost as fucky as my keyof typeof in mix

woeful pike
#

if you want to make a function that works with a valid input for any defined function

rocky hearth
#

Im making a package, and want to typecast the return types from users inputed object.

opal plank
#

thats a first for me

woeful pike
#

now go make a json parser in typescript types

opal plank
woeful pike
pale vessel
#

me rn