#development

1 messages · Page 1769 of 1

thin quarry
#

replit + uptime robot

earnest phoenix
#

but it's mostly an ide

thin quarry
#

is hosting

near stratus
#
const express = require('express')
const Topgg = require('@top-gg/sdk')

const app = express() // Your express app

const webhook = new Topgg.Webhook('topggauth123') // add your top.gg webhook authorization (not bot token)

app.post('/dblwebhook', webhook.listener(votedUser => {
  //Give user reward
}));

app.listen(3000)
near stratus
thin quarry
thin quarry
#

but u have to pay

thin quarry
visual goblet
#

fuck yeah

#

fixed it

ember wraith
#

. .

visual goblet
#

just needed to reset the token

near stratus
lyric mountain
near stratus
mortal basin
#

how to get dbl_secret ?

earnest phoenix
#

Does MongoDB $lookup run in parallel?

#

Like if i have 2 look ups but i want them to run in parallel. Is that possible and if so how to do that?

lyric mountain
#

depends, what do you mean with "parallel"?

earnest phoenix
#

Like i have 2 $lookup in my aggregation pipeline and they execute in parallel. Not like after first completed and then the second $lookup starts working. When they both end it returns the data

lyric mountain
#

if I understood right, it joins the two tables and return the aggregation of them

#

so I guess it's sequential

#

and damn, if it is equivalent to this sql then that's a VERY costly operation

earnest phoenix
#

I don't think such widely used operator in aggregation would be an issue in mongo.

rocky hearth
#

in vsc, I want to see source code of a function in node_modules. But instead it leads me to the type declaration.
So do I see that?

opal plank
#

the .js file should be in the same folder hopefully

#

usually its file.ts/file.js together

rocky hearth
#

so I manually need to search through the files?

opal plank
#

not quite

#

open the file delcaration and it should point u at the current file on ur file explorer

#

@rocky hearth

sterile lantern
#

im editing it so it changes the embed, how would i completely remove the buttons after either one is clicked?

rocky hearth
#

ooh wow. How do u make these gifs?

opal plank
#

sharex

sterile lantern
pale vessel
#

yeah

sterile lantern
#

do i add button.defer()

#

or no

#

because i have that

#

and it doesnt work

pale vessel
#

no clue, are you using discord-buttons?

sterile lantern
#

yep

pale vessel
#

yeah idk

crimson vapor
sterile lantern
#
button.message.edit({
      embed: embed,
      components: []
    })```
opal plank
pale vessel
#

use buttons

#

buttons: []

cinder patio
#

Erwin is a normal person

opal plank
#

lies

crimson vapor
cinder patio
#

they don't commit every time they change a single line

pale vessel
#

discord.js doesn't support components yet so use properties that discord-buttons extend

opal plank
#

oh, that may be true

sterile lantern
#

still doesnt work

opal plank
#

but im clearly not normal

sterile lantern
#

lets me click it even after the dit

clear marlin
crimson vapor
#

discord-buttons kinda cringe

opal plank
#

discordjs cringe

crimson vapor
#

true

opal plank
#

use detritusjs

cinder patio
#

😉

#

depends

clear marlin
#

imagine using trash

#

jk Erwin

earnest phoenix
#

Ah yes, detritus ads anytime I open development

opal plank
#

yw

#

making it feel like home for you

sterile lantern
#

so only one use can use the button correct

#

i mean the person who ran the command can only use the buttons right

lusty quest
#

detritus is not bad, just not really that mature so that beginners could pick it up

sterile lantern
#

wut

#

ic

umbral lake
#

Hey

#

I have a question, if its possible to: if a user has a specific role, add a line in a embed

sudden geyser
#

It's possible

#

Depends on the library you're using

mental raven
#

Why this not work? Discord.py

@client.command()
async def invites(ctx, user:discord.Member=None):
  totalInvites = 0
  left = 0
  joined = 0
  for i in await ctx.guild.invites():
    if i.inviter == ctx.author:
      if ctx.guild.get_member(i.id) is not None:
        totalInvites += 1
        joined += 1
      else:
        left += 1
        joined += 1
  await ctx.send(f"Invites: {totalInvites}\nJoined: {joined}\nLeft: {left}")
sudden geyser
#

You tell us

#

What's the expected and actual behavior of the command

lunar patio
#

how do i make that if my command is !cd then bot replies after 1min

sudden geyser
#

What language are you using

lunar patio
#

js

sudden geyser
#

Use setTimeout

lunar patio
#

ok

mental raven
sudden geyser
#

Are you intentionally only incrementing the total if the invite was made by the message author

mental raven
#

ye

#

In short words i am trying to remake plasma's invite system

#

Because plasma dead

lunar patio
# sudden geyser Use setTimeout
async run (client, message, args) {

        const embed = new Discord.MessageEmbed()
        .setColor('#e0bff2')
        .setDescription(`ok`)
        setTimeout(function(){ 
            `Your cd is over!`
         }, 5);

        message.reply(embed);
    }``` like this?
topaz wedge
mental raven
topaz wedge
#

Well, what does Your cd is over go to?

lunar patio
topaz wedge
#

Well here's code you can use:

//...
const embed = new Discord.MessageEmbed()
        .setColor('#e0bff2')
        .setDescription(`ok`);
message.reply(embed);
setTimeout(() => message.reply(`Your cd is over`), 60000);
//it makes the embed, then waits 60000 ms (1 min) to send another message
lunar patio
#

ok let me check

#

@topaz wedge ya its working thanks

topaz wedge
#

No problem.

lunar patio
#

if i want to delete the ok msg after a min

topaz wedge
#

Ok:

const embed = //...

const sentEmb = await message.reply(embed);
setTimeout(() => {sentEmb.delete(); message.reply(`Your cd is over`)}, 60000)
#

Make sure it's async

mental raven
topaz wedge
lyric mountain
mental raven
#

lol

lyric mountain
#

lol what?

#

I asking for the expected vs actual results

#

like, what you expected to return

mental raven
#

yeah ik

lyric mountain
#

vs what you got

mental raven
#

Expected

#

What I got

lyric mountain
#

ok so, first of all you are checking for users that created the invite and if they're in the server

#

you can't check what users used what invites

#

for this, people tend to use the guessing trick

#

like, let's say your have two invites: A and B

#

A has 0 uses, and B has 2

#

an user joins the server, you check the uses again

#

A now have 1 use and B 2 uses

#

so you know the user that joined the server used invite A

#

you need to do that everytime an user joins the server and store the value to the database

mental raven
#

Can you make it more simple?

#

It's a bit confusing

fleet radish
#

lol

#

its clear ig

lyric mountain
#
Invite A: 0 uses
Invite B: 2 uses
#

an user joins the server

#
Invite A: 1 use
Invite B: 2 uses
mental raven
#

yes

#

then?

lyric mountain
#

then you add +1 to invite creator's invite count

tired panther
#

Does anyone knows the vs code cmd terminal good?

lyric mountain
#

vs code has no terminal

#

it's just windows' cmd/powershell embedded

tired panther
#

after I click on some option

#

now I am not getting the dropdown back 😦

lyric mountain
#

weird

fleet radish
#

bruh just press +

#

not the drop arrow

#

just press +

#

or from menu

#

click on new terminal

tired panther
pale vessel
#

did you try restarting vsc

fleet radish
#

pressing + just opens onto new terminal

tired panther
fleet radish
#

and yea restart

#

what happens when u click +

tired panther
fleet radish
#

tf

lyric mountain
#

what exactly is this?

tired panther
lyric mountain
#

you could try fresh installing it again

mental raven
#

How to get how many uses an invite has in discord.py?

cinder patio
#

you can also just use your terminal

tired panther
cinder patio
#

the default terminal your OS provides...

tired panther
#

and I am to lazy to start cmd lol, enter the path....

cinder patio
#

Shift + right click > open powershell window here

#

if you're on windows

quartz flume
#

What are some good hosting services?

earnest phoenix
fleet radish
#

just go to the folder where ur file is

#

do this

granite swan
#

Hi devs, I use a webhook to communicate from my game to Discord. How can I accept a webhook's input?

subtle river
#

if db[userid]["level"] >= config["mining_info"][mine]["lvlreq"] and db[userid]["prestige"] >= config["mining_info"][mine]["prestigereq"] and db[userid]["rank"] >= config["mine_info"][mine]["rankreq"]:

Why is throwing a "excpected bytes" error?

lusty quest
#

or from the game to discord?

cinder patio
#

It's still experimental in node 14

granite swan
granite swan
# lusty quest so you want to send a webhook back to the game?

I want the Game to push a command to the Discord (which works already) but the RaffleBot does not accept the input. If I copy paste the command manually, it is accepted. And since its a webhook and not a user, I cant give him permissions since the add permission command requires a roletag

pale vessel
#

i'm pretty sure the file needs to have the .mjs extension if you use js instead of ts

cinder patio
#

and "type": "module" in package.json

#

it's a mess

#

just use ts

royal herald
#

how can i use tensoroverflow in aws

#

its 50mb+

humble rock
#

excuse me, i'm doing a Partnership bot, I just finished doing the event in which it says that: if a member who is a partnership manager makes a partnership (link server) the bot sends an embed with the partnership number s that the user performed and the total number of partnerships made on the server. I found a NaN for the total of partnerships in the server but not for those of the user ... why, could you help me?

royal herald
#

do you use javascirpt?

humble rock
#

yeah

royal herald
#

lib?

#

djs rigth

humble rock
#

yeah

#

mongoose for database

royal herald
#

you an try ||

#

it does fetch it rigth?

humble rock
#

let's try if it fetchs data from database, but the user datas are ok

#

it's a Number

royal herald
#

idk how moongose works

humble rock
royal herald
#

sorry but icant help u lol

humble rock
lucid prawn
#

how do i check if the member in the same vc

#

as bot

humble rock
#

totalPartners: {
type: Number,
default: 0
}


Here my schema (it's for other people who are reading this conversation)

And what I use to increase the data by 1


Guild.totalPartners += 1;
Guild.save();


humble rock
lusty quest
lucid prawn
#

i tried this

    if (message.member.voice && guild.voice && message.member.voice.channelID === guild.voice.channelID) {
    return message.channel.send('>>> :x: | You need to be in channel together with me.',);
    };
sorry we detected a error cutie here is the error : TypeError: Cannot read property 'voice' of undefined
granite swan
humble rock
#

someone know how to use mongoDB?

lucid prawn
#

ik someone

humble rock
lucid prawn
#

one min brb

lusty quest
#

you will have to make your own raffle bot

granite swan
lusty quest
#

then you could expose an API within the Bot to start the raffle

lucid prawn
humble rock
lyric mountain
#

but would create a shitton of other issues

granite swan
lusty quest
#

well any decent bot ignores Bots, webhooks are sort of bots, atleast they get the tag

lyric mountain
#

they are

#

the can be detected by checking if user is fake

lusty quest
granite swan
#

Yes, never tried it. Thats why

lusty quest
#

they are not really hard to make

granite swan
#

Ok, then make me one hehehe

lusty quest
#

depending on what languages you know there is probably a api wrapper for the language aviable

granite swan
#

php

#

Would be cool

lusty quest
#

i could make one, i might get friday off, so i could spend 4 days on making one

granite swan
lusty quest
granite swan
#

aaah ok, I will try and look into it, thanks

lusty quest
#

for starting the raffle, can you call an API from the game?

#

would make it probably quite easy

granite swan
#

I use a discord webhook api class

lusty quest
#

should probably work if you can make http requests

granite swan
#

I have to look up what I have to code in order to make a bot post something

lucid prawn
#

how do i check if the member in the same vc as bot
anyone can help me

lyric mountain
#

get the bot's voice channel

#

and check member list

#

iirc you need an intent for that tho

lucid prawn
#
   if (message.member.voice.channelID === message.guild.voice.channelID) {
    return message.channel.send('>>> :x: | You need to be in channel together with me.',);
    };
lyric mountain
#

message.guild.voice.channelID what?

lucid prawn
#

it was guild.voice.channelID

lyric mountain
#

a guild can't have voice

lucid prawn
#

you right

lyric mountain
#

you need to get the voice channel of the bot

solemn jolt
#

Hello how i can make this code to send me the records

exports.enter = function(msg, channelName) {
  channelName = channelName.toLowerCase();

  //filter out all channels that aren't voice or stage
  const voiceChannel = msg.guild.channels.cache
    .filter(c => c.type === "voice" || c.type === "stage")
    .find(channel => channel.name.toLowerCase() === channelName);

  //if there is no voice channel at all or the channel is not voice or stage
  if (!voiceChannel || (voiceChannel.type !== 'voice' && voiceChannel.type !== 'stage'))
    return msg.reply(`The channel #${channelName} doesn't exist or isn't a voice channel.`);

  console.log(`Sliding into ${voiceChannel.name} ...`);
  voiceChannel.join()
    .then(conn => {

      const dispatcher = conn.play(__dirname + '/../sounds/drop.mp3');
      dispatcher.on('finish', () => { console.log(`Joined ${voiceChannel.name}!\n\nREADY TO RECORD\n`); });

      const receiver = conn.receiver;
      conn.on('speaking', (user, speaking) => {
        if (speaking) {
          console.log(`${user.username} started speaking`);
          const audioStream = receiver.createStream(user, { mode: 'pcm' });
          audioStream.pipe(createNewChunk());
          audioStream.on('end', () => { console.log(`${user.username} stopped speaking`); });
        }
      });
    })
    .catch(err => { throw err; });
}
lyric mountain
#

so guild.me.voice I guess

#

refer to the docs for correct params

lucid prawn
#

ok

earnest phoenix
#

Say you were making an RPG game, and say there were different kinds of vehicles you could own. How would you track that? I was thinking of having a Many-to-One and One-to-Many relation between a Vehicle entity and my user entity (using typeorm), is there anyone else who has any better suggestions?

lyric mountain
#

one player can have N vehicles

#

one vehicle can belong only to one player

granite swan
#

Say you were making an RPG game actually I am making an RPG game hehehe

lyric mountain
#

so One-To-Many

earnest phoenix
#

Yea so a user can have multiple vehicles but a vehicle can only belong to one user

#

So my method was the best way?

digital ibex
#

yo i got a quick question about node.js, can i add a setTimeout in a function, when the function is ran, end that process, start the process back up again and it'll continue on with the setTimeout, any ideas?

lyric mountain
#

not the ManyToOne part

digital ibex
lyric mountain
#

do you really need backward reference to the owner?

#

if you do then yes, use OTM and MTO

#

else just use OTM

earnest phoenix
#

I have to have an ManyToOne

#

It is required by Typeorm unless I am doing it inverse

lyric mountain
#

so it enforces backward reference

earnest phoenix
#

Yep

lyric mountain
#

but yeah, use that

earnest phoenix
#

Would a OneToOne relation between a clan and user be logical?

lucid prawn
earnest phoenix
#

Actually no

#

Actually I don't know

earnest phoenix
#

Well heres the thing I don't know how to actually handle it

lyric mountain
#

OTO means one clan could only have one member

earnest phoenix
#

I was thinking of only creating an instance of a clan for the owner

#

btw how do I add my server to top.gg?

#

and when people join it they get pushed to a members array

lyric mountain
#

nonono

earnest phoenix
#

But that doesn't seem logical

lyric mountain
#

go OTM when something will have N children

#

and OTO when something will only have 1 child

earnest phoenix
#

How would an OTM work though

earnest phoenix
#

Cause the person who creates the clan should be the owner

lyric mountain
earnest phoenix
#

How will I tell who is the owner and who are the members?

lyric mountain
#

just create a field in members

#

either a boolean to indicate ownership or an enum field to indicate hierarchy

earnest phoenix
#

Mmm, so what you are saying is attach the clan they join to them and push them into the members field?

lyric mountain
#

yes I guess

earnest phoenix
#

What do you mean by Enum?

lyric mountain
#

js doesn't have it, so read "constant"

earnest phoenix
#

I know what an enum is but what do you mean when you say to indicate hierarchy

#

I am using typescript

#

Typescript has enums

latent heron
#

different enumerables = different levels of hierarchy

lyric mountain
#

yes yex

latent heron
#

you can use it in premise to indicate some form of level or ownership

earnest phoenix
#

Can I make an example of what I think you guys are talking about?

latent heron
#

in php but obv same concept


abstract class Enumerables
{
  public const MEMBER = 0;
  public const MODERATOR = 1;
  public const OWNER = 2;
}

echo Enumerables::MODERATOR;

earnest phoenix
#

The higher the number bigger authority ?

latent heron
#

sure

lyric mountain
#

I'd use reverse sorting, but ye, that's the concept

latent heron
#

its however you want to design it

#

but an enum would be a nice way to efficiently neaten and do it

granite swan
#

Is there a way to copy paste multiple command in one shot? Example:

!raffle tickets add "Weekly Raffle" "chosenlegacy" 138
!raffle tickets add "Weekly Raffle" "Cobb" 112
!raffle tickets list "Weekly Raffle"
!raffle roll "Weekly Raffle"
!raffle reset "Weekly Raffle"```
lyric mountain
#

nope unless you make it possible

earnest phoenix
#

So I could do something like this:

//enums.ts idk
export enum Rank {
  MEMBER = 0;
  MODERATOR = 1;
  OWNER = 2;
}

// ClanEntity.ts
import { Rank } from './enums.ts'
export class ClanEntity extends BaseEntity {
    @PrimaryGeneratedColumn()
    _id!: string;
        
    @Column({name: 'rank', type: 'smallint', default: 0 })
    rank!: Rank
}

I assume anyway

lyric mountain
#

dat indent

earnest phoenix
#

The indentation fucked up ik

#

Discord was showing it to me weird

lyric mountain
#

but yes, looks fine

earnest phoenix
#

Sick

cinder patio
#

you should use const enums most of the time

#

Also initializing the enum variants is unnecessary in this case

earnest phoenix
#

Ah I see

earnest phoenix
cinder patio
#

const enum ...

earnest phoenix
#

Ah

#

It wasn't letting me do that for a sec

#

What is the difference?

#

between const enum and just enum

cinder patio
#

const enums get transpiled down to integers, while regular enums get transpiled to functions which return an object

earnest phoenix
#

Ah

rocky hearth
#

can we add a gap between flex items?

#

I hve 3 children of a parent flex element.
the Middle one is flex: 1.
And I want to add a gap between

vivid fulcrum
knotty obsidian
#

how long does it take for a bot profile picture to update

split hazel
knotty obsidian
#

weird it doesnt do that for me

#

¯_(ツ)_/¯

split hazel
#

though they might've changed something

#

try doing ctrl + f5 on your bot page to force your browser to reset cache?

latent heron
#

emptying cookies sometimes helps as well

slender thistle
#

oh not the food

split hazel
#

not food

#

here its biscuits

#

obviously its biscuits

#

the hell is a cookie

slender thistle
#

fuck off

split hazel
#

:( ruski

earnest phoenix
#

biscuits?

#

its a fucking cookie

distant cobalt
#
message.channel.send(part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11)``` all the parts are embeds. but they just turn out into [object] and stuff.
#

help

slender thistle
#

what.

pale vessel
#

Make a loop?

#

Why do you need to send that much embeds in the first place

earnest phoenix
#

Me brain is suffering

summer torrent
#

you can't send multiple embeds in one message

distant cobalt
earnest phoenix
#

Doubt

#

Definitely not that way

summer torrent
#

no you can't

opal plank
#

otherwise, u cant

#

and i think split:true is only for strings

earnest phoenix
#

or, for loop?

cinder patio
#

you can send multiple embeds if you're using a webhook

opal plank
#

you can also use a for ... loop

earnest phoenix
#

Yea

#

But why send it as a webhook just seems like uneeded extra work no?

vivid fulcrum
#

webhooks have one major advantage

#

they can hyperlink outside of embeds

solemn latch
#

webhooks support multiple embeds too, which seems to be your goal.

lucid prawn
#
 if (message.guild.voice.channelID === message.member.voice.channelID) {
    return message.channel.send('>>> :x: | You need to be in channel together with me.',);
    };

TypeError: Cannot read property 'channelID' of undefined

vivid fulcrum
#

a guild doesn't have a voice property

summer torrent
#

message.guild.voice isn't a thing

rocky hearth
#

for ts, I hv a type Theme from a package.
I want to extend it, so everywhere I use Theme type variable. I also see my properties.
this is that type

export type Theme = {
  dark: boolean;
  colors: {
    primary: string;
    background: string;
    text: string;
  };
};

I want to add my own colors to it.

lucid prawn
summer torrent
#

who?

lucid prawn
#

Monkey#8028

summer torrent
#

it is not a thing

woeful pike
lucid prawn
summer torrent
#

what are you trying to do

rocky hearth
#

but then it would be YourTheme .
I want to change the Theme itself, from the package

The package is not using any namespace or interfaces.
So is it possible?

summer torrent
#

Theme class/type in package?

lucid prawn
vivid fulcrum
#

you probably got told to use the me property on the guild

summer torrent
#

im doing this in my bot ts declare module "discord.js-light" { export interface Client { readonly commands: Collection<string, Command> twitter: Twitter } }

summer torrent
lucid prawn
#

thx

rocky hearth
#

yeah, but as I said, Theme is a type not an interface.
Will it still work

summer torrent
#

idk try and see

lament rock
#

interfaces and types are treated very similarly

#

if you're just declaring types, using either works

summer torrent
woeful pike
#

if that were the case a single weak link would break encryption for everything

earnest phoenix
#

So no?

#

Or not

lucid prawn
# summer torrent guild.me.voice

me may be dumb

    if (message.guild.me.voice.channel === message.member.voice.channel) {
    return message.channel.send('>>> :x: | You need to be in channel together with me.',);
    };

It stop it form changing vc but it still run the command

woeful pike
#

I wouldn't bet my life on it but it sounds extremely unlikely

sudden geyser
#

maybe you want to compare the channel ID rather than the instance

rocky hearth
#

it is working I think, but how do I let ts know, that this error is intentional

lament rock
#

You can't. If you want to merge two interfaces, you'd have to rename the base interface then declare that the interface you want extends the base interface

#

or if you want merging conditionally, you could do Interface1 & Inferface2 where you need it

rocky hearth
#

The Theme is a type coming from an package, which I can't do anything about.
And I want to redeclare it, somehow

lament rock
#

you can import it under a different name then extend it or do whatever

summer torrent
#

export interface Theme

rocky hearth
rocky hearth
lyric mountain
#

js is very lenient for errors, but I'd still prefer not to ignore linter highlights

rocky hearth
#

i understand, but Ive no choice
And its just for code completion, so no issue

distant cobalt
#

i played sound using ytdl core. It plays for like half a second and then it stops playing. How can i fix this?

#
const Discord = require('discord.js');
const fs = require('fs');
const ytdl = require('ytdl-core-discord');

module.exports = {
    name:"stage",
    async execute(message, args){
        if (message.member.voice.channel) {
            const connection = await message.member.voice.channel.join();
            connection.play(await ytdl("https://www.youtube.com/watch?v=5qap5aO4i9A"), { type: 'opus' });
        }
    }
}``` this plays for half a second then stops. can someone help?
#

help 😦

mild shard
#

Hey all, I made a pretty cool discord bot, but it's pretty unorthodox, maybe looking for some advice on how to go about this.

solemn latch
#

hmm?

prime mist
mild shard
#

ok cool

prime mist
#

Cool

mild shard
#

So basically. It's a chrome extension

#

and it should probably read the commands as an actual bot, and not read from just parsing the chat in the browser as I'm doing

#

does that make sense?

prime mist
#

No idea what you are talking about hah.

#

Just post the advice you are looking for as a question.

compact briar
pale vessel
#

Doesn't ytdl-core-discord require you to await the function?

#

Read their README

distant cobalt
pale vessel
#

It's embedded in their npm page

distant cobalt
#

oh

#

what should i do tho?

#

@pale vessel ```js
const Discord = require('discord.js');
const fs = require('fs');
const ytdl = require('ytdl-core-discord');

module.exports = {
name:"stage",
async execute(message, args){
const url = "https://www.youtube.com/watch?v=5qap5aO4i9A"
if (message.member.voice.channel) {
const connection = await message.member.voice.channel.join();
async function play(connection, url) {
connection.play(await ytdl(url), { type: 'opus' });
}
}
}
}``` it doesn't play

compact briar
vivid fulcrum
#

why are you trying to do a music bot anyway

#

it's just a waste of resources by this point

distant cobalt
#

oh ok

vivid fulcrum
#

nobody will use it because there are thousands of superior bots which do it better

vivid fulcrum
#

oh, private use

drifting wedge
#

is there a way to sleep in python without using async?

#

or if so

#

like how do i turn EVERYTHING async?

#

this isnt discord related

prime mist
#

I would generally not recommend this, as event emitters don't listen for promise rejections.

sage bobcat
#

One message removed from a suspended account.

vivid fulcrum
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

vivid fulcrum
#

nope

sage bobcat
#

One message removed from a suspended account.

vivid fulcrum
#

i barely read dapi anymore

#

lmfao

#

how do people still use net fx

#

i mean companies i get ok expensive to port

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

vivid fulcrum
#

yeah

#

so expensive

#

idk

#

some companies are just dumb

#

i still refuse to use c# for ui though <33

earnest phoenix
#

How do I add something in which the user would need to type yes before the command does its action?

#

I've been trying a few things but the only thing I can think of is: .<command> {yes|no}

vivid fulcrum
#

ive been considering using ultralight c# bindings (so i can render html/css/js from c#) but ultralight has licensing issues unlike electron

sage bobcat
#

One message removed from a suspended account.

vivid fulcrum
#

yeah

#

core was marginally faster ever since it came out

#

and the fact that you can run it natively on linux is chefs kiss

sage bobcat
#

One message removed from a suspended account.

vivid fulcrum
#

honestly i have no idea

#

well

#

until core 3, you had to use framework for ui

#

but still

#

maybe some people studying cs and c# have older curriculums so they use framework

#

without reading the docs

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

sage bobcat
earnest phoenix
#

C# pog

#

Just very complicated when you are first starting to learn it cause of how powerful it is

weary crypt
#

C# is an all around language, it has money to be thrown into it. It is apart of .Net core so it just keeps getting more and more upgrades.

earnest phoenix
#

Indeed

#

Especially if you are using Unity it is very beneficial in the game dev environment

weary crypt
#

After learning C# I would try and learn C++, very different. I like both, but C# is by far my favorite, since you can make pointers anyway

earnest phoenix
#

I know the basics of C# for the most part

weary crypt
#

If you know what your doing you can even make Managed types into pointers

earnest phoenix
#

I just got tired of it cause I couldn't figure out how to make a table in the database I connected too :^)

weary crypt
#

Use dapper

earnest phoenix
#

I was going too

#

At first I was using Npgsql

weary crypt
#

Haven’t heard of that one

earnest phoenix
#

But I just got tired of C# after that so I took a break and decided to use Kotlin instead

#

Npgsql is just for postgres

visual goblet
#

I was using C++ but I couldn't figure out how to compile

weary crypt
#

I am going to learn Rust next, since I heard it is the most loved language.

earnest phoenix
#

It is

#

Very good as well

#

Perfect for low level

weary crypt
#

It looks really nice

earnest phoenix
#

I know basics of rust as well ahah

weary crypt
#

Heard discord is moving to it

earnest phoenix
#

It would be better if they did I think

weary crypt
earnest phoenix
#

Rust is perfect for security and low level management

#

Which is why Deno uses it

weary crypt
#

Yea, so that is my next step, heard there is a great library for web development on Rust

visual goblet
#

nah I was using visual studio code

#

visual studio wanted 25 gigs I was like fuck no

earnest phoenix
#

You should still be able to use a compiler no?

visual goblet
#

I failed to set it up I guess

#

it just never worked

weary crypt
#

Huh

#

Weird

visual goblet
#

I could never compile my code at all so I couldn't program much lmao

weary crypt
#

Lol

earnest phoenix
#

Mmm

#

Isn't there a plugin for C++ on VSC

#

that allows you to compile

visual goblet
#

well I made games and stuff with it just can't run it

earnest phoenix
#

Did you use Unreal

#

or just some graphics library

visual goblet
#

what do you mean?

earnest phoenix
#

Unreal engine (By games I assume you mean that kind)

visual goblet
#

I don't even remember what I have lmao it's been a bit

weary crypt
#

You said games, unreal uses C++

earnest phoenix
#

Do they really use it much though

#

Now they have blueprints

#

which does a lot for you right?

weary crypt
#

I don’t think it gives out too much freedom

earnest phoenix
#

Yea

weary crypt
#

But I am not too sure, have not used it, just seen it

earnest phoenix
#

Same

#

I have been really getting into kotlin

#

Its been quite fun

weary crypt
#

Heard it is a good language

earnest phoenix
#

It is pretty decent

#

Imo its better then Java just cause of how simpler it is

#

Syntax is pretty similar to TS as well by the looks of it so it was rather easy for me to learn

weary crypt
#

I also wanna learn py

earnest phoenix
#

funny enough don't know the basics to py anymore

#

Kind of forgot about it after learning new stuff

weary crypt
#

I hate that I have to have perfect spaces in it. But I have not used it too much. I used it before I really started liking programming

wheat mesa
long crow
earnest phoenix
#

I need help coming up with ideas 😩

#

So I wanna generate a map of some sort for a rpg bot I am making. What are some good ways to do it

lyric mountain
#

Depends

#

Procedurally is more random and dynamic

#

Asset-based can be more detailed

earnest phoenix
#

Mmmm, well since it is a discord bot it is limited to what I can do no?

#

If at all possible it would be nice to have some kind of graphic map but I doubt it would be easily doable

lyric mountain
#

You're only limited on what you can output and how users interact with it

earnest phoenix
#

The entire point of it is to be vast enough that it can be explored, clans can claim territory, and resources can be mined from planets, asteroids, etc

lyric mountain
#

Other than that, theres pretty much no difference from making a discord bot and making a pc game

earnest phoenix
#

Mmm true

#

I am just not the most skilled person when it comes to this so idk where to begin

lyric mountain
#

I mean, I made a fully functional trading card game for my bot

#

Sky is the limit I guess

#

Start off thinking on how you'd do it

#

Making interactive games on discord is no easy task

earnest phoenix
#

Indeed

#

My plan was using some kind of canvas element for the area you are on

lyric mountain
#

Sure

earnest phoenix
#

But I am not sure how I would actually manage tracking what part on that map you are on.

#

Like I could use x,y values right?

#

Kind of like coordinates

lyric mountain
#

I once made an interactive tabletop rpg module for my bot

#

Here's my opinion:

#

Wait for discord menu update

#

Like, in the current state you'll rely fully on messages, and trust me when I say that you'll end up with a huge amount of embed menus

earnest phoenix
#

:^)

#

I agree

lyric mountain
#

That's one of the reasons I discontinued it

earnest phoenix
#

Mmmm, so you are saying put it on hold for now?

lyric mountain
#

Yeah, discord announced they are making custom pop-up menus bots can create

earnest phoenix
#

:o

#

That sounds cool

#

I actually am going to do that.

lyric mountain
#

With them creating inventory, character sheets, monster sheet, map, etc will be a lot easier

earnest phoenix
#

Makes more sense then rewriting later

#

Yea, ima wait.

#

But now I need something to do to pass the time

lyric mountain
#

Practice map generation

#

Like, make a map-only module for your bot

#

A map where you can move pawns

#

You'll use that later on probably, so it's good to practice

earnest phoenix
#

Mmm what should I use?

lyric mountain
#

Idk, up to you

earnest phoenix
#

No idea what is out there to use

lyric mountain
#

I'd go for a procedural map that's generated based on a seed

#

There are many tutorials regarding that for game devs

earnest phoenix
#

Mmmm

#

It'd have to be 2D right

lyric mountain
#

Sure

#

You can go 3d if you want, but it's easier to start 2d

earnest phoenix
#

Ima start 2D first

earnest phoenix
#

You can pass a function that takes bot and message as arguments to the command_prefix parameter when instantiating the Bot object. You can then do the logic there, e.g., return the prefix based on the guild id

wheat mesa
#

How would I go about listening for reactions on this message?

#

Discord.js

#

<@&304313580025544704> ^

rustic nova
#

why the mod ping tho

wheat mesa
#

didn't know who was online

#

¯_(ツ)_/¯

ripe prairie
#

literally

rustic nova
ripe prairie
#

two of us have green

wheat mesa
#

yeah but not sure who would respond

ripe prairie
#

two of us have green

wheat mesa
#

okay fair enough

cinder patio
#

awaitReactions or a reaction collector

wheat mesa
#

alright, thanks!

earnest phoenix
#

Is there a way I can set headers for an axios request later?

#

So if some conditions are met set an axios header and then use those headers in the final request

slender thistle
#
headers = {};

if (x)
{
    headers.y = "z";
}

sendrequest(headers: headers)
feral aspen
#

Just ping everyone to ask them how their day is going..

copper cradle
#

their job is not to answer development questions, it's to moderate the server

#

just ask your question

#

somebody will eventually answer

feral aspen
#

😂

#

Lmao.

wheat mesa
#

I’m aware that they’re not here to answer development questions

royal herald
cinder patio
#

Why is everyone still bringing this up

wheat mesa
#

Not sure

#

I should’ve just pinged one that was online

#

Not the entire role

copper cradle
crystal wigeon
#

hey is it possible to compromise your discord account via your bot token?

sick agate
#

no

copper cradle
#

well, in a certain way it is

#

if your bot's token gets leaked and someone uses it to break ToS then you're fucked

sick agate
#

oof

earnest phoenix
#

Yes very much so

earnest phoenix
#

@rustic nova Same here

novel jetty
#

What does this mean?

earnest phoenix
#

client.settings is undefined

novel jetty
#

How can i define it?

earnest phoenix
#

Idk its your code...

#

you just bind settings to client

#

What are you using to store this info?

novel jetty
#

quickmongo

earnest phoenix
#

then follow the readme and bind settings to client with the instance of a new Database

untold spade
#
(node:36) UnhandledPromiseRejectionWarning: Error [SHARDING_READY_TIMEOUT]: Shard 0's Client took too long to become ready.
    at Timeout.onTimeout (/home/container/node_modules/discord.js/src/sharding/Shard.js:163:16)
    at listOnTimeout (internal/timers.js:555:17)
    at processTimers (internal/timers.js:498:7)
(Use node --trace-warnings ... to show where the warning was created)
(node:36) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:36) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
#

i am having this erroe can somone halp

earnest phoenix
#

Why are pinging a staff member

untold spade
earnest phoenix
#

well now its ghost ping :^)

untold spade
earnest phoenix
#

Ion know the issue

#

Where are you sharding at

untold spade
#

at my personal hosting

untold spade
earnest phoenix
#

No

#

Ion got time to help

lavish bramble
#
const {MessageEmbed}=require("discord.js")
const glob = require("glob")
module.exports = {
  name: "reload",
  description: "reload all cmds",
  execute: async(client, message, args) =>{
    if(message.author.id!== "769077060944658452") return 
    client.commands.sweep(() => true)
    
    glob(`${__dirname}/../**/*.js`, async (err, filePaths) =>{
      if(err) return console.log(err)
      
      filePaths.forEach((file) => {
        delete require.cache[require.resolve(file)]
        
        const pull = require(file)
        
        if(pull.name){
          client.commands.set(pull.name, pull)
        }
        
        if(pull.aliases && Array.isArray(pull.aliases)){
          pull.aliases.forEach((alias) =>{
            client.aliases.set(alias, pull.name)
          })
        }
      })
    })
    message.channel.send(new MessageEmbed()
    .setTitle("Bot Reloaded")
    .setDescription("Bot Reloaded Successfully")
    .setTimestamp()
    .setColor("RANDOM")
    .setThumbnail(message.author.displayAvatarURL())
    )
  }
}```
Error set is not defined
#

My reload command

#

Ping me if you got it

earnest phoenix
#

Seems like client.aliases is not defined

#

or client.commands

#

one of the two

lavish bramble
#

Well this work I'm command handler
client.commands.set

earnest phoenix
#

When I am attempting to use a Custom Emoji on a embed it shows the following:

(node:17209) UnhandledPromiseRejectionWarning: TypeError: modembed.react is not a function

Literally the easiest question I know, but its once again 5:45am xD and haven't slept.

code: modembed.react('MY_EMOJIS_ID')

#

Thanks console!

#

You don't react on embeds, you react on the message that contains the embed bruh

earnest phoenix
#

Re-read what I said

#

My brain capacity rn = null

#

Ill figure something out.

#

modembed is an embed, not the message that contains the embed

earnest phoenix
#
const sentMessage = await <Message>.channel.send(modembed);

await sentMessage.react(...);```
#

I just tried that... still test.react is not a function

#

Show your code I guess

#

Nvm

#
.then(embed => {
    embed.react("EMOJI_ID")}````
#

Works Like_thumbs_up

#

OkayChamp alright

#

im bored

#

what shit should i do with js and replit today

#

GTA V in JS

distant bramble
#

lol

earnest phoenix
#

ill do this

#

and ill jsfuck the code before putting it for production

#

You do you-

#

?

#

fine ill make a visual slash command payload generator then

#

quick s a s s y question
if i have this rule in my scss file:

.button {
  .active {
    /* stuff */
  }
}

will it match anything with BOTH the button and active class OR will it match a child with active class inside a parent with button class?

#

because i want it to do the first one

snow urchin
#

Where is the error in this sql query? It is run automatically for each artist that is played on an online station, but gives this error.

rocky hearth
#

ive an array of objects haivng a single property.
Is it possible to access this property, without knowing the key?

#

I mean I just want to grab the only property the object have

rocky hearth
#

but I dunno the key, and I dont want the object itself.

pale vessel
#

array.find(e => Object.values(e).includes(value))?

rocky hearth
#

neither I know the value 😅

pale vessel
#

Then what are you trying to find?

#

Nothing?

rocky hearth
#

by hving a single property, I mean key value pairs with distinct keys

earnest phoenix
#

show us your data

rocky hearth
#
const arr = [
  {hello: 0},
  {hi: 'value'},
  // etc etc
];

I dunno the key and value in these objects
But I know, it would only have one key value pair

earnest phoenix
#

Or just

#

Object.values(<Object>)[0]

rocky hearth
#

Ooh, yeah, how can i forget, these methods exists. Thanks

zenith terrace
#

object object object

rocky hearth
#

yes it will do the 2nd part

#

bcoz it will compile to this in css
.button .active and not .button.active

placid python
#

Hi

earnest phoenix
#

so how do i make it do the first part

placid python
earnest phoenix
#

yep, definetely js not css

rocky hearth
#

Im not sure, but may be this

.button {
  &.active {}
}
earnest phoenix
#

imma try that

rocky hearth
earnest phoenix
#

it works

#

ty

torn mesa
#

Copy the button to my bot, I repeat, it makes me write once and there is no error in the log, how can I solve it?

vivid fulcrum
#

again, what

#

you cross posted an issue with engrish

torn mesa
#

I don't understand?

rocky hearth
earnest phoenix
#

So, when I am using:

if(command === 'mod'){
*code here bla bla bla*
}```

I noticed that when I add another command like:
```fix
if(command === 'currency'){
*rubbish*
}```

it will display 'mod' when I try to use 'currency'.
near stratus
earnest phoenix
#

petition to delete discordjs.guide for teaching everyone this shit way of handling commands

earnest phoenix
near stratus
#

@earnest phoenix

if(a == "a"){
    //
} else if (a == "b"){
  //
} else if (a == "c"){
  //
} else if (a == "d"){
  //
} else if (a == "e"){
  //
} else if (a == "f"){
  //
} else if (a == "g"){
  //
} else if (a == "h"){
  //
} else if (a == "i"){
  //
} else if (a == "j"){
  //
} else if (a == "k"){
  //
} else if (a == "l"){
  //
} else if (a == "m"){
  //
} else if (a == "n"){
  //
} else if (a == "o"){
  //
} else {
  //
} 
earnest phoenix
#

God no

#

Don't do that

#

Dear god, I said 3 not the whole alphabet.

near stratus
#

Also,
Your code works fine

earnest phoenix
#

It doesn't.

near stratus
#

forget the error at top

earnest phoenix
#

Yeah,

#

But it sends all of em

#

Not just the one

near stratus
earnest phoenix
#

@earnest phoenix What exactly is your issue if I might ask, it has been burried

near stratus
#

I just ran it in console cuz I was too lazy to make a file

torn mesa
#

Friends, I added a command to my bot, but once I type the command, it throws its answer non-stop. I wrote the command at 13 o'clock, it still writes an answer and there is no error in the log, how will this be fixed?

earnest phoenix
#
    if (command == 'moderation' || 'mod'){
        const modembed = new Discord.MessageEmbed()
    .setTitle(message.author.tag, message.author.displayAvatarURL({ dynamic:true }))
    .setThumbnail(message.guild.iconURL())
    .setDescription(`Hey <@${message.author.id}>! Here are the **\`Moderation\`** Commands!\n\n> x/kick - Kicks a User.\n> x/ban - Bans a User.\n> x/mute - Mutes a User.\n> x/unmute - Unmutes a User.\n> x/lock - Locks the Current Channel.\n> x/unlock - Unlocks the Current Channel.\n> x/slowmode - Set a Channels Slowmode.\n> x/nuke - Nukes the Channel. (Clearing all Messages.)`)
    message.channel.send(modembed).then(embed => {
    embed.react("846988261057626122")}
)
  
} else if (command === 'currency' || 'econ'){
      
       const currencyembed = new Discord.MessageEmbed()
    .setTitle(message.author.tag, message.author.displayAvatarURL({ dynamic:true }))
    .setThumbnail(message.guild.iconURL())
    .setDescription(`Hey <@${message.author.id}>! Here are the **\`Currency\`** Commands!\n\n> x/setlogs - Set the ModLogs.\n> x/[enable/disable] - Disable a Command Category.\n> x/enable - Enable a Command Category.\n> x/setverif - Set a Verification Channel/Role.\n> x/setmuterole - Set the servers Muted Role!\n> x/disableverif - Disable server verification.\n> x/setwelcome - Set a Welcome Channel.\n> x/dchannel - Disable Commands in a Channel.\n> x/echannel - Enable Commands in a Channel.`)
    message.channel.send(currencyembed).then(currencyembed => {
    currencyembed.react("846988972924207135")}
)}

This only displays the MOD Command.

#

I frfr accidentally just sent that in D-Devs API Questions

#

Well how are you executing it

near stratus
#

not

if(command === "mod" || "moderation"){
}
earnest phoenix
#

I'd make it an array to be honest.

#
if(['mod', 'moderation'].includes(command)){...}
near stratus
earnest phoenix
#

Okay and?

#

Why does that limit what we can tell em

near stratus
#

how do you expect him to understand how arrays and .include work when he doesn't even know the ground basic of js

earnest phoenix
#

That really isn't my issue is it

#

If he doesn't understand he can say so or google it

#

I am just here to help not hold your hand

near stratus
earnest phoenix
#

Okay?

#

I told him a better solution if he doesn't understand it again he can say so or google how the individual components work

slender thistle
#

You poor soul

near stratus
#

oh wait a second I'm getting DM advertisement.
Gonna report to a mod
I'll be back soon

earnest phoenix
#

Mk

near stratus
#

f every single mod is dnd and afk

earnest phoenix
#

🤷‍♂️

autumn rampart
#

Hi does anyone know how to have it that your discord bot makes the muteed role

earnest phoenix
#

What library are you using

autumn rampart
#

Node.js

earnest phoenix
#

I said library

#

I assume discord.js

autumn rampart
#

Yeah

earnest phoenix
autumn rampart
#

Is there any examples

#

I can see

earnest phoenix
#

It has two examples on it...

autumn rampart
#

I mean like porjects

#

Projects

earnest phoenix
#

What

#

There is legit 2 code snippets on how it works

#

What more do you need

autumn rampart
#

For muted

earnest phoenix
#

What

autumn rampart
#

Muted role

#

No permissions

earnest phoenix
#

Just follow the damn example

#

It tells you how to create named roles

#

and you can ignore anything you don't need

#

You can also click on the blue words under type

#

and it takes you to the page of what it contains

earnest phoenix
near stratus
earnest phoenix
#

Why are you being a dick

earnest phoenix
near stratus
#

*steps away

earnest phoenix
slender thistle
#

Nah really though

#

Why are you working on a bot without enough rest

#

It's bad for you both short and long term

earnest phoenix
#

says the guy who watches anime at 3 am

#

👀

slender thistle
#

At least I sleep well and don't exhaust myself to the point of passing out

earnest phoenix
#

@rustic nova Got another one.

#

Sorry for pinging you if you're busy

lyric mountain
autumn rampart
#

Is it better to have commands in one file or

#

In singular files

#

Like a file for commands

long crow
#

It more common called as command handler. And better to have it seperate and called by 1 main file

woeful pike
#

tip: stop using colors

long crow
#

Separate command files that is

autumn rampart
#

Oh

#

Ok

woeful pike
#

go with grays only. Have you seen any website that has a blue background like this?

earnest phoenix
#

Just go with your favorite vs code dark theme

#

and use that color pallet

earnest phoenix
woeful pike
#

genuinely you don't need to use any color at all. User generated content alone (images and role colors in the case of discord) has enough variety in it in terms of color. Work in shades of gray and that's all you need

earnest phoenix
#

Yea

lyric mountain
#

but really, that button shape screams ADS!

autumn rampart
#

Do something like this

vivid fulcrum
#

it doesn't fit modern design in 2021 at all

#

also

#

whitespace is your friend, not your enemy

#

use it

silk wadi
#

In Python you can do:

x = """
hello
"""

How do you do this in Javascript? 😁

earnest phoenix
#

let x = "hello"

silk wadi
#

no i mean

earnest phoenix
#

or if you don't want the value to change use const

silk wadi
#
x = "hello\nbye"
x = """
hello
bye
"""
#

are the same thing

#

in Python

#

how would I do that in Javascript

earnest phoenix
#

I am not entirely sure

#

I have never done such without stripindents

silk wadi
#

hm okay thank you tho 😄

#

Ah I found how

near stratus
#

??

silk wadi
#
x = `
hello
bye
`
silk wadi
near stratus
#

np

earnest phoenix
#

I guess that could work

#

iirc though if you were to send that in a discord message it would get rid of the new line

near stratus
#

\n

earnest phoenix
#

I assumed they didn't wanna use \n

earnest phoenix
#

Alright then ig it will work

near stratus
#

also """ wouldn't get newline in python anyway

#

(I guess)

earnest phoenix
#

That is how you make a multiline string in python

near stratus
autumn rampart
#

Anyone know any good toturials

#

For moderation discord bot

#

Not youtube

silk wadi
autumn rampart
#

How to make commands in separte files

silk wadi
#

make a new file

earnest phoenix
#

Using a command handler

silk wadi
#

then import the file

#

probably should use cogs tho instead

earnest phoenix
autumn rampart
#

I have command in my bot.js

earnest phoenix
#

He is using discsord.js

ripe prairie
#

lol

silk wadi
#

o nvm then

#

xD

#

use classes

ripe prairie
#

Have you tried using google

silk wadi
#

there thats generic

earnest phoenix
#

I mean everyone who uses a language assume its their language the problem is about

autumn rampart
#

Yeah

earnest phoenix
ripe prairie
#

I doubt you have

silk wadi
#

lmao

ripe prairie
#

Actually try before asking to be spoonfed, please

earnest phoenix
#

I know this

stable eagle
#

lil

#

lol

cosmic forum
#

Hello, I have an image gallery where some images are taller than others, and I was wondering, is there was a way I could keep the width for them all the same, and have the height get cropped to, let's say 500px, and have it centered vertically?

ripe prairie
#

if you're asking is there a way, yes

cosmic forum
#

Ah, mind pointing me to a place that explains it?

earnest phoenix
#

canvas maybe

#

I can't remember if they let you resize or not

cosmic forum
near stratus
# cosmic forum yep

just make div elements with fixed size
them set bg to the image and set cover

earnest phoenix
#

Can't that reduce quality though?

near stratus
#

easier method

near stratus
#

you can always use canvas crop the hell out according to your window.size/number of images then put it there. Maybe with some animation too

cosmic forum
#

👍

autumn rampart
#

Is this right ```js
module.exports = {
name: 'kick',
description: 'Tag a member and kick them (but not really).',
execute(message) {
if (!message.member.hasPermission('KICK_MEMBERS'))
return message.channel.send("Insufficient permissions (Requires permission Kick members)").then(msg => {
msg.delete({ timeout: 30000 })
})
const member = message.mentions.members.first();
if (!member)
return message.channel.send("You have not mentioned a user").then(msg => {
msg.delete({ timeout: 30000 })
})
if (!member.kickable)
return message.channel.send("This user is unkickable").then(msg => {
msg.delete({ timeout: 30000 })
})
const reason = args.slice(1).join(" ")
if (member) {
if (!reason) return member.kick().then(member => {
message.channel.send(${member.user.tag} was kicked, no reason was provided);
})

    if (reason) return member.kick().then(member => {
        message.channel.send(`${member.user.tag} was kicked for ${reason}`);
    })
}

}

}

earnest phoenix
#

try it and see

weary crypt
# earnest phoenix try it and see

the only thing I see, is that you are saying if(member) I dont know if this works in js though. But it does not make too much sense.

earnest phoenix
#

That does make sense

autumn rampart
#

How would i have it instead of this const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));

weary crypt
#

Does it?

earnest phoenix
#

Yes

weary crypt
#

Why?

autumn rampart
#

Like for mmutliple folders

earnest phoenix
#

If there is no member mentioned return a message

weary crypt
#

ah gotcha

autumn rampart
#

Like moderation in commands

earnest phoenix
#

You'd have to use for loops or a file walker

autumn rampart
#

How?

earnest phoenix
#

Google

rocky dagger
#

how can i send every element of an array without using a for loop?

weary crypt
#

You could also trial and error it. I like to learn on my own, but to each their own.

earnest phoenix
rocky dagger
#

hmmm

autumn rampart
#

Any examples

earnest phoenix
autumn rampart
#

I did

earnest phoenix
#

Then you would of found examples

earnest phoenix
silver perch
#

how do you put an emoji of my server in an embed for a public bot?

earnest phoenix
#

array.forEach()

autumn rampart
earnest phoenix
autumn rampart
#

?

#

How will this help me?

earnest phoenix
#

you give it a pattern

#

it will walk those folders and return the files

#

in an array

autumn rampart
#

Ok

earnest phoenix
#

The examples are on the npm page

#

Im not going to spoonfeed you

rocky dagger
autumn rampart
#

Ok

#

Chill

weary crypt
#

Spoonfeeding vs. leading someone to the right path is different.

earnest phoenix
earnest phoenix
earnest phoenix
weary crypt
#

He does not know what to search up, you could give him an example of what to search. That would be more helpful, you could also show him an example from the docs.

placid iron
#

in python

earnest phoenix
#

I did.

#

I told him to look up a file walker which is what glob does

placid iron
#

if you are appending multiple thigns to a string then just create a list then " ".join(list)
it is faster and uses less ram
that is my wisdom, use it carefully

earnest phoenix
#

I mean

rocky dagger
earnest phoenix
#

you can map it

#

and get an array of names

rocky dagger
#

smart

earnest phoenix
#

json.body.attributes.map(x => x.name)

#

map returns a new array of whatever element you tell it to

#

help pls?

weary crypt
sick agate
#

rebuild it

earnest phoenix
#

It is occurring inside a node module it seems

#

If this is replit then I am of no assistance

earnest phoenix
weary crypt
#

someone answered it

sick agate
#

rebuild the modules

earnest phoenix
#

did they

weary crypt
#

yea

sick agate
#

?

weary crypt
sick agate
#

like thats your proably first choice

earnest phoenix
#

Oh right you're the C# enthusiast

sick agate
#

no?