#development

1 messages ยท Page 1140 of 1

drifting wedge
#

wdym

earnest phoenix
#

./db.json

drifting wedge
#
def get_prefix(client, message):
    with open('prefixes.json', 'r') as f:
        prefixes = json.load(f)

        return prefixes[str(message.guild.id)]

client = commands.Bot(command_prefix = get_prefix)```
#

thats my code

earnest phoenix
#

. is the current wd

#

@drifting wedge dude, just do ./ and tr

#

y

drifting wedge
#

./

#

where tho

slender thistle
#

Add ./ to the left of prefixes.json

drifting wedge
#

with open(./'prefixes.json', 'r') as f:

misty sigil
#

no

#

in the string

earnest phoenix
#

@drifting wedge cat ./text.txt would do the same as cat text.txt, u understand?

stable nimbus
#

@misty sigil The reason why its 15 seconds is because a status can only change 4 times in a minute, 60/4 = 15. I have 4 total status's. And I want it to update when my bot is added to a guild is my goal.

drifting wedge
#

yea

pure lion
#

Je rae me

faint prism
#

Json is so suspectable to corruption x_x also you can't write to it at the same time from multiple processes because it's a file

misty sigil
#

@stable nimbus I'd just advise using client.guilds.cache.size

#

as if you're using d.js all guilds are cached

drifting wedge
#

waot

#

if i were to move to sqlite

earnest phoenix
drifting wedge
#

would it work better?

earnest phoenix
#

@faint prism corruption has nothing ntondo with that, the errno clearly states that the file isn't present

#

any idea why im getting this error?

#

its on a vps

misty sigil
#

no

earnest phoenix
#

if i run it on my pc it works fine but on the server it says that

misty sigil
#

WE NEED CODE

#

gah caps

earnest phoenix
#

who

drifting wedge
#
    with open('prefixes.json', 'r') as f:
        prefixes = json.load(f)

        return prefixes[str(message.guild.id)]

client = commands.Bot(command_prefix = get_prefix)```
faint prism
#

@faint prism corruption has nothing ntondo with that, the errno clearly states that the file isn't present
@earnest phoenix I'm talking in general. Not keeping up with the active convo rn

earnest phoenix
#

@earnest phoenix did you use /usr/bin/env/python3/2 instead of just python

#

@earnest phoenix I'm talking in general. Not keeping up with the active convo rn
@faint prism Ah, sorry.

#

@earnest phoenix the shebang

faint prism
#

:) no worries

midnight blaze
#

this isnt even python

earnest phoenix
#

def seems like python to me. I might just be an idiot since I've never used it.

midnight blaze
#

lol, the def one is python

earnest phoenix
#

yes

slender thistle
#

Mentioned the wrong person

midnight blaze
#

but the other code is js

earnest phoenix
#

Oh fuck I pinged the wrong person, sorry.

midnight blaze
earnest phoenix
#

@earnest phoenix can you pipe to nl so I can see where the error occurred?

#

also backticks are not quotes @earnest phoenix

languid pollen
#

So I'm trying to make a list of embed objects but for some reason it's complaining over a space? I can't figure out what's wrong

@client.event
async def on_message(message):
    if message.content.startswith('$starbae'):
        mylist = [embed = discord.Embed(title="Endo, ###", description="1 station away", color=discord.Color.purple())
        embed.set_author(name=client.user.name, icon_url=client.user.avatar_url)
        embed.add_field(name="============", value='test', inline=False)
        embed.add_field(name="Field2", value="hi2", inline=False), discord.Embed(title="Endo, 101", description="1 station away")
        embed.set_author(name=client.user.name, icon_url=client.user.avatar_url), discord.Embed(title="Endo, 101", description="1 station away", color=discord.Color.purple())
        embed.set_author(name=client.user.name, icon_url=client.user.avatar_url)
        embed.add_field(name="============", value='test', inline=False)
        embed.add_field(name="Field2", value="hi2", inline=False), discord.Embed(title="Endo, 101", description="1 station away", color=discord.Color.purple())
        embed.set_author(name=client.user.name, icon_url=client.user.avatar_url)]
        await message.channel.send(random.choice(mylist))
midnight blaze
#

try this is member.displayName instead of member.author.tag

#

@earnest phoenix

#

member.author.tag does not exist

earnest phoenix
#

Might want to read the documentation for the library and the API lmfao

midnight blaze
#

he tried. message.author.tag which only works in a message event

earnest phoenix
#

Guys I need help... I need more custom command ideas...

#

Ah.

midnight blaze
#

@earnest phoenix So

earnest phoenix
#

@earnest phoenix action commands like slap or hug, a rules command, a randomimage command that gets a random image from a site

#

Hmm that's a good idea

#

await channel.send(embed=embed)
AttributeError: 'NoneType' object has no attribute 'send'

#
async def on_connect():
    embed = discord.Embed(
        description='**NFO** Has Detected An Attack!\n\n**Location**: Chicago\n\nA Filter Has Been Applied To Protect The Server.',
        color=0xee7000,
        )
    embed.set_thumbnail(url='https://media.discordapp.net/attachments/725272853565538416/742432548180852736/warning.png')
    channel = client.get_channel(742452987435155586)
    await channel.send(embed=embed)```
#

whys it saying that

midnight blaze
#

channel = client.get_channel(742452987435155586)
isnt id a string?
In js it is a string and not a number

earnest phoenix
#

python

midnight blaze
#

(I only code in js..so no clue about py)

#

I know that it is PYTHOn

earnest phoenix
#

channel = client.get_channel(742452987435155586)
isnt id a string?
In js it is a string and not a number
@midnight blaze fuck weak typing

sonic lodge
#

channel is a None value

midnight blaze
#

wut?

sonic lodge
#

so of course it wont have any useful properties

earnest phoenix
#

then what do i doo loll i literally grabbed the code on google

#

it should work

midnight blaze
#

LOOL

sonic lodge
#

oh no

midnight blaze
#

@earnest phoenix what do you mean?

earnest phoenix
#

not the whole code now calm down

#

only to send to a specific channel

karmic compass
#

i'm working on a PingCatcher feature in my bot, how do i see if a message has a mention included in it anywhere in the message?

sonic lodge
#

and that's the correct channel id?

earnest phoenix
#

yes

sonic lodge
#

put it in a string

earnest phoenix
#

wdym

#

' '?

sonic lodge
#

'id'

#

and if it still returns None the channel wasn't found

earnest phoenix
#

@earnest phoenix what do you mean?

  1. why would you have numerical values as strings
  2. In js, "1" == 1 evaluates to true.
sonic lodge
#

oh just found that the docs says int

solemn latch
#

finally fixed my index
nearly 500 lines, down to 75.

midnight blaze
#

When I fetch channels, I get them in strings. So, that was just an idea.

earnest phoenix
#

because js is a little special snowflake and supports numbers up to 53bits

midnight blaze
#

I know that this is the case in js, but is it in python?

earnest phoenix
#

py should support unsigned 64 bits no problem iirc

slender thistle
#

Yup

#

D.py uses int for IDs

sonic lodge
earnest phoenix
#

When I fetch channels, I get them in strings. So, that was just an idea.
@midnight blaze channel contents or IDs?

summer torrent
#

i'm working on a PingCatcher feature in my bot, how do i see if a message has a mention included in it anywhere in the message?
@karmic compass which lib

faint prism
#

long long ;)

earnest phoenix
#

py should support unsigned 64 bits no problem iirc
@earnest phoenix long long was a good idea

#

@faint prism fuck beat me to it

faint prism
#

Heheheh

earnest phoenix
#

weak typing is the devil

faint prism
#

I'm mobile rn too. That swipe to text is the key

earnest phoenix
#

lol

#

@faint prism what

faint prism
#

||Edited previous msg||

#

Oh you mean, weakly typed datatypes

earnest phoenix
#

@faint prism No, weak typing in prigrammong

drifting wedge
#
@client.command()
async def changeprefix(ctx, prefix):
    if author.has_permissions(manage_messages=False):
        ctx.send(f"Sorry, you don't have permission to do this!")
    else:
        @commands.has_permissions(manage_messages=True)
        @commands.has_any_role("changeprefix", 'adminperms')
    with open('prefixes.json', 'r') as f:
        prefixes = json.load(f)

    prefixes[str(ctx.guild.id)] = prefix

    with open('prefixes.json', 'w') as f:
        json.dump(prefixes, f,indent=4)
        embed = discord.Embed(
            colour = discord.Colour.blue()
            )

        embed.set_thumbnail(url=f"{author.avatar_url}")
        embed.set_author(name=f"{author.name}", icon_url=f"{author.avatar_url}")
        embed.add_field(name=f"Prefix Change", icon_url=f"Prefix was changed to: {prefix}")
        embed.set_footer(text=f"{member.guild}", icon_url=f"{client.guild.icon_url}")
        embed.timestamp = datetime.datetime.utcnow()


    await ctx.send(embed=embed)```
#

im getting a tom of errors

#

i just wanna make it so if you dont have the permission, it says you cant do it

#

if you do it sends the embed

golden condor
#

Isn't it f'{stuff}' not f"{stuff}"

drifting wedge
#

i dont think it matters

#

but ill change it

#

thats not the errors tho

golden condor
#

what's the errot

drifting wedge
#

its some enexpected indent

#

but i dont think the code is correct

faint prism
#

@faint prism No, weak typing in prigrammong
@earnest phoenix yeah that's what I'm referring to

slender thistle
#

await ctx.send

#

Decorators are not indented unless nested

drifting wedge
#

the thing is

slender thistle
#

You don't have a command function there as well

drifting wedge
#

i think the code is wrong

slender thistle
#

A good assumption, because it is

drifting wedge
#

lol

earnest phoenix
#

^

drifting wedge
#

how would i just send the embed if they have the permission tho?

slender thistle
#

And I pointed out all mistakes in that code

#

@golden condor there's zero difference between apostrophes and quote marks in Python

golden condor
#

idk

#

Sorry

#

I thought it made a difference

slender thistle
#

It's just that you'll have to escape apostrophes in a string surrounded with apostrophes and vice versa for quote marks

golden condor
#

That's why I kinda asked instead of stated

slender thistle
#

@drifting wedge You can use channel.permissions_for in the command function

#

p.s. I'm on phone so you'll have to get the documentation yourself

drifting wedge
#

ok

slender thistle
#

Also, you can't slap a decorator in the middle of a function

#

Those are supposed to be above functions, they are function decorators

pure kernel
#

people

#

rate Site

#

?

drifting wedge
#

@pure kernel br?

pure kernel
#

@drifting wedge sim

drifting wedge
#
@client.command()
@commands.has_permissions(manage_messages=True)
@commands.has_any_role("changeprefix", 'adminperms')
async def changeprefix(ctx, prefix):
    with open('prefixes.json', 'r') as f:
        prefixes = json.load(f)

    prefixes[str(ctx.guild.id)] = prefix

    with open('prefixes.json', 'w') as f:
        json.dump(prefixes, f,indent=4)

        embed = discord.Embed(
            colour = discord.Colour.blue()
            )

        embed.set_thumbnail(url=f"{author.avatar_url}")
        embed.set_author(name=f"{author.name}", icon_url=f"{author.avatar_url}")
        embed.add_field(name=f"Prefix Changed", icon_url=f"Prefix was changed to: {prefix}")
        embed.set_footer(text=f"{member.guild}", icon_url=f"{client.guild.icon_url}")
        embed.timestamp = datetime.datetime.utcnow()


    await ctx.send(embed=embed)```
#

is this correct?

slender thistle
#

That's one way of doing it, yes

drifting wedge
#

doesnt work...

slender thistle
#

icon_url doesn't exist in fields

drifting wedge
#

ah

#

wait

#

wut

#

i did it in another embed

slender thistle
#

It exists in author and footer

drifting wedge
#

oooh

#

ok

#

sorry typo

#

how would i find the author tho

#

it said author not defined

golden condor
#

author.author.avatar_url

drifting wedge
#

you need to import discord py

golden condor
#

is it message.author.avatar_url

drifting wedge
#

or whatever ur using

#

and then u need to run the token

#

message.author.avatar_url

#

i want the author url

#

not to message the author

summer torrent
#

Why my bot offline
@earnest phoenix we don't know

drifting wedge
#

i got it

#

ty

slender thistle
#

is it message.author.avatar_url
@golden condor avatar_url.url iirc

#

or just fucking str(avatar_url) it

golden condor
#

Idk

pure lion
#

Would having nginx stop a discord client from connecting to discord?

slender thistle
#

Because avatar_url returned Attachment last time i opened the docs

eternal flame
#

i need help making a block of code that switches statuses ever 10 minutes, and there are 3 statuses that it switches between, ive tried setinterval and timeout but nothing happend

golden condor
#

Eh

#

Idek shiv

odd lichen
#

Hello, I am trying to get a value from json. Currently its case sensitive. But I want to make it so it isnt. The json im trying to read is from https://api.skripttools.net/v4/addons. The thing im trying to read is like mundoSK ASkAddon but I have to type it with the correct capital letters etc. Is there a way to make it non case-sensitive?

( javascript btw)

golden condor
drifting wedge
#
embed = discord.Embed(
            colour = discord.Colour.blue()
            )

        embed.set_thumbnail(url=f"{message.author.avatar_url}")
        embed.set_author(name=f"{message.author.name}", icon_url=f"{message.author.avatar_url}")
        embed.add_field(name=f"Prefix Changed", value=f"Prefix was changed to: {prefix}")
        embed.set_footer(text=f"{member.guild}", icon_url=f"{client.guild.icon_url}")
        embed.timestamp = datetime.datetime.utcnow()


    await ctx.send(embed=embed)```
#

is this correct?

odd lichen
#

what is that? like python?

drifting wedge
#

yes

odd lichen
#

idk anything about it

drifting wedge
#

it says message not defined

pure lion
#
require('dotenv').config()
const config = process.env
const mongoose = require('mongoose');
const { Client } = require('discord.js');
const client = new Client();

mongoose.set('useFindAndModify', false);
mongoose.set('useCreateIndex', true);
mongoose.Promise = global.Promise;

const dbOptions = {
    useNewUrlParser: true,
    useUnifiedTopology: true,
    poolSize: 5,
    connectTimeoutMS: 10000,
    family: 4
};

mongoose.connect('mongodb://localhost:6969/better-dbl2', dbOptions);
mongoose.connection.on('connected', () => {
    console.log('[NOTICE] Mongoose connected');
});

client.on('connected', () => {
    console.log('[NOTICE] Discord client connected')
});

client.on('error', err => {
    console.error(err)
})

client.login(config.token)

the discord client doesnt wanna connect

solemn latch
#

i wouldnt want to connect either

pure lion
#

:(

drifting wedge
#

lol

solemn latch
#

no message event, sad bot

odd lichen
#

isnt env like capitals

#

idk

pure lion
#

It's ready

restive night
#

no ready event

pure lion
#

I'm so retarded

#

Also it's not a bot

restive night
#

what?

pure lion
#

Okay I can finally start the better-dbl2

solemn latch
#

gk

#

gl

left nacelle
#

does the bot go offline when u go off ur pc

pure lion
#

Thanks

slender thistle
#

Yes

solemn latch
#

if you dont have a vps

odd lichen
#

if you are hosting it yourself yes

pure lion
#

Yeah

left nacelle
#

vps?

solemn latch
#

virtual private server

odd lichen
#

Hello, I am trying to get a value from json. Currently its case sensitive. But I want to make it so it isnt. The json im trying to read is from https://api.skripttools.net/v4/addons. The thing im trying to read is like mundoSK ASkAddon but I have to type it with the correct capital letters etc. Is there a way to make it non case-sensitive?

( javascript btw)

Anyone can help with this btw?

pure lion
#

But I'm testing on my vps because I'm a madlad

left nacelle
#

does it cost money

drifting wedge
#
@client.event
async def on_guild_join(guild):
    with open('prefixes.json', 'r') as f:
        prefixes = json.load(f)

    prefixes[str(guild.id)] = '.'

    with open ('prefixes.json', 'w') as f:
        json.dump(prefixes, f, indent=4)

@client.event
async def on_guild_remove(guild):
    with open('prefixes.json', 'r') as f:
        prefixes = json.load(f)

        prefixes.pop(str(guild.id))

        with open('prefixes.json', 'w') as f:
            json.dump(prefixes, f, indent=4)

@client.command()
@commands.has_permissions(manage_messages=True)
@commands.has_any_role("changeprefix", 'adminperms')
async def changeprefix(ctx, prefix):
    with open('prefixes.json', 'r') as f:
        prefixes = json.load(f)

    prefixes[str(ctx.guild.id)] = prefix

    with open('prefixes.json', 'w') as f:
        json.dump(prefixes, f,indent=4)

        embed = discord.Embed(
            colour = discord.Colour.blue()
            )

        embed.set_thumbnail(url=f"{message.author.avatar_url}")
        embed.set_author(name=f"{message.author.name}", icon_url=f"{message.author.avatar_url}")
        embed.add_field(name=f"Prefix Changed", value=f"Prefix was changed to: {prefix}")
        embed.set_footer(text=f"{member.guild}", icon_url=f"{client.guild.icon_url}")
        embed.timestamp = datetime.datetime.utcnow()


    await ctx.send(embed=embed)```
solemn latch
#

hosting indeed costs money

slender thistle
#

there's the option of looping through the keys and .toLowerCase them all

drifting wedge
#

it says message not defined

pure lion
#

LoC

left nacelle
#

welp this is annoyinf

odd lichen
#

We need more development channels to prevent cross posting

left nacelle
#

i wish it was online always

digital ibex
#

no we dont

slender thistle
#

@drifting wedge ctx.message

digital ibex
#

its gonna be more hell

drifting wedge
#

?

odd lichen
#

cross posting is annoying

#

:/

solemn latch
#

i dont. hosting your own bots is a good thing

opaque eagle
#

We need a stateful discord bot lib

slender thistle
#

Use ctx.message instead of just message

opaque eagle
#

with middleware

digital ibex
#

hell x100

left nacelle
#

imma go add more pokemon commands

odd lichen
#

someone make a discord.js documentation bot

#

๐Ÿ‘

solemn latch
#

theres already one iirc

odd lichen
#

xD

left nacelle
#

my bot already has like 5 commands only

solemn latch
#

but, you know the actual docs website is faster

odd lichen
#

it is

drifting wedge
#

wait wayt @slender thistle

odd lichen
#

but whats the fun about that

drifting wedge
#

ctx.message

#

not ctx.send?

#

im a litle confuzled

opaque eagle
#

What's fun about a bot to do that @odd lichen

#

A website is much more fun

#

bots are tedious

odd lichen
#

nah

#

websites slow

#

XD

left nacelle
#

eh ill just go onto my lsptop and not turn it off and just close the top

slender thistle
#

ctx.message is the message they invoked the command

opaque eagle
#

not everything needs to be a bot

odd lichen
#

at least for me

slender thistle
#

ctx.send is a shortcut for ctx.channel.send

solemn latch
#

the bot would be even slower then

#

๐Ÿค”

odd lichen
#
  • its helpful to show people the syntax
opaque eagle
#

Websites are more fun to make too

odd lichen
#

without having to send them a link

drifting wedge
#

but what would i change then?

opaque eagle
#

don't send them a link

#

tell them what property/method to refer to

slender thistle
#

message in the embed methods

opaque eagle
#

and they can go search the docs

solemn latch
#

the only reason you need to send a link, is if the user didnt look themselves

opaque eagle
#

^

solemn latch
#

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

odd lichen
#

But most people quit if you tell them to search the docs sadly

left nacelle
#

i also applied for my bot to be in this server

opaque eagle
#

Which if a user doesn't want to do, they clearly have no motivation to learn

drifting wedge
#

message.author?

opaque eagle
#

too bad @odd lichen

odd lichen
#

yeah I guess

solemn latch
#

really beyond help if they cant be bothered to read docs

#

thats what docs are for

slender thistle
#

message.author changed to ctx.message.author

solemn latch
#

quick as possible getting of info

drifting wedge
#

yes

#

so add ctx?

slender thistle
#

Yes

#

Everywhere where you try to access a message variable

drifting wedge
#

raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'message' is not defined

#
embed = discord.Embed(
            colour = discord.Colour.blue()
            )

        embed.set_thumbnail(url=f"{ctx.message.author.avatar_url}")
        embed.set_author(name=f"{ctx.message.author.name}", icon_url=f"{ctx.message.author.avatar_url}")
        embed.add_field(name=f"Prefix Changed", value=f"Prefix was changed to: {prefix}")
        embed.set_footer(text=f"{ctx.member.guild}", icon_url=f"{ctx.client.guild.icon_url}")
        embed.timestamp = datetime.datetime.utcnow()


    await ctx.send(embed=embed)```
#

nope didnt wrok

slender thistle
#

I...

#

never said replace

drifting wedge
#

? didnt replace

#

i just added

slender thistle
#

ctx.member

drifting wedge
#

ctx.member.author?

slender thistle
#

ctx.author

#

ctx.client doesn't exist

drifting wedge
#

in your opinions

#

are thubnails good?

#

like do they look good?

nocturne dagger
#

Does anyone here know unbuntu?

#

Like know the OS fairly well

solemn latch
#

I know it well enough to use it daily

sinful belfry
#

-ask2ask

gilded plankBOT
#

Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.

Please read https://dontasktoask.com/ for an explanation on why this is an issue.

left nacelle
#

will i get pinged or messsaged if my bot gets accepted

sudden geyser
#

Luca will DM you to my knowledge and you'll be pinged in #logs.

left nacelle
#

ok

#

idk ehy im asking ill probably br rejected

solemn latch
#

dont submit until your confident your bot will be accepted

left nacelle
#

i mean im confident

solemn latch
#

and confident it will be online when the mod is reviewing

left nacelle
#

it eill be cool if it gets accepted

solemn latch
left nacelle
#

my bot eill be always online

#

since im on laptop so i can just close the cover and it wont power off

sonic lodge
#

try to get it on a hosting service if you can

left nacelle
#

maybe

thin turret
#

Mine would power off when my laptop went to sleep

haughty igloo
#

Hello

solemn latch
#

yeah, it does that

haughty igloo
#

i wanna help

solemn latch
#

heya

haughty igloo
#

How can I fix?

left nacelle
#

wtf?

solemn latch
#

thats pretty unreadable

left nacelle
#

thats so much

solemn latch
#

error messages can be long

#

looks like your unauthorized to do whatever your doing

haughty igloo
#

u not know

#

i not know

left nacelle
#

i think my bot is not bad so far

#

wanna see it Woo

haughty igloo
#

How can I fix?

solemn latch
#

get proper authorization

#

i can look at any bots rn, in the middle of shrinking my index

misty sigil
#

Anyone know how to run a bot from another file

#

Like I have an index.js for a website and I wanna fetch data from discord with a bot

left nacelle
#

seriously

#

my bot is sending thibgs twice

misty sigil
#

what

finite bough
#

is that data just something u need for a sec or u need to store it

left nacelle
#

i only type it once

misty sigil
#

You're running two instances.

solemn latch
#

probably logged in twice

misty sigil
#

Or logging in twice

#

as Woo said.

left nacelle
#

gonna spam log out then

misty sigil
#

is that data just something u need for a sec or u need to store it
@finite bough just stuff i wanna fetch

finite bough
#

exporting them then?

#

or like

misty sigil
#

i want to start the js file from within another

solemn latch
#

you can require them

left nacelle
#

ffs

#

imma look around to see

finite bough
#

u made no sense rn lmao

left nacelle
#

if anythings wrong

misty sigil
#

lmao

finite bough
#

u can do like

#
return client.users.cache.get(id)
}
#

then export the function to the other js file

left nacelle
#

yeah nothings wrong

#

i logged out

#

and logged in

#

and still sending twice

solemn latch
#

log out, and run the command again

#

while logged out

left nacelle
#

it works when i log out

#

only sends once

finite bough
#

question

solemn latch
#

pretty sure he is just running locally

#

which means he has a rouge terminal somewhere

finite bough
#

@left nacelle

left nacelle
#

what

finite bough
#

what is ur bot hosted on

left nacelle
#

nothing

finite bough
#

turn it off and then check if it's working

left nacelle
#

i did

#

but now its saying thw wrong thing

finite bough
solemn latch
#

do you have an extra terminal somewhere?

left nacelle
#

idk

#

lemme check

#

lemme restart everything

#

to check if it works then

#

now it sends 2 things on other commands

solemn latch
#

did you restart your laptop

left nacelle
#

lemme do that real quick

#

alright mt laptop is loading

#

btw

#

how does this happen

solemn latch
#

having the program running twice

#

running
node .
then without closing the program, running
node .
again

left nacelle
#

works noe

#

doesnt send ir twice

#

hey woo atleast im not asking alot of questions anymore lmao

thick gull
#

your probably were running it somewhere

left nacelle
#

probs

#

brb im a hungry boi

#

so im gonna work on bot later

hardy vector
#

in webstorm i added my vps details into it but i cant open up the files in the folder and edit them it only lists all the folders in the vps

solemn latch
#

the account you logged in with, does it have permissions to read/write these files?

hardy vector
#

yea

finite bough
#

clicking in the folders?

misty sigil
#

How do I match multiple things in regex

solemn latch
#

when you say multiple things, what do you mean?

misty sigil
#

say I wanted to match links

#

invite prevention to be specific

solemn latch
misty sigil
pure lion
#

if (/(discord.gg)/g.test(msg.content.toLowerCase())) msg.delete()

#

y regex no work

solemn latch
#

/invite isnt 100% needed

#

for example

misty sigil
#

ok yea but i'd rather keep my server ad free lmao

pure lion
#

woooooooooooooooooooooooo why is my regex not working

solemn latch
#

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

pure lion
#

ah

solemn latch
#

wont match blank invites either

#

https?:\/\/discord\.gg\/\w{1,50}

honest perch
#

/(https:\/\/)?(www\.)?(discord\.gg|discord\.me|discordapp\.com\/invite|discord\.com\/invite)\/([a-z0-9-.]+)?/i

solemn latch
#

^ could even keep going

honest perch
#

Most accurate i could get

pure lion
#

lmfao

#

ty

solemn latch
#

? your https
http works with invite links

honest perch
#

Doesn't matter

#

It will pick up both

pure lion
#

it doesnt delete the msg

vague kite
#

Hey if I'm sending a message across like 2.6k servers, what would be the best method. Cause I dont think client.guilds.cache.forEach(...) would be the best

misty sigil
#

das a prob on your side

solemn latch
#

api abuse

misty sigil
#

Hey if I'm sending a message across like 2.6k servers, what would be the best method. Cause I dont think client.guilds.cache.forEach(...) would be the best
@vague kite I don't think doing that would be the best

#

thats api aboose

vague kite
#

Yeah thought so

misty sigil
#

dinkle

#

give code

solemn latch
#

client isnt defined

misty sigil
#

well no shit lmao

pure lion
#
    if (/(https:\/\/)?(www\.)?(discord\.gg|discord\.me|discordapp\.com\/invite|discord\.com\/invite)\/([a-z0-9-.]+)?/i.test(msg.content.toLowerCase())) return msg.delete()
```confusedโ„ข๏ธ
tardy fiber
#

can i do it in dm? pana

honest perch
#

No

misty sigil
#

Fine.

honest perch
#

You have to match it @pure lion

pure lion
#

oh

vague kite
#

I don't think doing that would be the best
What would be the best way then??

pure lion
#

but test is supposed to return a boolean

solemn latch
#

dont do it

#

use an announcement channel in your bots support server

#

those who want to know, can follow it

pure lion
#

yeah doesnt work with match either

vague kite
#

use an announcement channel in your bots support server
But what if the whole point of the bot is to deliver news and stuff

honest perch
#

You would have to slowly send them

amber fractal
#

webhooks

honest perch
#

Or webhooks

amber fractal
#

never use the bot to send announcements, that's all on one client

misty sigil
#

thats a big large reatlimtie

amber fractal
#

technically, you can send from every webhook at once I believe

#

every webhook would have different ratelimits no?

pure lion
#

i am so confused

#

why is the regex not working

honest perch
#

You just gotta do it right

pure lion
#

if (string.match(regex)) do shit

vague kite
#

webhooks
So I gotta learn how to use webhooks so ๐Ÿ™‚

#

Thanks guys

drifting wedge
#

how do i check the servers the bot is in/the amount of users?

earnest phoenix
#

in which library

drifting wedge
#

discord py rewrite

honest perch
#

Read the docs

solemn latch
#

if(regex.test(string)) message.delete()

#

works

pure lion
#

hMmM

solemn latch
#
if(/(https:\/\/)?(www\.)?(discord\.gg|discord\.me|discordapp\.com\/invite|discord\.com\/invite)\/([a-z0-9-.]+)?/i.test(message.content)) message.delete()
#

tried on my test bot, worked fine

hardy vector
#

im using the ftp/sftp extension and all its doing is listing the folders

#

i mean i can edit each file, but i want it to be like the vscode ssh extension where when u connect to a host it opens up the folder in the menubar

#

pwease help i cant find anyone who uses webstorm ):

solemn latch
#

never used it

#

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

hardy vector
#

welp

solemn latch
#

got my index down to 45 lines, and its mostly just database stuff now

#

๐Ÿ™€

hardy vector
#

today i got the github student dev pack thing and i was excited about getting access to webstorm

#

nice

misty sigil
#

Epic.

hardy vector
#

but now i cant even do shit with it

left nacelle
#

my bot is gonna take ages to finish

#

like all of it

#

cuz theres so much pokemon in pokemon

#

theres like 800-900

rocky hare
#

ok

thick gull
#

cuz theres so much pokemon in pokemon
@left nacelle you should use an API instead of hard coding it

left nacelle
#

api?

ionic dawn
#

you dont have to write every single pokemon info by hand

#

theres probably lists or apis that can provide that information

left nacelle
#

i sometimes copy and paste

ionic dawn
#

My bot have every single item/block of minecraft, and just took 10m to code it

left nacelle
#

damn

ionic dawn
#

mojang api already provide that info

#

theres probably any pokemon source where you can take that info

left nacelle
#

pokeapi

#

but whenever i try to copy and paste something like that i get 50 problems

thick gull
#

dont copypaste

#

just connect to the API

ionic dawn
#

apis are so helpful, if you need help mayb I can give you a hint

thick gull
#

Itโ€™ll save you a ton of time

#

I have like 20 api commands on my bot that wouldโ€™ve taken forever to do by hand

ionic dawn
#

yeah, same

#

well my bot is api based so... yeah.. kek

left nacelle
#

uh

solemn latch
#

a lot of bots create api's for their bots to even function. I was considering actually making all requests go to a local api

#

so i could port it to a website, or an app quite easily

thick gull
#

im thinking about making my own public api but that takes EFFORT:(

left nacelle
#

this is confusing

ionic dawn
#

im thinking about making my own public api but that takes EFFORT:(
feelsbadman

solemn latch
#

ive only made private api's at this point

rocky hare
#

who can hit me too

thick gull
#

???

ionic dawn
#

@solemn latch I never tried to make one or even read about it, is it hard?

solemn latch
#

i would like to learn more about authentication before making a public api

#

you can get a grasp on the basics in a half an hour tbh

left nacelle
#

what am i supposed to do in the skeleton code

thick gull
#

thatโ€™s just an example

#

you donโ€™t need to use that

ionic dawn
#

well, you have any idea of connecting to an api?

thick gull
#

you can use your own code

left nacelle
#

const { Client, MessageEmbed } = require('discord.js');

const client = new Client();
const prefix = '!';

client.once('ready', () => {
console.log('Ready!');
});

client.on('message', async message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;

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

// ...

});

client.login('your-token-goes-here');

thick gull
#

yeah you donโ€™t need it

left nacelle
#

it looks like this

ionic dawn
#

codefied

#

pls

misty sigil
#

```

thick gull
#

thatโ€™s just the base they started with

#

you donโ€™t need to use it

left nacelle
#

oh ok

solemn latch
#

```js
code here
```

ionic dawn
#
const { Client, MessageEmbed } = require('discord.js');

const client = new Client();
const prefix = '!';

client.once('ready', () => {
    console.log('Ready!');
});

client.on('message', async message => {
    if (!message.content.startsWith(prefix) || message.author.bot) return;

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

    // ...
});

client.login('your-token-goes-here');
left nacelle
#

woo do i need it

torn ravine
#

if I were to make an api. idk what I'd do with it

misty sigil
#

same lmoa

ionic dawn
#

Can you link me that poke api?

misty sigil
#

but i done it

thick gull
solemn latch
left nacelle
#

yes

thick gull
#

or that

left nacelle
#

both the same lol

ionic dawn
#

That probably work

#

is it updated?

left nacelle
#

yeah i think

solemn latch
misty sigil
left nacelle
#

but its only missing the gen 8

solemn latch
#

not since sword and shield

left nacelle
#

pokemon

misty sigil
#

and so does pokeapi tho

left nacelle
#

yeah

thick gull
ionic dawn
#

Well... my last pokemon was that green from GBA so

left nacelle
#

i really like pokemon sword and shield

#

its a good game

solemn latch
#

not touched it yet

#

i have it

ionic dawn
#

anyhow... you just have to make a request to that api

thick gull
#

it was 60 requests / 1 minute before but it was lowered cause someone was nuking it KEKW

left nacelle
#

also so woo do i need this part

ionic dawn
#

and pass an arg or whatever on the request

left nacelle
#

const { Client, MessageEmbed } = require('discord.js');

const client = new Client();
const prefix = '!';

client.once('ready', () => {
console.log('Ready!');
});

client.on('message', async message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;

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

// ...

});

client.login('your-token-goes-here');

misty sigil
#

argh

thick gull
#

No

ionic dawn
#

so people can request an specific poke

misty sigil
#

code block pls

thick gull
#

that is skeleton code

#

you donโ€™t need it

ionic dawn
#

code without `` give me anxiety

thick gull
solemn latch
#

uh

left nacelle
#

what

solemn latch
#
 P.getPokemonByName('eevee') // with Promise
    .then(function(response) {
      console.log(response);
    })
    .catch(function(error) {
      console.log('There was an ERROR: ', error);
    });

left nacelle
#

wat is this

solemn latch
#

litterally so easy

ionic dawn
#

you can even track objects in the game

#

what the heck

#

berries pokeballs

left nacelle
#

berry flavours too

ionic dawn
#

not just pokemons

thick gull
#

ok im switching

ionic dawn
#

Who the hell made that api

thick gull
#

soonโ„ข๏ธ

ionic dawn
#

he got a lot of time

solemn latch
#

lmao

thick gull
#

data entry

left nacelle
#

yeah true

#

idk how to use this lmao

thick gull
#

might just add a command to access my counties public records cause itโ€™s public KEKW

solemn latch
#

it looks extremely straight forward

misty sigil
#

what are you trying to use @left nacelle

ionic dawn
#

ooh this API is made for pokemon games I see

left nacelle
#

im trying to add pokeaapi

misty sigil
#

Do you have node-fetch installed?

left nacelle
#

yes

ionic dawn
#

or you can do what panasonik is saying and fetch the response

#

then response.json and all that stuff

left nacelle
#

oh i didnt know this was a tutorial

ionic dawn
#

Spoonfeed isnt allowed right?

oak cliff
#

Correct

ionic dawn
#

But I can explain him how to make it work right?

oak cliff
#

Yeah

ionic dawn
#

Noice, so @left nacelle you here?

left nacelle
#

i am here

#

i just did the npm install part

ionic dawn
#

fetch or that poke?

left nacelle
#

i already downloaded fetch

#

so i down loaded the poke

ionic dawn
#

if you have fetch you dont need the poke thingy

left nacelle
#

oh

#

is it npm install fetch

#

just incase

ionic dawn
#

I'll try to explain something to you, if you lose me at sometime just say it, my english isnt the best

rocky hare
#

Who can kick my system pls?

left nacelle
#

ok

ionic dawn
#

Well, first of all you need any link to fetch, lucky for you you find that PokeAPI that provides you a link to request information

left nacelle
#

@rocky hare what u mean

#

oh

#

um

#

where is that

ionic dawn
#

on top of pokeapi.co

left nacelle
#

ok

ionic dawn
left nacelle
#

ok

ionic dawn
#

That link will provide you a block of information in JSON

#

and JSON allows you to extract the information that you need from all that block

left nacelle
#

which button

ionic dawn
#

Button?

left nacelle
#

which do i press

karmic compass
#

how do i check permissions for everyone in a guild in discord.js? using a channel editing command but only want it to work if the channel hasn't already been edited

left nacelle
#

which link

#

theres multiple

ionic dawn
#

the top one

left nacelle
#

what

ionic dawn
#

https://pokeapi.co/api/v2/pokemon/{YOUR POKEMON HERE}

solemn latch
ionic dawn
#

try it

#

u'll get a json response

solemn latch
#

you can even just put it in your browser

left nacelle
#

thats alot

ionic dawn
#

yep

drifting wedge
#

its a lot of code

ionic dawn
#

thats all the information available of a single pokemon

drifting wedge
#

but just to add permission

left nacelle
drifting wedge
#

i have the permission code

ionic dawn
#

Yeah, put as I said, you can take whatever you need

drifting wedge
#

just idk where to put it

ionic dawn
#

@left nacelle you have to parse it, raw jsons are unreadable

left nacelle
#

what

ionic dawn
#

Nevermind, you see all that code?

left nacelle
#

yes

ionic dawn
#

you can now take per example the abilities

#

and print in a message all the abilities of that pokemon

left nacelle
#

so should i just select all of it

#

then print

ionic dawn
#

You dont need to

#

I think you are trying to do the stuff by hand

#

when isnt needed

solemn latch
#

you can request any pokemon by fetching it from the api

ionic dawn
#

with a simple 10 lines code you can take every single pokemon information

solemn latch
#

and automatically get that info and make it readable for the user

left nacelle
#

bruh this is confusing

ionic dawn
#

actually reading that api im thinking about making a pokemon duel bot

left nacelle
#

im too dumb to make a game

ionic dawn
#

same, but you can always learn

solemn latch
#

i am working on adding battleship rn to my bot

ionic dawn
#

thats what programming is all about

solemn latch
#

exciting stuff

left nacelle
#

my ea

ionic dawn
#

im working on a pet system to my minecraft bot, but canvas prints are messing with me

solemn latch
#

anything canvas messes with everyone

thick gull
#

i hate canvas

left nacelle
#

idk what canvas is

thick gull
#

i spent 3 days trying to get avatar and username to show correctly without fucking up

left nacelle
#

ok

solemn latch
#

canvas makes it dumb easy to do stuff sometimes, and others its dumb hard

ionic dawn
left nacelle
#

ok

left nacelle
#

ok

ionic dawn
#

those images of welcome etc

solemn latch
#

made this in canvas aswell

left nacelle
#

woo ded

solemn latch
ionic dawn
#

for real?

solemn latch
#

yeah

ionic dawn
#

so cool actually

solemn latch
#

its my pride and joy

strange trout
#

gifencoder?

solemn latch
#

gifencoder 2

#

gifencoder is too slow

strange trout
#

Nais

left nacelle
#

um

solemn latch
#

20+ seconds for a gif to render in gifencoder

strange trout
#

Looks pretty simple to make

left nacelle
#

idk what to do with the code

solemn latch
#

the only real difficulty is layering

#

2 million possible costumes

#

with my current code

ionic dawn
left nacelle
ionic dawn
#

So @left nacelle how is that api thing going?

#

you get any result so far?

solemn latch
left nacelle
#

i did nothing yet

ionic dawn
#

oh.. hmm

left nacelle
#

im too confused

ionic dawn
#

never worked with json?

solemn latch
#

the wrapper makes it really easy

ionic dawn
#

oh wait theres a spider walkin in my desk

#

brb

harsh minnow
#

Anyone help me

left nacelle
#

i hate spiders

harsh minnow
#

I don't now coding

#

I want to make bot

left nacelle
#

know*

harsh minnow
#

See what j do now

#

I now only tjis

faint prism
#

aaaaa

left nacelle
#

why are u on phone

ionic dawn
#

coding in a phone

harsh minnow
#

Teo @left nacelle

ionic dawn
harsh minnow
#

Yep

left nacelle
#

teo?

harsh minnow
quasi arrow
#
activeServers = bot.guilds
print(activeServers)
summ=0
for s in activeServers:
    summ += len(s.members)
print(summ)

so..whats wrong here? the output is

[]
0
karmic compass
#

does anyone know how to check everyone's permissions in discord.js for a channel?

strange trout
#

I tried supporting gif profile pics on my rank card but it ended up having potato quality so I scratched that idea

ionic dawn
#

you trying to print all the guild names or?

#

all*

left nacelle
#

um

faint prism
#

Token leak

left nacelle
#

is that your code

#

yes

#

token

harsh minnow
#

How to upload my coding on my bot ??

ionic dawn
#

@faint prism eyes

solemn latch
#

upload?

ionic dawn
#

@harsh minnow you need to node {JS ROUTE}

harsh minnow
#

Give me the link @ionic dawn

karmic compass
#

wait would if(message.channel.permissionsFor(message.guild.roles.everyone).has('READ_MESSAGES) {
message.reply('This channel is visible!')
}

work?

ionic dawn
#

link?

wicked pivot
#
var RoleListGenre = ["535579820088754178", "535579900955066392", "662724365095403577"]

    if(RoleListGenre.some(role => { message.member.roles.find(r => r.id === role) })){
        console.log("true")
    }else{
        console.log("false")
    }```
its return me false while I have this role
solemn latch
#

wheres cry with the image explaining bots

ionic dawn
#

a lot of code spam here

left nacelle
#

alright time to try to do something with the code of ditto

wicked pivot
#

I am v11

faint prism
harsh minnow
#

@ionic dawngive me the link

ionic dawn
#

Didnt v11 will close?

summer torrent
#

yes

solemn latch
#

v11 is deprecated

ionic dawn
#

then why still using it? hmm

summer torrent
#

lemme send a screenshot

harsh minnow
#

Vo1d rply

left nacelle
#

idk what version im using lol

solemn latch
#

check your package.json

#

to see

#

i need to clean mine up

summer torrent
ionic dawn
#

ADI, as I can see you dont know how to even run the bot, so pls read how to first or watch a YT tutorial

wicked pivot
#

I have a heavy code earlier, it will take me several days to switch to v12 and I don't really have the motivation

karmic compass
solemn latch
#

well, djs v11 wont work in a few months

summer torrent
#

roles.everyone is not a thing

faint prism
#

who was the guy who posted the token. I forgot his name

summer torrent
#

just use message.guild.id

faint prism
#

Want to remind him to reset it

strange trout
#

It wasn't even the entire token

karmic compass
#

how can i fetch the everyone role @summer torrent ?

summer torrent
#

just use message.guild.id
@summer torrent

faint prism
#

Right, just to be safe

strange trout
#

Good luck guessing the rest

solemn latch
#

i uploaded someones token to github today to reset it

karmic compass
#

oh

solemn latch
#

if we are thinking of the same guy

rocky hare
#

!rank

#

-verifybot

placid iron
summer torrent
#

guild's ID is same with everyone's ID

solemn latch
#

when discord tokens get put on github they get auto reset

strange trout
#

If the repo is public

karmic compass
#
if(!message.channel.permissionsFor(message.guild.id).has('READ_MESSAGES')

this right or am i dead wrong

solemn latch
#

yeah it is

summer torrent
#

there is a bot which posting bot tokens to github iirc

solemn latch
#

yeah, if its in an image it has a hard time

harsh minnow
#

I am from India I don't so much English

solemn latch
#

i manually type it in

summer torrent
#

@karmic compass try it and see

solemn latch
#

yes, im that dedicated to protecting users

#

that i will never know

quasi arrow
#
activeServers = bot.guilds
summ=0
for s in activeServers:
    summ += len(s.members)
print(summ)

so..whats wrong here? the output is

0
ionic dawn
#

What a gentlemen @solemn latch

quasi arrow
#

again

karmic compass
placid iron
#

@karmic compass can I ask why you aren't getting the permission for a member instead of the role?

karmic compass
#

im getting the role everoyne

#

for the specified channel

opaque seal
#

How would you make something like? So to record my bot up time and post it in a website like that https://maki.gg/status?

karmic compass
#

if you do !channel visible it changes the read messages permissions for everyone in that channel to true

placid iron
#

Ah ok

#

Np, my bad

solemn latch
#

feels bad when people have python questions and only js devs are on

karmic compass
#

@summer torrent gave me an error (look above for ss and sorry for ping)

crystal socket
#

@solemn latch i can help you

crystal socket
#

let me try it on my bot one second

karmic compass
#

how do i grab the everyone role?

#

for channel perms

earnest phoenix
#

message.guild.roles.everyone i assume

#

na i might be wrong

#

oh nvm im right

strange trout
#

Doesn't python have reduce

crystal socket
#

@quasi arrow make it a command

#

i think that the bot isn't logged in

quasi arrow
#

isn't logged in?

earnest phoenix
#

Guys help I need more custom commands ideas

zenith terrace
#

no

left nacelle
#

a command to see how gay people are

solemn latch
#

its been done a lot

left nacelle
#

ik

#

like dank memer

earnest phoenix
#

I like it lol

left nacelle
#

but

#

ITS RIGGED

#

EVERYONE IS ALWAYS 100% GAY

drifting wedge
#

is this good for a coin flip?

#
async def flip(ctx):
    variable = [
        "Heads",
        "Tails",]
    await bot.say(ctx.message.channel, "{}".format(random.choice(variable)))

@client.command(case_insensitive=True)
async def coinflip(ctx):
    variable = [
        "Heads",
        "Tails",]
    await bot.say(ctx.message.channel, "{}".format(random.choice(variable)))

@client.command(case_insensitive=True)
async def flipcoin(ctx):
    variable = [
        "Heads",
        "Tails",]
    await client.say(ctx.message.channel, "{}".format(random.choice(variable)))```
#

it dpesmt wprl

#

work*

solemn latch
#

then, probably not

#

;p

drifting wedge
#

well whats wrong

solemn latch
#

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

#

your the python dev

gray zealot
#

can I add an image in an .addField?

strange trout
#

No

gray zealot
#

can I have multiple imgs in an embed?

strange trout
#

Full sized images no. You can add an image to the thumbnail, footer, author, and the actual image

gray zealot
#

ok... ty

strange trout
gray zealot
#

ok ty!

strange trout
#

np

ionic dawn
#

the only bad thing about embed titles is that you cant add links on them

#

like: Click here

#

you can do .setURL but isnt the same

gray zealot
#

ok

#

ty

#

:)

#

can I change the size of the img... ๐Ÿ˜„

quasi arrow
#

@quasi arrow make it a command
@crystal socket worked, thanks man ๐Ÿ‘

crystal socket
#

np

strange trout
#

I wonder if this would work too. I haven't used python much

from functools import reduce

guild_members = map(lambda a : len(a.members), bot.guilds )
total_users = reduce(lambda a, b: a + b, guild_members)

print(total_users)
quasi arrow
#

the problem was as @crystal socket said, the bot wasn't logged in

hallow dune
#

p!help

solemn latch
earnest phoenix
#

how do i create a bot please teach me

midnight blaze
#

go on discord.dev and create a bot

thin turret
#

Watch a setup tutorial or go to the discorddev

earnest phoenix
#

OK!

earnest phoenix
#

ok sir

left nacelle
#

what

#

those errors i think

torn ravine
#

@left nacelle let me see top

#

the first line of the error

left nacelle
torn ravine
#

its says args is not defined

#

so define args

#

const args = ???

left nacelle
#

theres something called args here

#

top right

torn ravine
#

args isnโ€™t defined

solemn latch
#

why is your formatting so weird

#

๐Ÿค”

torn ravine
#

thats where you defined pokemon

left nacelle
#

i had help from @ionic dawn

solemn latch
#

wth is going on here

torn ravine
#

looks like if else chains

left nacelle
#

i was keep copy pasting

#

idk what happened

#

i was copy pasting a image link

ionic dawn
#

const args = arguments excluding the prefix

left nacelle
#

how do i fix

ionic dawn
left nacelle
#

ugh

#

this is annoying lmao

#

how one little thing can break everything

earnest phoenix
#

hi

solemn latch
#

typically, command handlers make that easier

#

less likely to break multiple commands with mistakes

#

easier to find where errors originate from

faint prism
#

Wish, I could stream so I can do a live tutorial of how to make a bot in C# ๐Ÿ˜›

left nacelle
#

i suddenly got 5 problems

#

expected ","

#

alright i deleted all of that

drifting wedge
#

how would i make a command be able to be turned on/off?

left nacelle
#

now my other stuff works

ionic dawn
left nacelle
#

imma try again tho

solemn latch
#

Like disableable per guild? @drifting wedge

drifting wedge
#

yes @solemn latch

left nacelle
#

ugh

drifting wedge
#

im using sqlite

left nacelle
#

what does args do

solemn latch
#

Its the arguments of the commands

drifting wedge
#

lets u do more than 1 work

solemn latch
#

!command arg1 arg2 arg3

#

Etc

left nacelle
#

its not letting me do any commands

#

i have smallest brain

#

idk what to do with args

solemn latch
#

I suggest reading the guide

#

It covers all this

left nacelle
#

i should go to sleep lmao

#

im too tired

#

but maybe

#

also i wanna try to finish the pokemon command in the next 30 mins or 1 hour

shy karma
left nacelle
#

theres nothing in the guide

#

about args

earnest phoenix
#

Um

shy karma
#

@left nacelle

left nacelle
#

what

shy karma
#

const args = message.content.slice(prefix.length).trim().split(/ +/g);

#

try that

left nacelle
#

wtf

#

idk

shy karma
#

and there is stuff in discord.js about args

left nacelle
#

IM SO DUMB

#

IDK HOW TO DO THIS

crystal socket
#

no caps pls

#

this is basic programming

solemn latch
#

Theres an entire page for args

left nacelle
#

IDk how to do this

shy karma
#

@left nacelle i recommend learning javascript before trying discord.jw

#

discord.js

#

?spoonfed

#

?help

#

ok

left nacelle
#

this is damn annoying

faint prism
#

Helps to know the basics

left nacelle
#

i read through most things

#

but still idk

faint prism
#

Did you struggle to understand what this said?
const args = message.content.slice(prefix.length).trim().split(/ +/g);

solemn latch
#

I mean, someone gave you copy paste code

left nacelle
#

what

#

wat does that mean

solemn latch
#

It means, make an array of each word in the message

#

And store it in the variable args

viral iris
#

Any1 know how to make cooldown in code?

solemn latch
#

Js?

viral iris
#

Yes

faint prism
#

setInterval, right?

solemn latch
viral iris
#

Thx

left nacelle
solemn latch
#

You need to define args

#

Before using args

left nacelle
#

wtf does that mean

faint prism
#

args = null at the moment your calling it

#

args = "something preferably from the message context"