#development

1 messages · Page 1810 of 1

royal portal
#

you can use different ports

uneven fulcrum
#

all same error

#

i tried 3000, 5000, 9000, 2000

#

how do i see what ports are in use @royal portal

royal portal
#

try that maybe

quartz kindle
#

thats why it errors

uneven fulcrum
quartz kindle
#

somewhere in your code you open a server twice

#

or call listen() twice

uneven fulcrum
#

im using a vps

#

is it cuz of that?

quartz kindle
#

no

uneven fulcrum
#

here is my code

#

nothing is wrong with it

#

@quartz kindle

#

idk why it no work

quartz kindle
#

thats not your full code

royal portal
#

anyone

zinc wharf
royal portal
#

am cant do it cryangeryBOYE

errant flax
#

god my code is messy sad

sudden geyser
#

First time?

errant flax
#

nope

limber mica
#

So when using kurasuta sharding manager, how would I create the shard and direct it to the main file?

sterile holly
#
module.exports = {
    name: 'stop',
    description: 'Stop command.',
    execute(message, args, client, ymdhm){

        client.channels.cache.get('863932226714599464').send('🔴 Bot offline. `' + ymdhm + '`');
        console.log('Bot offline. ' + ymdhm + '');
        process.exit();
    }
}

I'm not getting any errors but the message to the channel is not sending

#

client.channels.cache.get('863932226714599464').send('🔴 Bot offline. ' + ymdhm + '');

#

this is not working

#

process.exit(); this used to be client.destroy and it would send a bunch of errors but now it doesn't

pale vessel
#

Try awaiting that send method. Your bot could be restarting before it even get to send the message

sterile holly
#

the console.log('Bot offline. ' + ymdhm + ''); works though

pale vessel
#

Because that's blocking

sterile holly
#

oh

#

and how would I await

pale vessel
#

Simply make your function async async execute() and add the await keyword to your send method(await client.channels.cache.get(...).send(...))

sterile holly
#

ok

#

thank

#

thanks

wheat mesa
#

I'm not sure if adding a status-changing command (without a cooldown) is a good idea. You're likely to get ratelimited, afaik the limit is 5 status changes per 20 seconds

earnest phoenix
#

client.user.setActivity('text-here', {
type: 'WATCHING (or whatever)'
})

#

yea

#

what

#

well if u want a custom prefix u should probably watch a video on how to amke one, theres a lot out there

#

ok

#

const act = message.content.slice("?change-status".length)

#

well i just gave u it

#

well u gotta watch a lot of videos then

#

mos tpoeple on discord wont be willing to teach u

#

just to help if u have issues

#

uh

earnest phoenix
#

if u say that, itll get rid of ?change-status

#

and itll set your status to that

#

if u do

client.user.setActivity(act, {
type: 'WATCHING'
})

#

thats really all u have to do

#

also i recommend making it so only u can change the status, otehrwise ur bot will be rate limited

#

uh

#

u dont need to set an interval

#

i mean u can

#

if u want

#

module.exports = async bot => {

const act = message.content.slice("$change-status ".length)

console.log(`${bot.user.username} is available now!`)

setInterval(() => bot.user.setActivity(act, { type: "WATCHING"}),5000)

};

#

u can change the type to whatever u want

#

PLAYING, WATCHING, LISTENING, STREAMING

#

it doesnt matter, it just gets the length of it

#

@earnest phoenix i just edited it

limber mica
#

Just a little tip, if you implement “listening to” or “ watching” into your sentence the activity looks a lot better

#

So smthn like “Listening to Upcoming’s coolness! | ?help”

#

Not possible sadly,

#

No problem!

long crow
#

Does if else do much faster than switch-case for Javascript? On like 20 expression/statements

vivid fulcrum
#

the margin is so small that it doesn't matter

#

use whatever's more readable

long crow
#

I'm more comfortable with if else, though the code look ugly with if else chain

mild agate
#

use switch for better readability / easier to edit for future if you have 20 cases

lament rock
#

If anyone is proficient at FFMPEG args, I need some help implementing filters into a rewrite of LavaLink I'm working on. I've already implemented some filters
you can view my project here:
https://github.com/AmandaDiscord/Volcano/blob/main/src/worker.ts#L317

LavaLink's filter definitions can be found here:
https://github.com/freyacodes/Lavalink/blob/dev/IMPLEMENTATION.md#using-filters

GitHub

A light-weight LavaLink compatible replacement. Contribute to AmandaDiscord/Volcano development by creating an account on GitHub.

GitHub

Standalone audio sending node based on Lavaplayer. - freyacodes/Lavalink

errant flax
#
let m = channel.messages.cache.get(args[0]) || await channel.messages.fetch(args[0])

how do i catch this while assigning the var

earnest phoenix
#

@errant flax put a .catch after fetch()

lethal trout
#

TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.

const client = new Client({
    partials: ["CHANNEL", "GUILD_MEMBER", "MESSAGE", "REACTION"],
    intents: Intents.ALL,
    allowedMentions: {
        parse: ["users", "roles"],
        repliedUser: true
    }
});``` 
I am trin out `npm i discord.js@dev`
pale vessel
errant flax
#

oh pd_pepethumbsup

long crow
errant flax
earnest phoenix
#

What is allowedMentions?

cinder patio
mild agate
#

Me: checks why is there no output
Code: return in promise but no resolve

errant flax
earnest phoenix
#

Does someone use repl.it i need help

slender thistle
#

Does anyone know your issue to be able to help you

earnest phoenix
#

The problem was fixed without me doing anything.

#

But I got this error several times there was typing
ERROR no such file or directory, open index.js but i dont have a file named as index .js

#

And i couldnt stop project

near stratus
earnest phoenix
#

Bot.js

#

I get this error when stopping the running bot

placid sluice
#

const client = new discord.Client({ disableMentions: "" }); this would disable pings on every server correct even if the bot had that permission or am i wrong about this

#

sorry not that but that settings

near stratus
#

that doesn't make any sense
anyway did you select bash or nodejs when creating the repl ?

earnest phoenix
#

Yes i did

#

My .replit file includes
Lang= nodejs
Run = node bot.js

left rain
#

How can u use quick.db in a hosting???

earnest phoenix
#

Did you put the " in your .replit file?

left rain
#

mine isnt working

#

tag me if you answer

earnest phoenix
#

So yes

#

But i typed without them bc i am lazy

#

@left rain which hosting service are you using?

left rain
#

hostcheap

#

euu no

#

hostways

quartz kindle
#

which operating system did you install?

left rain
#

wdym?

quartz kindle
#

or is it one of those pterodactyl panels

earnest phoenix
#

windows Linux macos what are you using

left rain
#
        throw e;
        ^

Error: /home/container/node_modules/better-sqlite3/build/Release/better_sqlite3.node: invalid ELF header
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at bindings (/home/container/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/home/container/node_modules/better-sqlite3/lib/database.js:9:24)
    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)```
#

windows

#

its pterodactyl

quartz kindle
#

lol

earnest phoenix
#

windows needs more stuff for quick.db/sqlite to run

quartz kindle
#

pterodactyl is not a real vps

left rain
#

but

#

how can i use it?

quartz kindle
#

you need to install sqlite in there

left rain
#

how???

quartz kindle
#

not copy paste the node modules

left rain
#

owh

#

but how can i install it?

#

this is the hosting

quartz kindle
#

ask them

#

or get a real vps

placid sluice
#

not trying to be an idiot but how do u get guild id from message.

near stratus
placid sluice
#

oh i was forgetting id like an idiot

earnest phoenix
#

Hello
anyone here
Who can help me and tell where to put a bots token in python?

crimson vapor
#

what the fuck did someone start selling pterodactyl discord bot hosting?

blissful spade
#

sure @earnest phoenix

#

client.run("YOURTOKEN")

on the end of the file

rigid jetty
#

Which is the best code?

placid sluice
#

Util.removeMentions(args[0]) if a bot just removed the ping but still does the at everyone is that bad should i just delete message completley or is it fine

near stratus
quiet pawn
rigid jetty
#

Hm

rigid jetty
quiet pawn
#

learn html and css

inner fulcrum
#

pm2 is kinda good for temp hosting i guess

quiet pawn
#

i used pm2 for my bot on vps

solemn latch
#

Why wouldn't pm2 be good for permanent hosting?

#

It's just a process manager

tired panther
#

How do you make a Bot with multiple Languages, Do you save the Lang-Data in a JSON File?

vivid fulcrum
#

pretty much

tired panther
#

uff

quiet pawn
#

or make dups of commands in different langos

#

worst idea

#

but yea

tired panther
quiet pawn
#

yes

boreal iron
#

As the format of an ini file is already perfect for this use case

quiet pawn
#

damn FakE nice tag

#

0037 damn

boreal iron
#

?

quiet pawn
#

i never seen a double number

#

in a non nitro tag

#

rare asf

boreal iron
#

This account is old, very old

tired panther
#

lol, I didnt changed my tag too

quiet pawn
#

makes semse

quiet pawn
#

its disabled now i gotta verify it with phone number at some point

vivid fulcrum
#

i sold an account from 2015 for 80 bucks

tired panther
#

lol

vivid fulcrum
#

should've sold it for a higher price

tired panther
#

👀 banned_sign_ban_hammer_bean

quiet pawn
#

breaking tos moment

dense flame
#

tos

#

lmao

vivid fulcrum
#

hahaha that was a jokje

dense flame
quiet pawn
boreal iron
#

as if anyone would actually read that trash or care about it okeh

quiet pawn
vivid fulcrum
#

there's actually people who have nothing better to do but report messages lol

boreal iron
vivid fulcrum
#

wannabe discord mods

boreal iron
#

I generally hate people too much to do something like that

#

But randomly banning accounts for no reason sounds funny tho

tired panther
quiet pawn
#

thats all tho

vivid fulcrum
#

yeah that's reasonable

quiet pawn
#

thats not even like a i dont want kids on here type thing its just because the amoutn of weird people on here probably best they arent on here

vivid fulcrum
#

exactly

quiet pawn
#

like probably for the best type thing

pure lily
#

Error fix? and yes this is an open source from Spiderjockey02
`/home/runner/Discord-Bot-1/src/utils/EgglordEmbed.js:14
const language = this.guild?.settings.Language ?? this.bot.config.defaultSettings.Language;
^

SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/runner/Discord-Bot-1/src/utils/index.js:2:9)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)`

cinder patio
#

You have an old node.js version

inner fulcrum
quiet pawn
earnest phoenix
inner fulcrum
#

oi what was the github link on the tutorial for top.gg api

quiet pawn
inner fulcrum
#

ah yes

rigid jetty
zinc wharf
#

Or if you want to go through the easy route, like me, buy Adobe XD, and then get the web export plugin

rigid jetty
#

Hmm

inner fulcrum
#

@rigid jetty just find a flipping html generator lmao

rigid jetty
#

Oo

vivid fulcrum
#

i wonder if web design curriculums are going to change with a preference for SPAs

#

since pretty much no one uses vanilla html/js/css nowadays

boreal iron
#

I do or still do and I don't see any reason to change that

earnest phoenix
vivid fulcrum
#

You need a website. Why not do it yourself? With Wix, you can create your own professional website. Choose from hundreds of templates. Whether you're a small business owner or an artist, we've got something for you. Just drag and drop to create your site exactly the way you want it. It's easy! Change your text. Choose one of our backgrounds or upload your own, and easily add one of our beautiful galleries. You can even set up an online store in seconds. With just a few clicks, you can connect your site to your favorite social media channels, and add popular Web apps and services, like Google Maps, Contact Forms, and so much more. Just like that, you've got your own stunning website, that is fully optimized for every device. Create your stunning website today. It's easy & free!

cinder patio
#

stunning

earnest phoenix
#

owo what happened to google web designer url

boreal iron
#

Those templates are all overloaded, horribly slowly and just for people who don't know how to build your site from 0.

vivid fulcrum
cinder patio
#

A lot of small companies use wix

earnest phoenix
#

i once saw a microsoft page that uses facebook's react

boreal iron
slender thistle
#

based

vivid fulcrum
#

SPAs are the future stitch_shrug

vivid fulcrum
earnest phoenix
#

wat

vivid fulcrum
#

i forgot which app on windows 10 uses react native

boreal iron
#

Even if they are my sites are still working, in any browser and mobile device

slender thistle
#

Cortana :^)

zinc wharf
cinder patio
#

Doesn't microsoft teams use electron w. react

vivid fulcrum
#

yup

#

actually i don't know if teams is electron or CEF

slender thistle
#

Cortana is scary

cinder patio
#

I read somewhere that it's electron

vivid fulcrum
#

well

#

just proves my point

#

SPAs are the future, almost everything is a web app now

#

discord, spotify, vscode

boreal iron
#

Well then I'm the last traditional website not being an app I guess, if so

vivid fulcrum
#

don't get me wrong there's a ton of other ways you can go, i.e. qt with wasm and shit like that

#

but SPA tech is in demand right now

cinder patio
#

yew 😩

eternal elbow
#

VoiceStateUpdate this event sometimes returns undefined and sometimes it doesn't work at all. What could be the reason?

boreal iron
#

Based on my logs of clients I still prefer to support even very old browsers (clients)

cinder patio
#

you can use webpack / typescript / babel to support pretty much any mainstream browser

boreal iron
#

Or simply rely on strict HTML 2 and CSS2

#

Doesn't mean I'm not using CSS3, too for fancy animations shit etc. (as people need that today), but if your browser doesn't support it, the website remains 100% functional

#

as well as the JS framework

#

Even with JS disabled the functionality still remains 100%

vivid fulcrum
#

you shouldn't need to continue support for old browsers though

#

old browsers are insecure and not up to today's standard

#

allowing them to access your site just encourages that behaviour

#

i straight up don't serve my app to IE users

boreal iron
cinder patio
#

You can tell em to use a modern browser

boreal iron
#

Anyways... there's no advantage or need for me at least to switch over to a different tech

#

That doesn't mean my sites are ugly or unresponsive... PHP as backend tech is more than fast enough

#

And I'm not really a good frontend creator anyways to make fancy and modern looking pages

earnest phoenix
#

Do I understand it correct that I only have to insert my top.gg token and it should work? I just started programming and am kinda stuck.

cinder patio
#

yeah

#

you should try to understand it tho

earnest phoenix
#

yeah I am trying but it doesnt seem to work

#

there is no error or anything

slender thistle
vivid fulcrum
slender thistle
#

Hey I'm not gonna judge if you're into that

feral aspen
#
cooldown.cooldowns.find((val) => val.id.toLowerCase() === "daily").timeout = 0;
cooldown.cooldowns.find((val) => val.id.toLowerCase() === "beg").timeout = 0;
cooldown.cooldowns.find((val) => val.id.toLowerCase() === "gamble").timeout = 0;
cooldown.cooldowns.find((val) => val.id.toLowerCase() === "work").timeout = 0;
cooldown.cooldowns.find((val) => val.id.toLowerCase() === "rob").timeout = 0;
cooldown.cooldowns.find((val) => val.id.toLowerCase() === "passive").timeout = 0;
cooldown.cooldowns.find((val) => val.id.toLowerCase() === "transfer").timeout = 0;

Any faster way to do this?

vivid fulcrum
#

what are you doing in the first place

slender thistle
#

That is uh

feral aspen
#

Getting all objects with the ids of daily, beg, gamble, etc... and get their property of timeout and make it equal to 0.

slender thistle
#

Yeah

vivid fulcrum
#

is cooldowns a map?

slender thistle
#

Can't you a for loop this

feral aspen
#

No. An array.

feral aspen
#

.. I'm also having a slight issue whereas sometimes cooldown.cooldowns.find((val) => val.id.toLowerCase() === "daily") may return undefined if it doesn't find it. (Not sure how to handle that).

cinder patio
#
const toBeErased = ["daily", "beg", ...rest];

for (const cooldown of cooldowns) {
   if (toBeErased.contains(cooldown.id)) cooldown.timeout = 0;
}
#

or

#
for (const cooldown of cooldowns) {
   if (cooldown.id === "daily" || cooldown === "beg" || ...rest) cooldown.timeout = 0;
}

but that can get cumbersome

feral aspen
#

Ah I see.

#

Alright.

#

Quick thing as well..

feral aspen
#

Is there a way to skip it if it doesn't find it?

cinder patio
#

The code I gave you fixes that as well

feral aspen
#

Ah I see..

feral aspen
vivid fulcrum
#

i also hope that you're checking for the user

#

otherwise you'll be setting everyone's cooldown to 0

feral aspen
#

I know. :)

#

I believe it's working.. fixing some errors here and there, and it's complete, thanks.

earnest phoenix
#

error plz help

vivid fulcrum
#

did you read the error

earnest phoenix
#

yes

vivid fulcrum
#

and you don't know why you're getting it because you copypasted code thumbsdownfrown

earnest phoenix
#

i dunno where is the code of err

vivid fulcrum
#

it tells you

#

read the stacktrace

#

if you scroll a bit down there should be a list of functions called and the locations

earnest phoenix
#

o

pure lily
#

(node:14520) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function at Function.normalizeFields (/bot/node_modules/discord.js/src/structures/MessageEmbed.js:450:8) at MessageEmbed.setup (/bot/node_modules/discord.js/src/structures/MessageEmbed.js:78:91) at new MessageEmbed (/bot/node_modules/discord.js/src/structures/MessageEmbed.js:18:10) at embedLikes.map.e (/bot/node_modules/discord.js/src/structures/APIMessage.js:166:40) at Array.map (<anonymous>) at APIMessage.resolveData (/bot/node_modules/discord.js/src/structures/APIMessage.js:166:31) at TextChannel.send (/bot/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:166:62) at Object.exec (/bot/src/commands/help.js:18:21) at Object.exec (/bot/src/listeners/message.js:15:31) at MusicClient.on.args (/bot/src/structures/MusicClient.js:61:58)

sudden geyser
#

Your node version is probably outdated

earnest phoenix
pure lily
# sudden geyser Your node version is probably outdated

root@somethingcp-6816://bot# sudo apt-get install -y nodejs Reading package lists... Done Building dependency tree Reading state information... Done nodejs is already the newest version (10.19.0~dfsg-3ubuntu1). 0 upgraded, 0 newly installed, 0 to remove and 70 not upgraded. root@somethingcp-6816://bot# node -v v10.19.0

#

lol

#

when i try to install latest it's just v10.19.0

sudden geyser
#

Try harder

vivid fulcrum
pure lily
vivid fulcrum
#

i guess

pure lily
#

😢

vivid fulcrum
#

uninstall the old version of node

#

apt remove nodejs

#

if it still doesn't work retry what you sent above

pure lily
#

@vivid fulcrum

#

finally

#

root@somethingcp-6816://bot# node -v v14.17.2

#

thanks

earnest phoenix
wary flame
earnest phoenix
#

I dont need this file bc

wary flame
#

/home/runner/tyrn-bot/index.js

earnest phoenix
#

And i didnt defined this file

wary flame
#

You're appently requiring it somewhere

#

Or using it as entrypoint

earnest phoenix
#

My bot project working on my desktop

#

Or glitch

wary flame
#

Then the file isn't imported into repl.it

#

You shouldn't use free hosting in the first place

earnest phoenix
#

I must bc of my country...

#

Vps are expensive

boreal iron
#

Does somebody force you to rent an expensive VM? Pick a cheap provider (even from a different country).

earnest phoenix
#

pay with paypal then

boreal iron
#

lol... how would that change the exchange rate

earnest phoenix
wary flame
#

Grab an old android phone and use termux

earnest phoenix
#

which country do you live,If I can ask?

#

Turkey

wary flame
earnest phoenix
#

I get this error sometimes

#

Not always

#

It fixes in a few hours by me doing anything

#
0|shard  | MongooseError: Operation `giveaways.find()` buffering timed out after 10000ms

Has anyone got this error when using mongoose?

wary flame
#

Seems like it can't query from database

#

Or too much data

tired panther
#

On Css, can a outline have a radius? so it can be rounded like a border?

tired panther
earnest phoenix
#

Yes

#

It got me this error on vps

tired panther
vivid fulcrum
earnest phoenix
#

@tired panther show what?

tired panther
tired panther
earnest phoenix
#
const mongoose = require ('mongoose')

mongoose.connect('mongo url', options)```
tired panther
#

and did you connected before you did the Operation?

earnest phoenix
#
mongoose.connect(config.mongo, {
  useNewUrlParser: true,
  useUnifiedTopology: true,
  useFindAndModify: false,
  useCreateIndex: true
})```
#

like this

tired panther
#

could you await the Operation, maybe this makes a Difference

earnest phoenix
#

await mongoose.connect ...?

earnest phoenix
tired panther
pure lily
#

`client.build();
^

TypeError: client.build is not a function
at Object.<anonymous> (/bot/index.js:4:8)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47
`

earnest phoenix
#

I mean it worked fine on my computer

#

but on the vps it was not

tired panther
hallow swan
#

hi

tired panther
#
mongoose.connect(config.mongo, {
  useNewUrlParser: true,
  useUnifiedTopology: true,
  useFindAndModify: false,
  useCreateIndex: true
}).then(e => console.log(e)).catch(e => console.log(e))
tired panther
hallow swan
#

yes

#

think

#

ur nick is do not thonk

#

so i thinked you

tired panther
tired panther
earnest phoenix
hallow swan
#

look at ur mongodb

#

thing

#

network

#

thing

#

idk i for got waht its called

tired panther
#

Whats the best for font-size: em, px or vw ?

earnest phoenix
boreal iron
#

Best is to disable all costum devices scales and stick to 100% as the local browser/device scale is always the best

tired panther
cinder patio
#

not really, em is relative to the font-size of the parent element afaik

#

You should use flexbox or a grid for dynamic box sizes

#

Or if you want a box to always be a certain size, then use px

earnest phoenix
#

okay maybe there server had issues

#

I think so too

earnest phoenix
#
const fs = require("fs");
const keep_alive = require('./keep_alive.js')
const { Collection, Client } = require("discord.js");
const client = new Discord.Client() // Your discord.js or eris client (or djs ShardingManager)
const { AutoPoster } = require('topgg-autoposter')


const client = new Client();
const ap = AutoPoster('Your Top.gg Token', client)
client.commands = new Collection();//Making client.commands as a Discord.js Collection
client.queue = new Map()
require('discord-buttons')(client)```
#

is this right

spare badger
#

Are you having an issue?

earnest phoenix
#

but no in consol log

spare badger
#

Show the error

earnest phoenix
# spare badger Show the error
const fs = require("fs");
const keep_alive = require('./keep_alive.js')
const { Collection, Client } = require("discord.js");
const client = new Discord.Client() // Your discord.js or eris client (or djs ShardingManager)
const { AutoPoster } = require('topgg-autoposter')


const client = new Client();
const ap = AutoPoster('Your Top.gg Token', client)
client.commands = new Collection();//Making client.commands as a Discord.js Collection
client.queue = new Map()
require('discord-buttons')(client)

client.config = {
  prefix: process.env.PREFIX
}

//top.gg consol 
ap.on('posted', () => {
  console.log('Posted stats to Top.gg!')
})```
spare badger
earnest phoenix
earnest phoenix
#

so can you tell is this codes right

spare badger
#

I'm not sure if it will work. You have to make sure all the files you require exist, all the required packages are installed and you have to fill in the right top.gg token.

earnest phoenix
#

@spare badger one dual const found

#

so want cn i do

spare badger
#

Remove the first const client = ... line

earnest phoenix
quiet pawn
#

how do i post custom server count to top.gg since the count my bot sends ia a couple off

#

and i cant figure it out

solemn latch
quiet pawn
#

nah

#

its always been like that

#

i jsut never really did anything about it

#

but i wanna try and fix it

solemn latch
#

its 2 off, shouldnt really matter.
but if you feel it needs to be corrected, whats your code look like?

quiet pawn
#
const ap = AutoPoster(`${config.topgg}`, client)


ap.on('posted', () => {
  console.log(`Top.gg Server Count Posted **(Server Count> ${client.guilds.cache.size + 2})**`);
})
#

its just that atm

solemn latch
#

hmm

quiet pawn
#

i looked

solemn latch
#

autoposter uses the sdk

quiet pawn
#

i cant figure it out thats why i asked

#

well i looked at the docs also

#

and cant figure out hot to post like "custom" server count

#

thats the doc i looked at

#

im guessing its mroe confusing then i thought

tired panther
quiet pawn
#

it says the "postStats" is not a fuction

#

when i do that

solemn latch
#


const api = new Topgg.Api('Your top.gg token');
await api.postStats({
  serverCount: client.guilds.cache.size,
  shardCount: 1
})
tired panther
#

Agree this should work

quiet pawn
#

just that or do i keep

ap.on('posted', () => {
  console.log(`Top.gg Server Count Posted **(Server Count> ${client.guilds.cache.size + 2})**`);
})
#

should i delete that part?

tired panther
quiet pawn
#

o

#

ill try it rn

earnest phoenix
#

I mean ofc you want the data to be overwritten if it changes

#

If it doesn't you aren't overwriting anything

#

You are just sending the same number.

solemn latch
#

ap is the autoposter

quiet pawn
#

api doesnt work either

#

i jsut changed

solemn latch
#

are you requiring the correct lib?

quiet pawn
#
const api = AutoPoster(`${config.topgg}`, client)

api.postStats({
  serverCount: client.guilds.cache.size + 2,
  shardCount: 1
})
#

ow ai

#

im dumb

#

i just

#

relooked

#

@solemn latch @tired panther Thank you for the help Panda_YAY

earnest phoenix
#

Why are you doing + 2 btw

plain talon
#

Fake numbers!!!!!

solemn latch
#

the stats are minus two on the listing

quiet pawn
solemn latch
#

so i am guessing trying to correct

earnest phoenix
#

Ah

quiet pawn
#

yea

#

its off 2

earnest phoenix
#

Why does it minus 2

quiet pawn
#

so i just + 2

earnest phoenix
#

that is weird

quiet pawn
solemn latch
#

its always a little behind because of cache

earnest phoenix
#

Ah I see

quiet pawn
#

if i go to invite page its 431 but on top.gg it shows 429

#

and anything else

plain talon
#

Is it consistently -2 ?

quiet pawn
#

i do it with my status also

quiet pawn
#

anything guild count

#

i have to do + 2

solemn latch
#

when you log your cached guilds size is it minus 2?

#

honestly, might just be the invite link page being incorrect, not top.gg or your bot.

lament rock
#

Map<string, Guild>.size = -2

quiet pawn
#

like

#

everything is -2

#

but invite page

#

it was only

#

-1 for a bit but then like last week it became -2

solemn latch
#

yeah that sounds like the invite link page being wrong

#

your actual count is whats being logged by the cache.

quiet pawn
#

well on my other bot its 100% fine

#

invite page and everything else is in sync

#

so you thik its just issue on discords side then?

#

also i use djs-light if that changes anything

solemn latch
#

it makes no sense for you to not have access to two guilds from your bot.

quiet pawn
#

yea

#

the -1 was every since i had the bot up

#

that was always a issue

#

since day 1

ocean haven
#

yo, anyone know a good way to use aliases for keys in a JSON?

lusty quest
#

does your json use dynamic data? if yes use a proper Database
if no Why not use a Proper Database?

ocean haven
#

lol

#

reading a local file is much faster, and I don't have a ton of data I need to save so a db is like using a grenade to kill a fly.

lament rock
#

The issue is still that that option doesn't scale well. If you shard, multiple processes cannot read/write at the same time. Your needs will most likely change down the line and JSON is not viable to scale.

Just because you don't have a lot of data doesn't mean you can't fuck up and corrupt the JSON.

ocean haven
#

Well, this is for a private bot, so I only have to worry about 1 server's use.

lyric mountain
#

imagine having a gigabyte-sized json db and a single misplaced commas fcking everything up

#

oh, and json in plain text files are very little compressed

ocean haven
#

wdym in plain text files?

#

as in, saved as a .txt?

lyric mountain
#

extension doesn't matter at all

#

plain text as in human-readable format

ocean haven
#

ahh

#

gotcha

lyric mountain
#

most dbs compress the data to allow much more information in a very little footprint

#

plain text doesn't

ocean haven
#

well I've been told that if I'm only storing small amounts of data, JSON is the way to go. I have a db for my other bot that holds a lot more info and I think the JSON works better for the mentioned function.

lyric mountain
#

json is merely a data exchange format

#

it's the way to go when you want to communicate with external sources

#

it's not really meant to be used for actual storage

#

unless we're talking about fixed data (as in, never or very rarely modified)

ocean haven
#

hm. I wonder why I was told that then. It was from a reputable programmer too..

copper cradle
#

who told you that

ocean haven
#

it's primarily fixed data. Admins can edit it, but it's an uncommon occurrence.

lyric mountain
#

any reputable programmer would abominate json dbs

lyric mountain
#

like, does the software modify the data stored in it?

#

or is it manual modification?

ocean haven
#

it can by a command, but it doesn't happen often at all.

#

it's been needed once in the past month.

lyric mountain
#

may I ask, WHAT are you storing in it?

#

guild data?

ocean haven
#

nope

#

just information for users

lyric mountain
#

per-user?

ocean haven
#

no

lyric mountain
#

global?

ocean haven
#

yeah

lyric mountain
#

why don't u use a properties format then?

#
property_1=bla bla bla
property_2=bla bla bla
property_3=bla bla bla
property_4=bla bla bla
property_5=bla bla bla
property_6=bla bla bla
property_7=bla bla bla
ocean haven
#

I guess I'm not familiar with properties.

lyric mountain
#

it's more lenient for syntax errors and won't kill your whole file for a single misplaced char

#

there are libs that make it really easy to read it, and you could also make your own parser which is no more than a line reader

#

basically, a properties file is composed by key-value pairs (like json), with each row representing a new property

ocean haven
#

I'll have to read into it. I don't understand your concern about a misplaced character though.

lyric mountain
#
{"id": 123, "name": "blablabla", "whatever": "anyway"}

is valid

#
{"id": 123, "name": "blablabla", "whatever": "anyway\"}

is not

#

the latter, when read will return [Object object]

ocean haven
#

hm

lyric mountain
#

if you save it BAM, file is dead

ocean haven
#

lmao

#

let me try it...

lyric mountain
#

happened a shitton of times around here, many dudes asking why their guild config files were all [Object object]

ocean haven
#

xd

lyric mountain
#

the funny thing is that no matter how hard you try, without constant backups your data is lost forever since you've ovewritten the data (making it unrecoverable by software)

ocean haven
#

your example didn't kill the file..

#

wait

#

wrong slash

#

we try again

#

nope, it didn't kill it

#

but it added a second \

lyric mountain
#

in that case it wont mess up because js won't even let you run

#

you need to do that on a separate file

#

then try to read the file from js and convert to json

#

it'll fail and return object object

#

or if you want a better testing experiment, add an extra " somewhere

blissful frost
#

How can i create a command, in which if a user sends any number between 1-5 , So bot sends same number of emojis?
Please Help

lyric mountain
#

"same number of emojis"?

#

you mean 1️⃣?

blissful frost
#

like if someone type 2
then bot sends two smileys

earnest phoenix
#

In the same message?

lyric mountain
earnest phoenix
#

There is a repeat method

#

tf

blissful frost
lyric mountain
earnest phoenix
#

That is handy

blissful frost
#

as i am new in js

earnest phoenix
#

The example is there

#

tf

#

As simple as it gets

lyric mountain
#

there's even a testing box there

earnest phoenix
#

Yea

#

MDN is what I use to quick test js stuff

mild agate
#

Js got a lot of inbuilt functions

earnest phoenix
lyric mountain
lyric mountain
earnest phoenix
#

Lol

#

node terminal: am I a joke to you?

boreal iron
#

chrome devtools: am I a joke to you?
Imagine using a Google browser KEKW

earnest phoenix
#

Doesn't every browsing engine pretty much use google

lyric mountain
#

all except mozilla iirc

#

oh and safari, but we don't talk about him

earnest phoenix
#

Mozilla uses google

#

At least it does for me

lyric mountain
#

mozilla use their own engine

#

gecko

earnest phoenix
#

Are we talking about firefox

lyric mountain
#

ye

earnest phoenix
#

yea firefox uses google as the search engine for me

boreal iron
sudden geyser
#

Yeah you're probably talking about search engines

boreal iron
#

A search engine isn’t a browser engine lol

earnest phoenix
#

Browse and search mean the same thing to me mmLol

signal estuary
#

Hey, I want to make a dashboard for a discord bot.
I already set the page up and the login button but now I dont know further.
How can you authorize the client with a bot and how to get data from this user?

boreal iron
#

Best thing u can do is block any Google service, Facebook and all trash network wide

earnest phoenix
runic depot
#

and then check if user exists, login it in, if not create then login it in

earnest phoenix
#

What

#

No

#

Not at all

runic depot
#

or you can get

#

discord id

#

...

earnest phoenix
#

That is purely useless

#

Discord has oauth2 flow for a reason

#

Its so you can make requests based on the scopes provided on their behalf

#

So you can get the guilds the user is in, their email, etc

#

And its far more secure

#

cause they have to authorize the connection before it even allows them to login with their discord account on your site

lusty quest
#

just use oAuth, it will not break if someone changes the username

runic depot
#

they send a access token to you

#

and you can get email and .. with that token

earnest phoenix
#

Which you can use to make requests on their behalf yes

runic depot
#

or guilds and ....

runic depot
earnest phoenix
#

What you said is useless when oauth2 exists

runic depot
earnest phoenix
#

Why though.

#

Why save the info in a db

#

when it can update

#

Just use the data gotten from discord when you make a request with the access token

#

and update said data when using an refresh token if its changed or expired

lusty quest
#

if you want to make your life easier, dont store any userinformations that are sort of critical, you dont want the lawsuite of it when it backfires.

earnest phoenix
#

^

#

Let discord handle that

#

Dont take that kind of stuff into your own hands when discord does it for you

#

and gives you a way to do it

sudden geyser
#

does discord even enforce that

#

sounds like something just to scare people

earnest phoenix
#

Uh

#

I mean

#

Yea

runic depot
lusty quest
#

not Discord, but possible individuals that gets theyre informations leaked

earnest phoenix
#

Probably not discord

#

but people that get their info leaked ye

runic depot
#

when use logs in, you update the data

earnest phoenix
#

What

signal estuary
runic depot
lusty quest
#

i dont get why you would reinvent the wheel for logins, if you could just add a oAuth flow, wich handles most of the important stuff

earnest phoenix
#

or do it yourself and use the oauth2 docs

lusty quest
#

do you make a dashboard for a Discord Bot?

earnest phoenix
#

You are making a dashboard for a discord bot

#

What is independent about that

#

You need the info discord supplies

#

and the way you are saying it is you are getting the info from discord in the first place and just storing it anyways.

runic depot
earnest phoenix
#

So why not just use oauth and get it over with

signal estuary
runic depot
#

i had many ways for logging in, because of that i just get the unique data from that platform

earnest phoenix
lusty quest
weak skiff
#

i want to use top.gg API to fetch weather user has voted or not how can i do this

still surge
#

How to Import any project from repl to Vs

drifting wedge
#

hey

#

can anyone help me publish a package to pypi?

#

its saying 403 wrong credentials

slender thistle
#

Suffering with it too

#

I see

#

Actually I don't remember how I fixed it ngl

earnest phoenix
drifting wedge
#

yeah

#

i tried account details and api key

#

none work

earnest phoenix
#

token or user-pass?

drifting wedge
#

i tried both

#

also i never made a test.pypi account though

#

do i need to?

earnest phoenix
#

You prefixed pypi-.. in token?scoop

drifting wedge
#

yes

#

ok so lemme try again

#

what do i put for username?

#

0Exe or __token__?

earnest phoenix
earnest phoenix
drifting wedge
#

ok

#

and passowrd is the api key

earnest phoenix
#

Yeah

drifting wedge
#

can i copy paste it?

earnest phoenix
#

Ig so, check if it's prefixed with pypi-

drifting wedge
#
Invalid or non-existent authentication information. See https://test.pypi.org/help/#invalid-auth for more information.```
#

it is

quartz kindle
#

pypy, aka: pp

drifting wedge
#

this is actual torture

#

halp

#

any more ideas?

#

i dont get why its being dumb

raw roost
earnest phoenix
#

that's what I found in the docs

drifting wedge
#

i wanna publish on stable

#

obviously

#

so what do i do/

#

whats the point of the test branch lol

earnest phoenix
#

I mean

#

test.pypi...

#

I chose the easy way to do this... Using Github Actions

slender thistle
#

It's... a test environment

drifting wedge
#

wait

#

it went

#

omfg

#

pog

slender thistle
drifting wedge
#

wat

#

wait tho

#

pog

#

it worksss

#

😎

earnest phoenix
slender thistle
#

That's a rather unique name but congrats fren

drifting wedge
#

wait the name is -0exe?!

#

shit

slender thistle
#

Kekw

earnest phoenix
#

Wait you can have packages without setup.py? potatothink

drifting wedge
#

i did setup.cfg

earnest phoenix
slender thistle
#

Technically yeah I believe

#

Might be a pain to do it without it but

#

If it's possible

#

It is possible.

earnest phoenix
#

It isn't ig

#

You need a setup.py file that installs the package right..?

drifting wedge
#

shiv

#

can i change the project name

earnest phoenix
#

Try installing and using it once

drifting wedge
#

cuz i fucked it uo

slender thistle
#

You'll have to reupload it iirc

drifting wedge
#

ah

#

so i delete it

#

and redo it?

slender thistle
#

Pretty much

#

Yeah

earnest phoenix
#

I prefer trying installing it once in a venv and test it

slender thistle
#

Since dblpy isn't deleted I can tell that you can't rename a package

pale vessel
#

member.displayHexColor?

drifting wedge
earnest phoenix
#

displayHexColor is a thing on member

#

also that is black

#

#000000 is black

#

#fff is white

slender thistle
#

It's white because of your theme

earnest phoenix
#

It probably isn't using your top role

earnest phoenix
#

hoist role?

#

The role that shows on the side?

#

So the top role

pale vessel
#

It should be displayHexColor

earnest phoenix
#

well ig maybe not the top

pale vessel
#

Dunno why it doesn't work

earnest phoenix
#

What lang are they using

#

d.js?

onyx steeple
slender thistle
#

Role caching?

pale vessel
#

It's your highest role that has a color set

earnest phoenix
#

Bruh

pale vessel
#

Highest role? Then member.roles.highest.hexColor

earnest phoenix
#

yea

pale vessel
#

IIRC

earnest phoenix
#

You are correct

#

I think

#

Lol

#

What the heck

#

Is that a problem with your code or just d.js being weird

slender thistle
#

That might explain it

pale vessel
#

If you want the hoist role color it's supposed to be member.displayHexColor

#

Otherwise that

slender thistle
#

Arrow keys ftw

#

Aw L

earnest phoenix
#

you use DBM

slender thistle
#

It works is a bit of a bloat term to use in this particular scenario

earnest phoenix
#

right

crimson vapor
#

2 seconds???

#

why in the fuck are you so fucking toxic?

#

insults someone's reading ability
"now I remember why I blocked you"

#

like

#

chill

earnest phoenix
#

Rude

crimson vapor
#

im replying for reference, not to fucking ping you

earnest phoenix
#

Its annoying

sudden geyser
#

Neither of you need to argue

crimson vapor
#

because I don't need to ping you WaitWhat

earnest phoenix
#

Because you are pinging them when they dont want you or need you to

sudden geyser
#

You should also get used to people not mentioning you, as it's in good faith

crimson vapor
#

like what

#

throw a fit

#

cry about it

earnest phoenix
#

Doesn't matter what you want

crimson vapor
#

and I want you to shut the fuck up
we don't always get what we want

#

ok

pale vessel
crimson vapor
pale vessel
#

I usually don't like minimodding but he's just fucking obnoxious

sudden geyser
#

how about just blocking him

pale vessel
#

I did, but if he's being like that to everyone else too, I don't know what to say

earnest phoenix
#

Its not really that funny

#

You were toxic cause they didn't ping you

crimson vapor
#

its fucking annoying

earnest phoenix
#

They probably did it out of respect

#

cause it wasn't that important to the situation

boreal iron
#

He generally is… you shouldn’t care about that too much

crimson vapor
#

but telling everyone to "cry about it" isnt?

earnest phoenix
#

You are the one kid no one likes at school

#

you probably eat alone

drowsy crag
#

eyes

earnest phoenix
#

Almost as if people aren't slowly going back to school

#

Omg no way

sudden geyser
#

There are going to be things you won't like that society imposes, and a user disabling a mention should be the last thing to complain over.

earnest phoenix
#

No shit really

#

Can't pull a fast one on you huh

drowsy crag
#

you guys really are just fueling whatever argument is going on

earnest phoenix
boreal iron
#

development is always weird

earnest phoenix
#

I don't even know em but I dont like em already

crimson vapor
#

true

drowsy crag
#

then ignore him

crimson vapor
drowsy crag
#

things are being dealt with

earnest phoenix
#

Alrighty nom

cursive ridge
#

guys the css looks great on my bot page but the same css doesn't work on my server page

#

it just shows all the tags

ebon gale
#

wym

cursive ridge
#

I'll show a picture

ebon gale
boreal iron
#

Make sure the property names are the same

#

aka. as class names

cursive ridge
#

bot page:

#

server page:

#

exactly the same

earnest phoenix
sudden geyser
#

markdown notlikePika

ebon gale
cursive ridge
#

just with tables

earnest phoenix
#

Its in the second image

#

see if you can use the source code

ebon gale
earnest phoenix
cursive ridge
#

the source code of the first?

ebon gale
cursive ridge
tame kestrel
cursive ridge
#

oh

#

so the discord server listing description doesn't use css but markdown

tame kestrel
#

it can use html or markdown whatever u want

cursive ridge
#

its not working

#

this:

<tbody>
<tr>
<td>bal, balance, stat or stats</td>
<td>Verify your balance as well as other stats such as case points, amount spent, etc.</td>
</tr>
<tr>
<td>daily</td>
<td>Claim a certain amount of money each day.</td>
</tr>
</tbody>
</table>```
#

just shows exactly that, not a table, and this is only for the server description, on my bot's description, the same code works fine

earnest phoenix
#

tr is tablerow and td is table description just so people know

#

That is how I remember how tables work

cursive ridge
#

found a html to markdown converter

#

but I'm pretty sure the server listing part of the site doesn't support html

boreal iron
#

Does the server page even support to use html?

cursive ridge
#

I don't think so

#

it supports markdown though

boreal iron
#

Well then a html table won’t be parsed to actual html

cursive ridge
#

exactly

#

but they told me it did

boreal iron
#

Never believe what “they” say okeh

#

It will always receive the event if it’s online and in the guild.

#

*events

#

If you somehow fear aggressive spam define a limit and leave the guild if it’s been reached

#

A simple timer added to cache with the last sent message timestamp will allow you to calculate the difference between it and the new message which can be at least a simple “rate limiter”

#

I haven’t understand one word but bots don’t magically assign roles

#

Only if you use copied code and features you don’t understand

#

But as I mentioned preventing spam only works if you leave the guild
That’s the only way to not receive tons of message events for example anymore

#

At least the only way that comes to my mind atm

plain talon
#

hey does anyone know what color type discord returns role color as? (example 15277667)

prime mist
#

Discord use HEX for colors.

#

0xffffff is white for example.

boreal iron
#

But I think spam won’t be an issue anyways as Discord is limiting the messages to send anyways

plain talon
#

this is my response from the api

#

that is not hex

prime mist
#

Well, hex is just an integer at the end of the day.

plain talon
#

yes i want to convert it to #xxxxxx for css use

prime mist
#

number.toString(16)

plain talon
#

yea nice purple

#

thanks guys

prime mist
plain talon
#

perfecto

drifting wedge
#

I made a python package, what should I do in the init file?

wheat mesa
#

If I'm hosting my bot on my pc, how can I see how much RAM it's using? Using the debugger in VSC to host temporarily.

vivid fulcrum
#

task manager

wheat mesa
#

Yes, but that shows how much ram vsc is using along with it

vivid fulcrum
#

the node process should be detached from vsc

#

go into the details tab

wheat mesa
#

Ah, found it

vivid fulcrum
#

you're going to see node.exe processes

wheat mesa
#

I'm assuming it's this process

vivid fulcrum
#

more than likely

wheat mesa
#

Dang, 114mb for only 10 servers with 100 users cached

#

I'll have to test how that scales ig

earnest phoenix
pale vessel
plain talon
#

Will do, thanks!

pale vessel
#

👍. It's because colors like 0x032abc will return 32abc if you use toString(16)

green kestrel
#

hmm, nearing 1000 questions in the triviabot queue now, thats insane

#

i never thought i'd see the day when the bots question queue became as nuts as a bot lists bot queue

lyric mountain
#

Tha Noscum

crude egret
green kestrel
#

its a list of new questions that people have submitted for the bot to ask in trivia games @crude egret

#

each has to be vetted by a human

clever agate
#

My bot has a verified seal, but I wanted it to be next to the username, not like this:

green kestrel
#

we've usually had maybe 200 a day

#

but this is nuts

crude egret
#

Ohhhh. So your bot is a trivia bot that people can submit questions to, that you can then accept/deny?

green kestrel
#

yes

crude egret
#

That is awesome

green kestrel
#

i thought the mod team was big enough... guess not any more and i'll have to recruit again

clever agate
green kestrel
#

problem is burnout, people get bored after a bit

latent heron
#

since most moderator positions are voluntary in terms of labour, treating it like a small gig/job would act as a form of incentive for people to want and continue doing it

#

otherwise it's really just for the meaning of the position/status that keeps them going, wouldn't it?

green kestrel
#

yeah

#

if i pay money or any kind of thing of value, that makes things majorly complicated

#

as im taking money to run the bot, that basically makes me an employer in the uk and makes me applicable to a ton of laws and regulations i definitely dont have time for or money for (costs money to make sure youre compliant, especially with remote foreign workers)

lyric mountain
#

Website + websocket/http requests

#

Websockets are better if you want to make real-time bidirectional updates

#

If you just want a simple dashboard, http will be the easiest

errant perch
#

anyone good with really basic html?

#
        <div>
            <input type="text" id="searchField" placeholder="place holder text"></input>
            <button onclick="myFunction()">Search</button>
        </div>

        <script src="https://unpkg.com/axios/dist/axios.min.js">
            async function myFunction() {
                console.log(`fard`)
            }
        </script>
#

it says myFunction is not defined

mild agate
#

oof... shift the function in another script tag...

errant perch
#

i fucking hate html

#

thanks

lament rock
#

axios

pale vessel
#

no

#

I agree

#

All my homies use const https = require('https');

https.get('https://encrypted.google.com/', (res) => {
console.log('statusCode:', res.statusCode);
console.log('headers:', res.headers);

res.on('data', (d) => {
process.stdout.write(d);
});

}).on('error', (e) => {
console.error(e);
}); /s

lament rock
#

I was unironically thinking of using http in my lavalink rewrite since centra seems to be having some issues in some edge cases

#

better yet. Write raw HTTP requests myself

#

I had to write raw http before. Not fun...

earnest phoenix
#

Wtf did my teacher just say:
A group of 16 bytes is called a word/vault

#

They mean 16 bits? Cuz WORD's a windows term for unsigned short.

#

we were talking about plain bits
no os specified

latent heron
#

i mean more importantly

#

why is that being taught

copper cradle
#

well, one of my friends had some random binary text written in his notebook

#

god knows why

earnest phoenix
latent heron
#

👀 recording a video highlighting numerous flaws in PHP, pros and cons and general existence

wheat mesa
#

I think the thumbnail is plenty

stable eagle
sly sierra
#

php
sucks.
here's why.

latent heron
#

TCD server