#development

1 messages · Page 1205 of 1

opal plank
#

not the function

#

the embed

earnest phoenix
#

oh

#

kinda long 1 sec

opal plank
earnest phoenix
#

over 2000 chars KEKW

opal plank
#

wtf dude

earnest phoenix
opal plank
#

JUST the embed?

earnest phoenix
#

Hypixel has alot of shit to handle

opal plank
#

omg....

#

why not make a function to loop that?

#

dry your code

faint prism
#

I've got a d.js question. I set my game status on ready event, but after a day it seems that the status goes away
@faint prism Anyone have an idea on this one?

earnest phoenix
#

I mean, I could make a for loop and an array to handle it

opal plank
#

i can already think 2 ways to dry the heck out that

earnest phoenix
#

but really im here to know how to make 2 fields in 1 line

#

then ill fix my code

opal plank
#

we told you, inline = true

#

addField() takes 3 params

#

key, value, inline

earnest phoenix
#

mhm

#

ok then, ill give it a shot gotta remodel it

faint prism
#

Don't have the same issue with d.NET

opal plank
#

hmmm im not sure tbh

#

you could setInterval really high as a quick patch tbh

jolly knot
#

Hi

faint prism
#

It's almost like it expires

jolly knot
#

I'm new

faint prism
#

you could setInterval really high as a quick patch tbh
@opal plank Yeah ig lol

jolly knot
#

I just joined

earnest phoenix
#

someone help me my bot doesn't connect to discord api

opal plank
#

aight time for food, then i'll come back to help more

faint prism
#

I just joined
@jolly knot great. Do you have a #development question?

jolly knot
#

I want to know how to make bots

opal plank
faint prism
jolly knot
#

Ok thanks!

faint prism
#

No problem. Cya soon!

jolly knot
#

Bye

faint prism
#

||prediction: returns with questions about basic syntax for JS||

wanton iron
#

i don't really know what to do with the output of permissionsFor i got numbers but i don't know on what it's based

faint prism
#

Does d.js use an enum for permissions?

#

I feel like it's mapped to something

restive furnace
#

js has no enums iirc

#

(ts still does)

faint prism
#

Something similar in the lib then?

wanton iron
#

hm i don't know it return smth like 2147483647

faint prism
#

Should be outlined in the docs if you search it for permissions

slender thistle
#

That's bitfields

quartz kindle
#

djs has helper methods for bitfields

#

for example you can do permissionsFor(id).has(permission) to check if someone has permissions, or permissionsFor(id).toArray() to list all permissions they have as strings

faint prism
#

djs has helper methods for bitfields
@quartz kindle Sounds like what I'm thinking of. I've seen a bunch of people manually mapping the permission's bitfield when it's already implemented by the lib

earnest phoenix
#

@opal plank quick question, does .addFields accept arrays?
I plan to make a for loop to handle the array making and use the array to just .addFields(array)

quartz kindle
#

yes addFields() is made for arrays

#

otherwise its addField()

earnest phoenix
#

ight thanks

magic jackal
#

Any jQuery masters in here that could assist with something?

#

I'm trying to select this element but I cant get it working because all the names are the same

earnest phoenix
#

pog moment, addFields is only available to v12

misty sigil
#

why not use v12

wanton iron
misty sigil
#

no

#

no bot needs admin perms truly

wanton iron
#

I need to look precisely for the roles he needs?

faint prism
#

Ideally

#

Admin is a pretty powerful role

#

And I'd imagine most guilds wouldn't give it

wanton iron
#

right

faint prism
#

You should focus on needing permissions for for only what is absolutely necessary for each command to function

wanton iron
#

mine just needs the role to delete other messages i guess

faint prism
#

Like !kick - Error, can't kick without necessary permissions

wanton iron
#

k thanks !

faint prism
#

but the !help would still work for example

#

np

earnest phoenix
#

how can i calculate between two dates?

#

wdym ?

#

40 days after 31 August

#

:0

#

hmm

#

😄

#

maybe google it

#

I will use it for premiumSince

#

cuz i never try that beffore

#

or is there an easier way

white drum
earnest phoenix
#

If the user's boost is greater than 1 month, it will show the 2nd level boost icon.

solemn latch
#

if your time values in milliseconds, you can just add 40 days in milliseconds.

earnest phoenix
#

@white drum how ur messageDelete code

#

userinfo.boosttarihi = moment.utc(message.guild.members.cache.get(kisi.id).premiumSinceTimestamp).format('dddd[,] DD MMMM YYYY - HH:mm')

earnest phoenix
#

hmmm

#

message.member.tag ?

#

nvm

white drum
#

There like
No reason for it to crash

quartz kindle
#

some messages have no author, such as system messages

earnest phoenix
#

oh

#

oh

#

yes

white drum
#

Here the other thing

#

I also put in
If(message.user.bot) return;

earnest phoenix
#

btw

white drum
#

And it would crash randomly with the same kind of error

quartz kindle
#

message.user is not a thing?

white drum
#

Message.member

misty sigil
#

message.user?

white drum
#

I think

misty sigil
#

no

earnest phoenix
#

client.on("messageDelete" , (client, message) => {})

misty sigil
#

message.author

earnest phoenix
#

there is no channel

quartz kindle
#

why client

earnest phoenix
#

uhmm

#

oh

#

i am using a module.ex

#

port

#

nvm

white drum
#

Why can't I have channel

quartz kindle
#

the event doesnt give you a channel

solemn latch
#

it doesnt return channel

quartz kindle
#

it only gives you a message

earnest phoenix
#

yes

#

try console.log(messagae.author)

white drum
#

But, it's different for every channel

earnest phoenix
#

then u can see

solemn latch
#

message has property channel

earnest phoenix
#

yes

#

correct

white drum
#

Uh

#

Hmm

slate grotto
#

sa

earnest phoenix
#

huh

slate grotto
#

Visual Studio Code burada botu nasıl 7/24 yapıcam

earnest phoenix
#

-notr

#

smh

solemn latch
#

mod only commands pandasad

earnest phoenix
#

yes

solemn latch
#

you told him to come here 🤔

misty sigil
solemn latch
#

lol

earnest phoenix
#

oh ye

#

sorry

slate grotto
#

Visual Studio Code How do I make the bot here 24/7

misty sigil
#

you need to host it

#

on a vps

earnest phoenix
#

get a vps

drifting wedge
#

using python

misty sigil
#

aH

earnest phoenix
#

omg

solemn latch
#

ah the spam

misty sigil
#

AEEHHHHH

drifting wedge
#

how can i check if youre in the vc with the bot alone?

#

would it be if there are 2 users?

earnest phoenix
#
- OVH: https://www.ovh.com/us/vps/
    Starting at $3.35/mo for 1 core, 2GB RAM, 20GB SSD
- DigitalOcean: https://www.digitalocean.com/
    Starting at $5/mo for 1 core, 1GB RAM, 25GB SSD
- Linode: https://www.linode.com/
    Starting at $5/mo for 1 core, 1GB RAM, 25GB SSD
- Vultr: https://www.vultr.com/
    Starting at $2.50/mo for 1 core, 512MB RAM, 10GB SSD
- Amazon(AWS) Lightsail: https://amazonlightsail.com/
    Starting at $3.50/mo (first month free) for 1 core, 512MB RAM, 20GB SSD
- Time4VPS: https://www.time4vps.eu/
    Starting at €3.99/month for 1 core, 2GB RAM, 20GB SSD
- VIRMACH: https://virmach.com/
    Full Windows and Linux Desktop VPS starting at $7/mo and $1/mo respectively

  - This is a list of hosting providers, not a backing/support for them. You will need to make your own decision. All $dollar prices are in USD.
quartz kindle
#

plus amazon and google have free for 12 months plans

#

and google also has a free forever plan, that only charges for bandwidth

white drum
#

Here's what I found out

#

It crashes

earnest phoenix
#

._.

white drum
#

Whenever someone deletes an embed

earnest phoenix
#

yes

#

u can't snipe embed

white drum
#

How can I make it ignore that so it doesn't crash xd

earnest phoenix
#

just let it crash

#

it doesnt stop the code

solemn latch
#

check if content exists

misty sigil
#

^

drifting wedge
#

how can i check if youre in the vc with the bot alone?
would it be if there are 2 users?

white drum
#

@earnest phoenix it crashes my bot bruh

earnest phoenix
#

well i am to lazy to do that

misty sigil
#

it does stop the code

#

lmfao

earnest phoenix
#

wut

#

oh

#

maybe i pm2

#

so it autorestart

#

OH

solemn latch
#

thats a bad idea 🤔

misty sigil
#

it takes time to restart

#

bruh

earnest phoenix
#

i didnt know

#

oh

#

oh no

#

need to fix it

white drum
#

Fail

solemn latch
#

also, spamming logins could get you banned from the api

earnest phoenix
#

i thought it is just warn

white drum
#

So how do I check for an embed?

misty sigil
#

if(!message.content) should do iirc

solemn latch
#

it doesnt matter if theres an embed, just matters if theres content

quartz kindle
#

@white drum check if message.author exists, otherwise return

white drum
#

Oh

#

Ok

quartz kindle
#

if(!message.author) return

#

you can also throw content in there

#

if(!message.author || !message.content) return

#

that is if you only want to log text

white drum
#

Here is what I'll add,

if(!message.author) return;
if(!message.content) return;
earnest phoenix
#

why 2 lines

#

u can make it one lines

misty sigil
#

you could just if(!message.author || !message.content)

earnest phoenix
#
if(!message.author || !message.content)
#

smh

#

u so fast

white drum
#

K

#

thx

#

its working properly now

#

😄

still merlin
#

Does anyone know how to upload code to github via the git app/console thing, My bot has a long file name (SpiderBot Command Handler), And I can't cd there because to many arguments, Ive tried doing-it-like-this and using the package name (SpiderBot2)

quartz kindle
#

you cant cd there?

still merlin
#

No

quartz kindle
#

put quotes on the path

#

cd "/bla/spíderbot command handler"

still merlin
#

epic

#

thanks

#

Also i have one more question about github if someone could answer, how do i censor out my token in my config? Do i change it when running git init or something

solemn latch
#

you should have an env var, or have a dedicated config file for your token, with the file listed in gitignore

still merlin
#

Okay thanks

quartz kindle
#

you can just use a .gitignore file

earnest phoenix
#

@still merlin or make ur project only for ur self

#

change it to private mode

solemn latch
#

some people want public repos.

marble juniper
#

if I have an array of json objects how would I use indexOf to get the position of an object in that json object to get the array position

earnest phoenix
#

i public my old bot in my github profile

#

cuz it is such of big mess

#

and ppl won't understand it

#

LoL

marble juniper
#

kinda like

const array = []
array.push({ username: 'Karl' })
array.push({ username: 'John' })

//How do I get the index of the username property 'Karl' in the array
#

username in my case would be unknown ofc

slender thistle
#

a find/filter function seems to be what you want

marble juniper
#

ok

#

im just trying to get the array position

#

lol

#

ig I will do a filter then

slender thistle
#

I mean, manually iterating over the array works too

#

If you only need to find one occurrence, just exit the loop catshrug

marble juniper
#

I could use a for loop

#

ig

slender thistle
#

Isn't it possible to use indexOf({username: 'Karl'})?

marble juniper
#

idk

#

thats why im asking

#

¯_(ツ)_/¯

restive furnace
#

yes it is

marble juniper
#

k then

#

but

restive furnace
#

array#indexOf({username: 'Karl'})

marble juniper
#

what if it is array.push({ username: 'John', goal: 'Some other object stuff' })

#

will it still work

#

lol

solemn latch
#

You would have to put in the whole object afaik.

#

which in this case, if you have an array of user objects and you want to find the index of one by its username, id use findIndex.

#

or, if you want the object itself, just find.

marble juniper
#

I just need the position

solemn latch
#

then findIndex, if you dont have the whole object and are just searching by a property.

earnest phoenix
#

some people want public repos.
@solemn latch me included

marble juniper
#

I just did

const checkQueuePosition = element => element.username === username;

queue.findIndex(checkQueuePosition)
earnest phoenix
#

i make all my stuff open source

#

literally everything

marble juniper
#

cool

#

I make my minecraft bot open source soon

#

its in js

earnest phoenix
#

woah

#

kool

marble juniper
#

uses mineflayer

#

has spam detection etc.

#

im just adding a command queue rn

#

so you can't cancel the command someone is doing rn

#

unless thier goal has been finished

#

wanted to ask how to get the position cuz I will add it so you can see ur position too

#

in the "command queue"

earnest phoenix
#

floods chat

#

how can i calculate a concept like if the user has been over .premiumSinceTimestamp for 1 month.

#

Save the timestamp

#

And check if it was older than one month ago

solemn latch
#

date.now() - member.premiumSinceTimestamp > 1month

earnest phoenix
#

spoonfeeding

solemn latch
#

psh, thats not copy paste 🤔

placid dock
#

Do you have a suggestion for a bot name?

earnest phoenix
#

Uhhhh

sudden geyser
#

what is the bot about

earnest phoenix
#

Carrot

solemn latch
#

the only thing thats copy paste is date.now() everything else is placeholders 🤔

placid dock
#

Moderation

solemn latch
#

Mod

sudden geyser
#

mod bot

earnest phoenix
#

name it MOODBOOT

sudden geyser
#

or just give it some person's name and call it a day

earnest phoenix
#

lol

sudden geyser
#

like Rose

solemn latch
#

name it "Lite"

#

ez

sudden geyser
#

Moon™️

#

You can re-arrange the letters in Woo and become a weeb at the same time

placid dock
#

thanks for suggestions

slender thistle
#

Roosemon

midnight blaze
#

how important is it to learn mathematics to get successful in programming? I am thinking of reading something about lambda

sudden geyser
#

know the basics at least

slender thistle
#

Depends on what you are going to use programming for

midnight blaze
#

I want to study programming nxt year

#

should I start learning mathematics?

slender thistle
#

Stuff like simple Discord bots won't require advanced maths like calculus

earnest phoenix
#

how important is it to learn mathematics to get successful in programming? I am thinking of reading something about lambda
@midnight blaze 8th grade math is a necessity for pogeyramming

solemn latch
#

knowing concepts of math i think is pretty important.
knowing how to do complex math, mostly isnt.

#

but, as always, it depends

midnight blaze
#

I heard that the theory of lambda function

#

is a huge part of it mathematics

hasty mulch
#

Code: Python
Issue: CommandNotFound: Command “join” is not found
Code:


class Music(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.command()
    async def join(self, ctx, *, channel: discord.VoiceChannel):
        """Joins a voice channel"""

        if ctx.voice_client is not None:
            return await ctx.voice_client.move_to(channel)

        await channel.connect()
bot.add_cog(Music(bot))

Please tag me in your response

slender thistle
#

Is the cog loaded

midnight blaze
#

@hasty mulch 🥄

slender thistle
#

Oh

midnight blaze
#

anyone here who learnd the theory of lambda?

slender thistle
#

Are you creating that class in the main file?

hasty mulch
#

Yes

#

As I always do, because I’m hosting the bot on my own thing, as you know

sudden geyser
#

A lambda is just an anonymous function.

midnight blaze
#

@sudden geyser yes, but there is a large amount of theory behind it

quartz kindle
#

for me the most useful math skill ever is the percentage formula. you can do almost everything with that

earnest phoenix
#

@hasty mulch that's the best way to ask for help no need to ask for permission or anything just send the code explain your error and wait for someone to reply

thanks for being a good boi

midnight blaze
#

@quartz kindle xD what about probability?

quartz kindle
#

otherwise basic trigonometry is also good to know, quite essential when dealing with canvas

earnest phoenix
#

for me the most useful math skill ever is the percentage formula. you can do almost everything with that
@quartz kindle the most useful math formula is not doing algebra or log functions or that shit but learning only that stuff about math which you ACTUALLY USE in daily life

slender thistle
#

Honestly, try to slap a few prints right after the add_cogs to see if they load properly

#

But it rather seems that you are loading the cog and silencing errors

hasty mulch
#

Should I move the add_cog up?

midnight blaze
#

who studied programming in a university?

#

I am sure you guys have to know a lot of stuff

quartz kindle
#

i've never used log functions, but i use the percentage formula in almost everything

midnight blaze
#

percentage formula? what do you mean by that? That doesnt seem very hard

earnest phoenix
#

date.now() - member.premiumSinceTimestamp > 1month
@solemn latch How do I define 1month

midnight blaze
#

I was watching an interview between a dev and a big company and they asked them a lot of mathematics questions about an actually very simple algorithm

quartz kindle
#

its not hard, its one of the most basic things in math, but its one of the most useful ones ever, you can use it for a shit ton of things

solemn latch
#

1 month would be the number of seconds in a month(30 days if you wanna be lazy)

quartz kindle
#

45 = 80

? = 100

slender thistle
#

Should I move the add_cog up?
@hasty mulch not necessarily

hasty mulch
#

@slender thistle Music not defined. I have a feeling I should pip import music

slender thistle
#

Order matters

#

Make sure you are creating the class before trying to load it

dusk vault
#

finally got mysql to work

hasty mulch
#

Oh, it goes bottom to top?

#

For loading

slender thistle
#

top to bottom

hasty mulch
#

I have the cog loaded before the bot came online

midnight blaze
#

@quartz kindle is 56,25 100%?

hasty mulch
#

Unless that is the on_ready thing

slender thistle
#

Can you slap a print(bot.cogs) in the on_rsady event

midnight blaze
#

if the number 45 is 80%

slender thistle
#

or in a command

hasty mulch
#

Yeah, one sec

quartz kindle
#

@midnight blaze yes

midnight blaze
#

lol, so what is hard about that?

#

that can not be all xD

quartz kindle
#

i never said it was hard

midnight blaze
#

ok

quartz kindle
#

i said it was the single most useful formula in maths

midnight blaze
#

I thought it must be more hard for some reason

quartz kindle
#

with a lot of uses

midnight blaze
#

well, I guess, I understand that

hasty mulch
#

Loading now, shiv

midnight blaze
#

I was always good with %

quartz kindle
#

you can use it for more complex stuff

hasty mulch
#

Music is loaded, gonna try the command

quartz kindle
#

for example, i use it all the time when working with canvas

#

to resize things

#

to recalculate scaling

#

etc

fervent goblet
#

How do i center a div in HTML?

quartz kindle
#

also for responsive web design

hasty mulch
#

@slender thistle Command “join” not found

earnest phoenix
#

How do i center a div in HTML?
@fervent goblet CSS style margin

slender thistle
#

...???

earnest phoenix
#

wait not that

slender thistle
#

Try commenting out the command function body and do something as simple as sending a message

hasty mulch
#

Wait

midnight blaze
#

is 100

#

177,77%?

earnest phoenix
#
style="text-align: auto/left/center/right;"
midnight blaze
#

Just trying to get it x

hasty mulch
#

It says “Ignoring exception in command None”

midnight blaze
#

xd

#

probably wrong

fervent goblet
#

its not text tho

hasty mulch
#

Is that where the error is, @slender thistle ?

midnight blaze
#

@quartz kindle

quartz kindle
#

if you put 100 instead of 45?

midnight blaze
#

well, if 45 is 80%

#

what % is 100

#

It looks to me it is around 177%

#

since 56 is 100%

#

but no clue

#

maybe I am talking bs

quartz kindle
#

56.25 is 100 yes

earnest phoenix
#

the hell

midnight blaze
#

and now, you want to know what % is 100

earnest phoenix
#

that math is making me go

#

INTERESTING

midnight blaze
#

id say 45/80. I get the number of for 1%

slender thistle
#

@hasty mulch what the genuine f?

#

What's the full traceback?

quartz kindle
#

like if 45 is 80% then 100 is how much %?

midnight blaze
#

I would do it like that. 45/80, I get the number for 1%

#

and after that it should be easy to get 100

hasty mulch
#

Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command “join” is not found
@slender thistle

quartz kindle
#

you cross multiply then divide

#

a = z

b = x

b * z / a = x

#

x * a / z = b

#

z *b / a = x

dusk vault
#

you're braining my hurt

lyric mountain
#

that sounded harder than it is lul

hasty mulch
#

And waiting for Shiv to reply...

slender thistle
#

Can you send your full code

midnight blaze
#

I still think it is 177%

#

am I wrong?

#

I was trying to understand your equations, but hmm

quartz kindle
#

yes its 177.7777

hasty mulch
#

Yeah, gotta load Discord on my Linux for that and hopefully not crash it

midnight blaze
#

nice

#

thanks man

#

I guess I am not completly stupid

lyric mountain
#

basically

hasty mulch
#

Reeee

#
import discord

from discord.ext import commands
from discord.ext.commands import Bot
import asyncio
import youtube_dl

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

@bot.event
async def on_ready():
    print('Successfully logged in as {0.user}, Running Verison 0.0.0.3'.format(bot))
    print('Cogs loaded:')
    print(bot.cogs)

async def on_message(message):
    if message.author == bot.user:
        return

@bot.command()
async def test(ctx):
    if ctx.author.id == 222766150767869952:
        print('Test')
        await ctx.send("Success!")
    pass

class Music(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        
        @commands.command()
        async def join(self, ctx, *, channel: discord.VoiceChannel):
            print('Connecting...')
            """Joins a voice channel"""
            
            if ctx.voice_client is not None:
                await ctx.send("Joining...")
                return await ctx.voice_client.move_to(channel)
            
            await channel.connect()
            print('Connected!')

@bot.command(name='ping')
async def _ping(ctx):
    print('Ping!')
    await ctx.send(f'Pong! Took **{(bot.latency * 1000)}**ms')
    pass

bot.add_cog(Music(bot))
print('Loaded music cog')
bot.run('[REDACTED]')
``` @slender thistle
midnight blaze
#

@quartz kindle xD sry for asking, are you working as a dev?

slender thistle
#

Uhm

#

uhhh

#

Do you uhh

#

see the unnecessary indents there

#

for your join command

#

You nested it into the init function

hasty mulch
#

Alright, I’ll bounce it to the front

dusk vault
earnest phoenix
#

You need to add the ability for the bot to process commands

#

Since you have an on_message event

hasty mulch
#

Ok

dusk vault
#

version 0.0.0.3?

#

seems very unsemver

drifting wedge
#

on the on_role_edit event

#

it sends like all roles have been edited

#

anyone know how to fix that?

#

using python

hasty mulch
#

@hasty mulch
@earnest phoenix So, write exactly await bot.process_command(message) or replace message with the commands?

#

And where would it go?

earnest phoenix
#

The first thing you said

hasty mulch
#

Ok

earnest phoenix
#

Literally on the on_message event you already have in ur code

hasty mulch
#

Ok

zenith knoll
#

Hey can i get some help onm my command coldown?

#

my code is

torn zinc
#

punten

zenith knoll
#
if (!cooldowns.has(command.name)) {
        cooldowns.set(command.name, new Discord.Collection());
    }
    
    const now = Date.now();
    const timestamps = cooldowns.get(command.name);
    const cooldownAmount = (command.cooldown || 3) * 1000;
    
    if (timestamps.has(message.author.id)) {
        if (timestamps.has(message.author.id)) {
            const expirationTime = timestamps.get(message.author.id) + cooldownAmount;
        
            if (now < expirationTime) {
                const timeLeft = (expirationTime - now);
                return message.reply(`please wait ${timeLeft.toFixed(1)} more second(s) before reusing the \`${command.name}\` command.`);
            }
        }
    }

    timestamps.set(message.author.id, now);
    setTimeout(() => timestamps.delete(message.author.id), cooldownAmount);
hasty mulch
#

@earnest phoenix

async def on_message(message):
    if message.author == bot.user:
        return
await bo.process_command(message)
``` Confirm?
torn zinc
#

I cant speak english:)))))

earnest phoenix
#
@bot.command()
async def test(ctx):
    if ctx.author.id == 222766150767869952:
        print('Test')
        await ctx.send("Success!")
    pass

Also, this pass statement is useless, remove it

hasty mulch
#

Ok

midnight blaze
#

@torn zinc go and learn it then

earnest phoenix
#

Indent the last line by one tab & yes @hasty mulch

hasty mulch
#

OH! And add a "T" at the end!!!!

drifting wedge
#

on the on_role_edit event
it sends like all roles have been edited
anyone know how to fix that?
using python

torn zinc
#

@midnight blaze Speak Indonesiaa:) i from indonesian.

earnest phoenix
#

Yee

hasty mulch
#

@earnest phoenix REEEEEEEEEEEEEEEEEE

discord.ext.commands.errors.CommandNotFound: Command "join" is not found```
quartz kindle
#

@midnight blaze im a freelancer basically

#

and i also have my own business

#

kinda

midnight blaze
earnest phoenix
#

I'm confused by ur code btw @hasty mulch

midnight blaze
#

I hope your business works well

gritty bolt
#

How do I run another js file in nodejs?

earnest phoenix
#

Why do you have a cog setup yet some of the code isn't in the cog? Is this the main file or what?

hasty mulch
#

This is

gritty bolt
#

I have an index.js file but I want to run another core file

torn zinc
#

teach english pliss:v🤣

hasty mulch
#

Cause I don’t know how to load other scripts

quartz kindle
#

@gritty bolt you want to "run" it, or you want to include/require it?

gritty bolt
#

Run it

torn zinc
#

DAHLAH GA PAHAM AKU SAMA BAHASA KLEN

quartz kindle
#

running means executing it as a separate process

midnight blaze
#

@quartz kindle I guess your business is probably about web and stuff, since you are an expert in js

gritty bolt
#

thats what I want to do

quartz kindle
#

then you can use node's child_process

#

spawn, fork or exec

hasty mulch
#

@sinful belfry Little help here with this guy? The one with all gibberish

quartz kindle
#

@midnight blaze not really lul, its about Astrology

gritty bolt
#

oh ok

#

thanks

earnest phoenix
mint token
#

hello i need code user

sinful belfry
mint token
hasty mulch
#

@earnest phoenix Ty, I’ll look into it and get back

dusk vault
#

you could also eval(require('fs').readFileSync('yourfile.js', 'utf-8')) but like why

simple stump
#

How do I disconnect my bot from the VC? Or stop my bot from playing anything? I get an error when I use this code:

        if (message.content.startsWith(`${prefix}stop`)) {
            var server = servers[message.guild.id];
            console.log(server);
            if (message.guild.voice.channel) {
                for (var i = server.queue.length - 1; i >= 0; i--) {
                    server.queue.splice(i, 1);
                }

                server.dispatcher.end();

                message.channel.send("Ending the queue. Leaving the voice channel...");

                console.log('Stopped the queue!');
            }

            if (message.guild.connection) message.guild.voice.channel.disconnect();
        }

Error:
https://hatebin.com/osjosjqseu

Printing out server:

{ queue: [ 'https://www.youtube.com/watch?v=9Va88Kt0NN0' ] }

Server is this:

var server = servers[message.guild.id];

Code: https://hatebin.com/purgqhgwsn

earnest phoenix
#

Error:

poll_message = await channel.get_message(id)
AttributeError: 'TextChannel' object has no attribute 'get_message'

Code:

    poll_message = await channel.get_message(id)
#

Help!

thick gull
#

any decent java compilers that i can use for free thinking_derp

slender thistle
#

fetch

#

not get

earnest phoenix
#

Oh ok!

dusk vault
#

any decent java compilers that i can use for free :thinking_derp:
@thick gull Yes, Javac

earnest phoenix
#

@simple stump to leave vc just do bot.member.voice.channel.leave();

slender thistle
#

...??

#

bot.member?

#

Excuse me?

dusk vault
#

i think it's client.voice.channel.leave()

misty sigil
#

dont you mean

#

message.guild.me.voice.channel.leave()

dusk vault
#

or that

earnest phoenix
#
        if (!msg.member.hasPermission("SEND_MESSAGES")) return message.channel.send("test");
        //let channel = message.mentions.channels.first() || bot.guilds.cache.get(message.guild.id).channels.cache.get(args[0]) || message.guild.channels.cache.find(r => r.name.toLowerCase() === args.join(' ').toLocaleLowerCase()) || message.channel;
        try {
        const messages = await channel.messages.fetch({ after: 1, limit: 1 });
        const message = messages.first();
        const embed = new MessageEmbed()
            .setColor(autimatic)
            .setThumbnail(message.author.displayAvatarURL({ format: 'png', dynamic: true }))
            .setAuthor(message.author.tag, message.author.displayAvatarURL({ format: 'png', dynamic: true }))
            .setDescription(message.content)
            .setTimestamp(message.createdAt)
            .setFooter(`ID: ${message.id}`)
            .addField('❯ Jump', message.url);
            msg.embed(embed);}
            catch (e){
                return msg.channel.send(e)
            }

TypeError: Cannot read property 'fetch' of undefined

slender thistle
#

client.voice shouldn't exist either

#

Because there can be multiple voice connections

earnest phoenix
#

fetch is giving an error what should I do

dusk vault
#

what is channel

earnest phoenix
dusk vault
#

dont you mean message.channel.messages.fetch

earnest phoenix
#

async (bot, msg, channel, args) => {

dusk vault
#

why is that an argument

#

you can just use async (args, msg) => { and use msg.channel and msg.client

#

lol

#

or const {channel, client} = msg

earnest phoenix
#

I first defined it that way. then I defined it as let = channel

dusk vault
#

let = channel?

#

tf

earnest phoenix
#

let channel =

dusk vault
#

that's a syntax error, unexpected token =

#

oh

earnest phoenix
#

let channel = sorry

#

.

dusk vault
#

lmao

#

hot tip: always use const whenever possible, if you dont plan on reassigning to the variable

steady wharf
#

hey

dusk vault
#

hello

steady wharf
#

my bot invite tracker bot working but

#

some times dont write text

#

like that

#

who can help me

modest smelt
#

um

#

(crap my bot hasn't been accepted yet)

steady wharf
#

i wanna fix it

earnest phoenix
#

Who has the reboot code?

misty sigil
#

well

#

your bot has to be on pm2 for this to work

#

process.exit(0)

steady wharf
#

what can i do

#

@misty sigil

misty sigil
#

?!

azure quail
#
      let robot = message.guild.members.cache.filter(m => m.user.bot)
#

i need help

steady wharf
#

?!
@misty sigil ??

earnest phoenix
#

@misty sigil How do I put it in PM2

misty sigil
#

you literally have not provided me any context

#

@earnest phoenix its a process manager

azure quail
#

@earnest phoenix ?

steady wharf
#

who can help me

azure quail
#

if i can

steady wharf
#

my bot invite tracker bot working but
[22:40]
some times dont write text

#

down text = mee6 up text = my bot

earnest phoenix
#

HELP!!!

@bot.command(pass_context=True)
async def endpoll(ctx, id):
    channelname= ctx.message.channel
    poll_message = await channelname.fetch_message(id)
    if not poll_message.embeds:
      return
    embed = poll_message.embeds[0]
    if poll_message.author != ctx.message.author:
      return
    if not embed['footer']['text'].startswith('Poll ID:'):
      return
    unformatted_options = [x.strip() for x in embed['description'].split('\n')]
    opt_dict = {x[:2]: x[3:] for x in unformatted_options}if unformatted_options[0][0] == '1' 
    else {x[:1]: x[2:] for x in unformatted_options}
        # check if we're using numbers for the poll, or x/checkmark, parse accordingly
    voters = [ctx.message.server.me.id]  # add the bot's ID to the list of voters to exclude it's votes

    tally = {x: 0 for x in opt_dict.keys()}
    for reaction in poll_message.reactions:
      if reaction.emoji in opt_dict.keys():
        reactors = await ctx.get_reaction_users(reaction)
        for reactor in reactors:
          if reactor.id not in voters:
            tally[reaction.emoji] += 1
            voters.append(reactor.id)

    await ctx.send('Results of the poll for "{}":\n'.format(embed['title']) + \
                 '\n'.join(['{}: {}'.format(opt_dict[key], tally[key]) for key in tally.keys()]))

This is my code. When i do the cmnd, it shows no error message, but it also doesn't say anything on the server

#

@misty sigil Do you have a code to change the prefix bot?

misty sigil
#

aye but no spoonfeed

hasty mulch
#

Ok, how do I keep messing up?

import discord

from discord.ext import commands
from discord.ext.commands import Bot
import asyncio
import sys, traceback

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

initial_extensions = ['cogs.central-music'
                      ]

@bot.event
async def on_ready():
    print('Successfully logged in as {0.user}, Running Verison 0.0.0.3'.format(bot))
    print('Cogs loaded:')
    print(bot.cogs)

if __name__ == '__main__':
    for extension in initial_extensions:
        bot.load_extension(extension)

async def on_message(message):
    if message.author == bot.user:
        return

@bot.command()
async def test(ctx):
    if ctx.author.id == 222766150767869952:
        print('Test')
        await ctx.send("Success!")
    pass

class Music(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

@bot.command(name='ping')
async def _ping(ctx):
    print('Ping!')
    await ctx.send(f'Pong! Took **{(bot.latency * 1000)}**ms')
    pass

bot.run('[REDACTED]')
``` @earnest phoenix What am I doing wrong? `ModuleNotFoundError: No module named 'cogs'`
steady wharf
earnest phoenix
#

HELP!!!

@bot.command(pass_context=True)
async def endpoll(ctx, id):
    channelname= ctx.message.channel
    poll_message = await channelname.fetch_message(id)
    if not poll_message.embeds:
      return
    embed = poll_message.embeds[0]
    if poll_message.author != ctx.message.author:
      return
    if not embed['footer']['text'].startswith('Poll ID:'):
      return
    unformatted_options = [x.strip() for x in embed['description'].split('\n')]
    opt_dict = {x[:2]: x[3:] for x in unformatted_options}if unformatted_options[0][0] == '1' 
    else {x[:1]: x[2:] for x in unformatted_options}
        # check if we're using numbers for the poll, or x/checkmark, parse accordingly
    voters = [ctx.message.server.me.id]  # add the bot's ID to the list of voters to exclude it's votes

    tally = {x: 0 for x in opt_dict.keys()}
    for reaction in poll_message.reactions:
      if reaction.emoji in opt_dict.keys():
        reactors = await ctx.get_reaction_users(reaction)
        for reactor in reactors:
          if reactor.id not in voters:
            tally[reaction.emoji] += 1
            voters.append(reactor.id)

    await ctx.send('Results of the poll for "{}":\n'.format(embed['title']) + \
                 '\n'.join(['{}: {}'.format(opt_dict[key], tally[key]) for key in tally.keys()]))

This is my code. When i do the cmnd, it shows no error message, but it also doesn't say anything on the server

hasty mulch
#

Use prints @earnest phoenix

earnest phoenix
#

wdym?

solemn latch
#

🤔 are you just pasting your code every time someone else asks for help

earnest phoenix
#

nope

solemn latch
#

two times people asked for help and just as they did you posted a wall of text

earnest phoenix
#

i was doing it anyways

#

cuz i made error in last one

misty sigil
#

If you have questions, ask the questions and wait for someone who can answer to help you.

hasty mulch
#

@sinful belfry Your opinion on this?

misty sigil
#

you know editing does work

earnest phoenix
#

If I do prints, then it will print in the code place

#

Not on the channel

#

But it doesnt even print anything

#

and there is no error code

#

idk why

hasty mulch
#

Then your issue is at the start

earnest phoenix
#

My other code is working

#

For creating the poll

sinful belfry
#

@earnest phoenix you should wait for someone to help

earnest phoenix
#

Ok

sinful belfry
#

if your question gets lost after some time, just link your earlier message

steady wharf
#

who can help me 😦

earnest phoenix
#

ok

sinful belfry
#

but not every minute or so

earnest phoenix
#

sry

sinful belfry
#

-ask2ask @steady wharf

gilded plankBOT
#

@steady wharf

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.

earnest phoenix
#

-help

sinful belfry
#

can u send ur code as text rather than an image?

steady wharf
#

i sent my image and problem

sinful belfry
#

it is easier to help when you send as text

#

such as with hastebin or something

#

images are difficult to see when there is that much code in them

steady wharf
#

mine problem maybe not interested with codes

#

idk

earnest phoenix
#

Is the problem ctx.message.server.me.id?

steady wharf
#

nope

earnest phoenix
#

no for me

#

Still no error message, but still nothing printed sigh

#

Help anyone?

crystal socket
steady wharf
#

down text mee6

#

up text my bot

#

please help me

misty sigil
#

c o d e

steady wharf
#

you wanna code?

crystal socket
#

That looks like a bot from GitHub lol

dusk vault
misty sigil
#

i need to see the code

steady wharf
#

okey

misty sigil
#

and the relative errors

steady wharf
#

okey wait

misty sigil
#
  client.guilds.forEach(g => {
    g.fetchInvites().then(guildInvites => {
      invites[g.id] = guildInvites;
    });
  });
});
#

yea no

#

fuck this

steady wharf
#

what

misty sigil
#

you do not know how fucking bad that is

steady wharf
#

can you fix it?

dusk vault
#

you do not know how fucking bad that is
@misty sigil how is that bad

misty sigil
#

its making a bot take all invites

#

of all servers

dusk vault
#

You do that for an invite manager

#

Which is probably why he wrote it

misty sigil
#

wait you do

dusk vault
#

Yes

misty sigil
#

fUCk im an eejit

dusk vault
#

Because bots cant track invites directly

misty sigil
#

ok right im off to not be a fucking eejit

dusk vault
#

you have to save the invite list all the time

steady wharf
#

@misty sigil

#

can you fix codes?

dusk vault
misty sigil
#

it seems that discord just isn't firing the event from what i can see

earnest phoenix
#

Hi

dusk vault
#

hi

earnest phoenix
#

I have a specific problem

solemn latch
#

i feel like fetching invites that way is still a bad idea, and using promise.All is a better choice

earnest phoenix
#

Dont know who to concact really

#

With owo server

steady wharf
#

who can fix it?

inner merlin
#

Quick question, I dislike the way titanbot and Widgetbot handles the things I want done. Is there a easy way to get the messages of a discord text channel to translate into displaying on a website? No chat interaction whatsoever only displaying messages'

steady wharf
#

@misty sigil you will fix it?

misty sigil
#

idk im not a magik man

steady wharf
#

i know but if you will fix it i will wait if you dont try to fix it i will search it

earnest phoenix
#

Hi

faint prism
#

Quick question, I dislike the way titanbot and Widgetbot handles the things I want done. Is there a easy way to get the messages of a discord text channel to translate into displaying on a website? No chat interaction whatsoever only displaying messages'
@inner merlin Yeah, you could have a bot that when the message event is fired, make an api call to the website to add it to the page, or update a database, and the website will refresh

inner merlin
#

Danke peepoawesome @faint prism

dusk vault
#

Can I get some feedback on this table?

CREATE TABLE `suggestions` (
`id` INT NOT NULL AUTO_INCREMENT,
`user_id` BIGINT NOT NULL,
`text` VARCHAR(256) NOT NULL,
`timestamp` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
)```
faint prism
#

A few ways to approach it 🙂

sudden geyser
#

Epixio for reference, what language are you writing in (I know it's SQL, but what lang to write your bot in).

dusk vault
#

@sudden geyser discord.js

#

I'm using mysql2

sudden geyser
#

I don't know if saving user_id as a BIGINT is the right way to go.

dusk vault
#

it's a 64 bit integer

#

which is the highest snowflake size

#

should i save as a VARCHAR(18)?

misty sigil
#

i'd store it as a string ngl

sudden geyser
#

The ID is large for JavaScript so it usually truncates the number from the last time I tried it.

dusk vault
#

mysql2 converts it to a string

#

and back

#

since its a BIGINT

faint prism
misty sigil
#

why

dusk vault
#

why would i need to sort guilds

#

wait

#

oh yeah it should be numeric

#

because its the PRIMARY KEY

sudden geyser
#

So when you query the table and get it back user_id will be a string

dusk vault
#

yes

#

and if i query with a string

#

it works somehow

#

i guess it converts

nimble kiln
#

I store IDs as bigint
But I also had to add this to my mysql connection options:

    bigNumberStrings: true,``` ¯\_(ツ)_/¯
dusk vault
#

with nodejs?

faint prism
#

lol

nimble kiln
#

yes nodejs

dusk vault
#

aight ill add them

#

ty

nimble kiln
#

It kept rounding the IDs

dusk vault
#

😳

nimble kiln
#

after adding those options it didnt do that anymore

dusk vault
#
module.exports = mysql.createPool({
    host: $config.db.host,
    user: $config.db.user,
    password: $config.db.pass,
    database: $config.db.name,
    decimalNumbers: true,
    connectionLimit: 10,
    charset: "utf8mb4_unicode_ci",
    supportBigNumbers: true,
    bigNumberStrings: true
});```
#

this is what i use

nimble kiln
#

i mean, bigNumberStrings is probably useless for me since i use bigint

#
    user: process.env.DB_DISCORD_USER,
    password: process.env.DB_DISCORD_PASS,
    database: process.env.DB_DISCORD_NAME,
    dateStrings: true,
    supportBigNumbers: true,
    bigNumberStrings: true,
    charset : 'utf8mb4_general_ci'```
Similar here
dusk vault
#

cool

#

dateStrings?

nimble kiln
#

I dont remember what I needed those for

dusk vault
#

if i use a timestamp will i be able to use it like Date.now()

nimble kiln
#

Well I save Date and Time seperately

#

that's probably why

dusk vault
#

or should i store an int for timestamp

#

instead of a TIMESTAMP field

faint prism
#

dates should have a hash

#

or an int representation

dusk vault
#

ye i use unix time

#

charset : 'utf8mb4_general_ci'
@nimble kiln you should use utf8mb4_unicode_ci

nimble kiln
#

Any reason why?

dusk vault
#

general_ci is only 3 byte characters, so some unicode characters get chopped off including some emojis i believe

#

unicode_ci is 4 byte

nimble kiln
#

oh, mhmm

dusk vault
#

the performance impact is minimal now, general_ci is from when cpus sucked lol

nimble kiln
#

by whole database is general_ci tho 👀

simple stump
#

I'm trying to make a queue system for my new music bot, however, the queue is always one song. I try to add something to the array, but a new song just plays (the connection.play(); is what controls playing a new song). I just want to add a new song to array, rather than deleting it.
Code:

            var server = servers[message.guild.id];

            const channel = message.member.voice.channel;
            if (!message.member.voice.channel || channel.join == null) {
                message.channel.send("Channel doesn\'t exist or you're not in a voice channel!");
            } else {
                console.log(server.queue);
                server.queue.push(args[0]);
                if (/*server.queue[0] != "" && */server.queue.length = 1) {
                    channel.join().then(function(connection) {
                        connection.play(ytdl(args[0]));
                    })
                } else {
                    console.log("ok zoomer thing is not empty");
                    server.queue.push(args[0]);
                }
                /*
                channel.join().then(function(connection) {
                    connection.play(ytdl(args[0]));
                })
                */
            }

Full code: https://hatebin.com/mrqsuzpfnc

faint prism
#

32bits 👀

dusk vault
#

rip

nimble kiln
#

Well I dont mind some unicode characters being cut off

dusk vault
#

console.log("ok zoomer thing is not empty");
@simple stump I respect this

faint prism
#

Well I dont mind some unicode characters being cut off
@nimble kiln Intentionally truncating data 😖

dusk vault
#

holdup

#

did you make 2b2t's priority queue

#

😳

grizzled raven
#
SqliteError: table starboard has 17 columns but 15 values were supplied

i thought you didnt need to specify all columns to insert a row? cant some be null?

nimble kiln
#

I made prio.2b2t.dev yes

dusk vault
#

is that the official one

nimble kiln
#

Not the queue itself

dusk vault
#

oh

#

lmao

nimble kiln
#

no idea who made the queue plugin

#

I'm just grabbing data with my bot 🙂

cinder sandal
#

console.log("ur ip is:");

dusk vault
#

love it when things work

#

fuck

#

i set it as timestamp

earnest phoenix
#

timestamp**

faint prism
#
client.on('message', async msg => {
  let commandQuery = msg.content.split(prefix);
  switch (commandQuery[1].split(' ')[0]) {
    case 'help': helpCommand(msg); break;
    case 'short': replyShortAnswer(msg); break;
    case 'full': break;
    default: break;
  }});

Am I doing it right? 🙂

-prefix:command- -args-
wa:short something

dusk vault
#

that hurts my brain

#

why are you doing it that way

earnest phoenix
#

wtf is that sir

#

make a proper command handler

#

:(

faint prism
#

😛

earnest phoenix
#

exactly holy

faint prism
#

Ik ik

#

It's not pretty

dusk vault
#

ill write you one

#

one sec

earnest phoenix
#

i dont understand sh**

faint prism
#

I was thinking about refactoring that

dusk vault
#

no shit

earnest phoenix
#

watch codelyons tutorials

#

@faint prism

#

no shit
@dusk vault sherlock

#

you can abstract d.net's command logic, it's going to be a lot easier since reflection in js is just... well dictionary lookups lol

faint prism
#

In another bot i made I did:

if (message.content.startsWith(process.env.PREFIX)) {
    let reqCommand = message.content.split(process.env.PREFIX)[1];
    switch(reqCommand) {
      case 'karma': karmaCommand(message); break;
      case 'help': helpCommand(message); break;
      default: break;
    }
dusk vault
#

no

earnest phoenix
#

i dont understand anything

#

sorry

#

lol

#

helpcommandmessage?

#

tf is that

nimble kiln
#

a function?

#

I understand everything there

#

you asked what that is

dusk vault
#
client.on('message', async msg => {
  let text = msg.content;
  const prefix = '!';
  let matches = false;
  const ping1 = `<@${client.user.id}>`;
  const ping2 = `<@!${client.user.id}>`;
  if (text.startsWith(prefix)) {
    text = text.slice(prefix.length);
    matches = text.trimLeft() == text;
  } else if (text.startsWith(ping1)) {
    text = text.slice(ping1.length).trim();
    matches = true;
  } else if (text.startsWith(ping2)) {
    text = text.slice(ping2.length).trim();
    matches = true;
  }
  if (matches) {
    const args = text.split(/ +/);
    if (!args.length) return;
    const name = args.shift();
    // Do stuff with name and args here.
  }
});```
#

@faint prism

#

you're welcome

#

no need to ask twice

earnest phoenix
#
const { GistBox } = require("gist-box");
const Box = new GistBox({
  id: process.env.GIST_ID,
  token: process.env.GH_TOKEN,
});
const Discord = require("discord.js");
(async () => {
  const client = new Discord.Client();
  client.login(proce_ss.env.BOTTOKEN);
  const GUILD = process.env.SERVER_ID;
  client.on("debug", console.log);
  client.on("ready", async () => {
    if (!client.guilds.cache.has(GUILD))
      throw new TypeError(
        `I am not in the guild ${GUILD} | (${client.user.tag})!`
      );
    const SERVER = client.guilds.cache.get(GUILD);
    await Box.update({
      content: `👉 ${SERVER.name}'s stats! 📊 Logged in as ${client.user.tag}\n🐍 Owner: ${
        SERVER.owner.user.tag
      }\n🤷‍♂️ Users: 💁‍♂️ Members: ${
        SERVER.members.cache.filter((x) => !x.user.bot).size
      } 🤖 Bots: ${
        SERVER.members.cache.filter((x) => x.user.bot).size
      } 🔢 Total: ${SERVER.members.cache.size} \n#️⃣ Channels: 📚 Text: ${
        SERVER.channels.cache.filter((x) => x.type == "text").size
      } 🎤 Voice: ${
        SERVER.channels.cache.filter((x) => x.type == "voice").size
      } 📦 Categories: ${
        SERVER.channels.cache.filter((x) => x.type == "category").size
      }\n📣 News channels: ${
        SERVER.channels.cache.filter((x) => x.type == "news").size
      } 💵 Store channels: ${
        SERVER.channels.cache.filter(x => x.type == "store").size
      } 📨 Roles: ${SERVER.roles.cache.size}`.trim(),
      filename: `📊 Discord server stats.txt`,
    });
    await process.exit(0);
  });
})();

client.login("");```
#

server info command for peeps who need it

faint prism
#

you're welcome
@dusk vault the only added value I see is is that it will allow mentions instead of the prefix. Correct?

thick gull
#

why though

#

why server info command

#

for free

#

thats like spoonfeed

solemn latch
dusky mason
#

Wait

#

Ok

#

lol

misty sigil
solemn latch
#

if it loads without the css, go to the top.gg homepage, then reload the api page.

#

not sure if they fixed the issue when attack mode is on

dusky mason
#

Alr pretty easy

#

Basically check if voted = 1

#

Else u do the vote for bot blah blah

dusk vault
#

@dusk vault the only added value I see is is that it will allow mentions instead of the prefix. Correct?
@faint prism and its not the shittiest command handler ive ever seen

hasty mulch
#

How do I change my bot’s status to DND?

#

Python coding

opal plank
#

Idk py unfortunately

faint prism
#

@dusk vault What exactly is wrong with it? It parses the input quickly and as expected

dusk vault
#

it was mostly a joke

#

but it's not the cleanest thing ive seen tho

faint prism
#

It's just splitting a string, and using the expected format by indexes though

dusk vault
#

anyway cant talk

#

researching colleges

#

lol

sharp thicket
#

um any help

node:4) UnhandledPromiseRejectionWarning: TypeError: message.client.get is not a function```
slender thistle
#

How do I change my bot’s status to DND?
@hasty mulch change_presence(status=discord.Status.dnd)

#

An enum

sonic lodge
#

@sharp thicket what are you trying to do

faint prism
#

message.client.get is not a function message.client.get isn't a function

sonic lodge
#

a nice moment where english is definitely not ambiguous

slender thistle
#

client doesn't have a get method

faint prism
#

lol right?

#

does message have a client property?

solemn latch
#

yes

sharp thicket
#

@sonic lodge i think i fixed it

#

i forgot to add queue to my code hyperlol

drifting wedge
#

using pythonm anyone have an example of prefix thing?

dusk vault
#

95% of this server's users dont know what tf they are doing prove me wrong

quartz kindle
#

you're wrong

#

its actually 96%

#

:^)

dusk vault
#

oof

#

lol

faint prism
#

You're both wrong, it's 99.7%.
ie, 3 standard deviations

dusk vault
#

fucc

quartz kindle
#

lmao

opal plank
#

make it 99.9%

dusk vault
opal plank
#

tim shiv cry me and auger, thats the team

dusk vault
#

100 - 1E-99999999

opal plank
dusk vault
#

%

sonic lodge
#

none of us know what we're doing

faint prism
#

Cry too

#

Y'all are the JS devs

dusk vault
#

me: cries in spent a year doing this and coding for half my life

opal plank
#

EXCUSE ME

quartz kindle
#

im pretty sure 99% of certified devs know what they're doing

opal plank
#

TS sir

quartz kindle
#

then maybe 30% of verified devs

faint prism
#

superset superiority syndrome

quartz kindle
#

then maybe 5% of whitenames

#

:^)

dusk vault
#

lmao

#

i deleted my submission

#

because it wasnt ready

opal plank
#

can i bribe @slender thistle to get me certified dev? 002_think

dusk vault
#

so thats why i still have a white name

quartz kindle
#

red names maybe 50% know what they're doing

sonic lodge
#

how do i apply to join the 'js team'

dusk vault
#

learn js

sonic lodge
#

i think i'm halfway decent

dusk vault
#

then spent 5 years doing it

#

lol

opal plank
#

learn js and spend 90% of your daily time here helping people in order to get an excuse for your procrastination, thats how you join the team

slender thistle
#

dblpy is working fine so I'd say there's still hope

sonic lodge
#

lol is there a test

dusk vault
#

yes

quartz kindle
#

if only i could make a living from helping people on discord

sonic lodge
#

how much is it worth my grade

dusk vault
#

know how proxies work KEKW

slender thistle
#

if only, Tim... mmLol

opal plank
#

any chance yall' be doing a certificate again soon?

quartz kindle
#

times are tough

#

i can barely pay rent as it is lmao

opal plank
#

feels bad having a unique bot and not a unique role

slender thistle
#

Soon™️ is as close as possible because it's still being reworked

dusk vault
#

hey shivaco i have a question

quartz kindle
#

is it actually being reworked tho?

opal plank
#

Im officially signing up for beta, wink wink

faint prism
#

||Shiv: -ask2ask||

slender thistle
#

Well, it's probably not top priority as of currently

dusk vault
#

so if i have a bot that has general purpose features, but still has one or more powerful unique features, it still cant be accepted as applicable for certification?

quartz kindle
#

so at least its not 100% abandoned

opal plank
#

petition for helper role for those who contribute a lot in this channel too

quartz kindle
#

thats good to hear

slender thistle
#

Requirements for certification are unknown, I can't give you a definite answer @dusk vault

dusk vault
#

ok

#

ree

grizzled raven
#

requirements for certified dev: be human (optional)

#

okay nvm my question never got answered

#

but eh

stark abyss
#

why do I get

TypeError: neko is not a function```
I did: ```css
module.exports = function neko(command, message, choices){ stuff}```
#

I can only think of one reason, I messed up in pathway but it doesn't give me that error

#

i still need help

sinful belfry
grizzled raven
#

is it just me or is sqlite being funky

quartz kindle
#

its just you

errant perch
#

using discord.js

#
      const https = require('https')
      const options = {
        hostname: 'financialmodelingprep.com',
        port: 443,
        path: '/api/v3/quote/AAPL?apikey=demo', //b186ef33ed7c7aee4fa9226a0d7f257f
        method: 'GET'
      }

      const req = https.request(options, (res) => {
        res.on('data', (d) => {
          process.stdout.write(d)
          
        })
      })
      
      message.channel.send(`${req.symbol}'s stock value is ${req.price}`)
      
      req.on('error', (error) => {
        console.error(error)
      })

      req.end()``` here's the code
grizzled raven
#

so the first time i tried it messed up the values, the second time it was fine except for one

#

wait forgot

#

tim save me

errant perch
#

or am i saying it wrong

#

what is that

sharp thicket
#

Hi,anyone know how to store data in a file so multiple commands can see it is that possile as im making music commands

modest crane
#

that's a json object

sharp thicket
#

ik

#

wait look

grizzled raven
#

reminds me

sharp thicket
grizzled raven
#

@quartz kindle sorry but do you usually enable auto_vacuum or vacuum at all?

sharp thicket
#

here

quartz kindle
#

@errant perch the value is only available inside the data event

#

it doesnt exist outside

#

@grizzled raven in sqlite? nope

grizzled raven
#

oh

sharp thicket
#

in the vote and queue files i just have new Map();

quartz kindle
#

i mean, i never set up any vacuum option, idk if it has a default one

grizzled raven
#

dont think so

modest crane
#

Hi,anyone know how to store data in a file so multiple commands can see it is that possile as im making music commands
use a database

sharp thicket
#

um i alr use one but the other dev who quit knows databases i don't..

#

im too dumb Think1

grizzled raven
#

so yeah tim do you know whats happening with text being set to "0.0" when i pass null?

sharp thicket
#

all ik is that he used mongoDb

#

DB*

ember lodge
quartz kindle
#

@grizzled raven how are you columns defined?

ember lodge
grizzled raven
sharp thicket
#

@ember lodge i don't know html or css but maybe define a position for the button?

grizzled raven
#

do you need the whole statement?

ember lodge
#

is not that :/

quartz kindle
#

if you do a SELECT, does it actually return 0?

#

or does it return null

grizzled raven
#

well thats from a sqlite viewer thingy which is probably using select, but i'll try myself

quartz kindle
#

which sqlite lib are you using?

faint prism
#

or am i saying it wrong
@errant perch it's an array of objects

grizzled raven
#

better-sqlite3

quartz kindle
#

most likely some weird type coalition going on

grizzled raven
#

also keys tend to get switched for whatever reason and its inconsistent

quartz kindle
#

the column expects text, do it doesnt understand what null is and tries to convert it

#

this conversion can be done at library level or at sqlite level, not sure which one is the culprit

grizzled raven
#

hm

quartz kindle
#

the only way to avoiding it is to avoid typing mismatch

grizzled raven
#

well other nulls actually get saved as null

quartz kindle
#

for example if the column is text, just store "" instead of null

grizzled raven
#

hm

#

okay

quartz kindle
#

because you cant control how automated type conversions happen, its always better to stick to the correct type

grizzled raven
#

its just weird how one is fine and one is 0.0

#

and its 0.0 and not 0 so thats even weirder

#

but that could be sqlite

quartz kindle
#

could also be the library

grizzled raven
#

but how can one be null and one be 0.0

#

okay i guess ill just manually do that

#

but then

#

seems to be in the order of the object but i didnt change it for 2 and 3 and their different

quartz kindle
#

arent you missing the columns selection?

grizzled raven
#

hm?

quartz kindle
#

INSERT INTO starboard (messageID,guildID,...) VALUES (@messageID,@guildID,...)

grizzled raven
#

but maybe that could fix it, i'll see

#

oh thats why sqlites asking me for all columns to be provided

#

that makes sense

quartz kindle
#

i've always used this format INSERT INTO themes (id,name,owner,data) VALUES (?,?,?,?)

#

never had issues

grizzled raven
#

just thought i should do it that way, didnt realise that both ways work

#

and that that way is for all values and the column thing is just for inserting some

#

that seemed to fix the column placement problems AND the message being 0.0 so thanks

errant perch
#

how do i get a value from a array

summer torrent
#

use its index to get

#

like array[0] for first value

errant perch
#

it returns as undefined

summer torrent
#

show code

errant perch
#
      const https = require('https')
      const options = {
        hostname: 'financialmodelingprep.com',
        port: 443,
        path: '/api/v3/quote/AAPL?apikey=demo', //b186ef33ed7c7aee4fa9226a0d7f257f
        method: 'GET'
      }

      const req = https.request(options, (res) => {
        res.on('data', (d) => {
          process.stdout.write(d)
        })
      })
      
      message.channel.send(`${req[1]}'s stock value is ${req[2]}`)
      
      req.on('error', (error) => {
        console.error(error)
      })

      req.end()```
astral yoke
#

does member.roles.has require cache?

summer torrent
#

@errant perch try sending message after req.end and see if it helps

errant perch
#

ok

#

still undefined

grizzled raven
#

req[0].name, req[0].price

#

thats an object not an array

errant perch
#

cannot read property of name undefined

grizzled raven
#

what are you console.logging

errant perch
#

req

grizzled raven
#

do console.log(res); console.log(req[0])

errant perch
#

ok

quartz kindle
#

@errant perch the data you want only exists inside the data event

#

outside there is nothing

#

req does not contain the data

#
// req is a request object, it controls the request process, but does not contain any data
const req = https.request(options, (res) => {
    // the request object returns a response object, which contains a data stream from where you can read
    res.on('data', (d) => {
        // here we read data from the stream, at this point the data you want exists in the "d" variable
        // this data only exists here, nowhere else
        process.stdout.write(d)
    })
    // there is no data here
})
// there is no data here
grizzled raven
#

wait is it d you're logging and showing me?