#development

1 messages · Page 792 of 1

quartz kindle
#

there are a few third party dashboards you can try using

mystic violet
#

like Compass?

quartz kindle
#

unless youre using atlas

#

yup

mystic violet
#

I have compass, but idk how to open the dashboard

quartz kindle
#

you open compass and connect to your mongodb

#

via ip port username and password

mystic violet
#

I never set a username and password

#

lmao im so confused

#

Im used to sqlite sorry if im stupid

quartz kindle
mystic violet
#

do you know the default username and password? I know the host and port

quartz kindle
#

i believe mongodb doesnt have a default password, you need to configure one in the mongo config

#

another option is to use SSH tunneling

split hazel
#

Is there any decent deep learning Q library out there for node

mystic violet
#

tensorflow.js

split hazel
#

I dont believe that has a SARSA approach

mystic violet
#

Yeah im not sure lmao im pretty dumb when it comes to node

#

Ion even know how to setup mongo 🤦‍♂️

static trench
#

Thanks @quartz kindle

#

I use bot maker for iOS

split hazel
#

WumpusSob disappointing

mystic violet
#

Is this the right variable names for mongo? ```js
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:27017/test', {useNewUrlParser: true, useUnifiedTopology: true});

const Model = mongoose.model('Database', { name: String });

const table = new Model({ name: 'Table' });
table.save().then(() => console.log('Saved!'));```

#

Like tables are tables, and the database is database etc

slender thistle
#

Since when does mongo have tables

amber fractal
#

It doesnt.

#

It has collections

slender thistle
mystic violet
#

Oh

#

Well im confused as hell then

#
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:27017/FlexiboatDatabase', {useNewUrlParser: true, useUnifiedTopology: true});```
#

there we go

#

Time to restart

earnest phoenix
#

How to make a vote logs

#

And if people votes than only they can use that command

#

Anyone here

astral yoke
#

Hello, I have a code made for me to where I can make it shut down the bot fully, but how do I make one so that it can restart instead of shutdown fully?

#

This is my code for the shutdown command.

#

.

#

.

#

.

#

const { ownerid } = require("../../loaders/reader");

module.exports = {
config: {
name: "shutdown",
aliases: ["stop", "exit", "rm-rf"]
},
run: async (bot, message, args) => {
if (message.author.id !== ownerid) return;

    try {
        await message.channel.send(". . . Bot is shutting down . . .");
        process.exit();
    } catch (e) {
        return message.channel.send(`ERROR: ${e.message}`);
    }
}

}

#

I use the process.exit();, but how would I change that so that it would restart it and not just stop it?

copper cradle
#

There's no way of doing so mmLol or at least that I'm aware of, one never knows

earnest phoenix
#

May I have some assistance with understanding how to code a command that I don't have the knowledge to code?

slender thistle
#

Generally you'd try to search some info on Google or read documentations

earnest phoenix
#

I don't know where to look.

slender thistle
#

and if that doesn't help, ask coding communities

earnest phoenix
#

Now that I think about it, I don't think it classifies as a command.

slender thistle
#

where to look
Eh, just search your issue up on Google? Like if you are having an error that says "Took too long to do something", you'd search something like "<your programming language> <the error>"

earnest phoenix
#

I want to understand how to make a "command" that when you join a server, a verification message is sent to the person's DMs and they respond with the arguments filled out, and then when a person that has Administrator permissions for that server reacts to that message with a specific reaction, it gives them access to the rest of their according permissions, and then logs the verification to a channel.

#

I'm currently using JavaScript.

#

Could somebody provide me with some guidance?

dense drift
#

Ah, so like a gatekeeper @earnest phoenix?

earnest phoenix
#

Sort of.

slender thistle
#

Commands are basically programs that users call using a message

#

"when you join a server" would be an event instead

earnest phoenix
#

I'll provide an example if it would help you give me guidance.

#

Like here's the arguments
Username? [0]
Timezone? [1]
Did you read the rules? [2]
Who invited you? [3]

#

and the bot would then react to the message sent in that specific channel

dense drift
#

Just do,

client.on("guildMemberAdd", member => {
//code goes here
member.send(//form to fill out
)})```
#

There's the first half

earnest phoenix
#

okay

#

so would I put the arguments in between member.send and client on?

#

or after member.send

dense drift
#

Anything in member.send would be pm'd to them

#

Do you want it to record any messages in it's own channel? Or an embed? Or?

earnest phoenix
#

I am trying to have the verification "form" logged

#

if you know what I mean

dense drift
#

If you want it to be like,

  1. member joins
  2. send (username?)
  3. wait for response, log response
  4. send (timezone?)...

You'll want to collect.

earnest phoenix
#

Either that or all in one message

dense drift
#

Otherwise, just send it to them, and watch on message filtered for PMs.

earnest phoenix
#

I've never been able to figure out how to use awaitMessages correctly

dense drift
#

So one event would send that when they join, and the other would be...

client.on('message', async msg => {
if(msg.channel.type.toLowerCase() !== 'dm') return
//code
})```
earnest phoenix
#

So, do I alter 'message' at all?

astral yoke
#

Whats a discord.js line that I can use for a channel called modlogs so it sends that someone got a punishment?

Example: scltxn#2018: !ban <person> advertising

Bot: <person> banned for: <reason>

Bot in #modlogs <person> banned for: <reason>?

dense drift
#

No, that code I just sent would be if the bot receives a PM, it would then run that code, period.

#

So the //code section would be grabbing what they send, and sending it to a channel.

earnest phoenix
#

Can we talk about this in DMs?

dense drift
#

You could do,

client.channels.get('ID OF CHANNEL').send(`${msg.author.username} - ${msg.content}`)
earnest phoenix
#

How should I make a vote logs with
Only votes people can use this command

dense drift
#

A database Pikachu.

earnest phoenix
#

I have

astral yoke
#

So I can just insert that into any moderation code and it would work? @dense drift

dense drift
#

Add someone to the database if they vote, and remove them afterwords.

#

Insert what Scltxn?

earnest phoenix
#

Can you give me a sample code

dense drift
#

Ohh

#

I was assisting Night

#

And Pikachu

#

LLol

#

I use Enmap personally

earnest phoenix
#

O

#

I use mongo as a database

#

Frog, can we discuss in DMs?

#

Yes here it's confusing😂

#

Whom telling to whom

dense drift
#

@earnest phoenix

So make the database,

client.vote = new Enmap({
    name: "vote",
    fetchAll: false,
    autoFetch: true,
    cloneLevel: 'deep'
});

Then run something like this

//on vote
client.vote.set(voter.id, 'true')

And then check when running a command

//on command
if(client.vote.get(author.id) !== 'true') return msg.channel.send(`You need to vote first!`)```
earnest phoenix
#

Thanks

dense drift
#

You can have it timeout later too with an interval or whatever

#

Just sub my database when what you use.

earnest phoenix
#

Ok

dense drift
#

Sure @earnest phoenix, let me see what Scltxn needs first though.

earnest phoenix
#

Okay.

dense drift
#

@astral yoke, pretty easy actually.

#

You have a kick command I assume?

astral yoke
#

As an example, sure.

#

So, I'm making a bot for other servers, like Dyno and stuff. How would I make it send to a channel such as 'modlogs' and not get an channel id?

#

Like, it's not just for me.

#

Because when they guildCreate/ the bot joins, it would say (Hi! Please make a modlogs channel so I can log stuff!)

dense drift
#

Okay, in your kick command, when someone is kicked, do something like this

const logs = client.guilds.get(msg.guild.id).channels.get('name', 'mod-log')
logs.send({embed: {
title: `User Kicked`,
fields: [
  {
    name: `User`,
    value: user.toString(),
    inline: true,
  },
  {
    name: `Moderator`,
    value: moderator.toString(),
    inline: true,
  },
],
timestamp: new Date(),
}})```
#

I'd do something like that.

astral yoke
#

Ok. I'm going to try that.

earnest phoenix
#

Is that JavaScript?

dense drift
#

Yeah

earnest phoenix
#

^^

dense drift
#

It's not exactly correct

earnest phoenix
#

js hurts my brain

#

Okay.

astral yoke
#

Oh, I use discord.js.

earnest phoenix
#

How?

astral yoke
#

Would I be able to use it ?

dense drift
#

You got to substitute a bit of it.

#

js is javascript

#

Discord javascript

astral yoke
#

I'm so stupid.

dense drift
#

So yes

astral yoke
#

Lol.

earnest phoenix
#

its so convoluted. i just like how expressive python is

dense drift
#

Python is silly to me haha

earnest phoenix
#

I don't understand Python.

dense drift
#

You can use the better embeds if you want too

#

I just prefer the old kind

#

¯_(ツ)_/¯

#

Okay, Night let me check pms lol

earnest phoenix
#

Okay.

astral yoke
#

@dense drift Got an error.

#

(node:10452) UnhandledPromiseRejectionWarning: ReferenceError: client is not defined
at Object.run (C:\Users\Cools\Downloads\DogBot\src\commands\moderating\kick.js:47:22)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:10452) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:10452) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

dense drift
#

Ah, you need to bring client through your command handler.

astral yoke
#

And how do I do that?

dense drift
#

What is your

command.execute(...```
say in your main file?
astral yoke
#

Do you want my command handler script?

#

Like, see it?

dense drift
#

Just that line

#

I need to know what exactly you have there

#

@astral yoke, you can either shutdown fully, or restart.

#

If you use pm2, if the bot ever goes down, it'll automatically restart.

astral yoke
#

I have it ran 24/7, I don't need to worry about it going down unless updating of course.

#

Nevermind about the channel loggin.

#

logging*

dense drift
#

Okay

earnest phoenix
#

i need help making roles

#

for my server

#

i have the bog

#

bot

copper cradle
#

Which bot

earnest phoenix
#

the reaction roles

astral yoke
#

that dosent make roles

earnest phoenix
#

what bot does

#

zira does reaction roles

astral yoke
#

you could use xenon

dense drift
#

I recommend Zira.

ocean frigate
#

I was hosting my bot on vps in Bangalore,India region it was showing near about 325 ms latency each time, I tried it with NYC region for testing and got 22 ms latency, then switched back to Bangalore,India region.
What does it signify?
Should I host my bot in NYC region instead of Bangalore region?

copper cradle
#

I mean

#

Isn't it obvious

earnest phoenix
#

^

ocean frigate
#

Why does it happen that latency changes according to region so much?

earnest phoenix
#

distance from discord's servers

#

which IIRC, are us-east on GCP

dense drift
#

European servers for this Discord specifically.

earnest phoenix
#

but discord api servers are us

ocean frigate
#

so which could be the best region to host the bot?

#

nyc

earnest phoenix
#

yup.

ocean frigate
#

closest to the api servers

dense drift
#

That would make sense.

ocean frigate
#

I thought to make it closest to the support server that is in India, but that don't matter, latency depends on distance from discord api servers

#

thanks for help

#

thank you guys

earnest phoenix
#

How do I embed links in discord.js?
Example: click here to visit our website

I thought you have to use markdown but that dosent work for me in discord.js

#

you cant

fiery stream
#

(https://google.com)jj

#

nvm

#

idk

mossy vine
#

you can in certain embed fields

#

look up markdown links

earnest phoenix
#

ok thx

fiery stream
#
jass@jass-K55A:~/Desktop/charm$ make install
bash: line 1: @printf: command not found
make: *** [/home/jass/theos/makefiles/package.mk:80: internal-install-check] Error 1
#

help pls

earnest phoenix
#

@ocean frigateindin ho

ocean frigate
#

what?

violet nimbus
#
const DBL = require("dblapi.js");
const dbl = new DBL(DBLAPITOKEN, bot);

dbl.postStats(serverCount);
dbl.on("posted", () => {
  console.log("Server count posted!");
});

dbl.on("error", e => {
  console.log(`Oops! ${e}`);
});

It shows error

    at IncomingMessage.res.on (/rbd/pnpm-volume/256ccade-fb85-42e6-882f-cd3dd81f765c/node_modules/.registry.npmjs.org/dblapi.js/2.3.1/node_modules/dblapi.js/src/index.js:118:25)
    at IncomingMessage.emit (events.js:194:15)
    at endReadableNT (_stream_readable.js:1125:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:405) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:405) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
late hill
#

where did you put that code

violet nimbus
#

@late hill in index.js file

earnest phoenix
#

Are you sure that ur token is correct

violet nimbus
#

@earnest phoenix yeah

#

Bcuz when I run on server it works

#

There is something else error idk what's that

#

Lemme regenerate the token

#

It could work

#

Still same error

mossy vine
#

@violet nimbus declare serverCount in your ready event, and post there

earnest phoenix
#

Doesn’t make sense how that would change anything

violet nimbus
#

Wdym?

#

@mossy vine mean I should transfer my code in ready event right?

earnest phoenix
#

yes but that won’t change anything

mossy vine
#

only the first line and the postStats

#

@earnest phoenix outside the ready event bot.guilds.size is either undefined or null

earnest phoenix
#

They can obviously reach each other otherwise you’d be given an error saying it’s not defined.

mossy vine
#

and you cannot post undefined/null

#

so you get 400

violet nimbus
#

@mossy vine thanx it is working

earnest phoenix
#

wtf

violet nimbus
#

😁

earnest phoenix
mossy vine
#

wont change anything my ass

violet nimbus
#

@mossy vine no you are the best

earnest phoenix
#

why does it returns undefined outside of the event

mossy vine
#

because it hasnt fetched the guilds yet

#

ready is emitted when guilds and members get cached

#

so that is when the size property will do anything

earnest phoenix
#

but he’s using dbl ready, not the bots ready. But I guess this would make sense

violet nimbus
#

Oooh k

#

Btw where will it show guilds on bot page?

earnest phoenix
#

Yes

mossy vine
#

on the page

violet nimbus
#

Where on the page?

#

There should be a position

mossy vine
#

"x servers"

violet nimbus
#

Or screenshot

#

??

#

Is that a bug?

#

It's 11 now

#

Lol

mossy vine
#

caching is shit

violet nimbus
#

yeah

#

btw it's not showing serverCount anywhere

#

N/A

#

Wth

ornate shoal
#

did you recently add the counting? its cached, so it can take a bit to show up

mossy vine
#

again, dbl caching is shit

violet nimbus
#

@ornate shoal yeah

#

@mossy vine lol

violet nimbus
dense drift
#

There's your guild count

violet nimbus
#

My?

dense drift
#

I mean, that's the code to pull it

violet nimbus
#

Ooh

mossy vine
#

scroll up, youre late

violet nimbus
#

I k

#

Lol

dense drift
#

oki

violet nimbus
#

The Griffin-Bot is amazing bot

#

And you think idk how to get server count?

#

Lol

dense drift
#

How should I know?

quartz kindle
#

are you posting it correctly? for me it usually updates in a few seconds

mossy vine
#

you should scroll up smh

violet nimbus
#

@quartz kindle yeah I think but there is no errors now

quartz kindle
#

are you using dblapi.js?

violet nimbus
#

Yeah

quartz kindle
#

do you have the .on("posted") event?

violet nimbus
#

And it's not logging posted server count in logs

#

Yeah

mossy vine
#

show your code smh

quartz kindle
#

if its not logging then there is a problem lol

violet nimbus
#

But there are no error message

#

K

#

@mossy vine @quartz kindle

#

That's it

quartz kindle
#

you dont need to use .postStats

#

it does it automatically

mossy vine
#

plus you are posting before the handler is added

violet nimbus
#

Wdym?

#

How will it post automatically?

quartz kindle
#

new DBL(token, client) has an autoposting option enabled by default

violet nimbus
#

But it isn't posting so I added code

earnest phoenix
#

Why’re you nesting events like that anyways

violet nimbus
#

@quartz kindle

#

Look

earnest phoenix
#

console.log is ur friend here

quartz kindle
#

that example is from 3 years ago

#

this is the example you should follow

violet nimbus
#

K

tight plinth
#

Don't forget to NOT post server count with client.guilds.cache.size with the latest d.js v12, coz only cached guilds are stored (aka some guilds can be missing)

quartz kindle
#

client.guilds.cache.size is exactly the same as client.guilds.size before that commit

#

no reason not to use it

tight plinth
#

One of my friends have a bot with 800+ servers (as per new oauth screen), but cached guilds are 600)+

quartz kindle
#

then hes doing something wrong

#

the cache is still the same, it just moved to a different storage system

earnest phoenix
#

@violet nimbus take help from me

violet nimbus
#

@earnest phoenix lol no need

#

😅

#

I am good than you

earnest phoenix
#

Nikal

violet nimbus
wicked pivot
#

is it possible to put their "moment" in french?

summer torrent
#

what

earnest phoenix
#

Wha!?

grizzled raven
#

what would a range with 3 params do in python?

#

range(3, 0, -1) for example

tight plinth
#

Never heard of 3 params range

grizzled raven
#

oh wait

#

maybe its to say that 0 is less than 3 and reversing the range or something

#

so instead of 0,1,2,3 it would be 3,2,1,0

#

idk

#

ill forget about it and see if it matters

quartz kindle
#

third param is the step

#

range(start, stop, step)

#

range(0, 50, 5) -> 0 5 10 15 20 25 30 35 40 45

grizzled raven
#

ohh okay

#

thanks

digital ibex
#

hi, so i got a vps and i am new to this

#

Does anyne know what i do here? I tried cdding to my bot folder but

slender thistle
#

dir/ls to view your current directory

summer torrent
#

do you uploaded your files to vps

digital ibex
#

i didnt

#

i just got it and now i done that

summer torrent
#

also

#

remove your message

#

your ip address...

digital ibex
#

o

#

fuck

#

oml

summer torrent
#

type ls to console

digital ibex
#

Is?

summer torrent
#

ls

digital ibex
#

ok

summer torrent
#

show result

digital ibex
summer torrent
#

it seems you dont have any file

#

is this linux?

digital ibex
#

windows

#

I won it and the guy just gave it to me

#

he asked for my username i wanted, then i chose it, changed my password and we're here now

summer torrent
#

do you know that guy?

digital ibex
#

yes

summer torrent
#

can you trust him?

digital ibex
#

I think so, he is support staff for Dyno i think, and i'm one of his mods, i won a giveaway

summer torrent
#

dyno support Thonk

digital ibex
#

yes

blissful scaffold
#

If it's a windows server then try dir

summer torrent
#

I think windows server has a desktop

blissful scaffold
#

That too

digital ibex
#

Oh, he isnt lol. He is fam and is like a special guy for helping people in int suppport

#

try dir?

summer torrent
#

yes

digital ibex
#

dir: cannot access 'desktop': No such file or directory

summer torrent
blissful scaffold
#

Just dir

#

Not dir desktop

digital ibex
#

new line

#

ok

summer torrent
#

do you have access to desktop of server?

digital ibex
#

idk, i'll ask him

blissful scaffold
#

I have no idea what you are running but I still think it's Linux

zenith orchid
#

Yep

#

This not windows

digital ibex
#

I'm not on linux

zenith orchid
#

Bro

summer torrent
#

🤦‍♂️

zenith orchid
#

Your server

blissful scaffold
#

That is your PC, not the server

zenith orchid
#

Not you

digital ibex
#

Oh

#

sorry, i dont know much about system things

zenith orchid
#

Xd

summer torrent
#

you can use FileZilla for upload your files

digital ibex
#

Oh

zenith orchid
#

What is your problem? @digital ibex

digital ibex
#

I dont know how to host my bot on a vps

amber fractal
#

On that command prompt, type uname -r and tell me what it shows

digital ibex
#

Okay

zenith orchid
#

Use filezilla and putty

summer torrent
#

first upload your files

#

also ^

digital ibex
#

4.15.0-76-generic

zenith orchid
#

SFTP method

digital ibex
#

thats what it says

zenith orchid
#

Idk

#

first upload your files
@summer torrent kalkanokey

digital ibex
#

I'm opening filefilza

#

Can you help me with that please

amber fractal
#

Yeah putty and filezilla are probably the easiest

zenith orchid
#

Of course

digital ibex
#

oh

#

I tried it before and it was uhm, kinda hard

earnest phoenix
#

filefilza

zenith orchid
digital ibex
#

ssh lost@delta.deltabot.tech thast my thingy

summer torrent
#

open filezilla and click "File" tab

zenith orchid
digital ibex
#

Okay

#

NMW03, what do i do now?

#

Oh

summer torrent
digital ibex
#

I'm reading it

#

but the one i have to connect to is ssh

zenith orchid
#

Ssh terminal?

digital ibex
#

i'm not too sure about that one

zenith orchid
#

I think SFTP

digital ibex
zenith orchid
#

Your server has 22 port?

valid holly
#

trying to map() through <g>.emojis to display in an embed, but I'ld like to join() them with their link so whenever you want to get the guild's emoji you click on it

#

anyone got any ideas? or did it ?

digital ibex
#

Im not sure, i'll try that

summer torrent
#

trying to map() through <g>.emojis to display in an embed, but I'ld like to join() them with their link so whenever you want to get the guild's emoji you click on it
@valid holly show your map code

valid holly
#
guild.emojis.map(e => e).join(" ");
#

so far

digital ibex
valid holly
bitter sundial
#

isnt that map kinda useless right now

zenith orchid
#

@digital ibex send host url

digital prism
#

Hey

digital ibex
#

host url?

digital prism
#

How i Can find if user is on desktop

summer torrent
#

@digital prism which lib

zenith orchid
digital prism
#

message.member.presence.clientStatus.desktop?

summer torrent
bitter sundial
#

@valid holly which part are you having trouble with? adding the link to the map or obtaining the link in the first place

valid holly
#

adding the link to the map

#

I can get the link no problem

digital ibex
#

ssh lost@delta.deltabot.tech

#

@zenith orchid

zenith orchid
#

Host: delta.deltabot.tech

bitter sundial
#

are you familiar with template strings

zenith orchid
#

Username: lost

#

Try

digital ibex
#

yes

#

Okay

valid holly
#

fields content then will have an hyperlink like link1 link2

#

I'ld like to assign link1 to emoji1 etc.

#

Yes, I know template literals allow variables in strings

#

Is there anything else to it ?

digital ibex
#

Ping, it would be port 22 right?

summer torrent
#

yes @digital ibex

digital ibex
#

Okay

valid holly
#
`${function()}`
digital ibex
#

yay

#

I think thats right

zenith orchid
#

Now

bitter sundial
#

you want the urls in a different field?

zenith orchid
#

Create new project folder

#

And upload files

digital ibex
#

How do i create a folder?

zenith orchid
#

Use ssh

#

Or right click

digital ibex
#

this?

zenith orchid
#

mkdir somename

digital ibex
#

dir lost?

zenith orchid
#

Yes

#

Main dir

digital ibex
#

i've tried cdding

zenith orchid
#

hey hey

digital ibex
#

?

zenith orchid
#

sudo mkdir prjectname

digital ibex
#

sudo mkdir lost ?

zenith orchid
#

Do you uploaded files?

#

lost is your project name?

digital ibex
#

i asked but you said do this

#

yes it is

zenith orchid
#

Allright

digital ibex
#

This?

bitter sundial
#

@valid holly is the format you want like
💩 example.com

or a clickable emoji

valid holly
#

clickable emoji

#

Sorry am ingame so I replied late

zenith orchid
#

New site

valid holly
#

Yep tried joining them but that joins all the emoji's url

zenith orchid
#

And use sftp protocol

digital ibex
#

What do i name it?

bitter sundial
#

ah, then you need a markdown hyperlink

link text

valid holly
#

Alo I'm slicing 20 emojis from the collection as I don't want to display more than 20

#

Well tried

#

Actually tried gimme a sec

digital ibex
#

@zenith orchid what do i name it?

valid holly
ocean frigate
#

Ping?

zenith orchid
#

Yes?

ocean frigate
#

Woah your username is ping?

zenith orchid
#

Yep

#

@digital ibex what

ocean frigate
#

Oh good

digital ibex
#

What do i name the new site?

bitter sundial
#

thats invalid, you need to wrap a single emoji and have only its link

digital ibex
#

oh, you cant change it

bitter sundial
valid holly
#
`[${guild.emojis.map(e => e).slice(0, 20).join(" ")}](${guild.emojis.map(e => e.url).slice(0, 20).join(" ")})`
#

Oh..

ocean frigate
digital ibex
#

Is that right

valid holly
#

should I make an array and iterate through that ?

ocean frigate
zenith orchid
#

@digital ibex no

digital ibex
#

oh

zenith orchid
#

Protocol is sftp

digital ibex
#

uhm

#

ok

summer torrent
#

@valid holly

zenith orchid
#

Because you have a ssh key.

summer torrent
#
map(emoji => `${emoji} ${emoji.url}`).join("\n")
digital ibex
#

what do i do then?

#

port 21?

zenith orchid
#

Connect

#

22

ocean frigate
#

Port 22

digital ibex
#

w-

#

im confused

ocean frigate
#

SFTP requires 22

valid holly
#

That returns emojis correct but links would be

link1
link2
link3
digital ibex
#

so, do i just connect now?

valid holly
#

I'll test and come back

digital ibex
valid holly
#

Thanks for the insight @bitter sundial @summer torrent

digital ibex
#

ping?

zenith orchid
#

Yes

digital ibex
#

Do i click connect now?

zenith orchid
#

Yep

#

Do you set to protocol sftp?

digital ibex
#

im not sure

valid holly
#

why don't you use mobax ?

zenith orchid
#

Ok @digital ibex

digital ibex
#

Ok

zenith orchid
#

Idk desu

digital ibex
zenith orchid
#

Aağh

#

Do you set to protocol sftp?
@zenith orchid

#

:D

digital ibex
#

I said idk

#

this is so hard ;(

zenith orchid
#

For you

digital ibex
#

🤞

#

Like that?

zenith orchid
#

Yes

digital ibex
#

thats ft somehting

zenith orchid
#

Connect now

digital ibex
zenith orchid
#

Show lost folder.

digital ibex
#

Okay

compact mauve
#

Does "Content-Type": "application/json" need to be specified in the Authorization header for posting to the API?

#

or is the authorization token the only thing required

digital ibex
#

thats for them guys

#

on their side

#

not mine

zenith orchid
#

Create new folder in lost

#

And upload bot files

digital ibex
#

upload what files?

#

what should i name it also?

zenith orchid
#

I prefer project name.

digital ibex
#

Okay

#

so

#

Okay

zenith orchid
#

Upload files on this folder

digital ibex
#

okay

#

if i have 3 bots

#

can i put all three in it?

zenith orchid
#

No

valid holly
#

@zenith orchid 🥣 spoonfeed @digital ibex

digital ibex
#

hily shit

zenith orchid
#

Use diferent folders.

digital ibex
zenith orchid
#

XD

valid holly
#

don't upload node_modules

zenith orchid
#

Yep

#

@valid holly 4Head

digital ibex
#

yea, dont worry

valid holly
digital ibex
#

can i cancel it?

#

bro, wtf im going to be here for hours

#

HHAHAH

#

im cancelling it

#

!

#

oh, wait im not

valid holly
#

Does rsync recursively overwrite folders and files over ssh ?

digital ibex
#

what happens if node modules are in?

valid holly
#

what happens if node modules are in?
nothing just use the host to get the package

digital ibex
#

is there any way for me to cancel this please

valid holly
#

yeah don't use filezilla

#

This is a good one for windows

summer torrent
#

@digital ibex click queue tab

digital ibex
#

~ 1k / ~ 6.5k

summer torrent
#

*right click

digital ibex
#

i kinda feel bad for the guy

#

then again, he does have like 300 gb or something

valid holly
#

Also don't send host / usernames here

summer torrent
valid holly
#

he ain't listening to me bruv kekwhyper

#

Just listen to the tutorial people

digital ibex
#

i right clicked

summer torrent
#

show result

digital ibex
#

nothings happening when i click on queued files

#

oh shit

#

it worked, i clicked on the thing above

summer torrent
digital ibex
#

stop and remove all

#

thats what i clicked on

summer torrent
#

yes

digital ibex
#

ok, the commands are on there

summer torrent
#

do you use node.js?

digital ibex
#

yes

summer torrent
#

type node -v to console

digital ibex
#

okay

#

on the vm or my one?

#

NMW03?

torn nebula
#

try in ur vscode terminal

summer torrent
#

in your vps console @digital ibex

digital ibex
#

ok

#

10.19

summer torrent
#

ok

#

do you uploaded all of your files?

digital ibex
#

most things

#

config,json, index.js & commands

summer torrent
#

ok

#

you need pm2 for processes

digital ibex
#

ok

#

pm2 start all?

summer torrent
#

pm2 start index.js

digital ibex
#

i am using command handlers though

#

oh, nvm

summer torrent
#

PM2 will help you manage and keep your application online

digital ibex
summer torrent
#

cd <your bot folder name>

digital ibex
#

okay

summer torrent
#

and retry

compact mauve
#

Does anyone know why this doesn't work (as in top.gg doesn't update my server count when I send this):

            dbltoken = "[REDACTED]"
            servers = {'server_count': util.get_server_count()}
            headers = {"Authorization": dbltoken, "Content-Type": "application/json"}
            async with aiohttp.ClientSession() as session:
                async with session.post(url="https://top.gg/api/bots/496480755728384002/stats", data=json.dumps(servers), headers=json.dumps(headers)):
                    await util.say(ctx.channel, "Done!")

This doesn't give me any error, so I have no clue what the problem is. This is written in Python 3.5.2, and dblpy requires 3.5.3+ to install so I can't use the library.

west spoke
summer torrent
compact mauve
#

o

#

sorry

digital ibex
summer torrent
#

pm2 logs

#

for check logs

#

is your bot online now?

digital ibex
#

its running on my pc

summer torrent
#

upload packages

#

sudo npm i <package name>

digital ibex
#

which one?

summer torrent
#

read error

#

it says

digital ibex
#

oh

#

discord.js

earnest phoenix
#

if you have a package.json you only need to do npm i

tight plinth
#

If you specify all ur bot packages in package.json u can just do npm install

earnest phoenix
#

^

summer torrent
#

oh i didnt know that

valid holly
#

Btw @bitter sundial @summer torrent fixed it <3

    function emojiSize() {
        let x;
        if(message.guild.emojis.size === 0) x = "N/A";
        else x = message.guild.emojis.map(e => `[${e}](${e.url})`).slice(0, 20).join(" ");
        return x;
    }
summer torrent
#

👍

valid holly
#

I should put alternate text with "Click me to Download" for people to know

summer torrent
#

good idea

valid holly
#

RangeError: RichEmbed field values may not exceed 1024 characters.

#

Need to slice less now

summer torrent
#

yes

valid holly
#

fuck

summer torrent
#

generate second embed

valid holly
#

naaaaaaaaaaaaaaaaaaah

valid holly
#

next task would be getting the emoji id from a message object

#

to get “download link” for external emojis that my client has no acces to

#

need to use regex I guess ?

summer torrent
#

i think no

#

i use regex for check is there any emoji in message content

lusty quest
#

has someone here a Digitalocean Database cluster and is able to connect to it with js? Ive got node networking errors (ETIMEDOUT)

earnest phoenix
#
2|xxx      |     at new ShardingManager (/root/node_modules/discord.js/src/sharding/ShardingManager.js:39:22)
2|xxx      |     at Object.<anonymous> (/root/xxx/sharder.js:2:17)
2|xxx      |     at Module._compile (internal/modules/cjs/loader.js:1144:30)
2|xxx      |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
2|xxx      |     at Module.load (internal/modules/cjs/loader.js:993:32)
2|xxx      |     at Function.Module._load (internal/modules/cjs/loader.js:892:14)
2|xxx      |     at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:27:21)
2|xxx      |     at Module._compile (internal/modules/cjs/loader.js:1144:30)
2|xxx      |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10) {
2|xxx      |   errno: -2,
2|xxx      |   syscall: 'stat',
2|xxx      |   code: 'ENOENT',
2|xxx      |   path: '/root/index.js'
2|xxx      | }```
#

What is error

#

Well seeing as that's not the entire stack trace

#

Mean

summer torrent
#

show full error

tight plinth
#

@earnest phoenix actual error is above

earnest phoenix
#

It's full

#

The error should be on top of stack trace

#

Try routing output to a log

#

With >

#

command to run bot > logfile.log

#

then just look at the end of the log with tail logfile.log -n 50 or someth

summer torrent
#

🔭

quartz kindle
#

just do pm2 logs xxx --lines=100 to view more logs

#

but ENOENT means file not found

#

looking at that partial stack trace i can see your directories are all messed up

#

your files should be in /root/xxx/ but the log shows /root/index.js and /root/node_modules

long lintel
#

@earnest phoenix, what app is that?

earnest phoenix
#

Terminus

long lintel
#

What we can do with this app?

summer torrent
#

i think it is for connect to console

#

i am using juice ssh for this

digital ibex
#

@summer torrent Sorry, I had to go. I'm back now

summer torrent
#

welcome

long lintel
#

It connects to your PC

digital ibex
#

?

#

How do i make it work on the vm?

long lintel
#

What

earnest phoenix
#

i dont know js but i see "not a directory"

#

doesnt node load a directory? not a file?

digital ibex
#

It works fine on my local machine, not on the vm though

earnest phoenix
#

wierd

#

file structure the same?

summer torrent
#

why your index js file is in the commands folder?

digital ibex
#

Oh

#

thats why

long lintel
#

I wanna make a command enable/disable option

#

But I'm confused how to start

solemn quartz
#

Hi

digital ibex
#

how do i restart it? So, I put it out of my commands folder and how do i restart?

#

pm2 restart?

summer torrent
#

pm2 restart index.js

digital ibex
#

Ah

#

Ok

#

wow

#

It works. Thank you all guys :)

#

@summer torrent @zenith orchid @valid holly Thank you guys :)

summer torrent
#

np

zenith orchid
#

Np

summer torrent
#

next task would be getting the emoji id from a message object
@valid holly try Discord.Util.parseEmoji()

solemn quartz
#

elo

#

Can someone help me?

digital ibex
#

How would I host a a different bot?

mossy vine
#

@solemn quartz post your question

quartz kindle
#

pm2 start differentbot.js

summer torrent
#

@digital ibex no

digital ibex
#

Oh

#

Ty

summer torrent
#

create second folder for your second bot

solemn quartz
#

@solemn quartz post your question
@mossy vine Im Doing A Mute Command On My Bot

#

Btw wait a sec and ill send u a pic then ill explain

#

@mossy vine

summer torrent
#

ask

solemn quartz
#

I did this:

#

case 'Mute':
const Muted = message.mentions.members.first();
if(!message.author.roles.find(r => r.name === "Super Bot Master")) return message.reply('You Dont Have Perms To Do This.')
if(!message.guild.roles.find(r => r.naem === "Muted")) return message.reply('I Didnt Find The Role, Pls Make A Role Called "Muted" and set -read messages and see voice channels-on and -send messages-off')
message.reply('I Succesfully Muted That Player!')
Muted.addRole("Muted")
break;

#

But when i do Muted.addRole("Muted") It Doesnt work

mossy vine
#

addRole takes a role object or a snowflake (id)

solemn quartz
#

So How Do I Do it?

mossy vine
#

are you on d.js stable or master

earnest phoenix
#

btw. setting -read messages is a bad idea if servers use channel lockouts

#

like if you have to have a role to see a channel

mossy vine
#

eh same shit anyways

earnest phoenix
#
  • takes precedence over -
mossy vine
#

btw you have a typo on the fourth line

#
- r.naem
+ r.name```
summer torrent
#

But when i do Muted.addRole("Muted") It Doesnt work
@solemn quartz addRole(message.guild.roles.find(a => a.name === "Muted"))

mossy vine
#

i mean

#

they are fetching it once already in the if statement

#

why not store it in a variable at that point

summer torrent
#

"message.author.roles.find"

solemn quartz
#

"message.author.roles.find"
@summer torrent If i would do this i would mute the one who did the message xd

digital ibex
#

im having trouble sending the files over without the node modules

summer torrent
#

user object has not roles property

digital ibex
#

i forgot how i was meant to do it NMW03

mossy vine
#

oh yeah that

#

use message.member instead

digital ibex
#

everything apart from node modules

earnest phoenix
#

also shouldnt you put the message.reply, after the muted.addrole? that way if addrole throws an exception it doesnt say it muted them?

mossy vine
#

even if it throws an exception

#

it wont exit the function

earnest phoenix
#

cuz rn, regardless if they actually get the role, it always says "muted"

solemn quartz
#

@solemn quartz addRole(message.guild.roles.find(a => a.name === "Muted"))
@summer torrent IM trying to do this

earnest phoenix
#

even if it doesnt leave the function, it still should be after

summer torrent
#

"message.author.roles.find"
@solemn quartz replace "author" with "member"

solemn quartz
#

oki

#

Where?

summer torrent
solemn quartz
#

case 'Mute':
const Muted = message.mentions.members.first();
if(!message.author.roles.find(r => r.name === "Super Bot Master")) return message.reply('You Dont Have Perms To Do This.')
if(!message.guild.roles.find(r => r.naem === "Muted")) return message.reply('I Didnt Find The Role, Pls Make A Role Called "Muted" and set -read messages and see voice channels-on and -send messages-off')
message.reply('I Succesfully Muted That Player!')
Muted.addRole("Muted")
break;
@solemn quartz Copy paste this with edit

#

That is for the one who mutes

#

cuz it checks if he has the role to do the mute

summer torrent
#
case 'Mute':
            const Muted = message.mentions.members.first();
            const muterole = message.guild.roles.find(r => r.name === "Muted")
                if(!message.member.roles.find(r => r.name === "Super Bot Master")) return message.reply('You Dont Have Perms To Do This.')
                if(!muterole) return message.reply('I Didnt Find The Role, Pls Make A Role Called "Muted" and set -read messages and see voice channels-on and -send messages-off')
                message.reply('I Succesfully Muted That Player!')
                Muted.addRole(muterole)
               break;```
#

user object has not roles property

#

message author is a User object

solemn quartz
#

Oki

#

Ima just copy paste : P

#

Im lazy

earnest phoenix
#

i still would move the feedback tho

solemn quartz
#

And btw im italian so now i need to traduct all again

#

OKi

earnest phoenix
#

you dont want any r/softwaregore stuff like "task failed successfully" ;P

solemn quartz
#

.-.

earnest phoenix
#

huh?

solemn quartz
#

huh

#

huhuh

#

Am Confused

#

Testing themute comand

#

Yayyyyyyyyyyyyy

#

It worksssssssss

#

Yaaaaaaaaaa

#

Thx @summer torrent @earnest phoenix

earnest phoenix
#

nice :)

summer torrent
solemn quartz
#

So i did kick and ban lonely ; ( and mute with you : D so i only need to do the warn command now

earnest phoenix
#

btw if you put a \ before a text emoji

#

\:)

#

:)

#

doesnt change

mossy vine
#

or u can disable it in settings

earnest phoenix
#

ye but i can use bth ways

solemn quartz
#

Idk If i need to do a simple warn or a variable warn

#

The simple is just that sends an embed in DM who says who warned you and why

#

The variable is that like if u got 5 warns u get kicked

earnest phoenix
#

personally, i prefer being able to set that up myself

summer torrent
#

store to a db

earnest phoenix
#

ye

#

add a clearwarn command too

summer torrent
#

quick.db is good for small bots

solemn quartz
#

?

#

So What Warn Should I Do For U Guys?

#

I Think that i should do the simple and when i will be more good i will do automod and do that

#

@summer torrent

#

@earnest phoenix

#

-bots @summer torrent

gilded plankBOT
earnest phoenix
#

personally, i would add a configurable automod

solemn quartz
#

Like Dyno/Mee6?

#

on the sites

earnest phoenix
#

more like nadeko

summer torrent
#

store to a db

solemn quartz
#

?

earnest phoenix
solemn quartz
#

Im Italian

#

Use poor words

earnest phoenix
#

nadeko is another discord bot

solemn quartz
#

IK

earnest phoenix
#

my favorite moderation bot

#

o

solemn quartz
#

wow

earnest phoenix
#

just

solemn quartz
#

I personally like mee6 and dyno more of that

earnest phoenix
#

something you can customize for each server

#

yea but mee6 and dyno are multipurpose and i hate that

solemn quartz
#

If I Would Do That It Will take me months

earnest phoenix
#

not really

#

just store a punishments list for each server, and check people's warnings each time they get warned

#

if they have say 2, and 2 is kick, then they get kicked

solemn quartz
#

And first of doing auto-mod i would like to do a currency system

#

Can U Accept Frnd Req

#

So We Can Talk When We Want

earnest phoenix
#

eh, if its for coding advice, you're better off finding someone that knows javascript

#

I use python, and as such, I am mostly useless when it comes to js

glossy pasture
#

mm bots

solemn quartz
#

So now i need to do a Currency System

#

Like Dank Memer

earnest phoenix
#

gl

solemn quartz
#

?

earnest phoenix
#

good luck

solemn quartz
#

ty

modest maple
#

Anyone know the Approximate global rate limit for webhooks?

earnest phoenix
#

thats a thing?

modest maple
#

yes?

earnest phoenix
#

test for it

#

xD

#

execute the endpoint until you get 429

modest maple
#

only one way to find out xD

#

altho might wait till a new news article comes out so i dont resend the same news article for the 3rd time

#

already restarted the backend once

earnest phoenix
#

this.member.id(executorID);

#

Given error on console

#

Unhandled promise rejection: TypeError: this.member.id is not a function

#

broken promises are the worst kind ):

lament tusk
#

so i recently got a raspberry pi and i was wondering if someone else maybe knows if i can host my bot myself easier through using that

earnest phoenix
#

ye

#

as long as it can be up and running constantly

lament tusk
#

how do i get node.js on meh raspberry

earnest phoenix
#

broken promises are the worst kind ):
Do you know how can I fix it?

#

and no i dont

#

i use python

#

Uf

lament tusk
#

legendary, thank youbongolovewave

earnest phoenix
#

sorry ):

#

and np

maiden moss
#

Hi people my community are looking into having our own bot in our server and I was wondering if there are any docs that are a must read. We have a bot programmed in our server atm but we are mainly wondering how to host it. Any pointers?

earnest phoenix
#

depends how much you're willing to spend

#

raspberry pi costs like 30 usd. if you have a spare laptop, you could use that, thats what i do

#

free hosting is pretty much trash

#

@maiden moss that help ?

#

You can spend like 3-5 dollars a month for a cheap vps

quartz kindle
#

if the bot doesnt do much, using something like glitch/heroku will be more than enough

#

just be aware of its limitations

#

alternatively, google and amazon offer free vps for 12 months

#

which is more than enough time to kick start a project

earnest phoenix
#

dont say free for gcp

#

its misleading

#

$300 for a year

modest maple
#

well no

#

it is free for a year

earnest phoenix
#

no.

#

you get $300 in credits to use for a year

modest maple
#

after that is is that much

#

it is still "free"

earnest phoenix
#

"free"

#

not free

#

;p

#

the 300 dollars doesn't even last you for a year if you have a heavier bot aka need a stronger machine

#

cough or a mc server

#

xD

#

yes

#

i lasted 4 months

#

but OP did say it was only for a single server

#

samee and the machines still aren't powerful enough

#

so they might be able to get away with using the free tier

#

aka f1-micro

#

mainly because java is retarded and mojang devs are autistic but ignoring that an 8 gig ram machine with 4 virtual cpus crashed every week or so

#

Well no

#

Wait how did you get 4 vcpus

#

You can only get 2 then you go to normal ones

#

you can use custom builds

#

i also didn't use micro

#

But I thogut it went 1 vcpu 2 vcpu 1 CPU etc

#

Cuz 1 vcpu is 1/4 cpu

#

Ndjrjdn

#

I ran my Mc server on a 2cpu 2gb machine

modest maple
#

tbf if youre the person to spend $300 a year or more on Google's hosting you might aswell either use a decent vps or just buy a server

earnest phoenix
#

Someone doesn't like gcp

modest maple
#

my school just upgraded their main servers which are moist

earnest phoenix
#

it isn't spending

#

it's

#

exploiting

#

~

#

^

#

google gives you free 300 dollars to use on their cloud service

#

Anyone know what gae is for?

#

repeatedly do that process and you'll be exploiting their services in no time

#

No

#

Can't

#

you can even with the new system

#

They need credit info tho?

#

yeah

#

but they don't check for dupe cards

#

O

#

they only check for cards which have been used an enormous amount of time

quartz kindle
#

my bot was on google for a year and it used like 10$ of the 300

#

now im using the account for my api, which uses so little resources (for now) that it costs like 0.01$ monthly

earnest phoenix
#

Depends on the bot

grizzled raven
#

how big was your bot

quartz kindle
#

it was on about 200 servers when i moved it there, and about 1600 servers when i moved it to a better vps

earnest phoenix
#

What does it do tho

quartz kindle
#

image generation

earnest phoenix
#

Hm

quartz kindle
#

the only thing that was going over google's free usage limits was the bandwidth

#

which google only allows 1gb/month free, which is nothing for a discord bot lol

late hill
#

^^this

#

I think my server is at like 5tb now

#

within a month

#

lol

quartz kindle
#

but with guild subscriptions and intents its not that much of an issue anymore

#

5tb lmao

grizzled raven
#

yokes

#

yikes

#

i mea

#

idk how much bandwidth im using

earnest phoenix
#

Same

quartz kindle
#

my server was at about 400gb/month due to some weird ass spikes

earnest phoenix
#

Spikes or mountains

grizzled raven
#

wait what host do you use now?

quartz kindle
#

but after i finish moving all my bots to my intents framework, the monthly bandwidth should fall back to like < 10gb/month

#

im on galaxygate

grizzled raven
#

does unmetered bandwidth mean i can use as much as i want?

quartz kindle
#

yup

grizzled raven
#

oh ok cool

quartz kindle
#

thats one of the reasons i went for galaxygate

grizzled raven
#

what plan

quartz kindle
#

3$ one

grizzled raven
#

understandable