#development

1 messages ยท Page 1452 of 1

analog imp
#

that should help

nocturne narwhal
#

does someone here know how to get the webhook url in dblpy? since it has an already built-in webhook system to check for votes

#

i just can't find it

earnest phoenix
#

your server ip and port

nocturne narwhal
#

oh? ok then

earnest phoenix
#

a webhook is nothing more than just a reverse API; instead of you making a request to a website, the website makes a request to you

in order to accept said requests, you need a webserver open on a specific port
the lib you're using probably creates a webserver for you and is listening on that port

nocturne narwhal
#

Yeah Thank You

earnest phoenix
#

Any ways to show your bot's statistics like server & members count on a website??

#

either server-side render your website
or
have an api exposed on your backend that the frontend can call

spiral kayak
#

weres the gamesZ?

carmine summit
#

IMAGINE USING A PACKAGE

spiral kayak
#

were they post game at in here?

earnest phoenix
#

what are you talking about

earnest phoenix
#

Heyo

analog imp
clever agate
zenith terrace
#

anyway

#

you did something wrong with ur code above since it shows the text as white

clever agate
#

@zenith terrace

#

pls HELP

zenith terrace
#

u are missing a }

clever agate
#

Where do I put it

#

@zenith terrace

zenith terrace
#

wait

#

yea there

clever agate
#

YEAHH

#

thankss broooo

rain orbit
#

MessageEmbed now, RichEmbed is v11

zenith terrace
#

their still using v11

rain orbit
#

O

#

rip

zenith terrace
#

yee

dense flare
rain orbit
#

i think thats oauth2

earnest phoenix
#

Yes.

#

The only way to see if account is verified is via oauth2, like kat said.

dense flare
#

do you mean these authorization windows of discord or is there a way to make oauth2 requests with a bot?

earnest phoenix
#

the former

#

the latter part of your question genuinely does not make sense

dapper ocean
#
entry = guild.audit_logs(limit=1, action=discord.AuditLogAction.bot_add)

how to i get a user from action

#

in audit logs

crimson vapor
#

basically

earnest phoenix
#

yes

#

google's servers are having a stroke

#

so inherently discord is having one too

zenith terrace
#

discord just wanted to join the fun

earnest phoenix
#

discord's using gcp

#

so they don't have much control

vague flicker
#

yeah my discord developer has not open

#

my bot is offline

analog imp
#

lmfaoo discord joined the fun

#

still can't get into the dev portal either

#

or connect my test bot

#

stuck at trying to start a new client RIP

vague flicker
#

Yeah I was testing my bot and suddenly my bot left

analog imp
#

yep, same here, i went to restart and was like

#

wtf so first thing i did was check status, they didn't update it so thought it was on my end lmao

#

went to dev portal and couldn't load it

#

so i thought "impossible, no way i got locked out, wasn't breaking rate limits :("

#

so i went to gmail

vague flicker
#

unlucky

analog imp
#

lmfao

#

gmail was down so i'm like "oH cRaP"

#

bad order of events tbh, thought i was getting attacked

vague flicker
#

And you looked at the gmail and couldn't enter

jovial nexus
#

How can i log the image if the message has an image?

analog imp
#

like on message delete?

vague flicker
#

even my message goes late: D

#

now my top.gg bot is offline they will reject

#

I'm very unlucky

earnest phoenix
#

they're aware of when discord has outages and won't deny it when you're not at fault

vague flicker
#

ฤฑ hope

lost isle
#

does anyone know a good host 24/7?

earnest phoenix
#

check pins

boreal iron
#

I wonder why your bot is offline. The gateway is still online.

outer perch
#

uhm, guys, my bot isn't starting anymore

#

it listens to POSTs

#

but bot.on(ready, {}) just stopped executing

crimson vapor
#

yep servers are nah rn

outer perch
#

no no, that happens locally too

crimson vapor
#

what do you mean by that

outer perch
#

or should node have problems?

outer perch
crimson vapor
#

well considering discord server are not working it makes sense that your bot can't connect

outer perch
#

outta nowhere

#

or that

#

yeah tru

#

but minutes ago it was working ๐Ÿคฆ๐Ÿปโ€โ™‚๏ธ

sand condor
knotty obsidian
#

what happen

#

Error fetching applications. Please reload page, or click here to contact support.

umbral zealot
knotty obsidian
#

oh

#

okay its not me

#

im not doing anything wrong xd

umbral zealot
#

Indeed! ๐Ÿ˜„

#

Well, not this time ๐Ÿ˜›

knotty obsidian
#

๐Ÿ‘

wary mason
#

my server just crashed because of #googledown (yes, i use google server)
and my bot doesnt start anymore (I doesnt get any response of the Api)
what should i do? i dont get any errors or something like that.

earnest phoenix
#

wait

#

sit and wait

umbral zealot
crimson vapor
#

lol

earnest phoenix
#

imagine using gcp tho

crimson vapor
#

whatever works tbh

wary mason
#

gcp works pretty good tho

#

thinking to switch to aws

slim umbra
#

discords dbs are having tons of backlog rn

#

that appears to be where its stroking

wary mason
#

yours work but mine not?

umbral zealot
#

You love telling literally everyone about your pings don't you @earnest phoenix

wary mason
#

hate my life xD

past needle
#

Luca is offline too bruh

#

wut

#

oh

#

yea

#

:o

#

i just restarted mine

#

tried*

wary mason
earnest phoenix
#

I got approved :D

#

Yaaay

past needle
past needle
fair axle
#

Which database management system is best for discord bots and why?

past needle
#

the shardRecconect event keep getting emitted

fair axle
#

I use sqlite

wary mason
fair axle
#

is there any request traffic problem with sqlite

past needle
umbral zealot
#

quick.db is slow and bad.

past needle
#

mysql is the best at general for me

umbral zealot
#

sqlite is perfectly fine, mysql is the worst

fair axle
#

I'm not beginner at this. I used too many database management system but I don't know which one is the best

#

I used mysql, sqlite and mongodb before

umbral zealot
#

What do you mean by "Database management" then

crimson vapor
#

is enmap persistent?

umbral zealot
crimson vapor
#

so its essentially a light db

umbral zealot
#

Enmap a wrapper around sqlite with caching. meant for absolute beginners.

crimson vapor
#

oh

fair axle
#

What if I send 50+ request in a second with sqlite

umbral zealot
#

sqlite is good for "lots of reads, a lot less writes"

fair axle
#

Do you know what is the limit for writing

earnest phoenix
#

HOi

umbral zealot
#

it's not a hard limit, it depends on a lot of factors

earnest phoenix
#

so

umbral zealot
#

if you're worried about it, maybe use a real database server like postgresql

fair axle
#

Is there any documentation about that

earnest phoenix
umbral zealot
#

I Feel we're going in the wrong direction. What exactly is your question?

earnest phoenix
#

thing

umbral zealot
earnest phoenix
#

the web hook

fair axle
#

How many request can I send to sqlite (update request)

#

That's the question

umbral zealot
umbral zealot
earnest phoenix
#

lel

#

@umbral zealot so what do i have to put

fair axle
#

Yes but I couldn't find anything about comparison with other systems

hollow sedge
umbral zealot
#

I mean they are limited

#

by a lot of things on the system

hollow sedge
#

Yeah but you won't hit that limit

umbral zealot
#

And it depends on the exact implementation

hollow sedge
#

It's not something to worry about

umbral zealot
#

and it depends on the speed of the disk

#

and it depends on the operating system

#

and it depends on the size of what you're writing

fair axle
#

Okey relax

earnest phoenix
#

Anyone who knows py plz dm me i need help

umbral zealot
#

See the thing is there is no one universal solid answer to the question, so, why are you asking about sqlite write limits?

fair axle
#

I will post a screenshot when discord servers came back

#

It will be more explanatory

#

I got an error about limits

umbral zealot
#

Ok so clearly you have reached them and you have an issue

earnest phoenix
#

@umbral zealot answer when

#

lag

#

lag

umbral zealot
#

and sqlite is no longer appropriate for you

#

You should consider switching to postgresql.

crimson vapor
umbral zealot
#

It's a great database, yes.

fair axle
#

When the bot joined the server, I tried to create a special line for each users

earnest phoenix
#

so what do i have to put

umbral zealot
earnest phoenix
#

and?

#

thats all?

fair axle
#

That was an error on command line about limits

earnest phoenix
#

live code or code

umbral zealot
#

"in a new window" lol

fair axle
#

I don't remember error exactly but it was about that

#

It was just 5 users in server

earnest phoenix
#

@umbral zealot live code or code

umbral zealot
#

it'll be something like http://myservername.glitch.me/

earnest phoenix
#

thats live code

umbral zealot
#

no that's the website URL that's public

#

literally, a web server.

fair axle
#

I'll ask again when discord servers came back

past needle
#

:o

fair axle
#

is it online now

#

yes it is

umbral zealot
#

lol

earnest phoenix
#
const Topgg = require('@top-gg/sdk')

const app = express(Do i have to put here) // Your express app

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

app.post('/dblwebhook', webhook.middleware(), (req, res) => {
  // req.vote is your vote object e.g
  console.log(req.vote.user) // 221221226561929217
}) // attach the middleware

app.listen(3000) // your port```
umbral zealot
opal plank
#

im fairly certain that sdk has a webserver its own btw

#

do you even need that tbh?

crimson vapor
#

it does

earnest phoenix
#

wdym

#

oo

umbral zealot
#

pretty sure that's the example provided in the docs

opal plank
#

you could use the bot as a gate, store votes or something in database

#

i dont remember epxress being there

#

lemme double check

#

it does

#

huh thats odd

#

the old way was to simply re-emit it or store in database/cache for an easy fetch when the website requests it

earnest phoenix
#

@umbral zealot

#

bo

#

bro

#

when i put the express code the link behind // go grey

umbral zealot
#

What.

#

Those are called "comments"

#

Maybe you should learn a bit more JavaScript before proceeding.

earnest phoenix
#

ik

#

behind // codes dosent works

#

so how do i

#

put the code

umbral zealot
#

Yeah... That's how JavaScript works...

earnest phoenix
#

that right?

opal plank
#

๐Ÿ‘€

umbral zealot
#

I'm sorry I don't think I can really assist you.

earnest phoenix
#

my bot dont want to go online ?

umbral zealot
earnest phoenix
#

ok

#

thank you

opal plank
#

my bot didnt go offline at all, which is odd as fuck, i was monitoring the connection and i didnt see any DISCONNECT event

#

my twitch bot went down for a couple mins, but my discord ones didnt

gilded olive
#

Twitch runs on aws then?

opal plank
#

i just know they probably dont like the fact that i made a very aggresive lib

#

100% doesnt help my case

pale vessel
gilded olive
#

Oh it is???

#

Bruh i never knew or forgot ๐Ÿ—ฟ

boreal iron
lyric lotus
#
    if(message.author.bot || !message.content.startsWith(global.Ayarlar.Prefix)) return;

    let args = message.content.split(" ");
    let commandName = args[0].substring(global.Ayarlar.Prefix.length);
    args = args.splice(1);
    let command = global.Commands.get(commandName);
    if(!command || !command.conf.enabled || (command.conf.guildOnly && message.channel.type != "text")) return;
    if(command)
        command.run(message.client, message, args);

help me
How to prefix with spaces
example: owo
command example: owo help

pale vessel
#

args[0].substring(global.Ayarlar.Prefix.length).trim()

pale vessel
#

Trim the whitespace excess

opal plank
#

yeah i didnt get socket closing

#

otherwise it would've shown on my panel since i monitor status every 15 seconds

boreal iron
#

If you don't experience any disconnect you won't notice the outtage

#

(probably)

lyric lotus
#

@pale vessel how do I get whitespace like bro owo help

#

i want to make a gap

pale vessel
#

Trim the whitespace after slicing your prefix

#

"owo help".slice(prefixlength) would be help so trim the string so that it becomes help, making it detect the command properly

#

Prefix length would be 3, assuming that the prefix is owo without space

earnest phoenix
#

@pale vessel global variables aaaaaaa

#

How do u get your port

earnest phoenix
#

how to get port

pale vessel
#

What port

earnest phoenix
pale vessel
#

Elaborate?

queen hamlet
frosty valve
earnest phoenix
#

W A N T E D
Global Variables

K I L L O N S I G H T

#

lOl

queen hamlet
#

Ohhhhh mg ty lol

earnest phoenix
#

@pale vessel to make web hooks

crimson vapor
#

LMFAO

earnest phoenix
#

Its said i need port

#

so idfk whats my port its

#

Ahhh yes my favourite const.log

umbral zealot
#

yes the more solid version of var.log

earnest phoenix
#

@queen hamlet u an use const log too

exotic vine
#

nothing can beat AAAAAA string in c

earnest phoenix
#

n.tag learn js

#

Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:

  • proper syntax
  • debuging code
  • basic features (vars, arrays, objects, functions)
  • read and understand docs
  • nodejs module system

As much as we d like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.

Here are good resources to learn both Javascript and NodeJS:

Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie s Accelerated JS: https://js.evie.dev/

Please take a couple of weeks/months to get acquainted with the language before trying to make bots!

#

@queen hamlet

#

Bro why don't they let us remove embeds on mobile

exotic vine
#

thats too much links embeds to my screen!

earnest phoenix
#

how to get ur bot's portt

#

@earnest phoenix are you making a bot named botghost KEKW

earnest phoenix
#

@earnest phoenix u mean dbl api?

#

app.listen(3000)

^example

#

yes

earnest phoenix
#

are you using the dblapi.js module or just using the api webhooks normally

#

ig normally

#

auto thingy

earnest phoenix
#

i installed that

earnest phoenix
earnest phoenix
quartz kindle
earnest phoenix
#

glitch limits what ports you can use?

#

o

#

:5head:

quartz kindle
#

yes, glitch only gives you a single port

earnest phoenix
#

no nitro moment

drifting wedge
#

YOOO

#

no slowmode here

#

dont tell the moddies

crimson vapor
#

dw I wont

earnest phoenix
#

@quartz kindle yo .-.

crimson vapor
#

^

earnest phoenix
#

my server still no work

lost isle
#

what packadges do i needa install for discord.js

crimson vapor
#

discord.js

lost isle
#

what else

#

for like

earnest phoenix
#

whats webhook url

#

express

lost isle
#

the package

quartz kindle
#

its your project url

earnest phoenix
#

wdym

#

can u show exapmle

#

example*

quartz kindle
#

https://YOURPROJECTNAME.glitch.me/dblwebhook

lost isle
#

what 2 packages do i need to install

#

beofre coding

quartz kindle
#

what other packages are you thinking about?

earnest phoenix
#

@quartz kindle its just said starting andnothing else

lost isle
#

i already have node_modules package-lock and i know there is anohter one

#

likw

earnest phoenix
#

Starting

To keep Glitch fast for everyone, inactive projects go to sleep and wake up on request

lost isle
#

packages

earnest phoenix
#

EXPRESS

quartz kindle
earnest phoenix
#

but i dont wanna leak my project name

quartz kindle
#

when you do npm install discord.js, a package.json file is created if it doesnt exist, a node_modules folder is also created if it doesnt exist

lost isle
#

dont i need one

#

called

#

oh ok

quartz kindle
#

then you just need to create your js file and start coding

lost isle
#

ok

#

thanks!

quartz kindle
earnest phoenix
#

@earnest phoenix i beg you to stop using glitch before the FBI comes and breaks your front door and sues you and puts you in jail ๐Ÿ™

quartz kindle
crimson vapor
#

package.json isnt created unless you use npm init I thought

quartz kindle
#

it is in npm v7

earnest phoenix
#

@crimson vapor it ain't created

#

only package lock

queen hamlet
#
const { Client, RichEmbed } = require("discord.js");
const bot = new Client();

const token = "Nz-OMCQkr




  switch (args[0]) {
    case "poll":
      const Embed = new RichEmbed()
        .setColor(0xffc300)
        .setTitle("Intitled Poll")
        .setDescription("p!poll to make a simple yes or no poll.");

      if (!args[1]) {
        message.channel.send(Embed);
      }
      break;
  }
});


bot.login(token);```
There seems to be a problem and it is not sending the embed, can someone help?
earnest phoenix
#
const Topgg = require('@top-gg/sdk')

const app = express('projectnamne.glitch.me')

const webhook = new Topgg.Webhook('My bots api key')

app.post('/dblwebhook', webhook.middleware(), (req, res) => {

  console.log(req.vote.user) 
}) 

app.listen(process.env.PORT) ```
earnest phoenix
#

@queen hamlet man just leaked his token

#

lOl

quartz kindle
crimson vapor
#

hippity hoppity your token is now my property

sterile lantern
#

lmao rookie mistake

quartz kindle
#

const app = express();

#

thats all

queen hamlet
#

Chile

#

Can someone help?

earnest phoenix
#

They literally have no message event listeners and aren't even deleting their message after leaking the token

#

OH

umbral zealot
#

what's the problem

crimson vapor
#

damn it invalid

quartz kindle
queen hamlet
#
const { Client, RichEmbed } = require("discord.js");
const bot = new Client();

const token = "ThisIsAGoodToken";

const PREFIX = "p!";

bot.on("ready", () => {
  console.log("Bot is ready!");
});

bot.on("message", message => {
  let args = message.content.substring(PREFIX.length).split(" ");

  switch (args[0]) {
    case "poll":
      const Embed = new RichEmbed()
        .setColor(0xffc300)
        .setTitle("Intitled Poll")
        .setDescription("p!poll to make a simple yes or no poll.");

      if (!args[1]) {
        message.channel.send(Embed);
      }
      break;
  }
});

bot.login(token);```
sterile lantern
#

what are you gonna even do with the token

#

u cant even get the invite

#

can u?

queen hamlet
#

It's not sending the embed.

sterile lantern
#

i mean maybe maybe not

earnest phoenix
#

RichEmbed -> MessageEmbed

quartz kindle
sterile lantern
#

Discord.MessageEmbed

queen hamlet
sterile lantern
#

define Discord

quartz kindle
#

its in your package.json

earnest phoenix
#

still

queen hamlet
#

^12.5.0

quartz kindle
#

RichEmbed doesnt exist in v12+

earnest phoenix
#

they don't have any message listeners

queen hamlet
#

Ah

#

MessageEmbed?

earnest phoenix
quartz kindle
#

yes

queen hamlet
#

Tyty

earnest phoenix
#

Nevermind it was the old message

crimson vapor
#

Tim you should add RichEmbed to discord.js-light

quartz kindle
#

why lol

crimson vapor
#

this.RichEmbed = MessageEmbed

#

why not

quartz kindle
quartz kindle
#

i just told you

earnest phoenix
#

in the webhook url i have to put?

quartz kindle
#

yes

#

thats where you put https://YOURPROJECTNAME.glitch.me/dblwebhook

hollow sedge
earnest phoenix
#

Hoow about in the Authorization?

sterile lantern
#

yea but

#

what if their bots are not in any server

#

t b h

quartz kindle
#

new Topgg.Webhook("YOU_CAN_WRITE_WHATEVER_YOU_WANT_HERE_AS_LONG_AS_YOU_WRITE_THE_SAME_THING_IN_AUTHORIZATION")

drifting wedge
#

how do i get the amount of vc channels my bot is connected to?

#

discordp[y

quartz kindle
#

and ban the owner from them

sterile lantern
#

bots... can create servers???

crimson vapor
#

yes

sterile lantern
#

they can own servers?

crimson vapor
#

no

quartz kindle
#

they can

sterile lantern
#

o

quartz kindle
#

only if they are in less than 10 servers

crimson vapor
#

and the first person to join will be owner

sterile lantern
#

bruh thats epik

lost isle
#

hey what command do i use to start the bot im using discord.js

drifting wedge
#

can u transfer ownership to them? i think you could

quartz kindle
#

node yourfile.js

sterile lantern
#

are u using node?

#

o

#

^^

lost isle
#

yea

crimson vapor
#

might I suggest learning node js

sterile lantern
#

do u have index.js?

lost isle
#

ok thanks

#

yea i got it

sterile lantern
#

aight

lost isle
#

thank you!

earnest phoenix
#

lets see

#

@quartz kindle the webhook still dosent post anything in my server or smth

lost isle
#

does anyone know how to make the discord bot have there own custom status im using discord.js

umbral zealot
lost isle
#

does anyone know how to make the discord bot have there own custom status im using discord.js

#

help

gilded olive
#

Bruh

lost isle
#

i have a code but it dont work

quartz kindle
umbral zealot
lost isle
#

k

#

thanks!

quartz kindle
zenith terrace
#

Yo tim is alive

quartz kindle
#

bots can only have playing/watching/listening/streaming

lost isle
#

yea ik i have watching all server

#

but its not showing up

quartz kindle
#

show your code

lost isle
#

k

#

` setInterval(() => {
let activity = activities[Math.floor(Math.random() * activities.length)];
client.user.setActivity("All Server!", { type: "WATCHING" });
}, 20000);

};`

#

prob

#

wrong

#

i got from yt

quartz kindle
#

the code is correct

#

did you wait 20 seconds?

lost isle
#

yes!

hollow sedge
quartz kindle
#

is your bot connected and online? does your console say anything?

lost isle
#

my bot is connect

#

and online

lost isle
#

and it doesnt say anything

hollow sedge
#

Yeah

quartz kindle
#

add a console.log inside the interval

lost isle
#

how?

quartz kindle
#

for example console.log("setting activity")

lost isle
#

sorry im new

hollow sedge
#

It keeps the links clickable

lost isle
#

ok

quartz kindle
#

right before client.user.setActivity

#

and see if it shows in your console

lost isle
#

so

#

console.log("client.user.setActivity")

quartz kindle
#

doesnt matter, can be anything

#

just to see if it appears

earnest phoenix
#

@quartz kindle like in there do i have to put top.gg's my bot's token or api key

quartz kindle
#

to make sure the interval is actually running

hollow sedge
#

Api token/(key?) @earnest phoenix

quartz kindle
earnest phoenix
#

lemme tryna put token ig

quartz kindle
#

no

#

jesus

opal plank
#

notEnoughCaps

quartz kindle
#

read what i said

slender thistle
#

Yeah, Tim is starting to lose it

opal plank
#

`needsmorecaps

lost isle
#

nothing showed in colose

slender thistle
#

So let's see what's going on

opal plank
#

shiv

quartz kindle
opal plank
#

im bringing tim to ts

#

you're next mofo

slender thistle
quartz kindle
lost isle
#

i have it in ready.js

#

should i put in

#

index.js

earnest phoenix
quartz kindle
#

does your index.js call ready.js?

opal plank
#

learning js would be good

lost isle
#

folders

#

i just wanted it to be organized

opal plank
#

how you expecting it to run if you never run it?

hollow sedge
#

wait what website is that

#

that console actually looks pretty nice

opal plank
#

isnt that glitc?

quartz kindle
#

when you do node index.js that doesnt automatically include all other files and folders, unless you have code inside your index.js that explicitly imports the other files

crimson vapor
earnest phoenix
#

yes

hollow sedge
#

oh ok

earnest phoenix
quartz kindle
slender thistle
#

I assembled a drone but it's not working, guys. The power button is off but I think the company forgot to ship some important details.

quartz kindle
#

did you fix your authorization? did you press the test button?

earnest phoenix
#

thats all

quartz kindle
#

this guy is literally not reading my messages

earnest phoenix
#

wots array.some

opal plank
earnest phoenix
slender thistle
#

You can ride on a tire

opal plank
#

try picking up chicks with a tire

opal plank
slender thistle
#

Oh dw they'll be running after my 200 iq

lost isle
#

ok

earnest phoenix
#
const Topgg = require('@top#2386-gg/sdk')

const app = express()

const webhook = new Topgg.Webhook('my thingy not showing')

app.post('/dblwebhook', webhook.middleware(), (req, res) => {

  console.log(req.vote.user) 
}) 

app.listen(process.env.PORT) ```
opal plank
#

lmao

lost isle
#

i got an errory in my terminal

#

pls help

hollow sedge
#

require('@top#2386-gg/sdk') wait..is this right?

slender thistle
#

`@top#2386-- yeah

quartz kindle
#

lmao

opal plank
#

bruh

slender thistle
#

I have the same question

lost isle
#

@quartz kindle

#

i got an error

#

in my console

quartz kindle
#

show error

lost isle
#

k

earnest phoenix
#

@earnest phoenix

breathes in

WHAT THE FUCK

breathes out

opal plank
quartz kindle
opal plank
hollow sedge
#

i dont understand

earnest phoenix
#

yes

hollow sedge
#

where did you even get that number from

lost isle
#

ReferenceError: activities is not defined

opal plank
#

cuz you dont get that number

quartz kindle
slender thistle
#

What about your URL

lost isle
#

ok

quartz kindle
#

if you dont have an activities array

earnest phoenix
opal plank
quartz kindle
opal plank
#

cuz some donk has the TOP name

lost isle
#

wait if i remove the lin it will only be ` console.log("client.user.setActivity")("All Server!", { type: "WATCHING" });
}, 20000);

;`

earnest phoenix
#

yes ig

lost isle
#

wtf

opal plank
#

wtf...

hollow sedge
#

just @ them anyway, if they have that name they deserve it

earnest phoenix
#

@quartz kindle my glitch's project name its long tats why?

opal plank
#

you tryeing to console log a function?

#

what

earnest phoenix
#

and like spam words

#

like jagdfufiff5v5d

#

d4

opal plank
#

the living hell is that

quartz kindle
opal plank
quartz kindle
earnest phoenix
#

we have two impostors among us

quartz kindle
#
console.log("this is a test")
client.user.setActivity(...)
earnest phoenix
#

@quartz kindle check dm when

quartz kindle
#

when i want to

opal plank
#

imagine being impatient

earnest phoenix
tribal siren
#
console.log("this is a test")
client.user.setActivity("...", {type: '...'})```
lost isle
#

ayyyy

#

i got it

#

how to i make the status show the amount of severs

#

its in

#

@quartz kindle

opal plank
#

@lost isle google discord.js how to add server count on status

lost isle
#

thanks

opal plank
#

we cant hand held you all the way thru learning js and making a bot

timber fractal
#

AW MAN IM SO SAD

#

for 2 reasons

earnest phoenix
#

The first is existing in 2020

The second is using discord

timber fractal
#

1.Google was down Discord bots dont work. Servers locked ๐Ÿ˜ก
2.Tomorrow in our country second lockdown starts....

earnest phoenix
timber fractal
#

oh lol

#

wrong channel

#

sorry

opal plank
crimson vapor
earnest phoenix
#

@quartz kindle uh

crimson vapor
#

install ffmpeg

earnest phoenix
#

what ffmpeg? ffmpeg static?

crimson vapor
#

I can't help on installing, maybe someone else can or you can find a guide

fiery locust
#

@earnest phoenix yes

crimson vapor
#

no lol

earnest phoenix
#

um

#

not in terminal

#

?

umbral zealot
#

is that repl.it you're running this under?

earnest phoenix
#

yep, i tried

umbral zealot
#

If so, you can't install that yourself.

earnest phoenix
#

I use repl.it for the host. i have everything what i need. I can do anything

#

You cant use FFMPEG on repl my boi

drifting wedge
#

how do i get the amount of vc channels my bot is connected to?
discordp[y

lost isle
#

hi, i added a index.js file and a test.js

in the test.js i have :

    if (!message.content.startsWith(config.prefix) || message.author.bot) return;
  
    if (message.content.startsWith(config.prefix + "ping")) {
      message.channel.send("pong!");
    } else
    if (message.content.startsWith(config.prefix + "foo")) {
      message.channel.send("bar!");
    }
  });```

and the bot goes online but when i do the command nothing shows up
#

what should i do

earnest phoenix
#

Get a new host

#

I don't use FFmpeg I use web-audio-api npm package so i dont have to deal with that shit

lost isle
earnest phoenix
#

@lost isle are you running index.js or test.js?

lost isle
#

index.js

zenith terrace
#

Put the code into the index file

lost isle
#

it works like that

#

but i want it to be cleaner

#

liike all commands

#

in a command file

zenith terrace
#

Then make a command handler

earnest phoenix
#

The code is in the test.js and is not imported into index.js

#

So it isn't run

lost isle
#

how do i do that

zenith terrace
#

U code it

lost isle
#

ik

#

but idk how to make a command handler

earnest phoenix
#

learn it then

opal plank
#

learn

earnest phoenix
#

discordjs.guide has a nice guide on it

crimson vapor
#

am I allowed to post sample command loader?

opal plank
#

@lost isle Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:

  • proper syntax
  • debuging code
  • basic features (vars, arrays, objects, functions)
  • read and understand docs
  • nodejs module system

As much as we d like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.

Here are good resources to learn both Javascript and NodeJS:

Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie s Accelerated JS: https://js.evie.dev/

Please take a couple of weeks/months to get acquainted with the language before trying to make bots!

crimson vapor
#

hello Erwin how is work

zenith terrace
#

O h n o t h i s

opal plank
crimson vapor
#

they sure as hell aren't gonna learn js tho

earnest phoenix
umbral zealot
#

Yeah they do

crimson vapor
#

actually I read evie's and its pretty hot

#

actually good information about how everything works

opal plank
crimson vapor
#

and how to write code more efficiently

umbral zealot
#

Do you have any idea how many beginners have thanked me for forcing them to learn javascript and stop mashing away at the keyboard? Hundreds.

opal plank
#

even though they somehow end up here

crimson vapor
#

I don't understand tbh

crimson vapor
#

the first place should be google

earnest phoenix
crimson vapor
#

and if google can't help ask someone to explain in english and supply sample (not working) code

umbral zealot
earnest phoenix
#

alright why does 0/0 throw an exception?

crimson vapor
#

0/0 is undefined

earnest phoenix
#

we're literally doing what you are telling us to do with that message but you don't see it

opal plank
#

doing js without learning it first is shooting your own foot, you're just inducing yourself to keep copying code until you eventually try to do something that someone hasnt done before and theres no easy snippet for you to copy. It just produces a shit ton of bad habits and dependency on either stackoverflow or some glorious channel like this

crimson vapor
pale vessel
#

oh god

crimson vapor
#

85kb pog

opal plank
#

looks like a json db

crimson vapor
#

you're correct

pale vessel
#

Nah, jason

earnest phoenix
#

Bruh

#

Yall use json?

crimson vapor
#

no

earnest phoenix
#

I fuckin use yml

crimson vapor
#

I made it as a joke

#

oh

pale vessel
earnest phoenix
#

๐ŸŽถ On the first day of christmas Jason gave to us ๐ŸŽถ

P O G G E R S 85KB FILE PROMOTING HIM IN FILE EXTENSION

crimson vapor
#

yes

opal plank
#

you made it as a joke?

crimson vapor
#

yep

earnest phoenix
#

Yml database is the best imo

crimson vapor
#

honestly helped me learn about typings

umbral zealot
#

So fine, let me bring the metaphor I always use: It's like trying to learn cooking by making Beef Wellington as your first recipe.
"How do I use promises" = "What does 'chop finely' mean?"
"I use notepad to edit" = "A chef's knife? You mean, like, butter knives?"
"I'm getting a syntax error on this code" = "What's a food processor? what does it process? Where do I get one?"
"Sorry I'm a noob" = "I literally just moved into my first apartment from mom's house, I don't know how to read a recipe"
"I'm following this tutorial and it doesn't work" = "I'm following this recipe and I don't understand most of the words"

#

Trying to make beef wellington as your first recipe and the instructions be like:

To prepare the beef: Tie the tenderloin in 4 places so it holds its cylindrical shape while cooking. Drizzle with olive oil, then season with salt and pepper and sear all over, including the ends, in a hot, heavy-based skillet lightly coated with olive oil - about 2 to 3 minutes. Meanwhile set out your prosciutto on a sheet of plastic wrap (plastic needs to be about a foot and a half in length so you can wrap and tie the roast up in it) on top of your cutting board. Shingle the prosciutto so it forms a rectangle that is big enough to encompass the entire filet of beef. Using a rubber spatula cover evenly with a thin layer of duxelles. Season the surface of the duxelles with salt and pepper and sprinkle with fresh thyme leaves. When the beef is seared, remove from heat, cut off twine and smear lightly all over with Dijon mustard. Allow to cool slightly, then roll up in the duxelles covered prosciutto using the plastic wrap to tie it up nice and tight. Tuck in the ends of the prosciutto as you roll to completely encompass the beef. Roll it up tightly in plastic wrap and twist the ends to seal it completely and hold it in a nice log shape. Set in the refrigerator for 30 minutes to ensure it maintains its shape.
And not knowing what the words "drizzle", "sear", "shingle", "duxelle", "twine" mean.

crimson vapor
#

I see this as an absolute win

crimson vapor
opal plank
#

thank god you didnt publish on npm

crimson vapor
#

no

opal plank
#

i was about to screech

crimson vapor
#

screech

#

do it

#

join vc and reeeee the loudest reee

opal plank
#

bruh what

pale vessel
#

he published it

opal plank
#

you actually published it?

earnest phoenix
crimson vapor
#

ye

opal plank
#

link that shit pls

pale vessel
#

okay so

umbral zealot
#

that is unfortunately 2 messages, guys

opal plank
pale vessel
#

I'm a contributor

umbral zealot
#

the second one is less good on the starboard

#

try the first one ๐Ÿ˜›

pale vessel
#

does that mean that I'm a degenerate too

opal plank
#

YOU

#

DENSE

#

MOFO

crimson vapor
#

im not quite sure why there are 500 downloads

earnest phoenix
pale vessel
#

scrapers

opal plank
#

563 users using this garbo wtf dude

earnest phoenix
umbral zealot
opal plank
#

why even publish a shit package?

crimson vapor
#

dw Erwin its just because its new

pale vessel
#

Just star both 4head

opal plank
#

delet that shit

crimson vapor
#

soonโ„ข๏ธ

pale vessel
#

or put a warning or something

crimson vapor
#

alr gimme a sec

earnest phoenix
#

Star both plz guys

opal plank
#

im sure theres people who unironically download that without knowing its a troll package

crimson vapor
#

hopefully not

opal plank
crimson vapor
#

they should use enmap

pale vessel
#

"I made this package and published it because I am a retard. This package is prone to corruption, use this at your own risk."

opal plank
#

dont put harmful shit out there to begginers

umbral zealot
crimson vapor
#

dw I will

opal plank
#

lmao

crimson vapor
#

what should I say "If you need a simple DB use enmap" or something?

opal plank
#

USE ENMAP INSTEAD OF THIS GARBAGE

#

should work

crimson vapor
#

ok

opal plank
#

make sure to add #

#

so its as big as possible

earnest phoenix
#

USE THIS GARBAGE INSTEAD OF ANYTHING ELSE YOU'LL LOVE IT

opal plank
crimson vapor
#

@umbral zealot send link

umbral zealot
#

This package stores JSON data which is prone to potential corruption and data loss. I used it to learn various things and published it by mistake. I strongly suggest you do not use it. If you want an easy storage solution please take a look at Enmap.

crimson vapor
#

nvm

umbral zealot
#

perfect, no? ^_^

crimson vapor
#

just about

#

publishing was not a mistake KEKW

pale vessel
#

LOL

earnest phoenix
#

The fuck you tell me evie just sent a link that shows up as the text Enmap and not the link URL

opal plank
#

This package stores JSON data which is prone to potential corruption and data loss. I used it to learn various things and published it by mistake. I strongly suggest you do not use it. If you want an easy storage solution please take a look at

Enmap.

#

i fixed it

earnest phoenix
#

Since when were we able to mask links outside embeds?

pale vessel
#

No add # to the description too

umbral zealot
#

Oh because it's mobile, probably, code?

blissful coral
umbral zealot
#

Some clients show the proper markdown link

earnest phoenix
opal plank
#

i mean its just a title header

blissful coral
#

Androids

earnest phoenix
#

@blissful coral hi weeb

blissful coral
pale vessel
#

or not

blissful coral
#

No

pale vessel
#

Oh well

earnest phoenix
#

No it doesn't

opal plank
#

can we spam npm with shitty modules just to advertise our main one, kinda like a one sided campaing?

earnest phoenix
#

Lemme try

blissful coral
umbral zealot
crimson vapor
#

yes

#

we should

earnest phoenix
crimson vapor
#

more json dbs

earnest phoenix
#

bruh momento

opal plank
#

JASON.db
Erwin.db
EvieCode.db
Best.db

and then all of them foward to enmap

earnest phoenix
pale vessel
crimson vapor
pale vessel
#

don't

#

send that

umbral zealot
#

I'm not going to actually advise or support that advertising method - just so we're clear it's a joke ๐Ÿ˜‰

opal plank
#

wink wink

crimson vapor
#

its updated

opal plank
#

yeah clearly a joke

#

you LEGALLY cant endorse

#

wink wink

vague imp
earnest phoenix
#

How to suggest things

pale vessel
#

Like?

earnest phoenix
#

@earnest phoenix ?

umbral zealot
#

suggest to whom

crimson vapor
#

fuck I messed up

pale vessel
#

what did you do

opal plank
#

speaking of messing things up i should go back to code

#

its all a mess

drifting wedge
#

how can i get how many vc channels the bot is connected to?

pale vessel
#

Where is code

drifting wedge
#

dpy

earnest phoenix
pale vessel
opal plank
#

thats cheating

#

you had it typed beforehand

pale vessel
#

Yep

opal plank
opal plank
#

cheetor

crimson vapor
earnest phoenix
crimson vapor
#

emails go brrr

drifting wedge
opal plank
pale vessel
#

Yeah

drifting wedge
#

ehh its fine..

#

i got you!

crimson vapor
#

once it corruptsโ„ข๏ธ

#

when it corrupts I am done

pale vessel
#

So yeah, len(bot.voice_clients)

drifting wedge
#

uhh im running certain shards, itll show the list of vcs those shards?

opal plank
#

imagine not using a proper database in a container for easy deployment

lost isle
#

i added a command handler and i went to run the bot and an error pops up

error:
ReferenceError: fs is not defined

command handlger

    files.forEach((file) => {
        if (!file.endsWith(".js")) return;
        let props = require(`./commands${file}`);
        let commandName = file.split(".")[0];
        client.commands.set(commandName, props);
        console.log(`๐Ÿ‘Œ Command loaded: ${commandName}`);
    });
});```
crimson vapor
#

actually

pale vessel
#

Are you using autoshardedclient?

opal plank
drifting wedge
lost isle
#

l

umbral zealot
lost isle
#

k

crimson vapor
#

once I corrupts im adding atomic writes

lost isle
#

i found it

pale vessel
#

whatever it's called

lost isle
#

nvm

crimson vapor
#

then I will be deleting it after

opal plank
#

you DONT know

#

thats the issue

drifting wedge
#

im doing autoshardedclient, but im doing wonky stuff

opal plank
#

not even the basics, you just copying code

drifting wedge
#

im running like 10 total shards but only runnning a couple shards on that proccess

#

clustering

crimson vapor
sick fable
#

My new code:-

msg = None
athr = None		
dsc = None				
snipe = None		
@client.event
async def on_message_delete(message):
                                guild = ctx.guild.id
                                global msg
                                global athr
                                global msg_id
                                
                                msg = message.content
                                athr = message.author.id
                                msg_id = message.id
                                
                                if message.id != guild:
                                	msg = None
                                	athr = None
                                	msg_id = None
                                
                                
                                

                                


@client.command()
async def sn(ctx):
		snipe = msg
		author = athr
		snmsg = snipe
		id = msg_id
		if snipe is None:
		                                  await ctx.send("There's nothing to snipe!")
		else:
		                                  embed = discord.Embed(title = "Last Deleted Message" , colour = ctx.author.colour , timestamp = ctx.message.created_at)
		                                  embed.add_field(name = "**โ€ขMessage Content**" , value = f"{snipe}")
		                                  embed.add_field(name = "**โ€ขAuthor of that message:**" , value = f'{author}')
		                                  embed.set_footer(text = f"Requested by {ctx.author.name}" , icon_url = ctx.author.avatar_url)
		                                  await ctx.send(embed=embed)```




Error - **Cannot send an empty message**
umbral zealot
opal plank
opal plank
#

bruh i swear, js community is a shitshow

crimson vapor
#

if you search it up, you will find like 100 stack overflow questions with that code

sick fable
#

@drifting wedge idk,

#

It showed no error

drifting wedge
pale vessel
#

But hey if it works it works

crimson vapor
sick fable
#

It's a snipe command

drifting wedge
#

CONSOLEEEEEE

crimson vapor
#

basic js is imo

sick fable
earnest phoenix
#

@lost isle you haven't required fs

opal plank
#

PROPERLY learning js, people be using vars/arrays/functions and think they know js, they dont

pale vessel
#

That could be biased since you already learned it

crimson vapor
#

me?

#

nah

sick fable
#

Helpp meeee

drifting wedge
#

i started js, its ez but doenst make too much sense

earnest phoenix
sick fable
#

๐Ÿฅบ

drifting wedge
#

sorry i meant

pale vessel
#

WHAT FUCKING LINE?*

drifting wedge
#

please: let us know where is the error

crimson vapor
#

js is easier than py and java

#

and those are the easiest languages

umbral zealot
#

Let's not polute this channel with language wars.

opal plank
#

java isnt fun

#

objects in java is a pain

drifting wedge
crimson vapor
drifting wedge
earnest phoenix
#

every single language is bad

pale vessel
#

What's a joke?

opal plank
#

except scratch

solemn latch
#

Scratch op

crimson vapor
opal plank
#

scratch is the ultimate lang

crimson vapor
#

wait

pale vessel
#

Got em

crimson vapor
#

discord bot on scratch when?

#

im still waiting

opal plank
#

i think its been done

crimson vapor
#

has it?

opal plank
#

i believe so yes, i remember someone in DAPI mentioning it after i joked about it 2 months prior

drifting wedge
#

ok im naming my clusters! @oak cliff whats the first word sylvia said?

oak cliff
#

dada lol

drifting wedge
#

cluster name boutta be: mommy i pooped in the floor

opal plank
#

scratch is basically js btw

drifting wedge
#

ok clustername: "dada lol"

#

thanks

oak cliff
lost isle
crimson vapor
#

still same error?

lost isle
#

no

#

a different

#
Require stack:```
umbral zealot
#

yo seriously go learn js

crimson vapor
#

LMFAO

opal plank
umbral zealot
#

Stop expecting us to handhold you through making a bot

crimson vapor
#

I don't think anyone here means to be especially rude but you should at least know nodejs basics before this

opal plank
#

or go hire a coach

#

ยฏ_(ใƒ„)_/ยฏ

lost isle
earnest phoenix
umbral zealot
#

Oh trust me I mean to be rude and direct and authoritative because people sometimes need the tough love.

earnest phoenix
#

the webhook might work or wot

crimson vapor
#

oh nvm

#

I was wrong

opal plank
#

i doubt anyone here will have the patience to guide you throughout both learning js and making a discord bot

lost isle
#

i got it

#

it works now

drifting wedge
crimson vapor
sick fable
crimson vapor
lost isle
#

i frogto the /

#

xddd

crimson vapor
#

why did you need the /?

pale vessel
#

et

lost isle
#

idk

pale vessel
#

LMAO

crimson vapor
#

wrong answer

earnest phoenix
#

guys what its the webhook url if i host on glitch

opal plank
#

im blocking them

lost isle
#

who?

opal plank
#

enough seeing cringe vampires in chat

crimson vapor
#

the answer was supposed to be "because X"

umbral zealot
lost isle
opal plank
#

much cleaner chat now

crimson vapor
#

imo blocking someone just makes chat dirtier

earnest phoenix
#

ik u answered ands another one answered u both not same answer

crimson vapor
#

like how the blocked messages are displayed

opal plank
#

rather seeing that than the same person asking for the 12th time stuff they would know if they listened to what we are saying

crimson vapor
#

true

umbral zealot
#

https://your-url.glitch.me/dblwebhook was the answer from both people @earnest phoenix

#

that's the URL

#

with YOUR site name of course

#

And your web server must be setup to work with glitch itself

pale vessel
#

What did you say? Just copy and paste? Sure.

crimson vapor
#

honestly they need to learn about webhooks first

umbral zealot
#

this isn't about learning webhooks

opal plank
#

they already have a webhook running from what i got

umbral zealot
#

this is about understanding some basics of http and web servers and that's not really a "clear" path of learning

opal plank
#

they just dont know how to point to it

crimson vapor
#

idk python but thats where the error should be

opal plank
#

do you even haev access to ports on glitch?

#

or just path's?

crimson vapor
#

you have ports iirc

umbral zealot
#

@earnest phoenix you also need to adjust one line: app.listen(process.env.PORT); instead of app.listen(3000)

#

due to the glitch inner workings.

opal plank
#

https://your-url.glitch.me:3000/dblwebhook

#

shouldnt it be something like that?

umbral zealot
#

no no don't speciffy a port

#

it's not a public facing server

opal plank
#

oh i see

umbral zealot
#

it's bound to a specific port on http