#development
1 messages · Page 556 of 1
just post the question and someone will prob answer it
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
...just remove the part where you can choose?
thats the most communistic thing i have ever said
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
it has to be working to be on the list, if its not working, it will get declined
if(command === `${prefix}ban` || command === mentionprefix + "ban") {
const banner1 = new Discord.RichEmbed()
.setColor("FF3131")
.setDescription(" 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(" 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(" 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(" You cannot ban yourself.")
if(who.id === message.author.id) return message.channel.send(banner4)
const banner5 = new Discord.RichEmbed()
.setColor("FF3131")
.setDescription(" " + 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(" 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(" " + who.username + " (" + who.id + ") has been banned. \n Reason: `" + reason2 + "`")
message.channel.send(banner7)
}```
The Error: https://hastebin.com/fipajusepo.cs
Please help anyone.
which one is line 1813
why is bot.on indented
it doesnt affect anything.. but makes readability worse. for you and others
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
console.log(reactions);``` this is my code for a reaction filter but it doesnt log anything
Hey anyone can give me eris docs website and server link pls
google smfh
ok
@desert bough wound that be a command or an event
its on a command
So like does it react to others with emoji or?
the bot reacts with an emoji then the user reacts and it should log it
@quick rune
ok
Its in beta tho so 🤷
ok
You know anything about cars?
no
Rip
if this isnt about development i recommend u move it to #memes-and-media
It was shorta that way
?
Its the system in the car
Well awaitreactions returns a promise
Use a .then
Anyone have sick a*# RAW data I could use for my bot (I prefer category moderation)
what
ProRP what are you even talking about
RAW data I could use for my bot for moderation
what do you mean by raw data
Yes we are and there’s no need for “RAW” data
and youre a "bot owner"
Unless you’re talking about the furry bots in which RAWr data but other then that yea no
if you mean actual code, noones gonna give you shit or spoonfeed you
if(uwant.spoonfeed) {
go.somewhere(else)
} or {
learn.howto(code)
}
return;```
what the fuck are you even on about
raw data can literally mean a ton of things
RAW is for pictures
for example, raw image data from a dslr camera
Not that type lol
or the raw event in discord.js where it logs all events
or raw binary data from a file
stop using terms you dont know to yourself look smart 🤷
to make yourself look smart**
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 
apparently there is a game called "raw data" on steam
send it 🤣
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 
quite possible, although his username suggests otherwise, psychologically speaking
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 
he was speaking on a higher plain of existance
Lol
Lol nice @slim heart
yes
Yeah
That moment when you’re warned and to move to general 
Lol
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```
troll 👏
why are you saying sorry to linux and mac users lol
this guy is trolling
he posted that same question like 5 times already
and doesnt reply when we try to help
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
try messing with discord's voice processing, under audio/video settings
tried still didnt work
other than that, each voice channel has its own voice bandwidth settings
you probably lowered the bitrate in your vc
Nah 64
I even tried group dms
still sounds wrong
if it still doesnt work, test in browser if youre on app
or test in app if youre on browser
kk
cpu bottlenecking/ram allocation issue then
nope
i have 32gb and a ryzen 1600
doubtfull
he said it sounds fine on skype
Tim, question, if I want to grab some Json data from a package, would I use .parse or. stringify?
if all else fails, try uninstalling the audio drivers and using it with windows's generic drivers
JSON.stringify turns into json format @vernal rivet .parse parses it
@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
Would I just call on the object?
But I want it to send in a embed on discord, but I keep getting [object Object]
you cant send the object itself
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
Is there a way to get just properties that I want
just to test, i've seen similar issues with skype, where it works everywhere except skype
Its not that simple tho
it turned out to be caused by the audio driver's dolby digital whatever
i have a scarlet 212
and default drivers installed
because well otherwise i have a mono issue
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
I don't see what you mean its obvously the fact that discord app is only using 0.1mbs
@vernal rivet ```js
object = {
key:value,
key2:value2
}
object.key2 // value2```
the browser works at 6mbs and its fine
6mbps its ridiculous, it should work fine at 0.1mbps
Oh ok, thanks, I will have to try it when I get home, I am at school right now
6mbps is a full hd video on youtube
why using the app on google
it took 6mbs for google
chrome*
the destop app uses 0,1 mbs
and cuts my mic out
yeah, it uses all it can to download the page
yar yar
after the page is downloaded, it should stop using that much
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
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
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
you are supposed to track that in your clients events, should be named something about adding reactions
i cant help with python sorry
cry
The users are defined inside de reaction (reaction.users() )
but i just need to change my check
To check a specific number
a text number or a reaction number?
here tim
you're using discord.js right?
yep
so, if you're using normal code, you can add a catch block on every async function, for example: .send().catch(console.log)
if you're using async/await code, you can use a normal try/catch block
It's throwing this error
yes, that happens when you dont catch errors
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
So if I add in your line, where? It should log missing perms instead of crashing it
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
Okay, so do I need to add this in with the permission check or it's own line?
if you add this on your .send() it will not crash anymore
swag
it will just send the error to your console
okay gonna test
this is called a "silent fail"
when the program fails, but doesnt let anyone know it failed
if(!bUser) return message.channel.send("Username must be wrong, can't find them.").catch(console.log)
its the ideal solution for when you dont have permissions, and you dont absolutely require them
This work?
should work yes
fingers crossed you helped
you need to add a catch to all instances of .send()
it will only catch errors of that specific line
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");
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
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
Looks like it's not throwing anything as of yet.
I'm going to lunch. I'll check back after to see.
Thanks man for the belp
also
oop spoke too soon
add .ban where?
Hi
oi m8
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
`like this`
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.
add a catch to ban and to the last send
done.
@stable summit i told you
incidentchannel.send(banEmbed).catch(console.log);
\uu\
@stable summit see this for Discord markdown https://gist.github.com/boltxyz/eae8ba05570fbd382d2c5dc9761d6b22
use tilde not apostrophe
this ` not this '
top left corner of the keyboard. It's also the ~ key
going to lunch, thanks a ton @quartz kindle
Lmao wot a tilde is ~
'''ooo'''
It is on the same key atleast
(')
WHAT
@stable summit this ` is different from this '
O
now
` is called a backtick
there ya go
finally
^
Thank
` is called an "accent" in portuguese xd
stop talking like that kthanks
:o
@quartz kindle continuing from our yesterday's discussion about bcrypt, how would I store the hash to sqlite exactly?
Plce
@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
should I be needing to encode the hash again before checking?
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
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
show your code
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
it encodes the string
does JS really accept parameters like that?
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
checkpw probably does that.. and oh python:)
yeah and that was my first question, is it really a good idea to store a hash as text?
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
and to compare the 2 I have to encode both
which is slowed down by the salt rounds
i did message.author
so it mentioned me
but when i do userinfo [user] i want their mention there
message.mentions = list of mentions
uhm it says object object
ok fine
oh I got it to work, thanks again tim
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
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 ^
I know
I'm pretty sure it doesn't
When you message.mention.users it returns an array
@quartz kindle throwing the same error.
Wait hold up, how do I mention the roles like this?
<@&ROLE_ID>
wait i wrote is
@earnest phoenix are you sure the error is in that function? have you checked your other bot functions?
lmao
well, technically they are all the same thing
if you do typeof array/object/collection it will always return "object"
then wait
Ok
@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.
@earnest phoenix did you put it on the .ban() to?
That command
@earnest phoenix do you know exactly which command causes the error?
Oh wait thats a discord thing isn't it
.ban(sendEmbed).catch(console.log
?
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
👍
:)
How do I get rid of the white space between my html and the site
you want to remove the "gamebot" part?
the description background?
how are you trying to style it?
yeah but show the css
<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>
<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>
.div ? is that a class?
that's not even valid css
i made it
you're missing a bracket
Oof, acciedentally deleted it
it was there
you're not targeting the content class then
when i do content
it just does the div without any class
im trying to get the entire divider
i dont get what you mean
q.q
but to target the content class, you need to be more specific
if you check the dbl website
Im trying to theme the backround of the dbl divider
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?
most of the .content css has a specificity level of 2: .longdescription .content
your css needs to be at least the same specificity level
how would i do that?
Okay
how can i show acknowledgements of a user
tim can ya help?
wait a min
sure thing
how would i change the backround of the entire page
are you on pc?
use the inspector and check where is the original background coming from
and use the same css targeting
Why they not accept me
Oof
Euhm why is this getting commented?
its just the styling it doesn't actually comment it out
i cant find the barckround
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
i tried body, it didnt work tho
what did you write?
<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>
works for me lol
Look on Phone same
you should read what the page says
how do i define message
i mean, reaction event is not in message event
you need to get it from the reaction
wdym
reaction is an object with many proprieties, message being one of them
Somehow my styling is commented...
did you test the code?
In html yes and it works fine
But when I paste it into DBL
It comments the styling
is it actually commented tho? ie: not actually doing anything in dbl when you save it and run it
Its not really styling anything
use the inspector and check how is the css being injected to the page
its being overwritten by a higher specificity css
Oh
check the css that is overwriting it
an id would also work yes, because IDs have a higher level than classes
But Tim? How would I make the background darker because this doesn't work:
.content {
background-color: #2A2D32;
}
once again, check how specific the original css is
and make yours equally specific
this is the original css
👍
#
# 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
So I'm not great withmarkdown but I thought this was how you would do it right?
(support server)[https://discord.gg/tetete]
Right?
Its the other way around
Yeah but I did both but none worked
Then I get this
Yeah but how would I make a markdown in the DBL page?
this usually breaks formatting
It sais it supports it
It should work then
But its not
Whats multithread?
ugh i cant find the goddamn way to change the backround
Working fine here https://i.imgur.com/beP1OB5.png
@earnest phoenix what background?
basically instead of your program being a list of things to do, it can run at the same time @tulip ledge
the backround of dbl
Not here
its useful if your bot has to run several commands at once
and one command hangs or something
You must be doing something wrong then
You mean like
I have it set up so each command is its own thread that's killed either after 30 seconds or after the command ends
if() {}
if() {}
if() {}
no
Yes
@earnest phoenix You mean the background of the main page or long desc?

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;
}```
okay
Dark overlay is nice if you have a bright background image
You should use
@earnest phoenix it does work i have it on all 4 of my bot pages 
mk :?
no
.longdescription .content {
//code
}
Are you adding the <style> </style> tags robot?

how do i change the button css?
You would have to take that up with the owner of commando or read the docs for it?
@tulip ledge https://canary.discordapp.com/channels/264445053596991498/272764566411149314/535912103832190987
You need to add
<style>
Css code here
</style>
i believe hes already doing that, his problem is with markdown
@tulip ledge
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>
-bots @prime cliff
@marsh mirage
@zealous stag
@gusty cargo
@dense peak
srry
Its np 😄
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
can someone please help me? i am making a discord.js bot, i wanted to know how to like overlay images.
Wikipedia?
@earnest phoenix
ye?
Scrape Wikipedia
I think MediaWiki runs on it
@silver lintel use sharp or canvas
whats that?
image manipulation libraries
ok
sharp is the best for imagine manipulation, its similar to gm and imagemagik
ok
but it says ```js
.toFile('output.webp'
you use buffers to send to discord
sorry but what are buffers
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...
in python i would just while True, how do i do that in js
while(true)
message.channel.send({
files: [{
attachment: 'entire/path/to/file.jpg',
name: 'file.jpg'
}]
})
do i do something like that?
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
how to get a buffer?
see the link above
so like ```js
.overlay(buffer);
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
and like what is //outputBuffer
outputBuffer is the resulting image
.then(function(outputBuffer) {
message.channel.send(outputBuffer);
});
``` like that?
wheres the crash?
gg im good at this
I need help 
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?
holy shit almost lost all my code
This is why you should use git

@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
wait... thats actually genius
Lol
anyway, to move voice channels in d.js v11 its member.setVoiceChannel('channelid')
til tim learns

@keen drift elaborate @_@
But how will the bot know the channel id?
i've never seen it being done before lul
you have to get the channel id that you just created
await the channel create
something like .createChannel("Kick Ptr" ,"voice").then(channel => channel.id)
I'll try
Tim and fishy working together O.o that's rare
is it?
IDK, first time I seen it
i never though about "working together", im just here because i like teaching/explaining, and i also like wasting my time
Lol
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? 
"wasting my time " lol, sounds liked your doing something boring
nope
Sad
Hmm
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 })
Ok
I'll try again
@quartz kindle
(node:19816) UnhandledPromiseRejectionWarning: TypeError: membro.setVoiceChannel is not a function

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 let membro = message.mentions.users.first()
You can't just add a message object to the field @silver lintel
You're probably looking for oldMessage.content & newMessage.content
That method to kick someone from vc is pretty neat actually
how do i theme the navbar using css?
that's the only way of kicking from a vc
Wouldn't provoking the permission to connect to vc work the same way though?
@quartz kindle
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.
what code is throwing the error
unhandled error.. may want to use a try catch.. idk JS very well
well the console is telling u the line of he error
add the error event
and what file
mk
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
i looked and cant find it
Change
style=border-bottom:none
to
style=border-top:none
uh
.container
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
@earnest phoenix rename your bot to multipurpose okay
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
change .find("a","b") to .find(a => a.name === b)
find(a, b) -> find(x => x[a] = b) just replace all
smart man
using js 
ok so i have a stats command anything i should put in there other than the basic stats and uptime etc

@earnest phoenix create an object or an array and add people to them?
oh
@earnest phoenix how did you make your description like you are using ** hi ** ?
Huh?
hi
Uh
No
with the normal css all text is bold
you will have to override that so people can distinguish bold text
Anyone know how to make a super simple REST API?
yeah
Is it possible to host one on glitch for use by me and patrons?
i believe so
🤔
glitch exposes a url for your project on port 3000 i think
yeah
Do you know how? 😂 You got any examples I could look at please? I don't really know where to start
node has like a gazilion webservers
express, restana, restify, fastify, rayo, polka, etc...
yeah, how would I get the result? 😂
have you ever used any of those servers?
Not really lol
the easier to use is probably express, althoug the others are not much harder either
so go ahead and install it using npm
All I want, is a simple categorized fact api that returns a random fact from the specified category
yeah, so go ahead and install a webserver of your chose with npm
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
🤔
Alright cool.
Then I could use unirest.get("URL") and it will gimme a result?
yeah
if you used a GET to <your project>/api/hello it'd return { hello: "Hello world!" } as application/json
Guys
you can open your browser and go to http://your.glitch.url/api/hello and you will see {"hello":"hello world"}
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 ?
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
you need to either get data from somewhere, or build your own data
sure
Are you talking o me ? 
Thankyou v much guys ❤ I'll more than likely be back here soon 😂
yee
Would the app stay online without the watch.json file York told us to add or is that something different lol
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
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
if i understand correctly, glitch should automatically "wake up" when it receives a request, so no need for the watch.json
500x20 = 10000
10000 x medium sized sentence = ~ 10 MB
small enough to keep it in memory
Okay lol
Tim, wouldn't people then have access to my code for the API as they know the project name?
@quartz kindle
Think so, if they have the project name I believe so
isnt there any way to make your project private?
hmm hold on
ah okay good thank you haha
hm?
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
but luca doesn't do that?
Yea it does but only the mods can use it
elaborate
also, sorry @lyric talon im not good with python, but im assuming the code you posted should work
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
It’s what the moderators do when they see an exposed token on GitHub, they test it first
iinm with Luca
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
Just out of curiosity is it possible to relogin to another token and it’d rewrite the client?
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
HAHAH it just logs into the other account that’s great
that's against the tos
oh
i also just made the fatal mistake of doing console.log(client) to see what i can get off of it. and um yeaaaa.
hello 54268 users 
rip your terminal logs
you provided everything but info that's of use to us
@slim heart login on dev tools and get it all nice and dandy
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
you can give the actual code?
What is there to give? Commands have RequireOwner attribute, they won't at all run when I (the owner) use them lol
is it in a team
yeah module preconditions don't work like they're supposed to
you're going to have to apply them on each command
yes
is your app in a team though
que?
also even if it isn't owner checks are broken rn
when i remove RequireOwner it works fine btw
if they use /oauth2/applications/@me
seems to be working fine on my end
wdym by is it in a team
i still have no idea what you mean
no? it's owned by me?
its aight, the api broke so that's why RequireOwner doesn't work
you can make a substitute precondition for the time being if you want to
basically compare the author's id to your id
nah they arent necessary commands right now, thanks though :')
im running from VS mainly as I test a few new features for Runescape lmao
it's fixed now
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
can you give an example?
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
how about creating a promise?
make what into a promise
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)
})
})```
mmmmm ok,
login is also a promise, and since you're using async/await, you can probably do something better
so i just move the login to the promise aswell?
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
very 
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
Object.keys(u).length
eh its fine
someones gonna snipe it
heyo
again, testing tokens is against the discord tos
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
How would you test tokens
@inner jewel how?
also ik luca does it so are yall breaking the tos too 
but what part of the tos restricts it
ok thanks
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")
ummm
Just asking because I have multiple calls of a.p but that is just an empty string
why are you trying to obfuscate something, i dont think you understand what that means



