#development

1 messages ยท Page 469 of 1

cobalt swan
#

It's just the missing piece ๐Ÿ˜›

earnest phoenix
#

I've never used DBM and it has no public documentation.

#

Maybe you should go to their server and ask them for it?

knotty steeple
#

paying $10 for a app to make discord bots..

quartz kindle
#

idk about dbm either

knotty steeple
#

when you can learn to code for free

cobalt swan
#

I have, but im just looking for a developer who can create this for me, in python or whatever

earnest phoenix
#

what

knotty steeple
#

dbm uses discord.js

cobalt swan
#

I didn't pay for it, I cracked it

earnest phoenix
#

my god

knotty steeple
earnest phoenix
quartz kindle
#

but first you need to save the channel id of the command, and check if messages match the channel id

earnest phoenix
#

i cracked discord bot maker haHAA

#

ill pay guys i swear haHAA

#

just make ame a bot haHAA

quartz kindle
#

then you rule out the digits

cobalt swan
#

XD TOM

#

What do you mean Tim. I mean there will be like 10-25 different 3 digits codes that people till type in

quartz kindle
#

i dont know what do you want your digit system to do

#

but first you need the channel id so the bot doesnt get messages from other channels into that command

#

so that messages in that channel go to the digits function, and not the other bot functions

#

while its listening

cobalt swan
#

The thing with the 3 digit system is that when for example 5-10 people type the same 3 digit code they will match together with the same SERVER ID "3 digit" and same goes for the others with different 3 digit code. If you got me

quartz kindle
#

so they can create an arbitrary digit

#

does it need to be persistent? like once set it should be saved forever, or can be discarded after showing the list?

cobalt swan
#

It will only be used in one chat

#

Numbers and letters, just 3 digits

#

It can be discarded after showing the list after sometime

#

No need to be saved forever

quartz kindle
#

does it need to listen for digits in other channels/servers?

cobalt swan
#

Only one channel

#

When the countdown bot has started in the voice channel, the other bot will automatically open the chat so people can type their 3 digits code and after like 1 minute the bot will close the chat so nobody can type

#

As everyone can see who they group with

quartz kindle
#

do they create their own 3 digit codes or do they get it from somewhere?

#

like if someone types 123, the group "123" will be created with only 1 member

cobalt swan
#

They get it from the server, there will be a long ass code but it will be the last 3 digits of that code

quartz kindle
#

can the bot verify this?

#

because people can just put whatever, and the bot cant verify its a valid code

cobalt swan
#

That's what im working on, not really sure how to do it

#

The bot has to verify every single 3 digits code

quartz kindle
#

is this a game server? which game is it?

cobalt swan
#

Fortnite

quartz kindle
#

do they have a public api?

cobalt swan
#

When the match is going to start, you need to sit in the room "Countdown".
Make sure your other team-members are ready and the content is pre-loaded.
A bot will then countdown. Last player hits ready when bot says GO!

When you're connected to the server make sure to check the 3 last digits in the server-code (left top corner of screen).
Type these 3 last digits in "#snipe-codes". There will be a form where you can see all other teams and which server they was placed in. Something like that, not sure if they do have a public api but I could be wrong

earnest phoenix
#

so basically a system that will never work because it requires too much cooperation from too many people across multiple platforms with a time limit

quartz kindle
#

i seriously doubt any of that can even be achieved with dbm

earnest phoenix
#

and people could type different IDs, people who arent in the game could ytpe it

#

its not gonna happen

quartz kindle
#

^

cobalt swan
#

Yeah well there's actually no need for to make a system for so many people across multiple platforms with a time limit etc. Like if there's any way to put it in embed messages and the ones who type the codes they will just group in a form together as the screenshot I showed you. No need to be advanced

#

I can actually pay for it if you could develop it for me btw

earnest phoenix
#

i thought fortnite only had like 4 man groups

#

whats the bigger grouping for?

cobalt swan
#

It's correct, the idea is that we'll be hosting solo, duos and squads snipes every 30 minutes. The ones who wants to join will be in the "Snipe Countdown" voice channel, there will be maybe 50+ waiting for the bot to countdown (3 2 1 go) it's like scrims to match against on the same server if everyone queue at the same time

#

I have everything ready besides for the grouping ID form thing

#

But it will be more than 50+, just made an example

quartz kindle
#

so the bot's sole purpose is to group people and nothing else? everything else, including the channel opening and closing is handled by another bot?

earnest phoenix
#

no, its to join fortnite games, get the ID of the match (shown on screen somewhere) i guess

#

all those people queue at the same time

#

why you would want to do this? only reasons would be to team, or to snipe streamers

#

or some other stupid shit

#

nobody with half a brain gonna make that

quartz kindle
#

i dont play fortnite so i dont get it

cobalt swan
#

So the bot purpose is to group people with the same ID and for those who are alone, like every 3 digit code have to be in the form and the player name of course AND including the channel opening + closing

earnest phoenix
#

they all queue at the same time

#

to increase chance of being in same game

#

then the bot puts in groups

#

of people in same game

#

so they can team up to cheat and win

#

stupidest thign ever

cobalt swan
#

?

#

There will be no teaming, that's against the rules

earnest phoenix
#

i mean thats what it sounds like OMEGALUL

#

u can only have 4 in a group, u call the channel "snipe countdown" and everybody tries to join the same game? awaitwhat

cobalt swan
#

It's called scrims/snipes, not even near to stream sniping

#

Yeah exactly

#

For example

#

If we're hosting squads

#

There will be 4 people on every team right

#

And to increase the chance to match up with the other squads, with better players and practice. Will do also host tournaments further in the future but this is just the beginning of the project

earnest phoenix
#

i take it fortnite doesnt have custom games

cobalt swan
#

Lets say there's 20-30 squads waiting

#

That's like 80-100 people

earnest phoenix
#

so lets say there are 8 people in the snipe queue

cobalt swan
#

So some of them will match together

earnest phoenix
#

and they all get in the same game, 2 squads

cobalt swan
#

Ye

earnest phoenix
#

where does the ID come from?

cobalt swan
#

When they are connected ingame

earnest phoenix
#

so its on screen?

cobalt swan
#

There will be a long code upper left corner

earnest phoenix
#

and is it different for those 2 teams, or same for everybody in the match?

cobalt swan
#

But to make it easier we just thought about the last 3 digits of that code

quartz kindle
#

but if you can only see the code when you're already in there

#

why the bot?

cobalt swan
#

If we queue at the same time and get to the same match we will have the same ID, the others who dont wont

earnest phoenix
#

OK so

#

this might sound crazy

cobalt swan
#

Because to group all of the people who's playing

earnest phoenix
#

so if people have their 4 man groups

cobalt swan
#

Thats what I need the bot for

earnest phoenix
#

why not just have a category with many 4 man voice channels

#

and have a bot rename that category to the game ids

#

and that way just 1 person gfrom each game ever has to use a command

cobalt swan
#

Nah it wont work like that

#

But I get your idea

#

But then it will be many categorys with IDs..

#

Better with the chat to group the IDs

earnest phoenix
#

u just have multiple categories with voice channels inside

cobalt swan
#

Well, it's a better concept with the chat I think

#

Easier

#

You know how?

earnest phoenix
#

i mean just think about it

#

if ur all queueing at the same time

#

but ur not all teaming and being in one voice channel to cheat

#

tthen why do others need to know what game ur in, just play the game together

#

theres no way to guarantee being in the same game anyways

#

apart from just being in 4 man

#

so its not like ur gonna be "hosting tournaments"

cobalt swan
#

That's the idea of it, the professional players are using this kind and this will be big. You don't have to worry about that stuff. I just would like to get that stuff going

#

So, do you want to help me to get this going or not?

hoary bramble
#

;shout @hoary bramble

knotty steeple
#

still wrong channel GWqlabsFacepalm

sinful lotus
#
    if (client.voiceCheck.size) {
        for (const [key, value] of client.voiceCheck) {
            if (!client.voiceConnections.has(key)) {
                client.voiceCheck.delete(key);
            };
        };
    };

since im just getting the key, could I just do it like

    if (client.voiceCheck.size) {
        for (const [ key ] of client.voiceCheck) {
            if (!client.voiceConnections.has(key)) {
                client.voiceCheck.delete(key);
            };
        };
    };

This ^ ?

uncut slate
#

you can just const key in client.voiceCheck

#

nvm you can't

sinful lotus
#

so not possible then?

#

unless I do some iteration on the other side

#

like maybe grab the values etc etc

heady zinc
#

const [key] of client.voiceCheck works

sinful lotus
#

got it thankies

stone hinge
#

how many days to approve the bot?
my bot awaiting approval 2 day.

knotty steeple
#

there are less mods now

#

so

#

may take longer

stone hinge
#

oh.. tnx

ocean token
#

!profile

earnest phoenix
#

hey

native pine
#

hey

earnest phoenix
#

I'm really confused.. I've done node.js for a long time.. and I've been trying to make a online panel.. I figured out how to get the users token into the server but I have no Idea how to make the html interactive..

#

I mean interactive in the fact that the server can put variables in the html (EXAMPLE: the users name in the top right)

topaz fjord
#

templating

earnest phoenix
#

pug

topaz fjord
#

ejs

earnest phoenix
#

I'm using express btw

earnest phoenix
#

thanks ๐Ÿ˜ƒ

tame quail
#

Hey if wanted to switch server specific commands to any server how would i do that?

loud salmon
#

what lang?

devout raven
#

uhh

#

24hr i wait

west raptor
devout raven
#

where my new bot

bright spear
#

@devout raven what?

devout raven
knotty steeple
#

@west raptor Thonk

west raptor
#

i installed it 5 times

knotty steeple
#

looks like async

neat falcon
#

is that client mods i see

knotty steeple
#

to me

#

get rewrite

#

or is it rewrite

#

idk

#

wew

#

@west raptor wat code

west raptor
#

huh

knotty steeple
#

whats ur code

west raptor
#
import discord
import config

class Daylight(discord.Client):
    async def on_ready(self):
        print('Logged on as {0}!'.format(self.user))

    async def on_message(self, message):
        print('Message from {0.author}: {0.content}'.format(message))

client = Daylight()
client.run(config.token)
knotty steeple
#

ew

west raptor
#

ok

#

am new to python so i basically copy and pasted of the site

#

ok

knotty steeple
#

i have mine differently so idk

#

@west raptor

#

wait

#

where did u get it

west raptor
west raptor
#

ok

knotty steeple
#

pycharm is bad

west raptor
#

ok

#

i tried

#

on

#

vscode

#
SyntaxError: invalid syntax```
knotty steeple
#

wew

slender thistle
west raptor
#

how do i check that

#

lol

loud salmon
#

python --version iirc

#

or -version idk which

west raptor
#

not python version

loud salmon
#

oh my bad

slender thistle
#

pip show discord.py

#

Anyways... you are not doing it right.

west raptor
#

0.16.12

#

.

#

i basically copied off the site then copied of the site that SamuraiStacks gave

slender thistle
#

What is config?

#

A json file with dict?

knotty steeple
#

probably just trying to import config.json as a module

slender thistle
#

I will just assume it's a file.

west raptor
#

its a file

slender thistle
#

And there is a dictionary inside of the file or just the bot token?

west raptor
#

token

knotty steeple
#

whats a dictionary

west raptor
#

idk

slender thistle
#

Is it just the token or something like this:

{
  "token": "my_token_here"
}

?

west raptor
#

yea

slender thistle
#

Oops.

#
import discord
import json

token = json.load(open("./config.json")) # Replace config.json with your file name.

client = discord.Client()

@client.event
async def on_ready():
    print('Logged on as {0}!'.format(client.user))

@client.event
async def on_message(message):
    print('Message from {0.author}: {0.content}'.format(message))

client.run(token["token"])
#

Here is a little example of how it is done. GWchadThink

west raptor
#
Traceback (most recent call last):
  File "Daylight.py", line 1, in <module>
    import discord
  File "C:\Users\fazin\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\__init__.py", line 20, in <module>
    from .client import Client, AppInfo, ChannelPermissions
  File "C:\Users\fazin\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\client.py", line 38, in <module>
    from .state import ConnectionState
  File "C:\Users\fazin\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\state.py", line 36, in <module>
    from . import utils, compat
  File "C:\Users\fazin\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\compat.py", line 32
    create_task = asyncio.async
                              ^
SyntaxError: invalid syntax```
slender thistle
#

Uh-uh.

#

Is your Python version 3.7?

west raptor
#

yes

slender thistle
#

That's the problem.

west raptor
#

.

slender thistle
#

3.6.6 should work fine with async.

west raptor
#

is there a way to downgrade?

knotty steeple
#

uninstall

#

install

west raptor
#

again

#

ffs

#
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\program files (x86)\\python36-32\\Lib\\site-packages\\chardet'
Consider using the `--user` option or check the permissions.```
#

had this issue earlier

#

had to reinstall python

#

and now its back

#

nvm

#

i fixed it

#

thank you

earnest phoenix
#

does anyone know any passport-discord stuff, because i keep getting this error when i try to log into my bot's dashboard:

TokenError
    at Strategy.OAuth2Strategy.parseErrorResponse (/home/node/mini-me-stable/node_modules/passport-oauth2/lib/strategy.js:329:12)
    at Strategy.OAuth2Strategy._createOAuthError (/home/node/mini-me-stable/node_modules/passport-oauth2/lib/strategy.js:376:16)
    at /home/node/mini-me-stable/node_modules/passport-oauth2/lib/strategy.js:166:45
    at /home/node/mini-me-stable/node_modules/oauth/lib/oauth2.js:191:18
    at passBackControl (/home/node/mini-me-stable/node_modules/oauth/lib/oauth2.js:132:9)
    at IncomingMessage.<anonymous> (/home/node/mini-me-stable/node_modules/oauth/lib/oauth2.js:157:7)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
topaz fjord
#

Show code

earnest phoenix
#

hastebin really needs an account system

#

@topaz fjord

split lantern
#

@earnest phoenix you are free to pr one

earnest phoenix
#

what?

split lantern
#

Go to hastebins github
Fork
Add account system
Pr

earnest phoenix
#

ah

#

i see

#

this is my friends clone, he hosts on gitlab

#

@split lantern have you worked with passport-discord before?

split lantern
#

I mean it says
Token Error

earnest phoenix
#

it might be cookie-session

split lantern
#

To what part do you come

earnest phoenix
#

wtf?

split lantern
#

Like do you know ~~ where it errors

earnest phoenix
#

oh, i can get it to run just fine, just when i try to login, it goes all the way through the discord oauth part and then errors when it comes back to my site.

#

@sharp bluff whats your bot based on?

#

I prefer Discord.JS

sharp bluff
#

yeah nodejs

earnest phoenix
#

so discord.js?

wide shale
#

This is for bot development...

earnest phoenix
#

yeah we know ๐Ÿคฆ

sharp bluff
#

yeah discordjs

earnest phoenix
#

nice

#

im a pro at discord.js

#

Hell yeah

#

if you need help then ask me

#

yet people wonder why this botlist is shit

#

i dont get it

#

it that a joke?

#

weebs like you

#

How do you get CPU % usage of node process? (nodejs)

heady zinc
#

boi

#

calm down a bit

earnest phoenix
#

weeb

heady zinc
#

@earnest phoenix you calcul from process.cpuUsage()

earnest phoenix
#

hmm

heady zinc
#

actually not sure of the syntax of this method

earnest phoenix
#

How do you get the bot developer role

heady zinc
#

be a bot developper

earnest phoenix
#

develop a bot

heady zinc
earnest phoenix
#

i did once

#

i already have a bot ๐Ÿคฆ

#

but it got removed

#

oofio

#

why

heady zinc
#

yeah so this is a website that lists bots

earnest phoenix
#

they search you for leaked tokens here

heady zinc
#

your bot is not on it

#

thus you don't have the role

earnest phoenix
#

my bot is called Cat

heady zinc
#

see the pattern

earnest phoenix
#

its not accepted yet

heady zinc
#

yeah you expect up to a month of waiting

earnest phoenix
#

@split patrol

#

A FUCKING MONTH?

heady zinc
earnest phoenix
#

who tf are you tryinhg to tag

#

WHAT IS THIS BULLSHIT

#

and i tagged my bot

#

@split patrol

heady zinc
#

yeah 2/3 of the staff retired there's nobody left to verify the bots

earnest phoenix
#

lmao

#

lmao

#

@bitter sundial verify cat bot rn or your gf wont give you a blowjob tonight last call

#

shows how shit this server is, not even the staff like it

heady zinc
#

that's how you get banned ๐Ÿ‘

#

well fuck this im out then

earnest phoenix
#

lool

#

wait is tonkku a girl or a boy

#

guy you dumbass

#

phew

#

ok

#

TypeError: Cannot read property 'kick' of undefined
wat

#

@uncut slate do you know why? it's broken all my moderation commands

uncut slate
#

why ping me

#

genuinely curious tbh thonk

#

anyhow, mostly useless error without the surrounding code

earnest phoenix
#

I was looking for verified devs and I know you were a mod

uncut slate
#

were mmSpin

#

read the channel topic

earnest phoenix
#

it crashes my bot

uncut slate
#
If you have questions, ask the questions and wait for someone who can answer to help you. [ ... ] Do not @mention people randomly.
earnest phoenix
#

yes

#

I never read topics

sick cloud
#

are you calling kick on a guildmember?

uncut slate
#

then that's your issue to deal with, not mine mmSpin

sick cloud
#

or a user

earnest phoenix
#

a user

sick cloud
#

aeth likes that emoji

#

oh

#

you need a guildmember

#

assuming your on d.js or something like that?

earnest phoenix
#
member.kick(reason)```
sick cloud
#

oh

#

add another line in between

#

if (!member) return msg.reply('No member mentioned or found');

#

that'll stop it erroring if theres no member mentioned or it couldn't get them

earnest phoenix
#

I have that

#

if (!args[0]) return msg.channel.send("Hmmm, looks like you didn't tell me someone to kick!")

sick cloud
#

you should check for the member

#

not args[0]

#

since depending on your args setup it can fail still

gilded blaze
#

Well if you don't want an error you should check the variables you are depending on to not be null or undefined.

earnest phoenix
#

it says member is not defined

#

@sick cloud

sick cloud
#

woah

#

thats weird

earnest phoenix
#

it kicks the user then crashes the bot... @sick cloud

sick cloud
#

what are you doing AFTER the kick code?

earnest phoenix
#

sending an embed

sick cloud
#

what are you using in the embed?

#

or just show the code

earnest phoenix
#
    let reason = msg.content.split(" ").slice(2).join(' ');
    let embed = new Discord.RichEmbed()
    .setColor("BLUE")
    .setTitle("Kick!")
    .addField(`Kicked:`, `${msg.mentions.members.first()}`)
    member.kick(reason)
    msg.channel.send({embed})```
sick cloud
#

ok

#

${msg.mentions.members.first()} won't work

#

since the member would already be gone

#

send the embed before you kick

earnest phoenix
#

ty @sick cloud

sick cloud
#

thats what i think at least, but np

sick cloud
#
router.get('/bot/:id', async (req, res) => {
    
});

anyone good with express and know how to get the :id from the request url?

frigid bone
#

It will work, members are saved as a local variable

#
const id = req.params.id;
sick cloud
#

ty

#

<3

frigid bone
fleet iris
#

so I'm very new to webhooks and I'm using dblapi.js. I'm having some trouble with this webhook I created from discord. I have the link, but I'm not quite sure what else to do with it, even on the discordbots website

gilded blaze
#

DBL does not support Discord webhooks.

fleet iris
#

I guess that makes sense then lol

sick cloud
#

You need a web server that accepts POST requests

fleet iris
#

github works right?

sick cloud
#

ie. express

fleet iris
#

oh

gilded blaze
#

Dblapi takes care of that

#

Just make sure it is exposed to the World Wide Web

sick cloud
#

no it doesn't take care of that

gilded blaze
#

It does

sick cloud
#

you still need a web server set up

fleet iris
#

why don't discord webhooks work? I can search it fine

sick cloud
#

DBL sends a POST request to the url you provide

gilded blaze
#

It handles POST requests

sick cloud
#

Discord doesn't accept POST

fleet iris
#

oh

gilded blaze
#

You could use Apache Webserver or Nginx for example

#

If you donโ€™t have one set up already

sick cloud
#

eww

#

just spin up an Express server

gilded blaze
#

No

sick cloud
#

if your on js

primal ferry
#

Hi how can i check my bot permissions ?

fleet iris
#

meh I'm tempted to do the express server because I am running node

sick cloud
#
const app = require('express')();

app.post('/dbl', (req, res) => {
    // yay data
});

app.listen(3000);
fleet iris
#

but apache has been around forever right?

sick cloud
#

yeah and its old af

#

you can add express into your bot

#

so it'd all be integrated

fleet iris
#

but if bot goes down then it goes down?

sick cloud
#

yeah

gilded blaze
#

Well if you are doing this just for the web hook donโ€™t use Apache

fleet iris
#

do I want that ๐Ÿค”

sick cloud
#

but if the bot goes down then why would people vote

fleet iris
#

true

sick cloud
#

also if its separate it'd just error

#

since your bot would be off

fleet iris
#

ah true

primal ferry
#

Hi how can i check my bot permissions ?

fleet iris
#

i'll try express, thanks!

sick cloud
#

message

#

guild

#

me

#

permissions

#

you get the idea

#

what lib/lang @primal ferry

primal ferry
#

discord.js

sick cloud
#

ok

#

get the guildmember for your bot

#

and then use the permissions.serialize() property

#

so ```js
m.guild.me.permissions.serialize();

#

if your message is set as m

gilded blaze
#

That isnโ€™t a property

sick cloud
#

yes it is

gilded blaze
#

No

#

Itโ€™s a method

sick cloud
fleet iris
#

lol

sick cloud
#

it works tho

#

and its a function

#

so ok

primal ferry
#

thanks

sick cloud
#

np

fleet iris
#

so where do I get the url from when using express ๐Ÿค”

earnest phoenix
#

Does the discord api have a feature to get server info from an invite

sick cloud
#

no

inner jewel
knotty steeple
#

how do i get mention from a message

lone wraith
#

as an arg ?

#

or the mentions in a message ?

knotty steeple
#

as an arg

#

ok thank

knotty steeple
#

o

#

ok

night imp
#

Do you get an error? @earnest phoenix

#

ok is there an error that it's giving you?

#

Please post it

#

We need the error to know what's wrong

#

Could you copy paste it?

#

?

#

Can you send the full error?

#

Not just paraphrased

earnest phoenix
#

oh

frigid bone
#

@earnest phoenix are you perhaps running on the default npm start?

#

If yes, it won't do, you need to define a Procfile yourself and push it along with other files

#

Then go to Resources and enable it

#

Should look something like this

#

You need to create a file called Procfile with the content worker: node yourfile.js

#

Don't forget to check the logs as well remsniff

knotty steeple
#

", ".join([x.name for x in bot.commands]) so this is what im using to get all the commands

#

how do i make it not show hidden commands

inner jewel
#

x.name for x in bot.commands if not x.hidden iirc

#

or whatever the hidden property is

knotty steeple
#

yea that works

keen anvil
#

sharing this here, discord added a thing

knotty steeple
#

wait what

loud salmon
#

What does that do

inner jewel
#

they added session_start_limit

#

reset_after is the time until it resets to 1k (aka total)

#

remaining is how many sessions can be started before token is reset

heady zinc
#

das actually useful for automating shit

inner jewel
#

not really

#

it's useful to know how close to the limit you are

#

but you can't do anything if you hit the limit

#

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

#

changing token can't be automated

knotty steeple
#

what happens if u hit the limit

inner jewel
#

token is reset

heady zinc
#

ye but now you can know how close you are so you can dodge the limit

knotty steeple
#

oh my GWfroggyFeelsUpMan

inner jewel
#

just let dozens of shards dead until it resets

sick cloud
#

i'd add it so if i get 5 away from the limit

heady zinc
#

and blame discord

#

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

sick cloud
#

prevent bot from starting

inner jewel
#

usually only badly written bots hit the limit

sick cloud
#

ie. mine

inner jewel
#

and/or libs that don't handle certain situations properly

heady zinc
#

or dank memer as it still isn't on the new sharding

prime cliff
#

Yea but a meme bot gets used a lot more that regular bots especially with nsfw commands

#

Optimizing all of that is a real hassle i bet

heady zinc
#

optimization, what is that?

#

this is javascript boii

prime cliff
#

Dank Memer has a lot of image commands aswell

sick cloud
#

tbh i thought dank memer was JDA

#

oof

prime cliff
#

Gotta make sure nothing breaks :/

heady zinc
#

ya tbh we use third-party services for critical things

#

iirc image server is third-party too

prime cliff
#

Dank Memer has its own image server written in pythonk i think by Krom

inner jewel
#

yes

#

because the image manipulation libs for node all suck

heady zinc
#

yeah

sick cloud
#

wow

inner jewel
#

canvas leaks memory, jimp is slow and blocking

prime cliff
#

Krom knows how to do magic ๐Ÿ‘Œ

inner jewel
#

aka use the python stdlib

heady zinc
#

we use redis to make most of our things faster

#

because redis is hot af

#

and because reddit is slow af angeryBOYE

quartz kindle
#

reddist

inner jewel
#

i just use redis for everything

#

except ipc

#

that's nats

heady zinc
#

ya image server is still python ๐Ÿ‘Œ

sick cloud
#

i use canvas

#

since idk what else to use

inner jewel
#

i use java.awt

quartz kindle
#

canvas here as well

heady zinc
#

well you can't really use anything else

#

canvas is about the best for nodejs

#

you'd need another language to perform better

glossy talon
#

Can i have my bot send a widget?

#

Cause i want to use as a image for a embed the bots widget

#

But idk how

sick cloud
#

ofc

glossy talon
sick cloud
#

just use .png

#

instead of .svg

glossy talon
#

So i convert the widget to png?

sick cloud
#

no

glossy talon
#

Or png on the link

sick cloud
#

you just replace .svg

#

with .png

glossy talon
#

O

#

Ok it works

sick cloud
#

ok

glossy talon
#

What are the Assets to the widget btw

#

Like images it uses when generating the image

sick cloud
#

wdym

#

its all custom generated i guess

glossy talon
#

@sick cloud DBL is using images to generate the final image

#

What are those images

sick cloud
#

what

#

i dont get what you mean

#

there are no images in it

#

the api generates an svg

glossy talon
#

The Text is a Image, the Circley looking transparent thing is a image, ect.

quartz kindle
#

its an svg

#

svg = programmable vector image

glossy talon
#

What i am saying is are you able to generate individual parts of it

quartz kindle
#

yes

glossy talon
#

Thats what i want

#

The Individual parts of what it is generating

quartz kindle
#

download the svg file and read its code

glossy talon
#

k

earnest phoenix
#

i need help

#

homies

#

i'm scared nvm

#

wassup homie, tell us your problem pepodetective

earnest phoenix
#

@earnest phoenix you know python?

#

no but someone else here does

#

yeah i asked the same question 10 times before over 5 weeks

#

and no one

#

helped

sick cloud
#

anyone here good with electron? having some issues with BrowserWindow, its saying it isn't a constructor

#

TypeError: BrowserWindow is not a constructor

glossy talon
#

Why does my widget link never update?

#

Is it cause the file is a png?

smoky spire
#

Cache stuff

bright spear
#

@glossy talon whats the issue? server count is correct if i open it in the browser

#

but when u send the link in discord, it loads it through the media proxy which heavily caches

glossy talon
#

The issue is it won't update on my mac, or my discord bot i am hosting on a linux vps

smoky spire
#

Itโ€™s caching the image

glossy talon
#

Well how to make it update then

smoky spire
#

Add a trash parameter at the end with a random number

bitter sundial
#

it'll update later when the cache expires

bright spear
#

discord caches images for practically forever

bitter sundial
#

are you posting it to discord Thonk

bright spear
#

no

#

when you send an image link the media proxy caches it

#

if u open those in the browser they're different

sick cloud
#

yeah, discord does it to save bandwidth and crap

earnest phoenix
#

d!sunucu

#

d!sunucubilgi

#

d!espriyap

#

how do i make this join the voice channel then

#

play that song

earnest phoenix
#

Where would you think the best place to learn HTML is

floral zinc
#

w3

radiant night
#

=help

#

woooh

earnest phoenix
#

connection.play is not a function

#

Whats wrong with connection.play

#

Should i change it to playStream or something

#

js?

#
    let embed = new Discord.RichEmbed()
    .setColor("AQUA")
    .setImage()```
How do I do the image
#

I have the link

#

well if u have the link just setImage it?

#

like put the url in there

#

lol

#
    let embed = new Discord.RichEmbed()
    .setColor("AQUA")
    .setImage("https://api.thedogapi.com/v1/images/search?format=src&mime_types=image/gif")```
this dont work
#

yeah because thats not the link

#

look at my eval

#

bot don't follow redirects

wide shale
#

...

autumn rain
#

So a general question for voting:
Is there a full documentation of the api?
When does the "hasVoted" reset?
What exactly does "getVoters" return?

earnest phoenix
#

How do I have like wait(3) in js

#

you dont

autumn rain
#

AFAIK setInterval

earnest phoenix
#

you could like...

#
await new Promise(resolve => { setTimeout(resolve, 3000) })

iirc

ocean token
#

I am starting getting a lot of errors

#

anyone know about discord.js?

#

ReferenceError: cmd is not defined The code was working fine yesterday

earnest phoenix
#

ok, well cmd is not defined

ocean token
#

with 0 errors

earnest phoenix
#

as it says

#

so no matter what day it is, that would be the same

#

so if you dont know what <x> is not defiuned means, learn js basic programming

ocean token
#

it was working yesterday though

#

that's why I am asking and I've defined a cmd

#
      if (!msg.member.hasPermission("MANAGE_ROLES")) return msg.reply("Unsufficient permissions.");
     let member = msg.mentions.members.first()``` @earnest phoenix
earnest phoenix
#

you did no define cmd in that code snippet

#

you dont know what undefined means, so you should probs read about that first

ocean token
#

ok

#

I fixed it

sour perch
#

hey, how do i make mu bot add roles in js master?

earnest phoenix
#

what have you tried? @sour perch

sour perch
#

memberID.addRole(roleID), and memberID.roles.add(roleID)

#

both returned errors

ocean token
#

Do you want a "add role"

#

thing?

earnest phoenix
#

what error?

sour perch
#

wait, ill just recreate it

earnest phoenix
#

the error would be something like memberID.addrole is not a function

ocean token
#

``` msg.guild.channels.find(name, logs).send({embed})
^

TypeError: Cannot read property 'send' of null``` any ideas WHATS WRONG?

sour perch
#

(node:6228) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'add' of undefined

earnest phoenix
#

the channel doesnt exist sir lock

ocean token
#

it exists

earnest phoenix
#

ok well its null mmLol

ocean token
#

IT was working yesterday

#

That's the thing

earnest phoenix
#

coming from somebody who didnt know what not defined means

#

the channel doesnt exist

ocean token
#

I know what not defined is

sour perch
#

that error is for memberID.roles.add(roleID)

ocean token
#

I just can't understand why it gives errors today

#

The code was the same for 10 days

earnest phoenix
#

because the channel doesnt exist

#

Hab, is memberID a guildmember object?

#

or an id

ocean token
#

it exists

#

and the bot can see it

earnest phoenix
#

log it, the bot cant see it

#

its null

#

lmao

sour perch
#
    let memberID = str.slice(3, 21);```
#

thats how i define it

earnest phoenix
#

yeah @sour perch memberID is an ID, not a GuildMemberStore

sour perch
#

and i tested it it returns the full if

earnest phoenix
#

and guildmemberstore has the .add method

ocean token
sour perch
#

ok, so how do i get guildmemberstore?

earnest phoenix
#

so you need to get a guild member using that Id, then do .roles.add(roleID)

ocean token
#

@sour perch what are you trying to make?

sour perch
#

mute @ocean token

ocean token
#

I got you pal

#

one sec

sour perch
#

i dont wanna copypaste tho

#

just need this addrole to work

ocean token
#
      if (!muteRole) return msg.reply("There's no Mute role, please create one named `Muted`");```
earnest phoenix
#

Hab did you understand what I meant

sour perch
#

not really, :/

earnest phoenix
#

OK, so your ID is a string

ocean token
#

Hab

sour perch
#

yes

ocean token
#

use the above code

earnest phoenix
#

it does not have a roles property

#

and therefore .add is a property of undefined

sour perch
#

it does nothing @ocean token

ocean token
#

You said you didn't want to copy paste ๐Ÿ˜‚

sour perch
#

yeah got you

earnest phoenix
#

his code doesnt do what you want @sour perch ๐Ÿ˜‚

sour perch
#

ik

#

i didnt try it i know what it does

earnest phoenix
#

ok, so if you look at the docs forGuildMember

#

it has a roles property

sour perch
#

where are the docs?

earnest phoenix
#

and that is a GuildMemberRoleStore

#

wait WHAT? OMEGALUL

ocean token
#
      if (!msg.member.hasPermission("MANAGE_ROLES")) return msg.reply("Unsufficient permissions.");
       let member = msg.mentions.members.first()
      if(!member) return msg.reply("You need to mention a member!");
       let muteRole = msg.guild.roles.find("name", "Muted");
      if (!muteRole) return msg.reply("There's no Mute role, please create one named `Muted`");
       let params = msg.content.split(" ").slice(1);
       let time = params[1];
      if (!time) return msg.reply("Please specify the time of the mute!");

      member.addRole(muteRole);
      msg.channel.send(`${member.user} has been muted for **${ms(ms(time), {long: true})}**`);

      setTimeout(function() {
      member.removeRole(muteRole);
      msg.channel.send(`**${member.user}**'s ${ms(ms(time), {long: true})} mute has expired!`);

    }, ms(time));


    }```
earnest phoenix
#
ocean token
#

Check it

sour perch
#

thans

#

thanks*

ocean token
#

No prob, don't forget that it requires MS

earnest phoenix
#

im dying, you never seen the docs? ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚

ocean token
sour perch
#

i have, just havent used them much XD

ocean token
#

Hab did it work?

sour perch
#

and im not going to use it @ocean token was sayijn thansks cuz he sent the docs ๐Ÿ˜‚

ocean token
#

ah

sour perch
#

sorry man, wanna do as much as possible myself

ocean token
#

anyway, just check how I did it, I am not good with explanations

wide shale
#

._.

sour perch
#

well i see what you did, and i tried it, but it doesent appear to work for me @ocean token a guy over at the apis discordserveer said that was because i used master

ocean token
#

discord js right?

sour perch
#

yes

ocean token
#

ah ok

sour perch
#

well, anyways, thanks for explaining, ill go test some stuff then,

ocean token
#

ok

steel drum
#

hi so i have a question

earnest phoenix
#

wow nice

steel drum
#

i was looking to load json data for a discord.js bot

#

would it be best to load all that data synchronously or asynchronously

#

each guild will have its own json

knotty steeple
#

thats

earnest phoenix
#

well if your use case is to store data for each guild e.g. settings, you are best of not using json at all

knotty steeple
#

really bad

earnest phoenix
#

that would be horrendous

knotty steeple
#

use a database

steel drum
#

im also using mariadb

#

the jsons are for

earnest phoenix
steel drum
#

custom commands

earnest phoenix
#

store in in the db

steel drum
#

bc you can serialize them

knotty steeple
ocean token
#
  let embed = new Discord.RichEmbed()
  .setAuthor(msg.author.username, msg.author.displayAvatarURL)
  .setDescription (`#${msg.channel.name}`)
  .setTitle( `${msg.content}`)
  .setFooter(`${msg.createdAt}`)

  .setColor(0xc1d4ee)
  msg.guild.channels.find("name", "logs").send({embed})
``` If you guys can see what's wrong with the code

ERROR MESSAGE```
  msg.guild.channels.find("name", "logs").send({embed})
                                         ^

TypeError: Cannot read property 'send' of null```
sour perch
#

the role you wanna add, can i add that by id or doesent it work?

knotty steeple
#

it cant find the logs channel @ocean token

earnest phoenix
#

I can @ocean token the logs channel doesnt exist

knotty steeple
#

also thats not how you get channel by name mmLol

ocean token
#

I will delete it and create it again

earnest phoenix
#

hes probs updated and been like "i changed nothing"

steel drum
#

how do you guys advise saving custom command data then

earnest phoenix
#

11.4 doesnt use that syntax anymore

knotty steeple
#

c => c.name === "logs" this is how

#

well @steel drum

#

store it in a db

steel drum
#

hmm

earnest phoenix
#

no dont store the while functon

#

i mean if its custom

#

surely its just

#

custom name and custom output

steel drum
#

true

earnest phoenix
#

so just store those in a db

#

and associate with guild id

#

and on load apply them all

steel drum
#

so like a sql table like

ocean token
#

Ok so, a deletion of the channel and re-creation fixed it

steel drum
#

id VARCHAR(255), name VARACHAR(255), msg VARCHAR(255)

#

smth like that ?

knotty steeple
#

yea

steel drum
#

should i pull that data from the database whenever i start up the bot

#

or should i just load up data when a user calls for it

knotty steeple
#

when a user calls for it

steel drum
#

kk ty

ocean token
#

wait nvm, it keeps giving an error

earnest phoenix
#

@steel drum It depends. You should do it when the user calls it, but once they have called it keep it cached for some time so you dont call it multiple times in short period

#

or if memory is not a concern, just load them all on startup :p

steel drum
#

ill probably cache it for an hour

#

thanks @earnest phoenix

#

hey

#

if anyone is free can you help me with something (pm me)

ocean token
#

Okay fixed

earnest phoenix
#

@earnest phoenix do you know how to do music in js?

#

best of checking the docs and asking somewhere like AIG server

#

i use lavalink so its different to how you might do it asa beginner for a small bot

#

my music isnt broken it just says it cant connect to vcs even when its admin

knotty steeple
#

rewrite

quasi marsh
#
embed = discord.Embed(title='name', description='meme')
await message.channel.send(embed=embed)
knotty steeple
#

Thonk thats how u send it

#

i knew how to make one but not how to send it thanks

quasi marsh
#

You can do send on any "channel" like object

#

Including members and users

#

wait easier than client.send_message(channel object, message)

earnest phoenix
heady zinc
#

all of them?

#

what do you mean by remote connection

earnest phoenix
#

ubuntu didnt work

heady zinc
#

wdym ubuntu didn't work thonk

#

what are you trying to do

earnest phoenix
#

i think ive been on a site like that once

#

windows didnt last very long

#

connect to my vps

heady zinc
#

yeah all of them support connections lul

#

you just need to ssh into them

earnest phoenix
#

why didnt ubuntu work tho sadcatte

#

ssh?

#

@earnest phoenix which one is better

#

os

#

? idk im not some linux expert

#

i've never used linux

quartz kindle
#

none of them support windows remote connection

#

but they all support ssh

#

ssh is a command line connection

earnest phoenix
#

oh thats when he meant

knotty steeple
#

you cant use rdp on linux

earnest phoenix
#

๐Ÿ˜‚

heady zinc
#

oh that's what they meant by remote connection

#

๐Ÿ˜ฉ

knotty steeple
#

ye

earnest phoenix
#

lmaooooo

knotty steeple
#

remote desktop connection

oblique sequoia
#

VPS's don't even have a desktop environment DansGame

heady zinc
#

facken everyone use ssh nowadays

earnest phoenix
#

well i mean you could install a desktop environment mmLol

#

but thats like.... illegal man

#

dont do that

oblique sequoia
#

or you could not do that

knotty steeple
#

i did a thing

earnest phoenix
#

?

#

how do i setup an SSH @heady zinc

knotty steeple
#

takes a while to connect

#

also i already told you what to do

earnest phoenix
knotty steeple
#

install putty

quartz kindle
#

the vps you're setting up has its own ssh instructions

heady zinc
#

windows 10 has built-in ssh

quartz kindle
#

follow them

earnest phoenix
#

"OK google, how do I use ssh"

heady zinc
#

google that

earnest phoenix
quartz kindle
#

follow the instructions of your specific vps company

#

some use keys, others use passwords

knotty steeple
#

looks like skysilk lul

quartz kindle
#

then google for skysilk ssh

earnest phoenix
quartz kindle
earnest phoenix
#

Yeah i just read it

#

im downloading putty

#

letting a website generate private key for you amonkaS

#

that sound like a disaster waiting to happen

quartz kindle
#

it shouldnt be any different from generating it yourself

earnest phoenix
#

wellif the site generates it and sends it to you

#

its bad OMEGALUL

#

I remember everytime I try install putty it takes 15 years for it to request for admin access then it installs

#

its not jsut entering your pub key

#

its actually generating it FeelsWeirdMan

#

i dont understand why it takes so long to request for access

quartz kindle
#

run it as admin from the beginning?

earnest phoenix
#

I cant

#

its not an option

quartz kindle
#

??

earnest phoenix
#

weird

quartz kindle
#

oh its an msi file

#

run cmd as admin, then run the msi from cmd

earnest phoenix
#

its installed

earnest phoenix
#

ive been stuck trying to connect to this for an hour and It wont work

steel drum
#

so im starting to write a exp plugjn

#

im using a generic exp function where its like levels 1-10 are just level * 100, then after that it's 10% more exp everty level you get

#

how much exp do you guys think a user should roughly get

knotty steeple
#

i randomize between 8 and 36

steel drum
#

are you using a similar algorithm as me ?

knotty steeple
#

no

#

level * 400

steel drum
#

by that scaling i should be randomly giving around 2-9 then

#

is your flevel system not exponential?

knotty steeple
#

wym

steel drum
#

the way mine works

#

after level 10, there isnt a consistent difference between levels

#

ill get some numbers one sec

#

at level 11, you need 1100 exp, at level 12, you need 1210, exp

#

at level 10 you need 1000

#

do you see how it starts to get progressively larger

knotty steeple
#

no

steel drum
#

...

earnest phoenix
#

lemme explain @knotty steeple

#

10 -> 11 = 1000 -> 1100 = 100 difference

knotty steeple
#

i mean no mine isnt like that

earnest phoenix
#

oh k

#

not having levels awesmart

steel drum
#

he has levels

#

he just has a linear leveling system

sick cloud
#

so how do you guys check for "hoisters"?

#

like is there a specific way for filtering them

#

or is it just checking for ! and such

gleaming glen
#

i think it would be if it doesn't includes normal letters

#

or maybe not

#

idk

steel drum
#

so say i want to give users exp for speak

#

what would be a good buffer

#

like

#

you can only gain xp from messages every x seconds

gleaming glen
#

i do it with some kinda provider, with message send user gets +1

topaz fjord
#

@sick cloud check for all the hoisting characters

gleaming glen
#

u can simply find a cooldown code for that

steel drum
#

no ik how to do it

#

im just looking for a good

#

cooldown time

topaz fjord
#

I don't cool down at all

gleaming glen
#

same

steel drum
#

i would

topaz fjord
#

Hence why I have someone who is lvl 178

steel drum
#

its really easy to spam

#

and get xp

topaz fjord
#

most people don't know it exists for me

#

Since I don't send lvl up messages

steel drum
#

i send pms

#

but im gonna make that toggleable

sick cloud
#

oh

steel drum
#

but what you guys say is a good buffer

sick cloud
#

i thought there was some way of checking the index or something @topaz fjord

#

but ok

topaz fjord
#

You can try asking aethery bakery

#

on how he checked

sick cloud
topaz fjord
#

Yes

steel drum
#

i was sthinking about doing this

sick cloud
#

ok

#

@uncut slate hi friend, how did you check for hoisters on Bo and such?

uncut slate
sick cloud
#

i'm pretty sure i did see some index checking code

steel drum
#

i just strip all non numbers and letter, square root the length and give the user that much xp per message

sick cloud
#

but idk

steel drum
#

is that a good system ?

sick cloud
#

ooh

#

thanks

earnest phoenix
#

does anybody know free hosting? that isnt aws or skysilk

steel drum
#

from my experience

sick cloud
#

there isn't any "free hoisting" thats good

steel drum
#

free hosting is bad hosting

topaz fjord
#

Do you want good hosting

earnest phoenix
#

no

topaz fjord
#

Or do you want free hosting

steel drum
#

you could always run it locally

earnest phoenix
#

idc what it is i just cant run it on my laptop

topaz fjord
#

Then heroku or glitch

steel drum
#

yea

#

that

sick cloud
#

hm.. also localCompare kinda is confusing

earnest phoenix
#

i mean just..

#

'username'.localCompare('a', 'en') i guess

#

so instead of "b" in my example, you would put whatever the highest acceptable character for names is

#

probably A

#

or a number

#

@sick cloud

sick cloud
#

okay

#

should i check for 0 though @earnest phoenix?

#

since some people have numbers in their names

#

and it isn't hoisting

earnest phoenix
#

well just compare to "0"

slender thistle
#

Try checking for alphanumeric character?

earnest phoenix
#

and if it returns 0, their name would be on par with 0

#

so in that case, dont de-hoist them

#

@topaz fjord I need a vps but I have no money idc what specs it has

#

it cant be worse then what I have now I run my bot on a 1mb/s connection

gleaming glen
#

u can just use glitch if u gonna do a private bot for ur server

earnest phoenix
#

its public

#

use process.env for token

gleaming glen
#

then buy a cheap server

earnest phoenix
#

or get cheap vps

gleaming glen
#

yea

earnest phoenix
#

like litera

#

I litterally just said I have no money

#

buy 1 less coffee each month

#

and bam

#

u can afford vps

gleaming glen
#

xd

earnest phoenix
#

I have a 45p budget

#

go panhandling

#

u will make enough fr a vps mmLol