#development

1 messages ยท Page 421 of 1

earnest phoenix
#

arg

trim plinth
#

kek

earnest phoenix
#

And can I edit it through github

#

or not...

trim plinth
#

no

earnest phoenix
#

Don't put your token on github

wet ferry
#

DONT USE GITHUB 4 BOTS!

shy verge
#

GitHub web editor is a trap

#

@wet ferry .gitignore

wet ferry
#

true

earnest phoenix
#

I don't have my computer yet though

wet ferry
#

but it's still acessable

earnest phoenix
#

Plus private repos

#

Boi just use your own pc oliy

trim plinth
#

you'd rather have the files on your pc, then use filezilla to transfer them to your host

knotty steeple
#

if i log my token i get lol

earnest phoenix
#

Laptop

knotty steeple
#

which is the current server prefix

gusty topaz
#

By putting your bot on public github you are asking for trouble

earnest phoenix
#

for school

#

Same shiz

#

I have a private repo

shy verge
#

@gusty topaz how

wet ferry
#

still

#

it's bad

trim plinth
#

ok, use git clone then

wet ferry
#

^

gusty topaz
#

Clones, leaks

trim plinth
#

and clone the repo

earnest phoenix
#

I'm just so lost

wet ferry
#

ikr

trim plinth
knotty steeple
#

still dont know why it returns [object Object]

shy verge
#

If you're not a fucking retard then how would you leak anything?

knotty steeple
earnest phoenix
#

oh boi I'm uploading my bot to github I sure hope nobody looks at my token.json file...

wet ferry
#

BECAUSE IT'S AN OBJECT @knotty steeple

shy verge
#

gitignore isn't hard to configure

earnest phoenix
#

It is a private repo

lament meteor
#

@knotty steeple does it return ["lol"] or "lol"?

short siren
#

@earnest phoenix GIVE ME YOUR GITHUB XD

earnest phoenix
#

Sure

knotty steeple
#

"lol"

lament meteor
#

o

earnest phoenix
#

I'll pm

wet ferry
#

hmmm

lament meteor
#

idk i gtg

knotty steeple
#

actually just lol

wet ferry
knotty steeple
#

no

earnest phoenix
trim plinth
#

.gitignore is ez, just use the node template and shove the config file in there

knotty steeple
#

its on vps

wet ferry
#

hmmmm

knotty steeple
#

shared one mmLol

wet ferry
#

it should be on glitch

#

cause it's better

#

thats all I have to say

#

not looking at yer code

knotty steeple
#

how is glitch better than a vps

earnest phoenix
#

Whatevre I'm hosting it on somee

wet ferry
#

cause u can let others edit it

earnest phoenix
#

Whatever

trim plinth
#

why tho

earnest phoenix
#

lol jk

wet ferry
#

and look at it

knotty steeple
#

github is for that

earnest phoenix
#

@earnest phoenix u still getting errors

#

somee is terrible

#

Or no

#

yes

#

Did you update the code

#

Like I said

#

I don't even wanna code a fucking bot anymore I am so confused

trim plinth
#

glitch <<<<<< vps

earnest phoenix
#

Free hosting will always be worse than a vps

wet ferry
#

ik

shy verge
#

not this one

earnest phoenix
#

I don't wanna pay for a VPS though

#

Free hosting is shared

#

100%

trim plinth
#

@shy verge nice meme

earnest phoenix
#

I think I'm gonna go back to web development

trim plinth
#

ok

earnest phoenix
#

Bots are web dev hee.......

#

ik but website

trim plinth
#

no

#

bots aren't web dev

earnest phoenix
#

Technically they are

trim plinth
#

how

earnest phoenix
#

Discord bots

#

js

#

No

#

Separate segment

#

They interact with the Discord api

trim plinth
#

yes, but they aren't for the web

earnest phoenix
#

They're not websites

trim plinth
#

that's like calling osu! a web app because it interacts with it's own api

earnest phoenix
#

I think I'm gonna stick with heroku for now

#

gayroku

#

ik

#

Whatever suits you man

#

I use localhost

#

I'll prob use the linux VPS later

#

No issues never ever

#

I could host it at my house too ๐Ÿค”

#

But my slow ATT internet will slow to a halt

#

Of it's a small bot it's ideal

#

If*

#

Besides you can also setup a db server

#

I can host it on a pi

#

Or something

#

db?

#

Database oliy

#

o

shy verge
#

pi < heroku

#

the best solution is to use skysilk

earnest phoenix
#

I host my bots on Windows 93

shy verge
#

same

earnest phoenix
#

Using IIS

trim plinth
#

I host my bots on Windows 9

earnest phoenix
#

I'll look into skysilk when I get my computer

#

cuz I have a chromebook rn

#

As my main

#

For skysilk I believe you need to enter your credit card

trim plinth
#

chromebook bloblul

earnest phoenix
#

If you don't have one then rip

#

It runs ubuntu

#

Gnome

#

I replaced chromeos

#

Gnome for servers Thonk

trim plinth
#

a chromebook that runs ubuntu GWmythsBlobGlare

earnest phoenix
#

USB boot

trim plinth
#

kek

earnest phoenix
#

Run windows 2000 on a usb drive

#

Chromeos is still there

#

I'm a hacker now

#

waw

#

I wanna try to fix this

#

I'm prob gonna add some simple commands and ditch bots forever

#

I told you how to fix your bot

#

When did yoi start getting errors anyway

#

It got lost I guess

#

today

#

arg

#

What did you add in

#

Undo it

#

100% fixed

#

Case closed

#
2018-05-27T15:55:21.425681+00:00 app[worker.1]: client.user.setPresence({
2018-05-27T15:55:21.425684+00:00 app[worker.1]:             ^
2018-05-27T15:55:21.425685+00:00 app[worker.1]: 
2018-05-27T15:55:21.425687+00:00 app[worker.1]: TypeError: Cannot read property 'setPresence' of null
2018-05-27T15:55:21.425690+00:00 app[worker.1]:     at Object.<anonymous> (/app/bot.js:29:13)
2018-05-27T15:55:21.425691+00:00 app[worker.1]:     at Module._compile (module.js:652:30)
2018-05-27T15:55:21.425693+00:00 app[worker.1]:     at Object.Module._extensions..js (module.js:663:10)
2018-05-27T15:55:21.425694+00:00 app[worker.1]:     at Module.load (module.js:565:32)
2018-05-27T15:55:21.425696+00:00 app[worker.1]:     at tryModuleLoad (module.js:505:12)
2018-05-27T15:55:21.425698+00:00 app[worker.1]:     at Function.Module._load (module.js:497:3)
2018-05-27T15:55:21.425699+00:00 app[worker.1]:     at Function.Module.runMain (module.js:693:10)
2018-05-27T15:55:21.425701+00:00 app[worker.1]:     at startup (bootstrap_node.js:191:16)
2018-05-27T15:55:21.425702+00:00 app[worker.1]:     at bootstrap_node.js:612:3
2018-05-27T15:55:21.479894+00:00 heroku[worker.1]: Process exited with status 1```
#

ik but I wanna have the custom presences

#

I saw that already

#

How do I fix it though.............

#

I told you

#

Many times

#

Not by removing it

#

Delete the second client login

#

Where

#

Omg

#

line 16 or somethign

#

Look for it

#

B o i

#

I saw that

#

ik it's deleted

#

It's somehwere in line 10-15

#

I d e l e t e d it

#

Okay did you try again

#

To run the bot

#

same thing....

#

Hastebin

#

Line 7

#

Change it with your token

#

ok

#

Don't delete the client login part

#

Just what's between ()

knotty steeple
#

ok i fixed the [object Object] thing with my prefix

earnest phoenix
#

it could be because bot not ready yet?

#

not certain

#

And don't upload the code anywhere

knotty steeple
#

thanks for the help that i didnt get

earnest phoenix
#

I don't think so

#

He said his code was working before

#

It is already there

#

ill check real quick

knotty steeple
#

nice token leak

earnest phoenix
#

It is not the full thing

knotty steeple
#

still

earnest phoenix
#

I could care less

#

Lmao

knotty steeple
#

lmao

earnest phoenix
#

It's a useless bot

knotty steeple
#

atleast i have part of your token

earnest phoenix
#

ye its because of that

knotty steeple
#

time to crack the rest

earnest phoenix
#

you're calling setPresence before bot is ready

#

I don't f u c k i n g care

quiet bobcat
#

also everything before the first . is just the client id of the bot to base64

#

so...

#

you can't do shit with it

earnest phoenix
#

Nice delete topik

#

ok

#

Lol

knotty steeple
#

reset that token

quiet bobcat
#

Why?

earnest phoenix
#

No need

quiet bobcat
#

It was just his bot's id to base64

earnest phoenix
#

Just fix the error first

quiet bobcat
#

it's basically useless @knotty steeple

earnest phoenix
#

ik how though

#

Put the token

#

There

#

Nnantis said smth

#

That could fix it

#

imma just do tht

#

you're calling setPresence before bot is ready - Ntanis

#

He might be right

#
2018-05-27T16:03:24.794106+00:00 app[worker.1]:                                                   ^
2018-05-27T16:03:24.794107+00:00 app[worker.1]: 
2018-05-27T16:03:24.794109+00:00 app[worker.1]: TypeError: Cannot read property 'DeTb' of undefined
2018-05-27T16:03:24.794111+00:00 app[worker.1]:     at Object.<anonymous> (/app/bot.js:7:51)
2018-05-27T16:03:24.794112+00:00 app[worker.1]:     at Module._compile (module.js:652:30)
2018-05-27T16:03:24.794114+00:00 app[worker.1]:     at Object.Module._extensions..js (module.js:663:10)
2018-05-27T16:03:24.794115+00:00 app[worker.1]:     at Module.load (module.js:565:32)
2018-05-27T16:03:24.794117+00:00 app[worker.1]:     at tryModuleLoad (module.js:505:12)
2018-05-27T16:03:24.794118+00:00 app[worker.1]:     at Function.Module._load (module.js:497:3)
2018-05-27T16:03:24.794120+00:00 app[worker.1]:     at Function.Module.runMain (module.js:693:10)
2018-05-27T16:03:24.794121+00:00 app[worker.1]:     at startup (bootstrap_node.js:191:16)
2018-05-27T16:03:24.794123+00:00 app[worker.1]:     at bootstrap_node.js:612:3```
#

I removed the token

#

But it does not like it

#

Which is why I used a variable

#

Boi

#

Lol

#

arg

#

I told you to remove what was between ()

#

wdym

#

The whole thing, not just the .token

#

o

#

Ofc it won't work

#

huh

#

As is

#

arggggggkgpoekep

#

kegp4o9ik49gkog

#

Replace what's between brackets

#

With your token

#

And put a " before and after the token

knotty steeple
#

cant u just define the token in your code

#

instead of using heroku's shit

earnest phoenix
#

Yeah

#

I have mine like: Client.login("mytoken");

shy verge
#

pls get real vps

earnest phoenix
#

Ez

knotty steeple
#

^ also

earnest phoenix
#

Since it's on localhost nobody has access to the file anyway

knotty steeple
#

shared vps is great ๐Ÿ˜‚

earnest phoenix
#

2018-05-27T16:06:47.965050+00:00 app[worker.1]: client.user.setPresence({
2018-05-27T16:06:47.965051+00:00 app[worker.1]: ^
2018-05-27T16:06:47.965053+00:00 app[worker.1]:
2018-05-27T16:06:47.965055+00:00 app[worker.1]: TypeError: Cannot read property 'setPresence' of null
2018-05-27T16:06:47.965057+00:00 app[worker.1]: at Object.<anonymous> (/app/bot.js:29:13)
2018-05-27T16:06:47.965058+00:00 app[worker.1]: at Module._compile (module.js:652:30)
2018-05-27T16:06:47.965060+00:00 app[worker.1]: at Object.Module._extensions..js (module.js:663:10)
2018-05-27T16:06:47.965061+00:00 app[worker.1]: at Module.load (module.js:565:32)
2018-05-27T16:06:47.965063+00:00 app[worker.1]: at tryModuleLoad (module.js:505:12)
2018-05-27T16:06:47.965064+00:00 app[worker.1]: at Function.Module._load (module.js:497:3)
2018-05-27T16:06:47.965066+00:00 app[worker.1]: at Function.Module.runMain (module.js:693:10)
2018-05-27T16:06:47.965067+00:00 app[worker.1]: at startup (bootstrap_node.js:191:16)
2018-05-27T16:06:47.965069+00:00 app[worker.1]: at bootstrap_node.js:612:3
2018-05-27T16:06:48.043126+00:00 heroku[worker.1]: State changed from up to crashed
2018-05-27T16:06:48.027268+00:00 heroku[worker.1]: Process exited with status 1

#

omfggg

#

orgpoergk

#

ARGGGG

#

I don't wanna do this anymore ._.

#

Me neither

native narwhal
#

What is this output ew

earnest phoenix
#

How did you write all that code

#

Yet not know how to these things

#

idfk

knotty steeple
#

its heroku @native narwhal

native narwhal
#

And that is? ๐Ÿ˜‚

earnest phoenix
#

Sounds fishy

#

I put things together

#

And it somehow worked

#

Sure

#

I don't even know

#

Okay

#

I gtg

#

yea

#

Ask someone else for help

#

I'm ditching this piece of shit

#

@harsh star

#

Did you even learn how to code

#

I know how to code

#

Not trying to be rude

#

Oh okay

#

I'm not good with JS

#

I'm rlly good with HTML/CSS though

#

I see

#

I'm taking a JS course over the summer, I'll prob restart once I have more knowledge

#

Well you better step up your js then

#

yea

shy verge
#

or learn a faster lang

#

like go

earnest phoenix
#

Angery

#

Like windows 93

#

whaterve imma go back to html

#

Good luck

#

@earnest phoenix

link Discord.js Guide, a guide with many detailed sections you can use to assist in your bot development!
link http://discordjs.guide/

gritty ice
#

is it possible somehow to use Discord's voice call through a VoIP or phone bumber system?

quasi marsh
#

Yes

#

It's paid tho

#

So you could but you'll probably need to charge for bot use

gilded blaze
#

@earnest phoenix does that

earnest phoenix
#

I have another mongo related question

#

I have the following document:
{user:1234, meta:{name:{field1: 0, field2}}}And I want to be able to add another "name" field to "meta" while keeping the data intact. How would I go about it?

#

I want to keep everything as is but add new fields basically

short siren
#
var thePresident = new pizzapi.Customer(
      {
          firstName: 'Barack',
          lastName: 'Obama',
          address: '700 Pennsylvania Avenue, Washington, DC',
          email: 'barack@whitehouse.gov'
      }``` for like the firstname last name adress and email that can be saved right?
shy verge
#

store whatever you want, but since it's not provided by Discord you HAVE to encrypt it

earnest phoenix
#

no

#

such info can't be saved like that

#

users have to agree on it and you also need to provide them ways to do stuff

#

read up GDPR

#

@earnest phoenix aren't you a mongo user? Maybe u could help me with my little issue

#

imo don't go that way, doesn't worth the effort to try and do a domino's bot, legal wise

#

I really need to read the documentation again

#

at least if you want to make it public xD

#

ehh nao no

#

I am the sometime-I-used-firebase user

#

Oh yeah

#

Lol

#

I'll read the docs then

#

They must have an article about this

#

Yep I'm a noob, just found out I can use $set

earnest phoenix
#

Got it to work :3

#

well

#

I thought i did..

#
if (typeof property !== 'boolean') return message.channel.send(`Instead of using ${property}, try using a boolean (true/false)`)```
#

is this because its a string?

gilded blaze
#

yes

trim plinth
#

messages are always returned as strings

#

not bools

gilded blaze
#

parse the string

earnest phoenix
#

okie

#

with JSON.parse()?

trim plinth
#

no

gilded blaze
#

no

trim plinth
#

boolean !== json

earnest phoenix
#

ah

gilded blaze
#

do Boolean(string) to parse it

earnest phoenix
#

okay

#

so

#
property = Boolean(property)
        if (typeof property !== 'boolean') return message.channel.send(`Instead of using ${property}, try using a boolean (true/false)`)```
gilded blaze
#

yes try that

earnest phoenix
gilded blaze
#

u should probs check if the string is actually true or false first

earnest phoenix
#

okay

#

this?

#
if(property.toLowerCase() == 'true') Boolean(property)
        if (typeof property !== 'boolean') return message.channel.send(`Instead of using ${property}, try using a boolean (true/false)`)```
#

I see on stack this is what they use

#
Boolean boolean1 = Boolean.valueOf("true");
boolean boolean2 = Boolean.parseBoolean("true");```
gilded blaze
#

o

earnest phoenix
native narwhal
#

Java is not JavaScript

gilded blaze
#

ok good

earnest phoenix
#

Oh sorry I just realized i was in the wrong stack

gilded blaze
#

i was like wtf

earnest phoenix
#

weird

native narwhal
#

What is it you're trying to do?

earnest phoenix
#
if(property.toLowerCase() == 'true') Boolean(property)
        if (typeof property !== 'boolean') return message.channel.send(`Instead of using **${property}**, try using a boolean (true/false)`)```
#

check if property == boolean

#

but its a string

shy verge
#

just to save some sanity I would make it a toggle instead of parsing a string into a bool

earnest phoenix
#

so check if a string is a boolean

gilded blaze
#

uhh ya

#

Boolean does return true

#

wrong fuc

#

nc

native narwhal
#

Why don't you just do

if(property.toLowerCase() === 'true') {

}else if(property.toLowerCase() === 'false') {

}else{
    return message.channel.send(`Instead of using **${property}**, try using a boolean (true/false)`)
}
gilded blaze
#

^

#

so much easier

earnest phoenix
#

ew ๐Ÿ‘€

#

lol

#

okay

#

I had that before but it just looked messy

gilded blaze
#

you could use switches

#

if u really want

#

but that works

knotty steeple
#

what if instead of 'boolean' do Boolean

earnest phoenix
#

it still returns a string sam

#

typeof does

knotty steeple
#

mm ok

#

wait u cant do that

#

im dumb ๐Ÿคฆ

earnest phoenix
#

this works :3

#
property = property === 'true' ? true : 
                    property === 'false' ? false : 
                    property;

        if (typeof property !== 'boolean') return message.channel.send(`Instead of using **${property}**, try using a boolean (true/false)`)```
#

nvm i just added a || id

hearty bramble
#

W O K E coding:

if (response.get(1).toLowerCase().equals("true".toLowerCase()) {
    // its true
} 
earnest phoenix
#

rly gud

tardy hatch
#

Guys

#

I want to know

#

At a simple command

#

For python

#

For example:

#
@bot.command(pass_context=True)
async def uptime(ctx):
    await bot.say('Uptime {}'.format(uptime_here)```
#

How to set uptime

gusty topaz
#

in discord js, when the promise returned by #Client.login resolves, am I 100% sure that the login was successful?

#

Like if I have await client.login(config.token);, can I be sure that after that point the client is logged in

#

and I can do super fancy shite with it

#

okay I found this in d.js code

      this.client.once(Constants.Events.READY, () => {
        resolve(token);
        this.client.clearTimeout(timeout);
      });
knotty steeple
#

0w0

gusty topaz
#

no need to answer anymore

restive silo
#

@gusty topaz Yes, it logged in succesfully but that doesn't mean that its ready yet, you need to wait until the Client emits the "Ready" event after that you can work with it as normal

mental solstice
#

isnt boolean 1 or 0?

slender thistle
#

@mental solstice 1/0, True/False.

mental solstice
#

was reading above and they are trying to figure out to set boolean from a command. I assume he would have needed to use 1 instead of true

earnest phoenix
#

at that point its a string, it all comes down to how the bot interprets it

slender thistle
#

@tardy hatch Haven't you had a code for that before?

tardy hatch
#

Nope

slender thistle
#
    def get_bot_uptime(self, *, brief=False):
        # Courtesy of Danny
        now = datetime.datetime.utcnow()
        delta = now - bot.uptime
        hours, remainder = divmod(int(delta.total_seconds()), 3600)
        minutes, seconds = divmod(remainder, 60)
        days, hours = divmod(hours, 24)

        if not brief:
            if days:
                fmt = '{d} days, {h} hours, {m} minutes, and {s} seconds'
            else:
                fmt = '{h} hours, {m} minutes, and {s} seconds'
        else:
            fmt = '{h}h {m}m {s}s'
            if days:
                fmt = '{d}d ' + fmt

        return fmt.format(d=days, h=hours, m=minutes, s=seconds)

    @bot.command(pass_context=True)
    async def uptime(self, ctx):
        await bot.say('Uptime {}'.format(self.get_bot_uptime)
#

You could use Google and learn a bit of Python, just in case.

floral stone
#

Dude

#

I have a one line function

#

to get uptime

#

well and a second convertor

tardy hatch
#

@floral stone u can help me?))

floral stone
#

I'm not a trained therapist but I could try

#

What do you need?

tardy hatch
#

To set uptime

#

In command

#

In this line:

#
 await embed.add_field(name="Uptime", value=uptime)
 await bot.say(embed=embed)```
#

There

#

With format or

#

To set uptime

#

And how

floral stone
#

do pip3 install psutil

#

import psutil, time

tardy hatch
#

Okay.. i imported

#

And at value, how to set there uptime

#

Ffs

floral stone
#
secs = round(time.time() - process.create_time()), 3)```
#

Seconds will return the amount of time your process has been running

tardy hatch
#

At value?)))

floral stone
#

hmm?

#

var secs is the amount of seconds

tardy hatch
#

await embed.add_field(name="Uptime", value=)

#

Here

floral stone
#

add those 2 lines above

tardy hatch
#

value=(process, secs))

#

Is okay?

floral stone
#

await embed.add_field(name="Uptime", value="{} seconds".format(secs))

#

I updated the code

tardy hatch
#

Okay

#

And, i can t transform secs to minutes?

floral stone
#

yes but I'm on mobile

#

can't find the function

tardy hatch
#

Oh

floral stone
#

you could just divide the seconds by 60

tardy hatch
#

I ll try to transform single

knotty steeple
#

so my serverinfo command is broken in this server

#

is there any way to make it not broken

uncut slate
#

that question is so vague the best answer I can give you is "fix it"

knotty steeple
#

lol

topaz fjord
#

@knotty steeple elaborate

trim plinth
#

@tardy hatch don't run stuff from root

#

you rather just run from a user account

tardy hatch
#

File "bot.py", line 130
secs = round(time.time() - process.create_time()), 3)
^
SyntaxError: invalid syntax

#

I moved

#

On user

trim plinth
#

ok

tardy hatch
#

But i have error

trim plinth
#

I don't really use python that often so I can't help you there GWnanamiKonataCry

tardy hatch
#

@floral stone how can i convert seconds to minutes and hours? ๐Ÿค”๐Ÿค”

trim plinth
#

maths

tardy hatch
#

For bot

#

Ffs

trim plinth
#

more like long maffs

tepid laurel
#

Ez maths

#

But pretty sure theres modules that do the same

#

๐Ÿคท๐Ÿผโ€โ™‚๏ธ

earnest phoenix
#

How do i convert python to maffs

#

Do i delete system32?

#

multiply them

#

60 seconds = 1 minute

#

then convert minutes to hours

#

60 minutes = 1 hour

#

therefore 3600 seconds = 1 hour

#

or

#

60 * 60 = 1 hour in seconds

#

Lol

tardy hatch
#

@earnest phoenix how to set in code, ffs

earnest phoenix
#

what language are you using

#

that should be basic stuff

#

if you don't know how to multiply in code

#

you might aswell take a whole course about it

tardy hatch
#

Python

earnest phoenix
#

I don't use python sorry

#

tbh you should know how to multiply in python

#

look it up

trim plinth
#

use some * s

#

example:

uwu = 4 * 20
earnest phoenix
#

psuedo code:

def StoH(s): // seconds -> hours
    return s * 3600;

def MtH(m): // minutes -> hours
    return m * 60;
tardy hatch
#

@trim plinth u can help me to put that in code..?

trim plinth
tardy hatch
#

=)()

trim plinth
#

it should be easy enough to do it yourself

tepid laurel
#

Wouldnt that formula return a massive number tho @earnest phoenix

hearty bramble
#

YOU

#

SHALL NOT

#

PASS

trim plinth
#

ok

tepid laurel
#

Lmaoo

#

Ok

gilded blaze
#

How would I wait for an event with JDA?

earnest phoenix
#

async jda??

#

what would return a massive number

#

@tepid laurel

#

that would be the actual seconds

#

which is what he asked for

gilded blaze
#

sure

#

so like a user executes a command and it asks a question

#

then it waits for message event

earnest phoenix
#

oh actually

#

hmm

tepid laurel
#

I think he meant an actual time

#

Like 00:00:00

verbal night
#

add the user to a list, then on the message event check said list, if the user is in the list, go from there

earnest phoenix
#

o rlly

tepid laurel
#

Ya

gilded blaze
#

hmm

earnest phoenix
#

you could use that formula + timestamp

#

use that formula to calculate ms

#

then timestamp - ms

#

or + depending on future or past

#

understand?

tepid laurel
#

Or you could just divide

earnest phoenix
#

yes divide

#

wait not divide

#

hold on

tepid laurel
#

Yeah fam

earnest phoenix
#

what does he wanted to convert

#

what does he want to get

tepid laurel
#

<seconds> / 3600

earnest phoenix
#

= hours

#

yes

tepid laurel
#

Or even do it with minutes which I think is better

earnest phoenix
#

that's what I said

#

it would be logical to use division instead of multiplication with the formula

#

I previously stated

tepid laurel
#

Ya but ur doubling it

earnest phoenix
#

??

tepid laurel
#

In that code u sent b4

earnest phoenix
#

oh true

tepid laurel
#

Which would return a massive number

#

Hence why I said it

earnest phoenix
#

yea It was supposed to be division

#

messed up

tepid laurel
#

Rip lol

earnest phoenix
#

that would make it HtoS

#

xD

tepid laurel
#

๐Ÿ˜‚๐Ÿ˜‚

earnest phoenix
#

oof

tardy hatch
#

Guys..

tepid laurel
#

Girls..

tardy hatch
#
@bot.command(pass_context=True, no_pm=True)
async def stats(ctx):

    process = psutil.Process(os.getpid())
    secs = round(time.time() - process.create_time(), 1)
    minutes = 1 * 60
    
    embed = discord.Embed(title = '__Stats__', colour = 0xFFFF);
    embed.add_field(name="Uptime", value="{0} seconds / {1} minutes".format(secs, minutes))
    
    await bot.say(embed=embed)```
#

I have this command

#

Okay?

tepid laurel
#

Great news

tardy hatch
#

How to set minutes

tepid laurel
#

Shout out

#

To you

#

For being repeative

earnest phoenix
#

dont spoof feed him

tepid laurel
#

Wasnt gonna

earnest phoenix
#

ik just saying

#

lol

tepid laurel
#

Lmaooo dw

#

@tardy hatch did you follow math class

earnest phoenix
#

lmao

#

rekt

tepid laurel
#

Rip

tardy hatch
#

Ffs

tepid laurel
#

Sake is not here mate

tardy hatch
#

I don t ask for jokes

#

Look.

#

I want to set bot, if seconds is 60, to set at 0 and to add one minute

tepid laurel
#

Okay and

#

Wait not and

#

First of all where do you get your 60 seconds from?

#

Is it from your bots actual uptime, do you guess it, did you set an interval

#

Whatd you do

earnest phoenix
#

I call that a wizard explanation where someone tells you something and expect you to know the context of the question thus making you a wizard

tardy hatch
#

In my bot

#

Is only seconds

#

From seconds i want t

#

To set in minutes

tepid laurel
#

Bruh if I got paid for being that wizard so often even just 50 cente

tardy hatch
#

Or to add minutes & seconds

tepid laurel
#

Id be a millionaire by now

#

I think a lot can relate

#

@tardy hatch in your bot is not an actual understanding

#

In your bot is so much you probably dont even know half about

#

So how did you once again get the 60 seconds

#

Is it from your bots uptime

#

?

tardy hatch
#

Wait

#

My bot uptime

#

Is set in seconds

tepid laurel
#

No shit

#

Sherlock

tardy hatch
#

I need to know how to add minutes

#

:).

tepid laurel
#

Youve been told many times

#

Its simple maths

tardy hatch
#

Waaaait

#

If i set:

tepid laurel
#

But you will have to store the minutes somewhere

tardy hatch
#

minutes = secs * 60

tepid laurel
#

What

tardy hatch
#

For example

tepid laurel
#

No

tardy hatch
#

If seconds is 2

tepid laurel
#

Thats multiplying

#

Bruh

tardy hatch
#

Minutes will be 120

tepid laurel
#

If u did that

tardy hatch
#

Yea

tepid laurel
#

What a fucked up thing to do

#

If you want to get the actual minutes

#

You need to divide the seconds

#

And round it to no decimals for clean look

tardy hatch
#

Yeah

#

I don t fucking know how to divide =)))))

unique solar
#

'/'

tepid laurel
#

<seconds> / 60

unique solar
#

you should probaly do some basic programming tutorials if you dont know math operators

tardy hatch
#

@tepid laurel

tepid laurel
#

What

tardy hatch
#

How to setttt

#

To divide

unique solar
#

'/' is the divison operator

#

so var = 120 / 60

topaz fjord
tardy hatch
#

minutes = secs / 1

#

?

#

ohhhh

#

OOOOOH

topaz fjord
#

minutes = secs / 60

#

tf

tardy hatch
#

thanks

#

minutes = secs / 60

#

Or?

unique solar
#

yes

tardy hatch
#

Okay

#

Thanks

trim plinth
#

you should probably learn basic python syntax before making a bot if you don't know how to even divide with it

tardy hatch
#

I got it

unique solar
#

That youtuber is good I learned basic clsip and c# from his videos

#

at the start

tardy hatch
#

@unique solar and i want to remove seconds..

#

When seconds will be 60

#

To set at 0..

unique solar
#

round it up you mean?

topaz fjord
#

I think you should take a look at that video and google a bit

unique solar
#

I dont know python. So your gonna have to look how to round in python

tepid laurel
#

@tardy hatch use something like

tardy hatch
#

Ffs

tepid laurel
#

round(<yourvar>, 0)

#

Which should round it to zero decimals if Im right

topaz fjord
#

wdym ffs

unique solar
#

dude if you wanna make a bot then your gonna have to learn at least basic programming

#

period

topaz fjord
#

do you think were all just gonna help you when you make no effort to try and google?

unique solar
#

dont give up immediatly and come here for help

#

do stuff yourself

tepid laurel
#

Cant blame them for being sick of that๐Ÿคท๐Ÿผโ€โ™‚๏ธ

topaz fjord
#

and now he disappears

unique solar
#

like the stuff we are telling you is what I learned on the very first day of my first programming class ever in grade 11

tepid laurel
#

Basic shit

topaz fjord
#

like i can google, "how to round a number in python" and like a million results will come up

tepid laurel
#

Yup lmao

tardy hatch
#

Man

#

When seconds will be 60

#

I want to add +1 at minutes

#

And to remove -60 at seconds

#

..

tepid laurel
#

You just make a var from it

unique solar
#

i aint helping you anymore and reccomend nobody else help you until you figure shut out your self

#

basic shit

ruby dust
#

I doubt you'll really get the exact code you want, you just need to learn it yourself..

inner jewel
#

^

#

it's just basic math

tardy hatch
#

I did it..

tepid laurel
#

Your equations are okay but if you wanna do what you want to

tardy hatch
#
@bot.command(pass_context=True, no_pm=True)
async def stats(ctx):

    process = psutil.Process(os.getpid())
    secs = round(time.time() - process.create_time())
    minutes = round(secs / 60)
    hours = round(minutes / 60)
    days = round(hours / 24)
    
    embed = discord.Embed(title = '__Stats__', colour = 0xFFFF);
    embed.add_field(name="Uptime", value="{3} days\n{2} hours\n{1} minutes\n{0} seconds".format(secs, minutes, hours, days))
    
    await bot.say(embed=embed)```
knotty steeple
#

why have it say days even tho there is no days

#

or hours

ruby dust
#

man there's an easier way of doing uptime, with the time module

knotty steeple
#

make like a function to add hours if there is hours

ruby dust
#

or was it daytime

#

I don't remember

earnest phoenix
#

wtf is wrong with the api

inner jewel
#

doesn't python have the % operator?

gilded blaze
#

can't send to bots

inner jewel
#

it's way easier to do with that

ruby dust
#

it does

topaz fjord
#

as far as u know a bot cant dm a bot

earnest phoenix
#

Electron is a user ;3

knotty steeple
#

yes

#

@earnest phoenix did you make it send the error

earnest phoenix
#

yeah

ruby dust
#

I mean you can just use time module's divmod to do basic uptime

knotty steeple
#

why tho

earnest phoenix
#
member.send(`You've been kicked from ${message.guild.id} for ${reason || "No reason specified."}`).catch(e => {
            message.channel.send(`Didn't send the reason to ${user.tag} because they have dms blocked ERROR: ${e}`)
        })```
#

Well i needed to know what was happening

tepid laurel
#

Dont send to a member

#

๐Ÿคญ

knotty steeple
#

it could just be Didn't send the reason to ${user.tag} because they have dms blocked

tepid laurel
#

Send to a user

earnest phoenix
#

I did before

knotty steeple
#

just saying

earnest phoenix
#

that didn't work either

gilded blaze
#

dms could be blocked

earnest phoenix
#

No

tepid laurel
#

Broooo

earnest phoenix
#

he just took a screenie

#

right before

ruby dust
#

why even say that? it can just fail that silently

tepid laurel
#

What is member

#

You dont

#

Send

#

T

#

O

#

A

#

Member

earnest phoenix
#

its a member object ๐Ÿ‘“

tepid laurel
#

Nooooob

#

God

earnest phoenix
#

smh

tepid laurel
#

Just said that

earnest phoenix
#

thats why im using user now

tepid laurel
#

Already

#

And you dont even read it

inner jewel
#
val seconds = time % 60
val minutes = time / 60 % 60
val hours = time / 3600 % 24
val days = time / 86400```
#

considering time is in seconds

earnest phoenix
#

zoomeyes read the screenie

#

smh

topaz fjord
#

who said he doesnt have this

#

in user settings

tepid laurel
#

^

#

Thats a thing too

inner jewel
#

blocking the bot/not having a common guild/disabling DMs

#

all of those can give that

topaz fjord
#

idfk why they have 2 settings

#

its stupid

tepid laurel
#

Well one is global

#

Other is per server

ruby dust
#

one is for when you want it disabled on new servers, so you don't get dm spammed by bots

earnest phoenix
#

just had to use await

tardy hatch
#

Guys

earnest phoenix
#

:3

tardy hatch
#

On command error, for example potato akdkdksksksk, how to make bot to response with Command not found.

knotty steeple
#

dont

#

please

tardy hatch
#

:))

tepid laurel
#

Thats so fucking annoying

knotty steeple
#

no unknown command responses

tardy hatch
#

I have a code

ruby dust
#

mainly asking how to annoy users the common way

tardy hatch
#

But it s wrong

knotty steeple
#

your bot will be instantly denied/muted mmLol

topaz fjord
#

if you do that your bot will get muted here

#

nice edit

tepid laurel
#

Loool

tardy hatch
#

*i don t want to make bot public, ffs

knotty steeple
#

but if you do disable it here

ruby dust
#

actually, why warn him? not like he ever listened to us, so lets just help this little dude

knotty steeple
#

well im gonna go because i dont know python

tepid laurel
#

Well you could do it e.g by storing your commands in the cache or so

#

Or in a array whatev

#

If it dont exist somewhere in there or whatever make it return that memeโ˜ ๏ธ

tardy hatch
#

Okay

tepid laurel
#

Now dont come back here asking again how

#

Google the rest ok

tardy hatch
#

xd

#

okay

#

Thanks for help

tepid laurel
#

A few searching hints tho

#

Use logical keywords to what you need

#

Theres a difference between like e.g 'python how to check if a command exists' or like 'python command cache/ python array usage (has/push)'

#

And np๐Ÿ‘๐Ÿป

summer kraken
spring bone
#

How i can get the inviteurl created of the user?

#

I tried to .fetchInvites() but he still returning a object promise

topaz fjord
#

did you do await on it

floral stone
#

I don't use Javascript

#

^

spring bone
#

oh...

topaz fjord
#

lmfao

buoyant estuary
#

How can I separate each command from my bot into a .js file inve sde sweat a file only?

floral stone
#

copy and paste

#

what

#

I can't read that

wanton walrus
#

What

spring bone
topaz fjord
#

english

wanton walrus
#

It went from english to spanish

topaz fjord
#

@spring bone show code

floral stone
#

what

#

wave wave?

spring bone
buoyant estuary
#

but if I use the command will the bot work? same without any reference where is the commands?

floral stone
#

how old are you?

buoyant estuary
#

my english is bad

floral stone
#

how old are you

buoyant estuary
#

so here is development chat, can you help me? '-'

floral stone
#

Sure, but you need to re explain your question so I can understand you.

buoyant estuary
#

I do not understand the purpose of asking my age. lmao

#

yeah

#

a moment

floral stone
#

It's just curiosity

wanton walrus
#

If you are under 13 you can get access to a special development channel mmLol

buoyant estuary
#

You must a folder called commands and inside this folder the .js files of each separate command, because I use a file and inside a file all the commands are there.

#

i'm 16 ..

floral stone
#

Copy and paste

#

Oh ok

buoyant estuary
#

Does More Copy and Paste Work? do not need a reference in the main file where are the commands?

floral stone
#

@wanton walrus I'm surprised people believe that

topaz fjord
#

you would need to create a command handler

wanton walrus
#

Ikr @floral stone

floral stone
#

I'm out

buoyant estuary
#

i'm only 16, so my english is bad, i speak portuguese fluently

floral stone
#

Turtle will help you, he owes me

buoyant estuary
#

i'm learning English

topaz fjord
#

i do? @floral stone

floral stone
#

yes

topaz fjord
#

for wat

floral stone
#

Being awesome ๐Ÿ˜‰

topaz fjord
#

owo

buoyant estuary
#

I'll do what I @floral stone said

floral stone
#

I'm just complimenting you

#

@topaz fjord

topaz fjord
#

owo โค

buoyant estuary
#

in visual studio code have a function to refactor the code and play in another file?

topaz fjord
#

i dont think so

buoyant estuary
#

ok

topaz fjord
buoyant estuary
#

ok thx s2

spring bone
#

~~ sorry again ~~~

topaz fjord
#

did you try without evaling

#

and in code

earnest phoenix
#

channe typo

spring bone
#

@topaz fjord no

topaz fjord
#

then try it

spring bone
#

Ok

earnest phoenix
#

hello ๐Ÿ‘‹

#

message.channe => message.channel

topaz fjord
#

also what Ntanis said

earnest phoenix
#

also send(x) won't work

#

x will be an invite collection

topaz fjord
#

anyways you wouldnt be able to fetch the invites for here

#

our bots dont have the perms

quasi hearth
#

anybody know stuff about heroku?

earnest phoenix
#

I have this

#
var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database('./database.sqlite');

db.serialize(function(){



})
#

Idk what .serialize is but

#

Ima go with it

#

serialize?

#

you don't need that

#

as far as I know

#

did you read the guide?

#

I didn't know there was a guide

#

most packages have a guide

#

go to it's github page

#

im on it

#

you're on the wrong package

#

actually nvm

#

there it is

#

"Usage"

#

serialize is to create tables right

#

I just used a third party app then created tables

#

it's way easier

#

idk ๐Ÿ‘€

#

this looks weird to me

#
db.serialize(function() {
  db.run("CREATE TABLE lorem (info TEXT)");

  var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
  for (var i = 0; i < 10; i++) {
      stmt.run("Ipsum " + i);
  }
  stmt.finalize();

  db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
      console.log(row.id + ": " + row.info);
  });
});

db.close();```
#

you should use knexjs

#

instead of pure sql

#

okay

#

npm i knex --save right?

#

okay so

#
var knex = require('knex')({
  client: 'mysql',
  connection: {
    host : '127.0.0.1',
    user : 'your_database_user',
    password : 'your_database_password',
    database : 'myapp_test'
  }
});```
#

Im guessing sqlite3 is like the server and the db?

#

all in one?

uncut slate
#

sqlite3 is embedded, it doesn't have a client and a server, it's just a "client" if you want to think of it that way

earnest phoenix
#

^

#

knex is compatible with multiple db types

#

find the snippet for sqlite

#

oh i see

#

so

#
var knex = require('knex')({
  client: 'sqlite3',
  connection: {
    filename: "./database.sqlite"
  }
});```
#

knex isn't really required to use sqlite3

#

it'll just make things easier

#

ye i need it easier

#

lol

unique solar
#

has anyone used the XDocument libary in .net?

#

im in c#

shy verge
#

xml = bad

#

use newtonsoft.json instead

buoyant estuary
#
let commandfile = bot.commands.get(cmd.slice(prefix.length));
#

have error on this line?

gilded blaze
#

cmd is not defined

buoyant estuary
#

ok thx

unique solar
#

@shy verge Ive seen newtonsoft on nuget package manager. Just curious though, in your opinion why is xml bad?

shy verge
#

slow

#

painfully slow

unique solar
#

ive used json before so I might as well

west raptor
#

People can still talk when they are muted. My bot is made in discord.js.

buoyant estuary
gilded blaze
#

you would use the timestamp or whatever it's called

#

so you get miliseconds

#

then parse that with math

buoyant estuary
#

"timestamp" : "..."

gilded blaze
#

uhh

#

u need an integer

earnest phoenix
#

is there a way to integrate the level coding into individual commands instead of into index.js

unique solar
#

like seperate commands into different files?

#

havent used js in a long time but im pretty sure there is a 'include' function

static lynx
#

im so confused

#

so, my bot is working fine, right?

#

i decide to change it (just a bit)

#

and i get IndentationError: unexpected unindent

#

which is weird, because i havent messed with that part of the code

#

so, i try to fix it, then i get Syntax Error

sweet fox
#

well you'll have to tell us what the syntax error is and what the code looks like

static lynx
#

the ban command is the one that isn't working (336)

#

oh and ty for helping

sweet fox
#

hm looks fine but frankly I don't know python and am on a phone

static lynx
#

hm.. okay

#

thanks for attempting, though.

delicate zephyr
#

you know that its not saying anything because it not bot.say its ctx.say

sweet fox
#

get a code linter for your ide and you won't have syntax or indent errors

#

I'd assume there's linters for python

delicate zephyr
#

the syntax is fine

#

also just a heads up @static lynx this is counted as api abuse

static lynx
#

hm

#

would it cause errors?

delicate zephyr
#

it'll get you ratelimitedโ„ข

static lynx
#

k ty

#

ofc i try to install a linter, but it never works

slender thistle
#

@delicate zephyr Is it ctx.say?

#

I thought it was ctx.send. thonk_think

delicate zephyr
#

thats rewrite

#

hes on async

slender thistle
#

Wouldn't that be bot.say(message)?

delicate zephyr
#

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

slender thistle
#

Wait what

#

Really

#

Async does not have ABC's, though. I doubt ctx.say would work.

delicate zephyr
#

youre rgith

#

I wrote my own thing for async

#

๐Ÿ˜›

slender thistle
#

Nice.

delicate zephyr
#

@uncut slate is this self-promotion? ^

uncut slate
real ginkgo
#

Can I ask a question?

olive drum
#

About development, sure.

real ginkgo
#

What is it when people use shards?

olive drum
#

Shards are basically only for big bots.

real ginkgo
#

Ok.

#

I looked a bot's website.

olive drum
#

Only for 2.5k+ guilds.

real ginkgo
#

It says shard 1, then displays stats, and on.

olive drum
#

Anyway, it's a partial instance of the bot.

#

Ok

real ginkgo
#

Is it for what servers the bot's on, and how its running?

lament meteor
#

shards is splitting the bot into 2 instances

fleet mason
#

@uncut slate its something we need XD. it think its pretty relevant

uncut slate
#

not to this channel, no

olive drum
#

Basically it decreases gateway load and increases performance.

#

"apparently"

real ginkgo
#

I was just wondering because like, are shards all the servers the bot is connected to, but each server has it own shard?

olive drum
#

No.

real ginkgo
#

Oh.

olive drum
#

A shard is an instance for a certain amount of guilds.

lament meteor
#

it splits it into 2....

olive drum
#

.

real ginkgo
#

I went onto a bot's website and it says shard 1, connected, and bunch more info, and so on.

olive drum
#

Not just 2.

#

Yeah.

real ginkgo
#

What does the connected and running part mean under each shard?

earnest phoenix
#

python

olive drum
earnest phoenix
#

yes

olive drum
#

I can't help you there.

real ginkgo
#

I use discord.js

midnight widget
#

I use js