#development

1 messages · Page 1705 of 1

neat beacon
#

k just a sec

quartz kindle
#

now that discord supports code viewing for large files

earnest phoenix
#

oh yeah true

neat beacon
quartz kindle
#

looks fine

#

what about the kick file?

neat beacon
#

aight just a sec

#

Got from those free-to-use github commands

earnest phoenix
#

yeah dont copy and paste code

neat beacon
earnest phoenix
#

so the issue is the file couldn't be located, you'll have to redirect it to where the file is located

neat beacon
#

Oh wait i think i know wheres the problem

#

yeah

#

Its at the style of the github file

#

aight ill fix it and test, thanks!

quartz kindle
#

that kind of code is not copy-pastable

#

it depends on other things that you dont have

#

code is often made specifically for a given situation

neat beacon
#

oh

#

then rip

quartz kindle
#

copying it and applying it in a different situation with a different set of code will never work

earnest phoenix
#

that's why it's suggested to not copy and paste

#

but if you still want to do that, at least adapt to your code structure

neat beacon
#

Well time to have headaches trying to make my own code

#

Thanks again

earnest phoenix
#

keep learning and the process will keep getting smoother

neat beacon
#

I'm back again, just to say i found the commands doing the whole problem, deleted them and im going to make the command again

opal plank
#

@neat beacon you using discord.js?

neat beacon
#

Yea

opal plank
#

was wondering cuz your structure is similar to what we use for detritus.js

neat beacon
#

Oh lol

#

Yeah pretty similar 👀

opal plank
#

you wouldnt be interested in joining our cult, right?

quartz kindle
#

a bit too early for that dont you think?

opal plank
#

the early bird gets the worms

#

ina ll honesty

#

the only issue is typescript

#

i find detritus a lot easier for noobs to use than d.js

quartz kindle
#

and basic knowledge

#

lmao

opal plank
#

well, that too

#

but its mainly because you dont have to do most of the work

#

it has it already done for you lmao

quartz kindle
#

it does everything for you

#

but without explaining how or why

opal plank
#

properly*

quartz kindle
#

xd

opal plank
#

you make it sound like the end result will change

#

users from d.js will simply copy shit code from stackoverflow instead

#

much rather have a lib with competent devs and code do the same function for you

quartz kindle
#

yeah and where are they gonna copy code for detritus from?

opal plank
#

in the end the user wont even bother reading what they're copying

lament rock
#

People don't learn if they aren't exposed to pain and suffering

opal plank
#

thats the thing

#

its built in already

#

no need to copy

#

just call the function

quartz kindle
#

but people dont know how to call functions

#

:^)

lament rock
#

function.call :)

long crow
#

people cant really rely on autocomplete all time

quartz kindle
#

Function.prototype.call(myfn, null, args)

opal plank
#

you just put () in stuff, no?

lament rock
#

imagine modifying Function.prototype

#

pain ensues

opal plank
#
run this function pls, kthxbyecya () {
  channel.send('hi')
}
long crow
#
i = i ? i < 0 ? Math.max(0, len + i) : i : 0;```
#

(╯°□°)╯︵ ┻━┻

quartz kindle
#

wat

long crow
#

well, yeah that was my first impression on it

sturdy dock
#

If I wanted to send a message using d.js and delete it a certain time later using .then(msg => msg.delete what's the max amount of time that would work?

opal plank
#

await for the message to be sent

#

then start a timeout

#

before you delete, check if the message is still cached, if not, fetch it

sturdy dock
#

is there a functional limit to the timeout?

opal plank
#

what

sturdy dock
#

how long can the timeout be max

opal plank
#
setTimeout(() => {}, time/*(in ms)*/)```
#

i guess MAX_SAFE_INTEGER would be your max

#

but why would that matter?

#

unless you plan to delete the message after a couple dozen years, you wont have a "max timeout"

sturdy dock
#

ah i see

#

thanks

opal plank
#

np

#

also

#

try to use await

#

instead of chaining then

sturdy dock
#

just await the message send to return and then start the timeout right?

fossil niche
opal plank
#

that would work, yes

sturdy dock
#

gotcha thx again

opal plank
#

it would actually be better for you to send a raw request in all honesty

#

cuz otherwise if the message isnt cached, you'll have to fetch it

#

cuz d.js

tacit sequoia
#

I love trying for 30 min to get a server owner DM working only to realize it didnt work cause of Priveleged Intents not being enabled -.-

opal plank
#

imagine having methods that dont require stuff to be cached

#

@sturdy dock

#

thats not d.js btw, its detritus.js

sturdy dock
#

👀

opal plank
#

better lib to use than d.js

sturdy dock
#

i use d.js-light

#

makes it slightly more bearable

opal plank
#

detritus > d.js

#

just saying

fossil niche
opal plank
sturdy dock
#

honestly kinda shit at js to begin with so i'm still working on the basics 🥴

opal plank
#

would you like to hear more about our lord and saviour, detritus.js?

sturdy dock
#

but yeah idk if i'll stick with djs once my bot grows some more

tacit sequoia
#

I'll look into detritus

opal plank
#

here

#

read this little resume i put

tacit sequoia
#

Is it more memory-efficient? Just curious

opal plank
#

accoridng to @crimson vapor , yeah

#

he was testing all the libs memory wise

#

eris, d.js, d.js light, detritus and rose iirc

crimson vapor
#

huh

opal plank
#

post your findings

crimson vapor
#

idfk where the paste is

opal plank
tacit sequoia
#

Yesssss

opal plank
#

nvm found it

crimson vapor
#

ok that

#

yea

#

discord rose by nature will be best for memory efficiency

#

however, you do most shit yourself

tacit sequoia
#

Ew, I want shit done for me 🥴

opal plank
#

read that ass wall of text

#

here

crimson vapor
#

both libs are similar in that manor

opal plank
#

i point out a lot of the good things about it

crimson vapor
#

ex. message collectors

tacit sequoia
#

Looks really sweet

tacit sequoia
#

Are there any template bots in .js? Just curious as thats what I currently understand, want to see the difference

opal plank
#

i would highly recommend using ts instead

#

anything js is valid ts

tacit sequoia
#

Yes, as ts compiles to js

#

Just curious

opal plank
#

just set the configs to be lax and you good to go, but you will still get the intellisence and error catching in your IDE beforehand

#

it'll basically be js with extra features

#

you dont necessarily need to use ts

tacit sequoia
#

I'm not worrying, chill. Looks really cool 😁

opal plank
#

just letting you know cuz a lot of people see typescript as a monster

#

its highly customizable, so, its on you how "harsh" it is

tacit sequoia
#

Only reason ts looks scary/annoying to me is I have to declare var types 🥴

thick nexus
#

can you change the discriminator of bot

#

am dum

tacit sequoia
thick nexus
#

ook

austere zealot
#
@welcome.command()
async def disable(ctx):
    async with asqlite3.connect(db_path) as db:
        async with db.cursor() as cursor:
            await cursor.execute(f"SELECT enabled FROM welcome WHERE guild_id = {ctx.guild.id}")
            result = await cursor.fetchone()
            sql = ("UPDATE welcome SET enabled = ? WHERE guild_id = ?")
            val = (False, ctx.guild.id)
            await cursor.execute(sql, val)
            await db.commit()
            await ctx.reply("Welcome message disabled!")

i made this disable command but it wont work. plus no errors

#

help would be appreciated

twilit geode
#

oop, it died

rustic nova
#

that error doesn't help

#

full error please

twilit geode
#

I dont need help

#

im just saying

#

kinda funny

sage bobcat
green kestrel
#

well thats my first all nighter for a long time

#

and i finally got my lib sending voice

#

admittedly it sends white noise, because i really cba to write code to send it a wav... but it works

jagged surge
#

anyone at all?

#
dblpy = dbl.DBLClient(client,
                      gg_token,
                      webhook_path='/dblwebhook',
                      webhook_auth='epictog',
                      webhook_port=6500,
                      autopost=True)

@client.event
async def on_dbl_test(data):
    print(data)

@client.event
async def on_dbl_vote(data):
    print(data)```
#

ip is public

umbral zealot
#

And what happens when you test it? What's the issue?

jagged surge
#

@umbral zealot

#

nothing happens

#

thats my issue

umbral zealot
#

do you get an error in console maybe with the test feature?

jagged surge
#

it is supposed to be public ip right?

#

nothing at all @umbral zealot

umbral zealot
#

yes, that URL should be completely public

jagged surge
#

perhaps my webhook path should be the same as webhook url?

umbral zealot
#

as in it should be accessible from outside of your local network

jagged surge
#

@umbral zealot

#

yeah that shouldnt be a problem

umbral zealot
#

please stop pinging me I'm literally here looking at it

jagged surge
#

sorry, its become a habit

umbral zealot
#

A very obnoxious one

#

Where did you get that code, it doesn't correspond to the official top.gg lib docs

jagged surge
#

@umbral zealot

#

oh shit

#

sorry

#

but i have copy pasted the code from therte

umbral zealot
#

The hell is "therte"

#

you mean there?

jagged surge
#

my vsc

umbral zealot
#

Because if that's what you mean, that code looks hella different from what you have

jagged surge
#

yeah no now ive changed it

#

this is my code in a cog

#
import dbl
import discord
from discord.ext import commands, tasks

import asyncio
import logging

class TopGG(commands.Cog):
    """Handles interactions with the top.gg API"""

    def __init__(self, bot):
        self.bot = bot
        self.token = 'dbl_token' # set this to your DBL token
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)

    # The decorator below will work only on discord.py 1.1.0+
    # In case your discord.py version is below that, you can use self.bot.loop.create_task(self.update_stats())

    @tasks.loop(minutes=30.0)
    async def update_stats(self):
        """This function runs every 30 minutes to automatically update your server count"""
        logger.info('Attempting to post server count')
        try:
            await self.dblpy.post_guild_count()
            logger.info('Posted server count ({})'.format(self.dblpy.guild_count()))
        except Exception as e:
            logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))

        # if you are not using the tasks extension, put the line below

        await asyncio.sleep(1800)

    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        logger.info('Received an upvote')
        print(data)

bot = commands.Bot(command_prefix='tt')

def setup(bot):
    global logger
    logger = logging.getLogger('bot')
    bot.add_cog(TopGG(bot))
#

oh nvm

#

still nothing i forgot to change the dblpy things

umbral zealot
#

alright so at this point, how's it looking? did you make sure to change your port and password?

jagged surge
#

yeah i forgot to do that, i did it, still doesnt work

umbral zealot
#

so if you open the dev tools (F12) and then click test, there's no error here?

#

If so... then I guess you're the victim of this particular site issue.

#

But that's servers not bots so... I dunno

jagged surge
#

wait let me check

earnest phoenix
#

I need help

#

Cn any one help how make a bot website

velvet bane
#

and how to make my bot familiar

sturdy dock
#

you'd probably want to learn basic html/css if you haven't already

#

assuming you're not going to go with a website builder or whatever

umbral zealot
#

For the top.gg description you want to check https://custom.discord.re/
For a separate website, basically start with googling "How to make a website" to be honest but that's a... like... really wide topic, not a one-day project for usre, just so you're prepared.

earnest phoenix
#

@umbral zealot how make top. Gg website soory for ping

umbral zealot
#

I literally just answered that question. Literally.

earnest phoenix
#

This

umbral zealot
#

yes, exactly that

earnest phoenix
#

Ok

#

Thx

#

Hmm i have a last question

jagged surge
summer dust
#

how do you post stats while sharding? do you set an interval in the sharding manager or in every shard spawned?

slender thistle
#

@jagged surge what's the issue?

slender thistle
#

So, sharding manager sounds feasible

opal plank
#

what

#

im fairly certain its just 2 ints

#

no arrays included

#

shard_count and guild_count

slender thistle
#

server_count: [1, 2, 3]

summer dust
#

yeah but as far as i know you cant rely on all shards being available so how do send the stats that way? using discord.js

#

do you have any example?

jagged surge
#

@slender thistle

opal plank
jagged surge
#

i cant get it to send me data

#

on vote

opal plank
#

yeah shiv is right

slender thistle
#

Shards should be available consistently though?

#

I'm not exactly sure why they would be unavailable 02think

summer dust
#

neither i am, but that's what i have read the most on internet

slender thistle
#

Can't confirm or deny that, never worked with shards myself

summer dust
#

😔

slender thistle
jagged surge
#

shivaco, think you can give my code a look?

#

thanks here

#
dblpy = dbl.DBLClient(client,
                      gg_token,
                      webhook_path='/dblwebhook',
                      webhook_auth='epictog',
                      webhook_port=6500,
                      autopost=True)

@client.event
async def on_dbl_vote(data):
    print(data)

@client.event
async def on_dbl_test(data):
    print(data)
#

so my code

opal plank
#

in all honesty

jagged surge
opal plank
#

i completely ignore shards

#

i just post count and shardcount

slender thistle
#

You use replit?

jagged surge
#

for now yeah

#

hacker plan

slender thistle
#

Then try the repl's repl.co URL instead

#

with httpa

#

https

jagged surge
#

uhuh alright

summer dust
slender thistle
#

Don't set the port in the URL also

jagged surge
#

like this?

slender thistle
#

Seems alright, yeah

jagged surge
#

yeas it workwed fucking genius @slender thistle

#

i love u thx lol

slender thistle
#

Hell yeah

#

Now that's what I like to see early in the afternoon

summer dust
# opal plank

interesting, here client is the new Discord.Client() which you use this.client.login on, right?

opal plank
#

ignore the this, thats just how my shit works. also its detritus, not d.js, but it should be similar

#

i dont pass a client to the poster

#

i feed the stats myself as you see there

jagged surge
#

@slender thistle

#

one smol question

#

how do i parse and make it give user'

opal plank
#
setInterval(() => {
      if (this.client.dbl && this.client.config.branchType === 'genshin_main')
        this.client.dbl.postStats({
          serverCount: ((this.client.client as ClusterClient).shards
            .map(shard => [...shard.guilds.values()])
            .flat() as Guild[]).length,
          shardCount: (this.client.client as ClusterClient).shards.size
        });
    }, 3600000);```
whole thing
summer dust
#

i see, but seems that you are posting the stats on every shard isnt it? @opal plank

opal plank
#

the variable names should be obvious enough even with my different setup

#

no

#

im just posting it once

summer dust
#

so this is executed in the shard manager?

#

nyeh

#

i see your point

#

but this works because the interval has a very long timeout until it's is called for the first time

#

if you wanted to post the stats as soon as possible it would be more complex

rose warren
#

In the shard manager

cinder patio
#
function postStats(client) {
 if (client.dbl && client.config.branchType === 'genshin_main')
        client.dbl.postStats({
          serverCount: ((client.client as ClusterClient).shards
            .map(shard => [...shard.guilds.values()])
            .flat() as Guild[]).length,
          shardCount: (client.client as ClusterClient).shards.size
   });
} 

postStats();
setInterval(postStats, 3600000);
summer dust
#

this is not going to work @cinder patio

summer dust
slender thistle
rose warren
summer dust
#

fair enough

#

i will go for that solution

cinder patio
summer dust
#

because you will get an error trying to fetch client values while the shards are still being spawned, afaik

cinder patio
#

it wasn't supposed to be copy-pastable code

#

you get the idea

#

you would call the function for the first time after the shards have spawned, and pass the guild count there

#

and shard count

rose warren
#

Topgg autoposter package posts when all shards are ready and then every 30 minutes after that

summer dust
#

well that is basically calling the func before the interval we all know that, the point was doing it when the shards were all available and not at the beginning when they were still spawning

#

ok thanks @rose warren i will go for that solution

#

crap

#

having a look to topgg-autoposter code

#

it was as simple as having an interval every, let's say 5 seconds, and checking if all shards are ready individually

#

then creating an interval to post stats

#

lmao

rose warren
#

That's what I was going to do originally and then I came across the package and saved myself some time 😂

jagged surge
#

i did data[user]

#

but it prints the function id lol

slender thistle
#

print(data["user"])?

jagged surge
#

oh fuck im stupid

slender thistle
#

Convert that to int and use it as an argument for get/fetch_user

jagged surge
#

completely stupid

#

i forgot the quotes im so stupid hahaha

slender thistle
#

kekw

willow frigate
#
const { Discord, MessageEmbed, DiscordAPIError } = require('discord.js');
const config = require('../../config.json')
module.exports = {
    name : 'avatar',
    category : 'Info',
    description : 'Shows Your Avatar / Other\'s Avatar',
    aliases : ['av'],
    usage : '@user / [userid]',
    example : `${config.prefix}av\n ${config.prefix}av @</Jaswant >#0001\n ${config.prefix}av 628774680987172864`,
  run : async (client, message, args) => {
    let user;
    if (!args[0]) {
        user = message.guild.members.cache.get(message.author.id).user;
    } else {
        if (!isNaN(args[0])) {
            user = message.guild.members.cache.get(args[0]).user;
        }
        else {
            user = message.guild.members.cache.get(message.mentions.users.first().id).user || message.guild.members.cache.find(r => r.user.username.toLowerCase().startsWith(args.join(' ').toLowerCase()));
        }
    }
    let embed = new MessageEmbed()
        .setTitle(`${user.tag}'s Avatar`)
        .setDescription(`**Download Avatar : -**\n [png](${user.avatarURL({ format: 'png', size: 4096 })})  -  [jpg](${user.avatarURL({ format: 'jpg', size: 4096 })})  -  [webp](${user.avatarURL({ format: 'webp', size: 4096 })}) `)
        .setImage(user.displayAvatarURL({size: 1024, dynamic: true}))
        .setFooter(
            `Requested By ${message.author.tag}`,
            message.author.displayAvatarURL({ dynamic: true })
          )
        .setTimestamp()
        .setColor("#00ffe3")

        return message.channel.send(embed);
    }

}
#

When i use command with user id
it replies with thier av
and also when no one is mentioned or specified it shows authors av
but when i mention someone it doesnt show
what would be the problem ?
ping and reply with your solution
kindly help

harsh blade
#

Any ideas on what im doing wrong?
Its supposed to check if someone edited their message and if it contains a bad word

client.on('messageUpdate', async (oldMessage, newMessage) => {
  if(!message.member) await message.guild.members.fetch(message.author.id).catch(errorFunction);
  if (message.member.roles.cache.has("765885271861624843"));
  if (message.member && message.member.roles.cache.has("765885271861624843")) return;
    let words = require('./blockedWords (1).json');
    let args = newMessage.content.toLowerCase().split(/\s/);
    args.forEach(w => {
      if (words["blockedWords"].includes(w)) {
        newMessage.delete()
        return message.author.send(`Hey! We dont allow that word here ![Ban](https://cdn.discordapp.com/emojis/775784231673659422.webp?size=128 "Ban")`);
      }
    })
  })
lost heath
#

could it be that you have "" around blackedwords ?

#

wait. nvm. its not defined

#

sorry. its weird reading that on phone

near stratus
lost heath
#

i usually dont read on phone

harsh blade
lost heath
#

just nevermind. i read it wrong

zenith terrace
wet shell
#

yt help

harsh blade
#

Tysm

earnest phoenix
#

i made the first version of me lib

#

:)

placid meadow
#

noice 😄

feral perch
wooden rover
#
if (msg.content === "yr gali") {
    let embed = new Discord.Messageembed
      .setTitle("Random Gali")
      .setDescription("Chutiya", "Bhadwe", "Backchodi")
      .setColor("RANDOM")
      .setFooter("This is a hindi bot!");
    message.channel.send(embed);
  }
});```
#

idk its giving me websocket error

wooden rover
lusty quest
feral perch
lusty quest
#

atleast the property you want to get name from is not defined

wooden rover
feral perch
#

other commands workk

lusty quest
#

since you loop over it

feral perch
lusty quest
wooden rover
#
at Client.<anonymous> (/app/server.js:14:17)
    at Client.emit (events.js:196:13)
    at MessageCreateAction.handle (/rbd/pnpm-volume/92ffaa29-9b13-43f9-86f5-3043190c49fd/node_modules/.registry.npmjs.org/discord.js/12.5.3/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/rbd/pnpm-volume/92ffaa29-9b13-43f9-86f5-3043190c49fd/node_modules/.registry.npmjs.org/discord.js/12.5.3/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/rbd/pnpm-volume/92ffaa29-9b13-43f9-86f5-3043190c49fd/node_modules/.registry.npmjs.org/discord.js/12.5.3/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/rbd/pnpm-volume/92ffaa29-9b13-43f9-86f5-3043190c49fd/node_modules/.registry.npmjs.org/discord.js/12.5.3/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/rbd/pnpm-volume/92ffaa29-9b13-43f9-86f5-3043190c49fd/node_modules/.registry.npmjs.org/discord.js/12.5.3/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/rbd/pnpm-volume/92ffaa29-9b13-43f9-86f5-3043190c49fd/node_modules/.registry.npmjs.org/ws/7.4.4/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (events.js:196:13)
    at Receiver.receiverOnMessage (/rbd/pnpm-volume/92ffaa29-9b13-43f9-86f5-3043190c49fd/node_modules/.registry.npmjs.org/ws/7.4.4/node_modules/ws/lib/websocket.js:825:20)```
lusty quest
#

you have a typo

zenith terrace
#

did you change it to MessageEmbed()

feral perch
zenith terrace
lusty quest
wooden rover
feral perch
#

there was not an error with the name

#

there was an error with info

#

i forgot to mention it in one command

#

nvm thanks tho!!! @lusty quest bloblul

feral perch
wooden rover
earnest phoenix
wooden rover
earnest phoenix
#

@wooden rover ofc FOPx1

earnest phoenix
#

Hmm

feral perch
earnest phoenix
earnest phoenix
#

guys
how to do 24/7 ur bot
my bot working only when im typing node . in cmd (node.js, javascript)

azure sparrow
#

You could use pm2

pearl trail
#

use VPS (virtual private server)

#

or yes pm2 if you want your computer works 24h non stop

earnest phoenix
earnest phoenix
#

i think

#

vps

azure sparrow
earnest phoenix
#

pm2 is process manager

azure sparrow
#

Heh

earnest phoenix
#

which is good thing

#

since you dont need cmd to be 7/24 open

#

ok

placid meadow
quartz kindle
#

pm2 is cooler

#

:^)

#

(except when it isnt)

rustic nova
#

@split wolf please don't advertise

#

thanks

#

holy fuck why did nobody tell me using docker is so easy lmao

lusty quest
#

ive mentioned it a few times

placid meadow
#

lol

sweet hamlet
#

Hi

placid meadow
crimson vapor
#

if everything is compiled already, just create a start.sh and set pm2 to run that

placid meadow
#

well if pm2 works great, cool, if it doesnt screen it, thats also cool

#

i rly dont give it much thought

quartz kindle
#

you have to specify it in you ecosystem file

#

when upgrading node from 12 to 14 i tried everything and pm2 refused to actually use 14 in the apps until i explicitly put it in the ecosystem file

earnest phoenix
livid lion
#

hello

#

Don’t you know how to put addfields online in embed without a giant space between them?

slim heart
#

i'm moving from docker back to indiv pm2 kekw

livid lion
#

my code

let embed = new Discord.MessageEmbed()
        .setColor(color)
        .setAuthor(`${utilisateur.username}`)
        .setThumbnail(utilisateur.displayAvatarURL({dynamic: true}))
        .setTimestamp()
        for(i = 0; i < objet.length; i++) {
            embed.addField(`**- ${objet[i]}**`,"\u200b", true)
        }```
placid meadow
#

thx lad

umbral zealot
livid lion
#

okay

#

this

livid lion
umbral zealot
#

I mean... you're adding a field with an empty space, that \u200b is literally your "giant space"

livid lion
#

yes

umbral zealot
#

Perhaps you shoudl consider concatenating them all in a single string and putting them in the description instead

livid lion
#

ok

earnest phoenix
#

Nerds

umbral zealot
earnest phoenix
#

Isn't there on node.js the same shit as in python

#

like

umbral zealot
#

The answer is "yes"

earnest phoenix
#
reponse = requests.get("google.com");
print(response)

then i'll give you the content

#

and save it as variable

umbral zealot
#

you mean an http get? yes, you can do http requests in nodejs

earnest phoenix
#

only thing i managed to get until now is aids

#

yea u can

#

and how to save them as variable

umbral zealot
#

node-fetch and axios are popular modules for that

earnest phoenix
#

i can console.log it

#

yea but we're doing a shitty ass school project

#

and you can't use fetch

cinder patio
#

ever heard of let and const

earnest phoenix
#

dude

#

i tried everything possible

umbral zealot
earnest phoenix
#

i can output it

umbral zealot
#

basic JS

earnest phoenix
#

but not save it OUTSIDE

cinder patio
umbral zealot
#

However, note that this is promise-based, right, so you need to understand async code

earnest phoenix
#

yea no shit sherlock

#

not first time i use await and async

slim heart
#

if you want help don't be rude

umbral zealot
candid steeple
#

Alguien en español?

#

Pls

slender thistle
#

No

candid steeple
#

F

umbral zealot
crimson vapor
quartz kindle
earnest phoenix
#
var req = https.request(options, res => {
            res.setEncoding('utf8');
            var responseString = "";
        
            //accept incoming data asynchronously
            res.on('data', chunk => {
                responseString = responseString + chunk;
            });
        
            //return the data when streaming is complete
            res.on('end', () => {
                console.log(responseString);
            });

        });
        req.end();

that's the cancer i got so far

#

but can't use the responseString outside

#

neither save it outside or return it by using a func

quartz kindle
#

no you cannot

earnest phoenix
#

jeez

quartz kindle
#

unless you wrap it inside a promise

#

thats what promises are for

placid meadow
#

to break?

#

😂

earnest phoenix
quartz kindle
#

the built-in http module is a low level module, it only gives you the very basic things to work with

earnest phoenix
#

lovely

quartz kindle
#

thats why there are tons of npm modules that are built on top of http

#

like node-fetch

#

etc

earnest phoenix
#

yea

#

but like

#

school projects = aids

cinder patio
#
function makeRequest() {
   return new Promise((resolve) => {
       // some code
       res.on('end', () => {
           resolve(responseString);
       });
});
}
earnest phoenix
#

yea tried that

quartz kindle
#

thats how you wrap it in a promise

#

like that you can then use it outside the function by awaiting it

#

let response = await makeRequest()

earnest phoenix
#

yea but like

#

i gave me error

quartz kindle
#

what error

earnest phoenix
#

and since it's fucking garbage

#

you don't get any infos

#

welcome to amazon

#

"Your programm got an erro"

#

thanks

quartz kindle
#

lmao

lyric mountain
#

if your console lacks error description something is really wrong

quartz kindle
#

its probably not even a console

#

just an admin panel or status panel or something

#

there should be an option to access the terminal tho

earnest phoenix
#

does not

#

it's some shit

#

and to get logs

#

you need to go on 100 websites

#

before finding that you have no perms

quartz kindle
#

lol

lyric mountain
#

may I ask, WHERE youre coding?

cinder patio
#

Okay maybe show us all your code

quartz kindle
#

i mean

lyric mountain
#

also, you can always code on some third-party ide then transfer the code there

quartz kindle
#

if you can see the output of your console.logs

#

you should definitely be able to see the output of errors

earnest phoenix
#

my brain would explode

#

like the first time i got asked to code on that

lyric mountain
#

a name would help

earnest phoenix
#

nana

#

don't want to hurt you

lyric mountain
#

so what exactly you want here?

earnest phoenix
#

trying something before sending what i got so far with promise shit

#

lovely error and still no information on what it is

#
function makeRequest() {
    return new Promise((resolve) => {
        var options = {
            host: weatherApiHost,
            path: weatherApiPath,
            followAllRedirects: true,
            redirect: 'follow',
            method: 'GET',
        };
        var res = http.request(options, res => {
            res.setEncoding('utf8');
            var responseString = "";

            //accept incoming data asynchronously
            res.on('data', chunk => {
                responseString += chunk;
            });

            //return the data when streaming is complete
            res.on('end', () => {
                resolve(responseString);
            });

        });
    });
}

let kekw = await makeRequest();
lyric mountain
#

you want a car mechanic without showing your car nor who you are basically

earnest phoenix
#

shit i got so far

cinder patio
#

You can only use await in async functions

earnest phoenix
#

it is

#
 async handle(handlerInput) {
previous stuff
}
lyric mountain
#

no async

#

also var is bad

cinder patio
#

there's no need for await there

#

async*

earnest phoenix
lyric mountain
#

it is

earnest phoenix
#

not first time i use async/await

#

well first time on js but not python

#

and it's unnecessary there

lyric mountain
#

async function name()

#

no its not

#

you gotta define it async

cinder patio
#

You don't need async there, that function isn't doing anything async, just returning a promise

lyric mountain
#

well, yeah there's that too

#

but for now, remove those vars

#

var is hoisted

earnest phoenix
#

won't change anything

lyric mountain
#

you will if you want to fix the code

earnest phoenix
#

won't make it work

lyric mountain
#

var gets hoisted on start

earnest phoenix
cinder patio
#

actually

#

in this very case

#

where you are using the same variable name twice

earnest phoenix
#

idk

#

why not

lyric mountain
#
console.log(a)
var a = 12;

// prints 12
earnest phoenix
#

i can change tho

#

ts > js anyways

cinder patio
#

var might mess that up

lyric mountain
#

blaming the lang won't get you anywhere

earnest phoenix
#

anyways

cinder patio
#

you don't even need to assign the result of http request to anything

earnest phoenix
#

changed the var and the name

lyric mountain
#

so, any error?

earnest phoenix
#

well ye

#

but i don't see them

#

because the error handling sucks

cinder patio
#

why don't you run the code on your PC

#

so you can see everything

lyric mountain
#

or press F12 and use chrome console

earnest phoenix
#

Doesn't work

cinder patio
#

no http module on chrome

lyric mountain
#

meh

earnest phoenix
#

and you can't run the code locally because the way you need to code this shit is online

cinder patio
#

That doesn't stop you from running it locally so you can see the errors

lyric mountain
#

what prevents you from coding locally then rewriting on the site?

cinder patio
#

not your fault they don't give you the errors

earnest phoenix
#

It

#

does

#

stop

#

me

#

from

#

running

#

locally

lyric mountain
#

why?

earnest phoenix
#

because they use fuckign random ssdks

#

sdks*

#

and u need a shitty amazon alexa to test that shit

cinder patio
drowsy epoch
#

i'm a bit confused on how to fix this. How can it be fixed?

cinder patio
earnest phoenix
#

jeez

#

whatever

#

if you don't understand the words

#

"You can't"

#

it's okay

lyric mountain
#

I'll ask again

#

say

#

where tf

earnest phoenix
#

everythin works

#

it's ok

lyric mountain
#

youre coding then

earnest phoenix
#

everythjng wporks

#

cool

#

thjanks for helping

cinder patio
#

bblocked

drowsy epoch
lyric mountain
#

basically the url is not reachable anymore

drowsy epoch
#

ohh ok

drowsy epoch
lyric mountain
#

did u install those first?

drowsy epoch
#

let me check

#

turns out i did not have the 2nd installed

#

same error tho

lyric mountain
#

welp, can't help much when it comes to npm errors

#

btw, why are you using a library for that?

#

levelling is simply saving a table/document where the user has an ID, XP and level

earnest phoenix
#

anyways

#

got it to work

placid meadow
#

thats not safe 😛

crimson vapor
#

super ezpz leveling tbn

drowsy epoch
#

actualy thats a good point

#

i'll remove it for now and re-write it tomorrow

lyric mountain
#

my favorite xp-per-level algorithm is xp = level ^ 2 * 100

drowsy epoch
#

so its not that bad

delicate zephyr
#

its pain

placid meadow
#

i got a equation right here

delicate zephyr
placid meadow
#

no no no

delicate zephyr
placid meadow
#

here wait ill give you something

#

ill dm it

delicate zephyr
#

No, this is for exponential growth

#

it works fine

crimson vapor
#

imagine using a recursive function in order to get the level

#

moment

delicate zephyr
#

cause we dont store the level in the database

placid meadow
drowsy epoch
#

luke how are u a certified dev?

crimson vapor
#

shiro

delicate zephyr
#

easy =/= good

lyric mountain
delicate zephyr
#

I mean

#

Math is just complicated in general

crimson vapor
#

no

#

its really not

drowsy epoch
#

^ what he siad

delicate zephyr
lyric mountain
delicate zephyr
drowsy epoch
delicate zephyr
lyric mountain
#

xp = level ^ difficulty * scale

delicate zephyr
delicate zephyr
lyric mountain
#

level = sqrt(xp / scale)

delicate zephyr
lyric mountain
#

is it here? stinky

delicate zephyr
earnest phoenix
#

How to make a bot send a photo not from url, but from my photos in storage?

quartz kindle
#

which library?

earnest phoenix
#

All of em.

quartz kindle
#

i mean

#

which discord library

earnest phoenix
#

Storage

#

Wait sry

quartz kindle
earnest phoenix
#

Hmmm i dont think i did that...

quartz kindle
#

what did you do?

earnest phoenix
quartz kindle
#

what are you using for your bot?

#

how are you coding it?

placid meadow
earnest phoenix
#

Like that

quartz kindle
#

what

#

what is that?

dusky sundial
#

Are you coding your own bot? Or what are you talking about

cinder patio
#

Probably bdfd

dusky sundial
#

What language are you coding in?

earnest phoenix
#

But i dunno what engine is it

cinder patio
#

It has commands like that right

earnest phoenix
#

Yep?

quartz kindle
#

then explain how did you create yur first command

dusky sundial
#

You don't know what you're coding in?

quartz kindle
#

which apps/programs did you download

earnest phoenix
dusky sundial
#

Oh

cinder patio
#

yup

quartz kindle
#

ah

#

so yes thats BDFD

cinder patio
#

called it

quartz kindle
#

you should probably ask in the bdfd support server

#

nobody here uses bdfd

earnest phoenix
#

Oh ok

#

Btw wats bdfd?

quartz kindle
#

bot designer for discord

dusky sundial
#

It's short for Bot designer for discord

quartz kindle
#

the initials

earnest phoenix
#

Ok

placid meadow
#

it makes it gradually harder the higher u get

quartz kindle
#

i was asking Daah lol

dusky sundial
#

Tim do you do CSS?

quartz kindle
#

yes

earnest phoenix
placid meadow
earnest phoenix
#

But website not found?

dusky sundial
#

Can you explain why darkgray is a brighter shade of gray than gray?

earnest phoenix
#

Okie thx

placid meadow
#

gfx card/software can do that too

dusky sundial
quartz kindle
#

Perhaps most unusual of the color clashes between X11 and W3C is the case of "Gray" and its variants. In HTML, "Gray" is specifically reserved for the 128 triplet (50% gray). However, in X11, "gray" was assigned to the 190 triplet (74.5%), which is close to W3C "Silver" at 192 (75.3%), and had "Light Gray" at 211 (83%) and "Dark Gray" at 169 (66%) counterparts. As a result, the combined CSS 3.0 color list that prevails on the web today produces "Dark Gray" as a significantly lighter tone than plain "Gray", because "Dark Gray" was descended from X11 – for it did not exist in HTML nor CSS level 1 – while "Gray" was descended from HTML. Even in the current draft for CSS 4.0, dark gray continues to be a lighter shade than gray.

placid meadow
#

O_O didnt know that

dusky sundial
#

Ooh okay

#

That makes a little more sense then

placid meadow
#

yeah it does

#

thx @quartz kindle

cinder patio
#

bruh

placid meadow
#

?

cinder patio
#

y'all have a browser right

crimson vapor
#

whats a browser?

lyric mountain
#

no, I use two AAA batteries to send signals through ethernet cable

quartz kindle
#

remember an adware browser called browzaar?

#

xd

quartz kindle
placid meadow
#

lol

lyric mountain
#

2 B/minute

placid meadow
#

bits or bytes?

#

😛

lyric mountain
#

bytes

placid meadow
#

then use lower case b

#

😛

lyric mountain
#

thats bit

zenith terrace
#

@quartz kindle keeping busy at home I see

placid meadow
#

wait what ?

#

not B was bits right ?

lyric mountain
#

b = bit
B = byte

dusky sundial
#

Lowecase b is bit, yes

quartz kindle
#

lowercase is bits no?

placid meadow
#

im confused

lyric mountain
#

it gets better with kilo

#

kb = kilobits
kB = kilobytes
kiB = kibibytes

placid meadow
#

kibi??

dusky sundial
#

Windows standard

lyric mountain
#

1 kiB = 1024 B

#

1 kB = 1000 B

placid meadow
#

this shit always confuses me

lyric mountain
#

blame marketing for that

placid meadow
#

upper case, lowe case

lyric mountain
#

basically people started using base 10 for bytes

#

but base 10 is shit for programmers and engineers

#

so instead of fighting against people to assert base 2 dominance

#

we went with kiB

quartz kindle
#

isnt KiB 1000 and KB 1024?

lyric mountain
#

nope

#

TIL there's also KB

placid meadow
#
        public static string ReadableSize(this Int64 input)
        {
            string[] sizes = new[] { "Bytes", "KB", "MB", "GB", "TB" };
            int order = 0;
            while (input >= 1024 && order < sizes.Length - 1)
            {
                order += 1;
                input /= 1024;
            }
            return string.Format("{0:0.##} {1}", input, sizes[order]);
        }```
lyric mountain
#

yes because u used KB not kB

placid meadow
#

gotya

quartz kindle
#

shouldnt it be KiB then

#

because is 1024x

lyric mountain
#

yep

placid meadow
#

so its wrong?

lyric mountain
#

The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable unit of memory in many computer architectures. To disambiguate arbitrarily sized bytes from the common 8-bit ...

#

both KB and KiB are the same

#

KB is windows standard

quartz kindle
#

PORTUGAL CARALHO

lyric mountain
#

oh

earnest phoenix
#

Welp confusing but i can do it?

quartz kindle
#

xD

placid meadow
#

lol Kuuh, u spanish? 😛

#

or portugese ?

lyric mountain
#

br

earnest phoenix
#

Bruh thats not portu

placid meadow
#

well... fk me

lyric mountain
#

tl;dr: blame the users for confusing filesizes

earnest phoenix
#

fascinating

placid meadow
#

im still not getting the Kibi thing, when was that introduced ?

lyric mountain
#

dec/1998

placid meadow
#

so we have conflicting colors, size units

#

what else is conflicted today ?

#

lol

lyric mountain
#

cats-per-football fields

placid meadow
#

eh ..

#

u taking a piss with me now kuuk ?

#

lol

lyric mountain
#

come to metric system

placid meadow
#

dude im from EU 😛

lyric mountain
#

doesn't EU use both?

placid meadow
#

i cant know that for sure

#

but as far as im concerned NL uses metric

#

the rest ... i think does too?

#

except for UK ofc

#

these fellas measure weight in stones

#

lol

lyric mountain
#

ah yes, stone system

placid meadow
#

and foot ...and feet

#

i have a feature in my bot that shows both yards and mtrs coz u never know when ur bot is being used in whatever part of the world

#

i dont like it, but you gotta be broad on delivering

#

i do know i always setup the right culture in my apps, coz there are some nasty hiccups if u dont

#

especially when you do expression evaluation, the comma's and dots

#

fkn headache right there

#

@lyric mountain

lyric mountain
#

?

wide hull
#

Haw i make a bot

placid meadow
#

haw haw? 😛

wide hull
umbral zealot
#

Hawdie

wide hull
#

I bont no haw to do a bot

lyric mountain
wide hull
#

Can you make for me?

merry grove
#

Beth

umbral zealot
#

If you want to make a bot, here's how:

Step 1) learn a programming language
Step 2) choose a library in that language
Step 3) actually start writing the bot
Step 4) ask for specific help if you need it

merry grove
#

Breh

placid meadow
#

i was waiting for that one

merry grove
#

Make it yourself @wide hull

lyric mountain
#

"can"? yes sure
"will"? no

wide hull
placid meadow
#

kuuh i thought u had a magic wand for these moments? 😛

merry grove
#

Or go steal a GitHub bot

placid meadow
#

dude

#

well ...its not like im always ethical .. -.-

lyric mountain
#

@wide hull you see, bots are basically softwares

#

and softwares arent generally free

placid meadow
#

lots of hours wend into them

#

lots of errors, debugging ...

lyric mountain
#

not that I'd make one even if paid

umbral zealot
lyric mountain
#

refer to fiverr or freelancer for that matter

placid meadow
#

Kuuh, everyone has a price 😛

#

even you

umbral zealot
#

yeah that's what the link is to 😛

lyric mountain
#

my price is NaN dollars

wide hull
#

🖕🏿🖕🏿🖕🏿

placid meadow
#

thats not nice :<

umbral zealot
#

@drowsy crag wanna take this guy? Please? ^_^

lyric mountain
#

yeah yeah, are you speedrunning top.gg too?

wide hull
drowsy crag
#

-m 809939073451819049

gilded plankBOT
#

🤐 Muted رمضان مبارك 🌙#2267 (@wide hull)

earnest phoenix
#

Well i kinda say java is more tiring than python

drowsy crag
#

we out here

placid meadow
#

nom!! 😄

umbral zealot
#

Thanks nom! hug

drowsy crag
placid meadow
#

nom to the rescue

lyric mountain
#

java is more verbose, but DEFINITELY easier to debug than python

earnest phoenix
#

Java debugs more than python

#

Exactly

placid meadow
#

i find debugging async tideious

lyric mountain
#

nono, java has more debugging tools/info than python

#

it's you who debugs

earnest phoenix
#

Ohhhhhhhhhh

lyric mountain
#

debugging = finding the bug

placid meadow
#

debugging is a specialty 😛

#

problem solving

#

isolating

earnest phoenix
placid meadow
#

usually debugging comes right after "ive optimized my code" and then you go "oh no...i wish i never done that"

#

-.-

earnest phoenix
#

Uuuuuuu

mellow arrow
earnest phoenix
#

Imma use java for debug and python for code

lyric mountain
#

nonono

placid meadow
#

lpol

#

hahahahaha

lyric mountain
#

that's not how it works

#

both java and python are languages

placid meadow
#

kuuh i give him kudos for that one 😂

#

hes solving the problem XD

earnest phoenix
lyric mountain
earnest phoenix
#

Wait so ur saying

lyric mountain
#

imagine two people

#

one talks english

earnest phoenix
#

They cant work each other?!?!?!?!?11!?!?!1!?!?!111?!?!!1

lyric mountain
#

and the other swahili

earnest phoenix
#

And if u translate the swahili

lyric mountain
#

that's called embedded coding

placid meadow
#

hahahaha

lyric mountain
#

java can run python snippets

#

(idk if python can run java snippets)

earnest phoenix
#

Fun fact: dont translate swish in swedish

lyric mountain
#

but they still dont mix

earnest phoenix
#

I see...

lyric mountain
#

you can make both work together, even in the same runtime

earnest phoenix
lyric mountain
#

but they'll never become one

dusky sundial
#

Swish in Swedish?

#

It doesn't mean anything

placid meadow
#

nah ?

earnest phoenix
#

Trust me

#

Trans it

dusky sundial
#

No it doesn't, I speak Swedish brother

placid meadow
#

Swiss = Switzerland ?

#

or am i retarded ?

earnest phoenix
#

Swish

lyric mountain
#

isvitzerland

placid meadow
#

LOL

earnest phoenix
#

Ok imma show u the true meaning of swish in swedish

dusky sundial
#

Swish is just a sound you make

#

or an app

#

to transfer money

earnest phoenix
#

Shoud i send it here or i send in general

lyric mountain
#

took me a long time to find out "Swi" isn't spoken like "Sui"

earnest phoenix
#

Pls trans it

placid meadow
#

its french ?

earnest phoenix
#

Swish in swedish

placid meadow
#

canadian ?

#

i give up

earnest phoenix
#

Swedish > English
Swish > ???

#

Like that

smoky laurel
#

РРРРРУУСКИЕ БООООГАТЫРИ ВОТ ИЛЮША С ЛЕГКА РАЗМИНАЕТСЯ А ПРИДУРОК УЖЕ ТУТ КАК ТУТ

placid meadow
#

yeah sure ..

#

what he said

dusky sundial
lyric mountain
#

literally

cinder patio
#

It's sus

placid meadow
#

silent sw'ish

earnest phoenix
placid meadow
#

SWOOSH

#

😂

cinder patio
#

hahahahahaahahhahahahahahahahahahahahahaahhahahahah sususususu very funny.

lyric mountain
#

anyway

earnest phoenix
#

Here i was wronk

#

Trans it with english

placid meadow
#

wronk even ...thats the worst kind of wrong u can have

earnest phoenix
#

And then swedish

placid meadow
#

Swoosh was in there...i was partially right 😄

#

ahyis

earnest phoenix
#

Yep

lyric mountain
#

back to topic, choose one lang and stick to it

earnest phoenix
#

Stone grinder mogus

#

Drip stone

#

Minecraft pig is sus

#

Bed is sus

dusky sundial
#

I'd advise you to move to #general if you don't need any help with development

earnest phoenix
#

Oki sry

cinder patio
#

don't post that shit in general either

#

cringe

earnest phoenix
#

And pls dont post badd words?

placid meadow
#

lol Fued

earnest phoenix
#

And yea cring it is

placid meadow
#

i kinda feel sad for him now 😛

earnest phoenix
#

Oh imma trans that

dusky sundial
earnest phoenix
#

Did u say u rape ur dog

dusky sundial
#

@drowsy crag we have a cool rule breaker here

drowsy crag
#

-noes

gilded plankBOT
earnest phoenix
#

Uh oh

drowsy crag
#

man

#

-m 718520365554335785

gilded plankBOT
#

🤐 Muted chrome 5#7300 (@half iron)

earnest phoenix
#

I get u

unreal estuary
#

can someone help, my footer wont go to the bottom of the page

#
    position: absolute;
    bottom: 0;
}```
#

and my body has 100vh body { margin: 0; padding: 0; font-family: 'Ubuntu'; width: 100vw; height: 100vh; }

lyric mountain
#

do note, bottom: 0 refers to the parent element

#

not the page coordinates

unreal estuary
#

ok

#

so what should i do to make it at the bottom

lyric mountain
#

doesn't 100vh need to be in quotation marks?

unreal estuary
#

i dont think so but ill try

#

yeah didn't work :c

lyric mountain
#

show me the page

#

btw