#development

1 messages · Page 639 of 1

earnest phoenix
#

Regen your token

rugged kelp
#

no purpose

#

:/

#

He still finds it

earnest phoenix
#

No

#

If your token was on your github just regen your token

#

The old token is not important

rugged kelp
#

So I do not really have to put in github?

earnest phoenix
#

No

rugged kelp
#

Really ?

#

...

slim heart
#

If you don’t have experience with things like that you can put your token in a file in the parent directory and require it from the bot file.

#

It’s not the best practice but if you don’t understand it and can’t figure it out it still works

echo pasture
#

HOW tha fuck i can download quick.db module

mossy vine
#

npm i quick.db

earnest phoenix
#

npm i quick.db@latest

rugged kelp
earnest phoenix
#

Idk github is trash

rugged kelp
#

yes :/

mossy vine
#

why do you insist on using github?

rugged kelp
#

Because idk

earnest phoenix
#

So dont use github

#

No needed

mossy vine
#

^

rugged kelp
#

For heroku

#

:/

mossy vine
#

oh thats shit

#

cant you give heroku access to private repos

#

so you dont have to worry about token leaks

late hill
#

Heroku has their own repos

#

Which are private

rugged kelp
#

What is repos ?

mossy vine
#

plural of the word repo (repository)

rugged kelp
#

Oh

#

Thanks

late hill
#

You don't need github for heroku

rugged kelp
#

Yes

#

Idk how to use

slender thistle
#

It's optional

rugged kelp
#

yes

mossy vine
#

its a git repo

rugged kelp
#

duckduckgo ? : )

late hill
#

Use the heroku cli

rugged kelp
#

How ? :/

late hill
#

Install it

#

Then heroku login in cmd

rugged kelp
#

This ?

late hill
#

Follow those steps yes

rugged kelp
#

Ok

#

Thanks ❤

#

@late hill look

#

:/

#

Method Not Allowed

#

Oh

#

I change github on private and now it's good 😄

#

Finally

earnest phoenix
#

Okay

#

how you can run your code

quartz kindle
#

depends on whats your environment, where did you write it?

#

Which libraries/language are you using?

frail ocean
#

@earnest phoenix You have now asked the question 3 times in #general , in here and in my DM's please accept the answers we give in following guides as you aren't providing information (ie libraries/languages) to us.

amber fractal
west spoke
#

@earnest phoenix f5

earnest phoenix
#

Someone know how this error happened ? (node:1948) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Access

#

(Causes)

#

Its when the bot try to do something without permission or other thing?

west spoke
#

Yeah

#

When blocked or unable to send to channel

earnest phoenix
#

ok its good thx

quartz kindle
#

Or trying to access a deleted channel/message

frail ocean
#

Basically it can't access (get to) something.

earnest phoenix
#

Okay so, how i can check if a user has the right permission to send a image in a channel?

#

In djs

#

oh nvm i'm dumb

spare goblet
#

guildmember's permissions property o.o

earnest phoenix
#

Hey guys can I ask you a question that will ask you if I can ask you a question?

spare goblet
#

not sure what you just said

earnest phoenix
#

Can I ask you a question that goes like "Can I ask you a question"?

#

@spare goblet yeah ik i'm just tired ahah

slender thistle
#

yeet ask2ask

covert turtleBOT
#

By asking if you can ask a question, you have already asked a question so simply just ask the actual question. State exactly what the problem is so someone can help you as soon as possible.

earnest phoenix
#

Can I ask again tho?

slender thistle
earnest phoenix
#

does this go in dev I don't know

#

bt

#

big problemo

#

``` else bot.user.setActivity(Type ]help to begin... , { type: 'PLAYING' }).catch(() => {});

              ^

TypeError: Cannot read property 'setActivity' of null```

#

worked for the past 2 months (since creation date)

#

now it doesn't

west spoke
#

That's ns

#

Js

#

Or java

#

Maybe it's something else?

earnest phoenix
#

javascript

#

discord.js

west spoke
#

One sec

earnest phoenix
#

its weird that bot.user isn't recognised

#

i saw my bot offline and a wtf moment

west spoke
#

client.user.setActivity('YouTube', { type: 'WATCHING' });

mossy vine
#

@earnest phoenix how did you define bot?

earnest phoenix
#

it worked for 2 months so I don't know why u askin but

#

1sec

#

like all ppl do js const Discord = require("discord.js"); const bot = new Discord.Client(); const fs = require("fs");

mossy vine
#

what event are you doing the .setActivity thing in?

earnest phoenix
#

i got two

#
bot.user.setActivity(`over ${bot.guilds.array().map(g => g.memberCount).reduce((c, n) => c + n)} users...`, { type: 'WATCHING' }).catch(() => {});
bot.user.setActivity(`Type ]help to begin... `, { type: 'PLAYING' }).catch(() => {});```
mossy vine
#

my best bet is that the code is running before the ready event, therefore bot.user doesnt exist

west spoke
#

Perhaps

earnest phoenix
#

and that is definitely true.

#

just noticed, thank you

mossy vine
#

yw

earnest phoenix
#

kinda scared me

#

thought maybe Discord banned all partner bots

mossy vine
#

nah, the bot application would be deleted and you would get an invalid token error

earnest phoenix
#

ahh]

#

gotcha

#

tysm

mossy vine
#

👍

earnest phoenix
#

and i'm back

#

now it's.. not becoming ready..

mossy vine
#

does the ready event not get fired or something?

earnest phoenix
#

yes

mossy vine
#

any errors?

earnest phoenix
#

nothing

#

probs cuz i log it somewhere

#
bot.on('ready', () => {
    log(
        `Guilds: ${bot.guilds.size} | Users: ${bot.guilds.array().map(g => g.memberCount).reduce((c, n) => c + n)} | Mem: ${Math.round(process.memoryUsage().rss / 1024 / 1024 * 100) / 100} MB`
    );
  cUse();
});```
#

the cUse(); is the activity changer

#

and log is a custom logger

#

that outputs date

pearl jasper
#

anyone here hosting at glitch?

earnest phoenix
#

yes

#

now let me guess

#

your bot doesn't eh?

#

let me guess again

#

Discord banned glitch

#

thats the only idea i got

pearl jasper
#

fak

earnest phoenix
#

@earnest phoenix they didnt ban glitch

#

phew

#

thats good

#

They only ban most of glitch's ips

#

Because of retards misusing glitch for bots

#

Like the porn ones, raids, etc..

pearl jasper
#

hmm any alt

earnest phoenix
#

so my glitch ip got banne for sum reasun?

#

Glitch projects can use the same ip lol

#

😠

#

who used my ip REEEE

quartz kindle
#

Did the ready event log anything?

earnest phoenix
#

no

#

Make a new "app", contact glitch support or just stop being poor and get a VPS

quartz kindle
#

Add a catch to the .login()

earnest phoenix
#

No need to?

#

Unless ur not using discord.js

quartz kindle
#

Why not need? Doesnt login return a promise?

earnest phoenix
#

Uh it returns for example if your token is invalid

#

No need to catch

pearl jasper
#

any recommended vps?

earnest phoenix
#

It just rejects

mossy vine
#

it is a promise

earnest phoenix
#

OVH, Galaxygate, digitalocean

#

Alot..

pearl jasper
#

aight

earnest phoenix
#

Im at galaxygate atm though

#

Powerful vpses and great support

quartz kindle
#

A promise rejection wont give you anything useful if you dont catch it

pearl jasper
#

@earnest phoenix hm is your plan?

earnest phoenix
#

Uh

#

The 10$ one

pearl jasper
#

is it worth?

earnest phoenix
#

Well for one bot the 3$ or 5$ is enough

pearl jasper
#

ohhh okay thanks

earnest phoenix
#

If you arent sure just ask the support on there

#

UnhandledPromiseRejectionWarning: Error: Something took too long to do.

pearl jasper
#

i think 5$ is good

#

brb

#

imma try it

earnest phoenix
#

@earnest phoenix doesnt sound like a ip problem but yeah try catch behind the login

#
bot.login(config.token).catch(console.error);```
correct?
mossy vine
#

yes

earnest phoenix
#

nothing

#

so far nothing

#

Ok so appearently glitch itself has issues right now

mossy vine
#

can confirm, my dead bot hosted on glitch is down

earnest phoenix
#

nah my website on glitch is up

#

Website isnt discords api gateway

#

Ya stoopid

#

so glitch only has problems with discord ok nice

slim heart
#

yea discord bans all of glitch's ips

earnest phoenix
#

and thats why u dont use glitch says a guy who uses glitch

slim heart
#

for discord bots dont atleast, just bots in general. glitch is a good practice platform

frail ocean
#

Weird, I usually use glitch for some of my smaller bots, specifically ones that are small and it's fine.

robust acorn
#

Does anyone know if there is a limit in changing the playing status of the discord bot?

inner jewel
#

5 times per minute

robust acorn
#

thanks!

#

but is this enforced?

earnest phoenix
#

One time per 20 seconds

robust acorn
#

other people can change their playing status more than that even without any approval for more

pale marsh
#

It says a file is missing

spare goblet
#

which part of your code is this erroring out? figure it out
don't think it's a node module, i think you probably requested to run/open /.../util/Util.js file in some sort of file

royal herald
#

oh guys i fixed!

spare goblet
#

congrats.

royal herald
#

okey thx

spare goblet
#

good work :)

idle basalt
#

@robust acorn bots like dyno and mee6 (which you may be referring to) have special rate limits. also, you can go ahead and bypass rate limits all you want but you risk being banned from the api

#

some libs wont even let you breach rate limits

frail ocean
#

Mhm, once every 20 seconds is more than enough.

stray garnet
#

Guys my Bot dont Work anymore... No Errors in the Code, the Server works fine, No Problems with the Database.. It dont come Online again. I already changed the Token and pasted the New one the Token Folder but it still dont works. Any Help?

mossy vine
#

is it hosted on glitch?

pearl jasper
#

if it is i think glitch is banned now

pale marsh
#

Why the bold text smh

#

When was glitch banned? Is that recent?

grim aspen
#

i never heard that problem before

#

i'm glad i never used it

pearl jasper
#

idk

stray garnet
#

@Cyber28#0001 yes

pearl jasper
#

my bot is not responding anymore earlier

#

glitch is banned

#

pwp

grim aspen
#

f

stray garnet
#

What does that mean?

grim aspen
#

use a vps

stray garnet
#

@pearl jasper

pearl jasper
#

yea

#

thats what im gonna do now

pale marsh
#

You can't host bots on glitch anymore I think

#

Just like they said

stray garnet
#

@pale marsh Why?

pearl jasper
#

im gonna try galaxygate

pale marsh
#

Idk

stray garnet
#

Weird Shit

pearl jasper
#

btw does it work like glitch?

stray garnet
#

What can i AS a Free Alternativ?

grim aspen
#

use aws

stray garnet
#

Ok

royal herald
#

guys i need loader.js

dusky marsh
#

Hm?

flat pelican
#

@royal herald We don't share code or code something for you there. Since I noticed you're Turkish, burada kod paylaşmıyoruz veya senin için kodlama yapmıyoruz.

earnest phoenix
#

so the thing

#

like an hour ago

#

that never ready thing

#

catching the login does nothing

#

says same thing

#

"Something took too long"

mossy vine
#

@earnest phoenix where are you hosting your bot?

stray garnet
#

Any Free hosting Stuff for my Bot?

mossy vine
#

@stray garnet nope

stray garnet
#

Ah Shit

mossy vine
#

i feel like discord is blocking glitchs ips

#

i have 4 old bots still hosted on glitch, and only 1 of them is online

stray garnet
#

Why is Discord doing this?

warm flame
#

there is nothing really out there for free to host a bot, at least nothing worth it

west spoke
#

^

#

Host it yourself

stray garnet
#

@west spoke i don't have a Raspberry

west spoke
#

Dont need one

#

Laptops exist

stray garnet
#

Hmm

#

But Mine broke down Yesterday

idle basalt
#

heroku works as long as you dont need disk storage

warm flame
#

even then heroku isn't that great

west spoke
#

Mine is based around storage

earnest phoenix
#

@mossy vine glitch

west spoke
#

That's why I have 30gb set aside for my bot's files

earnest phoenix
#

since i got no money and glitch is the only one that saves files

west spoke
#

Repl saves, but is insecure

earnest phoenix
#

wdym insecure

west spoke
#

Token

idle basalt
#

ive always found glitch finnicky

mossy vine
#

@earnest phoenix thats the problem. i think discord is blocking ips where the spambots are coming from, which are in this likely hosted on glitch

#

@west spoke actually repl can be secure if you can do it right

earnest phoenix
#

;-;

west spoke
#

Sometimes

earnest phoenix
#

so uhm

#

what should i do

mossy vine
#

no i wasnt really talking about that

earnest phoenix
#

thats insecure, no?

slim heart
#

@earnest phoenix its actually super secure, i know the guys that work at replit. but anyways, what you can actually do on repl.it is u can use dotenv and itll keep it secure from anyone that isnt you. if you want to protect your code tho, youll have to pay and upgrade that

earnest phoenix
#

hmph

#

and how can i bypass glitch's ip banne :v

#

cuz i'd love to keep my code pribate

#

cause then just 50 copycat bots pop up

#

or the best part would be me forgetting to ENV the token, and someone using it for spambotting

#

my account getting deleted

#

no thank you

grim aspen
#

nvm it is

#

@earnest phoenix there's really no way to evade a ip ban from glitch except appeal via their support

#

i thought i read it somewhere

earnest phoenix
#

i'm talking about Discord banning glitch ip

grim aspen
#

there's no way to evade it

dusky marsh
#

^

earnest phoenix
#

😭

#

rip my botto

grim aspen
#

you can use a vps

#

which is good with bot hosting

quartz kindle
#

Why not use google/amazon?

grim aspen
#

that also

#

aws

quartz kindle
#

Both offer free hosting for 12 months

grim aspen
#

@earnest phoenix i did happen to look more into it, i only found this which was a while ago, the best suggestions i can give you is to use a vps, aws from amazon, or google developer hosting

mossy vine
#

glitch staff comment on the thread
It looks like some IP addresses may have been banned recently, certainly not all, due to problematic bots. Unfortunately this can impact other bots which weren’t doing anything incorrect. If you let us know the name of the projects then we can review and move those like that for you.

grim aspen
#

but discord banned glitch alltogether

mossy vine
#

i still have a bot on glitch thats online

spice mango
#

They probably only banned some of the IPs

#

If you get lucky and are running on the right one it will still work

grim aspen
#

yeah but she/he was ip banned

quartz kindle
#

Glitch staff said theyd move projects to unbanned ip addresses from what i understood

pearl jasper
#

Same

azure rain
#

So ...
Me and a friend are working on a Smart Home Bot with discord for the hack week

how would that be tested for DBL?
since the commands won't really work unless you have like smart lights, etc

earnest phoenix
#

Weirdly, my issue fixed itself, I did absolutely nothing but my bot is back online.

grim aspen
#

must have had an outage

earnest phoenix
#

no, only that out of 4 projects work

#

oh well glad it fixed itself

#

and the uptime dropped to 80%

quartz kindle
#

@azure rain make a live stream a d have the bot commands control the house in the live stream

#

Something like twitch plays

#

"Discord plays house lights"

earnest phoenix
#

if (!bot.channels.get(obj.pcid).permissionsFor(ch.id).has('SEND_MESSAGES')) incirrect how?

#

oh

#

oops nvm

earnest phoenix
amber fractal
#

that's the stacktrace, what was the error

#

it is mostlikely a module that isnt installed

#

and is that in glitch?

earnest phoenix
#

yes

mossy vine
#

it is glitch

grim aspen
#

scroll up to the start of the error

amber fractal
#

idk how to add packages in gltich

grim aspen
#

that screenshot doesn't show enough

#

same as nodejs @amber fractal

amber fractal
#

glitch has a terminal?

grim aspen
#

add it in package.json

earnest phoenix
amber fractal
#

Oh

#

Do what he said then

#

add it to your package.json

grim aspen
#

a glitch inside of glitch

urban vapor
#

hey, i create a simple bot in java, now, how may i move him to my discord? So i can test it?

earnest phoenix
#

Can u fix it i will send the link to edit ok?!

urban vapor
#

created*

amber fractal
#

This isnt the server that will do it for you

#

@urban vapor have you made a discord app?

urban vapor
#

ye

grim aspen
#

i am looking at his glitch site

#

first

amber fractal
#

invite the bot to a guild

urban vapor
#

how?

grim aspen
#

never ever send your site to people who aren't trusted

urban vapor
#

where can i find him?

grim aspen
#

second he definetely never installed discord.js

amber fractal
grim aspen
#

there's a module called add package

#

look up discord.js

#

in package.json

earnest phoenix
#

added

grim aspen
#

that's all you need

earnest phoenix
#

still error

grim aspen
#

i'm not here to spoonfeed i forgot

earnest phoenix
#

-_-

urban vapor
#

@amber fractal thanks, it worked!

amber fractal
#

👍

earnest phoenix
#

Remix projects if bot not online

earnest phoenix
#

for glitch

amber fractal
#

Already told you the answer

topaz turtle
#

where error

amber fractal
untold matrix
#

I seem to have an issue with this

client.on("ready", () => {
    console.log("Bot Initialisation Completed")

    setInterval(function () {
        axios.get("https://api.torn.com/torn/?selections=stocks&key=KEY")
            .then(function (response) {
                console.log(response)
                console.log("BB Ping FHG Executed")
                if (response.data.stocks[14].available_shares > 500000) {
                    let q = response.data.stocks[14].name
                    let w = response.data.stocks[14].acronym
                    let e = response.data.stocks[14].available_shares

                    let embed = {
                        title: (q) + " (" + (w) + ")",
                        color: 938492,
                        description: "<&@591703566864089089>, There is currently " + (e) + " Available Shares for " + (q) + "."
                    }

                    message[591699619717578762].send({ embed })

                        .catch(function (error) {
                            console.log(error)
                        })

                        .finally(function () {
                        });
                }
            })
    }, 10000);
});
#

(node:9076) UnhandledPromiseRejectionWarning: ReferenceError: message is not defined
at D:\Discord_Bots\ID_Bot_Test\ID_Bot_Test\idbt.js:27:21
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9076) 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: 3)
^C

#

message[591699619717578762].send({ embed }) this line in particular I may have issues with

amber fractal
#

uh ye

#

it's not defined

#

as it says

#

also you just gave out an api key to something

#

which you'll want to regen

untold matrix
#

Its fine

#

Yeah Ill regen

amber fractal
#

if you're trying to send to a specific channel you have to get the channel then send

untold matrix
#

[591699619717578762]

#

This is the channel ID

dusky marsh
#

client.channels.get('channelid').send('some message')

amber fractal
untold matrix
#

Alright thanks

royal herald
#

guys how to dowland watcher.app?

earnest phoenix
#

??

#

Do you have searched on google

#

Before asking here?

royal herald
#

yep

grim aspen
#

is that even related to discord bots?

royal herald
#

yep

untold matrix
#

This is probably the stupidest question but I forgot how to make my bot ping tags, I tried doing this <@&591725617255546884> but it doesnt work

pale marsh
#

Remove the &

#

Oh wait, by tags you mean channels?

#

Then it's <#ID>

untold matrix
#

I want it to ping a tag

amber fractal
#

users: <@id> roles: <@&id>

untold matrix
#

Removing the & does that

amber fractal
#

trying to ping a role?

pale marsh
#

What are you trying to ping?

#

You can mention 3 elements: Users, Channels and Roles

wet ferry
#

No

#

You can mention the server

#

Too

untold matrix
#

Aight Idk why but it just started working

wet ferry
#

By putting the server Id in role tags

untold matrix
#

I just turned off and on my bot

#

And it works?

red atlas
#

<@&264445053596991498>

#

mk

grim aspen
#

you tried

earnest phoenix
#

Nice try

red atlas
#

i mean i did what Codingpro said to do

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

@sage bobcat Try use pastebin as it helps with spam AYAYASmile

#

Or use the Synex so it helps other Devs locate issues better

warm flame
#

Code blocks are a wonderful thing lol

grim aspen
somber verge
#

can someone help me with dblpy
i did pip install dblpy but it says i didn't
does this mean pc = broken

slender thistle
#

What does it say

somber verge
#

something like "dblpy not found"

#

i don't remember the error

slender thistle
#

Works fine for me

warm flame
#

Are you trying to install the latest version?

somber verge
#

i did just pip install dblpy

#

whatever version that might be

slender thistle
#

I would have to see the error you are getting to figure out a solution

somber verge
#

there

slender thistle
#

How are you running your bot and how are you installing dblpy

somber verge
slender thistle
#

Wait.

#

import dbl

somber verge
#

that's it?

#

it worked

slender thistle
#

Yep

somber verge
#

i didn't know, i'll remeber if i make more bots

#

thanks for the help

slender thistle
#

There were examples on the GitHub repo but okay dogeKek

somber verge
#

i only looked at the api reference lol

#

it's what i do

sage bobcat
#

One message removed from a suspended account.

somber verge
#

i think i know how to do that

#

what lib tho

sage bobcat
#

One message removed from a suspended account.

split hazel
#

Logging messages without the users' knowledge is against the Discord ToS.

west spoke
#

^

sage bobcat
#

One message removed from a suspended account.

somber verge
#

if d.js idk how

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

I am trying to make my bot add a 1⃣ reaction but I am having trouble finding the ID for this emoji. It works with other ones but this one just seems kinda different

sage bobcat
#

One message removed from a suspended account.

west spoke
#

^

earnest phoenix
#

Didn't work

split hazel
#

Should work, what lib you using?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

split hazel
#

I miss understood, I thought you were also saving the actual file to the bot.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#
MarkusawToday at 11:45 PM
I am trying to make my bot add a :one: reaction but I am having trouble finding the ID for this emoji. It works with other ones but this one just seems kinda different```

the emoji is constructed from two unicode characters, digit 1 and an enclosing keycap
#

1 + ⃣ -> 1⃣ -> 1⃣

#

Thanks, gonna try it

somber verge
#

also about dblpy
do i use bot.event
or dbl.event

#

for upvotes

slender thistle
#

bot.event

somber verge
#

ok

slender thistle
echo pasture
#

;-;

earnest phoenix
#

Thank you Cry, it worked. MVP

somber verge
#

ok but how do i test if my code works

#

for upvotes, again

split hazel
#

@somber verge

somber verge
#

but i'm talking about upvotes

#

not the webhook

split hazel
#

That is upvotes.

#

The upvote webhook.

somber verge
#

lemme try it

split hazel
#

It will send a test webhook to the specified url

#

For self hosting, it would be something like <ip> all depending on your code of course.

somber verge
#

so if i'm self-hosting, i just put my pc's public ip?

split hazel
#

I believe so.

#

And if you're listening to a specific port, you can simply add <ip>:<port>

somber verge
#

it didn't work

#

hmm

earnest phoenix
#

you usually need to port forward home routers

split hazel
#

I'm the last person to ask about port forwarding, once spent 2 hours trying to figure out how to forward to a specific port then figuring out my router doesn't even support it

somber verge
#

my router does support port forwarding, but my dad (who configured the router) forgot the password

#

and even if i tried, i can't get that to work

split hazel
#

I think you can reset your routers' settings (and password) by inserting a pin into a small hole somewhere on it

somber verge
#

the problem would be that, we'd have to entirely reconfigur the router using an ethernet cable, and my pc doesn't like that router (i plugged another routher into that one and then connected my pc to the other one)

#

also my pc is the only one which would be close enough to not cause any problems

split hazel
#

True true

royal fog
#

Hello

#

I'am Need The Website

split hazel
royal fog
#

tysm

#

Woho? The Discord Bot List Do New decor?

#

New Style?

split hazel
#

Maybe, and for future messages not regarding development, please use #general

earnest phoenix
#

@royal fog No

stark flume
#

Hey could anyone help with coding my bot, im trying to add in a welcome message with a picture like this (not this exactly like but similar) but want the welcome message to be customize like if someone does !welcome (welcome message) im not the best with coding and having difficulties with this

earnest phoenix
#

Wow

#

@stark flume try canvas-constructor

#

Its a npm package

#

Very simple to use

#

it work like embed

stark flume
#

ok thxs

earnest phoenix
#

Its in javascript

#

Idk what library do you use

prime cliff
#

@stark flume that is part of an api btw

split hazel
#

I personally use JIMP

stark flume
#

ok, i can use javascript i prefer python but javascript is fin

sage bobcat
#

One message removed from a suspended account.

split hazel
#

Yes

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

split hazel
#

Decent knowledge of it.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

split hazel
#

I've already told you, i have made a mistake.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

split hazel
#

Honestly yes, but besides

sage bobcat
#

One message removed from a suspended account.

split hazel
#

You could fetch x amount of messages from the current channel, then map the collection to only grab the message content & author user+tag (if needed) and then use fs to write it all to a text file (joined by \n\n) and then of course send the txt file

earnest phoenix
#

why not POST the text to hastebin

#

and send the hastebin link

#

saves you from working with filestreams

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

mental solstice
#

I wouldnt respond to a user who isnt allowed to use a command. potential for trolls to abuse rate limits.

#

the d.js docs should have the function for grabbing a set amount of messages in a channel

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

mental solstice
#

link me

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

split hazel
#

<textchannel>.fetchMessages({limit: 10}).then(messages => {

mental solstice
#

idk JS very well, but enough to help u.. I'm not sure what clean would be? is text => just a dynamic function?

indigo geyser
#

FileNotFoundError: [Errno 2] No such file or directory: 'FUN_FACTS.png' how can I import the file?

split hazel
#

Looking at so, I think you'd have to create the actual file yourself.

mental solstice
#

put the picture file in the same directory as the class that's calling it?

indigo geyser
#

i tried it

mental solstice
#

output your directory, to make sure it matches

indigo geyser
#

i don't understand sorry

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

split hazel
#

<textchannel> is just a place holder, you'd have to replace that with the actual channel property yourself

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

loud salmon
#

@slender thistle good job

sage bobcat
#

One message removed from a suspended account.

split hazel
sage bobcat
#

One message removed from a suspended account.

split hazel
#

How is the bot supposed to know what channel you're referring to

sage bobcat
#

One message removed from a suspended account.

split hazel
#

And where is guild defined?

sage bobcat
#

One message removed from a suspended account.

split hazel
#

Discord.js doesn't define it if you don't define it yourself

sage bobcat
#

One message removed from a suspended account.

split hazel
#

maybe message.channel ?

sage bobcat
#

One message removed from a suspended account.

split hazel
#

guild isn't a defined property, you need to get it through another property

#

like message

sage bobcat
#

One message removed from a suspended account.

split hazel
#

message.channel is not a function

earnest phoenix
#

@indigo geyser use fs

#

fs if its a local file, superagent (my favorite) if its online

indigo geyser
#
    await channel.send(file=discord.File(fp, 'new_filename.png'))``` this?
earnest phoenix
#

cz_happy_cry_cat shit i forget people use other things

#

sorry im a js dev

indigo geyser
#

oh

split hazel
#

Yeah, don't think python has fs

#

But you can easily google alternatives

#

python alternatives to fs

indigo geyser
#

ok tnks

earnest phoenix
#

either way

#

maybe you should put the full directory there ThinkPika

indigo geyser
#

okkkk

#

tnks

earnest phoenix
#

try it

indigo geyser
#

ok

sinful lotus
#

how much req can an sql db run?

#

per sec

sage bobcat
#

One message removed from a suspended account.

split hazel
#

@sinful lotus alot depending on the speed of your disk

sinful lotus
#

How much connections do you recommend?

split hazel
#

Connection? Are you using something like MySQL?

sinful lotus
#
const createPools = [
    { name: 'settings_1', options: { connectionLimit: 3 } },
    { name: 'settings_2', options: { connectionLimit: 3 } },
    { name: 'mute_1', options: { connectionLimit: 3 } },
    { name: 'mute_2', options: { connectionLimit: 3 } },
    { name: 'api_1', options: { connectionLimit: 3 } },
    { name: 'api_2', options: { connectionLimit: 3 } },
    { name: 'api_3', options: { connectionLimit: 3 } },
    { name: 'api_4', options: { connectionLimit: 3 } },
    { name: 'patreon_1', options: { connectionLimit: 1 } },
    { name: 'patreon_2', options: { connectionLimit: 1 } }
]
#

connection pools

#

bascially I separated the pools

zealous veldt
#

uwu

sinful lotus
#

so Im wondering if how much connections I can have to optimize speed + perf

#

the connection limit is the # of connection available

zealous veldt
#

I think the obvious solution is to have your bot have a shard for each user and each shard should a minimum of 500 connections

sinful lotus
#

500 is too much I thinnk so lmao

#

and I cant also have more than 32k connnections per mariadb instance

#

Im always having troubles on optimzing my maria db instance

#

lmao

earnest phoenix
#

What are you doing that you have to worry about mysql limits

sinful lotus
#

idk not that familar with mysql limits myself

#

thats why im asking

earnest phoenix
#

It depends on how well your tables are made, indexed

#

The structure of your data etc

#

And most people make a pool of connections and keep reusing them

sinful lotus
#

around 48k rows 8mb

#

and yes I do that

earnest phoenix
#

If you need more connections you increase your pool

#

How are the rows structured

sinful lotus
#
const createPools = [
    { name: 'settings_1', options: { connectionLimit: 9 } },
    { name: 'settings_2', options: { connectionLimit: 9 } },
    { name: 'mute_1', options: { connectionLimit: 5 } },
    { name: 'mute_2', options: { connectionLimit: 5 } },
    { name: 'api_1', options: { connectionLimit: 3 } },
    { name: 'api_2', options: { connectionLimit: 3 } },
    { name: 'api_3', options: { connectionLimit: 3 } },
    { name: 'api_4', options: { connectionLimit: 3 } },
    { name: 'patreon_1', options: { connectionLimit: 1 } },
    { name: 'patreon_2', options: { connectionLimit: 1 } }
]
#

for settings, its the command guild id as unique key

earnest phoenix
#

Different databases?

sinful lotus
#

nah same db

#

should I think of making it separate?

#

just diff tables

earnest phoenix
#

No no but the library is weird

#

It makes a pool for every table?

#

Rather than making a pool for the whole database

sinful lotus
#

thats the pool to a database

#

basically thats my pool at that db Kashima

#

whole in whole

#
this.pool = this.client.poolCluster.of('settings_*')
#

settings will use the settings pool only

#

mutes will use the pool for them only

#

something like that

earnest phoenix
#

Well you usually have a pool of connections for the whole database

#

And then you run queries that affect each table

sinful lotus
#

yeah it is a pool for the whole database

earnest phoenix
#

const createPools = [
{ name: 'settings_1', options: { connectionLimit: 9 } },
{ name: 'settings_2', options: { connectionLimit: 9 } },
{ name: 'mute_1', options: { connectionLimit: 5 } },
{ name: 'mute_2', options: { connectionLimit: 5 } },
{ name: 'api_1', options: { connectionLimit: 3 } },
{ name: 'api_2', options: { connectionLimit: 3 } },
{ name: 'api_3', options: { connectionLimit: 3 } },
{ name: 'api_4', options: { connectionLimit: 3 } },
{ name: 'patreon_1', options: { connectionLimit: 1 } },
{ name: 'patreon_2', options: { connectionLimit: 1 } }
]

sinful lotus
#

its just categorized so a module of my bot will have their own pool to the database

earnest phoenix
#

Oh why

sinful lotus
#

basically the api part will only get the pool on the api named pool

earnest phoenix
#

I doubt that this is needed

sinful lotus
#

so settings have 18 pool in the database
mutes has 10 pools
api system has 12 pools
patreon has 2 pools
of connections in the database

#

its just so if one of my pool clusters fails and reconnect they can still use othe other pool

#

something like a high availability stuff

earnest phoenix
#

Okay and how often your bot has to access the database

#

Every message?

sinful lotus
#

before I used to cache the settings in a map

#

but it gives me a bit of problems so Im gonna let it query directly to db

earnest phoenix
#

Well that could cause bottlenecks and lag, it isn't recommended

#

And invalidate the cache entry each time the settings of the server get updated

#

How many guilds your bot serves

sinful lotus
#

yeah thats what I used to do before on map but sometimes its failing to sync causing issues

#

Im thinking of what they say as redis as cache

#

but Im not sure how do that work with mysql

earnest phoenix
#

Or you can use redis to store everything

sinful lotus
#

that should have been my first choice if not for my sneaky co devs that want to use sql

#

now I need to redesign a lot of things again pssh lmao

earnest phoenix
#

Both of them store data in the ram

sinful lotus
#

yeah but probably I might just use redis directly although Im still thinking about what should I take as a design choice

#

I can also implement partial caching like when the settings does not exist in cache thats when I should update it

#

fetch it

#

but webdashboard will be my next problem there

earnest phoenix
#

You can use redis over mysql to cache things, but your application is probably not that huge

#

Like, mysql can handle tons of requests

#

The only bottleneck would be the latency

sinful lotus
#

its local hosted

earnest phoenix
#

But it depends on where you host your mysql server

sinful lotus
#

so I dont think latency will be a problem

earnest phoenix
#

Go ahead then and query the database in every possible msg that can contain a command

sinful lotus
#

6ms per req

#

but I'll probably switch to nosql in future

#

depending on how things escalate

#

also last thing if you dont mind

earnest phoenix
#

Mysql is fine, you can probably upgrade to mariadb

sinful lotus
#

also I use mariadb right nnow

#

since I believe it is the more optimized version of mysql?

earnest phoenix
#

Yeah

sinful lotus
#

Also one last thing, mariadb has settings as far as Im aware of?

#

is there a good setting there that I might want to change

earnest phoenix
#

Nah not really, you don't have to modify anything

#

I have been serving thousands of visitors with a single mariadb instance

#

It can easily handle millions of rows

#

Just don't do things like SELECT * FROM guilds

#

And then loop over in ur code till you find the guild you want

sinful lotus
#

oh ofc I dont do that

#

thanks for the reassurance yayy

earnest phoenix
#

yeah im gonna logout now if you want anything else let me know

sinful lotus
#

sure thanks RaphiThumbsUp

earnest phoenix
#

i need someone to join my glitch project and help edit $ to e@

#

what?

#

wdym

#

nvm i finished it

opaque eagle
#

Rofl glitch

west spoke
earnest phoenix
#

Is it possible fo change the discriminator of a bot?

west spoke
#

No

drowsy sentinel
#

Yeah, you pretty much just have to get lucky.

earnest phoenix
#

How I make a invite of a server that my bot is in

#

eval bot.guilds.get('id').channels.random().createInvite().then(invite => message.channel.send(invite.url) );

#

Thx

#

It didn't work yo

#

@earnest phoenix

#

error?

#

change random to first()?

#

random is better

#

I gotta wait until my bot goes back online

#

first() is generally a category

#

not all times

#

Its working for me @earnest phoenix

#

Show me what do you do

#

This is what I'm doing

#

e@eval bot.guilds.get('584813944611274752').channels.random().createInvite().then(invite => message.channel.send(invite.url) );

#

I get no response back

#

Tf

#

It says missing perms

#

Possible way:

  1. Invalid id
  2. No channels
  3. You have client and not bot
#

Or missing perm

#

yes

#

I have let bot = client

#

Is it not set up correctly

#

[ '414229698445574144', '251123922005786624' ]11:46 PM

#

What

#

Why do you send an array??

#

Wait how did I lose my devs

#

I had var devs = [ '414229698445574144', '251123922005786624' ]

#

I lost it

#

okay??

#

and how i can help u

#

Shits still not working

#

Because the bot doesn't have the permissions on the server

#

Maybe a private server

#

So dont insist

#

Ok

#

Yup ur right it's private

pearl jasper
#

what does vps do?

earnest phoenix
#

virtual private server

#

It hosts your bot

pearl jasper
#

hmm

earnest phoenix
#

Or a Minecraft server

#

or whatever you want it to

pearl jasper
#

i tried galaxygate

sinful lotus
#

I recommend Contabo

#

if you are finding a cheap vps

#

As for what vps is

#

its somewhat a "Dedicated Server" but at the same time it is not a dedicated one.
on a vps, you are all sharing a part of a dedicated server

pearl jasper
#

f

#

XD

#

wasted 5$

sinful lotus
#

basically VPS offers more power

pearl jasper
#

yeet

#

meh ill try contabo

sinful lotus
#

than a shared hosting as long as its not open vz

#

cause openvz is usually overselled than kvm

dusky marsh
#

Is there a function to get all the role ids of a member

twilit rapids
#

No, but you can loop trough all roles of a member and get their ID

dusky marsh
#

Thought so, thank you

twilit rapids
earnest phoenix
#

@broken elmBot

#

fk wrong ping

broken elm
#

wat

earnest phoenix
#

wrong person

#

sorry

#

:p

#

@earnest phoenix

#

ok my bot is here

last flicker
#

its muted seems legit

warm flame
#

Muted for responding to other bots

last flicker
#

how would I add a bot I have created to DBL?

warm flame
#

]]faq 1 --clean

covert turtleBOT
earnest phoenix
#

My bad, I forgot adding anti-bot messages while remastering my bot! Fixed now 😄

warm flame
#

Unmuted!

earnest phoenix
#

Thank you!

earnest phoenix
#

uhh is discord lagging

sinful lotus
#

not really

earnest phoenix
#

the image isn't appearing

sinful lotus
#

also make sure the embed was not deleted

#

embeds can be deleted now

earnest phoenix
#

it wasn't

#

oh it finally appeared

#

idk what just happened

#

but it did

sinful lotus
#

image server lag probably

#

or something like that

earnest phoenix
#

probably

earnest phoenix
#

.

#

xd

echo pasture
#

why

earnest phoenix
#

im updating my bot's nodejs version

#

it's hella outdated

drowsy sentinel
#

@echo pasture > It's just a user who accidentally tagged you instead of e@ban.

echo pasture
#

ok lol

earnest phoenix
#

this is why you dont use @s in bots

tulip solar
#

How so?

#

Did you add it to the website already>?

quartz kindle
#

it takes time

#

usually 1 week

frail ocean
#

]]faq 2 -c

covert turtleBOT
quartz kindle
#

it depends on how many bots are waiting

frail ocean
#

At the moment it’s looking like a week or two but it could change as the moderator count is going up.

tulip solar
#

yeah, it won't take a week tho trust me. The moderators are active and know their job is important so a lot of them hop on and go through a dozen bots or so and then stop. There are also a lot of new trial moderators and moderators in general that started.

frail ocean
#

Mhm, but please remember that we go in the queue so at the moment it should be getting quicker.

earnest phoenix
#

When I added my bot it took only an hour

#

It depends on timezones partially too

frail ocean
#

And how long the queue is.

real helm
#

Hello, who help me to do a command that it verify if a user has vote de bot.

spare goblet
real helm
#

I clikc in Generate Bot api key?

spare goblet
#

You'll need an API token to access the API, yes. You can do that on the bot editing page

real helm
#

Bro

#

If i don't have password to webhook?

slender thistle
#

Then don't use the authorization field

real helm
#

okay

earnest phoenix
#

Hey, I have a question, I have saw bots around on DBL with the description like this, could someone send me the html usage of this cause I've been looking into it.

spare goblet
#

it's markdown, not html

mossy vine
#

it does render as html tho, so you can inspect element it

slender thistle
#

Markdown supports tables?

spare goblet
#

yeah, mine uses md

slender thistle
#

TIL

mossy vine
#

it does, but its a pain to write

spare goblet
#

true that

real helm
#
let channel =message.guild.channels.find(channel => channel.name == "name");
  const dbl = new DBL("TOKEN");
dbl.webhook.on('vote', vote => {
  channel.send(`El usuario con ID ${vote.user} acaba de votar el bot`);
});
#

Is this correct?

spare goblet
#

don't use .find("name", string), it's deprecated btw

real helm
#

Yes, but the rest are okay?

warm marsh
#

message.guild.channels.find(channel => channel.name == "name");

real helm
#
let channel =message.guild.channels.find(channel => channel.name == "name");
  const dbl = new DBL("TOKEN");
dbl.webhook.on('vote', vote => {
  channel.send(`El usuario con ID ${vote.user} acaba de votar el bot`);
});
spare goblet
#

you need webhook auth

#

if you're using a webhook ??

real helm
#

and how I create it

spare goblet
#

and define dbl

real helm
#

idk

#

idk how i create a webhook

warm marsh
slender thistle
#

I'm fairly sure they meant the DBL one

warm marsh
#

Fair

real helm
#

What TOKEN i need put?

spare goblet
#

You can get the auth in edit page as well as token

#

I'm on phone so can't really help much rn

real helm
#

okay 😦

native thunder
#

If it is possible to print some icons in messages like emoji?

#

I'm parsing items for game from API and would like to print every item with small icons assigned to them.

spring ember
#

yes you can

native thunder
#

how?

spring ember
#

<:NAME:ID> for non animated emojis

#

<a:NAME:ID>

#

for animated emojis

native thunder
#

ah.. i would like to print them from url

spare goblet
#

You can make it an emoji

spring ember
#

like the image?

native thunder
#

right

spare goblet
#

Then paste it in there

native thunder
#

.jpg image from external site

spare goblet
#

Then delete the emoji lol

spring ember
spare goblet
#

Like make the bot create emoji, send message, then delete emoji

spring ember
#

@native thunder

spare goblet
#

If not then make it a tiny image and make it show up as image preview

earnest phoenix
#
iaraToday at 12:08 PM
Like make the bot create emoji, send message,  then delete emoji```

for people who haven't seen the emote and don't have it in the client cache it would appear as regular text
spare goblet
#

Oh right didn't think of that 🤔

native thunder
earnest phoenix
#

create a guild, invite your bot to it and upload your icons as emojis, then you can use those everywhere else, since bots are able to send custom emojis anywhere

native thunder
#

as external server got few thousands of icons... i cant download them all

spare goblet
#

You can use your own emojis for it

spring ember
#

<:NAME:ID> for non animated emojis
<a:NAME:ID>
for animated emojis

#

then again

#

once you upload use these ^

spare goblet
#

Bot can use other server emojis in all its other servers

native thunder
#

so you suggest to upload ALL icons?
This is not the good solution

earnest phoenix
#

it's the only solution

native thunder
#

Ok, but i don't want to create 50servers to upload ALL emojies

spare goblet
#

Yes

#

Then I'm afraid you haven't found a solution to your problem

#

Just make the bot make a few servers and then create emojis of the url

native thunder
#

heh.. i was hoped there are some better way to do it

spare goblet
#

Depends on what you're trying to do in the first place

native thunder
#

i was hoped will be some way to print icon in message without importing it to server

spare goblet
#

A tiny icon, you'll need an emoji. Wanting to embed it or show it as avatar in embed, then you use an embed

There's no other way(s) in my knowledge for my understanding of your needs

earnest phoenix
#

Wait @spare goblet, is there anywhere I can actually see how to use the DBL markdown format.

#

Cause the generator does not look the same as the DBL ones..

#

Well it does work but the generator looks weird and seems to be complicated to use, I'll probably figure it out tho.

spare goblet
#

@earnest phoenix hi. Normal markdown is basically the format. If it seems to not work you can always find another but it generally looks like this

titles more title
stuff more stuf
rows more row
#

It's just easy to use a generator if you don't know any md

earnest phoenix
#

Yeah I managed to do it 😃

half perch
#

Can someone help me with an error I have? I use Js for my code.
I'm getting an error that the discord.js module can't be found, but it is there and fully up to date. If anyone can help me with this thanks so much

spare goblet
#

@half perch try running
npm install

In your console

half perch
#

Oh that worked. Thanks so much

spare goblet
#

No problem. rollonthefloor_rolypoly

earnest phoenix
royal fog
#

i need help

slim heart
#

You must select one of the libraries

#

In the library drop down

#

@earnest phoenix lost on what you’re asking

earnest phoenix
#

i mean

slim heart
#

You want to know the version of canvas rn?

earnest phoenix
#

you know how every package has a version

#

yes!!

slim heart
earnest phoenix
#

thanks!

slim heart
earnest phoenix
#

2.5.0

slim heart
#

Yup! And the ^ means higher than that version just FYI

#

Higher than or equal to*

earnest phoenix
#

okay, thanks!

royal fog
mossy vine
#

@slim heart not exactly

slim heart
#

?

#

@royal fog yes you have to fill that out but that’s not the lib selector no

mossy vine
#

it basically means that you are fine with updates of that version, as long as theyre not major

slim heart
#

Oh oop @spare goblet ^

#

Wrong person

mossy vine
#

wrong one lol

slim heart
#

@earnest phoenix

royal fog
#

@slim heart this is lib?!

slim heart
#

Huh?

#

No you have to select the library you wrote the bot in

brave anvil
#

Hello

royal fog
#

hey im not good in english

brave anvil
#

I need some help with a bot dadhboard

#

Languages

mossy vine
#

as in making a dashboard?

royal fog
brave anvil
#

Yes

earnest phoenix
#

@slim heart yes?

mossy vine
#

@royal fog leave it empty

brave anvil
#

XD

slim heart
#

Sorry look above I was wrong about the ^ cyber corrected me

earnest phoenix
#

well

brave anvil
#

Idk

#

Umm

earnest phoenix
#

it doesnt matter cuz thats what i did with all my packages

#

@slim heart

brave anvil
#

@mossy vine

slim heart
#

👌 just was pointing it out instead of messing you up in the possible future

earnest phoenix
#

so when 2.6.0 comes out, the package will be basically updates

brave anvil
#

Yes @mossy vine making one

earnest phoenix
#

thanks

brave anvil
#

Any article or guides ?

mossy vine
#

@brave anvil if you have a specific question you should ask it. i highly doubt anyone would guide you through completely making one

#

i dont think there are any

brave anvil
#

Hm

#

F

slim heart
#

I made a guide on my yt but it’s trashy lol

brave anvil
#

I

#

Uhhhhhh

#

.......

slim heart
#

Basic understanding you’ll need is endpointing, as in things like express, you’ll need an open web server and a place to host the website and you’ll write front end JavaScript to interact with the endpoint

brave anvil
#

Making a status page on my web

#

I have an open webserver

#

Its rethink db

#

I have currently 3 servers connected to it

#

3 pcs making 3 server points

slim heart
#

That’s not a web server that’s a database. But you’ll have an express server to interact with via front end to interact to your backend database

brave anvil
#

Yes

slim heart
#

Look up some guides in express if you don’t already know how to, and you’ll pretty much be set, the hardest part tho keep in mind, is authenticating users because you don’t want to just leave it open

brave anvil
#

I have an Authentication

#

For users to login to my dashboard

slim heart
#

Yea so you check that when they send it in an auth header is recommended

brave anvil
#

Yeha

#

I could send dashboard but its

#

Ummm

#

Hosted locally and Its gonna be put through to a Nginx and droplet soon

#

Using Nginx and Digital Ocean

slim heart
#

Ok well good luck, sounds like you know a bit what you’re doing, if you need any specific help feel free to come back and ask

brave anvil
#

Okie

#

This is partially what it looks like

slim heart
#

👍 if you wanna show it off go to #memes-and-media since it’s not dev related but gj so far.

brave anvil
#

Thatnks