#development

1 messages Β· Page 1008 of 1

earnest phoenix
#

I have aws

placid iron
#

Postgresql is just a database structure thing

finite bough
#

mongoose wrapper if u want to make life easier

placid iron
#

On heroku u can add a postgresql database to your app

earnest phoenix
#

Ok tmr I learn mongoose

restive furnace
#

my bot rn has mysql db xD

still merlin
#

wdym? .-.

placid iron
#

So it's online in that sense

restive furnace
#

i dont know is it worth of it to use mysql

placid iron
#

But you could install it onto your own machine

earnest phoenix
#

@restive furnace which hosting you have

#

πŸ€”

restive furnace
#

google cloud

earnest phoenix
#

My aws πŸ˜‚

restive furnace
#

my friend pays dblWink

earnest phoenix
#

1 year free trial

placid iron
#

For my raspberry pi I just use sqlite3

earnest phoenix
restive furnace
#

its soon over

wild ore
#

let perms = client.elevation(message);

#

error

#

pls help

#

me

restive furnace
#

also i dont think 2GB ram can hold my bot for long time more tho

earnest phoenix
#

@wild ore that's not a function

#
wild ore
#

okey

earnest phoenix
#

why does avast say discord.guide is not trustable

wild ore
#

what should I do

earnest phoenix
#

@slender thistle hey I have 1 questions is pepe emotes banned here

solemn latch
#

I dont know a discord.guide domain

restive furnace
#

bcs it doesnt exists

#

use discordjs.guide

earnest phoenix
#

Oh

#

Lol

slender thistle
#

NSFW, flashy, and other Discord ToS-breaking emotes are not allowed, the rest we don't care

earnest phoenix
#

That one my antivirus says isn't harmful but isn't trustable

pure saddle
#

its true?

earnest phoenix
restive furnace
#

512 is for 40 servers

slender thistle
#

oh God what

solemn latch
#

Depends on the library and amount of caching you do

pure saddle
#

hmm

restive furnace
#

if you go over 500 then i think its not

earnest phoenix
#

@pure saddle it will got till bot has 1 or 2k servers

restive furnace
#

also ^^^ (what woo said)

earnest phoenix
#

Maybe 1k

restive furnace
#

depends caching mostly

pure saddle
#

discord.js

earnest phoenix
#

Buy galaxygate

restive furnace
#

if you dont cache things, then it can prob hold even 2000+ guilds

solemn latch
#

^

restive furnace
#

(dont recommend tho)

solemn latch
#

A static bot that just responds scripted messages ram usage will always be really low

sterile vale
#

What is the prefix for the discord server list bot?

earnest phoenix
#

which is the best free bot hosting service that allows you to put custom clde because WHO CARES FOR BOTGHOST AND BOTBIND

#

@sterile vale why you need

placid iron
#

My bots in 135 servers and uses 40mb ramcry

solemn latch
#

My bot has a rendering program, that uses 300mb just to launch it. And 500mb when its used.

Just for an assisting program

restive furnace
#

@earnest phoenix get a friend who pays ur vps

solemn latch
sterile vale
#

Cause im using the bot for my server

hushed jungle
#

Is there a way I can view ram usage

#

I want to know but have no clue 😦

placid iron
#

Python?

earnest phoenix
#

@hushed jungle yea

solemn latch
#

My status command includes ram usave

#

Cpu usage

earnest phoenix
solemn latch
#

All the usages

restive furnace
#

even network one?

earnest phoenix
#

glitch is the fastest worst bot hosting service

solemn latch
#

I got rid of networking

#

But it was in and working

hushed jungle
#

@earnest phoenix how?

earnest phoenix
#

Btw i added an advertise command to my should probably put a cooldown on it but I DONT CARE

pure saddle
#

any good bot hosting service

earnest phoenix
#

Which libarary you use

hushed jungle
#

Discord.js

restive furnace
#

@pure saddle aws

#

(i use google cloud tho)

solemn latch
#

Galaxtgate is good vps hosting

restive furnace
#

^^ or contabo, actually any

solemn latch
#

I've heard bad things about contabo

stark abyss
#

how to set up so it does something when a user votes your bot

earnest phoenix
#

no minimodding right

#

i dont evem know what is and isn't considered minimodding

restive furnace
#

minimodding is allowed i guess tho

earnest phoenix
#

why

restive furnace
#

i dont know

solemn latch
#

Its not allowed

restive furnace
#

and im not sure

solemn latch
#

I've never seen someone get told not to tho

earnest phoenix
#

also can someone tell mehow i can get a mentioned user from a message and turn it into his id? i use ids for economy system to prevent with hunting (what does that even mean)

solemn latch
slender thistle
#

Generally minimodding is acceptable if you mean reminding someone of the rules/warning

solemn latch
#

^ I think it's more about dont constantly do it

earnest phoenix
#

Generally minimodding is acceptable if you mean reminding someone of the rules/warning
@slender thistle so saying "that belongs in #topgg-api" isn't minimodding right

#

please dont kill me

slender thistle
#

Not really, if there's no moderator then it's acceptable

earnest phoenix
#

Is my bot added in #commands ? Or will it be added after it has been verified?

slender thistle
#

The latter

earnest phoenix
#

realizes there are two testing channels

#

Shivaco when will mod application over

slender thistle
#

somedayℒ️

#

And please let's keep this channel on topic

earnest phoenix
#

Ok @_@

#

also we all should probably goto #general and purge our currenct messages wait shivaco i was about to say that

#

Mention.user.id
@solemn latch so will this work:

db.get(`userBalance_${message.mentions.user.id}.balance`
solemn latch
#

Mentions is a collectiob

#

Collection

earnest phoenix
#

why cant i type colored syntax mobile

hushed jungle
#

@earnest phoenix You know how I can get ram usage or not 😦

solemn latch
#

Message.mentions.first

earnest phoenix
#

I wanna get the id

#

Of the first mentioned user

#

If only i didn't make my bots code available to anyone then i can safely store usernames

solemn latch
#

.first gets the first mention

earnest phoenix
#

so

#

@hushed jungle I will tell tmr

#

@solemn latch message.mentions.users.id.first?

hushed jungle
#

What is tmr

solemn latch
#

Message.mentions.first

earnest phoenix
#

Tommorow

hushed jungle
#

πŸ€”

#

Oh okay just ping me then πŸ™‚

#

Also nice doge

earnest phoenix
#

@solemn latch message.mentions.users.id.first?
message.mentions.first returns normal users not their id

#

@slender thistle what heppen if I invited Luca bot to my server

slender thistle
#

nothing

earnest phoenix
solemn latch
earnest phoenix
#

@slender thistle it will left automatically?

#

lol

slender thistle
#

probably yes

#

but it won't work in your server

earnest phoenix
#

Lol

hot elbow
#

hi

earnest phoenix
#

why

#

Let me invite then

solemn latch
#

And putting first at the end doesnt make any sense

earnest phoenix
#

idk

solemn latch
#

Putting first on the collection does tho

pure lion
#

Suuuuup

hot elbow
#

how to i get Bot Dev. Perm

earnest phoenix
#

just wanna figure out how to get the id of the first mentioned user

pure lion
#

Wait

solemn latch
#

I just told you

#

4 times

earnest phoenix
#

no

solemn latch
earnest phoenix
#

you told mr hwo to get normal user with tag not id

pure lion
#

@earnest phoenix message.mentions.users.first().id

#

Jesus was it that hard

earnest phoenix
#

thx

solemn latch
#

No spoon feeding dice

pure lion
#

You're so thick

earnest phoenix
#

wo

pure lion
#

No spoon feeding dice
One off

solemn latch
#

I have him how to get the user, he knows how to get the ID from a user object

pure lion
#

I-

solemn latch
#

He woulda figured it out

pure lion
#

:o

#

He should have a long time ago

#

@earnest phoenix learn js uwu

misty sigil
#

@slender thistle it will left automatically?
@earnest phoenix what would actually happen
it's a private bot, you can't invite it

slender thistle
#

it used to be public

misty sigil
#

i tried to invite luca once

earnest phoenix
#

@misty sigil I can invite

misty sigil
#

no you cant

earnest phoenix
#

You have to put his id in invite link

misty sigil
#

its private

earnest phoenix
misty sigil
#

you cant invite with that

earnest phoenix
#

264811613708746752

#

Put this

#

And see

modern sable
#

you legit cant

#

but I guess you didnt try it

misty sigil
#

H M M

earnest phoenix
#

@modern sable how to make private

modern sable
misty sigil
#

ok

earnest phoenix
#

Oh

misty sigil
#

so, I have this function for findOne ping js async function dbping(guildID){ var timeNow = message.createdTimestamp await client.db.collection('prefixes').findOne({"g_id" : guildID}).then(date = Date.now) }and I have this for my findAll pingjs async function dbpingall(a){ var timeNow = message.createdTimestamp await client.db.collection('prefixes').findAll.then(allDate = Date.now) } The allDate var and date var return NaN and this is my init code for the date and allDatejs var date, allDate;

earnest phoenix
misty sigil
#

thatdidnothelpintheslightestlol

earnest phoenix
#

Can you add spaces

misty sigil
#

wdym

earnest phoenix
#

thatdidnothelpintheslightestlol
@misty sigil this text

misty sigil
#

ohnahsorryspacekeybro ke

earnest phoenix
#

Seriously you lieing

misty sigil
#

you missed the joke lol

earnest phoenix
#

How can you code then

hidden lynx
#

How can i create a new role and add that role to my bot? The docs didn't help :/

misty sigil
#

you dont need a new role

#

the role gets made automatically

#

with the oauth perms

#

that you decide when making your link

pure saddle
#

its good for dc bot hosting?

quartz kindle
#

thats hella cheap

#

which company is it?

pure saddle
#

wait

#

ohh

#

its multiserver not vps

earnest phoenix
hidden lynx
#

Is creating new roles possible in code as well tho? (discord.js)

quartz kindle
#

still, whats the company?

pure saddle
#

witherhosting

earnest phoenix
#

@hidden lynx yes

hidden lynx
#

how?

earnest phoenix
#

guild.rolecreate

#
#

It is createrole

#

Maybe

#

I forgot

quartz kindle
#

roles.create lol

earnest phoenix
#

Omg

hidden lynx
#
let role = message.guild.roles.find((role) => role.name === "lol");
  if (!role) {
    try {
      role = await message.guild.createRole({
        name: "lol",
        color: "#fff",
        permissions: [],
      });

      client.addRole(role);
    } catch (error) {}
  }

thats what i have so far

earnest phoenix
#

Try

quartz kindle
#

are you using v12 or v11?

#

that code looks like v11

hidden lynx
#

It says find() is not a function. I'm being kinda dumb rn

#

possible

#

im using v12

quartz kindle
#

ah then you're using v12

#

in v12 there are caches

#

guild.roles.cache.find()

earnest phoenix
#

Yup

quartz kindle
#

and to create its guild.roles.create()

earnest phoenix
hidden lynx
#
let role = message.guild.roles.cache.find((role) => role.name === "lol");
  if (!role) {
    try {
      role = await message.guild.roles.create({
        name: "lol",
        color: "#fff",
        permissions: [],
      });

      client.addRole(role);
    } catch (error) {}
  }

it says that guild is not defined

#

I hope i did that correctly with the cache

quartz kindle
#

guild is not defined?

#

or cannot read guild of undefined?

hidden lynx
#

no, it says its really not defined

quartz kindle
#

then you're using guild somewhere

#

not in that code

hidden lynx
#

omg guys im fucking stupid

#

the code snippet i showed you was from a node module. the error came from the index file

pure saddle
#

ummmmm

quartz kindle
#

thats the multiserver thingy??

pure saddle
#

no

#

discord bot hosting

solemn latch
#

I think you've asked this question like 5 times now

#

And gotten pretty decent answers

pure saddle
#

yes

#

he say its enough

solemn latch
#

It may be enough, depending on your bot

#

And how many servers you want to handle

quartz kindle
#

depends on a lot of things

#

a bot on 1000 servers can use 100mb ram or use 1gb ram

#

depending on language, library, code, optimizations, requirements, caching, etc

earnest phoenix
slender thistle
#

bad description declined

earnest phoenix
#

Boi

copper cradle
#

yeah that desc will probably get your bot denied

misty sigil
#

so, I have this function for findOne ping js async function dbping(guildID){ var timeNow = message.createdTimestamp await client.db.collection('prefixes').findOne({"g_id" : guildID}).then(date = Date.now) }and I have this for my findAll pingjs async function dbpingall(a){ var timeNow = message.createdTimestamp await client.db.collection('prefixes').findAll.then(allDate = Date.now) } The allDate var and date var return NaN and this is my init code for the date and allDatejs var date, allDate;

#

but it returns NaN

#

unless im doing something wrong

copper cradle
#

this is not the fix, but, findAll is a function, therefore needs (), so, findAll().then...

misty sigil
#

ohwait

#

maybe it needs an entry?

copper cradle
#

no

#

just add ()

misty sigil
#

yea i did

copper cradle
#

ok

misty sigil
#

still returning NaN for both

#

help

sudden geyser
#

You can't do assignment like that in the .then method call.

misty sigil
#

ill just split line

lusty quest
#

is Manage_Messages needed for Editing non Cached Messages? (Editing them after the bot got Restarted)

misty sigil
#

nah

#

im sure you can just edit it if it's from the bot

blazing portal
#

You probably need the READ_MESSAGE_HISTORY perm instead

misty sigil
#

thatTHIS6

signal oracle
#

Does anyone have any suggestions on how to rate limit / throttle commands? I want to globally limit / lock up the bot and wait for a command to finish executing before letting new commands be entered. I looked at discord.js commando and I'm not crazy about it. Are there any other suggestions or best practices?

plucky harness
#

how much time does it takes for a server vps to activate?

misty sigil
#

no idea

solemn latch
#

thats a question for your host

misty sigil
#

depends on host

#

not us

plucky harness
#

i c

blazing portal
#

Do you want to rate limit the command per person/guild or in total?

misty sigil
#

per person

#

i think

signal oracle
#

for everyone in the entire server

#

Basically its a really wonky api call I wan't to let finish before anyone does anything else.

solemn latch
#

youd have to make a cooldown collection per guild

misty sigil
#

i just let my wonky api call

#

and no thing like that

#

it loads with time

signal oracle
#

@plucky harness You might want to take a look at caprover for hosting, might save you some money.

blazing portal
#

Well in that case you could just have a Collection/Map/Array, where you save the guild id, and delete it with a timeout, then before executing that command check if the guildid is in there

unique nimbus
#

I think they already have a VPS

#

or have an idea

misty sigil
#

how do i use a vps

unique nimbus
#

you pay for one

solemn latch
#

buy it, then use it

unique nimbus
#

and SSH into it

solemn latch
misty sigil
#

huh

#

no shit sherlock

unique nimbus
#

ye

solemn latch
#

lol

misty sigil
#

still working on mongo ping

earnest phoenix
lusty quest
#

limit is 100

earnest phoenix
#

how do i make it say the actual amount of messages that have been deleted

#

and not the amount i typed

misty sigil
#

pass in the args

earnest phoenix
#

wym

#
@client.command()
async def clear(ctx, amount=0):
    await ctx.channel.purge(limit=amount)
    await ctx.send(f'I Have Cleared **{amount}** Messages!', delete_after=5)```
sudden geyser
#

I believe ctx.channel.purge returns a list of messages that were deleted.

#

So you could count how many messages were deleted.

stable nimbus
#

So I'm having an issue that doesn't produce an error, I have a block of code thats running when I provide different arguments and I don't know whats wrong.

else if(!user.mentions){
            const embed = new MessageEmbed()
            .setTitle(":warning: Error in: User Mentions :warning:")
            .setColor(0xFFD700)
            .setDescription('Hey ' + `<@${message.author.id}>` + '! You need to mention someone for me to work! Not just provide arguments!')
            .setFooter(copyright.copyright);
            message.delete();
            message.channel.send("Hey " + `<@${message.author.id}>` + '!', embed);
        }
        else if(user.bot){
            const embed = new MessageEmbed()
            .setTitle(':warning: Error in: User Mentions :warning:')
            .setColor(0xFFD700)
            .setDescription('Hey ' + `<@${message.author.id}>` + '! You shouldn\'t mention a bot! Not as much fun huh?')
            .setFooter(copyright.copyright);
            console.log(user.mentions)
            message.delete();
            message.channel.send('Hey ' + `<@${message.author.id}>` + '!', embed);
        }
        else{
            const embed = new MessageEmbed()
            .setTitle('The Tow!')
            .setColor(0xFF0000)
            .setDescription(`<@${message.author.id}>` + ' is towing ' + `<@${member.id}>` + '\'s car!')
            .addField('The Car Is: ', `<@${member.id}>` + '\'s ' + vehicle)
            .setFooter(copyright.copyright);
            message.delete();
            message.channel.send('Hey ' + `<@${message.author.id}>` + ', ' + `<@${member.id}>` + '!', embed);
        };```
Blocks that don't work
#

Block two triggers when I mention a bot, and when I do the command correctly.

merry grove
#

Two of my webhooks send [object Object]

digital ibex
#

its an object

misty sigil
#

i wonder if i could subdomain

#

anyways, this is my code for pinging, it still returns NaN js async function dbping(guildID){ t0 = Date.now await client.db.collection('prefixes').findOne({"g_id" : guildID}) t1 = Date.now - t0 t2 = Date.now await client.db.collection('prefixes').findAll t3 = Date.now - t2 }

opal plank
#

my turn to ask a question, is this possible?

#

on index.js

if (command === 'reload')
    client.commands.get('reload').execute(this.params);

on reload.js

module.exports = {
params = message, client, fs, Discord, config
async execute(params) {
//...
}```
#

passing params onto module.exports and executing them on index?

misty sigil
#

i think it would be

pale vessel
#

wouldn't you need to define the params directly like a function

opal plank
#

im not sure tbh

#

also, Date.now()@misty sigil

misty sigil
#

oh god thats a function

pure lion
#

Suuup

misty sigil
#

find one is returning 0 ping

#

wHAT

opal plank
#

why you pinging inside the func?

misty sigil
#

wait no im dumb

opal plank
#

actually, nvm, i can see why'd want it

misty sigil
#

hmm

#

findAll still returns 0

#

oop nope im just an idiot

#

oop nope that didn't work

opal plank
#

if someone knows the awnser for my question, lemme know, i cant use my pc rn to try it

empty owl
#

from Object.entries how would you get the value of a certain array inside the array

digital ibex
#

@misty sigil you can just do .find()

quartz kindle
#

Object.entries returns a multidimensional array, like this: [[key1,value1],[key2,value2],[key3,value3]]

#

you should be able to use any array functions on it, such as .find .filter .reduce etc

misty sigil
#

K

quartz kindle
#

@opal plank nope you cant do that

#

but you can do this

opal plank
#

figured, thank you, gotta tell the guy who asked me that that i was wrong

#

i may have told them you should be able to do it

#

also, do what?

quartz kindle
#
module.exports = ({message,client,fs}) => {
  // do stuff
}
#

and call it with myfunc(object)

#

if object contains those properties

opal plank
#

hmmm thats actually a good way

#

ty Tim

pure lion
#

Bsbsbsbsbsbsbs

misty sigil
#

@misty sigil you can just do .find()
@digital ibex still returns 0

digital ibex
#

then you don't have any data in ur db

#

in that collection anyways

misty sigil
#

i swear i do

digital ibex
#

whats the collection name?

misty sigil
#

prefixes

modest maple
#

low key could just use the guild id as the primary key

#

but yes

digital ibex
#

oh, u shouldn't make collections for every thing btw.. its just gonna take up a lot of storage and idk about ram, prob

#

if u do whatever.findOne({ g_id: message.channel.guild.id }); what does that return?

misty sigil
#

i dont store anything but prefix

#

hold up ill just eval that

zinc condor
#

alright so

#

i need to get the guildcount before any shards are started

#

how would i do this

misty sigil
#

findOne works

zinc condor
#

am using DiscordGo but im assuming its the same in most libs or theres a web thing to get it

balmy knoll
misty sigil
#

wait i never use findall

#

why does this matter

torn nebula
#

can i still use raw event...

timber linden
#

help

#

const client = new Discord.Client(TEST);

#

what do i put inn

#

what do i put after discord.client

modest tangle
#

Can someone help me to advertise my server on the website?

timber linden
#

help me'

#

first

warm marsh
#

It needs client options

timber linden
#
``` what do i put in
#

oh

warm marsh
#

Although they're optional.

#

You can read about them on the docs.

#
timber linden
#

i used discord.js

sudden geyser
timber linden
#

the script to make the bot on

#

o

sudden geyser
#

Look at the example on the front page

timber linden
#

so what do i put on it to make it on

#

oh nvm kk

#

objects

modest tangle
#

Would you like to help me to pls?

warm marsh
#

You just go to the website and follow the instructions.

timber linden
#

wait so i can put nothing in it?

blazing portal
#

yes

#

as Dillon said, they're optional

timber linden
#

ok.

#

imma remove the script actually

#

weird doesnt work

blazing portal
#

don't post your token ytho

timber linden
#

omg

#

i just notice

blazing portal
#

now the first thing you want to do is regenerate it

tribal rock
#

reset your token

timber linden
#

i regenerate it

#

dont worry

#

why tf am i dumb

torn ravine
#

anyone that works with ererla think they can help me? I get the ERRCONNREFUSED message

timber linden
#

i removed the token now tell me whats wrong πŸ™‚

#

i cahnge a few letters

blazing portal
#

what isnt' working

timber linden
#

when i try to run it

#

it logins

#

as a different

#

username

blazing portal
#

what

#

double check your token?

timber linden
#

before i change the token

ebon kelp
#

@timber linden Maybe I can help

timber linden
#

i tested it before i showed you it

ebon kelp
#

waddup

timber linden
#

just now

ebon kelp
timber linden
#

ik the problem

#

at the top

#

traumaticmushycalcuator

#

it says thats the "NAME"

#

of the bot

ebon kelp
#

And the import of the depency should be before all

timber linden
#

const client = new Discord.Client();

#

i removed that

#

since it was "optional"

blazing portal
#

no

ebon kelp
#

That's now how that works

blazing portal
#

the options are optional

timber linden
#

oh

#

ok i added it back

#

but imma put in

#

Object

#

ok

#

heres the problem

#

"name": "TraumaticMushyCalculator",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"discord.js": "^12.2.0"

ebon kelp
#
const { Client } = require('discord.js');
const client = new Client();

client.on('ready', () => {
  //CODE
});

client.on('message', message => {
  //CODE
});

client.login(TOKEN);
timber linden
#

i use js

ebon kelp
#

That's js

timber linden
#

make a new login

ebon kelp
#

Nonono

timber linden
#

oh

#

u added token

#

so i remove that login

#

and make a new one?

blazing portal
#

well since you showed yours, yes you make a new one. but he said "TOKEN" because that's what you have to replace with your own token

#

Without showing it to us!

timber linden
#

yes

#

ik

#

i showed my password than changed it

ebon kelp
#

Well it's not your password

#

It's the bot password

timber linden
#

yes

#

ugh

#

for some reason

#

when i try to run

ebon kelp
#

You should run it local

#

Not from a website

#

idk what that site is

timber linden
#

basically

#

it makes the script than runs it on node

ebon kelp
#

I think is better to first learn JS before you start using NPM dependecies

timber linden
#

i only know some

#

ive learned for like 3 days and im trying to make a test bot

#

so i know how to make it online

ebon kelp
#

btw a token has to be a string

#

Not a variable name

livid rivet
#

dammit

#

I can still see the tojen

#

@ebon kelp

ebon kelp
#

I know

#

Hahahaha

#

He's running it from a site

#

Where everyone can edit it

timber linden
#

ik

#

thats my old token

#

yes you can edit it

#

everyone can

livid rivet
#

lmao

ebon kelp
#

mr gonna steal ya token

livid rivet
#

then why did you even bother with the red line

#

either block it out 100% or show me

ebon kelp
#

process.env.DISCORD_TOKEN peepoLaugh

timber linden
#

im alloweing everyone to edit it

blazing portal
#

but why

livid rivet
#

and also having a token in public is not what a token is supposed to do

timber linden
#

making a discord bot but everyone can edit it

livid rivet
#

it's literally the exact opposite

timber linden
#

i changed the token

#

already

blazing portal
#

if you give me the password to your real account i can help edit that too pogey

livid rivet
#

well have fun until the griefers arrive

timber linden
#

FEEL FREE TO EDIT IT

#

FEEL FREE TO EDIT IT

livid rivet
ebon kelp
livid rivet
#

this is you --> 🀑

timber linden
#

idc

#

this might be a yt vid if ppl actually edit it

livid rivet
#

lemme try some js

ebon kelp
timber linden
#

when it gets on

#

it says hi

#

no ones editing it

#

wo

#

w

blazing portal
#

can you please stop spamming?

timber linden
#

ok.

ebon kelp
#

Lemme help you out

#

can I edit?

timber linden
#

yes

#

everyone has access to edit it

#
#

no this is it

#

to join me and code it

ebon kelp
#

Coding without linting

#

yikes

timber linden
#

sometimes i wonder what im doing with life

ebon kelp
#

So

#

@timber linden

timber linden
#

yes

#

o

ebon kelp
#

You can use if-else statements, but I used switch for now

timber linden
#

imma make a other code because ppl can already edit my other

#

one

ebon kelp
#

Please go local

timber linden
#

wait

#

it still works

#

THE BOT IS ONLINE

#

nvm gotcha

ebon kelp
#

It didn't work?

#

What's the error?

timber linden
#

it says no

#

i think i forgot

#

the numbers

#

for the username

#

/home/runner/betterantispam-V-7683
client.on('ready', (how are you) => {
^^^

SyntaxError: Unexpected identifier

ebon kelp
#

Where do you run it?

timber linden
#

in node.js

#

it rusn on node

ebon kelp
#

Where in the code

timber linden
#

at the side

ebon kelp
#

and remove "How are you"

timber linden
#

at the top it says run

#

and at the top it runs in NODe

ebon kelp
#

at the side
@timber linden NPCMechanicFacepalm

timber linden
#

it runs it in node.

#

by at the side

#

i mean thats where node is

#

but at the top yoou press run to run it in node

ebon kelp
#

Please follow a tutorial online

#

Follow {TheSourceCode}'s tutorial

timber linden
#

wait

#

i think the bot is actually on

#

nothing

blazing portal
#

what do you mean with custom timers?

#

setInterval

#

if you're using js

#

np

ebon kelp
#

There's a thing called Stacksoverflow

#

It's very useful ;) For those kind of questions

pallid silo
#

I’m finally almost done 😭

strange trout
#

I'd use cron for longer periods

blazing portal
#

why?

long yew
#

so when someone writes .spawn it spawns a pokemon
but when they write .catch it catches the most recent pokemon spawned on the whole bot but i want it so it only catches the pokemon in the channel it was spawned in
probably something to do with this

ebon kelp
#

if-if-if-if-if-if

#

nesting is fun

solemn latch
#

you want to store that data

ebon kelp
#

Let's see

solemn latch
#

just use join

ebon kelp
#

You can use args.join(" ") instead of a for-loop

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

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

    if(command=="ping"){
        message.channel.send("You pinged Azul, now Azul pongs you!")
    } else if(command=="say"){
        message.channel.send(`${message.author.username}#${message.author.discriminator} said: ${args.join(" ")}, Arguments passed: ${args}`)
    }
})
#

args has the command in it tho

#

nvm (.shift())

tame shuttle
#

@earnest phoenix btw the issue with your code (doing it you way) was using for in rather than for of.

#

for in was looping over the keys (0 and 1)

ebon kelp
#

${message.author.username}#${message.author.discriminator} -> ${message.author.tag} (No ping) or ${message.author.toString()} (Ping)

@earnest phoenix

earnest phoenix
#

Where can I contact someone about not being able to connect to api as cloudflare is blocking it?

analog roost
#

It thinks your bots sus

#

That’s just it I recommend waiting and trying again later

ebon kelp
#

Where can I contact someone about not being able to connect to api as cloudflare is blocking it?
@earnest phoenix #topgg-api

earnest phoenix
#

@ebon kelp I ask in there and I dont get a response about it

ebon kelp
#

Can I see the code?

#

Never used the Discord Bot List api but maybe I can find it

earnest phoenix
#

I know it's working as I put the token on my tester bot hours ago to make sure it was posting stats then changed it back and put it on my main bot

coral palm
#

I have a error here, i can resolve,
so, I'm trying to make a command that would be more or less "+ list (role)" and the bot would make a list of all the members that had the role mentioned and send it on the channel!
I tried with the for cycle but it also gives an error! I do not know what else to do.

signal vortex
#

Filter the guild#members collection, removing any member that has not got the role. Then work with what's left, such as using the map method or size property depending on what you want to do

#

That's not how you use for(), you need to pass arguments inside those parentheses

coral palm
#

That's not how you use for(), you need to pass arguments inside those parentheses
@signal vortex yeah i know ahaha

#

I had erased because it gave an error and I ended up taking the print with nothing inside

signal vortex
#

It's gonna give an error when you remove all arguments too

#

But you don't need to run a for loop

#

You can tho

#

It's one way

#

If you're to do so, iterate through the collection and check if each individual GuildMember has the role

coral palm
#

Exactly

#

I do that

#

But it didn't work very well

vivid ravine
#
Error: input stream: Status code: 429
#

pls help

solemn latch
#

Whats your code

compact echo
#

CODE

signal vortex
vivid ravine
#

thats my code

signal vortex
#

Was a retry-after header given?

digital ibex
#

you've most likely been temporarily banned, just wait for like an hour or something

signal vortex
#

Not banned, ratelimited

vivid ravine
#

how long?

digital ibex
#

hm, im having a small issue.. if anyone knows.. js app.get('/chat', async (req, res) => { res.render('chat'); }); why am i going to mywebsite.com/chat and uh

#

its saying in the console i went to the 404 page.. it doesn't redirect me to it just says i went to the 404 page for some reason

coral palm
#

guys

#

help me here

#

i try to put only 20px / 30 px

#

doesnt work

winter basalt
#

describe what you're trying to do

coral palm
#

i want to put the text

#

here

prime cliff
#

Use margin-left: 5px; or change it to -5px and increase those values to see which one sticks

coral palm
#

ok

#

the text doesnt move

#

@prime cliff

#

Ok

#

i did it

#

thank you guys

#

Whats wrong in the code?

#

'-'

#

It is not to be like this : /

cobalt dagger
#

@coral palm nothing I see of-

#

But I wouldn't know-

prime cliff
#

Dang that's nice

coral palm
#

Dang that's nice
@prime cliff its bug

#

It is not to be like this

prime cliff
#

Still you're doing pretty well

#

Css is not that easy to get fully right

sudden chasm
#

Was wondering if anyone knows how to use youtubes data api to pull subscriber counts via nodejs? please contact me as ive been trying to figure this thing out for 2 weeks. Cant find anything on StackOverflow, Thanks in advance.

solemn latch
#

youtubes api is pretty straightforward

#

channel.statistics.subscriberCount

#

@sudden chasm

#

actually, the very first result on google has a library for getting channel data

delicate shore
#

I bought Google VPS

#

How to use it

#

I wanna move from glitch

#

To that

solemn latch
#

Move your files over, install dependencies, run your code

earnest phoenix
#

How to make a command vote only feature

solemn latch
#

Thats in the docs

hazy sparrow
#

this should send " 🎲 | rolled a (number)
but it sends

🎲 | rolled a **(number)

#

it just cancels the last two **

#

how can i fix this

solemn latch
#

It makes reading strings so much easier

#

Your issue is your closing parenthesis early

hazy sparrow
#

fixed it thanks

solemn latch
#

I would look into template literals. It really makes things easier

earnest phoenix
#

help me

#

Does anyone know HTML Coding that can help me?

summer torrent
#

just ask

earnest phoenix
#

Well

#

and

#

Idk HTML

#

lol

#

I have my developers do it.

#

but

#

they are working on my bots, they also dont know HTML

#

So

#

I need help

#

So

#

if you know HTML DM me

summer torrent
earnest phoenix
#

Like

#

Whatever its called.

#

Web-page

#

Idfk

eager citrus
#

Can somone help me get my bot online but I’m on mobile

earnest phoenix
#

so

eager citrus
#

Can somone help me get my bot to be online

earnest phoenix
#

host??

eager citrus
#

What

earnest phoenix
#

nothing

#
2020-07-01T04:02:29.125128+00:00 app[worker.1]:     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
2020-07-01T04:02:29.125129+00:00 app[worker.1]:     at Function.Module._load (internal/modules/cjs/loader.js:475:25)
2020-07-01T04:02:29.125129+00:00 app[worker.1]:     at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
2020-07-01T04:02:29.125129+00:00 app[worker.1]:     at startup (internal/bootstrap/node.js:201:19)
2020-07-01T04:02:29.125130+00:00 app[worker.1]:     at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
2020-07-01T04:02:29.181494+00:00 heroku[worker.1]: Process exited with status 1
2020-07-01T04:02:29.223278+00:00 heroku[worker.1]: State changed from up to crashed```
#

any buddy help plz

solemn latch
earnest phoenix
#

heroku

solemn latch
#

For some reason, I have a hard time with heroku errors

earnest phoenix
lusty quest
#

looks like it cant find a file

earnest phoenix
#

which

lusty quest
#

read the error

earnest phoenix
lusty quest
#

it litteraly say what file is missing in the first line

#

even the path where the file is expected

earnest phoenix
#

.env

lusty quest
#

how tf did you think its a .env file when it expects a .js?

solemn latch
#

It doesn't even say .env anywhere does it

earnest phoenix
#

so

#

@lusty quest solution??thonkku

lusty quest
#

find out how to read the error and fix it

earnest phoenix
lusty quest
#

we are not here for debugging your code. And the ability to debug your own code is mandatory

earnest phoenix
#

ok

#

sorry for this

lusty quest
#

i gave you some pointers the rest is by you

earnest phoenix
lusty quest
#

you have somewhere a file that requires("app/index.js") find it and fix it

solemn latch
#

Are your commits all named like that?

#

Maybe I just take naming commits too seriously CBPikaThink

#

It helps to make your commits describe the changes, not the name of the file updated(that's already part of it).

sudden chasm
#

yeah so im a bit new and im using a pebblehost node to host my bot, I was wondering how to store the channel.statistics.subscriberCount
pulled from YouTube's API? damn i know so little

#

check package.json @earnest phoenix , sometimes that contains what your main / index file is

lusty quest
#

use a database

sudden chasm
#

if there a way to store it in a local directory?

lusty quest
#

there are different types, from sqlite over sql to no-sql

sudden chasm
#

or make it log into FTP?

lusty quest
#

you could use a json db but they are unreliable and corrupt easy

restive pebble
#

fs

sudden chasm
#

ok thanks

earnest phoenix
#

@sudden chasm { "name": "HAPPY", "version": "0.0.1a", "description": "Moderation bot", "main": "mainbot.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "node index.js" },

restive pebble
#

u using heroku?

sudden chasm
#

look for mainbot.js

#

i guess

#

im using pebblehost bot hosting

earnest phoenix
#

edit?

lusty quest
#

if you dont want to have external stuff i suggest having a SQlite DB would be the best solution for you RN. but the downside is if you want to have many users /servers it can cause issutes

sudden chasm
#

its just going to be in 1 server

lusty quest
#

then SQLite is fine

sudden chasm
#

ty

lusty quest
#

if you use node.js look into Enmap or quick.db

sudden chasm
#

will do

lusty quest
#

enmap works like Discord Collections but with persistant data

earnest phoenix
#

@sudden chasm mainbot.js edit??

restive pebble
#

what is ur problem

sudden chasm
#

@earnest phoenix cmon do ur own work, you'll learn more by not making us write all your code for you

#

in fact you'll learn so much you can do it independently next time as well

earnest phoenix
#

@restive pebble 2020-07-01T04:02:29.125127+00:00 app[worker.1]: Error: Cannot find module '/app/package.js' 2020-07-01T04:02:29.125128+00:00 app[worker.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15) 2020-07-01T04:02:29.125129+00:00 app[worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:475:25) 2020-07-01T04:02:29.125129+00:00 app[worker.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:695:10) 2020-07-01T04:02:29.125129+00:00 app[worker.1]: at startup (internal/bootstrap/node.js:201:19) 2020-07-01T04:02:29.125130+00:00 app[worker.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3) 2020-07-01T04:02:29.181494+00:00 heroku[worker.1]: Process exited with status 1 2020-07-01T04:02:29.223278+00:00 heroku[worker.1]: State changed from up to crashed

restive pebble
sudden chasm
#

damn boeing going hard

earnest phoenix
#

@restive pebble tik tok is app

sudden chasm
#

ban in india

restive pebble
#

ik

sudden chasm
#

yes we know

restive pebble
#

oh

#

lol

sudden chasm
#

it got banned in india the other day

earnest phoenix
#

chienes app

sudden chasm
#

omg

earnest phoenix
#

chaines corona

restive pebble
earnest phoenix
#

πŸ˜‚

sudden chasm
#

that insults me so much im literally chinese

restive pebble
#

global server

sudden chasm
#

f u

earnest phoenix
#

corona

sudden chasm
#

racist

earnest phoenix
#

@restive pebble my issue see

restive pebble
#

yes

#

where u requiring that

earnest phoenix
#

solutionweirdsip

restive pebble
#

idk

earnest phoenix
#

lol

restive pebble
#

u modified discord.js?

#

temoporary solution is that make a package.js

#

file

#

empty

earnest phoenix
#

seee

#

@restive pebble bruh

restive pebble
#

it says .js

#

not json

solemn latch
#

Your requiring js

earnest phoenix
#

"discord.js": "^11.5.0",

#

i am right??

#

version is 11.5.0

restive pebble
#

yes

#

v12 is latest

sudden chasm
#

by now im just wondering if i can make my bot use FTP to store files instead what

restive pebble
#

yes

#

u can try

#

its a transfer protocol

sudden chasm
#

this is going to fill up that 1g hard drive so fast but lets try it

#

i found it

solemn latch
#

Your trying to store just sub counts? With ftp?

lusty quest
#

i would still use a Database. its way more efficent

#

even if it would be a Json DB

solemn latch
#

^

#

Ftp is more of a file transfer thing.
Its probably the worst way to do what you want

sudden chasm
#

just a plain txt with sub counts

#

that i can request from

lusty quest
#

use fs

eager citrus
#

Try that bot

pale vessel
#

sure

#

@west raptor

eager citrus
#

What

west raptor
#

??

#

I'm confused

#

what's happening

eager citrus
#

Ikr

#

Idk

west raptor
#

@pale vessel

#

oh

#

is there any context to the invite

eager citrus
#

Your asking me?

west raptor
#

sure

eager citrus
#

It’s a discord bot that is a utililty

west raptor
#

why did you send the invite

eager citrus
#

Am I allowed to?

pale vessel
#

yikes

west raptor
#

no not really without context

plucky harness
#

Vps is asking me for a host name what type of name should i give?

eager citrus
#

If I’m not I will taken it down p

west raptor
#

I'm on mobile rn

#

first and final warning

eager citrus
#

Okay

plucky harness
earnest phoenix
pale vessel
#

and?

earnest phoenix
#

nothing

pale vessel
#

cool man

earnest phoenix
#

video is end say

plucky harness
#

Vps is asking me for a host name what type of name should i give?

earnest phoenix
plucky harness
earnest phoenix
#

F

plucky harness
pale vessel
#

you okay mate

plucky harness
#

Help me lol

#

I asked a question above

restive pebble
#

link pls

pale vessel
#

you can put your domain or subdomain as your hostname

restive pebble
#

ur choice

pale vessel
#

just anything will do

restive pebble
#

yea

#

lol

plucky harness
pale vessel
#

yes

plucky harness
#

Ty

eager citrus
#

Does anyone know how to do a moderation script for a bot

hazy sparrow
#
module.exports = {
    name: 'kick',
    description: "this is a kick command. only people with kck permissions can use this",
    execute(message, args){
        if (msg.member.hasPermission("KICK_MEMBERS") {
            if (msg.members.mentions.first()) {
                try {
                    msg.members.mentions.first().kick();
                } catch {
                    msg.reply("I do not have permissions to kick " + msg.members.mentions.first());
            }else {
                msg.reply("You do not have permissions to kick " + msg.members.mentions.first());
        } 
     }
 }

it says theres an error in the else statement.

#

how to fix this?

wheat hornet
#

space

#

} else

hazy sparrow
#

didnt work

wheat hornet
#

what is the error exactly

hazy sparrow
#

fixed the top and bottom problem. the code is now like this

const newLocal = module.exports = {
    name: 'kick',
    description: "this is a kick command. only people with kick permissions can use this",
    execute() {
        if (msg.member.hasPermission("KICK_MEMBERS")) {
            if (msg.members.mentions.first()) {
                try {
                    msg.members.mentions.first().kick();
                }
                catch {
                    msg.reply(`I do not have permissions to kick ${msg.members.mentions.first()}`);
                }
            }
            else {
                msg.reply(`You do not have permissions to kick ${msg.members.mentions.first()}`);
            }
        }
    }
};
wheat hornet
#

nice

hazy sparrow
#

is it all good now?

wheat hornet
#

why }; at last tho

hazy sparrow
#

it says } expected

delicate shore
#

2 more to go

wheat hornet
#

@hazy sparrow is the code running or giving errors

hazy sparrow
#

actually nvm i removed the ;

#

running

wheat hornet
#

good

hazy sparrow
#

but wen i try the command its not kicking

pure saddle
#

message

restive pebble
#

msg is not defined

hazy sparrow
restive pebble
#

how u defined message

earnest phoenix
#

D-PROFILE

#

d-profile

#

de-profile

#

E

restive pebble
#

U ok?

earnest phoenix
#

@void zenith

#

hmm

#

de-help

#

huh

restive pebble
earnest phoenix
#

tf

#

uh shit

#

my bad

restive pebble
#

dude

hazy sparrow
#
const Discord = require("discord.js");

const client = new Discord.Client();

const fs = require('fs');

const prefix = ("bow");

client.commands = new Discord.Collection();

const commandFiles = fs.readdirSync(`./Commands/`)
for(const file of commandFiles){
    const command = require(`./commands/${file}`);

    const name = file.split('.')[0];
    client.commands.set(name, command);
  }

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

client.on("message", (message) => {
  if (!message.content.startsWith(prefix) || message.author.bot) return;
  if (!message.content.startsWith(prefix)) return;
 
    if (message.content.startsWith(`${prefix} ping`)) {
           client.commands.get('ping').execute(message);
  
  } else
     if (message.content.startsWith(prefix + " foo")) {
           client.commands.get('foo').execute(message);
  
  } else 
     if(message.content.startsWith(`${prefix} roll`)) {
      client.commands.get('roll').execute(message);
  } else 
     if (message.content.startsWith(`${prefix} invite`)) {
      client.commands.get('invite').execute(message);
  
  }  else
     if (message.content.startsWith(`${prefix} help`)) {
      client.commands.get('help').execute(message);
  
  }  else 
      if (message.content.startsWith(`${prefix} user-info`)) {
      client.commands.get('userinfo').execute(message); 
  
  } else
      if (message.content.startsWith(`${prefix} server-info`)) {
      client.commands.get('serverinfo').execute(message); 
  
  } 


}) 

  
  

      



client.login()
#

it says client is not defined

surreal sage
#

Could someone help me with packaging a electron project? When i export and run the setup stops at around 30% and if i run the file generated by the command used to run it will load index.js but not index.html

wheat hornet
#

it says client is not defined
@hazy sparrow than set client

delicate shore
#

const swearWords = ['N word here']
 if(swearWords.some(word => msg.content.includes(word)) ) {
   
   let personlol = msg.author()
   msg.delete()
 msg.channel.send(`${personlol} just said N word`);} ```
#

what is wrong here\

sinful belfry
#

what error are you getting?

delicate shore
#

it is not sending message

#

saying that @granite pagoda just said the n word

sinful belfry
#

the message has been deleted

delicate shore
#

no

#

if i use $person

#

it doesnt not do anytging

#

if i jjst write OMG U SAID N WORD

#

then it works

earnest phoenix
#

fm

sinful belfry
#

is the message deleted though?

delicate shore
#

depends

#

in the code above

#

it doesn not

#

but if i remove $person

#

thn it does

#

so?

sinful belfry
#

so the issue is that the message doesn't send?

delicate shore
#

yes

sinful belfry
#

you should delete the message after you send the message

delicate shore
#

let personlol = msg.author()

#

is this correct

#

btw

sinful belfry
#

yeah, i am pretty sure you can just provide the user object to @mention someone

delicate shore
#

ok

#

so

#

it worked

#

thanks

sinful belfry
#

awesome

delicate shore
#

the issue was

#

i had done msg.author()

#

but it was msg.author

#

thanks

sinful belfry
#

oh yeah

#

lmao

coarse hearth
#

can someone teach me how to do pagiant embeds / embed pages with emojis

spare mirage
#

embeds with emojis?

#

@coarse hearth

coarse hearth
#

yea

#

im really bad

#

i watched yt