#development

1 messages Β· Page 315 of 1

sonic kindle
#

^

earnest phoenix
#

lol

#

gl with Rhino

#

Make your own music bot like I did for @grim yacht

cosmic plover
#

lmao

keen anvil
#

Anyone know how I would fetch all active voice channels accross all shards in d.js?

scenic crest
#

@keen anvil I will risk getting banne and ping you...

I don't know d.js or much js, but I would iterate through each shard, then iterate through each guild in that shard to see if it's connected, and if it is add it to a collection of some sort

#
val connected = ArrayList<VoiceChannel>()
for(shard in arraybot.managerBot.shards.values) {
    if(guild in shard.guilds) {
        if(someCheckThatIDoNotKnow) {
            connected.add(someObjectThatIDoNotKnow)
        }
    }
}```
#

That being the kotlin example, I could probably use some .map function but I kept it simple so that yuou get the gist of it

bitter sundial
#

d.js has built in collections

#

isn't there something in d.js that allows you to fetch something from all shards

earnest phoenix
#

bot.shard.broadcastEval()

bitter sundial
#

yeah

#

or even fetchClientValues

#

and getting voiceConnections

earnest phoenix
#

or you could just mention me master of d.js

restive silo
#

lmao

keen anvil
#

Ok then, master of js. @earnest phoenix gib me code

restive silo
#

πŸ₯„

earnest phoenix
#

the fuck did discord not register this mention Thankong

#

unless it was msg edit to mention

#

k

#

@keen anvil use broadcast eval or get value method on shard util

sharp rock
#

just a question , how can i get a member count of a specific server using its id in discord.py

#

nvm

hoary crag
#

lol

umbral pelican
#

What does this do BlobThinkingEyes

let newMember = await member.guild.member(await client.rest.methods.getUser(member.user.id, true).then(async u => await u.id))
hoary crag
#

so many await's

umbral pelican
#

lol, I know
I didn't write it

earnest phoenix
#

@umbral pelican looks like d.js code Thoenkyng

#

anyways

#

it gets ID

pliant mortar
#

,help

#

*help

#

nope no bot

#

,set prefix *

#

um

#

,kick

#

um

#

,help

#

*help

#

ahhh

#

403 forbidden

#

,kick @earnest phoenix

weary shoal
#

Haha

pliant mortar
#

lol

weary shoal
#

Ya cant kick in here

pliant mortar
#

why cant my bot talk

weary shoal
#

Bots dont have permission to

#

Also

pliant mortar
#

doesnt work

weary shoal
pliant mortar
weary shoal
pliant mortar
#

@weary shoal r u sure i am allowed to kick people

earnest phoenix
#

Completely

pliant mortar
#

R U SURE

weary shoal
#

Yeap

earnest phoenix
#

Try me

#

yes

#

Kick me

pliant mortar
#

i cant ban u

earnest phoenix
#

:D

#

Kick me then

pliant mortar
#

wait

earnest phoenix
#

?

weary shoal
#

OwO

#

Wrong channel

sonic kindle
#

Ded πŸ˜‚

earnest phoenix
#

d!help

sonic kindle
keen anvil
#

Weird issue where my node opus will just stop working randomly.

#

I'll get the error that there is no opus engine installed

fossil oxide
#

sounds like an opus problem thonk

keen anvil
#

didn't happen till I updated to node 8 Β―_(ツ)_/Β―

karmic parcel
#

Rip node 8

fossil oxide
#

Node 10 best node

slow idol
#

node 10 πŸ€”

abstract mango
#

nodedows 10

red heath
#

node 0.10.0

vital lark
#

node 0.0.1

earnest phoenix
#

Node 8 is really good

#

@keen anvil Try to to delete node_modules & do sudo npm install

fiery goblet
#

why can't I find client.shard.id?

#

fuck

#

me

earnest phoenix
#

idk

fiery goblet
#

sad...

sonic kindle
#

What lib?

#

-bots @fiery goblet

gilded plankBOT
#
AnounFXβ„’#3494
Bots

@lost spruce
@tribal estuary
@covert notch

sonic kindle
#

-bots @fiery goblet --noembed

gilded plankBOT
#
AnounFXβ„’#3494
Bots

@lost spruce
@tribal estuary
@covert notch

sonic kindle
#

:/

#

-help

earnest phoenix
#

-bots @fiery goblet -noembed

gilded plankBOT
#
AnounFXβ„’#3494
Bots

@lost spruce
@tribal estuary
@covert notch

cosmic plover
#

what's with noembed

#

is it even a thing

#

xD

earnest phoenix
#

idk but none of those mentions show on mobile

cosmic plover
#

lol

#

true

fiery goblet
#

-bots noembed

gilded plankBOT
#

AnounFXβ„’#3494's () bots:
@lost spruce @tribal estuary @covert notch

sonic kindle
#

-botinfo @lost spruce noembed

gilded plankBOT
#
Bot info
ID

310779662173208576

Username

EntiredBot

Discriminator

7928

Short Description

Entired - A multi-functional bot!

Library
Prefix

e_

Upvotes

2

Server Count

51 Servers

Owner(s)

@fiery goblet
@brave shadow

Links
bitter sundial
#

there's no noembed for botinfo

cyan wedge
#

you could always just not use embeds ever

trim steppe
#

πŸ₯š blobthonkang

keen anvil
#

hey @earnest phoenix can you check out my shit d.js code and help me figure this out?

#
let [guild, vc, user] = await Promise.all([client.shard.fetchClientValues('guilds.size'), client.shard.fetchClientValues('voiceConnections.size'), client.shard.fetchClientValues('users.size')])
let guilds = guild.reduce((prev, val) => prev + val, 0)
let vcs = vc.reduce((a, b) => { return a + b })
let users = user.reduce((a, b) => { return a + b })
#

user count is where I'm running into trouble. It's clearly not correct, as the guild the bot is in has more members than it's saying

#

what would I use to get total user count in that ^?

earnest phoenix
#

while promise them all

#

oh ti returns promise k

#

nano ping

keen anvil
#

whut

earnest phoenix
#

okay lets make this simple

#
const = guilds = (await client.shard.fetchClientValues('guilds.size')).reduce((a, b) => a + b);
const voiceConnections = (await client.shard.fetchClientValues('voiceConnections.size')).reduce((a, b) => a + b);
const users = (await client.shard.fetchClientValues('users.size')).reduce((a, b) => a + b);```
#

user count is correct

#

as guilds can share same user

#

so both have diferent members but same user

#

each member contains its unique guild settings

#

as roles and etc

#

user contains all default information that is shared everywhere

keen anvil
#

so mapping out guilds => membercounts would be incorrect because it would count duplicates, that makes sense. Interesting

earnest phoenix
#

yea

#

example

#

guild1[contains me you and tonkku] guild2[contains me and you] join them all you get 5 members but you know yourself this is only you thonkku and me thats 3 users

keen anvil
#

gotcha, thanks πŸ‘Œ

#

d.js master

bitter sundial
#

does the ban event not contain the reason

earnest phoenix
#

let me check

bitter sundial
#

or who banned

earnest phoenix
#

it doesn't have reason or who banned

bitter sundial
#

yay checking audit logs

earnest phoenix
#

who banned would require to check audit logs

#

and reason i could make pull request to include in event

#

but thats other hard part

#

not all bans are made from client

#

so not always reason appears

#

so audit logs again

cinder sleet
#

ok ill send a pic @sonic kindle

#

What do you mean by a red?

sonic kindle
#

If you don't know your probably fine

cinder sleet
#

;3;

sonic kindle
cinder sleet
#

So must I send the on_ready() still?

#

It doesnt have much

sonic kindle
#

then under if name == 'main': add bot.load_extension('api')

cinder sleet
sonic kindle
#

Now you can also put that in you on_ready event sit down side of that is when you load it on ready you will miss the on_ready trigger and only send stats server join and server leave

cinder sleet
#

(Its just a little thing at the begining to show me whats going on btw)

sonic kindle
#

Ok so change everything in the cog from bot to client

#

Then above client.run

#

Put client.load_extension('api')

#

That's will load the cog at boot

#

And fire off stats on_ready

cinder sleet
#

Wait just confirming, what is cog? facepalm

#

I really am new to this sorry

#

And I am a bit slow

#

I think I know what you are saying though

#

Not working Thinkfusing its my fault

#

Maybe ill just send the begining of the code here

#

and you can fix it?

sonic kindle
#

so that that example you have is a 'cog'

cinder sleet
#

Seperately? And then just leave that running?

#

I feel so stupid ;3;

sonic kindle
#

import json
import aiohttp
uri = 'https://discordbots.org/api'
class botsorgapi:
def init(self, bot):
self.bot = bot
self.session = aiohttp.ClientSession()
def __unload(self):
self.bot.loop.create_task(self.session.close())
async def send(self):
dump = json.dumps({
'server_count': len(self.bot.servers)
})
head = {
'authorization': 'yourkey',
'content-type' : 'application/json'
}
url = '{0}/bots/213868823151902721/stats'.format(uri)
async with self.session.post(url, data=dump, headers=head) as resp:
async def on_server_join(self, server):
await self.update()
async def on_server_remove(self, server):
await self.update()
async def on_ready(self):
await self.update()
def setup(bot):
bot.add_cog(botsorg(bot))

#

Yes it loads it with load_extension

#

And runs in the main loop

cinder sleet
sonic kindle
#

Yes

cinder sleet
#

The whole thing?

sonic kindle
#

Yes

cinder sleet
#

And I am just confirming again, where would I find the key? Is it where it says client secret?

#

@sonic kindle

sonic kindle
#

The key is the API key from the website

cinder sleet
#

OOOOOOOOOOOOOOOOOOOOOOOH

sonic kindle
#

And you are using client

#

So change all the bot to client

cinder sleet
#

The end of the link

weary shoal
#

No thats your bots id

cinder sleet
#

Dammit I am so bad at this

weary shoal
#

you replace the ? with your key

cinder sleet
#

Where do I find this magic key?

weary shoal
cinder sleet
#

Thanks!

#

And what must I change to client?

#

What parts exactly

#

@sonic kindle @weary shoal (Sorry for tag)

sonic kindle
#

'bot'

#

I use bot you use client

#

my example uses bot.

cinder sleet
#

Ok

#

So I replace everything that has the word bot with client? πŸ˜•

sonic kindle
#

Yes lol

cinder sleet
#

import json
import aiohttp
uri = 'https://discordbots.org/api'
class botsorgapi:
def init(self, bot):
self.bot = bot
self.session = aiohttp.ClientSession()
def __unload(self):
self.bot.loop.create_task(self.session.close())
async def send(self):
dump = json.dumps({
'server_count': len(self.bot.servers)
})
head = {
'authorization': '(I found it now)',
'content-type' : 'application/json'
}
url = '{0}https://discordbots.org/bot/320590882187247617'.format(uri)
async with self.session.post(url, data=dump, headers=head) as resp:
async def on_server_join(self, server):
await self.update()
async def on_server_remove(self, server):
await self.update()
async def on_ready(self):
await self.update()
def setup(bot):
bot.add_cog(botsorg(bot))

#

@sonic kindle Please change it I am confused

karmic parcel
sonic kindle
#

Bro no. What's confusing

#

bot. To client.

cinder sleet
#

I am retarded omg

#

So the last line

#

What must I do

sonic kindle
#

^

cinder sleet
#

Ok

#

Ok I did it

#

brb

#

I am fucking retarded

earnest phoenix
#

you too thanks

cinder sleet
#

Ok thanks everyone who helped

neat falcon
#

DEVELOPMENT

keen anvil
#

go write an ez d.js sharding friendly cluster module pls @earnest phoenix

#

k thanks

earnest phoenix
#

not noW !!!

#

will do soon

keen anvil
#

will be your first download

earnest phoenix
#

inb4 1k downloads in first day

rustic grove
#

-botinfo @silent stone

gilded plankBOT
#
Bot info
ID

325338513153196032

Username

Lit Bot

Discriminator

2754

Short Description

A bot which is gonna have commands that other people wanted!

Library

Discordia

Prefix

lb.

Upvotes

1

Server Count

No server count

Owner(s)

@rustic grove
@tired vector

Links
rustic grove
#

well i am screwed

#

i cant get the server count

gleaming leaf
#

hi guys how do i make bot with assembly??

karmic parcel
prime cliff
#

πŸ€”

#

πŸ€”

#

πŸ€”

vital lark
#

@gleaming leaf like with Unity? Thonkang

gleaming leaf
#

@vital lark no im try use arduino board

vital lark
#

oh

#

You can join the unofficial Discord APi, @gleaming leaf Thonkang

earnest phoenix
#

Is there an API wrappr for Android? Seems Javacord doesn't behave well with it

inner jewel
#

if on 7.0+ i'd use JDA

earnest phoenix
#

Thanks I'm looking at that now

earnest phoenix
#

.ping

plucky kettle
#

so wrong I don't even know where to begin

earnest phoenix
#

@plucky kettle henlo my friend

#

more details what are you trying to do

#

saying it isn't ordering how you like isn't question

plucky kettle
#

role list in a proper order

earnest phoenix
#

how would you like it to be sorted

plucky kettle
#

the same way it would be in server settings

earnest phoenix
#

it sorts by position role list of guild settings

#

so sort same d.js roles

#

aka

#

roles.array().sort((a, b) => a.position - b.position)

#

that should return sorted list

#

message.guild.roles.array().sort((a, b) => a.position - b.position)

[ [Object],
  [Object],
  [Object],
  [Object],
  [Object],
  [Object],
  [Object],
  [Object],
  [Object],
  [Object],
  [Object],
  [Object],
  [Object],
  [Object],
  [Object],
  [Object],
  [Object],
  [Object],
  [Object] ]
#

message.guild.roles.array().sort((a, b) => a.position - b.position)[0]

Role {
  guild: [Object],
  id: '264445053596991498',
  name: '@everyone',
  color: 0,
  hoist: false,
  position: 0,
  permissions: 104188992,
  managed: false,
  mentionable: false }
#

message.guild.roles.array().sort((a, b) => a.position - b.position)[1]

Role {
  guild: [Object],
  id: '324186523266187264',
  name: 'Admin',
  color: 0,
  hoist: false,
  position: 1,
  permissions: 104188992,
  managed: false,
  mentionable: true }
#

message.guild.roles.array().sort((a, b) => a.position + b.position)[0]

Role {
  guild: [Object],
  id: '324625084700688385',
  name: 'Shitpost mute (yes, that bad)',
  color: 0,
  hoist: false,
  position: 9,
  permissions: 104188992,
  managed: false,
  mentionable: true }
#

now sorted right

#

@plucky kettle use + for sorting

plucky kettle
#

ahh, thanky πŸ˜„

#

I havent used sort much yet

earnest phoenix
#

if you havent noticed yet i am the same cat Thinkeyes

#

no one knows about that of you i see

plucky kettle
#

Apparently not

earnest phoenix
#

message.guild.roles.array().sort((a, b) => b.position - a.position)[0]

Role {
  guild: [Object],
  id: '265158261945270273',
  name: 'Website Administrators',
  color: 16711853,
  hoist: true,
  position: 18,
  permissions: 2146958463,
  managed: false,
  mentionable: true }
#

now right didn't notice it was out of order fully

#

as shitpost mute

#

@plucky kettle ^

#

simple sort rule

#

if it is number and 2 values

#

swap them and use -

plucky kettle
#

@earnest phoenix got it πŸ˜„

#

holy better order

vital lark
#

Why am I getting this error: C:\Users\AugustxD - Official\Desktop\Ayane\src\commands\utility\help.js:122 "name": 'help', ^ SyntaxError: Unexpected token : at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:542:28) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at files.forEach.file (C:\Users\AugustxD - Official\Desktop\Ayane\src\ayane.js:34:18) and the code is: ```js
exports.help = [
"name": 'help',
"description": 'Shows Ayane's commands',
"usage": 'a;help || a;help [command]'
];

earnest phoenix
#

maybe try with double quotes

inner jewel
#

{} not []

earnest phoenix
#

that komada?

inner jewel
#

exports.help = [

#

you're making an array

#

not an object

cinder sleet
#

TypeError: get_server() missing 1 required positional argument: 'id'

#

So then I put id in the brackets and it says None

abstract mango
#

@cinder sleet id means server's id

cinder sleet
#

Yes but it says None

abstract mango
#

wait, are you using brackets?

#

like <>?

cinder sleet
#

Nope @abstract mango

abstract mango
#

oh

cinder sleet
abstract mango
#

I've never experimented with get_server() anyways so

#

Β―_(ツ)_/Β―

cinder sleet
#

Ok

#

(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

abstract mango
#

and using rewrite branch, not the one on pip

#

so it may be different for me

cinder sleet
#

Ok

candid oak
#

!invite

rustic grove
#

@bitter sundial

#

wow you just removed the invite LOL

candid oak
#

i was in the wrong server

rustic grove
#

yeah yeah

candid oak
#

was actually 😎

#

prove i wasnt i have lawyers

rustic grove
#

whatever

#

p.s. i never make those mistakes

#

also why !invite

#

bruh

candid oak
#

oh this isnt even the testing channel is it

#

fuck me

rustic grove
#

XD

sonic kindle
#

@cinder sleet for py? If it's rewrite it's just the id if it's not it's 'id'

cinder sleet
#

Ok

#

@sonic kindle yes it is py

sonic kindle
#

bot.get_server('362827462528173')

#

for 0.16.x

#

bot.get_guild(4738362847252)

#

For 1.0.x

earnest phoenix
#

officially snowflakes should be strings but what is d.py doing idk

sonic kindle
#

Strings in 16 x

weary shoal
earnest phoenix
#

it should bE IN REWRITE TOO TO FOLLOW API

sonic kindle
#

Int in 1.0.x

#

They're not there fucking ints

earnest phoenix
#

THAT JUST MAKES D.py WORSE

sonic kindle
#

Annoying as f***

#

Because py rounds ints

#

You have to convert to a string and back to int

#

Worst change ever

inner jewel
#

lol

earnest phoenix
#

vote to change back snowflakes to strings

sonic kindle
#

When you're ID turns into 3826292.e.281722

#

Annoying af

inner jewel
#

snowflakes as 64bit integers is better

#

if they are available

#

way less memory usage

earnest phoenix
#

ye ano

#

snowflakes deliver as strings

#

why d.py changed to int no one knows

inner jewel
#

jda changed to long

bitter sundial
#

ano

earnest phoenix
#

ona

#

noa

sonic kindle
#

Jda can do both int and strs

earnest phoenix
#

aon

bitter sundial
#

noah

weary shoal
#

Don't mention that name

#

Especially in development

#

Since he did NONE of that

earnest phoenix
#

nnoah

#

NOAH

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

weary shoal
#

No

earnest phoenix
#

noah

#

noah

#

noah

sonic kindle
#

wait I use his bot list

earnest phoenix
#

noah

#

noah

sonic kindle
#

But I can't login

earnest phoenix
#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

weary shoal
#

nano ban @earnest phoenix no

earnest phoenix
#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

noah

#

NoahLiedFilm?

weary shoal
#

Nanoah

inner jewel
#

noah

#

noah best dev

earnest phoenix
#

yes

inner jewel
#

all of us can't compare

weary shoal
#

Noah was great

inner jewel
#

everyone aims to be noah one day

earnest phoenix
#

become noah today

bitter sundial
#

becoming noah is easy

#

mastering noah is not

inner jewel
#

luk at my amazing bot i made alone by myself itz the best !1!!!1!11!

earnest phoenix
#

Lol

rustic grove
#

ok so i am gonna start to rewrite my bot in discord.js any recomendations on what to use?

earnest phoenix
#

Thinkeyes so you was going lua then change to js

rustic grove
#

yes cuz i ran into alot of problems in lua sofar

#

and its hard to get help with it

#

since almost noone uses lu

#

lua*

#

Without voice support: npm install discord.js --save
With voice support (node-opus): npm install discord.js node-opus --save
With voice support (opusscript): npm install discord.js opusscript --save

wich one do you recoment?

earnest phoenix
#

It tells tou

#

I would use node-opus

rustic grove
#

ok

rustic grove
#

ok

#

so

#

lets start

#

lets start the rewriting of 129 lines :/

weary shoal
#

At least it's only 129 lines and not over a thousand like mine owo

rustic grove
#

lol

#

but just so i dont have to search the complete docs how do i set the game in js?

weary shoal
#

I can't remember hmm

#

s*exec cat events/ready.js

#

Ugh too big

rustic grove
#

XD

weary shoal
#

I have to add handling to that

#

Check the functions for user

rustic grove
#

omg how did i skip that....

#

in the docs

weary shoal
#

Lol

rustic grove
#

XD

#

now you know how bad i am at reading docs XD

#

i skip alot

#

without noticing

weary shoal
#

D.js docs best docs. Everything links to the next thing

rustic grove
#

yeah i noticed already XD

#

this is so much easier

weary shoal
#

Seeeeeeeee

rustic grove
#

yeah

weary shoal
#

But don't get stuck in the client, user, client, user, client, user, ... loop.

#

Best loop

rustic grove
#

XD

weary shoal
#

Input:

bot.user.client.user.client.user.client.user.client.user.username

Output:

Mercy
#

Best loop

rustic grove
#

XD

#
client.on('ready', () => {
  console.log('I am ready!');
  game.name('Type lb.help for help')
});```
#

thats right?

weary shoal
#

Doesn't look right

rustic grove
#

:/

weary shoal
#

game is not defined

#

I'm on mobile hmm

#

In the docs, go to Client then the user property then look in functions for setPresence I think it is

rustic grove
#

woah

weary shoal
#

Oh that's not right

rustic grove
#

that one?

#

XD

weary shoal
#

I think it's setgame

rustic grove
#

yeah i think too XD

weary shoal
#

Then you do bot.user.setGame(stuff goes here)

weary shoal
#

Yeah in [] is optional

rustic grove
#

i know

weary shoal
#

Game is string

#

Yeah thas righttt

rustic grove
#

is it not client.setGame

weary shoal
#

Hmm.

rustic grove
#

cuz bot is not defined XD

weary shoal
#

/./exec ls

#
cmdline.txt
discord-oauth2-example
keybase_amd64.deb
SharpBot

#

/./exec cat SharpBot/src/commands/utility/setgame.js

#
cat: SharpBot/src/commands/utility/setgame.js: No such file or directory

rustic grove
#

lol

weary shoal
#

/./exec ls SharpBot/src/commands/utility/

#
ls: cannot access SharpBot/src/commands/utility/: No such file or directory

rustic grove
#

is it not setGame

#

rip

weary shoal
#

Oh wait

#

/./exec cat SharpBot/src/commands/Utility/setgame.js

#

Caps

#
const normalizeUrl = require('normalize-url');

exports.run = (bot, msg, args) => {
    msg.delete();
    if (args.length < 1) {
        bot.user.setGame(null, null);
        return msg.channel.sendMessage('Cleared your game! :ok_hand:').then(m => m.delete(3000));
    }

    let parsed = bot.utils.parseArgs(args, ['s:']);

    let game = parsed.leftover.join(' ');
    let stream = parsed.options.s;

    let fields = [{ name: ':video_game: Game', value: game }];

    if (stream) {
        stream = normalizeUrl(`twitch.tv/${stream}`);

        fields.push({ name: ':headphones: Stream URL', value: stream });
    }

    bot.user.setGame(game, stream);


    msg.channel.sendEmbed(
        bot.utils.embed(':ok_hand: Game changed!', '', fields)
    ).then(m => m.delete(5000));
};

exports.info = {
    name: 'setgame',
    usage: 'setgame <game>',
    description: 'Sets your game (shows for other people)',
    options: [
        {
            name: '-s',
            usage: '-s <url>',
            description: 'Sets your streaming URL to http://twitch.tv/<url>'
        }
    ]
};

rustic grove
#

xd

#

bot.user.setGame(game, stream);

weary shoal
#

Yeah

bitter sundial
#

depends on what variable you set it to

#

client.user.setGame

rustic grove
#

const client = new Discord.Client();

#

thats what i got

weary shoal
#

client.user.setGame then

rustic grove
#

yay i right for once XD

weary shoal
#

Lol you missed out user when you said it

bitter sundial
#

mercy confusing people with his own vars

rustic grove
#

XD

weary shoal
#

We should make one standardised global name. Bot or client

#

Pick a side before the war

rustic grove
#

client XD

#

no bot i choose

weary shoal
#

Eww no

rustic grove
#

XD

bitter sundial
#

depends on the lib

weary shoal
#

bot and msg

#

Only way to live

bitter sundial
#

since in d.js it is Client class

rustic grove
#

xd

bitter sundial
#

where

weary shoal
#

What?

rustic grove
#

the discord.js discord

#

XD

weary shoal
#

I hate the ten min timer

rustic grove
#

same

#

its usseless

bitter sundial
#

verify phone number to skip

weary shoal
#

Nope

#

I have a verified number doesn't let me skip

rustic grove
#

i dont wanna verify using my phone number

#

rip

earnest phoenix
#

henlo

#

why not ask me

rustic grove
#

10 min is so usseless

bitter sundial
#

I just joined for the first time

earnest phoenix
#

master of all d.js

bitter sundial
#

no wait

rustic grove
#

oh lol

weary shoal
#

Hnng

earnest phoenix
bitter sundial
#

and I have verified phone number

rustic grove
#

lol

weary shoal
#

I may have unverified myself

earnest phoenix
#

inb4 discord sends ads to ur phone number

rustic grove
#

wow

#

XD

bitter sundial
#

nah

#

it makes things over the waves lol

vital lark
#

lol

rustic grove
#
  if cmd == 'lb.getmewater' then
        print(message.author.username.. ' said getmewater!!!!!!!!!')
        message.channel:sendMessage {
        content = "Here's your water!",
        file = "water.jpg"
        }
    end```
#

i wanna make that javascript

#

you guys can probally help with that right?

#

also wtf

weary shoal
#

On mobile rn, if nobody else helps I will when I get home

rustic grove
#

its not going awey

weary shoal
#

CTRL R

#

Reload

rustic grove
#

thx

#

also it will probbaly be too late then cuz its 21:18 for me

earnest phoenix
#

i suggest learning js first

rustic grove
#

XD

earnest phoenix
rustic grove
#

welllll

#

thats the f part

#

i got absolutly no patience in learning through docs or youtube

earnest phoenix
#

there is book collection covering main js

rustic grove
#

ehm what i mean is that i instantly like to start and just learn on the way

#

ans ask people

earnest phoenix
#

yea people dont like to spoonfeed people that decide to not learn first lang

rustic grove
#

yeah i know but normally i dont actually learn through reading or youtube strangely

#

it just does not work for me

#

i tried it once

#

and ehm

#

i learned nothing from like a 30 video series explaining a complete lang

prime cliff
#

πŸ€” doubt that

rustic grove
#

i am not lieing

#

really i tried

bitter sundial
#

what are you having trouble with

rustic grove
#
  if cmd == 'lb.getmewater' then
        print(message.author.username.. ' said getmewater!!!!!!!!!')
        message.channel:sendMessage {
        content = "Here's your water!",
        file = "water.jpg"
        }
    end
#

translating that too js

prime cliff
#

πŸ€”

bitter sundial
#

so

#

do you know how if works in js?

earnest phoenix
rustic grove
#

yes i do

earnest phoenix
#

and i cant find link to books repo

#

somewhere lost

rustic grove
#

i doubt that it works :/

#

but i will try

bitter sundial
#

you don't know js book?

#

@earnest phoenix

rustic grove
#

ugh cant you guys just help me a little :/

#

you guys made me switch

earnest phoenix
#

@bitter sundial i know one repo that has super perfect books for noobs covering ES6 await/async and all future thing

#

but i dont remember that repo name

bitter sundial
#

@rustic grove is the file the problem?

rustic grove
#

yes

earnest phoenix
bitter sundial
#

mercy really

rustic grove
#

its true....

tame rivet
#

lol

#

#blamejen

rustic grove
#

i serieusly already know that....

bitter sundial
#

so file in MessageOptions

#

is either an object that lets you change more info

rustic grove
#
client.on('message', message => {
  if (message.content === 'lb.ping') {
    message.reply('pong O_o');
  }
});
bitter sundial
#

or the filename

rustic grove
#

i already made 1 of the commands

#

also knowing who sended the message is the problemn

bitter sundial
#

message.author is the user who sent it

#

so it's the same

rustic grove
#

same as lua :/

bitter sundial
#

message.author.username

rustic grove
#

ok

bitter sundial
#

and adding it to a string

#

I am going to teach you the new way and not the old way

#

instead of using normal quotes '

earnest phoenix
#

tonkku for teacher

bitter sundial
#

change it to the quotes that do this aka `

rustic grove
#

yeah?

#

what is the difference :/

bitter sundial
#

oh and instead of print use console.log

#

with the ` quotes you can use ${variable} inside the string

weary shoal
#

I didn't make anybody switch. I just suggested that lua isn't the best language to make a bot in

rustic grove
#

:/

bitter sundial
#

${message.author.username} did something

earnest phoenix
rustic grove
#

ugh if i am gonna get this all the time i think i will just stop but i will try for now....

earnest phoenix
#

we could acctaully find decoding part and build our own spotify decoder to be efficient and use for music playing

rustic grove
#

message.send(${message.author.username} did something, )

weary shoal
#

@earnest phoenix I'll wait until after rewrite whenever you do that

rustic grove
#

just like that?

weary shoal
#

No , at the end

rustic grove
#

i know

#

but for the file?

#

where do i plce it

#

place*

bitter sundial
#

print(message.author.username.. ' said getmewater!!!!!!!!!') is what I was talking about

rustic grove
#

i know

#

:/

#

but how do i do the FILE

#

i still dont get it

#

:/

bitter sundial
#

message.channel.send

rustic grove
#

:/

bitter sundial
#

if you look at the docs you see it takes two arguments: content and options

rustic grove
#

yes

bitter sundial
#

Here's your water! is the content and you can do that

rustic grove
#

yes

bitter sundial
#

then you add a ,

rustic grove
#

yes

bitter sundial
#

and start an object

rustic grove
#

object?

bitter sundial
#

do you know json

rustic grove
#

ehm

#

a little bit...

#

not much too

#

tho*

#

and i gotta do this fast cuz i gotta go...

bitter sundial
#

json is javascript objects

#

here's an example object {dogs: 2, cats: 5}

#

so can you make an object with file as the filename

rustic grove
#

ugh lets see....

#

message.channel.send('Here is your water!',file:'water.jpg' )

#

probbaly wrong...

bitter sundial
#

an object has to have {} around it

rustic grove
#

message.channel.send('Here is your water!', {file:'water.jpg'} )

#

is that correct?

earnest phoenix
#

well array is also object

#

but we call it array

bitter sundial
#

array is a special kid

rustic grove
#

is this good?

bitter sundial
#

yup

rustic grove
#

just tell me cuz i gotta go

bitter sundial
#

test it

rustic grove
#

good

#
    message.channel.send('Here is your water!',file:'water.jpg' )
                                               ^^^^

SyntaxError: missing ) after argument list
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3

C:\Users\thoma\Desktop\Lit bot javascript>pause```
#

...

earnest phoenix
#

you didn't update

bitter sundial
#

you forgot to save

rustic grove
#

oops

#

lb.getmewater

#

:/

bitter sundial
#

and quick fixup because deprecation

weary shoal
#

Bots can't talk here

rustic grove
#

oopd

#

XD

bitter sundial
#

{files:['water.jpg']}

rustic grove
#

works

bitter sundial
#

is there arrays in lua

earnest phoenix
#

yes nano handling errors !!!

rustic grove
#

thx cya tommorow yall

bitter sundial
#

@earnest phoenix was the book I linked the one you were looking for?

earnest phoenix
#

nah

#

it is github repo

bitter sundial
#

there is repo of it

#

lol hi random guy

earnest phoenix
#

oh yes this !!!

weary shoal
#

That guys face is perfection

earnest phoenix
#

πŸ‘Œ

#

great shit

#

approved by sneklab

cyan wedge
#

hello friends

#

how do bot?

earnest phoenix
#

henlo not friend

cyan wedge
#

how do bot @earnest phoenix

earnest phoenix
#

first turn on toaster

#

set on 3 mins

#

wait till it is done

cyan wedge
#

ok what is the command to do?

earnest phoenix
#

toaster-toast({ time: 3 })

cyan wedge
#

!help

#

it didn't work

weary shoal
#
How to bot
1. Buy fridge
2. Install toaster
3. require('toaster').toast({ time: 3 });
4. ???
5. Profit
earnest phoenix
#

@cyan wedge toasts only work in #commands rooms

cyan wedge
#

!toast

#

why do you need a fridge @weary shoal

weary shoal
#

bots can only run on fridges

#

Keeps them cool

keen anvil
#

Oh mighty @earnest phoenix, will d.js internal sharding ( soon ) be more compatible with clusters?

earnest phoenix
#

d.js internal sharding is just running same processing but with more websockets connected so discord thinks bot is sharded

#

thats pretty good for bots that didn't reach like 10k guilds

#

but later process wont be powerful enough to handle that load

#

it will need actual spliting

keen anvil
#

So I'll keep on using the sharding manager? :/

earnest phoenix
#

well internal sharding is good enough for you now

keen anvil
#

8.1k servers, so by the time internal comes out, I'll probably be over 10k

earnest phoenix
#

it will decrease memory usage somewhere like ~50MB but thats just value by bot size

#

@keen anvil you can always download gus internal sharding fork

#

and use it

keen anvil
#

I mean whatever you think will help performance best. I have a 4 core VPS, but you know, no clusters. I did just move my image generation over to a cheap 1 core server with express

earnest phoenix
#

why move it to new vps

#

you actually could spawn it on 1 of free cores

#

as child process

keen anvil
#

Cause idk how to do that.

earnest phoenix
#

and talk over process events or any other type

keen anvil
#

Hey, I mean it's set up and works now

earnest phoenix
#

are you storing memes images cloned

#

as memory usage is huge

keen anvil
#

I'm not storing anything besides 3 images that generate.

#

it's for trigger, warp, invert, magik, and salty

#

trigger and salty being heavy commands on the CPU

earnest phoenix
#

what modules are you using

#

as some are really shit and eat your memory as hell

keen anvil
#

jimp, gifencoder for salty and trigger

#

snekfetch and gm for warp

#

imageMagick too

earnest phoenix
#

yea gm and imageMagick are memory monsters

keen anvil
#

mm, not really an option that does the same thing in js iirc. I'd have to write my own

#

As long as it doesn't get too high before I notice, I can always restart the api server

#

not a big deal

earnest phoenix
#

Thinkeyes thats pretty simple function wrap is

#

i will look for you doing that with jimp

keen anvil
#

If you can do that, it would be great. But roll, swirl, and implode aren't exactly built in functions

earnest phoenix
#

if i will need i will create those functions

keen anvil
#

Be my guest

abstract mango
rustic grove
#

@weary shoal

weary shoal
#

What?

rustic grove
#

i made it work....

weary shoal
#

Ayy gj!

rustic grove
#

i can play music with my bot now!

#

it took me like the whole day

#

but its working!

weary shoal
#

Haha nice

rustic grove
#

only i noticed it glitches sometimes and does not play the music

earnest phoenix
cinder sleet
#

Hey, its me, Spectrix the noob again... I cant seem to figure out how to get my program to tell me how many members are in all the servers my bot can see MEGATHINK I am using Python

rustic grove
#

well for js it was like client.guilds.size IF i remember correctly.

#

#eval client.guilds.size

#

wut

#

oops

#

can do it here XD

#

pffff idk i am not there yet for me

#

i still gotta make my music player work correct

next path
#

@rustic grove music is done for my bot but need a queueing system

#

xd

rustic grove
#

my que already works XD

next path
#

using what Library for yout bot?

rustic grove
#

discord.js

weary shoal
#

@static oasis try googling anime picture api

fiery goblet
#

so searching pictures on a site?

#

using a bot

keen anvil
#

Does the site have an actual API? @static oasis

weary shoal
#
Search results for `"anime images api"`

https://myanimelist.net/modules.php%3Fgo%3Dapi
https://myanimelist.net /api/anime|manga/search.xml?q=full+metal ... <image>
https://myanimelist.cdn-dena.com/images/anime/6/4052.jpg</image> </entry>Β ...

https://www.reddit.com/r/anime/comments/5ec91v/any_api_for_anime_wallpapers/
22 Nov 2016 ... Are there any services that provide random anime wallpapers with APIs? Like,
Bing's Image of the Day, NASA's Astronomy Picture of the Day,...

http://anilist-api.readthedocs.io/en/latest/anime.html
AnimeΒΆ. Title languages: To make supporting the user title_language option
easier, if the english or japanese titles are not available their values will be
replacedΒ ...

https://github.com/jieverson/animeapi
A free, easy-to-use and open-source RESTful API for Anime Data. ... "picture": "
http://cdn.myanimelist.net/images/anime/10/47347.jpg", "synopsis": "CenturiesΒ ...

https://konachan.com/help/api
Konachan.com - Image board site for Anime / Manga wallpapers. ... Moebooru
offers API which is mostly compatible with Danbooru API (version 1.13.0) to make
Β ...

next path
#

@rustic grove can you teach your ways? oh thomas

#

xd

weary shoal
#

I swear nobody has independence here

rustic grove
#

wut

weary shoal
#

It shouldn't be I don't know how to do this so I will give up and wait for somebody to give me their code

#

That's not how life works

rustic grove
#

litterly i just starting coding in js XD

#

and i made the voice in 1 whole day full of stress and hell

weary shoal
#

Ik I'm not talking about you Thomas it's ok

rustic grove
#

XD

#

i know

#

but

#

nasty is aksing me XD

weary shoal
#

Lol

next path
#

mada mada

rustic grove
#

now i know what you guys mean with no spoonfeeding XD

fiery goblet
#

my mom was bad then

rustic grove
#

also mercy why is you nick like that

#

?

fiery goblet
#

lol

weary shoal
#

I have one file that can be copied into a bot.on('message') that is a fully working YouTube search and player

#

I need to split it up

#

Too much ram usg

rustic grove
#

oh my i really need that cuz i want the search function so bad

#

!

surreal peak
#

spoooonfeeeeeeddiiiiiiing

rustic grove
#

i currently can only do id

next path
#

@weary shoal yellow_fruit

weary shoal
#

@rustic grove npmjs.org and search for youtube-search

rustic grove
#

and i dont want a new full day of stress and hell XD

#

ok

#

wut

#

XD

next path
#

what is that

#

xd

weary shoal
#

@next path That wont help you if you dont have any music playing to start with as it only searches and doesnt play but yes

next path
#

yeah thats why im like half way lost xd

weary shoal
#

@static oasis That module doesnt have built in playing

#

It can only search youtube

next path
#

Which one that have the both sides? yellow_fruit

weary shoal
#

I dont know if there is one

sinful jolt
#

There isn't I don't think

weary shoal
#

Who is @sinful jolt I am confuse

sinful jolt
#

Why?

#

-bots @sinful jolt

gilded plankBOT
#
Crystal#6112
Bots <:dblSupporter:317251816226160641>

@woven verge certifiedbot
@viral saffron
@silk token

sinful jolt
#

Less confused?

weary shoal
#

Ohh ok

#

I thought you left my guild OwO

sinful jolt
#

I left ALL of them

weary shoal
#

Whoa

#

Then became a furry?

#

πŸ˜‰

sinful jolt
#

Ye who is going to find me as a furry name Crystal

weary shoal
#

Jks ly Tom/Crystal/Whatever your name is now

sinful jolt
#

Ya I'm way hotter then before πŸ˜‚

#

now I just grow new guilds

weary shoal
#

You should have told me I would have given back your donator rank lol

sinful jolt
#

I joined yesterday I just gotta click the thing on patron and it will give me

weary shoal
#

lol

#

Tbh I actually thought you quit Discord when all the people were kicked from your guilds

sinful jolt
#

I did technically

#

Drama to much

weary shoal
#

Tru

sinful jolt
#

The staff from my server couldn't get along with staff from my other servers

#

So I deleted some and left the rest

#

So empty

weary shoal
#

lol

#

All but 1 offline

#

/invis

#

Only time people PM me is to send nudes or ask for things

sinful jolt
#

Boobbot πŸ‘€

weary shoal
#

Yeah

#

Blame Francis

#

selfbot (3)
wtf (3)
dm-clear (1)
christian (0)
wow (0)

#

bot.channels.filter(c => c.recipient && c.recipient.bot).forEach(c => c.delete())

#

Input:

bot.channels.filter(c => c.recipient && c.recipient.bot).forEach(c => c.delete())

Output:

undefined
sinful jolt
#

Ayy

weary shoal
#

Input:

bot.channels.filter(c => c.recipient && c.recipient.id == '203587309843513344').forEach(c => c.delete())

Output:

undefined
sinful jolt
#

I used aiohttp and the app endpoint to leave all guilds

weary shoal
sinful jolt
#

Without unverifying my email

weary shoal
#

Nice

#

I have 2-step OwO

sinful jolt
#

Me too

#

I just sent my token in header with origin : discordapp

weary shoal
#

lol

sinful jolt
#

And poof no unverify email

fiery goblet
#

wait ur tom?

sinful jolt
#

lul

fiery goblet
#

no

weary shoal
#

It doesnt tag me so Β―_(ツ)_/Β―

fiery goblet
#

same

earnest phoenix
#

how do you do code boxes in an embed?

sinful jolt
#

the same way?

#

`code

#

codestuff

earnest phoenix
#

ok

#

thanks

sinful jolt
#
moar pie```
#

thers that to

earnest phoenix
#

this isnt code box

#

this is codeblock u dambs

#

also it is same markdown nothing changed

fiery goblet
#
console.log('banter');
earnest phoenix
#

.stats

indigo oasis
#

++profile

slow idol
#

Asked in Discord API

lost crane
earnest phoenix
#

you got answered by user named dumb and you beleave it HYPER3c

slow idol
#

Well I'm not a discord developer

#

And his name is blue

earnest phoenix
#

dumb name is white

#

smh

#

great color

#

much effort

slow idol
#

πŸ‘

bitter sundial
#

yeah no one can access deleted images rip

slow idol
#

back at square 1 LUL

lost crane
#

"yeah no one can access deleted images rip"

that's why they are called deleted lul

bitter sundial
#

they're still kept

earnest phoenix
#

and can be accessed

#

if you have right rights to image

#

one of them is being message author

#

@umbral pelican guildmember.ban will ban that user with knowledge that member exist

#

guild.ban is used with knowledge of member may not be in guild

lost crane
#

isnt this just aliasing all over the place?

#

what lib?

earnest phoenix
#

d.js

lost crane
#

ok no idea then

#

i only know discordie & eris

earnest phoenix
#

anyways @umbral pelican it is just alias for guild.ban

#

but having member

#

so after ban is done you can still have member details

#

for mod log and ect

earnest phoenix
#

ERIS

#

GOD

#

PLS

#

NO

#

D.JS > ALL

fiery goblet
#

means eat biggest or best

slow idol
#

These audit logs suck so much they dont actually return a message object, but you can always find workarounds :^)

bitter sundial
#

discord audit logs are nice but could use some more things

slow idol
#

Yeah I really wan't them to just send a message in extras for message_delete would make things alot easier

slow idol
cyan wedge
#

@earnest phoenix wew that's a dum thing to say

#

@slow idol they don't give you a message on purpose lol

#

and wan't is not a word

slow idol
#

What's the purpose then?

fossil oxide
#

Yea but mod log is already broken here because Luca does a fuck ton of role updates

slow idol
#

get more boats :^)

prime cliff
#

Yea Oily why dont you use blargbot for the mod logs πŸ€” or my moderator bot

earnest phoenix
#

we need custom ones

#

as we log stuff that other mod log bots dont

slow idol
#

yeet

earnest phoenix
#

also we need trust so only nano or luca

#

!!!

rustic grove
#
client.on('ready', () => {
  console.log('I am ready!');
  client.user.setGame('Type lb.help for help')
  exec(`curl -X POST -H "TOKEN of my bot is here" -H "Content-type: application/json" -d '{"server_count": "${client.guilds.size}"}' "https://discordbots.org/api/bots/325338513153196032/stats"`);
  console.log(`Running on ${client.guilds.size}`);
});```
#

whats wrong with it

#
  exec(`curl -X POST -H "MzI1MzM4NTEzMTUzMTk2MDMy.DCWyxA.BBMNbCtmYcnnBnPPk57AOVp4fGE" -H "Content-type: application/json" -d '{"server_count": "${client.guilds.size}"}' "https://discordbots.org/api/bots/325338513153196032/stats"`);
        ^^^^

SyntaxError: Unexpected identifier
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3```
#

/\

#

the error

#

and the arrows are under the server count

earnest phoenix
#

did you really take that curl server count

#

lol

rustic grove
#

huh

#

whats wrong then=

earnest phoenix
#

it is bloatware

#

it was just a joke

#

to use

rustic grove
#

bruh

earnest phoenix
#

there will be correct example

rustic grove
#

snekfetch.post(`https://discordbots.org/api/bots/${client.user.id}/stats`)
  .set('Authorization', 'UR DBOTS.ORG KEY')
  .send({ server_count: client.guilds.size })
  .then(console.log('Updated dbots.org status.'))
  .catch(e => console.warn('dbots.org down spam @oliy'));```
#

this one?

bitter sundial
#

you leaked your token

#

and it's not the token for the website

rustic grove
#

leaked token?

#

FUCK

#

damit gotta change it....

umbral pelican
#

Lol

rustic grove
#

ugh well got a new token now :/

#

damit now i gotta redo all the tokens in my script

#

UGH

#

done

#

XD

umbral pelican
#

Hardcoded token BlobThinkingEyes

surreal peak
#

rip i was booting your token

rustic grove
#

lol

#

booting my token ?

#

sorry i just dont knwo why you actually gotta hide your token :/

keen anvil
#

@rustic grove put your token in a config file and that way all you ever have to put in your script is config.token

#

same with your id

#

config.dev

bitter sundial
#

it leaked from the error he showed

rustic grove
#

i know

#

but what did he mean by booting my token?

keen anvil
#

He was going to fuck with your token

#

as was I