#development

1 messages Β· Page 1731 of 1

finite leaf
#

no

#

it responds fine, its just the request body is somehow empty

clear marlin
#

uh, well guess you must handle exceptions next time forth

finite leaf
#

final one is the response, its set to no as default πŸ˜„

eternal osprey
#

i have tried chocolatey

#

cmd, even powershell

#

stuck for a long time

#

waiting for log file..

cosmic forum
#

Anyone know any js libraries that allow you to take a screenshot of another website? I'd like something like this because I'm featuring some projects on my website, and I'd like to show a preview screenshot of it, but because I'm updating the projects often, I'd like to not have to take a new screenshot every time I make a change.

umbral zealot
#

Yes, look at puppeteer

cosmic forum
eternal osprey
#

so i wanted to finally take some steps into upgrading my bot to v12, downloaded the files from my vps.... does this fucking build tools not install.

umbral zealot
#

I'm curious. What specifically is requiring the build tools?

#

because nodejs doesn't. discord.js doesn't.

#

upgrading shouldn't require the installation of build tools.

snow vector
#

const ping = ("${Math.round(client.ws.ping)}")

earnest phoenix
#

What

umbral zealot
#

Either that's not a real client variable, or it's not discord.js version 12.

snow vector
#

i switched to an advanced command handler and idk where to put that

#

in index didnt work

umbral zealot
#

put what?

#

if you want to use client, you can either pass it from your main handler to your functions, or you can access it from another place, like message.client or member.client

snow vector
#

thats where i have it

umbral zealot
#

ok so you're passing your client to your handlers

#

show your command_handler/index.js file

snow vector
umbral zealot
#

err rather your /handlers/command_handler.js file

#

Oh wait a sec

#

yeah that line 4 makes no sense at all

#

delete that

snow vector
#

i had that in my old code

umbral zealot
#

no you didn't, not here, not at this location

#

it cannot be defined globally

#

the scope is wrong

snow vector
#

thats my command handler

umbral zealot
#

ok great, that works

#

now show the code that handles your incoming messages

#

something like message.js I presume? whatever handles those

snow vector
umbral zealot
#

great so

#

every one of your commands gets the following arguments:

#

so, in your actual command file

#

and client.ws.ping

snow vector
#

thats teh ping cmd

umbral zealot
#

yeah ok so that's wrong

snow vector
#

damn

umbral zealot
#

client, message, args, Discord
message, args, client, Discord

#

you can't randomly decide where these go

#

functions are called with the same ORDER of arguments

snow vector
#

oh

umbral zealot
#

They all have to match.

snow vector
#

ok

#

bro ur so smart

umbral zealot
#

It's not about being smart it's about having 25 years of programming experience thumbs_up

snow vector
#

im keeping this forever btw

umbral zealot
#

lol

#

Have it framed on your wall, those are famous words kekface

snow vector
#

i will

#

so bc ur so smart

#

how would i make it say "Purged (specified amount) messages"

umbral zealot
#

I presume you're sending that number in your arguments, so just use that number?

#

It can only be between 2 and 100 anyway

snow vector
#

so it would be this

#
module.exports = {
    name: '!purge',
    description: "delete messages!",
    async execute(client, message, args, Discord) {
        if(!args[0]) return message.channel.send("You must specify how many messages to delete!");
        if(isNaN(args[0])) return message.channel.send("Please enter a number!");

        if(args[0] > 100) return message.channel.send("The max you can delete is 100!");
        if(args[0] < 1) return message.channel.send("You must delete atleast one message!");
        if(!message.member.hasPermission("MANAGE_MESSAGES")){
            return message.reply("No");
        }

        await message.channel.messages.fetch({limit: args[0]}).then(messages =>{
            message.channel.bulkDelete(messages);
        });
        message.channel.send(`Purged (args[0]) messages`)

    }
}```
umbral zealot
#

only if you actually use a correct template literal

eternal osprey
#

hey, what is this in v12 form? js message.author.DisplayAvatar

umbral zealot
umbral zealot
snow vector
umbral zealot
#

no you'd have to add the appropriate text

#

and not just copy/paste shit

#

smh

snow vector
#

shhhhhh

umbral zealot
#

try to understand this instead of blindly shoveling code, mmmkay?

snow vector
#

lmao

#

jk

#

ok

earnest phoenix
#

hello guys i need help

umbral zealot
#

with?

earnest phoenix
#

how do i fix that

umbral zealot
#

Uhhhh do less requests I guess

#

twitch is blocking you

earnest phoenix
#

ok thanks!

#

but how do i do less requests

umbral zealot
#

I don't know, absolute no idea, try to ask their support...

earnest phoenix
#

okay

sudden knoll
#

Does anyone know why this code isn't updating the server count on the website?

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

DBL_TOKEN = os.getenv("DBL_TOKEN")

intents = discord.Intents(messages=True, reactions=True, invites=True, guilds=True, members=True, emojis=True)
bot = commands.Bot(command_prefix='!', case_insensitive=True, help_command=None, intents=intents)
bot.dblpy = dbl.DBLClient(bot, DBL_TOKEN, autopost=True)

@bot.event
async def on_guild_post():
    await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="users in " + str(len(bot.guilds)) + " servers"))
    print(f'Posted server count ({bot.dblpy.guild_count})')
#

this is python btw

slender thistle
#

I'd ask the same question

sudden knoll
#

lol

sudden geyser
#

Don't you need to wait 30 minutes before the post is sent?

sudden knoll
#

I have

#

don't worry about that

eternal osprey
#

hey would this in v12: js let muterole = message.guild.roles.cache.find(r => r.name === "muted"); if(!muterole){ try{ muterole = await message.guild.roles.create({ name: "muted", color: "#000000", permissions:[] }) message.guild.channels.cache.forEach(async (channel, id) => { await channel.overwritePermissions(muterole, { SEND_MESSAGES: false, ADD_REACTIONS: false }); }); }catch(e){ console.log(e.stack); } } delete all the other channel perms in the server?

#

i've heard that a while ago but i am unsure whether that is true

zenith terrace
#

try it

umbral zealot
#

and see

sudden knoll
#

I'll try the manual way instead of autopost and see if that works

#
bot.dblpy = dbl.DBLClient(bot, DBL_TOKEN)

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

returns the error

Failed to post server count
TypeError: object Lock can't be used in 'await' expression
slender thistle
#

Ah

#

Yes

#

You haven't heard about topggpy, have you

sudden knoll
#

why is it using locks instead of asynchronous locks?

slender thistle
sudden knoll
#

lol thanks

slender thistle
#

It used to because the module dblpy used was a disaster

#

Kinda just rewrote it and added it manually

sudden knoll
#

that's nice, should probably change the top.gg python library link to show pip install topggpy instead of pip install dblpy btw

earnest phoenix
#

guys does anyone know where to connect our webhook so it can send notifications when someone goes live on twitch?

rapid wharf
#

Sir, i tried it but still same, the bot is welcoming ppl who are joining diff servers
The code:

async def on_member_join(member):
    if member.guild.id == 799980929056768000:
        pass
    em = discord.Embed(title=f"Welcome {member.name}!!", color=0xd24dff)
    em.add_field(name=f'Welcome to my World Baby {member.name}!', value=member.mention)
    em.set_footer(text="Hope you will have Fun with me here!!!")
    await client.get_channel(799980929056768003).send(f'{member.mention} has Joined.')
    await client.get_channel(799980929056768003).send(embed=em)
sudden geyser
#

because you did nothing in the if condition body

#

pass is a placeholder

#

You should do the welcoming logic in that block

earnest phoenix
#

how do i change that

sudden knoll
#

yeah

slender thistle
#

Aye, will be done soon

sudden knoll
hexed vortex
#

How do u make a website for ur bot? Not to customize the bot tho just like The website of giveaway bot

earnest phoenix
#

because, it's now topgg lol

sudden knoll
#

^^^

earnest phoenix
sudden knoll
#

okay thanks

hexed vortex
#

That's all just make a coded website?

umbral zealot
#

there's a bunch of ways to make websites

#

can be with code

#

can be with online editors

#

can be 100% stolen code you just slap your bot's name on like 90% of bot websites

hexed vortex
#

Not wix nor godaddy

umbral zealot
#

Β―_(ツ)_/Β―

#

if you're making it on your own, then it can be pure html/css/javascript. or you can use a framework like vue, react, angular. Or it can be a backend framework like laravel or django

hexed vortex
umbral zealot
#

there ya go

hexed vortex
#

But how do I code a website?

cinder patio
#

all you need is a text editor

umbral zealot
#

with html, css, javascript

sudden knoll
#

html, don't forget to close those tags

hexed vortex
#

But like how do I just go to vs code and code?

sudden knoll
#

yeah

hexed vortex
#

For my eebsite

vivid fulcrum
#

put your fingers on your keyboard

#

press keys

sudden knoll
#

or just use notepad if you're pro

vivid fulcrum
#

boom

#

you're writing code

sudden knoll
#

if you aren't coding in notepad, are you even coding

hexed vortex
#

But how do i make it a website

solemn latch
#

i think you need to be more specific if you want a clearer answer.

sudden knoll
vivid fulcrum
hexed vortex
sudden knoll
#

or just a screen that sits there and does nothing

vivid fulcrum
#

you're lacking very very basic knowledge that you're supposed to learn in school lol

sudden knoll
#

that url doesn't work

hexed vortex
#

Ik

#

Just an example

sudden knoll
#

but it doesn't work

solemn latch
#

you need to buy a domain

hexed vortex
#

No...

sudden knoll
#

or go on heroku and host a webapp

#

for freeeee

hexed vortex
#

Freeeeeeeeee

solemn latch
#

then your hosting off a heroku url which is ugly πŸ‘€

hexed vortex
#

Or I can use godday

#

Fodaddy

#

Godaddy

cinder patio
#

You can change it

sudden knoll
solemn latch
#

hes asking for a website

#

πŸ‘€

vivid fulcrum
#

as if the link i sent doesn't cover everything you're asking right now πŸ™„

cinder patio
#

you need a paid domain ofc

vivid fulcrum
sudden knoll
#

I mean I assume he wants his site to be a little interactive

#

but also go on stack overflow

#

and just find all the answers there

solemn latch
#

i mean all the answers are linked above by cry πŸ‘€

sudden knoll
#

lmao

lyric mountain
vivid fulcrum
#

yes but how to make it SPARKLY AND COOOL!!????!?!?

sudden knoll
#

genius

vivid fulcrum
#

my BOT IS BEST!!!

earnest phoenix
#

pain

#

what is ur bot

#

i mean which bot is urs

vivid fulcrum
#

that was sarcasm

finite leaf
#

how can I filter reacted by users that have not left the server?

lyric mountain
#

my bot is a panzer kampfwagen mk III

vivid fulcrum
lyric mountain
#

because less lines of code obv means faster code smh

sudden knoll
cinder patio
solemn jolt
#
const Command = require("../../base/Command.js"),
  Discord = require("discord.js");

class Addcaptain extends Command {

  constructor(client) {
    super(client, {
      name: "addcaptain",
      dirname: __dirname,
      enabled: true,
      guildOnly: true,
      aliases: [],
      memberPermissions: ["MANAGE_GUILD"],
      botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
      nsfw: false,
      ownerOnly: false,
      guildOwnerOnly: false,
      cooldown: 3000
    });
  }

  async run(message, args, data) {
    const name = args[0];
    if (!name) {
      return message.error("administration/addcaptain:MISSING_TEXT");
    }
    if (name.length > 5) {
      return message.error("administration/addcaptain:TOO_LONG");
    }
    if (!args[1]) return message.error("administration/addcaptain:MISSING_MENTION");
    const member = await this.client.resolveMember(args[1], message.guild);
    if (!member) return message.error("administration/addcaptain:MISSING_MENTION");
    let team = this.client.teamsData.findOne({ name })
    if (team) {
      const teamData = this.client.findOrCreateTeam({ name });
      teamData.captain = member.id;
      const embed = new Discord.MessageEmbed()
        .setAuthor(message.translate("administration/addteam:TITLE"))
        .setColor(data.config.embed.color)
        .setFooter(message.author.tag)
        .setTimestamp()
        .setDescription(message.translate("administration/addcaptain:DES", {
          user: message.author.tag,
          name,
          member: member.user.tag
        }));
        teamData.save()
      message.channel.send(embed);
    } else {
      return message.error("administration/addcaptain:MISSING_NAME")
    }
  }
}

module.exports = Addcaptain;
#

Why i have error in teamData.save()

signal estuary
#

There is an client.onReady event. But is there a client.onStop event?

solemn jolt
#

This is my client

async findOrCreateTeam({ name: teamID }, isLean) {
    if (this.databaseCache.teams.get(teamID)) {
      return isLean ? this.databaseCache.teams.get(teamID).toJSON() : this.databaseCache.teams.get(teamID);
    } else {
      let teamData = (isLean ? await this.teamsData.findOne({ name: teamID }).populate("members").lean() : await this.teamsData.findOne({ name: teamID }).populate("members"));
      
      if (teamData) {
        if (!isLean) this.databaseCache.teams.set(teamID, teamData);
        return teamData;
      } else {
        teamData = new this.teamsData({ name: teamID });
        await teamData.save();
        this.databaseCache.teams.set(teamID, teamData);
        return isLean ? teamData.toJSON() : teamData;
      }
    }
  }
worn sonnet
#

ValueError: set_wakeup_fd only works in main thread on linux
I'm trying to thread two apps

#

in python

#

and this error shows up

#

it only shows in linux

#

and when googled all the solutions are for windows

sudden geyser
#

Can you show how you're running/starting your bot

worn sonnet
#
class Bot(BotBase):
    def __init__(self):
        self.PREFIX = PREFIX
        self.guild = None
        self.channel = None
        super().__init__(command_prefix=self.PREFIX, intents=intents, case_insensitive=True)


class DiscordBot(Thread):
    bot = Bot()

    def run(self):
        print("Starting The Bot")
        self.bot.run(TOKEN)


class FlaskApp(Thread):
    def run(self):
        if __name__ == '__main__':
            print("starting the app")
            app.run()


bot_thread = DiscordBot()
flask_thread = FlaskApp()

bot_thread.start()
flask_thread.start()

bot_thread.join()
flask_thread.join()
#

here

#

works fine on windows machine

#

but gives error on linux

solemn quartz
#

Hello, i'm having a problem with my welcome and goodbye message code, it worked perfectly until some days ago it stopped working, can someone help me?

//benvenuto membri
client.on("guildMemberAdd", benvenuto => {
  if (benvenuto.user.bot) return;
    const benvenutoC = benvenuto.guild.channels.cache.find(channel => channel.id == "826524704579387482")
  if (!benvenutoC) return;
  const benvenutoE = new Discord.MessageEmbed()
  .setColor("#F79600")
  .setTitle("Benvenuto " + benvenuto.user.username + "!")
  .setDescription("------------------NUOVO MEMBRO------------------------\n:call_me: Ciao <@" + benvenuto.user.id + ">, benvenuto in π•π•šπ•β€™π•€ π•”π• π•žπ•žπ•¦π•Ÿπ•šπ•₯π•ͺ!\n:eyes: Sei il " + benvenuto.guild.memberCount + "Β° membro!\n:no_entry: Prima di fare altro, leggi il [#826521456157917226](/guild/264445053596991498/channel/826521456157917226/)\n-----------------BUONA PERMANENZA-------------")
  .setThumbnail(benvenuto.guild.iconURL())
  benvenutoC.send(benvenutoE)
})

//Addio membri
client.on("guildMemberRemove", addio => {
    const addioC = addio.guild.channels.cache.find(channel => channel.id == "827838537050357780")
  if (!addioC) return; 
  if (addio.user.bot) return;
 addioC.send(addio.user.username + "#" + addio.user.discriminator + " ha preso il volo. πŸ˜ͺ")  
})
vivid fulcrum
#

did you enable the server members intent both in your code and on the website

feral aspen
#

What's the difference between prototype and adding a new property?

#

I'm confused, I read the JavaScript learning thing, but yet don't understand much.

lyric mountain
#

prototype adds a new property to all objects derived from it afaik

#

so like, if you add isNumber() to String.prototype, all strings will have isNumber() function

umbral zealot
#

I don't suggest ever changing the prototype of anything. This was done in the hayday when you couldn't have classe in JavaScript, but... Classes are a thing now, you should use them instead

sudden geyser
#

It's useful for defining extensions on already-existing types.

worn sonnet
deep mantle
#

whats the error

worn sonnet
#

ValueError: set_wakeup_fd only works in main thread on linux

lyric mountain
#

did u search on google?

worn sonnet
#

i did and all the sols are for windows

#

not for linux

lyric mountain
#

did u use client.start()?

worn sonnet
#

yeah

lyric mountain
#

all solutions say that using start instead of run solves the error

worn sonnet
#

and then the bot doesn't work

lyric mountain
#

with what error?

worn sonnet
#

well when i try to fetch data using bot

#

it gives None

lyric mountain
#

could you be more detailed?

#

fetch what data?

worn sonnet
#

for example

#

bot.user.avatar_url

#

bot.user returns None

lyric mountain
#

isn't that because the user isn't cached?

worn sonnet
#

Nope

#

the
bot.user
returns the profile of itself

lyric mountain
#

idk then, but you should address that issue instead of the former

worn sonnet
#

ah so i looked up again and the Docs says

#

Represents the connected client. None if not logged in.

#

so how do i connect with client.start?

deep mantle
worn sonnet
deep mantle
#

so you need an async function to run the client.start

worn sonnet
#

checked stackoverflow they say client.start no longer supports

deep mantle
worn sonnet
#

and i deployed using that method

#

it throws same error

#

wait

#

lemme re deploy it

sudden knoll
#

you should use quart instead of flask

#

quart is flask but asynchronous and with way way less documentation

quartz kindle
#

shivaco usually recommends sanic

#

if im not mistaken

worn sonnet
#

how do i thread async?

sudden knoll
#

wdym

#

ideally, you won't have to make a new thread

worn sonnet
#

i mean i'm still using flask

sudden knoll
#

Here's an example of some quart/discord bot code

import discord
import os
from discord.ext import commands
from dotenv import load_dotenv
from quart import Quart

load_dotenv()
TOKEN = os.getenv("DISCORD_TOKEN")
PREFIX = "!"

bot = commands.Bot(command_prefix=PREFIX)

@bot.event
async def on_ready():
    print(f'{bot.user} has connected to Discord!')

@bot.command(name="hi")
async def hi_command(ctx):
    await ctx.channel.send("hello")

app = Quart(__name__)

@app.route("/")
async def hello():
    return "hello world"

bot.loop.create_task(app.run_task())

bot.run(TOKEN)
worn sonnet
#

so Quart is the way to go

sudden knoll
#

you can also do
bot.loop.create_task(app.run_task(host=HOST, port=PORT))
sub in your actual host and port for HOST and PORT

sudden knoll
#

it's just a lot harder to find documentation on Quart

#

like a lot

#

harder

#

those are the docs btw

sudden knoll
#

ohhh

#

you're using heroku?

worn sonnet
#

the only reason i'm threading

sudden knoll
#

use this then:

PORT = int(os.environ.get("PORT", 5000))
bot.loop.create_task(api.app.run_task(host='0.0.0.0', port=PORT))```
sudden knoll
#

also for the procfile
hypercorn -b 0.0.0.0:$PORT MODULENAME:app

#

gotta put that for the procfile

sudden knoll
#

np, I suffered a lot trying to figure this out

#

glad you won't have to as well

worn sonnet
#

this will be needed for Quart right?

sudden knoll
#

yup

#

hypercorn is necessary for quart

#

like gunicorn but asynchronous

worn sonnet
sudden knoll
#

lmao

worn sonnet
#

like from 10AM

sudden knoll
#

that's not too bad

worn sonnet
#

It's 12AM

#

here

sudden knoll
#

lmao

worn sonnet
#

i did took few breaks

opaque acorn
#

doesnt show the image and the hearts
`
const Discord = require("discord.js");

module.exports = {
name: 'beso',
description: 'Besar a un usuario',
aliases: ['b'],
async execute( client, message, args ) {
const member = message.mentions.users.first();

    const gifsbesos = ["https://i.imgur.com/wGwmCB3.gif", "https://i.imgur.com/gD2lbAB.gif",
    "https://i.imgur.com/FGjViBU.gif", "https://i.imgur.com/gjnJuND.gif",
    "https://i.imgur.com/N2Vk9A2.gif", "https://i.imgur.com/qatdjzJ.gif",
    "https://i.imgur.com/rTmHQtX.gif", "https://i.imgur.com/BycHjfh.gif",
    "https://i.imgur.com/5gAwEzp.gif", "https://i.imgur.com/jMZEz5d.gif",
    "https://i.imgur.com/Wewugby.gif", "https://i.imgur.com/7rUwGEV.gif",
    "https://i.imgur.com/QicmrQF.gif", "https://i.imgur.com/q50sUzB.gif"];

    const randomgif = Math.floor(Math.random()*(gifsbesos.lenght));

    const corazones = ["πŸ’ž", "πŸ’—", "πŸ’•", "❀️"]

    const randomcorazon = Math.floor(Math.random()*(corazones.lenght));

    if(!member) return message.reply(' ❌ Debes mencionar al usuario que quieres besar !');

    const embedbeso = new Discord.MessageEmbed()
    .setTitle(` ${corazones[randomcorazon]} Β‘ **${message.author.username}** besΓ³ a **${member.username}** !`)
    .setImage(gifsbesos)
    .setTimestamp();

    if(member) return message.reply(embedbeso);
}

};`

sudden knoll
#

if you looked on stack overflow you could've seen this code exactly

sudden knoll
#

yuh that's me

worn sonnet
#

but i was stuck on flask

vivid fulcrum
#

recreating arrays on every command notlikenoot

sudden knoll
#

nah screw Flask, gotta go for that Quart

worn sonnet
#

modulename is filename right?

sudden knoll
#

yeah

#

like a normal procfile

#

oh wait

#

also put web in front

worn sonnet
#

and i can remove ports

sudden knoll
#

web hypercorn -b 0.0.0.0:$PORT MODULENAME:app

#

put that exactly

#

except instead of modulename put your filename

#

also if the app is a different name, put a diff name

finite leaf
#

why is reacted.remove undefined

deep mantle
#

I am trying to make a global leaderboard for my bot and need to fetch members names, would it be better to use client.get_user or await client.fetch_user?

finite leaf
#

fetch

#

might not be cached otherwise

deep mantle
#

ok thanks

earnest phoenix
#

exports.run = async (message, args, options) => {
    
    const guild = message.guild;
    const embed = new Discord.MessageEmbed()
    .setColor(options.colors.gray)
    .setDescription(message.language.get("SERVERINFO_FIELD")
        .replace("{name}", guild.name)
        .replace("{id}", guild.id)
        .replace("{own}", "<@"+guild.owner+">")
        .replace("{region}", guild.region)
        .replace("{memberCount}", guild.memberCount)
        .replace("{roleCount}", guild.roles.cache.size)
        .replace("{channelCount}", guild.channels.cache.size)
        .replace("{boostCount}", guild.premiumSubscriptionCount))
        .setThumbnail(guild.iconURL({
            dynamic: true,
            format: "png"
        }))
    return message.channel.send({
        embed: embed
    });
};```

Why my .setThumbnail doesn’t work? I have no one error and the guild icon doesn’t display..
earnest phoenix
#

ok

#

same bug

#

:/

#

i’m dumb.. the server hasn’t icon lmao @digital swan

digital swan
#

LOL rip

#

i'd end up doing the same thing for hours

worn sonnet
sudden knoll
#

wdym servers widget

worn sonnet
#

I mean the one discord gives

sudden knoll
#

oh you mean the token?

worn sonnet
#

No no

#

The Server widget it

#

Provides in iframe

sudden knoll
#

oh

#

I have no idea how to work that stuff

#

I just use quart for a voting webhook

#

also donation webhook

worn sonnet
#

Thanks to ya it got working for now

sudden knoll
#

hmm yeah you're gonna have to talk to someone else about website design

worn sonnet
sudden knoll
#

all I know is some basic html

#

that looks pretty nice

worn sonnet
#

Well it's related to heroku itself

#

But nvm

#

I'll just look into it

worn sonnet
sudden knoll
#

yeah

#

is it a bot or a server

#

or both

worn sonnet
#

A bot and it's server

#

A friend of mine crated the Server

#

And I was just messing around with discord bots

sudden knoll
#

what does it do?

worn sonnet
#

For now it does all those simple things

#

Like setting up Welcome messages

#

Either embeds or images

sudden knoll
#

oh that's cool

worn sonnet
#

Should I DM?

#

Cuz mods may not like it

sudden knoll
#

wdym

torn musk
#

Hi

worn sonnet
torn musk
#

bye

worn sonnet
brave tendon
#

Why am I getting a

FetchError: invalid json response > body at <url> reason: > Unexpected end of JSON input
``` error when I am sending a request from a vserver but not when I run it locally on my pc
#

It is the same code nothing changed.. when sending from the server I get the error ... when sending from my pc not

lyric mountain
#

json is invalid

proven lantern
lyric mountain
#

likely a dangling bracket or quotation mark

sudden knoll
#

you might need a header?

#

idk though

brave tendon
#

It is the exact same code I used on my pc

proven lantern
#

can you ssh into the server and do a curl request to the endpoint?

sudden geyser
#

[PostgreSQL] I have a tags table following a many-to-many relationship. It has a media_id and character_id column which both reference a row on another table (media or characters). I want the tags table to force rows to reference one (and only one) row from another table. So, media_id could have a value and character_id could be NULL, but media_id and character_id can't both have values (and they both can't be null either).

How would I implement something like this?

lost heath
#

hello. i was wondering if someone knew why this code // This figures out which day it is var days = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"]; var day = days[time.getDay()]; thinks its one day behind what it is. its the second today but it says its the first

sudden geyser
#

I'm already using foreign keys. I want to see how I can restrict it so only one of the foreign keys are allowed to be present.

proven lantern
#

UNIQUE

sudden knoll
sudden geyser
#

Could you show an example?

lost heath
#

you mean it counts from 0?

sudden knoll
#

that's how lists work

lost heath
#

it counts from 1 to 31

#

oh wait. im using getday. ill try getdate

sudden knoll
#

yeah ik that, I'm saying it returns 1 and your list's index 1 = 2

lost heath
#

what?

proven lantern
lost heath
#

which is 1

sudden knoll
#

days[0] = 1

#

days[1] = 2

lost heath
#

you confuse me

sudden knoll
#

so on until days[30] = 31

lost heath
#

i still dont understand

sudden knoll
#

do you know how array indices work?

lost heath
#

yes

sudden knoll
#

okay

#

so getDay() returns 1 right?

brave tendon
lost heath
proven lantern
sudden knoll
#

oh it's behind?

lost heath
#

wait. i think i fixed it ``` var time = new Date();

    // This figures out which day it is
    var day = time.getDate();
sudden knoll
#

wack

sudden knoll
#

probably timezone stuff then

lost heath
sudden knoll
#

yeah but does time.getDate() get your local timezone

lost heath
#

it would appear so

#

okay. it would appear to work now. thx for the help

brave tendon
proven lantern
proven lantern
#

that looks fine

#

is the url you are calling hosted on your localhost?

brave tendon
#
fetch("https://w2g.tv/rooms/create.json", {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json'
            },
            body: JSON.stringify({
                "w2g_api_key": w2gKey,
                "share": "",
                "bg_color": "#000000",
                "bg_opacity": "90"
            })
        })
        .then(response => response.json())
        .then(function (data) {

            const NewRoomEmbed = new Discord.MessageEmbed()
            .setColor('#8467b8')
            .setTitle("A new room has been created")
            .addFields(
                { name: `Room Link`, value: `[https://w2g.tv/rooms/` + data.streamkey + `](${data.streamkey})`}
            )
            .setFooter(client.user.username, client.user.displayAvatarURL())
            .setTimestamp()
            message.channel.send(NewRoomEmbed);
        })
        .catch(error => console.log(`Error on 'w2#create': ${error}`));
#

thats the code snippet.. on my pc it works fine but the same code on server gives the invalid json body response

proven lantern
#

what does the curl respond with?

brave tendon
#

one moment

proven lantern
brisk gate
#

does anyone know if it's possible to know who installed your bot to the guild?

#

i am working on install flow and I don't want to send DM to the guild admin but rather to the person who added to the server

brave tendon
brave tendon
brisk gate
proven lantern
brave tendon
#

ahh

#

okay

proven lantern
brave tendon
brisk gate
sudden geyser
cosmic forum
#

I noticed that for many websites, under their "Partners" section, they have the logos of their partners in grayscale, and when you hover over them, they fade into color. Anyone know how I could achieve that effect?

proven lantern
sudden geyser
brisk gate
sudden geyser
#

I don't think it's possible to know who invited your bot without audit logs permission.

unreal kiln
#

does anyone know how to make a discord bot play music in a stage channel since that i saw rtyme do it i want to know

#

and i use distube for the music

vivid fulcrum
#

you'll have to modify your library

#

or wait for the lib maintainers to implement it

unreal kiln
sudden knoll
#

that's how I do it at least

vivid fulcrum
#

because distube is a library for lazy ass developers that integrates with djs

#

they aren't maintaining djs

unreal kiln
vivid fulcrum
#

lmao

sudden knoll
#

I mean this way works

unreal kiln
#

on my bot

mystic osprey
#

Who decided that ! was going to be every frickkn prefix for bots

sudden geyser
#

newer devs

mystic osprey
#

What did it used to be

sudden geyser
#

Nah, like ! is more common for newer developers to choose for their bot

#

imo ! is only nice in development, but as soon as it hits production please don't use !

mystic osprey
#

I like / but my first bot uses $

sudden geyser
#

or make it configurable

#

I usually stick with $$

mystic osprey
#

Why not use !

sudden geyser
#

it's very common

mystic osprey
#

Oh

#

This is why / commands are the best

sudden geyser
#

The new slash commands?

mystic osprey
#

Yea

sudden geyser
#

I haven't tried those yet, but yeah, they're nice for getting rid of prefix problems like that

sacred juniper
#

Can i manage a bot without vds?

mystic osprey
sacred juniper
#

It is an securiate system and a machine for shard
as far as I know

sudden geyser
#

Do you mean VPS?

#

Yeah, a lot of devs do.

umbral zealot
#

And they're not jokes. They're just not appropriate for hosting bots.

#

I see your baby, editing that message to look less like a wawa_clown

lyric mountain
#

virtual droplet server

#

aka digital ocean

#

no, they're shit for long-running apps like bots

mystic osprey
#

Paid in Bitcoin

#

Like $60 in total

#

Run a bunch of stuff on it

lyric mountain
mystic osprey
#

I got 2gb I think

#

And on sale

lyric mountain
#

"shouldn't" KEKW

mystic osprey
#

Cmon one of my friends ran a discord bot off a raspberry pi

lyric mountain
#

the specs don't help too much also

lyric mountain
#

but you need to sacrifice A TON of caching which will make the bot sluggish

mystic osprey
#

Yeah here we go

lyric mountain
#

then there's this

mystic osprey
#

Also I can't afford that shit

lyric mountain
#

from contabo

#

and it's not that expensive

mystic osprey
#

It's not expensive but it's not ideal

lyric mountain
#

not ideal???

mystic osprey
#

My stuff is fine on my vps

lyric mountain
#

how are that 1GB 1CPU specs ideal then?

mystic osprey
#

I have 2gb 2cpu

#

And it's cheap

#

$4 a month or whatever

#

I guess it's not that bad

#

But

#

I'm fine

lyric mountain
#

for now

mystic osprey
#

for now

#

My bot latency is anywhere from 30-50ms

finite leaf
#

why does the login button not align to the right?

lyric mountain
#

latency depends only on distance to server

mystic osprey
#

Ohhh

#

I thought it was from user <-> bot

modest maple
#

it's user -> discord -> bot -> discord -> user

mystic osprey
#

No it's

#

discord -> bot

modest maple
#

CoffeeSip And where you think the response is going and how discord knows to send the event

lyric mountain
mystic osprey
#

How you think the bot can update the latency when it already sent the message

modest maple
#

KannaWhat what

sudden geyser
#

The user sends some data -> discord receives and processes it -> your bot receives the data and you process it -> discord receives the response from your bot and processes it -> the user receives data (which was emitted by your bot)

finite leaf
#

???????

modest maple
#

by default a flex box will shrink to it's smallest possible width without wrapping content

finite leaf
mystic osprey
#

Use absolute position

modest maple
#

please god dont

mystic osprey
#

I'm KIDDING

finite leaf
#

lol ye no, ik

mystic osprey
#

This is basic css

finite leaf
#

not for everyone πŸ€·β€β™‚οΈ

#

apparently align-self: right is invalid?

mystic osprey
#

Try text align

#

Nah use

modest maple
#

well by default align-self applies to the vertical axis

mystic osprey
#

float: right;

modest maple
#

unless it's flex column where it rotates basically 90 deg

finite leaf
#

apparently just needed margin-left: auto

mystic osprey
#

BotGhost KEKW

modest maple
#

if you want anything else to go right it'll affect it's siblings

finite leaf
#

then give me optimum solution 😒

lyric mountain
#

flex

opal plank
mystic osprey
modest maple
#

ima do it in tailwind so it's easy to write out rq:

<nav class="flex justify-between w-full h-16">
  <div>left</div>
  <div>right</div>
</nav>
lyric mountain
#

there's like -1 reason not to use flex nowadays

modest maple
#

the nav child will inherit the parent's full width

mystic osprey
lyric mountain
#

fed websites don't even have css

mystic osprey
#

Tru

#

Or they use Wordpress

modest maple
#

did someone say vulnerabilities?

mystic osprey
#

Yeah

opal plank
#

who needs css when you can render the whole website inside an iframe?

mystic osprey
opal plank
#

--yolo

mystic osprey
dire kraken
#

Can anyone just give me a python eval command cog

#

Would be highly appreciated

opal plank
dire kraken
#

:o

opal plank
#

against the rules

mystic osprey
#

DID SOMEONE SAY VULNERABILITIES

dire kraken
#

Ok can someone help me make one?

mystic osprey
#

No

#

Do it yourself

#

It's hella easy

dire kraken
#

Back to stackoverflow πŸ˜…

opal plank
#

CSS(Cascade Styling Sheets) has casdade in the name because you make one minor change and it will cascade all the way down detroying everything in its path mmulu

#

what could go wrong making this box smaller?

mystic osprey
finite leaf
#

erm

dire kraken
#

Is there any free way to host a bot

#

Without it running on ur pc

mystic osprey
#

Save up and buy a vps

#

They cost $2-16 a month

opal plank
#

more like $1-$300

#

or for free if you have a credit card

#

aws offers a 1 year trial if you use ur credit card

#

also f1' micro from google

minor urchin
#

Try heroku it gives 550 hrs a month per repository and if it runs out, just make a new repository if you plan to pay nothing on bot hosting

viscid merlin
#

heroku is ass

cosmic forum
#

It also gives u two free instances permanently.

dire kraken
#

@cosmic forum AW FR?

#

TYSM!

cosmic forum
#

np

quaint wasp
#

what the fuck is wrong with my Northon and my PC security system? it doesnt let my close my apps, says this app made a suspiciaus action. Rish: Hight

#

ITS JUST TRYING TO CLOSE IT TSELF

boreal iron
#

He he he... imagine using an external anti-virus application decreasing your system speed dramatically and sharing your system Information and your activities to help to "improve" their apps.

earnest phoenix
#

Can someone help me
im getting these random null messages spamming on my console tho i dont know where the origin of where these are coming from

#

code? lol

#

it has something to do with your code, not normal node

oak crag
#

prolly a loop kek

earnest phoenix
#

im not sure what part of my code is coming from xd

lyric mountain
#

Right click root -> find in files -> console.log

oak crag
#

It has to be a loop or on_message()

#

I don't see anything else that could spam

lyric mountain
#

Pretty much any routine task

oak crag
#

mmh mmh

earnest phoenix
#

so a event probably

lyric mountain
#

Cron, loops, setInterval, events and commonly called methods

earnest phoenix
#

hmm πŸ€”

lyric mountain
#

Just search the whole project for console.log

earnest phoenix
#

my whole project has console.log over 200 files has it

#

245 to be exact xd

lyric mountain
#

It shouldn't tbh

oak crag
#

MonkaS

lyric mountain
#

Console.log should never make into production

oak crag
#

Why all of this pain

earnest phoenix
#

right

crimson meteor
#

I just tried pushing an official update for my bot, and it's telling me that my port is already in use
I'm not sure what's listening through this port other than myself
The only thing the update did to my DBL cog was make it give me some items when it receives a vote
It's giving me OSError 98
I have my bot on a runner, and it restarts every time I restart the Pi
That's the only way I can restart the bot
I don't see how another program is running around through my port
Could anyone help with this?

earnest phoenix
#

Anyone got a code I can use for music

#

or ideas

umbral zealot
#

There's like a thousand music bots on discord

lyric mountain
crimson meteor
#

I don't use control c
I literally just restart the Pi to restart the bot

lyric mountain
#

Maybe there're some leftover processes

#

Why?

crimson meteor
#

it's a runner

lyric mountain
#

Like, you can just shutdown the proccess

crimson meteor
#

a startup process

crimson meteor
lyric mountain
#

Why doing that?

#

Just literally quit the process though code

crimson meteor
#

huh?

lyric mountain
#

But before that, close all streams and terminate background tasks

#

Like, you know that all languages have some sort of exiting the process right?

crimson meteor
#

I'm not exactly the best at Ubuntu Server and Raspberry Pi

lyric mountain
#

Regardless of operating system

#

Exit from the code itself

crimson meteor
#

and how do I start it again
Just run the file?

lyric mountain
#

Yep

#

Or use stuff like pm2

crimson meteor
#

That still doesn't help very much with the current problem

lyric mountain
#

It does

#

It might be some leftover process messing stuff

crimson meteor
#

How can leftover processes exist if I stopped all running processes and restarted the Pi

lyric mountain
#

Idk, nowadays I don't even question it

#

Ever tried fixing a printer?

craggy pine
lyric mountain
#

You don't fix printers, you convince them to work

craggy pine
#

Tis true. My job is also convincing the old people that it's not fixable bec fuck printers

lyric mountain
#

Also everytime you disassemble one and reassemble you end up with more screws than when you started

#

But anyway @crimson meteor, try running fuser -n tcp -k PORT to see if it solves your issue

#

That'll kill whatever is running on that port

#

And tell you what it was

crimson meteor
#

it didn't do anything

#

or didn't say anything

craggy pine
crimson meteor
#

also it didn't end my bot process

lyric mountain
#

Yw

lyric mountain
#

What port does it state that's in use?

crimson meteor
#

not even my bot?

#

It was working fine before I made it give out gifts

crimson meteor
lyric mountain
#

Ok, 5000 is safe

#

Afaik

#

Aren't u starting two webservers in the same port in the code?

crimson meteor
#

am I?

#

i don't think so

lyric mountain
#

I can't think of anything else

quiet pawn
#

@mighty ember

#

heroku seems to be fine for me

#

i ran a bot with almost 1k servers on it

#

worked fine

#

no issues

mighty ember
#

yes, so does using a single JSON file to save data, but it's not fine in some hidden ways

quiet pawn
#

just slow with updating from github thats all

mighty ember
#

willing to try testing my API? (it makes a graph)

clear marlin
#

it makes graphs. How does one request?

mighty ember
#

a get request

#

or typing in discord replaces with an image

clear marlin
#

that's cool

#

so it uses node canvas?

mighty ember
#

no

#

matplotlib

clear marlin
#

ah, so you used python

mighty ember
clear marlin
#

that's cool, haha, good work!!

mighty ember
#

it's really easy, except to make it good

#

and i already had the code to graph a function for my actual bot

#

just needed to add images for it

clear marlin
#

mhm, you could add more types of graphs

mighty ember
#

i plan to

clear marlin
#

its a good idea because people can make graphs using any other programming language

mighty ember
clear marlin
#

cool, you made any wrappers for the api?

mighty ember
#

if i make it public, i'll need to have API keys to limit people

mighty ember
#

i have no idea what that means

clear marlin
#

Yep, Jwt

clear marlin
mighty ember
#

oh

#

a programming library?

clear marlin
#

yeah like pypi has packages

mighty ember
#

okay

#

i don't know many other languages, so just https requests

clear marlin
#

nah, its cool

mighty ember
#

if you wanted to, i could say that yours is the official one (sort of official)

#

python doesn't need one because matplotlib is python

clear marlin
#

you should also ratelimit the api, like 50 requests per minute or somethin

mighty ember
#

i could, but not yet

clear marlin
#

yeah

mighty ember
#

it does lock for now, and delays all requests if one's in progress

#

what language(s) do you use/know?

clear marlin
#

I'm more of a gopher, and I know nodejs

mighty ember
#

okay

clear marlin
#

did you use flask, for the web server?

mighty ember
#

flask

#

i have a website on it too

clear marlin
#

if you make it public any day

opaque scroll
#

may i ask something. I'm new here.
How do my BOT get approved?

mighty ember
#

it'll go along with my bot

clear marlin
clear marlin
opaque scroll
#

I already add my bot. is there anything I should do to get it approved?

mighty ember
clear marlin
clear marlin
drowsy epoch
#

Does anyone know a good coloration site for programming?

opaque scroll
clear marlin
#

yeah, np!

clear marlin
drowsy epoch
clear marlin
#

lmfao

#

the best I know

drowsy epoch
slim heart
#

use vsc live share

drowsy epoch
#

Sorta un reliable

clear marlin
#

or maybe repl.it. But its not as good

slim heart
#

and regardless live collaboration coding never works well in scale and shouldn’t be used to create a creation workflow

drowsy epoch
#

repl makes me sick

#

good point

slim heart
#

you should stick to simple git and have certain people take on certain projects

#

if you want to do a one off coding session with your friend or something vsc live is your best bet

earnest phoenix
#

repl make me happy (not judging any body)

patent basalt
#

I'm making something similar to top.gg's voting system. But I'm thinking about how to implement a monthly reset of votes. Is it the best way to reset DB values ​​using cron?

slender thistle
#

Top.gg probably checks for last vote timestamp on vote and in case it was from previous month, reset monthly votes and then append the current onr

delicate shore
#

I want to get all the emails

#

from sent section

#

zoho

#

any wya?

patent basalt
vagrant grove
#

how to edit bot avatar?

#

same

earnest phoenix
#

hello this is my code how could i make it send it every 10min

#

in a specific channel

vagrant grove
#

same

delicate shore
#

Hey guys

#

I have a CSV file

#

with over 200 contacts

#

emailI*

earnest phoenix
#

??

delicate shore
#

I want to use NodeMailer to send mail to everyone

#

any idea how I can do that

sacred juniper
#

Can Δ± do shards with BDTM

delicate shore
#

I want to get The "email" part for each

#

and mail them

vagrant grove
#

thx

cinder patio
delicate shore
#

here

opal plank
#

this is a great way to completely fuck up your bot

#

ikd how experienced with js you are, but you do realise the implications of what you just wrote right?

earnest phoenix
#

..

opal plank
#

EVERY time someoen sends a message, it'll start a new loop to send messages in the channel. Now, heres the fun part, if someone were to dm your bot 40 times, or if you leave ur bot running for an hour, you'll like start spamming your bot which will lead to ratelimiting

#

also, message isnt even defined there

#

you calling a function but are not passing the parameters

#

nor is channel

#

where did you copy that code from?

earnest phoenix
#

........

opal plank
#

i dont understand dotlanguage, sorry

thorny flume
#

Hi

opal plank
thorny flume
sacred juniper
#

@opal plank how did you do your state

sacred juniper
#

Ok thx

opal plank
#

np

sacred juniper
#

Can i use shards on BDTM

opal plank
#

dunno what that is

sacred juniper
#

<β€’β€’β€’>

opal plank
#

another one with dotlang

earnest phoenix
#

guys how can i connect a webhook to twitch so it can send a message when someone is live?

opal plank
#

twitch should have webhooks already for that

earnest phoenix
#

how do i connect it to my discord server

opal plank
earnest phoenix
#

ok thanks

cinder patio
# delicate shore

... but like... it's on that site? You want to scrape it from a site

tardy hornet
#

why didnt it update the hours?

hasty stream
#

botumu doğrulayııınn

tardy hornet
#

english?

hasty stream
#

verify my bot

#

but how

#

let's

#

let's let's

#

let's!

#

;_;

#

@tardy hornet my verify boooooottt

tardy hornet
#

dont ping me

#

for that

hasty stream
#

what ping

earnest phoenix
#

guild.channels.set(channel.id, channel);

TypeError: Cannot read property 'id' of undefined
summer torrent
#

what is error

tardy hornet
earnest phoenix
#

Any cn come to review my bot personaly

sudden knoll
sudden knoll
#

why don't you use mod to check week, then day, then hour, then minutes, then seconds?

#

instead of hour then week then day

opal plank
#

is there a way to get scopes allowed in a guild?

#

when you invite the bot, like slash commands scope, bot, etc

sudden knoll
#

wdym, there's the oauth link that lists the perms you should give a bot

opal plank
#

these

#

it is indeed oauth, but i cant find proper way to see if i can add slash commands onto a guild

#

speciffically this

sudden knoll
#

click bot and in there are slash commands

opal plank
#

wait what?

#

theres only a USE_SLASH_COMMANDS bitfield, there isnt one for checking if i can register slash commands onto a guild tho

sudden knoll
opal plank
#

thats why i'd need to know if the bot was authorized

#

bento

#

i dont want to generate an invite

#

i want to check if the bot has permission to add slash commands

sudden knoll
#

oh you wanna see if it has the perm

opal plank
#

2 different things

sudden knoll
#

I see now

#

@commands.bot_has_guild_permissions(**perms) for python

opal plank
#

did u read what i sent?

opal plank
#

unless its merged with MANAGE_GUILD or some other perm

#

but im not findingh anything in the docs for it

earnest phoenix
#

guild.channels.set(channel.id, channel);

TypeError: Cannot read property 'id' of undefined
opal plank
#

also guild might be undefined, dm messages for example

delicate shore
#

I just used an online csv viewer

sudden knoll
slender thistle
#

Scopes?

opal plank
#

hmm

opal plank
#

to create slash commands in a guild

#

theres no permission for it

#

only USE_SLASH_COMMANDS

slender thistle
#

Is there any way to check your scopes within a guild?

sudden knoll
#

but you can't look through a bot's scopes can you

#

idk a way

opal plank
#

good question, thats what im looking for

#

like i said, unless its bulked into a permission like MANAGE_GUILD or something

#

but i highly doubt it

sudden knoll
#

don't think it's in one of those

#

I think the only way is to just try except or try catch

opal plank
#

might go bother cake evan or advaith to see if theres some super secret endpoint for that

#

there has to be a way to check it tho

slender thistle
opal plank
#

hmmm i dont think so

#

that'll only give me the scope for my user

slender thistle
#

Aye rip

sudden knoll
#
let totalSeconds = (client.uptime / 1000);
let weeks = math.floor(totalSeconds / 604800);
totalSeconds %= 604800;
let days = Math.floor(totalSeconds / 86400);
totalSeconds %= 86400;
let hours = Math.floor(totalSeconds / 3600);
totalSeconds %= 3600;
let minutes = Math.floor(totalSeconds / 60);
totalSeconds %= 60;
let seconds = totalSeconds;
let uptime = `${weeks} weeks, ${days} days, ${hours} hours, ${minutes} minutes and ${seconds} seconds`;
#

that would work right?

tardy hornet
#

yes

#

ty

sudden knoll
#

np

delicate shore
#

can anyone help

#

I have a csv file

#

I want to read data

#

from that file

#

and for each email send a mail to that email using nodemailer

#

how can I fetch the dta

earnest phoenix
#

how add emoji in bot

tardy hornet
#

get the emoji's id

earnest phoenix
delicate shore
#

there are over 200 records

#

I want to get email of each

quartz kindle
#

open the csv file in notepad

#

and youll see what delimiter its using

tardy hornet
#

that

delicate shore
#

I am on mac tho

quartz kindle
#

textedit

delicate shore
#

okk

tardy hornet
#

that

#

@earnest phoenix

quartz kindle
delicate shore
#

tim

#

it seems really weird

#

uh really really weird

tardy hornet
delicate shore
#

I cant send it here because it has a lot of emails

tardy hornet
boreal iron
#

Comma or no comma that’s the question to split your CSV

tardy hornet
delicate shore
#

this is how it does all stuff

tardy hornet
#

i use it

quartz kindle
delicate shore
opal plank
delicate shore
#

like this

sudden knoll
#

how else will it be able to access the emoji

boreal iron
#

There you go , is the delimiter

delicate shore
#

oh

sudden geyser
#

mmm, commas

boreal iron
#

And ; inside for more than 1 argument

delicate shore
#

but I dk what is a delimeter

#

a lof of commas are there

#

how do I do stuff lol

tardy hornet
sudden geyser
#

its a separator

quartz kindle
boreal iron
#

You SPLIT by commas and the items of the array by ;

quartz kindle
#

idk anything about slash commands, remember?

delicate shore
#

but a lot of commas are there

boreal iron
#

Yes check if the item is empty or not

opal plank
boreal iron
#

The structure is always the same

quartz kindle
#

a csv file is like a table

delicate shore
quartz kindle
#

you open the file

#

split by new lines

#

then each line you split ny commas

#

and you have the table in a 2d array

boreal iron
#

It’s getting more complicated using a parser than simply splitting the items separated by a comma already

opal plank
quartz kindle
#

yes thats exactly how csv looks like

delicate shore
#

I can use parser seems easy

#
    // [
    //   { NAME: 'Daffy Duck', AGE: '24' },
    //   { NAME: 'Bugs Bunny', AGE: '22' }
    // ]
boreal iron
#

No Detritus ads so far?

sudden knoll
#

why wouldn't you use a parser?

opal plank
boreal iron
opal plank
sudden geyser
#

that gif KuuHaKu made is invaluable

eternal osprey
#

hey! Why is my code not working? js var pStart = now(); message.channel.send(":ping_pong: Checking ping... please wait :clock1: ").then(message => { var pEnd = now(); message.edit("Current latency is " + (pEnd - pStart).toFixed(2) + " ms and the current websocket ping is " + client.ping.toFixed(0) + "."); }).catch(error => console.log("Error executing ping command:\n")); };

#

is it because the .then is deprecated in v12?

#

i have to await it now right

quartz kindle
#

no lol

sudden geyser
#

.then isn't deprecated

#

What isn't working about it

eternal osprey
#

owh