#development

1 messages · Page 1094 of 1

faint prism
#

You know a few languages, so you should catch on pretty fast

#

C# has some interesting things like Interfaces and abstractions though

#

Delegates, funcs, actions and other lamba/linq

#

Which are seen less in some other languages

lusty quest
#

funny thing is i started to learn GO and py a little bit but never got into it bcs my bots are written in Js. (also had some issues with getting a GO enviroment running for development)

faint prism
#

If you want to see how similar JS and C# bots are, here's the tutorial I watched for a C# bot with discord.net:
https://www.youtube.com/watch?v=e2iaRVf4sho

lusty quest
#

time to learn C#

pure lion
#

Ye

earnest phoenix
#

So writing a privacy policy kind of thing for a bot is necessary or Optional?

solemn latch
#

will be required

lusty quest
#

is not that i need to throw it in my brain together with extensive kowlede in G-Code, Docker, K8s, Linux Stuff, Windows Stuff, Networking Stuff, Useless Stuff and the languages i know

pure lion
#

Which langs do you know?

pure lion
#

Oh got it

lusty quest
#

well know lua and js. some Py and Go. Then English, German and some Dutch

earnest phoenix
#

@gilded plank bots 180112943612952577

gilded plankBOT
#
Bots <:dblCertified:392249976639455232>

@oak sentineldblCertified
@autumn widget
@frank niche

lusty quest
#

also G-Code is some sort of Programing but on a way lower level and completly different usecase

pure lion
#

I know js, frontend stuff (HTML and CSS) and C, and I wanna learn the other 2 C langs and py

faint prism
#

Go for C#

lusty quest
#

ohh right forgot that i learned some HTML and CSS

pure lion
#

Eyyyy

#

Also ejs it counts as a separate lang because of the file ext jajajajajajajajajajajajajajaja

faint prism
#

Knowing C# means you also know Java for the most part

earnest phoenix
#

oops

pure lion
#

I've heard that yeah

west quarry
#

@gilded plank bots @west quarry

gilded plankBOT
pure lion
#

I can't see I'm on mobile ajajaj

faint prism
#

I can't see and I'm on PC lol

pure lion
#

Eyyyyyyyyyyyyy

lusty quest
#

any suggestions on what net core version? would go for 3.1 then

faint prism
#

yeah

#

3.1 is solid

ashen shard
#

guys

pure lion
#

I literally only downloaded VS to use C# lmao

ashen shard
#

how can i press the middle mouse button in python

pure lion
#

Um

faint prism
#

Keycode

sinful belfry
#

@west quarry @earnest phoenix keep bot commands in testing channels please

ashen shard
#

i copied someones code that uses selenium and chrome extension so i have the somethingsomething.click

#

i can click but i don't know which makes the middle mouse button click

faint prism
#

That's one way lol

ashen shard
#

i want to open something in new tab

faint prism
#

Selenium probably has that ability

pure lion
#

"I copied someones code"
pepowot

ashen shard
#

lol

#

%95 of coders amirite @pure lion

pure lion
#

No

ashen shard
#

lol

pure lion
#

You are very not right

west quarry
#

@west quarry @earnest phoenix keep bot commands in testing channels please
ok sorry

ashen shard
#

@faint prism what should i google to see the click etc. commands

pure lion
#

Don't google

faint prism
#

the only time I don't write my own is when I'm learning someone elses library for the first time

pure lion
#

You gotta feeeeeel the code

ashen shard
#

lol i only know begginer level c++ rn

#

so im bodging in the meantime

#

will learn python js c++ thoroughly tho

faint prism
ashen shard
#

thank you auger

faint prism
#

Learn from the examples, but write your own code.

earnest phoenix
#

im not sure which channel to ask this in but is heruko free?

wise quartz
#

Yeah

earnest phoenix
#

oki ty

pure lion
#

Don't use it tho

#

Please no

#

Aaaaaa

#

*cri*

earnest phoenix
#

sorry my bad starman

ashen shard
#

@faint prism profile_btn.click() is this usage correct?

faint prism
#

yourSeleniumDriverInstance.click() would probably be a left-click is my guess

ashen shard
#

yes

faint prism
#

I'm sure there is a mm btn click function somewhere in the docs

ashen shard
#

you mean in the link or in the files of the program?

#

im assuming the second

faint prism
#

Are you using the pylib I sent or selenium?

ashen shard
#

well the program i downloaded was originally using selenium, i just wanted to make a few adjustements

#

so selenium

#

but can't i use both?

faint prism
#

I'm familiar w/ selenium but not the lib I sent.

#

Selenium is a webclient driver. So most of your interactions in a chrome tab should be handled with it alone

slim robin
#

@grand storm

#

@silver fiber

ashen shard
#

so what do you recommend to turn profile_btn.click() into profile_btn.3rdbuttonclick()

pure lion
#

Define the 3rdButtonClick() as the third button click code

faint prism
#

So maybe something like: ActionChains(driver).key_down(Keys.MIDDLEMOUSE) Idk if that's a valid entry in the Keys enum though, just a guess

silver fiber
#

@silver fiber
@slim robin 😳

faint prism
#

Why are you using selenium though. Is it for a bot?

slim robin
#

@silver fiber oi

#

como vai?

faint prism
#

If so, I recommend adding options.add_argument('headless') so a window doesn't pop up every time

slim robin
#

bora bater nesses gringos safados 😡

#

CLBC GRINGO

#

FALA DMS

lyric mountain
pure lion
#

Oh

lyric mountain
#

tenha modos

faint prism
#

That's kinda rude

lyric mountain
#

(thx dice)

slim robin
#

@lyric mountain Ok, mais quem é você ?

ashen shard
#

@faint prism it is for a bot

lyric mountain
#

alguem que sabe se comportar em servers públicos

#

e desenvolvedor de bot

quartz kindle
#

kkkkk lmao

pure lion
#

(np KuuHaKu)

slim robin
#

@silver fiber

silver fiber
#

alor

slim robin
#

ele tá me aloprando

#

bora derrubar a acc dele?

opal plank
slim robin
silver fiber
#

se saia verme

solemn latch
#

Gettem erwin

grand storm
#

😳

pure lion
#

Omg

quartz kindle
silver fiber
#

vai que tem staff br aqui

opal plank
#

Tim

#

dont tell them

silver fiber
#

👀

slim robin
#

KKKKKKK

pure lion
#

Lmao

silver fiber
#

o u tim man KKKKKKKKK

#

é br

#

pensei que era gringo

delicate shore
pure lion
#

Gggg

faint prism
#

I think that falls under mini-moding

slim robin
#

Random

faint prism
#

It does seem to not follow rules 1, 3, 6 though

pure lion
#

*pings atmod* he's not speaking English

opal plank
#

Bruh wtf is this chat today?

#

Other languages

#

Ads

#

Random shitposts

#

like what the heck?

pure lion
#

Ikr smh

#

We try to code

#

"""try"""

solemn latch
#

.catch()

faint prism
#

throw

restive furnace
#

I know js, frontend stuff (HTML and CSS) and C, and I wanna learn the other 2 C langs and py
theres basically C & C++, but yeah C# is included.

#

Knowing C# means you also know Java for the most part
you dont need to

faint prism
#

It's an added bonus

pure lion
#

h

delicate shore
#

it got my bot added into 40+ servers

#

In 2.5 days

#

It's now in 115+

faint prism
#

Where should I host my bot? Currently self hosting in a VM.

pure lion
#

Dm me

lusty quest
#

there are some good VPS hosts

quartz kindle
#

any vps should be good enough

lusty quest
#

just dont get a Free one they suck

faint prism
#

I mean, SSH and SFTP is all I need

pure lion
#

Dm me because nobody loves me and i need friends 😔

cerulean venture
#

How would I go about actually reading the current discord js version ?

lyric mountain
#

I mean, SSH and SFTP is all I need
@faint prism tl;dr: get a vps

pure lion
#

Check your package.json

faint prism
#

ok ok, lol

cerulean venture
#

yeah that would be the easiest way I guess

#

was trying to make an info command with ping etc

faint prism
#

Any recommendations is my real question

solemn latch
#

I like galaxygate

lyric mountain
#

contabo is cheap 'n good imho

faint prism
#

Not aws?

solemn latch
#

Digital Ocean is well known

#

Aws works too

lyric mountain
#

DO is expensive af

lusty quest
#

not really

pure lion
#

Where can i host my express.js server?

solemn latch
#

Vps

restive furnace
#

DigitalOcean Gang

solemn latch
#

🤔

lusty quest
#

i know other that are more expensive

faint prism
#

DO: $5/mo

pure lion
#

Okay coolio

quartz kindle
#

contabo, ovh, galaxygate, google compute engine, amazon aws, vultr, etc...

#

ramnode, vpsdime, scaleway

digital ibex
#

@pure lion i recommend using LOC

lusty quest
#

i dont like ovh. Had a Root server there a few years ago and the Firewall was annoying

quartz kindle
#

upcloud, digital ocean

pure lion
#

LOC?

#

How much

digital ibex
#

if u want something free

#

yeah

pure lion
#

O

#

Is it good?

digital ibex
#

yeah

pure lion
#

Eeeeeeee

#

I can host my dashboard yaaaay

digital ibex
#

if ur code is efficient, u should be able to host ur bot & dashboard there until its like in 150 - 200 servers no problem

pure lion
#

Oh I have a bot host already

muted vortex
#

LOC?

lusty quest
#

lol i guess i can run up to 1k Guilds with my current host

digital ibex
#

oh

pure lion
#

But I can't find the IP lmao

lusty quest
#

ohh right you got the Docker Container

muted vortex
#

Got a link for LOC?

digital ibex
#

well yeah, superbrain. LOC is free.

pure lion
#

Yeah pandasad

digital ibex
#

DM me

lusty quest
#

free Hardware has always a Downside

delicate shore
#

Dm me because nobody loves me and i need friends 😔
@pure lion

I am your :)

digital ibex
#

im not tryna advertise or anything, their website is down

pure lion
#

Oh-

#

Lmao

faint prism
#

What is this LOC

pure lion
#

Secx

#

@digital ibex I'd access with IP:port?

digital ibex
#

yeah

lusty quest
#

actually i know a host who offered a VPS for 1€/Month when they rebranded themself

digital ibex
#

a code related community, augur

lusty quest
#

leauge of Oregon Cities?

digital ibex
#

no

#

library of code

delicate shore
#

LOC

#

Line of Actual Control

#

Which is border of China and India

digital ibex
#

lac and loc ma'am

faint prism
#

Maybe I'll just buy a cheap server to host myself lol

valid frigate
#

yo those aint cheap

faint prism
#

I've hosted before, power consumption was really the only thing

valid frigate
#

then feel free

lusty quest
#

if you have 1-2k$ spare buying a used Server is a valid thing

faint prism
#

And I'm thinking a raspb pi 4

lusty quest
#

then just rent into a datacenter with it

faint prism
#

super underpowered though

quartz kindle
#

if you have the money for it, why not

valid frigate
#

raspberry pi is interesting

quartz kindle
#

im paying $3 a month for my vps lol

valid frigate
#

lmao

#

do you think it's a good idea to run a bot on 2 different vps instances

faint prism
#

galaxygate looked pretty good tbh

valid frigate
#

just in different parts of the world

lusty quest
#

i guess my ecosystem is way to large for a bot of my size. like i have 3 Dedicated database Servers 1 Dedicated management server and 1 Production Server

valid frigate
#

im curious what would happen to the sharded connections

digital ibex
#

how big is ur bot?

quartz kindle
#

im trying to fit as much as i can on my vps

lusty quest
#

200 Guilds

quartz kindle
#

because i dont wanna pay more

digital ibex
#

how much storage do u use, tim?

faint prism
#

@lusty quest do you use a server cluster?

digital ibex
#

well ur biggest bot not u lul

lusty quest
#

the Database is running MongoDB in a Replicaset

restive furnace
#

arial, roboto, etc. are good for websites

digital ibex
#

i'd just use localhost on ur db so it doesnt take space away from the mongodb thing

faint prism
#

cOmIc SaNs

digital ibex
#

instead its using ur vps' stuff

faint prism
#

Good call

quartz kindle
#

it was using around 1gb because of user generated images, but i reworked it to store only the generation instructions

#

now the database is like 15mb

faint prism
#

nice

lyric mountain
#

use either helvetica or roboto

#

roboto is sexy af

faint prism
#

That's a solid optimization lol

digital ibex
#

tf

faint prism
#

roboto is sexy af
@lyric mountain YES

digital ibex
#

15mb storage??

quartz kindle
#

only the database

#

if you count node, npm and all the rest

#

then its more

lyric mountain
#

btw, remember to specify more than one font

restive furnace
#

use roboto or arial then

lyric mountain
#

like, Helvetica, Arial, Verdana

#

so you don't run into missing font issues

faint prism
#

I think you can add a fallback option

lyric mountain
sudden geyser
#

Trebuchet MS is best font

faint prism
#

Consolas is

quartz kindle
#

comic sans :^)

earnest phoenix
#

roboto ugly periodt

#

roboto is so overused in design and apps i get sick of seeing it

sudden geyser
#

new times roman scares me

digital ibex
#

sunglasses is nice

earnest phoenix
#

Is it possible to get vote updates without webhooks?
to reward users on voting

lyric mountain
#

well, yeah, but it's not the font's fault

#

sunglasses is nice
@digital ibex that's roboto bold

sudden geyser
#

Heem yes, there's an endpoint to check if a user has voted.

digital ibex
#

oh

sudden geyser
#

but I recommend using webhooks if you want it instant

lyric mountain
#

all of those are roboto

lusty quest
#

use webhooks for this

earnest phoenix
#

@sudden geyser like when a user vote, he gets rewarded

#

not in realtime, you will have to check for votes periodically

faint prism
earnest phoenix
#

if I use webhook, where do I get the webhook pass?

lusty quest
#

with the webhooks you get a call that contains the userid of the user that voted

lyric mountain
#

if I use webhook, where do I get the webhook pass?
@earnest phoenix you set it to whatever u like

#

you could use the word "cat"

#

or dog

lusty quest
#

webhook pass is a random string you generate

earnest phoenix
#

oh

lyric mountain
#

that pass is returned to u in the http request

earnest phoenix
#

thx

karmic compass
#

how do i check if a member is messageble in discord.js

lyric mountain
#

so you know that the request is coming from dbl

lusty quest
#

try and send a DM if it fails catch it

digital ibex
#

messageable?

karmic compass
#

message.author.send(content).catch(err => {
Message.channel.send('could not send this message')
console.error()
}

lyric mountain
#
message.author.send(content).catch(err => {
  Message.channel.send('could not send this message')
  console.error()
}
#

better

sudden geyser
#

is Message supposed to be capital

#

also missing )

karmic compass
#

ye

faint prism
#

How do you send your discord msg in a block like that

karmic compass
#

three `'s on either side

#

also

lyric mountain
#

```lang
code
```

sudden geyser
#

```language
code here```

faint prism
#
Oh snap
karmic compass
#

how do i make it so that way if it catches it, it sends that msg, but not the other one?

#

(my code btw)

faint prism
#

Replace what the catch does

karmic compass
#

wym

faint prism
#

Instead of just logging, call another function

lyric mountain
#

lemme see if I understood: you want the code to break if it catches an exception?

faint prism
#

that "sends that msg, but not the other one"

karmic compass
#

yes

#

because

lyric mountain
#

use .then

karmic compass
#

can i have some context i woke up maybe 10 minutes ago

earnest phoenix
#

@karmic compass console.error() ????

faint prism
#

logging

digital ibex
#

how2avoiderrorswhencatchingthem101

solemn latch
#

Your getting errors in your catch?

digital ibex
#

wait

#

what

opal plank
#

.catch(() =>{}) there we go no more errors

faint prism
#
try { Thing(); }
catch {Log("I don't want this. Take it back!"); throw;}
karmic compass
#

im tryna basically do this (just as cosmetic for context)

message.channel.send('woops')
} else {
(do this)
}```
faint prism
#
try
{
  if (what = thehell)
  {
    throw SpecificException;
  }
}
catch (SpecificException)
{
}
karmic compass
#

if i put in the catch "break" would it not send the next msg?

digital ibex
#

no

#

return instead of break

solemn latch
karmic compass
#

so .catch(err => { message.channel.send(':mailbox_closed: This user does not have their mailbox open!') console.error() return }) would techincally work then?

earnest phoenix
#
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});```
here vote.user is id right? or the mention of the user?
solemn latch
#

You have some small sizing issues sometimes

#

🤷

#

I dont think a single word can wrap

#

Nope

#

Guessing you have a left margin that's a minimum size

#

Below a certain screen size it can be removed and just center

#

Other than that looks great

#

Login system isn't complete, but im sure you know that

faint prism
#

The text element can resize to a minimum based on view port

lusty quest
#

@faint prism thx for recommending C#. its pretty easy to understand even if you used js before like the basic syntax is pretty similar.

digital ibex
#

helo

topaz fjord
#

js is ass mmLol

digital ibex
#

any idea how i can move the make the divs be in the middle?

#

thats what it is now

#

im using css grid btw

valid frigate
#

margin: 0 auto

digital ibex
#

kk

valid frigate
#

i think

faint prism
#

@lusty quest
No problem, if you haven't seen the ML.NET yet. You'll need Visual Studio and it actually scaffolds out a ML project for you based on the training data ready to go

valid frigate
#

do you have a wrapper div for it

still merlin
#

I'm trying to make my bot react with a custom emoji from my bots support server, That reacts on other guilds, How would I make my bot do that

faint prism
#

library of bytes that = emoji?

lusty quest
#

before i get into ML i write a bot with C# so i can learn it more

faint prism
#

Sure

digital ibex
#

same way you would in the guild the command is ran in @still merlin

#

but guild = clinet.guilds.get('guild id')

#

and yeah @valid frigate

#

it doesnt change with margin: 0 auto :/

lyric mountain
#

what about flexbox?

#

align-content: 'center'

digital ibex
#

im using css grid

lyric mountain
#

still

digital ibex
#

this iw what i've got now: css display: grid; margin: 0 auto; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 100px; grid-gap: 10px; margin-left: 13%; margin-top: 4%;

#

oh ok

#

doesnt change anything :/

#

~~ yeah ik i've got margin and margin ~~

#

no buli

valid frigate
#

O

#

well

topaz fjord
#

it's probably being overridden

#

by the last 2 margins

valid frigate
#

true

digital ibex
#

o ok

topaz fjord
#

the order you place them matters afaik

digital ibex
#

yeah

#

idk if it order matters tho

lyric mountain
#

it does

digital ibex
#

i was saying "yeah" it was being overridden by the bottom 2

topaz fjord
#

KuuHaKu is saying that order does matter

digital ibex
#

it was at the bottom tho

topaz fjord
#

that's why

#

it parses top to bottom

digital ibex
#

it starts from the bottom?

#

oh

lyric mountain
#

wait, no

digital ibex
#

i added a margin-top: 10px; at the bottom

#

and nothing changed :/

lyric mountain
#

try using flexbox

topaz fjord
#

you could always just shove a !important mmLol

#

don't actually

#

flexbox > grid

digital ibex
#

i fixed it by

lyric mountain
#

and i'd not recommend using absolute units for margins and stuff

digital ibex
#

removing the margin: 0 auto;

#
   .b-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 100px;
    grid-gap: 10px;
    margin-top: 30px;
   }```
lyric mountain
#

and i'd not recommend using absolute units for margins and stuff
else you might get something like discord

topaz fjord
#

lmao

digital ibex
lyric mountain
#

depends, do you want it to always be 10px away from the top, independent of screen size?

digital ibex
#

oh

#

on mobile, like 5 or something

#

and thats 30px btw

#

how would i do dis?

lyric mountain
#

if you want it to adapt to screen size, use flexible units

digital ibex
#

flexible units?

#

?

lyric mountain
#
% -> percent
vh/vw -> viewport height/width respectively
#

there are some more

digital ibex
#

oh

delicate shore
#

😘

digital ibex
#

what??

lyric mountain
#

for example

#

10vh would be equivalent to 1/10th of the screen's height

digital ibex
#

oh

lyric mountain
#

so basically 10% of screen's height

#

remember that % is based on the current parent, while vh/vw is based on the actual screen

digital ibex
#

oh

lyric mountain
#

vmax and vmin are exceptionally useful when you need to take the max/min value between screen's width and height

opaque eagle
#

Some CSS help required... how can I change the src of an image through CSS? I found this:
https://css-tricks.com/replace-the-image-in-an-img-with-css/

But trying it didn't work on my bot page. I want to replace my bot's image on the bot page with one that's transparent in some places (so it works well with DBL's night theme)

#

I tried ```html
<style>
div.bot-img img {
display: block;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: url(NEW_IMAGE_URL) no-repeat !important;
}
</style>

lyric mountain
#

why "background"?

#

also, the bot avatar is hardcoded afaik

digital ibex
#

are discords docs working for anyone else?

solemn latch
#

they are working for me

digital ibex
#

whelp

slender thistle
#

Discord has disconnected me on the desktop client today like 2 times already

#

and I mean connection drop, not a logout

digital ibex
#

i go to applications

#

and then it works for some reason

#

no idea what just happened there

sterile minnow
#

Does anyone know how i filter users that has a specific value on true from MongoDB? JS

slender thistle
#

Small hiccups on Discord's side probably

sterile minnow
#

ty

digital ibex
#

nvm

still merlin
#

i keep getting a ilegal break statement in my code 😔

 switch (args[0]) {
    case "poll":

      if (message.content.startsWith(prefix)) {
        if (message.author.bot) return;
        const pollMsg = args.slice(2).join(" ");

        if (!pollMsg) return
        message.channel.send("**error** you can't create a blank poll!")

        let pollEmbed = new Discord.MessageEmbed()
          .setTitle("New Poll @everyone")
          .setColor("#ff7f27")
          .setDescription(`${pollMsg} \n Be sure to vote!`)
          .addField("Reactions", "👍 Yes \n ➖ Not sure \n 👎 No ")
          .setFooter(`Poll created by ${message.author.tag}`);

        message.channel.send(pollEmbed).then(messageReaction => {
          messageReaction.react("👍");
          messageReaction.react("➖");
          messageReaction.react("👎")


          message.delete()

          break;
#

does anyone know how I can stop this from happening

digital ibex
#

thats not a switch statement

#

oh i never saw the top bit

#

i believe thats happening because of the returns u've got

#

change the returns to break

#

i think

still merlin
#

What returns to break it- I'm a bit confused

digital ibex
#

what

#

its a switch statement..

solemn latch
#

is it not because breaking in the wrong spot?

still merlin
#

Okay thanks

#

where would I put the break statement?

solemn latch
#

outside any if statements

digital ibex
#

change return for break

still merlin
#

What return though?

digital ibex
#

im not entirely sure if this is the issue though.

still merlin
#

Sorry bit confused you want me to change my return too "break;"

solemn latch
#

i dont see why returns are the problem 🤔

digital ibex
#

yeah, try it

#

i've never used return in switch statements

solemn latch
#

return just means stop doing whatevers going on

digital ibex
#

and i've never had it when using return, so no idea

#

break stops the code from running whats underneath too

still merlin
#

Exactly what I want to do

solemn latch
#

but continues after the break

#

return stops everything

digital ibex
#

no idea then, im just suggesting it because its worked for me without getting that error catshrug

#

not using break

#

but in my switch statements

amber fractal
#

break should be at the end of the case

#

outside of any if

solemn latch
#

^

#

which is what this error is saying

amber fractal
#

break, afaik, can only be used in loops and switch cases

still merlin
#

Wherever I put the break its still giving me ilegal break statement

digital ibex
#

yeah my bad 😓

still merlin
#

I went back and looked at some other code and I fixed it, Sorry for the waste of time

placid iron
#

never knew it existed

valid frigate
#

is this rust

placid iron
#

py

valid frigate
#

bruh

#

python seems like its an interesting language

#

yo async?

placid iron
#

there are lots of sleep methods just this one is inbuilt so that is cool

#

and yeah, async

valid frigate
#

yo thats crazy

placid iron
#

would be quite bad having to wait for somone elses command in another server to resolve before your one started ahahhaha

valid frigate
#

que

ashen shard
#

sup fellow mcdevelopers

#

not to be confused with mac developers

sonic lodge
#

what problems are you encountering

ruby elbow
#

does anyone know how I can run my bot 24/7 for free? Heroku recently changed their policy...

earnest phoenix
#

you cannot

amber fractal
#

heroku banning bots now too?

#

🦀

earnest phoenix
ruby elbow
#

How can this be

#

Is there honestly no where that you can run a bot 24/7 for free

#

I mean that's insanity

sonic lodge
#

it costs money to maintain a vps

#

if everyone offered free hosting they would be immediately out of business

amber fractal
#

it's insanity that people dont want to pay for something for you?

#

do you let people remotely access your pc?

cinder patio
#

VPS is basically a computer that stays up 24/7... maintenance isn't easy and there's good reason it costs money

midnight blaze
#

@ruby elbow there is , you could use an online ide

#

I am not sure if that is against the tos

ruby elbow
#

Ok, I'll look into it

earnest phoenix
#

someone has to pay for the resources spent, it isn't insanity, it's called "you're a cheapskater"

ruby elbow
#

It is insane, because having a free plan is a good business model, and 2 major services have been doing it for years up until this past month. Right when I decide to make a bot

midnight blaze
#

which 2 major services?

#

heroku?

#

or what? I am not uptodate with free services

earnest phoenix
#

those services aren't major in the slightest LMFAO what are you talking about

midnight blaze
#

heroku is not major?

#

what

earnest phoenix
#

major services are aws, google cloud and azure

midnight blaze
#

yeah, but they aint free

#

he is talking about free stuff

#

google cloud is not free

#

it is cheap

earnest phoenix
#

they have free trials

midnight blaze
#

tho

sudden geyser
#

They're partly free

sonic lodge
#

because people pay

earnest phoenix
#

still doesnt deminish the defenition of major

midnight blaze
#

xD

sonic lodge
#

in summary, it's not insane; it's necessary

midnight blaze
#

who cares about the definition @ruby elbow so which 2 services were you talking about?

ruby elbow
#

which 2 major services?
@midnight blaze heroku and glitch

#

btw Pang dm me about the IDE I have a question

amber fractal
#

inb4 it's repl and his token is leaked

ruby elbow
#

repl has a horrible reputation though

amber fractal
#

so did glitch and heroku for bots

sudden geyser
#

rep for what

ruby elbow
#

Glitch worked perfectly 24/7 for free for years

sudden geyser
#

no it didn't

ruby elbow
#

for me it did

midnight blaze
#

glitch is horrible anyway for serious bots, because it only will handle small projects, unless you pay for it

celest schooner
#

Why is reading code so hard

#

like its 10x easier to write it

sudden geyser
#

depends. Is it your code?

ruby elbow
#

My friend had a bot in over 500 servers and it used glitch

#

it was online 24/7

#

for free

sudden geyser
#

or were you writing it at 3 am

celest schooner
#

my old code

sudden geyser
#

Probably because you didn't document it // use comments

celest schooner
#

¯_(ツ)_/¯

sudden geyser
#

Use comments to describe complicated stuff or what something may mean if it doesn't make sense at glance

celest schooner
#

it was online 24/7
@ruby elbow glitch breaks like every week until they banned pinging

midnight blaze
#

it does not matter in how many servers the bot is in it, but I am talking about the possibilites a bot can reach. If you use canvas/collections and other stuff, your bot is going to eat a lot of CPU

celest schooner
#

doesnt the more servers that the bots in run more ram

ruby elbow
#

@ruby elbow glitch breaks like every week until they banned pinging
@celest schooner It didn't for me Thonk

midnight blaze
#

yes, ofc

ruby elbow
#

Pang dm me

sonic lodge
#

i highly doubt that bot stayed up 24/7 "for years"

midnight blaze
#

but I am not talking about that, I am talking about bots that get complicated and need more cpu

ruby elbow
#

Of course there was downtime, but nothing significant

midnight blaze
#

w/o considering the numbers of guilds

ruby elbow
#

which IDEs were you talking about before

earnest phoenix
#

you were misusing their services anyways, heroku and glitch were never and aren't meant for discord bots but rather for small apps and websites. because of so many people misusing and abusing with pingers, they had to take action and start banning such behaviour

ruby elbow
#

Yeah, ik

celest schooner
#

yea but glitch embraced discord bots until they broke glitch

ruby elbow
#

How else do you expect broke small time devs to do anything

earnest phoenix
#

get a temporary side job

celest schooner
#

hosting isnt that expensive

#

¯_(ツ)_/¯

ruby elbow
#

I'm 15 years old mate

celest schooner
#

ok

earnest phoenix
#

old enough to be employed

celest schooner
#

its 3 dollars per month

ruby elbow
#

Not old enough to have a job

sonic lodge
#

^

celest schooner
#

if you use galaxy gate

#

m8 ask ur parents

earnest phoenix
#

ive worked my ass off in retail at 15 and 16 but ok

ruby elbow
#

Even if some places would hire me, I don't have time

#

All the money I make I invest

#

I've been watching the NYSE since 13

earnest phoenix
#

you can also freelance so there's no excuse

ruby elbow
#

I live in Italy at the moment, with little Italian so yes there are excuses

earnest phoenix
#

i didnt ask

celest schooner
#

well you can do online freelancing

ruby elbow
#

You don't know the first thing about me or my situation so don't tell me there aren't excuses

celest schooner
#

you can freelance online ...

ruby elbow
#

I can't

#

for reasons I won't go into

earnest phoenix
#

...yes you can

celest schooner
#

dudes ip is banned from chrome

#

jk

ruby elbow
#

You want to hear why I can't?

earnest phoenix
#

freelancing became a thing online

celest schooner
#

I made money but my parents dont let me spend it lolo

earnest phoenix
#

oh yikes

#

my parents let me spend my money however i want at this point

#

i rarely ask for their financial support anymore

ruby elbow
#

that's what I thought, so don't tell me what should be able to do if you don't know what my situation is

earnest phoenix
#

i didnt ask

#

nor do i care

celest schooner
earnest phoenix
#

i said what i said, point blank periodt

ruby elbow
#

I didn't ask either

#

so stop poking at people for no reason

slender thistle
#

cut it out

earnest phoenix
#

...but you did ask

ruby elbow
#

I didn't.

slender thistle
#

all of you

ruby elbow
#

mod is here

earnest phoenix
#

but aight

#

you do you

ruby elbow
#

did you not read what the mod said

slender thistle
#

cut it out
thanks

#

If anyone keeps commenting, you will get muted

ruby elbow
#

I asked. You gave an answer that was so far from what is possible in my situation. Then you say you don't care. 3Head If you want to continue this in DMs go ahead, but don't be a prick and try and get the last word in

#

mute away

elder mural
#

@earnest phoenix

earnest phoenix
#

;-;

elder mural
#

@earnest phoenix I finally managed to program it.

slender thistle
#

Is there some special way to rename files so that Git sees the updated file name or am I miserably fucking it up without realization? 🤔

amber fractal
#

did a file lose tracking when you renamed it?

#

You can try to git add filename

slender thistle
#

They didn't, actually

#

git add doesn't seem to do anything noticeable

#

git status doesn't show any changes, at least

trim flax
#

!play the box

slender thistle
#

-botcommands @trim flax

gilded plankBOT
#

@trim flax

Hey! Bots aren't given permissions to send responses in this channel. Please use #commands or #265156322012561408 to run commands. In addition, bots with commonly used prefixes cannot read or send messages in any channel. This is done to prevent spam and bot abuse.

elder mural
#

It took hours for me to figure it out lmao

crystal socket
#

hey shiv, is there anyway to git add . automatically whenever you commit.

elder mural
#

@earnest phoenix Instead of it being a command it is now automatic.

#

I found it easier that way.

#

client.on('guildMemberUpdate', update =>

slender thistle
#

@crystal socket The only thing I can think of is a bash script catshrug

crystal socket
#

sounds good

amber fractal
#

there are some nice tools like git kraken

crystal socket
#

nah not using anything but cli git

#

and vim

amber fractal
#

Suit yourself

solemn latch
#

you always want to git add . when you commit?

misty sigil
#

is there any way that I could make my userinfo command alot more efficient?

#

I have to fetch all members to make it work

sudden geyser
#

Do you cache guild members?

misty sigil
#

yea

#

i cache em

#

not em all but

sudden geyser
#
  1. If the user passes a mention or text that looks like a user ID, look in the cache to see if you can get it. If not, try parsing the mention to get the user ID (or use the user ID you already got), then send a request to Discord asking for the guild member by ID (there should be a method for it).

  2. Look in the cache to see if you can find the user by name/tag/nickname/however you want it to. I wouldn't try fetching all members to search by name and instead rely on the cache.

Really, it's up to you to decide how to implement it. I'd avoid sending a request directly.

misty sigil
#

all id's are cached right?

sudden geyser
#

no

misty sigil
#

hm

solid falcon
#

Are VPS and VPS Hosting the same?

quartz kindle
#

yes

#

well

solid falcon
#

So can I build a Web using ordinary VPS?

quartz kindle
#

technically, a vps is the thing, and vps hosting is the company who sells the thing

#

but its basically the same thing

#

you can do anything with a vps

#

its like having a second computer

#

except that its not physically near you, you have to access it remotely

solid falcon
pure lion
#

*playing tf2 on my vps*

#

IP:port

solemn latch
#

Point the domain at the vps ip

#

You have to buy domains

pure lion
#

Probably at namecheap

slender thistle
#

So regarding my issue with files not being updated, it's fixed... somehow

solemn latch
#

Self solving issues

slender thistle
#

I re-cloned the whole thing and renamed stuff

earnest phoenix
#

how i can use the npm yt-search?

digital ibex
#

read the docs

solid falcon
#

Point the domain at the vps ip
@solemn latch ok lemme try

#

You have to buy domains
@solemn latch I already have at namecheap

solemn latch
#

Just create an a record pointing to the ip.
If you want www to work aswell, you can add an a record for that aswell

pure lion
#

Can you use cname and a host of www

#

?

solemn latch
#

i dont see why not

#

🤔

placid iron
#

I run my webserver off my pi lmao

pure lion
#

:D

#

On your home net?

#

Smaaaart

placid iron
#

Perhaps

pure lion
placid iron
#

Just don't hack me

pure lion
#

:D

placid iron
earnest phoenix
earnest phoenix
#

why song.title say undefined?

        let videos;

        yts(args.join(' '), function (err, r) {
            if (err) return;
            videos = r.videos[0];
        })
        let song = {
            title: videos.title,
            url: videos.url,
            time: videos.timestamp
        }
fast zenith
#

@earnest phoenix are you running that async? it's trying to define song before the yts function could return

solemn latch
#

^

sterile minnow
#

Does anyone knows how i remove EVERY reaction from a message

solemn latch
#

removeAll ?

#

depends on the lib

fast zenith
#

message.reactions.removeAll() for djs12 or message.clearReactions() for djs11

faint prism
#

Are VPS and VPS Hosting the same?
@solid falcon
Oh boy, I get to use my favorite similes:
One is like porn, and the other is like PornHub

unborn steeple
#

Im working on my website bot dashboard and im tryna implement markdown support to the changelog editor how would I do that?

earnest phoenix
#

use a library that does it for you or a whole load of regex and/or string manipulation

unborn steeple
#

What library is that?

solemn latch
#

youd have to find it, theres bound to be one

unborn steeple
#

I dont know what to search

amber fractal
#

"Markdown Parser HTML"

topaz cobalt
#

idk where to ask it but how do I do this reaction thing (its not a discord bot)

#

it says its a bot tho

earnest phoenix
#

It’s a webhook

unborn steeple
#

Webhook

topaz cobalt
#

with reaction?

unborn steeple
#

ye

topaz cobalt
#

how do I do that

opal plank
#

Undocumented

#

Webhooks can use custom emojis

#

But its undocumented bit of api

earnest phoenix
#

I don’t think webhook can use reaction

opal plank
#

I used it before but i dont recall

#

You had to send raw payload with token

#

Iirc

#

They can

#

Its just undocumented bits of the api

#

I dont think that was all though

light hinge
#

Iai

wanton nova
#

so it turns out digitalocean has a $50 credit for github students

#

so i applied

#

and today i got in

#

and then i realized that you need to create an account to apply the code, and you need a credit card for that

#

fuck

sudden geyser
#

same happened to me

#

so I never ended up using my own

wanton nova
#

why even have a credit for students when ur gonna require that

sudden geyser
#

lots do that. take aws for example

wanton nova
#

75% of the github students users don't have a credit card or a paypal account with $5

#

i thought you just need an aws educate account

sudden geyser
#

¯_(ツ)_/¯

solemn latch
#

how do students not have credit cards?

#

🤔

wanton nova
#

under 18?

sudden geyser
#

16 year old here

wanton nova
#

github students starts at 13 years lol

#

im 15

solemn latch
#

🤔

#

ive had a debit card of some kind since i was 15 or 16

wanton nova
#

yeah but thats a debit card

#

im pretty sure digitalocean doesnt accept that

solemn latch
#

debit cards work

#

ofc they do

wanton nova
#

oh wait

#

im stupid

#

i did not see "debit"

#

but yeah my parents dont trust me with a debit card

solemn latch
#

credit cards and debit cards are interchangeable

digital ibex
#

where do u live where they give u debit cards at 15 or 16?

solemn latch
#

uh

digital ibex
#

isnt that like

solemn latch
#

you can get them at 14

digital ibex
#

a bit too early

solemn latch
#

🤔

digital ibex
#

not where i live

solemn latch
#

gosh no, you can drive, you can handle spending your own money

digital ibex
#

not of which i know anyways

#

????

#

who allows 14 year olds to drive???

solemn latch
#

15 to 16 is 14?

faint prism
solemn latch
#

🤔

digital ibex
#

you can get them at 14

solemn latch
#

well, you can drive a tractor on the road at 13 technically, so yeah

#

i guess

#

14 aswell

digital ibex
#

tf...

solemn latch
#

i heard in idaho you can have a full license at 14

#

🤷‍♂️

digital ibex
#

wtf

#

when ur 16, u've got to be someone who has a full license when ur driving until ur 18

#

18+ u can drive

#

actually where i am

solemn latch
#

clearly you all dont trust your children enough

#

must have a lot of bad parents

digital ibex
#

england isnt even that bad

solemn latch
#

germany has dumb crazy driving laws from what ive heard

tight heath
#

what have you heard

#

am in Germany

solemn latch
#

4+ years of permit min, some like 30x my states driving permit time for adults

tight heath
#

wat

placid iron
#

Does anyone have a good idea about how to sync a database between two python scripts in real time without using too much read writes to the disk. Because currently it's writing at least once a second and I think i can just commit before a read happens but I don't know how I would go about that

tight heath
#

xyproblem

#

what are you trying to achieve with this

placid iron
#

Reduce disk usage

tight heath
#

no, by syncing the python scripts

#

what do they do

placid iron
#

One is for my webserver one is for the bot

tight heath
#

what does the web server display that needs all data from the bot?

#

wouldn't you just write any relevant data to a db or cache

#

and have an API to access that?

placid iron
#

Well I guess those are the things I'm asking for with this question

tight heath
#

I suggest you cache your data somewhere in memory

#

with a tool like redis

#

if it's high-write

#

otherwise just write it to db

#

and then have an API access wherever you store that data upon request from the frontend

placid iron
#

I have a small API script thing that has all the db stuff in it already so I'll look into the redis thing. It's a shame that the database tool can't have a memory database shared between processes otherwise it would be an easy thing to fix

sand scroll
#

where does it say the requirements for getting your bot approved

solemn latch
sand scroll
#

oh

sand scroll
#

well i look like a clown for not reading that channel dont i 🤡

solemn latch
#

also, generally speaking your bot should be up nearly 24/7

#

and #mod-logs helps for seeing the most common reasons bots get denied

sand scroll
#

ah i see

#

my bot is normally up but i have to take it down on my VPS when im editing the code

#

i get scared every time i do that because what if they're reviewing my bot

#

😔

zenith terrace
#

Anyone know why this error shows up
DiscordAPIError: Missing Permissions at RequestHandler.execute (/home/runner/FP-Bot/node_modules/discord.js/src/rest/RequestHandler.js:170:25) at processTicksAndRejections (internal/process/task_queues.js:97:5) { method: 'post', path: '/channels/689969083705196564/messages', code: 50013, httpStatus: 403 }

#

it has send messages perms on the channel

amber fractal
#

clearly not.

zenith terrace
#

it does

amber fractal
#

That will only show up if you dont have message send perms to the channel with the id 689969083705196564

zenith terrace
#

well it did

#

I double checked

#

both its role and itself had the send message perm on that channel

amber fractal
#

It also has read perms?

zenith terrace
#

mhm

amber fractal
#

idk any other reason that error would happen ¯_(ツ)_/¯

solemn latch
#

(╯°□°)╯︵ ┻━┻

zenith terrace
#

Even tried to give itself a bot role and did the perms with the channel and same error ¯_(ツ)_/¯

earnest phoenix
#

hi how do u make my bot open 7/24 open

solemn latch
#

host it on a good vps

crystal socket
#

really any vps

junior terrace
#

would I run in to problems using "s/" and "s " (s with a space after it) as prefixes for my bot commands?

crystal socket
#

what lang?

junior terrace
#

I mean usage problems, like maybe that conflicts with too many others

#

but I'm writing in Java

crystal socket
#

s/ and s isn't that much used

#

maybe just use 1

#

but i mean the most common prefixes are ! and / so you should be fine

junior terrace
#

I personally like the one with the /, but it's easier to say "s " on my phone

#

alright, thank you

crystal socket
#

yeah i think s/ is nicer. gl on bot approval!

earnest phoenix
#

@hot elbow

#

:))

meager crown
#

Hlw anyone else

hot elbow
#

hi

#

ma love

#

@earnest phoenix

meager crown
#

Hlw

crystal socket
#

why is this command not working for me? [link removed]

#

the bot is wokring okay but the command gives a error

amber fractal
#

regen your token

#

and what's your error?

digital ibex
#

np

amber fractal
#

it's og tags

faint prism
#

Wouldn't this work just fine.... lmao
if someBoolean and anotherBoolean:

#

Wait that's the same bool

#

Also, you just posted your token @crystal socket

#

You had better revoke that ASAP before someone else uses it

digital ibex
#

yw

sudden hedge
solemn latch
#

in order to get a message, you need to have a message event.
you also need to login

crystal socket
#

that seems like a cog or something

#

its in the 'commands' folder

sweet ruin
#

Hello. My problem is that When the bot does not have permissions to chat in a channel, he gives an error. It doesnt effect anything or shut the bot down. but it annoys the hell out of me.

#

How else am I supposed to catch the error and just make it go away?

solemn latch
#

you can check if the bot has permission to send messages in channels before sending them

sweet ruin
#

Well he does

#

just not that one channel

#

it isnt a global permission. it is one set by the channels

#

I tried the check permissions thing. it didnt help at al

solemn latch
#

if (channel.guild.me.permissionsIn(channel).has(['SEND_MESSAGES', 'VIEW_CHANNEL'])) return

#

this code returns if you dont have send or view channel perms

sweet ruin
#

so like this?

#

well with only Send_Messages obviously

solemn latch
#

! will invert it

sonic lodge
#

you put it in the middle of an if else block

earnest phoenix
#

That's correct, just you don't need the else { after that

solemn latch
#

also its not something you can just directly import.
channel wont be defined, message.channel will.

earnest phoenix
#

And the last }

sweet ruin
#

Yes, the ! makes it so that if it doesnt have permissions. then it returns. else it runs command

#

right?

earnest phoenix
#

In theory yes, but you don't need that else {

sudden hedge
#

How do I create a Message Event for the trigger word?

earnest phoenix
#

And the last }

solemn latch
#

return means stop 🤔

sweet ruin
earnest phoenix
#

It won't send anything and return if it doesn't have permission

#

Obviously

sweet ruin
#

Awesome

earnest phoenix
#

So that's the correct thing to do to avoid the error

sweet ruin
#

It works

#

but euhm

#

it also stops it from editing the database.

#

Fixed it

#

this is what I did

amber fractal
#

yes

#

Not with og, I think it uses the pages theme

#

Not positive on that

#

I know that you can though

viral iris
#
client.on("message", message =>{
    if (message.author.bot) return;
    if (message.content === `${prefix}img`) {
    message.channel.send("**Ok, Wait..**").then(message => message.delete({timeout: 5000}))
        message.channel.send(attatchment)
#

how to make it delete ok wait
then send the img

delicate shore
#

Omg

#

In matter of 6 hours

#

My bot got added in almost 100 guilds

#

Wow

#

It's now in 199

#

Without bidding

viral iris
#

@earnest phoenix ```js
await message.channel.send(attatchment);

delicate shore
#
bot.on("ready", () =>

 
       bot.setActivity(`with ${bot.users.cache.size} members in ${bot.guilds.cache.size} servers`)

       
       
)```
#

this is not working

#

idk why

karmic compass
#

its bot.user.setActivity

#

@delicate shore sorry for ping but:

bot.on("ready", () => {
 
   bot.user.setActivity(`with ${bot.users.cache.size} members in ${bot.guilds.cache.size} servers`, { type:'PLAYING' })

})

hopefully this should work?

#

can anyone help me out real quick?

#

i want to prevent this from happening:

#

it should just say the second one, but it says both of them for some reason

solemn latch
#

mailMan.send is probably async

karmic compass
#

i have client.on('message', function(message) {

#

how do i prevent it from saying the lower one + top one

#

i was told return would work

solemn latch
#

You'd have to await mailMan.send or .then()
Return does work, but its returning after the second send because promises.

karmic compass
#

would:

sdfjksldfkjslfjsldkjf
}))
sjfslkdjflksljlksfkl
``` work?
#

or what do i put in the .then ?

#

@solemn latch (read two messages above pls im depsperatr)

solemn latch
#

.then(m => {
}).catch(err => {
});

delicate shore
#

@delicate shore sorry for ping but:

bot.on("ready", () => {
 
   bot.user.setActivity(`with ${bot.users.cache.size} members in ${bot.guilds.cache.size} servers`, { type:'PLAYING' })

})

hopefully this should work?
@karmic compass thanks but i did with another way and it worked

karmic compass
#

alr

digital ibex
#

what do u guys think about this?

#

the 3rd div will be in the middle and centered

karmic compass
#

@solemn latch still does it, this is what i put. any final suggestions? (sorry for ping so much, you're epic)

digital ibex
#

use return

karmic compass
#

OH

#

dude

vernal basin
karmic compass
#

my brain is large

digital ibex
#

moyai

karmic compass
#

uh

#

@digital ibex still didnt work ;[

digital ibex
#

send ur code

karmic compass
solemn latch
#

Then runs after doing something
So you want your confirmation message in then

karmic compass
#

oh

#

wait

#

that's how that works?

digital ibex
#

return message.channel.send

karmic compass
#

time to test

#

these members are carrying me

solemn latch
#

The problem is returning in a promise doesn't work until the promise is resolved @digital ibex
Which his confirmation message was being sent before the promise resolved

karmic compass
#

ay, it finally works, ty for the helpers

#

wait

#

that was amazing grammar

#

alr cya

solemn latch
#

👋

digital ibex
#

huh

#

im going too

mild flower
#

I tried setting up a slowmode command where i wanted to detect whether the arg given was an integer or not. Why doesn't this seem to be working? It's not detecting it as a non-integer when i type a word as the slow time
if(Number.isInteger(slowtime)) return message.reply('Please provide a valid duration.')

earnest phoenix
#

anyone know what permissions are needed to create integrations?

ionic dawn
#

Hi, does anyone used Google Classroom API?

solemn latch
delicate shore
#

how to see

#

if my bot was on trending

#

alr

#

i forgot

#

how to make my bot respond to pings

#

like

#
msg.content.includes(`<@${bot.user.id}>`)```