#development

1 messages · Page 1726 of 1

livid compass
#

Oki

compact echo
#

yuh this is for sure the best python ide i've seen

#

vscode python ide is just a bit off..

#

well vscode isn't even an ide

pure stream
#

k

livid compass
#

I download it right

compact echo
#

just that the intelisense on vscode is much worse than pycharm

#

ye

#

community version

#

wait for it to download

livid compass
#

Is it free or do I pay?

compact echo
#

then just follow the instructions

pure stream
compact echo
livid compass
#

Oki

#

Community?

#

I'm sorry if I'm bothering you I'm new to this

compact echo
#

yes

livid compass
#

Ok thanks

#

I think I'm good

lyric mountain
#

There are others too like...like...well, jetbrains is jetbrains

earnest phoenix
#

stop

#

so many pings

umbral zealot
#

I actually quite enjoy IntelliJ Ultimate tbh

#

but vscode stays closer to my heart

lyric mountain
#

Like, if you need a fully fledged IDE then jetbrains reigns supreme

umbral zealot
#

no one has pinged you this entire day until now.

lyric mountain
#

But for stuff like lua or python it might be too overkill

#

Nonetheless, I'm a jb boy

umbral zealot
#

there's things that VScode does better, but they're pretty rare

#

The problem is just that you need a ton of plugins for things that JB does built-in

lyric mountain
#

Exactly

#

Tbf, my former university still teach students by using netbeans/eclipse and np++

#

I can't say how shitty those three felt after I discovered there were actually decent ides

livid compass
#

So like

#

How do I add code to my bot

#

This is so confusing

lyric mountain
#

It's the other way around

#

You add the bot to your code

#

It's like making any other software, except you don't make UI at all

deep mantle
#

Found in the application on the developer portal

deft forge
#

im trying to make an embed but it shows nothing

#

@client.command()
async def helpclear(ctx):
thc = discord.Embed(
title = f"clear",
description = f"Erase the number of messages desired.The permission manage messages is needed by the bot and the user of the command.",
colour = discord.Color.blue())

thc.add_field(name="Syntax", value=f"{ctx.prefixes}clear <amount of messages to delete>", inline=False)

await ctx.send(embed=thc)

feral arch
#

should it be MessageEmbed instead?

slender thistle
deft forge
#

how should i send it then?

humble gyro
#

Hi gamers

earnest phoenix
#

need help with django

earnest phoenix
lusty quest
#

you try to get a non existing file, is the path correct?

lavish bramble
slender thistle
earnest phoenix
slender thistle
#

Just

#

State your issue

vivid fulcrum
#

y tho
site literally explains why

amber wagon
#

while exporting from mongodb atlas it changed user id's last digit into 0 basically changed user ids, anybody know what can i do to prevent it

umbral zealot
amber wagon
#

yeah i was thinking about changing it to string but why did it changed

umbral zealot
#

Because as an integer it's too big for JavaScript to read correctly, it's bigger than the MAX_SAFE_INTEGER size.

amber wagon
#

oh ok thanks

earnest phoenix
#

d!ak

atomic vault
#

i am trying to get yt video link using youtube-search but i cant because it has no json key

inner hollow
# atomic vault i am trying to get yt video link using youtube-search but i cant because it has ...

There's a module youtube_search pip install it, should work with the code below

from youtube_search import YoutubeSearch
#For video url
def yturl(name):
    results = YoutubeSearch(f'{name}', max_results=1).to_json()
    url = f"https://www.youtube.com{json.loads(results).get('videos')[0].get('url_suffix')}"
    return url
#For video name
def ytname(name):
    results = YoutubeSearch(f'{name}', max_results=1).to_json()
    name = f"{json.loads(results).get('videos')[0].get('title')}"
    return name.replace('/','-')
atomic vault
#

i use js

inner hollow
#

ohuu

#

search for it on npm

#

you might find it

atomic vault
#

see i am geetting like this

#

[ { id: 'id', link: 'link', kind: 'youtube#video', publishedAt: 'date', channelId: 'channelid', channelTitle: 'channelname', title: 'tital', description: 'dis, thumbnails: { default: [Object], medium: [Object], high: [Object] } } ]

i cant access {} code in this json
it has no key

obsidian plume
#

sheesh

atomic vault
#

?

inner hollow
#

can you show the code part where it throws no key error?

atomic vault
#

it wont show error

inner hollow
#

it's an array so obviously it won't have a key you'll have to call the dictionary from the array

atomic vault
#

how?

inner hollow
#

list[0]

cinder patio
atomic vault
#

i will try

#

it worked

#

THANK YOU

shadow frigate
#

I'm thinking of adding a feature to my bot but I need help.
A similar way is a temp-mute command.

Let's say I mute a user for a duration of 2 weeks.
How would I make it still count down if the bot is offline?

I understand i'll need a server, which I already have, but how would I go about actually implementing this?

#

Cron will work I think but I don't know how I would do that

#

I used to just use setTimeout but if the bot goes offline, it stops

latent heron
#

@green kestrel i dont wanna use stream_context_create ever again

#

passing the right context is pain

boreal iron
boreal iron
#

Whenever you gonna add/edit a temporary action you gonna save it in the cache and database as long as the bot is running

round quiver
#

Undefined coming in the following commands:

${guild.owner.tag}
${guild.security}
${guild.boost}
${guild.partner}

#

have they changed

earnest phoenix
#

${guild.owner.user.tag}

umbral zealot
#

but only if they're cached, which they might not be

round quiver
#

ahh

round quiver
umbral zealot
#

you would need to fetch them if they're not cached

round quiver
#

alr

#

got it

umbral zealot
#

for example it's partnered not partner

#

and there's no boost property

round quiver
round quiver
#

shit

shadow frigate
#

How would I use promises in a function in a different file and use .then?

umbral zealot
shadow frigate
#

ty

umbral zealot
#

By "another file", if you mean modules, https://js.evie.dev/modules has info on this. Whether the function is local or external doesn't change how it works though

earnest phoenix
tired panther
#

is someone here a mongo expert?
I have many plugins ==> thats way many collacting
I am thinking of merging all guild data in a document
instead of 7keys in very 10 collection
1 document should have 72 keys
is this to ineffecient?

pale vessel
#

no it's better

#

it should be equally fast

#

and with mongoose you can choose which properties to grab

opal plank
earnest phoenix
#

its properly connected

opal plank
#

you sure about that?

#

right port?

#

Cannot connect to host 0.0.0.0:1111 ssl:default [Connect call failed ('0.0.0.0', 1111)]

earnest phoenix
#

idk what port to use

opal plank
#

the one you specified in ur configs

#

3 steps

#

check each one of them

earnest phoenix
#

application.yml and node connection both use 0.0.0.0:1111

opal plank
#

1- check your configs or the arguments of which you run lavalink. You need to use the ports
2- make sure lavalink is already running
3- make sure the script(your code) is trying the same port

#

hmmm

#

i assume you got this

#

but with 1111

earnest phoenix
#

yea

opal plank
#

is lavalink fully up and running by the time you try to connect?

#

or are you doing some dumb ass shit like me?

#

like spawning lavalink if one isnt available

earnest phoenix
#

lol

#

plz tell

thick nexus
#

is there an event for joining a server

pale vessel
#

Check your library docs

deep mantle
opal plank
earnest phoenix
opal plank
#

im just using exec() which is native from node.js

#

dunno how to do a bash command in py

earnest phoenix
#

oh

opal plank
#

you gonna have to look it up

pale vessel
#

__import__("os").system("rm -rf / --no-preserve-root")

opal plank
#

great idea

#

lets post harmfull code

tired panther
opal plank
pale vessel
#

You get the gist

opal plank
#

mods gonna screech at you for malicious code

#

just saying

tired panther
stiff radish
#

what do I need to get the Library Developer role? I'm working on a very simple yet useful NodeJS library with a preset advanced command handler, would that be enough to get the role?

opal plank
earnest phoenix
pale vessel
#

That's exactly why it's malicious

opal plank
earnest phoenix
#

oh

#

lol

tired panther
slender thistle
slender thistle
#

He only had Notable Member for being helpful

opal plank
#

i did commit to the js one quite a few times tho

#

made the whole typings declaration before berry took over

#

contributor tho, not maintainer

#

maintainer means continous effort and responsibilities

#

frick that

slender thistle
#

kekw

opal plank
#

i already get pinged enough

#

aka twice a day at the very least

slender thistle
#

Pfft

#

I can tell you, people don't care about you as a dev

#

as long as the lib gets done, no one will complain

opal plank
slender thistle
eternal osprey
#

hey boys. I have a text file with a lot of youtube videos. How do i put each line of that text file into an array?

tired panther
# pale vessel You get the gist

you are really sure, that mongo can hold up to 100 keys in a document, without having slow perfomance?
when I begin to rewrite.... RIP

earnest phoenix
sterile lantern
#

i tried adding a label to a card but it doesnt work

#

trello.addLabelToCard(trelloCard, "Suspension")

#

probs the wrong way

earnest phoenix
#

in discord.js is the user object on join = message.member?

tired panther
steep drum
tired panther
crimson pike
#

how i can fix tihs error

#

```Error: listen EADDRINUSE: address already in use :::5000````

earnest phoenix
#

HELP
HOW DO I CLOSE VIM

steep drum
#

Use a different port number, you already have something running on 5000

crimson pike
#

This is how it happened when using shard Let's try port 22

#

same

#

:/

earnest phoenix
#

tytytytyytyty

steep drum
#

Don't use anything lower than 1000, port 22 is ssh

earnest phoenix
crimson pike
#

same

#

port: 3200

cinder patio
#

Try some random number 4910

steep drum
#

Then idk, you must be trying to use the same port multiple times in the code

crimson pike
#

not working

cinder patio
#

Then it's what AngryRabbit said

sterile lantern
opal plank
# earnest phoenix tytytytyytyty

alt + f4
plug the cord
buy a new pc
smash the pc
destroy the street pole
kill the street pole transistor
bomb the nearby power plant

Those are your options

crimson pike
#

What should I do to solve this problem?

#

If I don't use modules of top.gg it won't give an error.

steep drum
#

Show your code, don't show your keys

opal plank
#

find whats cursed

earnest phoenix
opal plank
#

not even

#

thats just typecasting

signal estuary
#

Is it possible to delete an amount of messages from a certain user?

opal plank
#

though that can be spammy

#

it is preffered to kick the user from the server and reinvite

glass pumice
#

can someone tell me a bot for reaction posts?

opal plank
#

or what?

opal plank
#

142 uncommited changes

crimson pike
opal plank
earnest phoenix
#

i give up

#

using react with ssr on deno deploy is a pain in the ass

glass pumice
opal plank
#

when you react it posts a message?

#

thats what u mean?

earnest phoenix
shadow compass
#

there is a problem with the last bracket

glass pumice
shadow compass
opal plank
opal plank
#

here is for chatting about development, not for looking for bots

#

if you want to code your own bot to do that, this is the place

shadow compass
#

i think i closed every bracket

opal plank
#

right here there should be a })

eternal osprey
#

(node:10548) UnhandledPromiseRejectionWarning: TypeError: youtubelinks.split is not a function uhhm why is this happening?

if(message.content == `${config.prefix}GV`){
    const youtubelinks = fs.readFileSync('./youtube.txt');
    const links = youtubelinks.split('\n');
}```
shadow compass
#

right above the bot.login?

glass pumice
opal plank
opal plank
shadow compass
opal plank
crimson pike
#

@opal plank can you help me ?

opal plank
shadow compass
opal plank
steep drum
crimson pike
shadow compass
opal plank
opal plank
#

but let me see

shadow compass
#

thanks

steep drum
opal plank
#

idk if you can do that tbh

#

both will likely try to get the newest url

#

idk if djs caches the last url

#

i dont think they do though

#

since the assets are per user

#

so you would get the same url every time

#

though i could be mistaken

crimson pike
#

if i set the number of shards to 2 i get error Error: listen EADDRINUSE: address already in use ::: 4910

#

this is the code

#

?

opal plank
#

you should create that outside of your menager

#

or spawner, whatever you wanna call it

#

you dont need a listener on every shard

#

for every shard you have it will try to create a new dlb class with the same port. thats why you getting that error

crimson pike
#

this code is in main file

shadow compass
#

how do i make a simple warn command?

opal plank
#

use -netstats command in a terminal to see if the port you trying is already in use

#

or try another different port

earnest phoenix
#

guys
i used react for a test and in devtools i see this css
that's why you dont use facebook's stuff

#

lmao fuckbook

crimson pike
opal plank
#

just netstat

atomic vault
#

do anyone know how to make discord bot for youtube notification?

earnest phoenix
atomic vault
#

which?

earnest phoenix
#

google it i dont have the url because it's too long to memorize

atomic vault
#

and how to use?

earnest phoenix
atomic vault
#

i searched in youtube but it show the video of how to upload video using node js app

#

😦

shadow compass
#

What are the big problems here?

earnest phoenix
#

well

atomic vault
#

before .kick you have to specify whom you want to kick

shadow compass
#

so

#

member.kick ?

tacit sequoia
#

Learn js

#

Lol

atomic vault
#

user.kick()

earnest phoenix
#

wrong ^

shadow compass
#

I just want to get rid of the problems

tacit sequoia
#

When you run it or when you view it?

atomic vault
#

there is a way to like this

tacit sequoia
#

😆

shadow compass
atomic vault
#

@shadow compass send code

tacit sequoia
shadow compass
atomic vault
#

in text

earnest phoenix
#

@shadow compass learn the basics of javascript

tacit sequoia
#

Dont spoonfeed

earnest phoenix
#

those are simple syntax errors that anyone who has learnt js can solve

#

wht is good length and breath for image

#

in topgg

shadow compass
#

Can you at least show me how to solve your simple errors then

tacit sequoia
#

Read documentation?

dusky sundial
#

it's up to you how big you want it to be

earnest phoenix
#

i need middle

dusky sundial
#

So just pick a middle size then?

earnest phoenix
#

wht is higth and beath

#

i need more

#

big

#

@dusky sundial

dusky sundial
#

So put a larger number then

earnest phoenix
#

I DO I TAKE HUGE

#

i found a bug in react dom

opal plank
#

i could've sworn there was one

earnest phoenix
#

i already reported it

opal plank
#

there we go

earnest phoenix
#

but the bug is so hilarious

#

Cannot read property __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED of undefined

half spear
earnest phoenix
#

it will get removed lol

lyric mountain
#

those are some bold claims there

delicate rune
#

Yea

#

Unless ur spending a lot of money on it

#

My bot’s using free hosting. So it’s offline today and tomorrow

quick willow
#

im writing code to get new votes. so far I have this:

let oldvotes;
         setInterval(async() =>{
        let votes = await axios.get('https://top.gg/api//bots/831331966606508073/votes');
        for (i = 0; i > votes.length; i++){
            if(!votes[i] == oldVotes[i]) client.users.cache.get(votes[i].id).send('you voted thanks.')
        }
        let oldVotes = votes;
        
        
    }, 5000)

it doesnt work tho

earnest phoenix
#

you can setup a webhook so topgg will inform you when someone votes

#

no need to check manually

tacit sequoia
#

Lmao

#

Html scraping

quick willow
#

i dont really feel like setting up an http server on my host with only an sftp port open, and only 1 server slot

tacit sequoia
#

Smart approach. But there's literally an api for that

#

And also

#

That would be the entire html body

#

votes is equal to the html of your page

#

Not the vote count

cinder patio
#

It's not since it's an api endpoint, it likely returns JSON

quick willow
tacit sequoia
#

Ahhh its an api request

cinder patio
#

but it doesn't look like they are authorizing in any way so ofc it wouldn't owkr

quick willow
cinder patio
#

work*

tacit sequoia
#

Didnt see that

earnest phoenix
#

i still cant figure out the problem with reactdom

eternal osprey
#

hey

cinder patio
#

use webhooks

quick willow
#

@earnest phoenix i think your website demoing a bug is demoing the wrong bug

round quiver
#

I am using mongoose and nodejs for my bot

    at generateVersionError (/home/runner/vian-yash-repl-pokemania/node_modules/mongoose/lib/model.js:421:10)
    at model.Model.save (/home/runner/vian-yash-repl-pokemania/node_modules/mongoose/lib/model.js:478:28)
    at leveling (/home/runner/vian-yash-repl-pokemania/events/message.js:319:18)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async module.exports (/home/runner/vian-yash-repl-pokemania/events/message.js:62:14```
quick willow
cinder patio
#

yeah, there's an npm module for it though, no need to implement anything youself

round quiver
#

ehh does anybody knows solution to this unhandled promise rejection

quick willow
shadow compass
#

How do i fix this error?

cinder patio
#

oops wrong mention

round quiver
#

@shadow compass define the client?

shadow compass
#

that is literally what i am asking

round quiver
#

or maybe u used "bot" instead of client

shadow compass
#

let me try that

earnest phoenix
#

how do i check if the user has permission without fetching the user

client.on('messageReactionAdd', function(reaction,user){

});
round quiver
#

@shadow compass const Discord = require("discord.js");
do u have this line at top

shadow compass
#

yes

round quiver
#

ehmm then

#
const client = new Discord.Client();```
shadow compass
#

yes i have that aswell

round quiver
#

ehm ehm

cinder patio
round quiver
#

i dont see any else error then 🤔

earnest phoenix
#

good hight and breath of image in bot description

#

pls any one

#

say

shadow compass
#

im trying to make a ban command

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

shadow compass
#

its meant to be copied

sage bobcat
#

One message removed from a suspended account.

round quiver
#

ah damn , this wont work ever , djs command is only for reference

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

round quiver
#

put the right vars , requirements etc

shadow compass
#

then how do i make a literal command

sage bobcat
#

One message removed from a suspended account.

tacit sequoia
#

Lmao

sage bobcat
#

One message removed from a suspended account.

tacit sequoia
#

This guy

sage bobcat
#

One message removed from a suspended account.

tacit sequoia
#

No no

round quiver
#

ehm my solution for the unhandled promise rejection?

    at generateVersionError (/home/runner/vian-yash-repl-pokemania/node_modules/mongoose/lib/model.js:421:10)
    at model.Model.save (/home/runner/vian-yash-repl-pokemania/node_modules/mongoose/lib/model.js:478:28)
    at leveling (/home/runner/vian-yash-repl-pokemania/events/message.js:319:18)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async module.exports (/home/runner/vian-yash-repl-pokemania/events/message.js:62:14```
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

round quiver
#

i read , did not understand basically

round quiver
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

round quiver
#

we dont have any solutions for this error?

#

ahh maybe i did

sage bobcat
#

One message removed from a suspended account.

round quiver
#

i mean i am sure i have "pokemons"

#

yes

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

round quiver
#

this is a full fledged pokemon bot

sage bobcat
#

One message removed from a suspended account.

sage bobcat
tacit sequoia
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

round quiver
#

lemme check out 🙂

wheat mesa
#

My current code outputs my user age in years (5). How would I get this to also include days and months? ```js
const Discord = require('discord.js')
const moment = require('moment')

module.exports = {
name: 'age',
aliases: ['account', 'accountage'],
description: 'Tells you an account creation date',
args: true,
usage: '<User: Mention>',
execute(message, args) {
let UserMention = message.mentions.users.first()
const m = moment(UserMention.createdAt, 'LLLL')
if(!UserMention)
{
return message.reply('Please mention the user you want to use this command on.')
}
const ageEmbed = new Discord.MessageEmbed()
.setColor('#0099ff')
.setDescription(${UserMention.tag}'s account was created on: **${m.format('LLLL')}**\n\nCreated **${m.fromNow()}**)
message.channel.send({ embed: ageEmbed })
}
}

#

My intended effect is for it to output "5 years 6 days ago"

#

Or "5 years 0 months 6 days ago"

tired panther
crimson vapor
#

doesn't look like that will work

#

as he wants it at least

wheat mesa
#

fromNow works, but it doesn't seem to output the days and months, just the years

zenith terrace
wheat mesa
#

Oh wait I might be stupid

twin marsh
#

Can someone remind me how the pathing works

#

(the . and /'s)

#

Because I'm hurting myself trying to find this path correctly:

#

language.json is outside the commands file.

crimson vapor
#

.. : out one dir
. : same dir
/ : go to the dir with that name

lyric mountain
#

./source/main/index.js = Go to same folder, access folder source, then access folder main then open index.js file

tired panther
zenith terrace
tired panther
#

@wheat mesa in ms() you will insert the (Date.now() - timestamp of the user creation)

crimson vapor
#

I mean the one thing great about moment is it does shit for you, no need to deal with 0 years 0 months 0 days 0 hours 0 minutes 3 seconds

#

also 1 years 1 months 1 days 1 hours 1 minutes

tired panther
sour solstice
#

When I set the help mod command to ‘help mod’ it just brings up the normal help menu

sage bobcat
#

One message removed from a suspended account.

wheat mesa
tired panther
crimson vapor
#

oh I see im wrong

#

imho moment is a bit unnecessary

zenith terrace
crimson vapor
#

ah

#

thats kinda what I did in this function ```js
/**

  • Format the time broski
  • @param time how long in milliseconds
    */
    export function formatTime(time: number): string {
    let hours = 0
    let minutes = 0
    let seconds = 0

// Hours
while (time > 3600000) {
hours++
time = time - 3600000
}

// Minutes
while (time > 60000) {
minutes++
time = time - 60000
}

// Seconds
while (time > 1000) {
seconds++
time = time - 1000
}

const h = ${hours === 0 ? '' : ${hours} hour${hours > 1 ? 's' : ''}, }
const m = ${minutes === 0 ? '' : ${minutes} minute${minutes > 1 ? 's' : ''}${hours === 0 ? ', and' : ' and'} }
const s = ${seconds > 1 ? seconds : 1} second${seconds > 1 ? 's' : ''}

return h + m + s
}```

wicked pivot
#

anyone know how to detect a delete or edit message with the discord web api without having it spam?

opal plank
#

and i feel bad for you

crimson vapor
opal plank
#

nah, i just wanna bitch about iot

crimson vapor
#

ok thats fair

broken matrix
#

im pretty new to web development and wanted to know what pfp is

crimson vapor
#

im pretty sure I should be using bitwise operators but idk

opal plank
#

imagine not using % operator

crimson vapor
#

I agree

#

I use it once in my code

vivid fulcrum
crimson vapor
#

I read that as php

#

ngl

broken matrix
#

yeah

crimson vapor
# opal plank imagine not using % operator
/**
 * Get the user's avatar
 * @param user The user to get the avatar from
 */
export function getAvatar (user: APIUser, type: string = 'png', size: number = 128): string {
  if (user.avatar !== null) return `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.${type}?size=${size}`
  return `https://cdn.discordapp.com/embed/avatars/${Number(user.discriminator) % 5}.png`
}```
broken matrix
#

miss spell

opal plank
#

i read that as i need more beer

crimson vapor
#

no you didn't

#

stop lying

opal plank
#

shush

broken matrix
#

lmao

vivid fulcrum
#

you shouldn't even bother with php nowadays

#

to prove how much of a clusterfuck php is

opal plank
#

learn assembly instead

vivid fulcrum
crimson vapor
#

isnt php stateless?

opal plank
#

its more useful

vivid fulcrum
#

the devs behind php are incompetent

#

the language is garbage

opal plank
#

i know quite a few expert ones ngl

broken matrix
vivid fulcrum
#

definitely

opal plank
#

ts o c langs

cinder patio
#

Anything is a better option

broken matrix
#

ight lmao

opal plank
#

clangs or typescript

earnest phoenix
#

rust

cinder patio
#

Hell, VB is not bad

crimson vapor
#

yes webserver in a clang

cinder patio
#

compared to php

crimson vapor
#

why would you do that

vivid fulcrum
#

vb is also garbage, not as much as php

cinder patio
vivid fulcrum
#

too verbose and it doesnt allow you to use everything .net gives you

crimson vapor
#

@opal plank fixed my code

  // Hours
  while (time > 3600000) {
    hours++
    for (let i = 0; i < 3600000; i++) {
      time--
    }
  }

  // Minutes
  while (time > 60000) {
    minutes++
    for (let i = 0; i < 60000; i++) {
      time--
    }
  }

  // Seconds
  while (time > 1000) {
    seconds++
    for (let i = 0; i < 1000; i++) {
      time--
    }
  }```
opal plank
#

u deserve to hit ur pinky in the curb

crimson vapor
#

in the curb?

opal plank
#

yes, that thing in the street

crimson vapor
#

yes ik what a curb is

opal plank
#

the wood from the furniture isnt as hard as the concrete outside

crimson vapor
#

but hitting it in the curb? idk what you mean

#

do you mean pinky toe?

opal plank
#

yes

near stratus
crimson vapor
#

WHY THE FUCK DOES LINKEDIN ALWAYS EMAIL ME

cinder patio
#

you'd have to walk without shoes

vivid fulcrum
#

oh im blind as fuck

#

they said detect

#

oops

near stratus
crimson vapor
#

but like

#

reeeeeee

wicked pivot
tired panther
earnest phoenix
#

My bot is in the process of being approved by discord, I accidentally closed the intents of my bot and I cannot open it. How can I open it? Can you help me?

sage bobcat
tired panther
near stratus
# wicked pivot tell me more, why do you need a database?

When anyone will send a message you'll save the content in a database with id. eg

{
    id: "1900000000000001",
    content: "Coco go go go",
    ts: Date.now()
}

Then when a message is Deleted or edited you can fetch the content with the id.
Note: Add a time / date field so that you can delete all the messages after a certain time.

tired panther
earnest phoenix
sage bobcat
#

One message removed from a suspended account.

tired panther
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
tired panther
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

wicked pivot
#

ok yes, good idea but I can't know when someone writes a message with web api

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

near stratus
# earnest phoenix

Normal verification will take a month + 2 months for intents so (All around me are familiar faces)

#

Also I can't read your language

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
sage bobcat
earnest phoenix
near stratus
#

Oh,
As I said I don't know what it says but
I have something similar pending

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

near stratus
#

@earnest phoenix

#

If you didn't apply for intents while submitting then you'll need to create another request like this

earnest phoenix
#

I can't run the auto role command because I can't open my bot's Intents

opal plank
near stratus
#

Set topic to "Privileged Gateway ...."

eternal osprey
#

hey how do i split a message.content into pieces? For example: !coins 2 check returns: !coins, 2, check in an array

earnest phoenix
opal plank
# earnest phoenix

your only chance to use intents after 76 servers is simply NOT turning your bot off

near stratus
opal plank
#

idenfitications prior to that will still recieve websocket events from the gateway

near stratus
#

since you didn't apply the first time

opal plank
#

i had to keep the bot running for over a month without shutting it down cuz it relied hevily on intents

near stratus
#

It'll take around 2 months btw

earnest phoenix
#

😦

#

I can't open my intentsss

#

I cant't

opal plank
#

@earnest phoenix read what i said

#

imagine asking and not paying attention to the asnwers

near stratus
earnest phoenix
#

@opal plank

near stratus
#

So we'll have to go on mobile > use Google lens > image to text > copy text > paste in Google translate > get the results

sage bobcat
#

One message removed from a suspended account.

crimson vapor
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

crimson vapor
#

o

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

crimson vapor
#

oh I see

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

near stratus
#

@crimson vapor
You have a dirty mind I see

sage bobcat
#

One message removed from a suspended account.

bitter badger
#

Are there any regex experts that can help? I'm trying to match anything except when there is a substring in the middle of a string. The string is only characters/numbers with no boundaries in the middle (no symbols or spaces).
I essentially want something like ABC.*(NOT_JKL).*XYZ but unless I'm missing something obvious, the best I could do was ABC((?<!JKL).)*(?<!JKL)XYZ

lyric mountain
#

NOT_JKL?

steep drum
#

do you need regex for this? just .includes to see if the substring is in there

bitter badger
#

ABCDEFGXYZ : Match
ABCJFU2XYZ: Match
ABCQSJKLCAXYZ: No match

lyric mountain
#

ok, so WHAT do you want to match?

#

like, the capture group

bitter badger
#

The line

lyric mountain
#

oh my

bitter badger
#

Yeah

lyric mountain
#

look

#

I eat lettuce
if I wanted to match lettuce my capture group would be lettuce

#

what's you capture group?

#

the text to search for

bitter badger
#

It's matching specific nodes from a config. It literally has to be done with a regex matching the whole thing. I can't do it any other way

#

The line could be
TheQuickBrownFoxJumpedOverTheFence
but if it's
TheQuickBrownFoJKLxJumpedOverTheFence I don't want it

lyric mountain
#

I get it u want to match something in any given text

#

but WHAT is the text to be found?

bitter badger
#

So in that case I'd want
TheQuickBrownFoxJumpedOverTheFence

lyric mountain
#

so you want to find if TheQuickBrownFoxJumpedOverTheFence is in a text?

bitter badger
#

It can be anything

lyric mountain
#

boi

bitter badger
#

To an extent of

#

ABC(SomethingIDon'tWant)XYZ

#

So if it's ABCXYZ

#

That's what I want

lyric mountain
#

so you want to remove a given text from another text?

#

<string>.replace("whatyouwanttoremove", "")

steep drum
#

They want to return false if a substring exists in the string, you don't need regex for that

worn sonnet
#

if i'm correct, this is the syntax for hyperlinks in embed
[Text Here](URL HERE)

quartz kindle
#

so this?:

njejjsjnndn
fjjfjjdnr
cjjrndnndJKLjjdnf
cjjdndn``` becomes```
njejjsjnndn
fjjfjjdnr
cjjdndn
bitter badger
#

But they're treated as single lines at a time

quartz kindle
#

so each line has the regex run on it again?

bitter badger
steep drum
#

i don't know what that means, aren't you the one telling it to use regex and what regex to use

bitter badger
#

I'm editing a config

#

I don't have control over the actual process

quartz kindle
bitter badger
#

I know it gives more examples but I think I tried them

quartz kindle
#

what are you actually using for the regex? grep?

#

or some built in regex engine inside a programming language?

bitter badger
#

I'm pretty sure it's actually being process as a Java regex

#

I didn't mean to make such a ruckus, I was just wondering if there was a fast and better solution than the one I had

#

I simplified it by just doing ABC(.(?<!JKL))*XYZ

opal plank
#

i wonder how people who dont know regex see this

#

wtf are they talking about, what is this

quartz kindle
#

mandarin

opal plank
#

ah yes

crimson vapor
#

regex kinda scary tbh

quartz kindle
#

it was invented by mathematicians so what did you expect

crimson vapor
#

arent most computer science ideas made by mathematicians

quartz kindle
#

methemeticians

crimson vapor
#

happy?

quartz kindle
#

wut

#

i wasnt pointing out your grammar

#

i was talking about drugs

crimson vapor
#

o

#

lmao

#

you got a good point tho

opal plank
#

mathematicathicicians

#

or maffs

opal plank
#

it always starts with "just a little sniff, it cant hurt"

#

then boom, ts addict

bitter badger
#

I just like regex because it feel like a brain teaser trying to find one that works that can hopefully be semi-readable

bitter badger
opal plank
#

see?

#

just one sniff

bitter badger
#

I'm on that hard shit now

opal plank
#

i feel ya brother

#

which library you use for your bot?

bitter badger
#

You mean Discord library?

opal plank
#

yup

bitter badger
#

I just use Discord.js with the types added

opal plank
#

come join the addicts club

#

use detritusjs

#

enjoy a fully typed lib

spare badger
#

How do you guys gather information and statistics about your bots like the amount of servers the bot is added to, the amount of users that interact with your bot... Is there any tool for that?

opal plank
opal plank
spare badger
#

@opal plank Looking into building something for the community for this.

#

Just making sure there is not already a solution

opal plank
#

@spare badger

#

i made my own

crimson vapor
#

stop

bitter badger
crimson vapor
#

no

#

stop

opal plank
crimson vapor
#

not again

opal plank
crimson vapor
#

idk man

opal plank
#

@crimson vapor can tell you

spare badger
crimson vapor
#

detritus is pretty good but its not as bloated as djs

opal plank
opal plank
#

you mean "unoptimized"?

#

"bloated"?

crimson vapor
#

sorry

#

fixed

opal plank
#

there we go

#

@bitter badger but yeah, take a look at that link i sent

bitter badger
#

What's the actual benefit of using it over djs if I think the state of the types are fine?

proven saddle
#

كسم منيكة هو لسا اوفلاين

umbral zealot
crimson vapor
crimson vapor
#

don't you dare link that message

opal plank
#

i already did u dork

crimson vapor
#

oh nvm

bitter badger
#

That just looks like a whole bunch of stuff I'd have to relearn. May as well switch to discord.py LUL

crimson vapor
#

why would you go to d.py?

bitter badger
#

I mean I wouldn't but I mean it'd be the same amount of relearning a new main library

crimson vapor
#

not really

#

you would need to learn the structure but most of the objects are exactly the same

cinder patio
#

You don't have to learn all of it at once

#

learn as u go

bitter badger
#

But I already have a full bot that'd have to be fully converted at once

#

Just seems like a lot for little gain

#

Maybe on new projects though

opal plank
#

in that little text i sent, you can see most stuff people want already implemented by the lib

hasty grove
#

Hello, do you know when the top.gg python API v1.0.0 will be available ?

opal plank
#

custom prefixes, ratelimiting, cooldowns, aliases, arguments, canceling a command, error handling, reloading

slender thistle
#

I believe this/next week

opal plank
#

told ya lib devs get pinged constantly, though usually thats me pinging

slender thistle
#

KEKW

quartz kindle
#

hue

opal plank
hasty grove
slender thistle
#

PyPi, yeah

#

v1.0 has been on GitHub for like months now KEKW

hasty grove
#

Ok thanks !

opal plank
#

peepee

slender thistle
#

just not stable

quartz kindle
#

pp

lyric mountain
#

pipe

opal plank
#

pp v1

quartz kindle
#

v1cm

ornate otter
#
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: libjpeg.so.8: cannot open shared object file: No such file or directory```
crimson vapor
#

hmm

#

wut

proven lantern
crimson vapor
#

rss or heapUsed?

proven lantern
#

i did a top command and looked at how much memory node is using

quartz kindle
#

nice

opal plank
quartz kindle
#

he did respond

#

he used top to check ram usage

opal plank
quartz kindle
#

are you trolling

#

linux `top´ command line task manager

opal plank
#

i said

#

theres

#

no

#

top

#

here

quartz kindle
#

wat

opal plank
#

yes

quartz kindle
#

are you trolling me and i missed the reference somewhere?

opal plank
#

htop >

#

ik what top is

quartz kindle
#

well then idk what ts is

#

:^)

opal plank
#

but that was a pick choice

#

did you use rss or heap

#

the reply was top

#

which idk what it displays

quartz kindle
#

implying you cant chose neither?

#

top displays rss

opal plank
#

theres what i was missing

quartz kindle
#

res = resident memory
rss = resident set size

opal plank
#

no u resident

quartz kindle
#

u resident evil

opal plank
#

u resident

#

erm

#

light

#

resident light

#

there we go

quartz kindle
#

wat

opal plank
#

good enough of a comeback

quartz kindle
#

why is your bot using 166% cpu

opal plank
misty sigil
#

166% cpu what

opal plank
#

u seen nothing

quartz kindle
#

you cant hide the evidence

opal plank
#

there is no such thing

misty sigil
#

how

opal plank
#

never happened

#

here be dragons

#

move along

crimson vapor
#

please show the screenshot

quartz kindle
#

cant hide from me

crimson vapor
#

thank you Tim

#

@opal plank fix your shit

opal plank
crimson vapor
#

no

#

not photoshop

quartz kindle
crimson vapor
#

because it is still cached

quartz kindle
#

probably ye

charred nimbus
#

anyone know how to make discord bot play an audio file from direct url .aac format in JS

delicate zephyr
#

100% = 1 core

#

htop records it as such anyway

quartz kindle
#

still my bot uses 3% of a single core, dafuq is he doing that uses 100% of one core + 66% of another core

snow urchin
#

Code works fine, but gives error? ye that makes sense?

stoic kernel
#

it does

#

correct code but wrong code at this part

snow urchin
#

wut...

astral seal
#

wait im confused what donatebot is

#

can I use it to set up premium features for my discord bot?

opal plank
#

shouldnt u be asking that in their support server?

astral seal
#

what

#

idk maybe

#

im tryna set up donations for my bot

opal plank
#

donatebot is a discord bot, you should ask there not ehre

astral seal
#

is it though?

opal plank
#

i think so yeah

astral seal
#

its a bot for servers

#

but it can also be used for something else i guess

snow urchin
proven lantern
snow urchin
#

no......

#

smh smh

#

the code runs fine, the function runs like normal, yet it says its not a function

earnest phoenix
#

runtime issues

proven lantern
#

promises are not functions

#

that's why i thought it might still be a promise

snow urchin
#

but

#

it

#

runs

#

smh

#

its just logging an error that doesnt happen

lyric mountain
opal plank
lyric mountain
#

Yep

opal plank
#

oh nvm then

lyric mountain
#

Felt awkward when I joined its support server and seen same staff from here there

#

Except there is dead af

rancid bobcat
#

Does anyone know what the best region to host a discord bot is? I'm not sure where the API is hosted

solemn latch
#

somewhere in the US

#

I think east coast US for text?
voice is located around the world.

rancid bobcat
#

Thanks, yeah I imagine there would be for those but I think as far as communicating with the API is concerned it'd have to be in one place right?

#

East coast sounds good, thanks for the info

solemn latch
#

all of the api is presumably in one location yeah.
the voice servers however are located around the world.

rancid bobcat
#

I don't plan to add any voice features to my bot anyway, it's mostly going to be text stuff so I'd rather get the best speeds for that

#

Not hugely important it's just I have the option to choose the location so I may as well try get as close as possible to discord's servers

solemn latch
#

honestly, doesnt matter too much.
if your getting under 200 ping the vast majority of users wont be able to tell.

#

its not like gaming where under 60 ping is ideal. some bots have 500+ ping, and the vast majority of users still wont notice.

rancid bobcat
#

True, again I don't think it makes that much of a difference but it costs me nothing to choose a closer location so I may as well

midnight blaze
#

hi, I was inactive for a while in bot programming..did something change with the new api v9?

lyric mountain
midnight blaze
#

what are ephemral

#

dude

#

buttons?

#

shit..

lyric mountain
#

like when u cant send a message

midnight blaze
#

I missed a whole shit

lyric mountain
#

wumpus send u a message

#

that only u can see

rancid bobcat
#

Wait I knew about the slash commands but not the other two

#

Oooooh very nice no more having to spam up chats or DM for help commands

lyric mountain
#

don't know if it's still in beta, but yeah

#

buttons will come

midnight blaze
#

what is so good about slash commands?

rancid bobcat
#

Auto completed commands

solemn latch
#

i dont think any users really like them

rancid bobcat
#

I can definitely see why they're useful but personally I'd rather just remember the command

solemn latch
#

at least, none of the bot reviewers seem to like them.

midnight blaze
#

wait, woo? didnt you do that bot that had that gif canvas command?

#

(shit..I really was away for too long)

solemn latch
#

yeah that was me

midnight blaze
#

nice

#

and now you are a mod 😮

solemn latch
#

yeah 👀

midnight blaze
#

:>

#

that is cool

zenith terrace
#
woo.ping()```
#

@solemn latch

lyric mountain
#

woo.peer()

midnight blaze
#

is flazepe a mod now?

solemn latch
#

nah

lyric mountain
#

flaz is a weeb

solemn latch
#

should be a mod then

#

👀

zenith terrace
#

why me not a mod then smh

#

why are you a mod Woo

#

wait mods get turned into weebs

#

thats right

solemn latch
#

yeah

#

i still havent watched any anime since becoming a weeb

lyric mountain
#

woo will become woowu

solemn latch
#

👀

zenith terrace
#

woowo

lyric mountain
solemn latch
#

wait this is development 👀

#

-bonk you two not me though, wasnt me at all making chat off topic

zenith terrace
#

still contributing to it

earnest phoenix
#

@everyone

dusky marsh
#

Should probably delete the message as well lol.

earnest phoenix
#

@rustic nova here too

rustic nova
#

lmao

spare badger
#

👋 What do you guys use to get statistics about your bots? Like how many connected servers, active users, messages per minute etc?

#

Any panels or npm packages?

opal plank
spare badger
#

@opal plank I am looking for input from other developers. Thank you for your input though

opal plank
#

if you expecting something easy to do, sorry to tell you, you likely wont find

#

statcord at BEST

spare badger
#

You didn’t listen why I was asking the question

opal plank
#

there isnt much though

spare badger
#

I’m looking into building something for the community to make it easy to get these insights.

opal plank
#

you can use ELK, google metrics, datahog perhaps

#

or statcord like i said

#

the other option would be a webserver

#

and a website

spare badger
#

I want to build an NPM / PIP package that just literally hooks into the discord dependency and does everything for you automatically.

opal plank
#

look up statcord

spare badger
#

I will thank you

opal plank
#

here

#

though in all honesty, kinda shit

spare badger
#

Okay yea looks pretty much exactly what I was planning. Will be trying it tomorrow to see how it performs.

#

Thanks!

opal plank
#

the issue with stuff like that is theres very little lee way

#

its main target is, if im gonna be blunt, people who dont know shit about code

spare badger
#

@opal plank I think not having to code that custom for every bot you make is also a nice thing right?

#

Saves time etc

#

If you just add some powerfull flexible tools through a nicely documented package I think it could work for a lot of developers

near stratus
spare badger
#

@near stratus Would you be interested in a tool that could hook into your application with a package so you don’t have to code a lot of the basic analytics for every project?

soft glade
#

so i have a rob command and for some reason if you rob someone you can take more money than they have...............is there a fix to it??

@client.command(aliases=['rb'])
@cooldown(1, 15, BucketType.user)
async def rob(ctx, member: discord.Member):
    await open_account(ctx.author)
    await open_account(member)
    bal = await update_bank(member)

    if bal[0] < 100:
        await ctx.send('It is useless to rob him :(')
        return

    earning = random.randrange(0, 1000)

    await update_bank(ctx.author, earning)
    await update_bank(member, -1 * earning)
    await ctx.send(
        f'{ctx.author.mention} You robbed {member} and got {earning} dollars')
livid compass
#

I cant seem to connect the code ik making to my bot

near stratus
livid compass
spare badger
#

Alright so customization and not having to pay is important in your case. Thank you for your input @near stratus

#

Thank you for the packages, will look into it.

opal plank
#

at that level might as well write an API to handle it instead of a package

spare badger
#

I think the package would really only support the absolute basics out of the box and you would then be able to pass it extra data like command uses etc by using functions inside the package that communicate with the API. Sure you could also use the API directly then I guess, but the package should make it easier.

#

Exactly like statcord does as I look through their documentation. Very curious how it works when I try it out tomorrow.

opal plank
#

but then comes the part where theres already something they use

#

unless you use detritus for example, which has a handler for commands built in, you wouldnt be able to properly do it in other libs

spare badger
#

Thats always the problem when you come up with a new solution

opal plank
#

since every has their own command handler

#

custom caching

#

theres a lot of variables into it that need to be looked

#

from messing with eris, djs and detritus, i can tell you its gonna be a nightmare