#development

1 messages · Page 314 of 1

earnest phoenix
#

also, that JS wouldn't work

#

it would be incorrect URL format

noble hazel
#

no?

#

?name=val is to get the name

#

which it works perfectly

earnest phoenix
#

y tho

#

why use custom JS?

#

when HTML already has built in functions that handle this

#

your code just makes it harder

#

and doesn't even work for special characters

#

so basically I could put an entire essay in there with new lines and shit, and it would be correct URL format?

#

I don't think so

#

well gtg

noble hazel
#

because

#

i built a api that uses args to get the user

#

it uses ?name=USER NAME HERE

#

to get the user name

#

:v

formal hatch
#

someone help me D:

#
if (message.content.startsWith(prefix + 'createstreet')) {
    message.channel.send('➡ Mention what channel you want to create the street in:');
    const filter = m => message.author.id === m.author.id;
    message.channel.awaitMessages(filter)
        .then(collected => console.log(collected.size))
        .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));
  }
#

how would I use .then and .catch

#

(it's not completely modified so)

bitter sundial
#

Promises

earnest phoenix
#

yes

#

promises

#

are love

formal hatch
#

not again.... D:

#

promises

#

are complicated

#

for me

earnest phoenix
#

not

formal hatch
#

..is there some simple explanation as to what promises are

#

without the complicated in-depth stuff

bitter sundial
#

ok want a nooby explanation?

formal hatch
#

ye

#

😄

earnest phoenix
#

nano urban promise

#

bots can't speak

bitter sundial
#

you run the function, it does stuff

formal hatch
#

mm

bitter sundial
#

but it takes time to do stuff

#

waiting

#

oh it's done

#

the function is a promise so it runs the other function in .then

#

fun

#

oh no error! it goes to catch

formal hatch
#

ah

slow swan
#

promises are used when waiting for I/O

formal hatch
#

so basically .then == function inside a function

slow swan
#

io being network, hard drive

bitter sundial
#

function after function

slow swan
#

async operation1!!!

formal hatch
#

oh

warm canopy
#

is there a way to make a bot that can use google translate? xD

earnest phoenix
#

that is cool

#

with some apis

#

@warm canopy

warm canopy
#

hmm

earnest phoenix
#

thanks for this idea

warm canopy
#

@earnest phoenix found an api that works

#

and here are the language codes

earnest phoenix
#

pls no

bitter sundial
#

inb4 sneklab/gtranslate

earnest phoenix
#

oh yes

#

cool

#

but.. i dont use js

sonic kindle
earnest phoenix
#

google py example

#

what the fuck is that shitty python

south stone
#

I am ciol

earnest phoenix
#

agree @earnest phoenix google lib is bad

vital lark
#

^

earnest phoenix
#

Can someone tell me how to deploy discord.py to heroku?

vital lark
#

I'm not a d.py fan, D.js fan here

wheat root
#

Guys can you please tell me why it says that?

#

but look what I defined as user.

#
  if (!message.guild.member.kickable) return message.reply("cant kick an admin");
  message.guild.member.kick();
#

@umbral pelican like that?

#

It doesnt work

#

it's not a function

#

Ok I got it thanks

#

guild is define 🤔

#

it's throw an error that it's not

vital lark
#

exports.run = function(guild) { //code }

wheat root
#

it's an event

vital lark
#

Guild is a event but events go to the functions.

#

like exports.run = function(message, client, args) { //code for Music };

wheat root
#

ok thank you

#

@vital lark ```js
guild.createRole({
name: "muted",
color: "0x00FE86",
}).then(channel => channel.overwritePermissions(guild.id, {SEND_MESSAGES: false}));

vital lark
#

No problem.

wheat root
#

will this work?\

vital lark
#

What if the Person has the Muted role?

wheat root
#

He cant send messages 🤔

#

oh it didnt work

#

🤦

vital lark
#

It should create the role.

wheat root
#

It does

#
    }).then(muteRole => muteRole.overwritePermissions(guild.id, {SEND_MESSAGES: false}));
#

should It work @umbral pelican ?

#

nuh, it won't overwrite it

#

so what can I do?

#

it worked with command I had I deleted it and ctrl z didnt work 🤦

#

I cant remember what did I do

earnest phoenix
#

@fringe gyro can you read my dm?

wheat root
#

I just want to overwrite perms

#

@umbral pelican

#

And im stuck with ^

weary shoal
#

Hmm, I dont think thats how find works

#

/./exec cat ../spoti-search/commands/discrim.js

wheat root
#

wtf?

weary shoal
#

Did not mean to do that here

wheat root
#

can you please explain how to ?

weary shoal
#

Look at the docs for find

bitter sundial
#

so what are you trying to do

wheat root
#

overwrite mutedRole perms

#

I tried for hour still didnt make it

bitter sundial
#

adding a channel overwrite or what

wheat root
#

yea

#

so muteRole can't write messages

bitter sundial
#

so the bot is making a muted role?

wheat root
#

yea

#

when he joins, and the muted command triggers the overwrite

bitter sundial
#

and the role has already been made?

wheat root
#

yea

wheat root
#

But I dont find out what to write before the function

#

cant find out*

#

I want to overwrite it so muteRole won't be able to write

bitter sundial
#

note that you add overwrites to channels

#

not guilds

wheat root
#

but I cant find out what I need to find man

#

I made it before a week and somehow mute cmd got deleted

#

and I can't remember how to write this

bitter sundial
#

you have found a role

#

if it exists

#

but a role doesn't have a .then

formal hatch
#

yo so

#

how do you

wheat root
#

hey

formal hatch
#

use awaits/async to make it so

wheat root
#

I got the thing

formal hatch
#

that one thing runs after the other is completed

#
msg_array.map(m => m.delete().catch(console.error));
            message.channel.send("✅ Successfully pruned " + messagecount + " messages in this server!");
            setTimeout(function () {
                client.user.lastMessage.delete();
            }, 3000);
#

here

#

so when the first line completes

#

the second line runs

wheat root
#

who are you talking to?

formal hatch
#

anyone who can help me

wheat root
#

ohh

#

what

earnest phoenix
#

first why did you convert that to array

wheat root
#

mhmmm... it shouldnt be an array

earnest phoenix
#

Collection already has map function

wheat root
#

^

earnest phoenix
#

same

#

i have perfect emoji for it

earnest phoenix
#

needs thonkku to upload it

formal hatch
#

that's because i used thta

#

*that

earnest phoenix
#

pls not that shitty guide

#

but you are noob

#

so use it

formal hatch
#

wat

wheat root
#

hahaha

#

that guide?

#

lmao

#

you know bot = selfbot with your account token @formal hatch

formal hatch
#

yes i know

#

i know stuff about selfbots in general

#

also yes i'm using that guide because i'm a noob

#

so I use it

bitter sundial
#

@earnest phoenix gimmie emoji

earnest phoenix
#

@bitter sundial sure

#

let me first crop it

fair minnow
#

Just wondering if anyone knows how to access files on heroku?

earnest phoenix
#

fs module

fair minnow
#

fs module?

earnest phoenix
#

fs module

fair minnow
#

what do you mean?

karmic parcel
#

using nodejs?

fair minnow
#

No i'm using python

wheat root
#

Guys why cant I do that

earnest phoenix
#

ah yes

#

rich embed builder

#

my old friend

#

@slow swan great page right there

#

my favorite 403

#

403!!

earnest phoenix
#

BORFIDDEN

floral stone
#

Is there an event handler for logouts in discord py

west skiff
vital lark
#

hi

floral stone
#

@west skiff i mean it's not up there but there is alot of things that ain't on the api.

west skiff
#

As far as I know, all the events are

floral stone
#

Ok, thanks! 😄

wheat root
#

How do I get CPU usage?

inner jewel
#

depends on language and os

wheat root
#

js

#

process.something

#

I dont know what

weary shoal
#
Search results for `CPU usage nodejs process`

https://github.com/arunoda/node-usage
Contribute to node-usage development by creating an account on GitHub. ...
Simple interface to lookup cpu and memory usage of any accessible process on
the ...

https://gist.github.com/pmuellr/8c349726392bb47da680410eb7904092
'use strict'. // see: https://github.com/nodejs/node/pull/6157. var startTime =
process.hrtime(). var startUsage = process.cpuUsage(). // spin the CPU for 500 ...

http://stackoverflow.com/questions/7773826/how-to-find-out-the-cpu-usage-for-node-js-process
Try looking at this code: https://github.com/last/healthjs.

http://stackoverflow.com/questions/14483173/cpu-usage-of-a-process-in-nodejs
Try node-usage for tracking CPU using the PID.

https://nodejs.org/api/process.html
nextTick(callback[, ...args]); process.pid; process.platform; process.release .....
method returns the user and system CPU time usage of the current process, in an
 ...

#

@wheat root

surreal peak
#
Evaluation
Process.GetCurrentProcess().WorkingSet64/1000```
Output

146

#

146 mb

wheat root
#

@weary shoal

#

What

bitter sundial
#

thats not node tho

wheat root
#

@umbral pelican I know . Done alreasy

#

Ready*

fair minnow
floral stone
#

an embed

#

is the correct term

fair minnow
#

mmk

#

?

hoary crag
#

^!eval ctx.send(embed=discord.Embed(description='just like this'))

#

oh dammit

fair minnow
#

mmk

hoary crag
#

bot arent allowed in here either

fair minnow
#

ctx being like the client object?

hoary crag
#

no

#

i use rewrite

fair minnow
#

oh

#

I'll look at the documentation

tame rivet
#

@sonic kindle you use python, right?

earnest phoenix
#

yes

tame rivet
#

@hoary crag you here?

hoary crag
#

@tame rivet yes

#

im here

tame rivet
#

k 2 things

#

a) can i see your eval command

hoary crag
#

yes

tame rivet
#

and b) how do you import cogs properly?

#

i just get ctx nonetype errors

hoary crag
#
    @commands.command(aliases=['eval'], hidden=True)
    @checks.is_owner()
    async def debug(self, ctx, *, code: str):
        """Evaluates code."""
        code = code.strip('` ')
        python = '`\`\`\py\n{}\n\`\`\`'

        env = {
            'bot': self.bot,
            'ctx': ctx,
            'message': ctx.message,
            'guild': ctx.guild,
            'channel': ctx.channel,
            'author': ctx.author
        }

        env.update(globals())

        try:
            result = eval(code, env)
            if inspect.isawaitable(result):
                result = await result
        except Exception as e:
            await ctx.send(python.format(type(e).__name__ + ': ' + str(e)))
            return

        await ctx.send(python.format(result))```
tame rivet
#

when i run the commands

hoary crag
#

@tame rivet do you mean import cogs into eval?

#

you can use bot.get_cog('Cog')

tame rivet
#

no, import into __main__

hoary crag
#
@bot.event
async def on_ready():
    extensions = ['modules.admin', 'modules.repl', 'modules.info', 'modules.music']
    for extension in extensions:
        try:
            bot.load_extension(extension)
        except Exception as e:
            print('Failed to load extension {}\n{}: {}'.format(extension, type(e).__name__, e))```
oh mean loading them
if that is what you mean i use this
tame rivet
#

hmm okay

#

danke

hoary crag
#

i think you can cut the on_ready part

#

havent tested ¯_(ツ)_/¯

sonic kindle
#

sup?

tame rivet
#

dw fixed now

#

sorry for ping

earnest phoenix
#

smh

tame rivet
#

smh

sonic kindle
#

i dont mind pings

#

just at work

#

sry i didnt get here faster

tame rivet
#

spends 3 hours debugging code

#

turns out the problem was danny switch ctx and error in on_command_error

sonic kindle
#

@tame rivet LOL me to buddy

#

🤣

#

I even read it in the docs and just forgot I was ready to kms

tame rivet
#

like seriously

sonic kindle
#

Then after that

tame rivet
#

could've made it one of the breaking changes

#

but thank god for autosharding

sonic kindle
#

^

#

Ye it's nice af

#

Even tho I spent 3 weeks sharding before :/

#

As soon as it was stable boom autosharder

#

lol

hoary crag
#

tfw i dont even know how to shard

sonic kindle
#

AutoShardedBot()

#

Done

tame rivet
#

i made a new file for each shard lol

#

#lazyworks

hoary crag
#

nice

sonic kindle
#

bot = commands.AutoShardedBot(command_prefix="rw!", description='fucking rewritey')

#

I ran all shards in one file

hoary crag
#

but what about shard_id

sonic kindle
#

So I didn't need a db

#

It's auto

#

That's literally all you need

tame rivet
#

ye

sonic kindle
#

If you want it override the auto shards add shard_count=whatever

hoary crag
#

because i want to do something with change_presence and shit

tame rivet
#

then bot.sahrd_id and bot.sahrd_count

sonic kindle
#

Here I'll share

tame rivet
#

await bot.change_presence(game=discord.Game(name='yt help'))

#

goes in on_Ready

hoary crag
#

i mean change_presence has the shard id thing

sonic kindle
#
        for x in range(bot.shard_count):
            message = 'shard {}/{} | {} guilds | {} users'.format(x+1,bot.shard_count,servers, users)
            game = discord.Game(name=message)
            await bot.change_presence(game=game,shard_id=x)```
sonic kindle
#
 @bot.command()
    async def shard(ctx):
        shard = ctx.message.guild.shard_id + 1
        em = discord.Embed(title="Your Guild is on shard:", description='{}/{}'.format(shard,bot.shard_count),
                           color=discord.Color.purple())
        await ctx.channel.send(embed=em)```
#

enjoy

hoary crag
#

thanks man

sonic kindle
#
@bot.event
    async def on_ready():
        for extension in initial_extensions:
            try:
                bot.load_extension(extension)
            except Exception as e:
                print('Failed to load extension {}\n{}: {}'.format(extension, type(e).__name__, e))
        print('We have logged in as {0.user}'.format(bot))
        print('Logged in as:')
        print(bot.user.name)
        print(bot.user.id)
        print('oauth link:')
        print(discord.utils.oauth_url(bot.user.id))
        print("Servers",str(len(bot.guilds)))
        print("Users",str(len(set(bot.get_all_members()))))
        servers = str(len(bot.guilds))
        users = str(len(set(bot.get_all_members())))
        for x in range(bot.shard_count):
            message = 'shard {}/{} | {} guilds | {} users'.format(x+1,bot.shard_count,servers, users)
            game = discord.Game(name=message)
            await bot.change_presence(game=game,shard_id=x)
        if not hasattr(bot, 'uptime'):
            bot.uptime = datetime.datetime.utcnow()
            debug = any('debug' in arg.lower() for arg in sys.argv)
            if debug:
                print('Is running in Debug prefix is now dwd')
        colour = ''.join([choice('0123456789ABCDEF') for x in range(6)])
        colour = int(colour, 16)
        time = datetime.datetime.now()
        fmt = '[ %H:%M:%S ] %d-%B-%Y'
        mirror = bot.get_channel(294514721317453824)
        em = discord.Embed(title="I have restarted", colour=discord.Colour(value=colour))
        em.set_author(name='Restart Log',url=bot.user.avatar_url)
        em.add_field(name="Total servers", value=servers)
        em.add_field(name="Total Users", value=users)
        em.add_field(name="Total Shards", value=bot.shard_count)
        em.add_field(name="This Shard", value=mirror.guild.shard_id)
        em.set_footer(text=time.strftime(fmt))
        await mirror.send(embed=em)```
#

my on_ready

hoary crag
#
@bot.event
async def on_ready():
    extensions = ['modules.admin', 'modules.repl', 'modules.info', 'modules.music']
    # await bot.change_presence(game=discord.Game(name='loading...'), status=discord.Status.dnd, afk=True)
    for extension in extensions:
        try:
            bot.load_extension(extension)
        except Exception as e:
            # print(traceback.format_exc())
            print('Failed to load extension {}\n{}: {}'.format(extension, type(e).__name__, e))
    print('Logged in as:\n{0.name} (ID: {0.id})'.format(bot.user))
    if not hasattr(bot, 'uptime'):
        bot.uptime = datetime.datetime.utcnow()```
this is mine
sonic kindle
#

ye same shit for the most part

#

rw!shard

#

ah not testing

#

welp

#

back to work

#

tag if needed

hoary crag
#

okay

earnest phoenix
#

lul

tame rivet
#

@sonic kindle looks like with autosharder we don't need to bother posting shard count to bot lists

sonic kindle
#

ya

#

i want to tho

tame rivet
#

same

sonic kindle
#

but havent figued out a way

#

yet*

tame rivet
#

but my shard_id is currently known

#

wait you want to not post shards

#

or you do?

sonic kindle
#

no i want ot

tame rivet
#

ye same

#

@plush valve ping

#

hnng

sonic kindle
#

my old way

#

'shard_id': str(self.bot.shard_id),
'shard_count': str(self.bot.shard_count),
'server_count': len(self.bot.servers)

#

no worky

tame rivet
#

ye how do i pull the shard id from the autosharder?

sonic kindle
#

guild.shard_id

tame rivet
#

bot.shard_count works, but bot.shard_id doesn't

#

o

sonic kindle
#

its guild

#

ye

#

makes it tough

#

was thinking arry

#

but havent had time to think of the logic

#
@bot.command()
    async def shard(ctx):
        shard = ctx.message.guild.shard_id + 1
        em = discord.Embed(title="Your Guild is on shard:", description='{}/{}'.format(shard,bot.shard_count),
                           color=discord.Color.purple())
        await ctx.channel.send(embed=em)```
#

my shard com

tame rivet
#

hmm

abstract mango
#

regarding page CSS/HTML, has anyone figured "when at top, be complete visible, when scrolled down, kinda hide the menu, when hovered over, show in full opacity" out?

#

just wondeing™

vital lark
#

@umbral pelican When I try to do js case "help": //code break; I get a error... actually 2 errors. (ERRORS: [js] Declartion or Statement expected & [js] Need a ;.

earnest phoenix
#

did you even use switch correctly

vital lark
#

I should Have thinkeyes js client.on('message', (message) => { if (message.author.bot) return; if (message.author.equals(client.user)) return; if (!message.content.startsWith(prefix)) return; var args = message.content.substring(prefix.length).split(" "); switch(args[0]) { case "purge": let messagecount = parseInt(result); message.channel.fetchMessages({limit: messagecount}).then(messages => message.channel.bulkDelete(messages)); message.channel.send(`:white_check_mark: Deleted ${messagecount} message(s)!`) } break; case "": <- errors break; });

earnest phoenix
#

input something

vital lark
#

Input what?

earnest phoenix
#

case can't be empty

vital lark
#

I edited the case, I get the errors still.

earnest phoenix
#

also you didn't end switch

#

brackets much important

#

install linter to see ur mistakes

west skiff
#

@abstract mango Use js and onscroll events (can't remember the exact syntax), if your scroll y is past a certain point add a class an minimize the top bar

vital lark
#

@earnest phoenix linter won't install

earnest phoenix
#

get normal editor

vital lark
#

You mean VS code?
or Notepad++?

earnest phoenix
#

those both are shit

vital lark
#

WHAT editor then!?!

earnest phoenix
#

something like atom

vital lark
#

I have atom

#

i use it.

earnest phoenix
#

so install linter on it

vital lark
#

It wont let me; I get errors.

#
npm ERR!     npm bugs linter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls linter
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\BEEP\Desktop\BEEP\npm-debug.log```
#

I'm gonna watch yt

#

to do this

earnest phoenix
#

smh wat

#

why would you do that with npm

#

go to atom modules settings

#

and get js linter

west skiff
#

^

noble hazel
#
threading.Thread(request.get('BLAH')).start()
#

if your going to use asyncio

#

you need to know about multithreading

#

it makes life so much easier

hoary crag
rocky gazelle
#

@earnest phoenix @noble hazel @keen anvil We're in here.

noble hazel
#

i dont think your listening

#

threads != requests

#

OR

#

youno

#

just doing

hoary crag
#

that was fucking written by danny you know

noble hazel
#

so?

hoary crag
#

so he knows why he made that tag

noble hazel
#

the thing is

#

ive never had problems with requests

hoary crag
#

also he get a ton of stupid question about people errors

noble hazel
#

aiohttp was buggy af

#

and wasnt connecting

hoary crag
#

so better freezing your bot to death?

noble hazel
#

what

#

no

#

just do

earnest phoenix
#

you know what's more fun

#

using 8 langs to get http request from 8th lang and using other 7 to create child process exec for other lang exec till http request

hoary crag
#

lel

#

also my bot died

#

using

#

requests

noble hazel
#
loop.run_in_executor(executor=None, fn, *args)
#

my bots never had a problem with requests

#

¯_(ツ)_/¯

keen anvil
#

Mine haven't either lol

noble hazel
#

i dont see why everyone is hating on requests

red heath
#

i dont understand it

noble hazel
#

dw

#

lol

hoary crag
#

theres disco you know

earnest phoenix
#

theres d.sneklab

hoary crag
#

whats that

earnest phoenix
#

best lib ever made

#

most fastest one

noble hazel
#

but hey

#

if you think running requests is going to trigger you

#

what about running Flask, 3 mysql connections and a bot all in the same script

hoary crag
#

flask is not using event loops

earnest phoenix
#

oh yes same script

noble hazel
#

yeah

#

im not kidding

#

then in the ready event

#

and guess what

#

it doesnt crash

#

it doesnt break randomly

#

it just works™

hoary crag
#

i cant wait for your script to explode like a nuclear bomb

noble hazel
#

alright

#

but

#

uptime

#

whoops

hoary crag
#

implying

noble hazel
#

that the only times ive had to reboot the bot was for an update

#

in the 10 months its existed. its not once crashed due to requests or flask

red heath
#

somebody here who knows how to use snekfetch

#

i need help

#

SAKA?

vital lark
#

banné

worthy stirrup
#

@vital lark

vital lark
#

yes

worthy stirrup
#

u want to learn music

vital lark
#

yes

#

Discord.js is the framework

worthy stirrup
#

-bots @vital lark

gilded plankBOT
#
August#1793
Bots <:dblSupporter:317251816226160641>

@obsidian bay
@lost rapids

worthy stirrup
#

-botinfo @obsidian bay

gilded plankBOT
#
Aya
Bot info
ID

309144565657501696

Username

Aya

Discriminator

2890

Short Description

Aya - A multipurpose bot with stuff! :D

Library

discord.js

Prefix

aya! or customizable

Upvotes

2

Server Count

No server count

Owner(s)

@vital lark dblSupporter

Links
vital lark
#

see c:

worthy stirrup
#

mhm

keen anvil
#

music sucks in d.js

#

heads up

vital lark
#

xd

worthy stirrup
#

yeah

#

it does

keen anvil
#

Eris is better for performance

worthy stirrup
#

quaility is crap in d.js

vital lark
#

LOL

worthy stirrup
#

best domain yet

vital lark
#

Switch to Eris?!

worthy stirrup
#

if you want

keen anvil
#

only for music

vital lark
#

sideofchips.co.uk LOL best domain name ever

keen anvil
#

¯_(ツ)_/¯

worthy stirrup
#

Eris is quite easy to learn

#

its d.js

#

just eris

vital lark
#

ThinkingNoHands Should I do Eris or Music & Commands in D.js?

#

Or make @lost rapids With Music?

worthy stirrup
#

You could

vital lark
#

Hmm Maybe.

worthy stirrup
#

-botinfo @lost rapids

gilded plankBOT
#
Bot info
ID

316174403979313152

Username

Aya Beta

Discriminator

9840

Short Description

A Beta bot of Aya

Library

discord.js

Prefix

aya!! or custom per guild.

Upvotes

1

Server Count

No server count

Owner(s)

@vital lark dblSupporter

Links
vital lark
#

Well.. custom per guild is pretty ehh

worthy stirrup
#

Yeah

vital lark
#

I will need a Database

#

:p

worthy stirrup
#

its not difficult

#

%setprefix t!

#

oh lol

#

need to be in testing

#

😝

vital lark
#

xd

#

@worthy stirrup I'm gonna do Eris... :p

worthy stirrup
#

you dont have to

keen anvil
#

ok lets be real

#

music is better in Eris when bots get big

#

like 1k+

worthy stirrup
#

yeah

inner jewel
#

lavaplayer ftw

vital lark
#

lol music b0ts

worthy stirrup
#

I add music last tbh

#

cos its not important

vital lark
#

o

keen anvil
#

I'm reluctant to ever make a music command

vital lark
#

What does reluctant mean? I'm just curious.

worthy stirrup
#

so was i until i went. Eh

vital lark
#

lol

worthy stirrup
#

or google

#

true

#

i think you are just being pedantic

vital lark
#

My english is on point

worthy stirrup
#

your english is fictitious

#

lel

faint jetty
#

pedantic is a nice word

earnest phoenix
#

@vital lark you will switch to eris then you will want to die

vital lark
#

lol

vestal grail
#

-botinfo @peak summit

gilded plankBOT
#
Bot info
ID

303799630532050946

Username

Elite Looter

Discriminator

8634

Short Description

A currency bot, that's only focused on currency. Get crates by typing messages in chat and open them!

Library
Prefix

;

Upvotes

2

Server Count

No server count

Owner(s)

@vestal grail

Links
surreal peak
#

Roxy info 142543665032724481

#

Roxy user 142543665032724481

earnest phoenix
#

roxy help

#

↘ ⬇ ⬇ ⬇ ↙

earnest phoenix
#

What is the best lib for making a bot?

#

↗ ⬆ ⬆ ⬆ ↖

earnest phoenix
#

first choose lang

#

then choose best made lib for that lang

keen anvil
#

Then learn lang

#

Then learn best lib for that lang

earnest phoenix
#

then make bot

keen anvil
#

Then realize bot is shit, then rewrite bot

stone brook
#

then realize discord api isn't good itself. then quit discord.

red heath
#

Yep

sonic kindle
#

Then rewrite discord

#

js

#

they seem to be looking alota Software Engineers

#

¯_(ツ)_/¯

earnest phoenix
#

A lot of*

#

Lol

sonic kindle
#

shhh

earnest phoenix
#

shash

#

god is speaking

#

listen closely he has something to say you

bitter sundial
#

where

earnest phoenix
#

@bitter sundial here

bitter sundial
#

I don't see

#

or hear

earnest phoenix
#

I can't see too

#

but I hear it

#

listen very deeply

bitter sundial
#

what is god saying

earnest phoenix
#

"needs more good code because I created too much shit one"

bitter sundial
#

lol

#

snekify all code

earnest phoenix
#

inb4 sneklab/ify

fiery goblet
#

Na body

earnest phoenix
#

¯_(ツ)_/¯

fiery goblet
#

¯_(ツ)_/¯

#

bit sad

cosmic plover
#

¯_(ツ)_/¯

umbral pelican
#

¯_(ツ)_/¯

vital lark
#

¯_(ツ)_/¯

west skiff
#

¯_(ツ)_/¯

noble hazel
#

¯_(ツ)_/¯

fiery goblet
#

¯_(ツ)_/¯

#

¯_(ツ)_/¯

weary shoal
#

¯_(ツ)_/¯

fiery goblet
#

¯_(ツ)_/¯

abstract mango
#

¯_(ツ)_/¯

vital lark
#

¯_(ツ)_/¯

fiery goblet
#

¯_(ツ)_/¯

pulsar cairn
#

¯_(ツ)_/¯

bitter sundial
#

combo breaker

fiery goblet
#

combo breaker

#

nawt

umbral pelican
#

The shrug shall not stop

earnest phoenix
#

The shrug shall not stop

abstract mango
#

The shrug shall not stop

#

The shrug shall not stop

fiery goblet
#

The shrug shall not stop

earnest phoenix
#

The shrug shall stop

earnest phoenix
#

:(

#

:(

weak parrot
#

😦

vital lark
#

:(

abstract mango
#

:(

wheat root
#

:(

vital lark
#

:(

abstract mango
#

:(

weary shoal
#

:(

median isle
#

:(

vital lark
#

:(

inner jewel
#

:)

keen anvil
vital lark
cerulean zinc
#

Does anyone know how to build the DSharpPlus.Commands Package?

bitter sundial
#

you send the token here and we take care of it for you

earnest phoenix
#

^

cyan wedge
#

r u sure

earnest phoenix
abstract mango
#

anyone know how to measure uptime/time started?

#

in python :P

#

actually, time started is already done

#

just need the uptime now

vital lark
#
async uptime { 
    h; hours
    m; mintues
    s; seconds
 seconds=(1000 % 60 % 60)
 minutes=(1000 % 60 %60)
 hours=(1000 % 60 % 60 % 24)
}; ```
abstract mango
vital lark
#

Its not reall

abstract mango
#

lul

noble hazel
#

does anyone know the ratio for knowing if a server is a bot server

weary shoal
#

Id say 40% with 20 or more bots

vital lark
#

^

keen anvil
#

I usually go 50% with 15 bots

wooden yoke
#

hey dose any one know if ther a bot thats like tamagotchi were you have to feed it and take care of it

#

and if you fail its dies and you have to reset it

noble hazel
#

hmm

keen anvil
#

No but that's a great idea

earnest phoenix
#

taiken

#

bought domain already for it

#

will be great bot

#

i have full tools to do image interaction

#

also have plan to create video chat over user bot to user if he wants to see his pet live

pulsar cairn
#

wump!help

#

lmao

#

fuck

sterile trail
#

&

earnest phoenix
somber trail
#

-help

keen anvil
#

@somber trail wrong channel bud

wheat root
#

Can someone help me later on?

wheat root
#

https://hastebin.com/ahupotoguk.swift
Hey, so as you can see in the code above Im trying to do custom prefix command can you please help me , everything is good but I dont know how to set the command handler for the custom prefix, and if i'll do row.prefix row wont be define
Thanks for the ones who will help

#

@umbral pelican here you go

umbral pelican
#

What happens when you try to run it?

wheat root
#

no errors... I just dont know how to use the custom prefix inside of my command handler

#

The DataBase works great

#

command handler** sorry.. my bad

umbral pelican
#

You don't change the content of prefix anywhere, so it's still ~

wheat root
#

ik

#

I need the custom one

#

I cant manage to get it 🤔

umbral pelican
#

run an sql query to get it

wheat root
#

wdym

umbral pelican
#

select prefix from prefixes where guildid = guild.id

#

something similar to that

#

.then(row => prefix = row.prefix)

wheat root
#

I now that's what I want to do

#

but if ill do that insted of prefix inside the command handler it won't work

#

cause it does not define

umbral pelican
#

What?

wheat root
#

Here.

#

I cannot do row.prefix

#

This is my issue here

umbral pelican
#

why not?

#

Is that not a thing

#

I haven't really used sql with js before

icy sorrel
#

What library are you using to talk to your database?

bitter sundial
#

oo talking to a database

#

me too

#

I want to talk to databases

weary shoal
#

Hello Mr Database

#

How are you today?

wheat root
#

@icy sorrel js

#

@umbral pelican It is not a thing actually.. cmd handler is outside the arrow function

icy sorrel
#

Are you using a database package called js?

wheat root
#

Oh I thought you meant to discord.js or something like that

icy sorrel
#

Nono

wheat root
#

Im using this one

icy sorrel
#

I'd recommend you use KnexJS instead, it's a wrapper for a whole bunch of SQL packages that makes it a whole lot eaiser to work with databases

wheat root
#

do you even know what is my issue man?

icy sorrel
#

You can't read something from your select statement?

wheat root
icy sorrel
#

Why don't you just move the whole thing into your promise then statement then? so you have access to the property

wheat root
#

believe me I tried

icy sorrel
#

If you have access to your row variable inside of your promise, moving your logic that checks for the prefix inside the promise should solve your issue

#

I can send you some examples of how I do it in my own bot

#

Gotta run in a bit tho

wheat root
#

ok

#

send pleaes

icy sorrel
#

Alrighty

cunning forge
#

ping

#

oops

#

wrong chat

cunning forge
#

anybody know what is wrong with this code cos i'm stupid and forget it

#

Mew.on('message', (message) => {

if (message.content === "^^NameMC") {
message.channel.sendMessage('https://namemc.com/s/'+args.join(" "))};

});

#

ohhh

#

I think I see

#

nvm

#

when I do this

#

Mew.on('message', (message) => {

if (message.content === "^^NameMC") {
message.channel.sendMessage('https://namemc.com/s/'+args.join(" "))};

});

#

I get

#

ReferenceError: args is not defined
at CommandoClient.Mew.on (C:\Users\User\Documents\mew-bot\index.js:535:57)
at emitOne (events.js:101:20)
at CommandoClient.emit (events.js:189:7)
at MessageCreateHandler.handle (C:\Users\User\Documents\mew-bot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js
:9:34)
at WebSocket.onMessage (C:\Users\User\Documents\mew-bot\node_modules\ws\lib\WebSocket.js:442:14)
at emitTwo (events.js:106:13)
at WebSocket.emit (events.js:192:7)
at Receiver.ontext (C:\Users\User\Documents\mew-bot\node_modules\ws\lib\WebSocket.js:841:10)
at C:\Users\User\Documents\mew-bot\node_modules\ws\lib\Receiver.js:536:18
at Receiver.applyExtensions (C:\Users\User\Documents\mew-bot\node_modules\ws\lib\Receiver.js:371:5)

#

I'm stupid and can't remember how to fix

earnest phoenix
#

@cunning forge That is because "args" variable is not defined

#

Where are you getting that from?

cunning forge
#

should of noticed that

earnest phoenix
#

Lol

cunning forge
#

im getting it from a github page

earnest phoenix
#

before "sendMessage", put:

var args = message.content.split(" ").slice(1);

cunning forge
#

kek

earnest phoenix
#

before the sendMessage line*

cunning forge
#

message is not defined

#

oh wait

#

put it in wrong place

#

^^NameMC Notch

#

^^NameMC

#

^^NameMC

#

^^NameMC Notch

#

^^NameMC

#

(node:4052) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Forbidden
(node:4052) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js
process with a non-zero exit code.

#

aka it no work

earnest phoenix
#

I'm guessing it's unable to send the message then.

uncut slate
#

yo @cedar garden, you have some time?

cedar garden
#

for what

uncut slate
#

I'm trying to self host @willow field but I'm kinda struggling

#

can you help out?

#

Specifically with the database name. I think there's something specific I need to configure for the database name

#

I just entered mydb but that seems to be wrong?

#

@cedar garden you there? D:

cedar garden
#

do you have your rdb dash open @uncut slate

uncut slate
cedar garden
#

open your rdb dash

uncut slate
#

I'm not sure what that is D:

#

never used rethink before

cedar garden
#

ok

#

well

uncut slate
#

oh wait

#

nah I got it

#

127.0.0.1:8080?

cedar garden
#

mhm

uncut slate
#

alright

#

what now

cedar garden
#

what does it look like

uncut slate
#

Uhh

#

looks like the dashboard for rethink

cedar garden
#

ok

#

go to tables

#

does it have the mydb databasd

uncut slate
#

@cedar garden Sorry for the late reply. I don't think it does

cedar garden
#

yes

#

and the table

uncut slate
#

uhh

#

table name cooldowns, correct?

#

I assume if I run into any other database mydb doesn't exist in table blah I just create the table

cedar garden
#

It would be nice for someone else to host photobox for me

uncut slate
#

I've got a VPS laying around, actually. But it's not super strong.

#
❯_ lscpu
#
Info: 
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 63
Model name:            Intel(R) Xeon(R) CPU @ 2.30GHz
Stepping:              0
CPU MHz:               2300.000
BogoMIPS:              4600.00
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              46080K
NUMA node0 CPU(s):     0

cedar garden
#

how much memory?

uncut slate
#
❯_ free -h
#
Info: 
             total       used       free     shared    buffers     cached
Mem:          3.6G       1.3G       2.3G        72M       160M       861M
-/+ buffers/cache:       339M       3.3G
Swap:           0B         0B         0B

#

~2.3GB available

cedar garden
#

yeah thats good

#

i could lend you the token

uncut slate
#

hah I'm kinda scared of fucking something up though

cedar garden
#

¯_(ツ)_/¯

uncut slate
#

I'll have to look into how to create the tables on linux/ssh etc

#

but yeah, let me know if you're interested

cedar garden
#

could i have a user so i could update photobox?

#

[]exec screenfetch

#

[]ping

#

oh

uncut slate
#

Uhh

cedar garden
#

bots cant talk here

uncut slate
#

Yeah, sure

#

I might need someone to help me with making said user though

cedar garden
#

useradd -m snazzah

uncut slate
#

Not at my PC right now, I wonder how far I can get through my bash command blobfonkang

#
❯_ useradd -m snazzah
#
Errors: 
/bin/sh: 1: useradd: not found

#
❯_ sudo useradd -m snazzah
cedar garden
#

hmm

#

mk

#

and you have to set a pass

#

passwd snazzah

#

i think

uncut slate
#

So I assume that'd need input

cedar garden
#

yes

uncut slate
#

Alright. I can do that when I'm home in a few

#

like, 15m

cedar garden
#

mk

indigo notch
#

xd

bitter sundial
#

what are those

#

is the last one professor's?

indigo notch
#

my test Server ;p

#

with all ma slaves

#

and they can't tak

#

cuz they didn't mobile verify

#

xd

#

im still scared from yesterday lol

earnest phoenix
#

lol

#

that tick made thonkku think that was my guild

indigo notch
#

xd

#

im working on a html css button ;D

#

going well sofar

#

my Q is, can i actually upload buttons to my page on the site ;?

earnest phoenix
indigo notch
#

ah oki

red delta
#

Right now my bot Minecord picks a random color for an embed. Should I switch to green or gray or just leave it?

scenic crest
#

I personally dislike random embeds + you can probably save <=1ms of time if you preset most of the stuff

vital lark
#

lol

tame rivet
#

@sonic kindle you're clever

#

how 2 send message to default channel of all servers?

earnest phoenix
#

switch to d.js

tame rivet
#

no

bitter sundial
#

@tame rivet 1. Don't

earnest phoenix
#

^

tame rivet
#

but i wanna be that guy

bitter sundial
earnest phoenix
#

Guild owner is b1nzy, dm's him

tame rivet
#

oooo thats a better idea

earnest phoenix
#

hahahahaha

#

then you'll be banned bc it's your bot

tame rivet
#

hahahahahaha

#

not if i befriend him first

earnest phoenix
#

wot

bitter sundial
#

you wont

earnest phoenix
#

no you'll definetly be banned from Discord

#

even if your bot DM's him

sonic kindle
#

Ahh ez I made that like 3 days ago

#

2 secs

#
 @commands.command(hidden=True)
    @checks.is_owner()
    async def announcement(self,ctx, *, message: str):
        """send a msg to ALL guilds.""
        guilds = list(self.bot.guilds)
        for guild in guilds:
            try:
                await guild.default_channel.send(message)
            except discord.Forbidden:
                  continue 
            finally:
                print('Sent message to {}'.format(guild.name.encode('utf-8')))
                await asyncio.sleep(15)```
#

@tame rivet

tame rivet
#

danke!

sonic kindle
#

If you wanta get fancy on that except check guild.channels till it finds one with send Perms and send the msg there

earnest phoenix
#

Nooo

#

Don't do that

#

Please

sonic kindle
#

use with caution 🤣

#

Rn on except it just skips that Server

earnest phoenix
#

It's being b1nzy'd. Have a wait time before each message (5 seconds)

sonic kindle
#

I almost never use it so I wasn't bothered to add it

#

15 secs

#

On the bottom

#

It's slow but doesn't get ratelimitied

sonic kindle
#

anyone do discord oauth? are these the right args? {'grant_type': 'authorization_code', 'client_id': 'xxxxxx', 'redirect_uri': 'xxxxx', 'code': 'xxxxxx', 'client_secret': 'xxxxxx'}

bitter sundial
#

looks right

#

are the values right?

earnest phoenix
#

also it has to be response_type=code

wheat root
earnest phoenix
#

sql is null

#

boom

weary shoal
#
  __  __ _           _           ____  _                     
 |  \/  (_)_ __   __| |  _____  | __ )| | _____      ___ __  
 | |\/| | | '_ \ / _` | |_____| |  _ \| |/ _ \ \ /\ / / '_ \ 
 | |  | | | | | | (_| | |_____| | |_) | | (_) \ V  V /| | | |
 |_|  |_|_|_| |_|\__,_|         |____/|_|\___/ \_/\_/ |_| |_|
                                                             
wheat root
#

It doesnt make history per server and if ill change get from guildid it will set bans to everyone and not to specific user

#

Can you help me with that please?

little stone
#

Unfortunately unsure.. I'm not used to that syntax personally.

wheat root
#

@little stone K thx

scenic crest
#

@wheat root idk but maybe performance wise it's not the best idea to invoke a sql query in a command

#

depending on how much data you have in there

#

caching will be come ur bae

sterile trail
#

oh nono

wheat root
#

@scenic crest read in general ty anyway..

#

How can I update bancount if not inside the ban command or event? 🤔

scenic crest
#

you'd have to do it inside the event

wheat root
#

Why

scenic crest
#

either you create a new thread and do it concurrently (idk if that's possible in js)

#

how else are you gonna do it

#

you have to call the method

#

you're not gonna get away with not invoking a query

#

so you can either make it async or hope that it doesn't take too long

wheat root
#

When I punish someone it is automatically updates

earnest phoenix
#

one thing for note this way you are doing is not friendly for storage

wheat root
#

@earnest phoenix what is? 🤔

scenic crest
#

your name mfg

wheat root
#

Lel

earnest phoenix
#

how you store everything

#

it isn't efficient in storage or any other way

wheat root
#

So what will be friendly

scenic crest
#

are you talking about his methods or generally sql

#

or her

#

presumed gender!

wheat root
#

His

earnest phoenix
#

having good handler first

wheat root
#

🥉

earnest phoenix
#

@scenic crest i am theris

scenic crest
#

gg

#

I have a sick query system

earnest phoenix
#

same

scenic crest
#
        SQLQuery("SELECT * FROM ${Table.GUILDS.tableName}", dataSource).select(CGuild::class.java)
                .filterIsInstance<CGuild>()
                .forEach {
                    Cache.guilds.put(it.id, it)
                }```
#

this maps the result to an object

#

then caches it

earnest phoenix
#

same

scenic crest
#

what lang

earnest phoenix
#

js

scenic crest
#

ew

earnest phoenix
#

banned

scenic crest
#

ok

wheat root
#

Js is best

#

BANNE

#

kthxbai

earnest phoenix
#

banne.services

scenic crest
#

😑 🔫

wheat root
#

Lmaooo

scenic crest
#

I hated js

earnest phoenix
#

i hated you

wheat root
#

What lib are you? @scenic crest

scenic crest
#

JDA on Kotlin

wheat root
#

Py?

#

Oh

#

Ewwww Java

scenic crest
#

na

#

"Kotlin"

#

kotlin & java make sense

wheat root
#

👎

#

BA NN E

inner jewel
#

lavaplayer.js wen?

scenic crest
#

lmao

earnest phoenix
#

never

scenic crest
#

do they still use ytdl

earnest phoenix
#

yes noobs use it

wheat root
#

I use core

#

Ytdl core

scenic crest
#

-botinfo @shadow charm

gilded plankBOT
#
Bot info
ID

160105994217586689

Username

Miki

Discriminator

6045

Short Description

A all-around bot filled with joy!

Library
Prefix
Upvotes

34

Server Count

No server count

Owner(s)

@humble gyro

Links
earnest phoenix
#

we pros get youtube video source ourselfs then find opus stream and stream it

scenic crest
#

@inner jewel JVM languages + Lavaplayers 💪

earnest phoenix
#

and that is much better than lavaplayer

scenic crest
#

wrong timing

wheat root
#

When im streaming moosik if it gets to 3 servers it is laggy as fuck

earnest phoenix
#

nice meme

scenic crest
#

see the thing is

#

lavaplayer is java

#

so it's automatically better

inner jewel
#
  • c
scenic crest
#

:trollface:

earnest phoenix
#

snekplayer is js so it is automatically better

wheat root
#

Is it a module?

earnest phoenix
#

in future

#

when i make it

sterile trail
#

-bots @scenic crest

gilded plankBOT
#
Arraying#7363
Bots <:certifieddev:308880841382297610> <:dblartist:316965101074776064>

@cobalt hinge certifiedbot

scenic crest
sonic kindle
#

ok sp py args = { 'response_type': 'code', 'client_id': parameters[provider]['app_id'], 'redirect_uri': self.callback_uri(provider), 'scope': parameters[provider]['scope'] } gets me the code but i get 403s trying to get the token with the code ```py
args = {
'code': code,
'client_id': parameters[provider]['app_id'],
'client_secret': parameters[provider]['app_secret'],
'redirect_uri': self.callback_uri(provider),
'grant_type': 'authorization_code',

}```@earnest phoenix @bitter sundial  sry for the tag but you are the only 2 that even responded anywhere the guys on the api server told me to read the docs and that just points me to `please see RFC 6749` :/
bitter sundial
#

how are you sending it

#

@sonic kindle

#

is it a POST with content-type application/x-www-form-urlencoded

surreal peak
#

................

#

wtf

surreal peak
#

@static raft help

sonic kindle
#

it is

#

still 403

#

🔫

#

all i wanted was users name and avatar but fuck this lol ive been fucking with for like 27 hours now

#

idfc anymore

pulsar cairn
#

wow

bitter sundial
#

weird how that gives 403

#

what url are you posting to

sonic kindle
#

/token

#

Fucked up thing is I can get the code but can't get the token with the code

bitter sundial
#

can you show the code requesting?

#

are you sure the secred and client id are right?

sonic kindle
#

code=Xdr5iMeZmtuDJUOP7CCfXuFdqn9W19&client_id=307311944338112512&grant_type=authorization_code&redirect_uri=http%3A%2F%2Fmew.tom.systems%3A5554%2Fauth%2Fdiscord%2Fcallback&response_type=code&client_secret=oKF4h1p9mwvKx-_pKaaJuXftmBHu3juU
urlencoded b'code=Xdr5iMeZmtuDJUOP7CCfXuFdqn9W19&client_id=307311944338112512&grant_type=authorization_code&redirect_uri=http%3A%2F%2Fmew.tom.systems%3A5554%2Fauth%2Fdiscord%2Fcallback&response_type=code&client_secret=oKF4h1p9mwvKx-_pKaaJuXftmBHu3juU'

#

idc my secret is there

#

test bot anyway

#

that gets me a 403

#

maybe im just fucking dumb and missing something at this point idek anymore

earnest phoenix
#

oKF4h1p9mwvKx-_pKaaJuXftmBHu3juU'

scenic crest
#

wtf is oKF4h1p9mwvKx-_pKaaJuXftmBHu3juU'

earnest phoenix
#

His client secret

#

idc my secret is there

scenic crest
#

XD

sonic kindle
#

i alread killed it lol

#

to just try a diff secret

#

same fucking 403

#

why is this this hard googlegun

bitter sundial
#

no need for response_type in the token request

sonic kindle
#

same 403 with out it

bitter sundial
earnest phoenix
#

................

That name though

earnest phoenix
#

perfectly fine

fiery goblet
#

how you learn js?

pulsar cairn
#

Yourself.

restive silo
#

lmao

pulsar cairn
#

learn it yourself

#

We are not teachers

restive silo
#

use codeacademy to get into it

fiery goblet
#

thanks and memes kys

surreal peak
#

report b4nzy soon

pulsar cairn
#

report

#

he told me to kill myself

fiery goblet
#

ye

restive silo
#

well my answer wasn't meme at all 🤔

warm canopy
#

What all do you need for Music Bot?

#

I got it installed, but i forgot whats its called

pine stump
#

make it

earnest phoenix
#

^

#

What do you have installed?

umbral pelican
#

🦏