#development

1 messages ยท Page 1027 of 1

restive pebble
#

U can prevent

delicate shore
#

how i am not good at aapi

#

api*

restive pebble
#

if message === that thing return

delicate shore
#

????

#

what

hoary elm
#

Figure it out

#

What do you want to replace

earnest phoenix
#

@delicate shore u use npm package

#

??

#

or api

restive pebble
#

Node fetch hot

earnest phoenix
#

request better

restive pebble
#

Depreacated

earnest phoenix
#

monkaHmm what they're doing i wonder

lusty quest
#

fetch is easy

restive pebble
#

Is better ik

#

But

#

Depreacated

earnest phoenix
#

@earnest phoenix what you DOING ?

#

:))

#

request is just better in more functionality, fetch is just for easy use

restive pebble
#

U code on mobile?

earnest phoenix
#

yes

#

and i prefer request

#

@restive pebble me ?

#

no

restive pebble
#

No

#

Voltrex

earnest phoenix
#

But using deprecated things are not good lol

#

dude noway he code in mobile

restive pebble
#

U can copy tho

earnest phoenix
#

I always coded on mobile

#

and why discord today is so slow

restive pebble
#

Mobile coders are epic

earnest phoenix
#

it take 2s to send msg

#

And genius

restive pebble
#

I also code on mobile sometimes

earnest phoenix
#

or maybe 5

restive pebble
#

Yeah he is genius

winter basalt
#

your internet nguyen

earnest phoenix
#

dude my wifi is full

restive pebble
#

Hmmm

earnest phoenix
#

I'm a genius for being the first person to be the verified dev by coding a bot on mobile KEKW

restive pebble
#

Lol

earnest phoenix
#

wut

#

noway

restive pebble
#

Yeah u can

#

Github

#

I directly commit to github

earnest phoenix
#

Huh

#

wait u can edit ongithub

restive pebble
hoary elm
#

๐Ÿ‘Œ

earnest phoenix
#

i didnt know

#

I don't use GitHub anymore since i changed hosts

#

xD

restive pebble
#

I will try

#

Tho

earnest phoenix
#

but i save everything on github

restive pebble
#

I write packages on github

#

Ya

earnest phoenix
#

Dude

restive pebble
#

This time it was a huge mess becuz I didn't tested my package and published it on npm

earnest phoenix
#

dude this discord is slow

#

smh

#

My browser crashes when i try to edit my main file on GitHub... It's that big xQcM LULW

restive pebble
#

And it was showing deaths in recovered

earnest phoenix
#

u know what

restive pebble
#

What

earnest phoenix
#

we should go general

#

:)

restive pebble
#

Yes

#

Shitchat

earnest phoenix
#

ShitPost lol

pure lion
#

Morning Boeing also can I have some help with some command handler bullshit

earnest phoenix
#

@restive pebble he asking u

pure lion
#

No

earnest phoenix
#

huh

pure lion
#

I was being polite and saying good morning to boeing

golden condor
#

@pure lion what's the problem with your cmd handler

restive pebble
#

Oh

pure lion
#

I have a client (mOnEy) and everything sucks, it all sucks, and he's not given enough info

restive pebble
#

If u don't ping I don't see

golden condor
#

Can we solve that issue lol

pure lion
#

But it's saying "unexpected token {"

restive pebble
#

What command handeler

golden condor
#

On what line

restive pebble
#

U are missing something before

earnest phoenix
#

@pure lion you got syntax errors i see

pure lion
#

I'll get the code brb

earnest phoenix
#

send codes

golden condor
#

That is what he is doing

earnest phoenix
#

Show us the full error not the code

#

damm

#

2 masters of djs is here

#

he is so lucky

restive pebble
#

Hi cxllm

earnest phoenix
#

So we can know which line it's

pure lion
#

Ohmygod he fucked everything up I might have to liveshare delete his bot

golden condor
#

Hey Boeing

earnest phoenix
#

lmao

#

Lol

golden condor
#

F

earnest phoenix
#

i gtg

#

bye

restive pebble
#

Bye lol

#

Take care lol

pure lion
#

Oh boi

#
//  ______          _  ______               _                                  _   
//  |  ___|        | | |  _  \             | |                                | |  
//  | |_ _   _  ___| | | | | |_____   _____| | ___  _ __  _ __ ___   ___ _ __ | |_ 
//  |  _| | | |/ _ \ | | | | / _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __|
//  | | | |_| |  __/ | | |/ /  __/\ V /  __/ | (_) | |_) | | | | | |  __/ | | | |_ 
//  \_|  \__,_|\___|_| |___/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__|
//                                                 | |                             
//                                                 |_|                             

const { Client } = require('discord.js')
const client = new Client();
require('./handlers/command.js')(client)
golden condor
#

This guy

#

Doesn't know

pure lion
#

This is there index file

golden condor
#

That /* exists

pure lion
#

Their*

winter basalt
#

my god what have i come back to

pure lion
#

This is the entire index file

pale vessel
#

didn't login?

pure lion
#

Idk any more

#

They're not showing me enough shit

restive pebble
#

Command handelers require loading

golden condor
#

What is in ./handlers/command

restive pebble
#

Make a collection

pure lion
#

@golden condor wait

#
const { Collection } = require('discord.js');
const { token } = require('../config.json');
const { readdirSync } = require('fs');
const db = require(`quick.db`)

module.exports = client => {
    client.commands = new Collection();
    client.tickets = new db.table(`tix`)
    client.StickyMessages = new db.table(`sticky`)

    readdirSync("./commands/").forEach(dir => {
        let cmds = readdirSync(`./commands/${dir}/`)
        cmds.forEach(f => {
            let props = require(`../commands/${dir}}/${f}`);
            client.commands.set(props.name, props);
        });
    })

    readdirSync('./events/').forEach(async file => {
        let evt = require(`../events/${file}`)
        let evtName = file.split('.')[0]
        client.on(evtName, evt.bind(null, client))
    })

    client.login(token);
    console.log('All commands and events have been loaded\nMade by Fuel Devlopment | Fuel#2649');
}
restive pebble
#

Nice copy

pure lion
#

I've been asking, "how the fuck have you been getting commands?"

golden condor
#

What is he doing

#

He needs help

pure lion
#

I'm trying my best

#

๐Ÿ˜ข

golden condor
#

No not you

#

The other guy

pure lion
#

To help

pale vessel
#

show message event

pure lion
#
SyntaxError: Unexpected token '{'
    at wrapSafe (internal/modules/cjs/loader.js:1054:16)
    at Module._compile (internal/modules/cjs/loader.js:1102:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at C:\Users\scicc\OneDrive\Desktop\Fuelbot\handlers\command.js:14:25
    at Array.forEach (<anonymous>)
    at C:\Users\scicc\OneDrive\Desktop\Fuelbot\handlers\command.js:13:14
PS C:\Users\scicc\OneDrive\Desktop\Fuelbot>

Err

#

Ok wair

#

Wait

restive pebble
#

U missing brackets ig

#

Learn to debug

earnest phoenix
#

@pure lion show 14th line on command.js file

pale vessel
earnest phoenix
#

Flaz wearing shungite powered goggles to have godlike eyes

pale vessel
#

anybody know what shungite is?

pure lion
#

A ty flaz

earnest phoenix
winter basalt
pale vessel
#

it's the copypasta

#

or what doc said

earnest phoenix
restive pebble
#

Hmmm

pure lion
#

Nope I'm done

#

I'm fucking done

restive pebble
#

Wut

pale vessel
#

yeah just leave them

#

there's no point in helping

restive pebble
#

Ok

pure lion
#

He's meant to pay me lma9

pale vessel
#

well then

#

if you really want that $0.1 then do your job

earnest phoenix
#

You gotta remake that from the ground up LULW

pure lion
#

HES ALREADY PAID ME $5

#

QHSISJDOWJDISSJ

pale vessel
#

run away with the money

#

fuck it

earnest phoenix
winter basalt
#

lmao

hoary elm
#

Lol

earnest phoenix
#

xQcM ditch them

pure lion
#

Epic

#

But he said I'm gonna get $10 more if I fix so I said undo everything

pale vessel
#

that fucking guy

hoary elm
#

๐Ÿ˜ฌ

earnest phoenix
#

$10 doesn't worth getting through that fucking pain man, go on with it

lofty lagoon
pure lion
#

Apparently a "verified big bot developer" helped him

pale vessel
#

huge Kapp

earnest phoenix
#

So then why it has errors like that if a "big bot dev" helped him LULW

pure lion
#

Name is apparently nut (username)

pale vessel
#

๐Ÿ˜ฉ

pure lion
#

๐Ÿ˜ฉ

graceful dock
#

is it possible to use an inputted id as a discord.member?

pale vessel
#

try resolving the id to a member

feral aspen
#

Hey guys

#

Im fixing the ping command.. and see this..

#

    const latency = msg.createdTimestamp - message.createdTimestamp;
    const choices = ['My Ping..']
    const response = choices[Math.floor(Math.random() * choices.length)]

How can I make it that after it sends (msg).. I want to delete it after

pale vessel
#

@graceful dock i don't know python but maybe this? member = discord.utils.get(message.guild.members, id='ID')

feral aspen
#

can anyon help me in the above.

restive pebble
#

What u mean by delete it after

#

After some time?

feral aspen
#

it sends the message.. then it deletes after the const response action is made.

restive pebble
#

.delete({timeout:time})

pale vessel
#

uwot

feral aspen
#

    const latency = msg.createdTimestamp - message.createdTimestamp;
    const choices = ['My Ping..']
    const response = choices[Math.floor(Math.random() * choices.length)]
<<< I WANT TO DELETE THE MSG HERE THEN >>> ```
#

like that

#

what is it

#

msg.delete;?

pale vessel
#

yes

#

()

restive pebble
#

set some time

pale vessel
#

it's a method

feral aspen
#

Oh.. msg.delete();?

restive pebble
#

Yea

pure lion
#

Yeah you gotta add brackets mannnn

pale vessel
#

MaN

feral aspen
#

Forgot..

pure lion
#

nAm

feral aspen
#

๐Ÿ˜

#

๐Ÿ™„

pure lion
#

ยท_ยท

graceful dock
#

ill just use the converters

#

as a method

pure lion
#

ยฐ_ยท

graceful dock
#

to return the data

delicate shore
#

bruh

#
client.on('message', msg => {
  if (msg.channel.type == "dm") {
    msg.author.send("You are DMing me now! I don't repsond to it. If you do it again I will mass ping you smh. But to add me just do s!invite in any server i am in and for support join here hlol");
    return;
  }
});```
honest perch
delicate shore
#

this is not working

#

and my bot is not responding to dms

honest perch
#

1970 great date

delicate shore
#

noicee

#

omfg

#

wtf

#
client.on('message', msg => {
  if (msg.channel.type == "dm") {
    msg.author.send("You are DMing me now! I don't repsond to it. If you do it again I will mass ping you smh. But to add me just do s!invite in any server i am in and for support join here ");
    return;
  }
});```
#

my bot is not responding to dm

delicate merlin
#

If you do it again I will mass ping you smh

#

what

delicate shore
#

ignore tha

#

but why it's not workng

#

-checkdms

#

-checkdm

#

hm

#

-bots

gilded plankBOT
delicate shore
#

oh

#

wrong channel

earnest phoenix
#
let oITG = await require("systeminformation").osInfo();
let aOfOs = [];
for(let key in oITG){
aOfOs.push(`${key}: ${oITG[key]}`);
}

return aOfOs.join("\n");
}

bot.tools.Os();``` does async / await not work in making functions?
#

Cuz it's not resolving the promise

#

it does work

#

Then care to explain why it doesn't resolve the promises Thonk

split kite
#

Question I have a little bot and Iโ€™d like to save the levels of my bot (the console) in case of a spit. Please help me. Iโ€™m 13 years old.

earnest phoenix
#

../

#

Happens each time tying to start bot?

lusty quest
#

there is somewhere a bad path in a module i guess

earnest phoenix
#

Location I should be looking? @lusty quest

lusty quest
#

there is somewhere a bad path in a module

#

i guess check all files

#

maybe restarting your pc already helps

earnest phoenix
#

Mmm, I'll see.

restive pebble
#

install moment lol

earnest phoenix
#

Yep, I can't read lool

restive pebble
#

do npm unistall

#

and again install

#

is it strange to get 120 downloads of npm package in one day

earnest phoenix
restive pebble
#

hmmm

#

did u did npm init?

pure lion
#

U m

restive pebble
#

do npm init

#

then npm install

#

all done

earnest phoenix
#

type something and press enter

#

its recreating the package

#

version 1.0.0

restive furnace
#

just do npm init -y

zenith gazelle
#

anyone know why

async def reactrole(ctx, role, emoji):
    if isinstance(role, discord.Role):
        print("test")
    else:
        print("test2")```
 does not print "test" when I mention a role as the arg?
earnest phoenix
restive pebble
#

ya good

#

now all should be installed

earnest phoenix
#

So run node .

restive pebble
#

strange mhm

earnest phoenix
#

Install it lol

restive pebble
#

all i can say is move ur code to another folder

#

ya run npm install

#

only

earnest phoenix
#

So run npm install now?

restive pebble
#

npm install

#

ya

earnest phoenix
#

I did and got same page of errors

lusty quest
#

its possible that you need to install every single Module you used again

earnest phoenix
#

Mmm

#

Sooo, what should I be doing?

#

Copy that @earnest phoenix ?

quartz kindle
#

you got errors when you did npm install ?

#

which errors?

earnest phoenix
quartz kindle
#

also, remove "fs" from your dependencies

#

those are not errors, they are warnings

earnest phoenix
#

So npm uninstall fs

quartz kindle
#

enmap requires installing better-sqlite3

earnest phoenix
quartz kindle
#

did you install better-sqlite3?

earnest phoenix
quartz kindle
#

npm install better-sqlite3

earnest phoenix
#

Did it same error

quartz kindle
#

what error

earnest phoenix
#

Gives me that still.

quartz kindle
#

show the installation

#

when you do npm install better-sqlite3 what happens

earnest phoenix
quartz kindle
#

you need build tools on windows to install better-sqlite3

#

npm install -g windows-build-tools

earnest phoenix
#

Was working fine before, I'll do that.

#

So that's done now run npm install better-sqlite3 ?

quartz kindle
#

if it was working fine before, then you dont need enmap at all

#

are you actually using enmap?

#

also, installing windows-build-tools takes a while, it cant be done that fast

earnest phoenix
quartz kindle
earnest phoenix
#

Closing and reopening now.

#

Same

#

Does make sense, was fine before.

quartz kindle
#

as it says above, you need an administrative powershell

#

meaning, run as admin

#

but if youre not actually using enmap, just remove it

earnest phoenix
#

How can I remove everything and just copy and paste what I've got into a new doc?

#

See if that fixes it?

quartz kindle
#

delete your node_modules folder, and your package and package-lock files

#

then run npm init

earnest phoenix
#

In CMD?

#

Or term?

quartz kindle
#

follow the instructions

#

its asking you to give it a package name

#

press enter to just use the default that shows in the parenthesis

earnest phoenix
#

Done

quartz kindle
#

with all of them?

earnest phoenix
#

Yeah not it wants to install again discord.js

#

npm install discord.js ?

quartz kindle
#

yes

#

now you have a fresh installation

restive furnace
#

that covers it fully up

earnest phoenix
restive furnace
#

package.json isnt synced with your js files

#

you need to add the packages manually you're using

quartz kindle
#

you asked how to remove everything and start again, so i told you how, now you need to install the packages you're using again

#

no big deal, there's not a lot of them

earnest phoenix
#

I'll need to install package.json now

quartz kindle
#

no

restive furnace
#

what

quartz kindle
#

thats not a package

restive furnace
quartz kindle
#

packages are dependencies/libraries/modules, the package.json file is the file that controls them, you already have it

#

just install moment the same way you installed discord.js

earnest phoenix
#

Now it's back to better-sqlite3

quartz kindle
#

so you are using enmap after all?

#

so you have code that uses enmap in your js files?

earnest phoenix
#

Ye

quartz kindle
#

then if you want to use it, you need to install windows-build-tools

earnest phoenix
#

npm install --global windows-build-tools

#

this ?

quartz kindle
#

yes

#

from an admin powershell or cmd

#

right click > run as admin

earnest phoenix
#

Already is running as admin

quartz kindle
#

ok now it seems to be working

#

installation should take a few minutes

earnest phoenix
#

Sweet as

blazing ravine
#

hi

#

it's possible to invite the bot to guild with a code ? from js file ?

quartz kindle
#

no, inviting can only be done by humans

blazing ravine
#

oh okay

#

with invite link its not possible ?

quartz kindle
#

not automatically

earnest phoenix
#

ETA on this?

quartz kindle
#

a few minutes

earnest phoenix
#

Sign it's installed?

quartz kindle
#

should say successfully installed

#

on visual studio build tools

earnest phoenix
quartz kindle
earnest phoenix
#

Mmm, frozen for the time.

blazing ravine
#

whats this error

pale vessel
#

read the error

blazing ravine
#

its permission ?

pale vessel
#

something before the user is null

blazing ravine
quartz kindle
#

guild.owner is null

#

guild owners are not guaranteed to be available

blazing ravine
#

oh thanks

quartz kindle
#

you need to fetch them

#

owner = await <client/bot>.users.fetch(msg.guild.ownerID)

earnest phoenix
#

Still doesn't work, ffs.

blazing ravine
#

oh thankss

earnest phoenix
#

Anyone know of any would you rather apis? I've seen either.io's used but can't find any info on it (i'm not sure where to ask, but if you know of a better place to ask please foward me to that)

quartz kindle
#

do they have an official api?

#

if not, people most likely scrape them instead

blazing ravine
#

its this good ?

quartz kindle
#

no need for the || {}

earnest phoenix
#

@quartz kindle Still doesn't work.

#

if not, people most likely scrape them instead
@quartz kindle How can i do this?

quartz kindle
#

what still doesnt work

#

did the installation complete?

earnest phoenix
#

@quartz kindle Worth just removing everything and copying pasting into a new project? Like?

quartz kindle
#

@earnest phoenix load the website using an http library, read its html response, and extract the questions

#

@earnest phoenix wont make a difference

#

did the installation complete?

earnest phoenix
#

Yes

quartz kindle
#

after the installation finished

#

did you do npm install better-sqlite3?

earnest phoenix
#

Installing now

#

@quartz kindle Installed, so I can run node . now?

quartz kindle
#

yes

earnest phoenix
#

Need to reset token, give a moment.

quartz kindle
#

are you using the correct token?

earnest phoenix
#

Yes

quartz kindle
#

where did you get it from?

earnest phoenix
#

Dev thing

quartz kindle
earnest phoenix
#

Yeah

quartz kindle
#

the bot one

earnest phoenix
#

Correct

quartz kindle
#

not the general information one

#

are you inputting it directly, or are you using some env/config file?

earnest phoenix
quartz kindle
#

show your index.js

earnest phoenix
quartz kindle
#

you're doing config = require("discord.js")

earnest phoenix
#

Should be doing?

quartz kindle
#

require("./config.json")

earnest phoenix
#

Ohhh, no wonder I changed that for something I removed.. Thank you.

#

Now I need to install npm install config.json?

quartz kindle
#

no

#

you already have it

blazing ravine
#

@quartz kindle

#

sorry for tag

earnest phoenix
blazing ravine
#

@earnest phoenix crate config file

#

or change location

quartz kindle
#

i edited my message, did you see?

#

"./config.json"

#

needs the ./

earnest phoenix
#

Oh shoot, mhm

blazing ravine
#

is this good ?

quartz kindle
#

yes should be good

#

no need to post twice lol

earnest phoenix
#

Hold shit, thank you so much @quartz kindle !!

blazing ravine
#

@quartz kindle i have error xd

#

with this code

quartz kindle
#

@blazing ravine what is the error

earnest phoenix
#

What should I change it to?

blazing ravine
#

1 min let me ss

quartz kindle
#

@earnest phoenix just remove them

earnest phoenix
#

Remove both things in the box?

quartz kindle
#

if you need to access client.config elsewhere, just do client.config = config instead

#

yes

#

also disableEveryone: true was removed in the latest discord.js update

#

use disableMentions: "everyone" instead

earnest phoenix
pale vessel
#

you don't

earnest phoenix
#

Why

pure lion
#

Lolololol imagine hosting on broken down software for 24/7

earnest phoenix
#

Any buddy reply plz

quartz kindle
#

glitch.com recently banned the usage of periodical pinging, which was required to keep a free project alive

earnest phoenix
#

No other trick??

quartz kindle
#

therefore, it is no longer easily possible to run a bot on glitch without paying

#

it might still be possible with some complex circumvention

earnest phoenix
#

@quartz kindle The !ping isn't working now?

quartz kindle
#

such as pinging it from another host and using proxies

earnest phoenix
#

:o

#

@earnest phoenix load the website using an http library, read its html response, and extract the questions
@quartz kindle just saw this, is there a good tutorial you recommend a tutorial for this?

quartz kindle
#

@earnest phoenix does some#user used the ping command appear in your console/terminal?

earnest phoenix
#

No

quartz kindle
#

then the problem is not there

#

@earnest phoenix which language are you using? js?

earnest phoenix
#

it might still be possible with some complex circumvention
@quartz kindle :O

#

How to fix? @quartz kindle

quartz kindle
#

then the problem is not there

#

aka, the problem is not in that file

earnest phoenix
#

@earnest phoenix which language are you using? js?
@quartz kindle py

quartz kindle
earnest phoenix
#

So, what's the go with getting it sorted?

#

Cheers

quartz kindle
#

@earnest phoenix the problem is likely in your index.js

earnest phoenix
quartz kindle
#

show your message.js file in your events folder

earnest phoenix
quartz kindle
#

you are using client.config.PREFIX here

#

did you add the client.config = config line i told you about before?

#

in your index.js

earnest phoenix
#

Where am I added client.config = config.

quartz kindle
#

remember where you had client.config = require("discord.js")?

#

and i told you to remove it because it made no sense?

earnest phoenix
#

Oh, mhm

#

:)

#

so replace that with client.config = config

quartz kindle
#

yes

earnest phoenix
quartz kindle
#

yes

earnest phoenix
#

Bot just crashes when I run !ping.

quartz kindle
#

error?

earnest phoenix
pure lion
#

Uh

#

Start over

earnest phoenix
pure lion
#

Jk

earnest phoenix
pure lion
#

Where are you reuqiring config.json?

#

Okay where is config.json?

earnest phoenix
#

Oh wait

pure lion
#

Try removing the ./

earnest phoenix
#

Mhm

quartz kindle
#

config.json is not a module, its a json file

earnest phoenix
pure lion
#

@quartz kindle so fs.readfile?

quartz kindle
#

did you change anything in your ping.js file?

earnest phoenix
#

No just removed ./ as told above.

quartz kindle
#

add it back

earnest phoenix
pure lion
#

Modern problems require modern solutions tim

quartz kindle
#

show the ping.js file again

earnest phoenix
quartz kindle
#

you did change

#

this makes no sense

earnest phoenix
#

Try removing the ./
@pure lion

#

Did the same thing.

quartz kindle
#

not that

pure lion
#

I'm always in chat there's no point pinging me

quartz kindle
earnest phoenix
#

Ahh

#

Nope crashed with discord.js in there too.

pure lion
#

E r r o r ?

#

Why did you write .discord.js

earnest phoenix
#

Oops, wait.

#

Working, thank you.

pure lion
#

:3

subtle sluice
#

ummmm how to code

quartz kindle
#

learn it by studying

digital ibex
#

learn with sololearn :)

#

sololearn is good

blazing ravine
#

tim

#

@quartz kindle

digital ibex
#

you can read the documentation btw

pure lion
#

hi helo

#

how to time function?

digital ibex
#

wut

pure lion
#
var date = new Date();

function t_i_m_e(date) {

  date.getDay() + '/' + date.getMonth() + '/' + date.getFullYear() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();
}
#

is no woerk

#

i can hear the facepalming, please forgive me. i never took the time to learn about how functions work

#

or time for that matter

blazing ravine
#

how t ofix

digital ibex
#

can u please read the docs

pure lion
#

^

#

i dont think thats how to array

digital ibex
#

u can do it like that

#

and shitddev

#

what r u trying to do

pure lion
#

get the time

#

with a function so it doesnt say 9 pm when its 1 pm

digital ibex
#

theres multiple ways to tell the time

#

12 hour time?

pure lion
#

๐Ÿฟ

digital ibex
#

or 24

pure lion
#

24

lusty quest
#

maybe its easyer if you use moment

digital ibex
#

no

pure lion
#

mehhhghhhhh

digital ibex
#

then its just new Date().toLocaleTimeString().slice(0, 5)

#

u can do that

pure lion
#

oh okay ty

digital ibex
#

np

pure lion
#

if i wanna get the day and month and year tho?

digital ibex
#

i believe its just new Date().getFullYear()

pure lion
#

okie

digital ibex
#

and for month prob getMonth

#

idk

pure lion
#

Holy son of ball it works thankyou @digital ibex

digital ibex
#

๐Ÿ‘

earnest phoenix
#

How would I make like a code to get a random number with the guild name to make a random server value thingo based off how many members are in the server?

digital ibex
#

wut

earnest phoenix
#

Ok so, I wanna make a command to say how much โ€œmoneyโ€ a server is worth thru how many members there are in a server

#

I might need to figure this out myself though

#

Can someone send me the discord.js website?

regal raven
#

Can someone send me the discord.js website?
@earnest phoenix see pins

digital ibex
earnest phoenix
#

Thanks

regal raven
#
earnest phoenix
#

Lemme just-

regal raven
#

Hm

earnest phoenix
#

ty

regal raven
#

Your Welcome

#

How do I make a paginator in discord.py? Any help or links will be helpfull

digital ibex
#

paginator?

regal raven
#

Page navigation in embeds with reactions

digital ibex
#

ah

#

like a reaction menu?

regal raven
#

Yep

digital ibex
#

1 sec

regal raven
#

Bcz my help page is really long

tight plinth
#

is there any way to do a forEach loop with objects?

digital ibex
#

wasi, unsure. im still learning python

pale vessel
#

use the keys

#

or just loop through the entries and have both accessible

regal raven
#

No problem

tight plinth
#

hmm

digital ibex
#

oh nice

finite bough
#

dming like 5k members in d.js is safe?

lusty quest
#

5k api calls in a short period what you think?

quartz kindle
#

why would you want to do that

digital ibex
#

hi, im having a small issue with something, my page just loads for some reason

#

im not getting any errors in the console

#

and the network tab just says pending

#

anyone know why this may be happening? the get request: js app.get('/:user/chat', async (req, res) => { const user = await user.findOne({ id: req.params.user }); if (user === null) res.render('404', { joke: 'That user ID does not exist.' }); else res.render('chat', { user }); });

finite bough
#

i dont wonna do it lmao

#

someone told me he has been doing it for years now and he didnt get banned

slender thistle
#

with a BIG delay and users' consent, I mean

quartz kindle
#

you wont necessarily get banned for it, but its kind of a dick move

pure lion
#

what filetype does canvas accept as fonts/where do i put fonts when i download them?

#

would i make a new dir?

quartz kindle
#

ttf or woff usually

digital ibex
#

ok after like 5 minutes it says I'm connected to socket.io

#

so uh

pure lion
#

ok ty tim

quartz kindle
#

you can put them wherever you want

pure lion
#

what about otf?

digital ibex
#

and now it shows the url as userid/chat but its not redirecting me

quartz kindle
#

should work too

pure lion
#

okokokokokokokokko brb

spare mirage
#

is it possible to make an commands command that automatically updates?

rain atlas
#

Albert is here!

quartz kindle
#

yes its possible

digital ibex
#

oh god im dumb

#

quick question, why am i not getting any errors? like I basically done const user = user

#

but it didn't error for some reason, does anyone know?

pure lion
#

@quartz kindle how do i incorporate the font into the script?

#

@earnest phoenix client.users.cache.size

quartz kindle
#

using node-canvas?

pure lion
#

the npm is named canvas

#

so i believe ye

quartz kindle
pure lion
#

ah ty

#

what lang?

#

yeah users

#

s

#

TypeError: Cannot read property 'user' of null

#

u s e r

quartz kindle
#

is that serverinfo.js line 48?

pure lion
#

||^||

earnest phoenix
#

when i type ping the bot wont respond with pong( can someone tell me the mistake in my code)

pure lion
#

are you in v11?

quartz kindle
#

sendMessage is deprecated

#

use .send()

pure lion
#

^

earnest phoenix
#

hm

#

idk what have i done wrong ๐Ÿ˜ฆ

spare mirage
#

npm i discordjs

earnest phoenix
#

i have done that

spare mirage
#

and check what version ur in

earnest phoenix
#

ok

#

ok

#

it doesnt work

copper cradle
#

@earnest phoenix console.log args and see if you're parsing it correctly

earnest phoenix
#

ok

quartz kindle
#

does it say "this bot is online" in your terminal/console?

earnest phoenix
#

yeah

#

it does say

quartz kindle
#

does it say anything else? like an error or something?

earnest phoenix
#

no

quartz kindle
#

are you typing ping or !ping?

earnest phoenix
#

!ping

#

i have set the prefix

copper cradle
#

there we go

#

wair

#

wait*

#

are you sure you're parsing it correctly?

earnest phoenix
#

idk

#

hi i wanna know how i can open a command shell and allow the user to run commands on it through node, i cant find anything online and im just stuck rn

copper cradle
#

console.log args and see if you're parsing it correctly

earnest phoenix
#

console.log args and see if you're parsing it correctly
@copper cradle ok

#

there is a prefix issue

#

cause when i type ping it works

quartz kindle
#

PREFIX.length

#

you have PREFIX.lenght

spare mirage
#

Depends if u usew prefix or PREFIX

quartz kindle
#

length is mispelled

earnest phoenix
#

oh shit

copper cradle
#

lmao

torn ravine
#

bruh

quartz kindle
#

these kind of bugs are the hardest to find lmao

torn ravine
#

spelling errors

earnest phoenix
#

these kind of bugs are the hardest to find lmao
@quartz kindle yeah

#

but now its showing some error

torn ravine
#

@earnest phoenix don't exactly know what you mean

earnest phoenix
#

i fixed the issue now

#

when i run a js file via a batch file the command shell closes

topaz epoch
#

use pause>null

#

in batch file

earnest phoenix
#

ok

#

ffs

#

now it just says press enter to close and i cant run any cmds

topaz epoch
#

Would you like to run a js file with a batch file?

earnest phoenix
#

yes...

#

i have a js file witch is gonna allow somebody to parse command line arguments

topaz epoch
#

in the batch file use : node C:\Directory

earnest phoenix
#

๐Ÿ˜

#

ik how to use batch files

topaz epoch
#

use node C:\DirectoryofYourfile

earnest phoenix
#

i cant with you rn

topaz epoch
#

why?

cinder patio
#

Put & after the command

#

that should keep it open

earnest phoenix
#
const Discord = require("discord.js");
const fetch = require("node-fetch");

module.exports = {
  name: "animeme",
  aliases: ["animememe"],
  category: "Anime",
  run: async (bot, message, args) => {
    
    let loadingEmbed = new Discord.MessageEmbed()
    .setColor("#2f3136")
    .setDescription(`:loading: Generating a anime meme!...`)
    let msg = await message.channel
      .send(loadingEmbed)
      .then(m => m.delete({ timeout: 2000 }));

    fetch("https://www.reddit.com/r/Animemes.json?sort=top&t=daily")
      .then(res => res.json())
      .then(body => {
        if (!body) return message.reply("I broke, try again!");

      const allowed = message.channel.nsfw ? body.data.children : body.data.children.filter(post => !post.data.over_18);
      if (!allowed.length) return message.channel.send('Hmm looks like an error to me...');
        const randomnumber = Math.floor(Math.random() * allowed.length)
       
    let url = allowed[randomnumber].url
    let animeembed = new Discord.MessageEmbed()
      .setTitle(allowed[randomnumber].data.title)
      .setURL(url)
      .setImage(allowed[randomnumber].data.url)
      .setFooter(`๐Ÿ‘ ${allowed[randomnumber].data.ups} | ๐Ÿ’ฌ ${allowed[randomnumber].data.num_comments}`)
      .setColor("#2f3136")

console.log(`${message.author.username}#${message.author.discriminator} asked for a anime meme!`)

    return message.channel.send(animeembed);
    })
  }
};
``` help it doesnt set the url of title for the post :/
tulip ledge
#

@signal carbon What does url log? And allowed and randomnumber?

torn ravine
#

how would I get the bot's voice channel again

tulip ledge
#

And are you sure the url isn't longer then the max length for titles?

#

message.guild.voiceConnection I think

#

Not sure tho

#

Don't have alot of experience with music bots

earnest phoenix
#

i get undefined :/ @tulip ledge

static trench
#

Does it work?

#

Or is it bad

autumn summit
#

Help when I edit the role's position nothign takes place, every thing is defined

#

here is the line await role.edit(position=10)

earnest phoenix
#

Python?

autumn summit
#

yeah

#

when I do different fields it works

#

only position doesnt

earnest phoenix
#

Idk sorry

autumn summit
#

k

tulip ledge
#

@earnest phoenix Wich one logs undefined?

earnest phoenix
#

url

#

the other are fine

#

@tulip ledge

slender thistle
#

What is role position relative to in Discord API?

tulip ledge
#

Ok

#

So .url

#

Doesn't work

#

Can you log allowed[randomnumber]

#

To see if it contains the url key?

earnest phoenix
#

uhh ok

slender thistle
tulip ledge
#

This is od

#

It works fine for me

autumn summit
#

role position changing is broken

slender thistle
#

ehh I would remove the "changing" part and it would still make sense

autumn summit
#

yea

#

are u trying to edit role positions too?

earnest phoenix
#

ay @tulip ledge i done it i needed to do

let url = `https://www.reddit.com${allowed[randomnumber].data.permalink}`
tulip ledge
#

Ah

#

See

#

Good job!

slender thistle
#

@autumn summit Not really, just accessing the role positions of my server

#

I remember something being up with channel positions also

blazing ravine
#

can some1 help me

sudden geyser
#

can you explain what you need help with

blazing ravine
#

verification level undefinned

#
.addField("Verification Level", verifLevels[msg.guild.verificationLevel], true)
 let verifLevels = ["None", "Low", "Medium", "(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต  โ”ปโ”โ”ป", "โ”ปโ”โ”ปใƒŸใƒฝ(เฒ ็›Šเฒ )ใƒŽๅฝกโ”ปโ”โ”ป"];
sudden geyser
#

that's because guild.verificationLevel is a string.

earnest phoenix
#

hey, how would i make a bot that when someone else creates a channel, it automatically deletes it?

sudden geyser
#

You're better off with an object key/value, or using the string itself.

#

Coraldonkey what library are you using

earnest phoenix
sudden geyser
#

There is the on_guild_channel_create(channel) event, though I'm not experienced if there's a better way of doing it.

earnest phoenix
#

hm. ill mess around with it, thanks

slender thistle
#

That's pretty much the only way

blazing ravine
#

how to get all members count in all guild that bot is in / with bots

sudden geyser
#

You could check the size of the <Client>.users collection, or you could iterate over each guild and add up the .memberCount for a more accurate number.

opal plank
#

guild.memberCount

blazing ravine
#

this is for only for the guild

#

u use the command

#

i mean all guild bot is in

#

and all memebr count

slender thistle
#

Iterate over each guild

opal plank
#

iterate thru all of them (duplicates might be an issue)

blazing ravine
#



})};```
#

something like this ?

opal plank
#

no

#

let sum = 0;
for(a of client.guilds.cache)
sum = sum + a.memberCount;

pale vessel
#

reduce()

opal plank
#

that works even better

blazing ravine
#
    guild.fetchMembers().then(g => {
        let count = 0;
        g.members.forEach((member) => {
            count++;
        });
        console.log(count);
    });

});```
#

this good ?

opal plank
#

dont use forEach

blazing ravine
#

oh ok

opal plank
#

forEach bad

blazing ravine
#

how to i add let sum = 0;
for(a of client.guilds.cache)
sum = sum + a.memberCount;

opal plank
#

for ( in)
while

blazing ravine
#

in embed

opal plank
#

use other alternatives, forEach is slow

#

you make that logic outside

#

add it on embed after you done it

#

actually, holdon

#

n.eval console.log(client.guilds)

#

@pale vessel its a collection, i dont think reduce() can iterate thru that, its for arrays only

pale vessel
#

collection has extended features

#

such as sort and reduce

opal plank
#

perfect then

sudden geyser
#

forEach is perfectly fine to use.

slender thistle
#

tbh forEach isn't that slow compared to for loops, is it

#

In some cases difference in performance not being significant enough to be noticed

opal plank
#

its the same as teaching people to use globals, vars, and all the other bad js practices

sudden geyser
#

Its performance is not what should be noted imo. It should be how it's done. For example, reduce is fine in this scenario because you just want to get the total calculated number.

#

forEach is not bad practice. Please explain how it is.

#

"It's slow; don't use it" is like saying "Python's slow. Don't use it."

opal plank
#

map(), filter(), find(), reduce(), for(), while() there are so many other options avaliable out there

tulip ledge
#

Is there a way to turn a date into a unix timestamp?

opal plank
#

js?

tulip ledge
#

Yes

sonic ivy
tulip ledge
#

I've been looking through their docs

#

But can't find anything

sonic ivy
#

i think moment().format("x") should work

tulip ledge
#

Well no

#

Thats to format a unix timestamp into a date

pale vessel
#

moment(date).valueOf()

tulip ledge
#

I want to convert a date into a timestamp

opal plank
#

new Date('2012.08.10').getTime() / 1000

sudden geyser
#

That's in seconds I believe.

#

You don't need the division

opal plank
#

oh js uses ms i think

#

yeah

#

used to postgres using seconds

#

speaking of which, anyone familiar with SQL/Postgres syntax well?

pale vessel
earnest phoenix
#

how do i do ```js
var mybool = false
wait until mybool == true

slender thistle
#

while (mybool !== true)

opal plank
#

who's cry?

earnest phoenix
#

ok

pale vessel
slender thistle
#

no wait, revert that

earnest phoenix
#

ok

blazing ravine
#

guild.members.cache.filter(member => !member.user.bot).size; how to make to check all members + bots in same count

#

this code remowing bots for mthe member count

#

sorry for my bad english

opal plank
#

oh there they are

earnest phoenix
#

im not at home @pale vessel :p this is a pain to read on phone

tulip ledge
#

Ok so now I have 2 timestamp and I want to get how many years, moneths and days are in between them and can't figure out how (momentjs)

opal plank
#

fair enough, cry, would you be able to give me a hand later on postgres? got a single question but no one here is familiar with more than basic SQL query syntax nor did they use jsonb

blazing ravine
#

@opal plank ${msg.guild.memberCount}

#

like this

#

but to show bot count too

tulip ledge
#

client.users.cache.size

blazing ravine
#

ok

earnest phoenix
#

problem is im on a holiday i wont be home in a weeks time, can't help regardless though since i didnt ever use jsonb, sorry

#

oh no now i cant type ๐Ÿ˜ฆ

opal plank
#

all good, ty either way

blazing ravine
#

@tulip ledge not showing correct

#

need fetch

opal plank
sudden geyser
#

our stackoverflow expert

opal plank
#

indeed

#

i think i exhausted all other alternatives

sudden geyser
opal plank
#

yes, indeed

earnest phoenix
#

im trying to make a command shell that generates a basic discord bot i have the following code:

const readline = require("readline");
const fs = require('fs')
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
var bottxt = ""
var prefixdefined = false

rl.question("What is your bots prefix? ", async function (prefix) {
    bottxt = "const Discord = require('discord.js');\nconst client = new Discord.Client();\nconst settings = {\nprefix: '"+ prefix +"',"
    console.log(bottxt);
    prefixdefined = true;
});
while(prefixdefined==false) {}
rl.question("What is your bots token? ", async function (token) {
    bottxt = bottxt + "\n'"+ prefix +"',\n}"
    console.log(bottxt)
});
``` but when i run it, the while(prefixdefined==false) {} causes me to not be able to type
sudden geyser
#

Can you show us index.js, line 1677 at column 16.

earnest phoenix
#

if (msg.member.permissions.has('ADMINISTRATOR')) return

#

this

blazing ravine
#
function getUsers() {
  let guilds = bot.guilds.array();

  for (let i = 0; i < guilds.length; i++) {
    bot.guilds.get(guilds[i].id).members.fetch().then(r => {
      r.members.array().forEach(r => {
        let username = `${r.user.username}#${r.user.discriminator}`;
        console.log(`${username}`);
      });
    });
  }
}```
sudden geyser
#

It means msg.member is undefined.

blazing ravine
#

how t ofix

sudden geyser
#

Are you sure the message sent was from a guild, or that msg is actually a message instance.

marble geode
#

someone can help me?

sudden geyser
#

Gokse what are you converting it to an array for

#

You probably don't need to do that.

earnest phoenix
#

@sudden geyser so, should i put if (!msg.member) return?

blazing ravine
#

i need fetch

#

all users

marble geode
#

dbl member is 100k why my bot status is 20k users

blazing ravine
#

bot and humans

#

in same count

marble geode
#

dbl member is 100k why my bot status is 20k users
.

sudden geyser
#

You should verify that msg is, in fact, a message instance and correct.

opal plank
#

online users

#

client.users.cache shows online users only

blazing ravine
#

but

opal plank
#

do a guilds sum

blazing ravine
#

not correct

marble geode
#

oo

blazing ravine
#

count

sudden geyser
#

Why do you need to fetch all members in a guild

marble geode
#

how to make count all? @opal plank

earnest phoenix
#

I tried if (msg.guild && !msg.member) await msg.guild.members.fetch(msg.author) but its spamming "Unknown User" error in console , lol

opal plank
#

reduce() works better tho

pale vessel
#

guilds.reduce((x, y) => x.memberCount + y.memberCount)

blazing ravine
#

@opal plank

pale vessel
#

it might return NaN but try that concept first

blazing ravine
#

for use this code in embed addFeidl(sum, "")

#

like this ?

opal plank
#

once you have the sum, yeah

sudden geyser
#

@earnest phoenix that means msg.author is probably not a user instance. Can you show us more of your code in the scope you're in.

opal plank
#

actually

#

no

#

that returns a number

marble geode
#

how to set that in my bot status

opal plank
#

has to be a string in that field iirc

marble geode
#

gimme example

sudden geyser
delicate shore
#

guys

sudden geyser
#

yes

delicate shore
#

pls suggest me some good

#

commands

#

fun commands

#

or meme commands

sudden geyser
#

Depends. What is your bot about

delicate shore
#

meme

#

and fun

#

and moderation

#

and music

#

and covid

opal plank
#

the msg spam oof

delicate shore
#

aka Multi Purpose

slender thistle
#

-ideas

gilded plankBOT
#

Find something that you would like in a bot, and has also not been done before. Try and come up with a list of things you are interested in, and think up ways you could make the task easier with a discord bot. Eg. I like fishing -> I'm in a fishing discord group -> I'll make a bot that has fishing data and gives fishing advice. or I like a certain cartoon/anime/tv show. -> Why not make a bot that reminds me when new episodes are released and their watch dates? Once you have a fair amount of concepts down, try and look for those bots on bot listing sites like this one. If you cant find a bot that does what you laid out before as a bot concept, then feel free to write it! Who knows? Maybe a lot of people would like what you create...

delicate shore
#

ohhh

sudden geyser
#

That can pretty much be anything, such as a userinfo, serverinfo, roleinfo, reddit, etc. but I think it's better you try and add features people will actually want rather than just throwing in random stuff

delicate shore
#

does anyone knows how to make a jail command like DM does

#

That can pretty much be anything, such as a userinfo, serverinfo, roleinfo, reddit, etc. but I think it's better you try and add features people will actually want rather than just throwing in random stuff
@sudden geyser ohh like noone will use currency

#

because people use dm

#

currency

earnest phoenix
opal plank
#

@quartz kindle are you familiar with postgres jsonb syntax by any chance?

delicate shore
#

how ot make a jail command?

blazing ravine
pure lion
#

how ot make a jail command?
Wh

blazing ravine
#

xd

#

hm

#

how to return i dont udnerstand

sudden geyser
#

hmm, could you try logging msg? If msg.member is null, it typically means the user who sent the message is not in the guild (DM), while msg.author being null I don't know.

earnest phoenix
#

k

quartz kindle
#

@opal plank nope

opal plank
#

try it with reduce()

#

fuckkkkk

#

not a single soul

blazing ravine
#

idk

#

how to make

#

with reduce

#

lol

opal plank
blazing ravine
#

if i know i not as kfor help

opal plank
#

not even our guru uses jsonb

#

wtf

pure lion
#

Weh?

opal plank
#

tim was my last hope here

pure lion
#

Who's Jason B

quartz kindle
#

are the docs that bad?

pure lion
#

And why is he not used by our guru

opal plank
#

not quite, i just dont see a method to get array index

#

everything else i got sorted

blazing ravine
#

how t oreduce

opal plank
#

the filter and the delete

#

but i'd need to get the index posittion of the obj to get it

#

and i dont see a method for doing that without destroying the array

#

destroy, scan, remove, reconstruct

blazing ravine
#

who can help me

pale vessel
#

i tried helping you

#

๐Ÿ˜ฉ

opal plank
#

theres a method to remove specifically at index, without needing for extra computation for the destroying and reassembling it

hidden lynx
#

How can i get the avatarURL of my client?