#development

1 messages · Page 556 of 1

atomic quarry
#

Hey y'all, is there anyone here with a decent understanding of ytdl that could help me out for a quick sec?

keen drift
#

just post the question and someone will prob answer it

atomic quarry
#

So on my bot right now, if I do ";play <songname>" It pops up with a list where I have to choose between 1-10. Is there a way for me to make it so if I do ";play <songname>" It will pop into the channel and just play the first result it found on YT

earnest phoenix
#

...just remove the part where you can choose?

#

thats the most communistic thing i have ever said

warm oak
#

my dm bots the frst bot i have made i hope it works allright

#

im kinda still testing it out a bit is that ok?

#

and dose it have to be on to work hear

quartz kindle
#

it has to be working to be on the list, if its not working, it will get declined

earnest phoenix
#
        if(command === `${prefix}ban` || command === mentionprefix + "ban") {
            const banner1 = new Discord.RichEmbed()
            .setColor("FF3131")
            .setDescription("![no](https://cdn.discordapp.com/emojis/534824114767265823.webp?size=128 "no") You must have 'BAN_MEMBERS' permission to use this command.")
            if(!message.member.hasPermission("BAN_MEMBERS") && message.author.id !== ownerID) return message.channel.send(banner1)
            const who = message.mentions.users.first() || bot.users.get(args[0])
            const banner2 = new Discord.RichEmbed()
            .setColor("FF3131")
            .setDescription("![no](https://cdn.discordapp.com/emojis/534824114767265823.webp?size=128 "no") Please enter a valid ID or mention a user to ban them.")
            if(!who) return message.channel.send(banner2)
            const reason = args.slice(1).join(' ')
        ```
#
            const reason2 = reason !== args.slice(1).join(' ').length > 1 ?  reason : "Admin has not given a reason."
            const banner3 = new Discord.RichEmbed()
            .setColor("FF3131")
            .setDescription("![no](https://cdn.discordapp.com/emojis/534824114767265823.webp?size=128 "no") Please add 'BAN_MEMBERS' permission to me.") 
            if(!message.guild.member(botID).hasPermission("BAN_MEMBERS")) return message.channel.send(banner3)
            const banner4 = new Discord.RichEmbed()
            .setColor("FF3131")
            .setDescription("![no](https://cdn.discordapp.com/emojis/534824114767265823.webp?size=128 "no") You cannot ban yourself.") 
            if(who.id === message.author.id) return message.channel.send(banner4)
            const banner5 = new Discord.RichEmbed()
            .setColor("FF3131")
            .setDescription("![no](https://cdn.discordapp.com/emojis/534824114767265823.webp?size=128 "no") " + who.username +  " cannot be banned.")
        if(!message.guild.member(who.id).bannable) return message.channel.send(banner5)
        const banner6 = new Discord.RichEmbed()
        .setColor("FF3131")
        .setDescription("![no](https://cdn.discordapp.com/emojis/534824114767265823.webp?size=128 "no") You have been banned from " + message.guild.name + " \n Reason: `" + reason2 + "`")
        let lmao = who.send(banner6)
        setTimeout(function() {
        message.guild.member(who).ban({reason: reason2 + " || Banned by: " + message.author.tag})
        }, 1000)
        const banner7 = new Discord.RichEmbed()
        .setColor("00ae86")
        .setDescription("![yes](https://cdn.discordapp.com/emojis/534711053511163914.webp?size=128 "yes") " + who.username + " (" + who.id + ") has been banned. \n Reason: `" + reason2 + "`")
        message.channel.send(banner7)
            }```
#

Please help anyone.

quartz kindle
#

which one is line 1813

earnest phoenix
#

@quartz kindle

mossy vine
#

why is bot.on indented

earnest phoenix
#

idk

#

Should it not be?

mental solstice
#

it doesnt affect anything.. but makes readability worse. for you and others

earnest phoenix
#

I'm thi nking to create a music bot But I'm confused in which library I create Discord.js or Eris

#

Which one will be better

desert bough
#
            console.log(reactions);``` this is my code for a reaction filter but it doesnt log anything
earnest phoenix
#

Hey anyone can give me eris docs website and server link pls

mossy vine
#

google smfh

earnest phoenix
#

ok

meager sierra
#

@desert bough wound that be a command or an event

desert bough
#

its on a command

meager sierra
#

So like does it react to others with emoji or?

desert bough
#

the bot reacts with an emoji then the user reacts and it should log it

meager sierra
#

Cool

#

What's ur bots name?

desert bough
#

@quick rune

meager sierra
#

Nice I like that

#

Mine is ProRP

desert bough
#

ok

meager sierra
#

Its in beta tho so 🤷

desert bough
#

ok

meager sierra
#

You know anything about cars?

desert bough
#

no

meager sierra
#

Rip

desert bough
meager sierra
#

It was shorta that way

desert bough
#

?

meager sierra
#

Its the system in the car

amber fractal
#

Well awaitreactions returns a promise

#

Use a .then

meager sierra
#

Anyone have sick a*# RAW data I could use for my bot (I prefer category moderation)

desert bough
#

what

slim heart
#

ProRP what are you even talking about

meager sierra
#

RAW data I could use for my bot for moderation

mossy vine
#

what do you mean by raw data

meager sierra
#

And y'all are bit makers!

#

Bot*

slim heart
#

Yes we are and there’s no need for “RAW” data

mossy vine
#

and youre a "bot owner"

slim heart
#

Unless you’re talking about the furry bots in which RAWr data but other then that yea no

mossy vine
#

if you mean actual code, noones gonna give you shit or spoonfeed you

quartz kindle
#

here's some:

#
var magic = bot pls do magic;
send(magic)```
slim heart
#
if(uwant.spoonfeed) {
   go.somewhere(else)
} or {
   learn.howto(code)
}
return;```
meager sierra
#

Lol

#

Atleast I know what RAW data is

earnest phoenix
#

what the fuck are you even on about

quartz kindle
#

raw data can literally mean a ton of things

earnest phoenix
#

RAW is for pictures

quartz kindle
#

for example, raw image data from a dslr camera

meager sierra
#

Not that type lol

quartz kindle
#

or the raw event in discord.js where it logs all events

#

or raw binary data from a file

earnest phoenix
#

stop using terms you dont know to yourself look smart 🤷

#

to make yourself look smart**

slim heart
#

Cuz then people who know what it actually is know you’re dumb and then people who don’t get confused and you end up getting nothing out of it at all lol

quartz kindle
#

apparently there is a game called "raw data" on steam

desert bough
#

send it 🤣

slim heart
#

That must be what he’s talking about right!!

#

Turns out he’s the developer to the game and he just wants to make discord integrations with it and he’s like 50x smarter then we actually are and we just didn’t get what he was saying PepeYikes

quartz kindle
#

quite possible, although his username suggests otherwise, psychologically speaking

slim heart
#

Say prorp as one word I just thought it to myself in the middle of class and I laughed out loud and we’re in the middle of the quiz and everyone looked at me zoomeyes

desert bough
#

he was speaking on a higher plain of existance

quartz kindle
#

Lol

meager sierra
#

Lol nice @slim heart

quartz kindle
#

anyways we probably should move to #general

desert bough
#

yes

meager sierra
#

Yeah

slim heart
#

That moment when you’re warned and to move to general what

meager sierra
#

Lol

scarlet solar
#

Hello this is only for peple with Windows! Sorry Linux, Mac...
Ok so i wanted to do an auto updater in batch and when i open the main file i want to start the updater too and the problem is that i want to check witch the updater (that is a batch file) if it is the update day or past than the update day.
How could i do that, i tried


:run_it
CLS
REM run whatever command
ECHO Running the command...
DIR C:\
GOTO END

:no_run
REM Notify user that it is the wrong day
ECHO Wrong day!

:END```
smoky mica
#

troll 👏

frank dust
#

why are you saying sorry to linux and mac users lol

quartz kindle
#

this guy is trolling

#

he posted that same question like 5 times already

#

and doesnt reply when we try to help

earnest phoenix
#

Idk if this counts as dev help but i have an issue

discord is only using 0.1mbs of internet which causes my microphone to sound roboto in vc
i booted up skype with a friend to test if the mic was the issue and i sounded fine
does anyone know how to allocate more bandwidth for discord?

#

its funny normally people complain about to much bandwidth XD

quartz kindle
#

try messing with discord's voice processing, under audio/video settings

earnest phoenix
#

tried still didnt work

quartz kindle
#

other than that, each voice channel has its own voice bandwidth settings

earnest phoenix
#

you probably lowered the bitrate in your vc

#

Nah 64

#

I even tried group dms

#

still sounds wrong

quartz kindle
#

if it still doesnt work, test in browser if youre on app

#

or test in app if youre on browser

earnest phoenix
#

kk

#

cpu bottlenecking/ram allocation issue then

#

nope

#

i have 32gb and a ryzen 1600

#

doubtfull

quartz kindle
#

he said it sounds fine on skype

vernal rivet
#

Tim, question, if I want to grab some Json data from a package, would I use .parse or. stringify?

quartz kindle
#

if all else fails, try uninstalling the audio drivers and using it with windows's generic drivers

earnest phoenix
#

this is why im confused

#

its only using 0.1mbs

amber fractal
#

JSON.stringify turns into json format @vernal rivet .parse parses it

quartz kindle
#

@vernal rivet .parse is to convert a string into an object. .stringify is to convert an object into a string

#

if the package is returning an object, you dont need to do anything to work on it

vernal rivet
#

Would I just call on the object?

quartz kindle
#

console.log the data

#

if it has " on it, its a string, and you need to parse it

vernal rivet
#

But I want it to send in a embed on discord, but I keep getting [object Object]

quartz kindle
#

you cant send the object itself

earnest phoenix
#

so i tried it on the website works fine

#

on the app same old issue

quartz kindle
#

you have to send a string

#

so you can stringify the object and send it

#

but it will send the entire object, not just the properties you want

#

@earnest phoenix try restarting, updating/reinstalling, uninstalling audio drivers

earnest phoenix
#

kk

#

Wait

#

why

#

They sound find

#

in audacity

vernal rivet
#

Is there a way to get just properties that I want

earnest phoenix
#

and the online app

#

and skype

#

Its obviously the discord app

quartz kindle
#

just to test, i've seen similar issues with skype, where it works everywhere except skype

earnest phoenix
#

Its not that simple tho

quartz kindle
#

it turned out to be caused by the audio driver's dolby digital whatever

earnest phoenix
#

i have a scarlet 212

#

and default drivers installed

#

because well otherwise i have a mono issue

quartz kindle
#

then idk, im not an audio expert, but ive seen similar problems being caused by audio drivers and their "advanced" features such as surround emulation, dolby, etc

earnest phoenix
#

I don't see what you mean its obvously the fact that discord app is only using 0.1mbs

quartz kindle
#

@vernal rivet ```js
object = {
key:value,
key2:value2
}

object.key2 // value2```

earnest phoenix
#

the browser works at 6mbs and its fine

quartz kindle
#

6mbps its ridiculous, it should work fine at 0.1mbps

earnest phoenix
#

well it doesnt

#

and it confuses me

vernal rivet
#

Oh ok, thanks, I will have to try it when I get home, I am at school right now

quartz kindle
#

6mbps is a full hd video on youtube

earnest phoenix
#

why using the app on google

#

it took 6mbs for google

#

chrome*

#

the destop app uses 0,1 mbs

#

and cuts my mic out

quartz kindle
#

yeah, it uses all it can to download the page

earnest phoenix
#

yar yar

quartz kindle
#

after the page is downloaded, it should stop using that much

earnest phoenix
#

im still wondering why the app cuts out

#

i tried re installing discord

quartz kindle
#

its a problem with either discord's app or your audio drivers

#

so either file a complaint to discord

#

or try messing with your drivers

#

not much else you can do

#

or simply switch to browser

#

tbh i like browser better

#

i never use the app

earnest phoenix
#

kk

#

Well time to go back to my search

#

i wonder why it doesnt allow you to edit the network usage

#

its anoyying

#

just stating

lyric talon
#

Uh, guys, could someone help me ?
I want to create a system that when a bot receive a specific number of a specific reaction, them it does something
https://hastebin.com/liloceqoji.py

earnest phoenix
#

you are supposed to track that in your clients events, should be named something about adding reactions

quartz kindle
#

i cant help with python sorry

lyric talon
#

cry

#

The users are defined inside de reaction (reaction.users() )

#

but i just need to change my check

#

To check a specific number

quartz kindle
#

a text number or a reaction number?

earnest phoenix
#

here tim

quartz kindle
#

you're using discord.js right?

earnest phoenix
#

yep

quartz kindle
#

so, if you're using normal code, you can add a catch block on every async function, for example: .send().catch(console.log)

quartz kindle
#

if you're using async/await code, you can use a normal try/catch block

earnest phoenix
#

It's throwing this error

quartz kindle
#

yes, that happens when you dont catch errors

earnest phoenix
#

okay sec

quartz kindle
#

when an error happens, it looks for a place to send the error to (the catch blocks), if they are not found, then it sends the error to the process, which causes it to get interrupted (crash)

#

every piece of code that you have, that "waits" for something, should have a catch block, because it can causes an error later

earnest phoenix
#

So if I add in your line, where? It should log missing perms instead of crashing it

quartz kindle
#

for example, the .send() function, its a promise that completes only after the message is successfully sent

#

so if .send() causes an error, and you dont catch it, it will crash the process

#

to catch promises is simple, just put a .catch on it

#

.send().catch(console.log)

#

if .send() causes an error here, it will send it to the console

#

instead of crashing

earnest phoenix
#

Okay, so do I need to add this in with the permission check or it's own line?

quartz kindle
#

if you add this on your .send() it will not crash anymore

earnest phoenix
#

swag

quartz kindle
#

it will just send the error to your console

earnest phoenix
#

okay gonna test

quartz kindle
#

this is called a "silent fail"

#

when the program fails, but doesnt let anyone know it failed

earnest phoenix
#

if(!bUser) return message.channel.send("Username must be wrong, can't find them.").catch(console.log)

quartz kindle
#

its the ideal solution for when you dont have permissions, and you dont absolutely require them

earnest phoenix
#

This work?

quartz kindle
#

should work yes

earnest phoenix
#

fingers crossed you helped

quartz kindle
#

you need to add a catch to all instances of .send()

#

it will only catch errors of that specific line

earnest phoenix
#

right

#

That's what I did

#

Assuming it only needs to be added to lines that has .hasPermission and not the
if(!kUser) return message.channel.send("Cant find user");

quartz kindle
#

not exactly

#

it needs to be added to the functions that return promises

#

ie: functions that do not execute immediately, functions that need to wait for something

earnest phoenix
#

so it would be safter to add it there anyways.

#

safer*

quartz kindle
#

the only functions that do not execute immediately are functions that interact with discord

#

for example, sending messages

#

or fetching users that are not cached

#

or sending reactions

earnest phoenix
#

I'm going to lunch. I'll check back after to see.

#

Thanks man for the belp

quartz kindle
#

also

earnest phoenix
#

oop spoke too soon

quartz kindle
#

banning people is also a promise

#

so you should also catch the .ban() function

earnest phoenix
#

add .ban where?

stable summit
#

Hi

earnest phoenix
#

oi m8

quartz kindle
#

in the code you posted

#

message.guild.member(bUser).ban(bReason);

#

the .ban() part sends the ban to discord and awaits for a reply

#

if the reply is an error, it will crash

#

so catch it

stable summit
#

How u Do that Black

#

.ban()

quartz kindle
#

`like this`

earnest phoenix
#
  let kickChannel = message.guild.channels.find(m => m.name === "logging");
  if(!incidentchannel) return message.channel.send("Can't find incidents channel.").catch(console.log);

  message.guild.member(bUser).ban(bReason);
  incidentchannel.send(banEmbed);
#

got it at the end there.

quartz kindle
#

add a catch to ban and to the last send

stable summit
#

Yew

#

Yea

#

How u do

#

'(('

earnest phoenix
#

done.

quartz kindle
#

@stable summit i told you

earnest phoenix
#
incidentchannel.send(banEmbed).catch(console.log);
quartz kindle
#

like this not 'like this'

#

`like this`

stable summit
#

\uu\

prime cliff
earnest phoenix
#

use tilde not apostrophe

quartz kindle
#

this ` not this '

earnest phoenix
#

top left corner of the keyboard. It's also the ~ key

#

going to lunch, thanks a ton @quartz kindle

amber fractal
#

Lmao wot a tilde is ~

earnest phoenix
#

oh mb

#

lmao

stable summit
#

'''ooo'''

amber fractal
#

It is on the same key atleast

stable summit
#

(')

earnest phoenix
#

nales!!!

#

jeez

#

top left m8

#

the key to the left of the 1

#

`

stable summit
#

WHAT

quartz kindle
#

@stable summit this ` is different from this '

stable summit
#

O

earnest phoenix
#

You're using the wrong key

#

you need to use `

stable summit
#

now

amber fractal
#

` is called a backtick

earnest phoenix
#

there ya go

quartz kindle
#

finally

earnest phoenix
#

^

stable summit
#

Thank

quartz kindle
#

` is called an "accent" in portuguese xd

stable summit
#

xd

#

My Bot permision not work, That why i Need wait

#

Noooo

queen sentinel
#

stop talking like that kthanks

slim heart
#

:o

ruby dust
#

@quartz kindle continuing from our yesterday's discussion about bcrypt, how would I store the hash to sqlite exactly?

stable summit
#

Plce

quartz kindle
#

@ruby dust once you generate the hash, you can just store it as text

#

and when a user logs in, you need to use bcrypt's password compare function with stored hash

ruby dust
#

should I be needing to encode the hash again before checking?

quartz kindle
#

nope

#

for example, bcrypt in npm/node.js:

#
bcrypt.hash(myPlaintextPassword, saltRounds, function(err, hash) {
  // Store hash in your password DB.
});
bcrypt.compare(myPlaintextPassword, hash, function(err, res) {
    // res == true/false
});```
#

saltRounds is basically the hashing strength, defaults to "10"

#

higher strength = takes more time/cpu power to hash

#

its basically a protection against brute force attacks

#

im assuming its similar in python

ruby dust
#

it errors for me if I don't encode the user input, and if I do that the check says that it doesn't match the hash anymore

quartz kindle
#

show your code

ruby dust
#

I'm just testing a lot right now, I don't have an exact code to show

#
import sqlite3
import bcrypt

conn = sqlite3.connect('test.db')
c = conn.cursor()
c.execute("CREATE TABLE IF NOT EXISTS TestTable (Something TEXT)")

password = b"super secret password"
hashed = bcrypt.hashpw(password, bcrypt.gensalt())

bcrypt.checkpw("super secret password", hashed)
#

basically it's something like this

quartz kindle
#

why is there a b

#

in front of the password string

ruby dust
#

it encodes the string

quartz kindle
#

hmm it should work

#

what is the error?

mental solstice
#

does JS really accept parameters like that?

quartz kindle
#

wait

#

if you need to encode the string

#

to hash it

#

you need to encode it as well for comparing

#

you're comparing an encoded version against an unencoded version

#

thats python Uncle

mental solstice
#

checkpw probably does that.. and oh python:)

smoky mica
#

so im improving userinfo command

#

and uh

#

i wanna mention the user

ruby dust
#

yeah and that was my first question, is it really a good idea to store a hash as text?

quartz kindle
#

yes

#

once hashed, its perfectly safe to move around

#

in case of a database breach, the only possible attack against it is a brute force attack

ruby dust
#

and to compare the 2 I have to encode both

quartz kindle
#

which is slowed down by the salt rounds

smoky mica
#

so it mentioned me

#

but when i do userinfo [user] i want their mention there

quartz kindle
#

message.mentions = list of mentions

smoky mica
#

uhm it says object object

quartz kindle
#

yes, its a list of mentions

#

you need to define which one you want

smoky mica
#

ok fine

quartz kindle
#

you probably want the first mention

#

so you can use .first()

ruby dust
#

oh I got it to work, thanks again tim

amber fractal
#

Does message.mention.users flip the order tho, cuz i did first and it grabbed the last and then i did last and it grabbed the first

#

I mean i know .reverse exists

#

Just wondering

smoky mica
#

ah im dumb xd

#

i defined user and i could have done ```js
.setDescription(user)

in the first place
#

its actually ```js
message.mentions.users.first()

#

Steven ^

amber fractal
#

I know

smoky mica
#

I'm pretty sure it doesn't

amber fractal
#

When you message.mention.users it returns an array

smoky mica
#

Hmm

#

Btw nice name xd

earnest phoenix
#

@quartz kindle throwing the same error.

smoky mica
quartz kindle
#

<@&ROLE_ID>

smoky mica
#

wait i wrote is

quartz kindle
#

@earnest phoenix are you sure the error is in that function? have you checked your other bot functions?

amber fractal
#

Wait im a moron

#

It returns a collection

#

I always think array

smoky mica
#

lmao

quartz kindle
#

well, technically they are all the same thing

#

if you do typeof array/object/collection it will always return "object"

stable summit
#

I want my bot accept

#

~oo~

quartz kindle
#

then wait

stable summit
#

Ok

earnest phoenix
#

@quartz kindle Still throwing the error. I put .catch(console.log) at the end of every single line that has .send in it and I'm still seeing it. I'm so confused.

stable summit
#

Me to

#

bit i roload my page

quartz kindle
#

@earnest phoenix did you put it on the .ban() to?

amber fractal
#

Its not even a reversed order

#

Its like random

earnest phoenix
#

uhh

#

lemme look

stable summit
#

That command

quartz kindle
#

@earnest phoenix do you know exactly which command causes the error?

stable summit
#

.ban

#

Is command

amber fractal
#

Oh wait thats a discord thing isn't it

earnest phoenix
#

.ban(sendEmbed).catch(console.log

amber fractal
#

You need parentheses after ban

#

D.js anyways

earnest phoenix
#

That is the terminate command for nodemon?

#

I know rs restarts the .js

amber fractal
#

?

earnest phoenix
#

I use nodemon to run my bot. So it will detect file changes and restart automatically or on command rs in the console.

#

@quartz kindle I forgot to add it to kick and report as well. Seems to have sorted it for now

quartz kindle
#

👍

stable summit
#

:)

earnest phoenix
#

How do I get rid of the white space between my html and the site

quartz kindle
#

what

#

explain better please

earnest phoenix
quartz kindle
#

you want to remove the "gamebot" part?

earnest phoenix
#

NOPE

#

nope*

#

sorry for caps

#

caps lock was on

#

the white bit

quartz kindle
#

the description background?

earnest phoenix
#

the content class

#

i cant seem to style it

quartz kindle
#

how are you trying to style it?

earnest phoenix
#

make it absolute and assign it 0,0 cords

#

uhm

#

using <style>

quartz kindle
#

yeah but show the css

earnest phoenix
#
<style>
  @import url('https://fonts.googleapis.com/css?family=Comfortaa');
      .div { 
        background-image: url('https://cdn.glitch.com/2b7e7bbd-231a-4e05-93ab-d9700aa0ec46%2FeS4IxK3.png');
        background-repeat: repeat;
        background-color: #23272A;     
        background-attachment: fixed;
        background-position: center;
        font-family: 'Comfortaa';
</style>
quartz kindle
#

.div ? is that a class?

earnest phoenix
#

that's not even valid css

#

i made it

#

you're missing a bracket

#

Oof, acciedentally deleted it

#

it was there

quartz kindle
#

you're not targeting the content class then

earnest phoenix
#

when i do content

#

it just does the div without any class

#

im trying to get the entire divider

quartz kindle
#

i dont get what you mean

earnest phoenix
#

q.q

quartz kindle
#

but to target the content class, you need to be more specific

#

if you check the dbl website

earnest phoenix
#

Im trying to theme the backround of the dbl divider

tulip ledge
#

Hey I have a question so I'm making my bot page look nice with some css but want to make some stuff bold but it isn't really working is font-weight: bold; not supported?

earnest phoenix
#

its classed as content

#

and it doesnt theme it

quartz kindle
#

most of the .content css has a specificity level of 2: .longdescription .content

#

your css needs to be at least the same specificity level

earnest phoenix
#

how would i do that?

quartz kindle
#

be more specific: .longdescription .content

#

instead of .content

earnest phoenix
#

Okay

smoky mica
#

how can i show acknowledgements of a user

earnest phoenix
#

Omg works now

#

ty

smoky mica
#

tim can ya help?

quartz kindle
#

wait a min

smoky mica
#

sure thing

earnest phoenix
#

how would i change the backround of the entire page

quartz kindle
#

are you on pc?

#

use the inspector and check where is the original background coming from

#

and use the same css targeting

stable summit
#

Why they not accept me

quartz kindle
#

it takes up to 1 week to verify...

stable summit
#

Oof

tulip ledge
languid dragon
#

its just the styling it doesn't actually comment it out

earnest phoenix
#

i cant find the barckround

quartz kindle
#

add it to body and see what happens

#

you can use the inspector to do live editing and preview

#

so you can get it to look exactly the way you want to, before you add it to the code, instead of coding blindly

earnest phoenix
#

i tried body, it didnt work tho

quartz kindle
#

what did you write?

earnest phoenix
#
<style>
  @import url('https://fonts.googleapis.com/css?family=Comfortaa');
      body { 
        background-image: url('https://cdn.glitch.com/2b7e7bbd-231a-4e05-93ab-d9700aa0ec46%2FeS4IxK3.png');
        background-repeat: repeat;
        background-color: #23272A;     
        background-attachment: fixed;
        background-position: center;
        font-family: 'Comfortaa';
        }
</style>
quartz kindle
#

works for me lol

earnest phoenix
#

hmm

#

not for dbl

quartz kindle
#

it works in the inspector

earnest phoenix
#

hmm

#

not in preview

stable summit
earnest phoenix
#

you should read what the page says

#

how do i define message

#

i mean, reaction event is not in message event

quartz kindle
#

you need to get it from the reaction

earnest phoenix
#

wdym

quartz kindle
#

reaction is an object with many proprieties, message being one of them

earnest phoenix
#

but i get error

#

message is not defined

quartz kindle
tulip ledge
quartz kindle
#

did you test the code?

tulip ledge
#

In html yes and it works fine

#

But when I paste it into DBL

#

It comments the styling

quartz kindle
#

is it actually commented tho? ie: not actually doing anything in dbl when you save it and run it

tulip ledge
quartz kindle
#

use the inspector and check how is the css being injected to the page

tulip ledge
#

🤔

#

Why is it like that?

quartz kindle
#

its being overwritten by a higher specificity css

tulip ledge
#

Oh

quartz kindle
#

check the css that is overwriting it

tulip ledge
#

So how do I fix it?

quartz kindle
#

your .header is an h1 element?

#

.content h1 has a higher specificity than .header

tulip ledge
#

yes

#

So I have to make .header higher?

quartz kindle
#

you need to make it more specific

#

ie: .content .header

tulip ledge
#

By making it an ID

#

Or that

quartz kindle
#

an id would also work yes, because IDs have a higher level than classes

tulip ledge
#

But Tim? How would I make the background darker because this doesn't work:

.content {
    background-color: #2A2D32;
}
quartz kindle
#

once again, check how specific the original css is

#

and make yours equally specific

tulip ledge
#

Yes I know

#

But how would you make it more specific if you can't redefined content?

quartz kindle
#

its specificity is .longdescription .content

#

which overrides .content

tulip ledge
#

Oh okay

#

Thank you

quartz kindle
#

👍

odd leaf
#
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f8ba31aff74, pid=19053, tid=0x00007f8b5518d700
#
# JRE version: OpenJDK Runtime Environment (8.0_181-b13) (build 1.8.0_181-8u181-b13-2~deb9u1-b13)
# Java VM: OpenJDK 64-Bit Server VM (25.181-b13 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libc.so.6+0x83f74]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /usr/nate/workspaces/eclipse/[DB] Pherrous/hs_err_pid19053.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
#

I fucked up

tulip ledge
#

So I'm not great withmarkdown but I thought this was how you would do it right?

(support server)[https://discord.gg/tetete]
#

Right?

quartz kindle
#

yeah, either that or the other way around

#

i always forget which

prime cliff
#

Its the other way around

tulip ledge
#

Yeah but I did both but none worked

odd leaf
#

if its like reddit's, then its text

tulip ledge
prime cliff
#

That only works in embeds fyi

#

Also you dont encase it in

This```
tulip ledge
#

Yeah but how would I make a markdown in the DBL page?

odd leaf
#

this usually breaks formatting

tulip ledge
#

It sais it supports it

prime cliff
#

It should work then

tulip ledge
#

But its not

odd leaf
#

hey do you guys multithread your bots

#

just curious

tulip ledge
#

Whats multithread?

earnest phoenix
#

ugh i cant find the goddamn way to change the backround

odd leaf
#

I have commands go onto a diff thread

#

well

prime cliff
tulip ledge
#

@earnest phoenix what background?

odd leaf
#

basically instead of your program being a list of things to do, it can run at the same time @tulip ledge

earnest phoenix
#

the backround of dbl

tulip ledge
odd leaf
#

its useful if your bot has to run several commands at once

#

and one command hangs or something

prime cliff
#

You must be doing something wrong then

tulip ledge
#

You mean like

odd leaf
#

I have it set up so each command is its own thread that's killed either after 30 seconds or after the command ends

tulip ledge
#
if() {}
if() {}
if() {}
odd leaf
#

no

earnest phoenix
#

can eval get functions from main file?

#

the grey into a backround photo

tulip ledge
#

Yes

odd leaf
tulip ledge
#

Dependings on how you set it up

#

Oh yeah I do that

prime cliff
#

@earnest phoenix You mean the background of the main page or long desc?

earnest phoenix
#

main page

#

of my bot

prime cliff
earnest phoenix
#

wait wait wait

#

the backround of my bots page

prime cliff
#

Custom background

body {
  background-repeat: no-repeat;   
  background-size: cover !important;
  background-attachment: fixed !important;
  background-image: url("https://linkhere.png") !important;
}```
Custom background with dark overlay
```css
body {
  background-repeat: no-repeat;   
  background-size: cover !important;
  background-attachment: fixed !important;
  background-image: url("https://linkhere.png"),linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.5)) !important;
 background-blend-mode: overlay !important;
}```
earnest phoenix
#

okay

prime cliff
#

Dark overlay is nice if you have a bright background image

earnest phoenix
#

okay

#

still not working :/

tulip ledge
#

You should use

prime cliff
#

@earnest phoenix it does work i have it on all 4 of my bot pages thonk

earnest phoenix
#

mk :?

odd leaf
#

no

tulip ledge
#
.longdescription .content {
    //code
}
odd leaf
#

um

#

a bunch of if statements aint multithreading

prime cliff
#

Are you adding the <style> </style> tags robot?

earnest phoenix
#

once i execute function how do i stop it xd

#

now it works oml

prime cliff
earnest phoenix
#

how do i make the long description just match the backround

#

return...

#

epic

odd leaf
#

return, break

#

depends on the lang and the position in the program

earnest phoenix
#

how do i change the button css?

sturdy delta
#

How do I make an overrride for myself with the command !prefix

#

In commando

prime cliff
#

You would have to take that up with the owner of commando or read the docs for it?

quartz kindle
#

i believe hes already doing that, his problem is with markdown

#

i dont know if you can mix markdown with html

#

im using only markdown, without html, and it works fine

#

so try moving your links outside of any html element

#

if you're using html, then do it the html way: <a href="url">click here</a>

earnest phoenix
#

-bots @prime cliff

gilded plankBOT
#
Builderb#0001
Bots

@marsh mirage
@zealous stag
@gusty cargo
@dense peak

earnest phoenix
#

srry

prime cliff
#

Its np 😄

earnest phoenix
#

Does anybody know and good API's that show facts about something? I already have most of the ones that show up on a simple google search but I cannot seem to find anymore, I currently have: number date year cat dog birb chuck bill and I am looking for other ones such as idk, maybe: bird fish history

#

Ping me when you respond to this, kthxbai

silver lintel
#

can someone please help me? i am making a discord.js bot, i wanted to know how to like overlay images.

earnest phoenix
#

hmm

#

I cant make the entire pages font to comfortaa

keen drift
#

Wikipedia?

earnest phoenix
#

?

#

No

#

my bots dbl page

keen drift
#

@earnest phoenix

earnest phoenix
#

ye?

keen drift
#

Scrape Wikipedia

earnest phoenix
#

🤔

#

Is it easy to make your own API? think3d

keen drift
#

I think MediaWiki runs on it

earnest phoenix
#

yeah

#

wikipedia is mediawiki apparently

quartz kindle
#

@silver lintel use sharp or canvas

silver lintel
#

whats that?

quartz kindle
#

image manipulation libraries

silver lintel
#

ok

quartz kindle
#

sharp is the best for imagine manipulation, its similar to gm and imagemagik

silver lintel
#

ok

quartz kindle
#

canvas is the best for image generation

#

to create your own graphics with code

silver lintel
#

but it says ```js
.toFile('output.webp'

quartz kindle
#

you use buffers to send to discord

silver lintel
#

sorry but what are buffers

quartz kindle
#

its a way of representing data

#

In computer science, a data buffer (or just buffer) is a region of a physical memory storage used to temporarily store data while it is being moved from one place to another. Typically, the data is stored in a buffer as it is retrieved from an input device (such as a micropho...

earnest phoenix
#

in python i would just while True, how do i do that in js

quartz kindle
#

while(true)

silver lintel
#
message.channel.send({
  files: [{
    attachment: 'entire/path/to/file.jpg',
    name: 'file.jpg'
  }]
})
#

do i do something like that?

quartz kindle
#

if you want to send files, yeah, but if you're doing image manpulation, you're losing a lot of time and resources by saving it to disk and loading it back from disk

#

thats why its better to use buffers

#

you do the image manipulation, get the buffer and send it directly to discord, without saving to disk

silver lintel
#

how to get a buffer?

quartz kindle
#

see the link above

earnest phoenix
#

hey tim?

#

hmm nvm

silver lintel
#

so like ```js
.overlay(buffer);

quartz kindle
#

did you read the link?

#
sharp('input.png')
  .overlayWith('overlay.png', { overlay options )
  .toBuffer()
  .then(function(outputBuffer) {
    // outputBuffer 
  });```
#

their example

#

input an image from file, overlay with another image from file, then output a buffer

silver lintel
#

and like what is //outputBuffer

quartz kindle
#

outputBuffer is the resulting image

earnest phoenix
#

LMAO

#

i broke my site

#

my bot page

silver lintel
#
.then(function(outputBuffer) {
    message.channel.send(outputBuffer); 
  });
``` like that?
earnest phoenix
silver lintel
#

wheres the crash?

earnest phoenix
#

gg im good at this

empty axle
#

I need help GWakkoWhenlifegetsatyou

#
module.exports.run = (bot, message, args) => {
    let membro = message.mentions.users.first()
    message.guild.createChannel("Kick Ptr" ,"voice")
    membro.voiceChannel.move(membro)
    message.guild.channels.find((x) => x.name == "Kick Ptr").delete()
}
#

What is wrong?

earnest phoenix
#

holy shit almost lost all my code

pale marsh
#

This is why you should use git

earnest phoenix
quartz kindle
#

@empty axle you're moving a user from a voice channel into a user?

#

you're trying to create a voice channel, move a person to the new channel, then delete the channel? wat

empty axle
#

voice kick

#

Creates a channel, moves a user for the channel, and delete the channel

quartz kindle
#

wait... thats actually genius

#

Lol

#

anyway, to move voice channels in d.js v11 its member.setVoiceChannel('channelid')

keen drift
#

til tim learns

empty axle
quartz kindle
#

@keen drift elaborate @_@

empty axle
#

But how will the bot know the channel id?

quartz kindle
#

i've never seen it being done before lul

#

you have to get the channel id that you just created

keen drift
#

await the channel create

quartz kindle
#

something like .createChannel("Kick Ptr" ,"voice").then(channel => channel.id)

empty axle
#

I'll try

vernal rivet
#

Tim and fishy working together O.o that's rare

quartz kindle
#

is it?

vernal rivet
#

IDK, first time I seen it

quartz kindle
#

i never though about "working together", im just here because i like teaching/explaining, and i also like wasting my time

#

Lol

empty axle
#
module.exports.run = (bot, message, args) => {
    let membro = message.mentions.users.first()
    let channelkcik = message.guild.channels.find((x) => x.name == "Kick Ptr").id
    message.guild.createChannel("Kick Ptr" ,"voice").then(channel => channel.id)
    membro.setVoiceChannel(channelkcik)
    message.guild.channels.find((x) => x.name == "Kick Ptr").delete()
}

This? GWseremePeepoThink

vernal rivet
#

"wasting my time " lol, sounds liked your doing something boring

quartz kindle
#

nope

empty axle
#

Sad

quartz kindle
#

its a promise

#

you need to wait for the promise to complete

empty axle
#

Hmm

quartz kindle
#

if you're using async/await: js let channelkcik = await message.guild.createChannel("Kick Ptr" ,"voice"); //channelkcik.id
if you're not using async/await: js message.guild.createChannel("Kick Ptr" ,"voice").then(channel => { //channel.id })

empty axle
#

Ok

#

I'll try again

#

@quartz kindle

#
(node:19816) UnhandledPromiseRejectionWarning: TypeError: membro.setVoiceChannel is not a function
silver lintel
#
bot.on("messageUpdate", function(oldMessage, newMessage) {
  let welcomeChannel = oldMessage.channel.guild.channels.find(`name`, "audit-logs");
    if (!welcomeChannel) welcomeChannel = oldMessage.channel.guild.channels.find(`name`, "bot-hell");
  if (!welcomeChannel) return;
  
  if (oldMessage === "" || newMessage === "") {
    return;
  }
  
  const embed = new Discord.RichEmbed();
  embed.setAuthor(`${newMessage.author.username} edited a message`, newMessage.author.displayAvatarURL);
  embed.setDescription(`A message by ${newMessage.author} was edited in ${newMessage.channel}`);
  embed.setColor(0x4c90ff);
  embed.addField("Old Message", oldMessage);
  embed.addField("New Message", newMessage);
  embed.setFooter(`ID: ${newMessage.author.id}`);
  embed.setTimestamp();
  
  welcomeChannel.send(embed);
});

even when no message was edited

inner jewel
#

that's not a member, it's an user @empty axle

#

message.mentions.users

empty axle
#

@inner jewel let membro = message.mentions.users.first()

inner jewel
#

yes

#

users

late hill
#

You can't just add a message object to the field @silver lintel

#

You're probably looking for oldMessage.content & newMessage.content

silver lintel
#

oh

#

.content

#

thanks

pale marsh
#

That method to kick someone from vc is pretty neat actually

earnest phoenix
#

how do i theme the navbar using css?

inner jewel
#

that's the only way of kicking from a vc

pale marsh
#

Wouldn't provoking the permission to connect to vc work the same way though?

earnest phoenix
mental solstice
#

provoke? or revoke? if someone is in the VC and you set permissions to not allow them. They will stay in it. Moving is the only option for now.

earnest phoenix
#

Is my error just a uncommon error

#

or a random error

mental solstice
#

what code is throwing the error

earnest phoenix
#

It's not saying

#

That's literally all the console is showing

mental solstice
#

unhandled error.. may want to use a try catch.. idk JS very well

#

well the console is telling u the line of he error

sick cloud
#

add the error event

mental solstice
#

and what file

sick cloud
#
bot/client.on('error', console.error)```
#

replace bot/client with your discord client

earnest phoenix
#

just put that into index.js?

#

@sick cloud

mental solstice
#

r0b0t

#

display: hidden;

#

iirc

sick cloud
#

sure

#

wherever your other events are

earnest phoenix
#

mk

mental solstice
#

oh

#

display: none

#

or visibility: hidden

earnest phoenix
#

good ole css

#

idk how cause it doesnt show on inspect

#

right click on the line

#

i did

#

it takes me to a entire divider

#

What page are you looking at?

#

this

#

my bots page

mental solstice
#

u will have expand the entire div or something

#

I'm not on PC atm

earnest phoenix
#

i looked and cant find it

#

Change

#
style=border-bottom:none
to
style=border-top:none
mental solstice
#

border top

#

oh yeh

earnest phoenix
#

uh

mental solstice
#

.container

earnest phoenix
#

remove the part that says -bottom

#

i dont think i cna

#

can

#

found the fix

#

ty

#

yw

#

I wish I took the time to learn HTML5

sick cloud
#

@earnest phoenix rename your bot to multipurpose okay

earnest phoenix
#

hey it had moderation but I'm probably going to make it exclusive to my server

#

so yeah

#

when I get round to that I'll do that

silver lintel
#

why does this come up, and how can you get rid of it?

quartz kindle
#

change .find("a","b") to .find(a => a.name === b)

inner jewel
#

find(a, b) -> find(x => x[a] = b) just replace all

quartz kindle
#

smart man

sick cloud
#

using js think

#

ok so i have a stats command anything i should put in there other than the basic stats and uptime etc

earnest phoenix
quartz kindle
#

@earnest phoenix create an object or an array and add people to them?

earnest phoenix
#

oh

earnest phoenix
#

@earnest phoenix how did you make your description like you are using ** hi ** ?

#

Huh?

#

hi

#

Uh

#

No

inner jewel
#

<b>text</b>

#

for html

earnest phoenix
#

I'm using a font

#

Probably that

#

I am bad at english fuck 416452135660814348

bright spear
#

with the normal css all text is bold

#

you will have to override that so people can distinguish bold text

earnest phoenix
#

Anyone know how to make a super simple REST API?

quartz kindle
#

yeah

earnest phoenix
#

Is it possible to host one on glitch for use by me and patrons?

quartz kindle
#

i believe so

earnest phoenix
#

🤔

quartz kindle
#

glitch exposes a url for your project on port 3000 i think

earnest phoenix
#

yeah

#

Do you know how? 😂 You got any examples I could look at please? I don't really know where to start

quartz kindle
#

you just need to make something listen to the port

#

are you using node.js?

earnest phoenix
#

ye

#

Is it like a webserver?

quartz kindle
#

node has like a gazilion webservers

#

express, restana, restify, fastify, rayo, polka, etc...

earnest phoenix
#

yeah, how would I get the result? 😂

quartz kindle
#

have you ever used any of those servers?

earnest phoenix
#

Not really lol

quartz kindle
#

the easier to use is probably express, althoug the others are not much harder either

#

so go ahead and install it using npm

earnest phoenix
#

All I want, is a simple categorized fact api that returns a random fact from the specified category

quartz kindle
#

yeah, so go ahead and install a webserver of your chose with npm

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

app.get('/api/hello', (req, res) => {
    return res.json({ hello: "Hello world!" });
});

app.listen(3000, console.log('Listening to port 3000'));

simple api server base

earnest phoenix
#

oo

#

Would I put that in my glitch app?

sick cloud
#

all you need is npm i express

#

yea

earnest phoenix
#

🤔

#

Alright cool.

#

Then I could use unirest.get("URL") and it will gimme a result?

sick cloud
#

yeah

#

if you used a GET to <your project>/api/hello it'd return { hello: "Hello world!" } as application/json

lyric talon
#

Guys

quartz kindle
#

you can open your browser and go to http://your.glitch.url/api/hello and you will see {"hello":"hello world"}

lyric talon
#

I never used the json in python:

# afk
afklist = {}


# afk
with open('afks.json', encoding='utf-8') as f:
    try:
        afklist = json.load(f)
    except ValueError:
        afklist = {}

#

The second afk should substitute the first one ?

#

Them i can work with them like a dictionary ?

#

Or am i doing wrong ?

earnest phoenix
#

So what do normal API people do?
Make like a JSON File and write all of the categories there and do it all manually? 😮

#

That would take a helluva long time lmao

quartz kindle
#

you need to either get data from somewhere, or build your own data

earnest phoenix
#

darn

#

JSON file would do, kherrect?

sick cloud
#

sure

lyric talon
#

Are you talking o me ? GWqlabsGarThink

sick cloud
#

its static data

#

so json should work fine

earnest phoenix
#

Thankyou v much guys ❤ I'll more than likely be back here soon 😂

sick cloud
#
{
    "category": ["fact", "fact"],
    ...
}
#

that'd work

earnest phoenix
#

yee

#

Would the app stay online without the watch.json file York told us to add or is that something different lol

quartz kindle
#

if your data is not very large (ie hundreds of MB), its a good idea to keep them in memory

#

ie: load the json file once, into a variable, and use the variable, instead of always loading the file again

earnest phoenix
#

O well imma plan on hiring devs to help me add as many facts to the file as possible

#

Possibly 500 Facts per category

#

For about 20 Categorys

quartz kindle
#

if i understand correctly, glitch should automatically "wake up" when it receives a request, so no need for the watch.json

earnest phoenix
#

Alright, good lmao

#

Thank you vm

quartz kindle
#

500x20 = 10000
10000 x medium sized sentence = ~ 10 MB

#

small enough to keep it in memory

earnest phoenix
#

Memory as in a JSON file? 😂

#

I'm retarded I tell you lmao

quartz kindle
#

memory as in, load the json file only once

#

and save it in a variable

earnest phoenix
#

Okay lol

#

Tim, wouldn't people then have access to my code for the API as they know the project name?

#

@quartz kindle

quartz kindle
#

idk how glitch works

#

can anyone access it?

earnest phoenix
#

Think so, if they have the project name I believe so

quartz kindle
#

isnt there any way to make your project private?

earnest phoenix
#

hmm hold on

earnest phoenix
#

ah okay good thank you haha

lyric talon
#

Guys ?

#

I'm using discord.py rewrite, could someone help me ?

ruby dust
#

hm?

slim heart
#

Wait what would be the process of testing if a token were actually used like using the token to login and then it replies with the username and ID and stuff, would it just be making like a function where it makes a new Client and then logs into it and returns those values? Like how Luca does

ruby dust
#

but luca doesn't do that?

slim heart
#

Yea it does but only the mods can use it

quartz kindle
#

elaborate

#

also, sorry @lyric talon im not good with python, but im assuming the code you posted should work

slim heart
#

Like you’d do test-token bot_token then it’d login to it and it’d return its username basically validating that its a real token

lyric talon
#

Ok, Tim, no problem 😃

#

ty

slim heart
#

It’s what the moderators do when they see an exposed token on GitHub, they test it first

#

iinm with Luca

quartz kindle
#

you mean getting a random token and testing it against discord to see if it works?

#

yeah just create a new client, login, and use the ready event

#

i believe d.js has a client.destroy() function, which you could use to safely unload those extra clients after you test them

slim heart
#

Just out of curiosity is it possible to relogin to another token and it’d rewrite the client?

quartz kindle
#

you dont even need to use the ready event, just the login result

#

no idea, try it

#

lmao

#

im pretty sure it will return an error

slim heart
#

HAHAH it just logs into the other account that’s great

quartz kindle
#

Lol

#

so you can use the same client for multiple bots

#

interesting

inner jewel
#

that's against the tos

slim heart
#

no it just rewrites the previous bot

#

so it disconnects the previous bot

quartz kindle
#

oh

slim heart
#

i also just made the fatal mistake of doing console.log(client) to see what i can get off of it. and um yeaaaa.

rotund mango
#

help guys my bot wont respond to my owner only commands

#

im so confuzzed

slim heart
#

hello 54268 users what

quartz kindle
#

rip your terminal logs

rotund mango
#

other commands work

#

except owner???

#

and im the OWNER??

earnest phoenix
#

you provided everything but info that's of use to us

quartz kindle
rotund mango
#

Discord.Net 1.0.2
[RequireOwner] attribute on commands listed under Group of "owner"
Shutdown >> Exits all running instances
Shutdown [reason] >> Logs the reason, and exits all instances
Reboot >> Closes all instances and opens one again
Announce >> Logs to the channel the provided string

#

It's just NOT responding to any RequireOwner listed commands

#

even when I myself the owner use them

#

there's not much information I can give

#

there is NO error

quartz kindle
#

you can give the actual code?

rotund mango
#

What is there to give? Commands have RequireOwner attribute, they won't at all run when I (the owner) use them lol

earnest phoenix
#

is it in a team

rotund mango
#

That first code occurs within this block

earnest phoenix
#

yeah module preconditions don't work like they're supposed to

#

you're going to have to apply them on each command

inner jewel
#

you can't get team members

#

for discord teams

earnest phoenix
#

yes

rotund mango
#

also this one

#

thats in a group that hasnt got listed requireowner

earnest phoenix
#

is your app in a team though

rotund mango
#

que?

inner jewel
#

also even if it isn't owner checks are broken rn

rotund mango
#

when i remove RequireOwner it works fine btw

inner jewel
#

if they use /oauth2/applications/@me

earnest phoenix
#

oh

#

the endpoint borked?

inner jewel
#

it 403s

#

with "bots can't use this endpoint"

#

Because Discord Is WebScale

earnest phoenix
#

seems to be working fine on my end

rotund mango
#

wdym by is it in a team

earnest phoenix
#

is your bot a team bot

#

it probably isn't

rotund mango
#

i still have no idea what you mean

inner jewel
#

is your bot owned by a team?

#

aka did you transfer it to one?

rotund mango
#

no? it's owned by me?

earnest phoenix
#

its aight, the api broke so that's why RequireOwner doesn't work

rotund mango
#

i can even log AppInfo.owner

#

and its me

#

this is wildin GWfroggerHyperXD

earnest phoenix
#

you can make a substitute precondition for the time being if you want to

#

basically compare the author's id to your id

rotund mango
#

nah they arent necessary commands right now, thanks though :')

#

im running from VS mainly as I test a few new features for Runescape lmao

inner jewel
#

it's fixed now

rotund mango
#

bork over?

#

bork over.

slim heart
#

how can i have an event inside of a function than will let me return the results of that event in the function, so the thing is the event is called after some time so if i return after it it'll just return undefined because the event hasn't been run yet, but if i return inside the event it doesnt return on the scope of the function

quartz kindle
#

can you give an example?

slim heart
#
async function tokentest(token) {
    const testbot = new Discord.Client();
    var v = {}
    testbot.login(token).catch(err=>{
        if(err) {
            v = {
                'tag': 'null',
                'bot': 'null',
                'id':'null',
                'avatar':'null',
                'server_size':'null',
                'user_size':'null',
                'n': 'RED'
            }
            return v
        }
    })
    testbot.on('ready', () => {
        v['tag'] = testbot.user.tag
        v['id'] = testbot.user.id
        v['bot'] = testbot.user.bot
        v['avatar'] = testbot.user.avatarURL
        v['server_size'] = testbot.guilds.size
        v['user_size'] = testbot.users.size
        v['n'] = 'GREEN'
        testbot.destroy()
    })
    return v
}```
#

u already know what that's for

#

but yea

#

cuz the event will happen in its own time so im wondering if theres anyway to return to the parent function after it

quartz kindle
#

how about creating a promise?

slim heart
#

make what into a promise

quartz kindle
#
let result = await new Promise(resolve => {
    let v = {};
        testbot.on('ready', () => {
        v['tag'] = testbot.user.tag
        v['id'] = testbot.user.id
        v['bot'] = testbot.user.bot
        v['avatar'] = testbot.user.avatarURL
        v['server_size'] = testbot.guilds.size
        v['user_size'] = testbot.users.size
        v['n'] = 'GREEN'
        testbot.destroy()
        resolve(v)
    })
})```
slim heart
#

mmmmm ok,

quartz kindle
#

login is also a promise, and since you're using async/await, you can probably do something better

slim heart
#

so i just move the login to the promise aswell?

quartz kindle
#

like: ```js
return new Promise(async (resolve,reject) => {
let testbot = new Client();
if(await testbot.login()) {
testbot.on("ready",data => {
resolve(data)
})
} else {
reject(data)
}
})

#

for example

#

promises are fun

slim heart
#

very triggered

#
for(i=0;i<Object.keys(u);i++) {
        res.addField(Object.keys(u)[i],u[Object.keys(u)[i]],true)
    }```
#

why isnt this working all the sudden

#

u is the response from the function btw

quartz kindle
#

Object.keys(u).length

slim heart
#

it sends the avatar url and the color value

#

woops what

#

im nub

quartz kindle
#

im a noob too

#

noice

slim heart
#

i also need to reset my token real quik lol

#

cuz the blur didnt work randomly triggered

quartz kindle
#

eh its fine

slim heart
#

someones gonna snipe it

quartz kindle
#

i've accidentally posted my token here before as well

#

xD

earnest phoenix
#

heyo

inner jewel
#

again, testing tokens is against the discord tos

silver lintel
#

how can you make a bot send a message, and react its own message, so that when the user selects that reaction, the bot knows

earnest phoenix
#

How would you test tokens

slim heart
#

@inner jewel how?

#

also ik luca does it so are yall breaking the tos too what

#

but what part of the tos restricts it

silver lintel
#

ok thanks

faint cedar
#

Hey, anyone with javascript skills, mind telling me what this little bit of code does? I am trying to de-obfuscate something and im having issues with this part of the script. a is a function. a.p = "", a(a.s = "FUsP")

slim heart
#

ummm

faint cedar
#

Just asking because I have multiple calls of a.p but that is just an empty string

slim heart
#

why are you trying to obfuscate something, i dont think you understand what that means