#development

1 messages ยท Page 968 of 1

sour cargo
#
async def _help(ctx):```
#

i want it to work for help and HELP

#

if that makes more sense

pale vessel
#

try lower()

sour cargo
#

i did

pale vessel
#

i don't use python so i'm not sure

sour cargo
#
async def _help(ctx):```
#

i tried hthat too

#

didnt work

pale vessel
#

isn't it lower('help')?

#

probably not lol

sour cargo
#

im p sure its .lower

#

but ill try that to

pale vessel
#

nah it's string.lower()

sour cargo
#

yea it isnt that

pale vessel
#

wait, you're doing it on a wrong place

#

it should be on the event

sour cargo
#

this is something else i used to do it as
@client.event
async def on_message

pale vessel
#

where it gets the message content

sour cargo
#

but now im trynna rewrite using @client.command

pale vessel
#

ah

sour cargo
#

yea apparently makes it so uur code is cleaner

#

got it

#

u just pass in a case insensitive param

pale vessel
#

case_insensitive=True yeah

sour cargo
#

when u create the client

#

yesh

pale vessel
#

i was about to send it haha

sour cargo
#

maybe shldve done this before

#

lol

#

ty!

#

ok now idk how to make thhe prefix case insensitive

#

;-;

lyric mountain
#

"Aaaa".toLowerCase()

sour cargo
#

ill try .lower

#

ah

lyric mountain
#

Idk if that's the correct function tho

#

But you get the idea

sour cargo
#

doesnt work

#

;-;

#

client = commands.Bot(command_prefix='pt.'.lower(), status='Online', case_insensitive=True)

lyric mountain
#

U sure?

sour cargo
#

ye

lyric mountain
#

The last argument was supposed to make it case insensitive

sour cargo
#

only the commands

#

apparently

#

not the prefix

lyric mountain
#

Ah

#

You gotta make the user input lowercase

#

Not the prefix itself

sour cargo
#

wdym

lyric mountain
#

Get the user input (the message) and make it lowercase

#

Then compare with the prefix

sour cargo
#

did u do ur bot in pytthon?

lyric mountain
#

Nope

#

But the logic is the same

upbeat herald
#

anyone have level up raw?

lyric mountain
brittle mica
#

bruh

#

Im trying to setup an api

#

for Time

#

but I need to put the auth key in a header

#

idfk what that is, or how to do it

#

and when I try I get 404

lyric mountain
#

First of all you're calling the wrong url if it's giving u 404

#

A header is kinda like a field in a http request

brittle mica
#

thats whats annoying, its like the alex api

#

that messes up images

#

with the user ids, and stuff

lyric mountain
#

What are you using to call the api?

#

Node-fetch?

brittle mica
#

const request = require('node-superfetch');

lyric mountain
#

Use node built-in fetch

brittle mica
#

ok

#

any easy examples u got?

lyric mountain
#
fetch('someurl', {
	method: 'themethod', 
	headers: [
		header1: 'somevalue', 
		header2: 'anothervalue' 
	] 
})
#

If you wait me finish typing

brittle mica
#

sorry, lol

lyric mountain
#

That's a promise btw, so remember to handle it properly

brittle mica
#

ye

lyric mountain
#

Just note that native fetch doesn't have a timeout

#

So you might get stuck in a request

brittle mica
#

thx for the help

turbid nova
#

How do I add code to my bot?

summer torrent
#

use IDE

turbid nova
#

Ok

#

Ok so does anybody know how to add code to discord bot by mobile

lyric mountain
#

He clearly doesn't know what an ide is lol

vale garden
#

lol

#

@turbid nova but you can add code by mobile

#

and opening it on your mobile

#

but it might be tedious and hard

#

btw

#
const args = message.content
    .slice(PREFIX.length)
    .trim()
    .split(/ +/g);
  const command = args.shift().toLowerCase();
#

this is from v11

#

how do i write it in v12

summer torrent
#

same with v11

vale garden
#

doesnt work

broken shale
#

Only some big changes that seem to break people's code is the use of managers

fiery stream
#

yo

#

is it normal for a bot whose in 1 guild and serving 3 users and it uses 10mb

#

is that normal>

#

its python btw

#

is it too much or less

pale vessel
#
fetch('someurl', {
	method: 'themethod', 
	headers: [
		header1: 'somevalue', 
		header2: 'anothervalue' 
	] 
})

@lyric mountain the headers lol

sick cloud
fiery stream
#

what does they say when you hover over em

terse lynx
#

best discordbot making free website

fiery stream
#

what>

terse lynx
#

read up

fiery stream
#

uh k

terse lynx
#

can u tell?

fiery stream
#

i cant find

#

what are you telling me to read?

terse lynx
#

i want to say you that ,, I want any free website which is used to make discord bot

fiery stream
#

uh how about you code yourself

#

lol

terse lynx
#

so you cant help

summer torrent
#

wtf

fiery stream
#

no i never use bot making things

summer torrent
#

there is no website for "making bots"

fiery stream
#

^^ also true

#

there is a paid thing on steam

terse lynx
#

:9

#

๐Ÿ˜ฆ

fiery stream
#

yeahhh'

terse lynx
#

like discord bind

fiery stream
#

??

terse lynx
#

*bot bind

fiery stream
#

i have no idea what you saying

terse lynx
#

ok bro

fiery stream
#

sorry i cant help with that

#

if you need help with code lmk

terse lynx
#

its ok , thanks

summer torrent
earnest phoenix
terse lynx
#

how to type or in code lan

summer torrent
#

learn any programming language first

terse lynx
#

i know c++,c,c# and java

fiery stream
#

then code in em

terse lynx
#

java is not that perfect of mine

fiery stream
#

why bot maker

summer torrent
#

there is a library for java

#

c++ too

fiery stream
#

even C#

summer torrent
earnest phoenix
#

there arent really an working cpp libs

noble bay
#

there are

fast trench
#

this is gonna sounds stupid but why would this output the meow message if the reaction.message.id isn't in the database? and I double checked...the db is actually empty...js client.on('messageReactionAdd', async (reaction, user) => { if (reaction.emoji.name === '๐ŸŽซ') { const ticketConfig = await StateManager.connection.query(`SELECT * FROM ticketconfig WHERE messageId = ${reaction.message.id}`); // console.log(ticketConfig) if (ticketConfig) { reaction.message.channel.send(`meow`) const findTicket = await StateManager.connection.query(`SELECT * FROM tickets WHERE authorId = ${user.id}`); } else { reaction.message.channel.send(`This server is not setup in the ticket config database yet. Please contact the server owner and ask them to set it`) } } });

noble bay
#

theyre a little dated

#

Nadeko is written in C++

#

she's just fine

earnest phoenix
#

LOL

summer torrent
#

what about aegis.cpp

earnest phoenix
#

nadeko is c#

noble bay
#

oh

#

my mistake

earnest phoenix
#

and nadekos code is very very shit

noble bay
#

that part i can agree with

earnest phoenix
#

kwoth is the biggest clown of a dev you can find

noble bay
#

she uses sqlite

#

and a massive cache

summer torrent
noble bay
#

the last commit was 5 months ago

#

it could still work for most things but using like

#

any other language would probably be better

fast trench
#

can you guys take this somewhere else so my question doesn't get buried...

noble bay
#

discord.js and discord.py are the most well documented

#

the ticket config still exists

#

it is a variable that exists

fast trench
#

no it doesn't...it's legit an empty db

noble bay
#

which is what youre checking for

#

check to see if its a Null variable

fast trench
#

oh duh lol sorry I just realized that

earnest phoenix
#

debug your code, debugging exists for the very reason to answer why questions

noble bay
#

its generally good practice to print whatever variables arent working

#

or console.log in your case

fast trench
#

wait...no you are wrong...I'm checking to see if a certain row exists...and that row doesn't exist...

noble bay
fast trench
#

yes I see that

noble bay
#

you create the variable here

#

you dont check to see what the value of the variable is

fast trench
#

yes and it checks MySQL for a row with a certain value...that value does NOT exist therefore it shouldn't be running that

noble bay
#

which is why its triggering the if statement

#

the value doesnt exist so the variable is Null

#

or whatever the return type is for that function

#

it is most likely Null

fiery stream
#

anybody know of a good dotenv lib for python

fast trench
#

ok so I checked if it's undefined and it works but now if it's not undefined it it continuously going to the else statement

pale vessel
fast trench
#

sorry Jazz I don't

#

so now it's just always skipping the if statement with this code js if (reaction.emoji.name === '๐ŸŽซ') { const ticketConfig = await StateManager.connection.query(`SELECT * FROM ticketconfig WHERE messageId = ${reaction.message.id}`); console.log(ticketConfig[0][0]) if (!ticketConfig === undefined) { reaction.message.channel.send(`meow`) } else { reaction.message.channel.send(`This server is not setup in the ticket config database yet. Please contact the server owner and ask them to set it`) } }

noble bay
#

just check to see if the variable is a string

#

that's how you're storing it right

fast trench
#

I shouldn't have to...it's not undefined

outer niche
#

When this is ran in the code it does not seem to work because it does not change the game or the status of the bot any ideas

async def on_ready():
    await bot.change_presence(status=discord.Status.dnd, activity=discord.Game('!help'))```
noble bay
#

what

#

oh

#

you can set presence during initialization, for starters

outer niche
#

It used to work like 3 weeks ago though

fast trench
#

any idea on my issue of it not doing the if/else statement right?

terse lynx
#

how to put random condition in java

pale vessel
#

try ticketConfig !== undefined

terse lynx
#

you answered mine?

pale vessel
#

no

fiery stream
#
            if resp.status not in [200, 404]:
                raise exceptions.WebAPIInvalidResponse(
                    status=resp.status
                )

            if resp.status == 404:
                await ctx.send(
                    ctx("API Error")
                )
                return

            data = await resp.json()
            print(data)
           # print(data.location.name)

        location = data["location"]
        
        print(location)``` hey so i cant manage to get the name from json data
#

the name is located in location

#

but idk how to get it help tickNo

terse lynx
#

how to put "or" condition in if...else java

fiery stream
#

isnt it ||

fast trench
#

try ticketConfig !== undefined
@pale vessel nope...which was expected lol

terse lynx
#

please give an example@fiery stream

fast trench
#

!== is for math I believe

delicate zephyr
#

@terse lynx

if (1 || 2) {}
else {}
#

@fast trench no?

#

!== means doesn't equal which works for objects and strings and arrays

fast trench
#

well I know it's not for comparing to 2 things like I'm trying to do...I'm trying a different setup real quick

fiery stream
#

@terse lynx idk java but it might be like ```if (food = food || 2+2=4) {}

#

something like that

delicate zephyr
#

^

terse lynx
#

i mean this

    msg.channel.send(`top`);
  }```
#

top and tip for random

fiery stream
#

wdym

terse lynx
#

??

fiery stream
#

what do you mean?

terse lynx
#

user typed = .tip
bot sended = top
(i want that my bot also say tip in random )

fast trench
#

nvm I got it a different way lol

sudden geyser
#

If you want something "random" in Java (such as generating a random number), check out the java.util.Random class

noble bay
#

@fiery stream are you asking how to get a dictionary key from a nested dictionary? If so it's just data["location"][whatever]

#

like you just keep going with the brackets

fiery stream
#

so next should be name?

noble bay
#

yeah

fiery stream
#

@noble bay ^^?

#

thx

fast trench
#

wait...not working...now it's just going to the if statement again...

noble bay
#

just check for the value of the return, you know what you want it to be

#

the data type I mean

fast trench
#

not sure what you mean

noble bay
#

well firstly, what does the console.log output

fast trench
#

if it's undefined its still doing the if statement...It shouldn't be doing the if statement

terse lynx
#

im very confused

noble bay
#

I'm not fluent in JS so I can't help you with specific syntaxing

#

but what I'm saying is to check to see if it's a string

terse lynx
#

it is constant

noble bay
#

if that's how you're storing it

fast trench
#

does anyone else know what to do?

#

I'm using js and MySql

noble bay
#

what format are you storing the variables in

fast trench
#

VARCHAR

noble bay
#

oh wait

pale vessel
#

i don't think that matters in this case

fast trench
#

do you have any ideas?

terse lynx
#

please suggest me any non coding free website for bot

fast trench
vale garden
#

hi

#

how do you find a tagged user's status

#

like the author's status is

terse lynx
#

please suggest me any non coding free website for bot

vale garden
#

message.author.presence.status

sudden geyser
#

Rishit what do you mean

terse lynx
#

@scenic geode

vale garden
#

he means

#

a website

#

where you can make a bot

#

without coding

terse lynx
#

YES

sudden geyser
#

sounds like discord bot maker

fast trench
#

why would this be skipping the if statement if ticketConfig[0][0] isn't undefined in the db? js if (reaction.emoji.name === '๐ŸŽซ') { const ticketConfig = await StateManager.connection.query(`SELECT * FROM ticketconfig WHERE messageId = ${reaction.message.id}`); console.log(ticketConfig[0][0]) if (!ticketConfig === undefined) { reaction.message.channel.send(`meow`) } else { reaction.message.channel.send(`This server is not setup in the ticket config database yet. Please contact the server owner and ask them to set it`) } }

copper cradle
#

if (food == food || 2 + 2 == 4) {}

fiery stream
#

@noble bay im gussing you know python i have one more question i got this code (url=data["current"]["weather_icons[0]"]) i cant get the array part to work in weather_icons[0]

copper cradle
#

that's not how you check for undefined values

pale vessel
#

since rows are always sent (they could be empty), you can just check by using if (ticketConfig[0][0]) {}

copper cradle
#

you can't just check by undefined

vale garden
#

how do you find a tagged user's status
like the author's status is
message.author.presence.status

terse lynx
#

@sudden geyser do u know

copper cradle
#

negate the item

fast trench
#

that's not how you check for undefined values
@copper cradle that's how I do it in all my other commands and code...

terse lynx
#

does anyone know

copper cradle
#

@fast trench yeah that shouldn't work

pale vessel
#

try what i sent

copper cradle
#

it's undefined

#

yet it errors

#

bc it's undefined

#

inception

pale vessel
#

or just do if (a) lol

fiery stream
#

uhhh

noble bay
#

@fiery stream brackets on the outside

copper cradle
#

yeah

fiery stream
#

wdym

terse lynx
#

please suggest me any non coding free website for bot

fast trench
#

since rows are always sent (they could be empty), you can just check by using if (ticketConfig[0][0]) {}
@pale vessel yeah but it doesn't allow empty data in the table...every box has to have a valid message id

fiery stream
#

@noble bay can i get an example?

copper cradle
#

just do if (a) if it exists if (!a) if it doesn't

noble bay
#

[weather_icons][0]

pale vessel
#

i meant that if nothing exist from the query, the rows are empty

fiery stream
#

ohh

fast trench
#

@terse lynx they already did

fiery stream
#

and do i have to double quote 0? @noble bay

fast trench
#

just do if (a) if it exists if (!a) if it doesn't
@copper cradle tried

pale vessel
#

if the first element inside an array exist, it's not empty and there's result

noble bay
#

no just the weather thing

terse lynx
#

@fast trench where

fast trench
#

read up ๐Ÿคฆโ€โ™‚๏ธ

#

ok so why is it skipping the if statement then @pale vessel ?

pale vessel
#

oh it still didn't work?

terse lynx
#

bro discord bot maker is paid

fast trench
#

no...that's been the problem

brittle mica
#

flaze

pale vessel
#

console.log(ticketConfig)

earnest phoenix
#

have you tried like n

brittle mica
#

do u use node-supefetch?

pale vessel
#

node-fetch

earnest phoenix
#

coding it by yourself lol

fast trench
#

ok and it logs it correctly

brittle mica
#

ah

pale vessel
#

i don't need node-superfetch

earnest phoenix
#

bot maker software isn't supported in this channel

brittle mica
#

would it be possible

noble bay
#

iirc sql databases output as tuples

brittle mica
#

could u help me

terse lynx
#

i need website

noble bay
#

but maybe that's just SQLite

merry shuttle
brittle mica
#

im trying to get headers to work

#

like for api keys

terse lynx
#

not an application

brittle mica
#

and I dont have any examples

#

do u have anything I could base my thing off?

pale vessel
#

the xiao source

#

xiao uses node-superfetch

#

(iirc)

fast trench
#

it logs ticketConfig correctly

noble bay
#

send a screenshot of the output

brittle mica
#

i know

#

i looked in xiaos code

#

couldnt find

#

any uses of headers

#

which sucks

pale vessel
#

what happens if i send one from the source?

brittle mica
#

huh?

open oracle
#

can someone get banned from this server if they stole my accidentally leaked token?

brittle mica
#

ye

open oracle
#

ok

brittle mica
#

zod Dm a mod

open oracle
#

ok

noble bay
#

you can regenerate bot tokens and changing your password changes your token@open oracle

brittle mica
#

what happens if i send one from the source?
@pale vessel huh?

open oracle
#

i did

noble bay
#

okay good

#

now dm a mod

brittle mica
#

^

open oracle
#

they deleted my whole discord thankfully i had a template

fast trench
open oracle
#

but they unlocked my minecraft server console

#

im so happy that there was no damage done to that tho

pale vessel
#

like

#

dude

open oracle
#

?

noble bay
#

not you

fast trench
#

sooooooo'

pale vessel
#

if console.log(ticketConfig[0][0]) works then js if (ticketConfig[0][0]) reaction.message.channel.send(`meow`) should also work. weird

fast trench
#

it doesn't though

pale vessel
#

yeah

#

that's the thing

fast trench
#

oh I thought you meant that in a sarcastic asshole way lol I didn't see you put weird

pale vessel
#

you're an asshole yourself

#

ok just to be clear

#

console.log(ticketConfig[0][0]) really works right?

fast trench
#

oh wait...I think I made progress lol one second

brittle mica
#

flaze

pale vessel
#

yis

brittle mica
#

thanks for the exmple

pale vessel
#

okay

#

it was the .set() for headers

#

query() for GET parameters

fast trench
#

and it's working all of a sudden ๐Ÿ˜‚ idk why but when I changed the !ticketConfig === undefined to just ticketConfig[0][0].messageId it started working for some weird reason

#

actually it's this sorry ```if (!findTicket[0][0].messageId === undefined) {

pale vessel
#

oh

fast trench
#

yeah idk ๐Ÿคทโ€โ™‚๏ธ

pale vessel
#

why don't you just use !==

#

! on the front is out of place imo

#

not that you care anyway

merry shuttle
fast trench
#

it works this way so it's good lol

#

idk i've been having that issue too

fiery stream
vale garden
#

hi

fiery stream
#

hello

vale garden
#

whats wrong in this

#
if message.author.presence.status === "online"
      const onlineEmbed = new Discord Message.Embed()
      .setColor('#00ff00')
      .setTitle(`${message.author}'s Status:`)
      .setDescription("You are currently **`Online`**")

      message.channel.send(onlineEmbed)

      if message.author.presence.status === "idle"
      const idleEmbed = new Discord Message.Embed()
      .setColor('#ffa500')
      .setTitle(`${message.author}'s Status:`)
      .setDescription("You are currently **`Idle`**")

      message.channel.send(idleEmbed)

      if message.author.presence.status === "dnd"
      const dndEmbed = new Discord Message.Embed()
      .setColor('#ff0000')
      .setTitle(`${message.author}'s Status:`)
      .setDescription("You are currently on **`Do Not Disturb`**")

      message.channel.send(dndEmbed)

      else 
      const invisibleEmbed = new Discord Message.Embed()
      .setColor('#f0f0f0')
      .setTitle(`${message.author}'s Status:`)
      .setDescription("You are currently **`Invisible/Offline`**")

      message.channel.send(invisibleEmbed)
#

hi

#

plz someone tell

fiery stream
#

whats the error my guy

vale garden
#

if message.author.presence.status === "online"
^^^^^^^

SyntaxError: Unexpected identifier

pale vessel
#

you're using js

sudden geyser
#

You're kind of just throwing random stuff out there.

fiery stream
#

um else or if function is wrong

grand dagger
#

@fiery stream LoL humidity: 9, 9 what. Temp 33, 33 what. Wind: N0

pale vessel
#

what

sudden geyser
#

The language can't read your mind. You need to provide it valid syntax. if requires parentheses.

vale garden
#

oh

#

i tried that

fiery stream
#

@grand dagger thats api and its correct and N in wind stands for north

grand dagger
#

n0 what though

#

m/s?

fiery stream
#

m/s?

grand dagger
#

km/h?

vale garden
#

if (message.author.presence.status) === "online"
^^^

SyntaxError: Unexpected token '==='

#

now getting this

fiery stream
#

mph

vale garden
#
if (message.author.presence.status) === "online"
      const onlineEmbed = new Discord Message.Embed()
      .setColor('#00ff00')
      .setTitle(`${message.author}'s Status:`)
      .setDescription("You are currently **`Online`**")

      message.channel.send(onlineEmbed)

      else if (message.author.presence.status) === "idle"
      const idleEmbed = new Discord Message.Embed()
      .setColor('#ffa500')
      .setTitle(`${message.author}'s Status:`)
      .setDescription("You are currently **`Idle`**")

      message.channel.send(idleEmbed)

      else if (message.author.presence.status) === "dnd"
      const dndEmbed = new Discord Message.Embed()
      .setColor('#ff0000')
      .setTitle(`${message.author}'s Status:`)
      .setDescription("You are currently on **`Do Not Disturb`**")

      message.channel.send(dndEmbed)

      else 
      const invisibleEmbed = new Discord Message.Embed()
      .setColor('#f0f0f0')
      .setTitle(`${message.author}'s Status:`)
      .setDescription("You are currently **`Invisible/Offline`**")

      message.channel.send(invisibleEmbed)
grand dagger
#

i love how itโ€™s stated

vale garden
#

the code

#

^

fiery stream
#

thx ig

vale garden
#

what

fiery stream
#

multi that code is all wrong

vale garden
#

how

fiery stream
#

not all but yeah

pale vessel
#

you need to close it after the condition ends

vale garden
#

im kinda bad

#

at

#

with {]

#

?

#

{}

pale vessel
#

)

merry shuttle
#

it works this way so it's good lol
@fast trench You talking to me?

vale garden
#

after each if?

pale vessel
fiery stream
#

@vale garden your way (message.author.presence.status) === "dnd" correct way (message.author.presence.status === "dnd")

vale garden
#

ok thx

fiery stream
#

dont mind the ")"

vale garden
#

const onlineEmbed = new Discord Message.Embed()
^^^^^

SyntaxError: Unexpected token 'const'

#

now why is this

#

an error

pale vessel
#

add curly brackets

fiery stream
#

uh i dont want to spoon feed this guy

pale vessel
#

this is not python lol

vale garden
#

for the embed?

fiery stream
#

somebody please help him

vale garden
#

plz

#

lol

#

plz

pale vessel
#

learn javascript

fiery stream
#

thx @pale vessel for that ^^^

vale garden
#

finally im done

#

lol

#

bruh

fiery stream
#

learned something lol?

vale garden
#

the command is working

#

what

fast trench
#

they need a command like TheSourceCode server has that links to different djs doc pages lol

fiery stream
#

true

grand dagger
#

itโ€™s still ass

fiery stream
#

howwwww

grand dagger
#

Where are the units

#

?

fiery stream
#

uh i forgot that

#

thx for reminding

grand dagger
#

Humidity; 9

#

LMAO

noble bay
#

yeah what does that mean

fiery stream
#

wait how is humidity measured tho

grand dagger
#

9%

#

Is what it is

#

supposed to be

fiery stream
#

so in percent?

grand dagger
#

The rest are ยฐC

#

Yes

hushed vale
#

can someone help me with canvas

#

in js

grand dagger
fiery stream
#

@grand dagger only the "ยฐ" stands for celsius too huh

grand dagger
#

it means degree

fiery stream
#

im dumb at this stuff ๐Ÿ™„

grand dagger
#

ยฐF, ยฐC

fiery stream
#

is the c supposed to be capital?

pale vessel
#

ยฐK lul

grand dagger
#

Iโ€™m not sure lemme check

pale vessel
#

yes

woven moth
#

ยฐC

fiery stream
grand dagger
#

๐Ÿ‘

fiery stream
#

cool

#

lol

hushed vale
#

can someone help me with canvas in js

fiery stream
#

i suck at that

grand dagger
#

ion know what that is wiggLMAO

fiery stream
#

its like drawing with code

hushed vale
#

ya

grand dagger
#

oh

#

shapes and shiiz I c

hushed vale
#

i just get tons of errors

fiery stream
#

uh i have no idea how canvas works sorry

hushed vale
#

k

grand dagger
#

Anyone know of a free lyrics api

#

xd

fiery stream
#

actually i do

#

but its pretty limited

#

you can only acces 30% of the first lyrics

grand dagger
#

The one I use had a large database, but it blocked my vps from connecting to it

#

Oh that

fiery stream
#

yeah

grand dagger
#

ik what ur talking about

fiery stream
#

yeah that part of it sucks

grand dagger
#

I shall keep looking

fiery stream
#

yeah

hushed vale
#

try this

#

@grand dagger

fiery stream
grand dagger
#

Yeah Iโ€™m on their website xd

#

Letโ€™s see

#

Joined on*

fiery stream
#

oh thx

grand dagger
#

Idk if you need the bot: false thing

#

Since Bots have the tag

#

But up to y

#

You*

fiery stream
#

most people got it in there bots

#

so imma keep it too

grand dagger
#

I have a date for when they created their discord account

#

You could add that 2 if u want

fiery stream
#

nah i had that removed that

#

i dont think anybody cares about taht

grand dagger
#

y

#

really bruh

#

itโ€™s literally one of the only sick things

#

An info command tells you

#

(Is this person an alt? Y/N) xd

fiery stream
#

wdym by last msg

#

lol

grand dagger
fiery stream
#

oh the days thing is useful

#

but too much work

grand dagger
#

bruh

#

discordโ€™s API tells you that info

fiery stream
#

oh srsly?

#

idk maybe later on

grand dagger
#

get used

#

User

#

Then from that it gives that info

noble bay
#

get member

grand dagger
#

^

restive furnace
#

date#now - api#date

grand dagger
#

I think

restive furnace
#

smh

noble bay
#

user and member are different

#

get member

fiery stream
#

oh nice

#

for now imma test every command i got then imma make my bot public tmr

pure lion
#

Sup

fiery stream
#

by public i mean the upload part

pure lion
#

You should have done that 2 weeks ago

#

Or so

noble bay
#

also art shouldn't you just have an info command that displays all of the info instead of a unique join date command

grand dagger
#

itโ€™s on info and a unique one

#

on both

pure lion
#

Y tho

noble bay
#

that seems wasteful

fiery stream
#

bruh

grand dagger
#

y not

noble bay
#

it wastes memory

fiery stream
#

the dumbest thing happened to me

grand dagger
#

my bot usually never goes over 150mb

#

and Iโ€™ve dedicated 1gig to it

noble bay
#

that's a lot

fiery stream
#

mine never goes over 10mb

pure lion
#

People spam ping my bot and my computer dies

grand dagger
#

LOL

#

Bruh

#

how

noble bay
#

mine never goes over 40 and it's quite robust

fiery stream
#

art how many people use your bot?

grand dagger
#

not many only 2k members

noble bay
#

the number of people using it shouldn't impact the memory much

fiery stream
#

oh well mine is used by 3 people in guild as of now

noble bay
#

each asynchronous function uses kilobytes at most

grand dagger
#

a few of my commands do heavy computation

pure lion
#

Mine is used in 20 servers or so

noble bay
#

mine is in a server with 2k members as well

grand dagger
#

I think Iโ€™ve got near 100 commands now

#

planning on adding more games later

noble bay
#

quite impressive

fiery stream
#

yo guys

grand dagger
#

cards against humanity soon

fiery stream
#

anybody here older then 18?

grand dagger
#

Iโ€™m 18

fiery stream
#

i got locked out

noble bay
#

I am 18

fiery stream
#

and i cant test nsfw commands

pure lion
#

Ah

noble bay
#

lmao

pure lion
#

Sounds like a job for horny teenager

fiery stream
#

true ^^

noble bay
#

not me

pure lion
#

Not me either

fiery stream
#

if anybody wants to help me lmk

grand dagger
#

LOL

#

Make ur own server

#

Test there

pure lion
#

Ye send me

#

I'm curious as to what else your bot does ๐Ÿ‘€ ๐Ÿ‘€ ๐Ÿ‘€ ๐Ÿ‘€ ๐Ÿ‘€ ๐Ÿ‘€

fiery stream
#

no the thing is the asked me age when i entered nsfw

noble bay
#

You don't need to mark the channel as nsfw

#

if you're the only person in the server

grand dagger
#

ur bot asks ur for ur age

#

nice

fiery stream
#

@commands.is_nsfw()

noble bay
#

discord does

fiery stream
#

not my bot

noble bay
#

not the bot

grand dagger
#

oh

pure lion
#

Yeah mate I'm 2828282828

fiery stream
#

its discord's new thing

grand dagger
#

Yeah discord did that recently

noble bay
#

it's a new thing

#

it's to comply with eu laws

pure lion
#

Oh

grand dagger
#

if u put under 18

#

Ur not allowed in nsfW channels?

pure lion
#

Good thing my bot isn't nsfw

fiery stream
#

nope

grand dagger
#

LOOOOOL rip horny children

noble bay
#

they reme

#

mber

pure lion
#

re
mem
ber

fiery stream
#

okay peace out imma do some testing

pure lion
#

Gl

grand dagger
#

Oki

#

MAL blocked my IP

#

Pogs!

noble bay
#

have you really spammed their API that much

grand dagger
#

they blocked everyone and their moms

#

nah they just wanted to clear out traffic

fiery stream
grand dagger
#

well

#

you need to have that

#

To have any nsfw commands

#

Xd

#

Atleast

fiery stream
#

true but the way he tells the general needs to be nsfw

grand dagger
#

Alright

fiery stream
#

lol

#

wait you can fuck people with bot

#

lmao

grand dagger
#

Dw bout what it does

fiery stream
#

y'all got weird stuff going on with bots

grand dagger
#

;)

#

You have a website or commands list?

#

@fiery stream

#

yes

fiery stream
#

command list of what?

grand dagger
#

of ur bot

fiery stream
#

well im making a bot rn

grand dagger
#

i c

fiery stream
#

and i dont think im plan on making that

#

its just gonna be a in bot command list thing

grand dagger
#

So built in command list?

fiery stream
#

yeah

grand dagger
#

ye

#

I should do that 2 hmm

fiery stream
#

other thing is 2 much work

grand dagger
#

xd

fiery stream
#

its not like i cant do that but im lazy

#

rn im just going for a good bot that can get me a badge

grand dagger
#

I c

#

Ye

fiery stream
#

yeah

grand dagger
#

I have 1

#

I donโ€™t like it but it suffices

fiery stream
#

have what 1?

grand dagger
#

Website

fiery stream
#

oh i got multiple

grand dagger
#

To list the commands

fiery stream
#

not for bot tho

#

actually i do got one website for bot

#

its old rust bot that i made a while back with friends

grand dagger
#

Nice

fiery stream
#

yeah

#

art

#

what lang did you do your bot in

grand dagger
#

Java

fiery stream
#

oh

#

nice

grand dagger
fiery stream
#

why crab o=lol

grand dagger
#

y not

fiery stream
#

idk

#

lol turns out alot of my nsfw commands dont work

grand dagger
#

f

fiery stream
#

yeahh

grand dagger
#

jus fix ez

#

Whenever I get a bug I note it down until I find the time to fix it

fiery stream
#

its api

grand dagger
#

the apiโ€™s the issue?

fiery stream
#

yeah

grand dagger
#

Which API

fiery stream
#

import nsfw_dl its a python package

grand dagger
#

oh

fiery stream
#

yeah

grand dagger
#

I use rest apiโ€™s for my nsfw commands

fiery stream
#

oh you got link

grand dagger
#

Each command uses a dif api

#

Depends on what ur tryna do with urs

fiery stream
#

everything lol

grand dagger
#

Nice.

fiery stream
#

can i get the links lol

grand dagger
#

dm me what ur looking for

#

Aye looks like MAL unbanned

#

^-^

fiery stream
#

print(member.activities.) guys im having trouble unpacking tuple help

#

i want to access the spotify data help

earnest phoenix
#

Is doing client.connect() required to send a message to a DM channel?

fiery stream
#

print(member.activities.title) i would really appreciate if someone could help me

#
    print(member.activities.title)
AttributeError: 'tuple' object has no attribute 'title'```
slender thistle
#

Uhhhh

#

access the first element

#

Just like you would do with a list

fiery stream
#

actually i need it for a spotify command

#

and i have no idea how i get that from there

slender thistle
#

You also might need a check to ensure it's Spotify

fiery stream
#

sure ill do that later

#

first i need to figure this out

grand dagger
#

Tuple

slender thistle
#

Probably a for-loop with comparing activity.type tl discord.ActivityType.listening

#

Or if you are really sure the user has only Spotify as their presence and cba to do it, member.activities[0]

fiery stream
#

when i do [0] it just prints "Spotify"

slender thistle
#

Yeah, because print calls str() on the object

fiery stream
#

uh ahk

grand dagger
#

repr owo

slender thistle
#

You still get an object with accessible properties

#

Yeah, repr sounds appropriate

fiery stream
#
            ctx.send("No Music Found")
            return``` is that good enough for check
#

@slender thistle

slender thistle
#

nope

fiery stream
#

why not?

#

oh i forgot [0]

slender thistle
#

You are comparing a... Spotify object to a string

#

Yeah, that too

fiery stream
#
            ctx.send("No Music Found")
            return``` now?
slender thistle
#

I check the type with if activity.type == dsicord ActivityType.listening

#

Eh

fiery stream
#

isnt mine correct tho

slender thistle
#

That's quite a workaround

fiery stream
#

k cool

grand dagger
#

Can bots read an entire channel?

trim saddle
#

depends

fiery stream
#

Duration: 0:03:19.534000 how do i get rounded duration lol

weary ridge
#

precentage?

#

Umm Soo I Need Help With My First Cmd I Can't Find Any Vids ? Any Help?

trim saddle
#

round the seconds before inserting

slender thistle
#

Probably round() :p

fiery stream
#

ohk lol

earnest phoenix
#

Is logging in the bot required to send messages?

#

hi i am discord.js new leaner i have to set help command in embed anyone can help

cinder patio
#

yes Sun! The bot must make a connection with the gateway

slender thistle
#

Sending a message is an API call

cinder patio
slender thistle
#

I believe it only needs to be connected once since the the bot account was created and then you can send messages without active connection

#

Yup, it doesn't say anything about an active connection during sending

cinder patio
#

yeah ^ that's true

earnest phoenix
#

ok

#

gl

#

and dont copy paste the code, try to understand it

#

ok but channel is not defined channel.send(Embed);

#

@earnest phoenix

honest perch
#

message.channel.send

earnest phoenix
#

yes

sick cloud
#

is there any half decent lib for js that can convert times reliably (ie. 12h or 12 hours) to milliseconds

mossy vine
sick cloud
#

cool thanks

#

and is there any library to convert them back to being readable that isn't huge

#

humanize is ok but big

mossy vine
#

this can

green yarrow
#

just splice

#

the string

sick cloud
#

cool

#

splicing = unreliable

strong tundra
#

new Time() gives time since epoch iirc

#

in ms

sick cloud
#

ms seems like it'll work

earnest phoenix
#

message.channel.send
@honest perch or get(x)/the id of the sv and then send(r)

#

Depends where you want to send the embed

sick cloud
#

so to get the time it'd be after the time provided, Date.now() + ms(...) should work right

true ravine
#

Dumbass question, but how do you ping a role by ID in discord (like how you do @proven sorrel for users, but for roles)

mossy vine
#

<@&id>

green yarrow
#

put the role id

true ravine
#

Ohhh that's it thank you

green yarrow
#

yee

mossy vine
#

<@&265125253443878912>

true ravine
#

Cheers cyber

#

ooo

mossy vine
#

yeah

#

thats it

sick cloud
#
Examples

ms('2 days')  // 172800000

so i could add Date.now() to that to get the time in 2 days basically

green yarrow
#

momentjs

strong tundra
#

yeah

green yarrow
#

moment().add(2, "days")

sick cloud
#

ms already does conversion

strong tundra
#

that's how i do it for refreshing oauth tokens

sick cloud
#

why would i install another module

mossy vine
#

because the js ecosystem promotes bloated design

green yarrow
#

why do you need high accuracy ms though

#

because the js ecosystem promotes bloated design
that's an under statement.

sick cloud
#

reminders

strong tundra
#

oh i should try adding that

#

although i've actually never seen an implementation of it

sick cloud
#

i'm just adding a crap basic one to my mod bot

earnest phoenix
#

Is a timmeout error, it appears when the connection between your bot that is in vc and discord sv is not stabile, time is 15 secs, obv the bot didnt connect, try again to upload the code, thats an error on music bots, in vc

#

Is a timmeout error, it appears when the connection between your bot that is in vc and discord sv is not stabile, time is 15 secs,obv the bot didnt connect, try again to upload the code, thats an error on music bots, in vc
@earnest phoenix has a solution?

#

basically the connection is not stable, try to run the code on cmd or on node(swich the one you use), idk, is an normal error, try again(as sometimes when you as a user connect to vc and have a big amount of ms the connection is no longer stabile and you might get disconnect, like this is the bot too), im not so much into a discord music bot but i believe that you cant fix that;

#

Strange, because I have a simple music bot without advanced commands and normal correct

#

connect*

#

is an usual error

#

sorry my english i'm brazilian

#

is ok im not native too

#

so there's nothing wrong with programming?

feral aspen
#

Hello!

#

Hello
[13:01]
Can anyone help me in a oding??
[13:01]
*coding.
[13:01]
I have this problem "Cannot read propery 'for each' of undefined", Array.forEach (<anonymous>)
[13:02]
It started when I added the Muted command
[13:02]
and when I remove the command.. it works.
[13:02]
any help?

earnest phoenix
#

no, i dont think the code is wrong

#

@earnest phoenix at least you can play one song without error right?

#

casue if you can play that means that is ok and the error happenes

#

all other functions work normal, except music

feral aspen
#

Hello.. can anyone help me? I have this problem "Cannot read propery 'for each' of undefined", Array.forEach (<anonymous>)..

It started when I added the Muted command.. and when i removed it.. it works..
Any help? ๐Ÿ˜ฎ

earnest phoenix
#

it worked to play at least one song? bcs last time i tried musc, the error was like after 10-12 songs played

#

in the other bot yes, if I add more functions it will give an error

#

debug your code, hamoodi

feral aspen
#

debug your code, hamoodi
@earnest phoenix I tried.. it didnt work

earnest phoenix
#

it worked to play at least one song? bcs last time i tried musc, the error was like after 10-12 songs played
@earnest phoenix don't even touch the first

#

then you didn't try

#

if you had debugged you would have found your issue already

feral aspen
#

How can I do that?

earnest phoenix
#

@earnest phoenix true

#

imagine claiming you debugged when you don't know what debugging is omegalul

#

dont be so mean

#

inspect your variables and log on every closure

#

follow all the parameters

#

@feral aspen

#

that will tell you to what point the code had executed and what the values of the variables are

#

and the logs sometimes might help

feral aspen
#

The problem is Im a beginner.

#

So I may need some help.

true ravine
#

When fetching messages from a text channel in discord.js by a limit or time period rather than an ID, are the messages in the order they were cached?

sick cloud
#
const reminders = client.data.reminders.filter((x) => {
            console.log(Date.now(), x.expiresAt, (Date.now() >= x.expiresAt))
            return (Date.now() >= x.expiresAt);
        });

        console.log(reminders.length)```

1591866465629 1591866020858 true
undefined

am i doing something stupid here
#

it returns true in the filter but returns undefined

true ravine
#

I've never seen a filter done like that before tbh

sick cloud
#

return (Date.now() >= x.expiresAt);

#

this basically

earnest phoenix
#

it's just a multiline

sick cloud
#

it returns true

#

but reminders = undefined after

#

got no idea why

true ravine
#

Are the other bits meant to be separated by commas or should it be semicolons?

sick cloud
#

console.log is just for debugging and makes zero diff

true ravine
#

Oh wait nvm I didn't see they were inside the console log

#

Idk then

earnest phoenix
#

see which type reminders is

sick cloud
#

i really don't see where it's failing lol

#

ok

#

an object apparently

earnest phoenix
#

stringify it and see the props

sick cloud
#

oh i see it's using the db type still

#

got it, just gotta conv to array

crude ember
#

Hey idk if I asking questions in right channel so my question is how can I add manual shard system In python

sick cloud
#

do you need to shard

crude ember
#

Yes we need to shard

sick cloud
#

how many servers do you have

crude ember
#

1830+

green yarrow
#

no

#

you can setup sharding, most libs provide automatic deployment of shards.

#

if you don't need it, it'd only deploy one shard.

rigid gazelle
#

I need help to figure out if it's possible to configure a discord server so that a discord bot with Server Administrator privileges can.... reference a Server Role, but without @mentioning it.

A while back before a particular Discord update, roles were able to be confisued so that nobody could @mention a role, not even owner/server admins, and when a user tried to @mention the role, it appeared as plaintext, but still it was possible for bots to be programmed to present the role in a message as a kind of @rolename link, but it did NOT ping or mention that role!

But now, that seems to not be the case. Now even if a role is not flagged as @mentionable, a user/bot with Server Administrator privilege causes the role to be @mentioned. Is there a way to configure a bot to be able to make the role name @linkable but without causing a ping @mention notification for users with that role?

split hazel
#

I think your best bet is embeds

rigid gazelle
#

This is probably more related to permission, server administration than bot development, but, I guess regarding development, is there a way to recreate the old experience where a role can be @flat lantern without mentioning it, perhaps as part of sending a flag to Discord API along with the message?

#

oops, sorry, I didn't mean to mention anyone

golden condor
#

You could escape it

#

With \

rigid gazelle
#

Ah, I almost figured out, but not quite.

golden condor
#

Do something like this

#

\<@&304313580025544704>

coral trellis
#

Nice

bitter sundial
#

that just pinged mods

slender thistle
#

Well

golden condor
#

Wait what

coral trellis
#

-atmods

frail ocean
#

Awesome.

gilded plankBOT
#

Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.

Here are some examples of emergencies:

  • Raids / Multiple members mass spamming.
  • Severe disruption of Discord's ToS (NSFW content, etc)
  • Anything that requires more than 2 moderators to handle.
slender thistle
#

It's still a mention

golden condor
#

What

#

I'm a fucking idiot

#

i'm so sorry

earnest phoenix
#

how do i send a dm

green kestrel
#

what library?

earnest phoenix
#

discord.js

golden condor
#

<user>.send(CONTENT)

earnest phoenix
#

thanks

#

Is there a possible reason as to why my clusters are constantly dying when I never had this kind of problem before?

golden condor
#

any errors?

sacred wraith
#

What value do you guys use for messageCacheMaxSize (discord.js)? I have it currently set to 20, but I'm wondering if I can reduce it further without adverse effects.

cinder patio
#

If you don't use cached messages at all, set it to 0

split hazel
#

thats sometimes not the best choice, it's best to set it to a low value, even if you don't think you'll be using it

#

discord.js treats cache like a king

quartz kindle
#

i set it to 5

#

but it doesnt matter for me because i dont cache channels (only active ones)

#

so even if i cached 200 messages it would still be less than 5 messages on thousands of channels lul

cinder patio
#

I don't think setting it to 0 would have any side effects

#

Other than maybe channel.lastMessage being null

pearl igloo
#

when i try to start my bot, i don't get anything? This is all i got after 10mins in my Terminal

quartz kindle
#

if it didnt return control do you, that means its running

#

does it not come online?

astral remnant
#

bOt AwAiTinG aPProVal

scenic briar
#

me and a friend are making a warn command on discord.js and we get a error whenever we try to warn eachother? Anyone know what this error means?

TypeError: Discord.RichEmbed is not a constructor
    at Client.<anonymous> (C:\Users\Jon\Desktop\SpiderBot Project\index.js:578:22)
    at Client.emit (events.js:224:7)
    at MessageCreateAction.handle (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\c```
earnest phoenix
#

Hey guys I know using html to change my bot page but how do I make the bot name different colour I tried with h1 and h2 but that doesn't seem to change that

#

Thanks in advance

#

Oh wait I've worked it out

golden condor
#

no

#

@scenic briar are you using v11 or v12

scenic briar
#

Oh I didn't realise I was in v12 ๐Ÿคฆ

golden condor
#

oh lel

still merlin
#

I'm so confused rn, I edited my ban command to DM a user right before they get banned and then I randomly got this error.. can someone help me?

PS C:\Users\Jon\Desktop\SpiderBot Project> node .
(node:4816) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
Logged in as SpiderBot#9421 with a ping of 436ms
C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\BitField.js:150
    throw new RangeError('BITFIELD_INVALID');
    ^

RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.
    at Function.resolve (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\BitField.js:150:11)
    at Permissions.has (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\BitField.js:45:28)  
    at Permissions.has (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\Permissions.js:45:85)
    at C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\structures\GuildMember.js:268:53```
#

I don't even have a bitfield.js

golden condor
#

I'm so confused rn, I edited my ban command to DM a user right before they get banned and then I randomly got this error.. can someone help me?

PS C:\Users\Jon\Desktop\SpiderBot Project> node .
(node:4816) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
Logged in as SpiderBot#9421 with a ping of 436ms
C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\BitField.js:150
    throw new RangeError('BITFIELD_INVALID');
    ^

RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.
    at Function.resolve (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\BitField.js:150:11)
    at Permissions.has (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\BitField.js:45:28)  
    at Permissions.has (C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\util\Permissions.js:45:85)
    at C:\Users\Jon\Desktop\SpiderBot Project\node_modules\discord.js\src\structures\GuildMember.js:268:53```

@still merlin it's about your permissions

#

Did you use message.member.hasPermission ?

still merlin
#

yeah

golden condor
#

what did you put in there

still merlin
#
        return message.channel.send(
          "**error** You don't have the ban members permission!"
        );

      const member = message.guild.member(user);
      let dmsEmbed = new Discord.MessageEmbed()
        .setTitle("Ban")
        .setColor("#ff7f27")
        .setDescription(`You have been warned on __${message.guild.name}__`)
        .addField("Banned By", message.author.tag)
        .setFooter("๐Ÿ—ฃ๏ธ ๐Ÿ”จ");

      user.send(dmsEmbed);

      message.delete();

      message.channel.send(`${user.tag} has been banned`);

      if (member) {
        member
          .ban({
            reason: "",
          })
          .then(() => {
            message.channel.send(`โ˜… I have banned ${user.tag} โ˜…`);
          })```
golden condor
#

instead of the comma put ||

green yarrow
#

no?

still merlin
#

what comma though

pale vessel
#

no.

golden condor
#

if (!message.member.hasPermission(["BAN_MEMBERS" || "ADMINISTRATOR"]))

pale vessel
#

it works as is

green yarrow
#

^

still merlin
#

what

vale garden
#

hlo

golden condor
#

That's what I do

#

and it works

pale vessel
#

then you are pepega

golden condor
#

shut up

autumn summit
#

Does anyone know how to get items from an array in mongodb?
Like in my db there is something that looks like this:
Array >
id: any player id
id: any player id

vale garden
#
const Discord = require("discord.js");
const client = new Discord.Client();
const Eco = require("quick.eco")
const eco = new Eco.Manager()
let shop = new Eco.ShopManager()

module.exports = {
    name: 'buy',
    description: "for buying items in the shop",
    execute(message, args) {

      let water_bottle = args[0];

      let add = shop.getItem(message.author.id, "water_bottle");
      let subtract = eco.removeMoney(message.author.id, 750);

      if (!args)
      return message.reply("Please enter an item to be bought like this for example:\n2t!buy water_bottle")

      if (args[0])

      return message.reply(`You have bought a ${getItem.item.Name} for ${removeMoney.amount}`)


    }
}

my code ^
and im getting this error

execute(message, args) {
  ^^^^^^^

SyntaxError: Unexpected identifier
#

help

autumn summit
#

Does anyone know how to get items from an array in mongodb?
Like in my db there is something that looks like this:
Array >
id: any player id
id: any player id

golden condor
#

Does anyone know how to get items from an array in mongodb?
Like in my db there is something that looks like this:
Array >
id: any player id
id: any player id
@autumn summit <array>.find(variable => condition)

vale garden
#

someone

#

help

#

me

green yarrow
#

@vale garden put function in front of it

autumn summit
#

tysm

earnest phoenix
#

hello

green yarrow
#

and shut the fuck up

vale garden
#

fuction execute?

#

lol

#

ok

#

soz

green yarrow
#

ask once, you don't need to spam

golden condor
#

not you

vale garden
#

kk

earnest phoenix
#

caca

vale garden
#

function in front of what

green yarrow
#

execute

#

baboon

vale garden
#

not working bruh

green yarrow
#

go learn javascript

pale vessel
#

learn how to pass a function

still merlin
#

Apparently its my warn command thats giving a weird bitfield error thing..
the code is

  let args = message.content.substring(prefix.length).split(" ");

  switch (args[0]) {
    case "warn":
      if (!message.member.hasPermission("MANAGE_MEMBERS"))
        return message.reply(
          "**error** You need the manage members permission to do this!"
        );
      let reason = args.slice(1).join(" ");
      let user = message.mentions.users.first();
      if (message.mentions.users.size < 1)
        return message.reply(
          "**error** You must mention someone to warn them!"
        );
      if (reason.length < 1)
        return message.reply(
          "**error** You must have a reason for the warning!"
        );

      let dmsEmbed = new Discord.MessageEmbed()
        .setTitle("Warn")
        .setColor("#ff7f27")
        .setDescription(`You have been warned on __${message.guild.name}__`)
        .addField("Warned by", message.author.tag)
        .addField("Reason", reason);

      user.send(dmsEmbed);

      message.delete();

      message.channel.send(`${user.tag} has been warned`);
  }
});
green yarrow
#

you make me angry

pale vessel
#

stop resending

#

oh my god

golden condor
#

MANAGE_MEMBERS ?

still merlin
#

resending what?

golden condor
#

What

pale vessel
#

that's the error

green yarrow
#

has nobody hear of pastebin or hastebin?

golden condor
#

That doesn't exist

green yarrow
#

it's a lovely thing

pale vessel
#

nope

vale garden
#

dude i do the same thing everytime

still merlin
#

I really need to read the docs

vale garden
#

execute

pale vessel
#

yes you do, why are you not reading it, like why?

golden condor
#

Try MANAGE_GUILD or MANAGE_ROLES

still merlin
#

ok thanks!