#development
1 messages · Page 325 of 1
i wouldnt know that because i moved to eris 
eris isnt bad
what do you mean
eris is d.js V8 a.k.a functional programming instead object oriented programming
d.js is ram hog tho 
you can disable events you dont need
didnt help with ram usage for me
moving to eris got me from 1000mb after 5 days of uptime on d.js to 200mb after 5 days of uptime with eris
owo
are you sure you disabled every uneeded event?
also
you can adjust the CacheLifetime
A.K.A when it is sweeping cached stuff
like messages
i dont really care, moving to eris was better for me- music is sounding a lot better too which is what 80% of my servers use it for kek
¯_(ツ)_/¯
also I thought eris was using object oriented programming
unless i am mis understanding what that means
you dont have to do that
👀
look at the git repo ¯_(ツ)_/¯
i dont use eris
so i dunno
but eris is ripped of D.js V8
since hydar and abal were working togheter
i used to use java for a lot of things but stopped when i learnt javascript
how is java better 
Typings, better scaling when using a lot of files, cleaner
also Lavaplayer is 
why npm dont have Lavaplayer 
what is lavaplayer 🤔
a Music LIbary what gives you the Stream from Soundcloud/Youtube/vid.me videos
also information
etc.
you just need to provide any Resolvable like an id or Link
i doubt you are creating a YTDL Libary for node.js
you dont even need any api key for Soundcloud 
I've just added soundcloud support on mine
well my api key request was declined
rip
yep
thats why i love Lavaplayer you dont need shit
ytdl-core as example crashed because of like everything
what is annoying af
never had issues with it when i was testing it
lmao
and the best part is that instead passing an error in the callback miniget (what is used by ytdl-core for the requests) is throwing it in the lib so you can't catch it
i just hate ytdl-core so much
kek
process.on('error', // do ur stuff)
process.on('unhandledRejection', // more stuff)
that will catch it when you throw smth in your code?
second is for Promises and i use that already
OwO
i will test later
since im not home atm
but if that is working i would cry
lmao
its just annoying af
why cant it just pass an Error instead throwing shit in the libary src

i coded a bot on js and added it to your bots page, its online, thats good, but it doesnt do anything, all was fine when VisualStudio Code was opened
hey does anyone know how to make a bot send u a dm
example:
@remote steppe
if u do
b!help
a dm message is sent to you
even @wintry spire has it
sendMessage is depricated, use send
Bruh
lol
?

what did u get
u got a message dmed to you with commands from @wintry spire BOT
right
my question is how to do that
👀
@languid dragon
That is a dm
embed
ok
Do some research
what about discord.js
yes
Google embed visualizer
the same way you would send it to a channel
ok
thanks
it says
Parsing error: Identifier 'embed' has already been declared (Fatal)```
i have already an embed command
how can i make two
ok
🤦
Same
the error is written right there
where

change the name? 
Idk
why did u say change the name

show us the code of the thing you're making

ok
here
const embed = new Discord.RichEmbed()
.setTitle("Embed test")
.setAuthor("Deni","https://pbs.twimg.com/profile_images/443395572783800322/nXTuit5o.jpeg")
/*
* Alternatively, use "#00AE86", [0, 174, 134] or an integer number.
*/
.setColor(0x00AE86)
.setDescription("This is the main body of text, it can hold 2048 characters.")
.setFooter(":wink: © CF", "https://pbs.twimg.com/profile_images/443395572783800322/nXTuit5o.jpeg")
.setImage("https://pbs.twimg.com/profile_images/443395572783800322/nXTuit5o.jpeg")
.setThumbnail("https://pbs.twimg.com/profile_images/443395572783800322/nXTuit5o.jpeg")
/*
* Takes a Date object, defaults to current date.
*/
.setTimestamp()
.setURL("https://discord.js.org/#/docs/main/indev/class/RichEmbed")
.addField("This is a field title, it can hold 256 characters",
"This is a field value, it can hold 2048 characters.")
/*
* Inline fields may not display as inline if the thumbnail and/or image is too big.
*/
.addField("Inline Field", "They can also be inline.", true)
/*
* Blank field, useful to create some space.
*/
.addBlankField(true)
.addField("Inline Field 3", "You can have a maximum of 25 fields.", true);
i have this code
mmhhmm
you're not sending it
client.on("message", message => {
if (message.content.startsWith(prefix + "sssss")) {
message.channel.send({embed});
}
});```
with this
change const to var if you want to change it
what
i want to make an embed commands
get out
no
why
lol
wut
ok
Parsing error: Identifier 'embed' has already been declared (Fatal)
'embed' has already been declared
already declared
ok thanks
guys
when i changed embed to
ttt
it said it is assigned a value but never used
what are you trying to send

yes, then send an embed called ttt
legit just fuckin const ANYTHINGTHATSNOTCALLEDEMBED = new Discord.RichEmbed()
pls
Then send an embed called ANYTHINGTHATSNOTCALLEDEMBED
how do i send it
Omg
lol no
where
ohmy
I told u wat to do
so much wrong in that one image
Yep
put the const ttt = new [...] shit in the command
👀
put your bot's correct token into where it connects
Uh
i have my correct token
suuuUUUuuure about that??
Token dont mean bot token
Pretty sure he just has a curly boi where he shouldn't be
considering there was red lines on that screenshot 
hey
hi
does the bot token get changed automatically
no
maybe there's an error making the token different
only if you login 1000 times in 12 hours or summin
idk
i changed the token now
i will see if the error is still there
how
it is still with the error
then it's sommin' else
Token dont mean bot token but dw about my comments amirite
knew it
hey
http://prntscr.com/gqf93e why do i get a 'return' outside of function
error
developers
you're an error developer 👈 😏 👈
huh
help me
i get await is reserved
but have it one time
written
in the command above
#vscoderepresent
if you're using async, shouldn't all api calls in your case, all .reply(...) calls have await?
async function ping() {
return await message.reply('pong');
}
await ping();```
??
unless you aren't using an async function, if that's the case remove await from member.kick
sql.open("./gconfig.sqlite");
exports.run = (msg, args) => {
const srole = args.slice(0).join(' ');
if(!msg.author.id == msg.guild.owner.id) return msg.channel.send("This command is only avalible to the guild owner and people who he/she adds to a list")
if(!srole) return msg.channel.send("Please provide a role you would like to have set has the mod role")
sql.get(`SELECT * FROM gconfig WHERE guildID = "${msg.guild.id}"`).then(row => {
if (!row) {
sql.run("INSERT INTO gconfig (guildID,srole) VALUES (?, ?)", [msg.guild.id,`${srole}`]);
} else {
sql.run(`UPDATE gconfig SET srole = ${srole} WHERE guildID = ${msg.guild.id}`);
}
}).catch(() => {
console.error;
sql.run("CREATE TABLE IF NOT EXISTS gconfig (guildID TEXT,srole TEXT )").then(() => {
sql.run("INSERT INTO gconfig (guildID,srole) VALUES (?, ?)", [msg.guild.id,`${srole}`]);
});
})
sql.get(`SELECT * FROM gconfig WHERE guildID ="${msg.guild.id}"`).then(row => {
if (!row) return msg.reply("No mod role is set");
msg.reply(`**${row.srole}** is now the mod role for this server`);
});
}
``` How come if run another time in a guild where its already been ran once it doesnt change the set srole
isnt sql.run(`UPDATE gconfig SET srole = ${srole} WHERE guildID = ${msg.guild.id}`); suppost to change it?
we are not ur coding helpers
Have you tried looking into using rethonk db
re 
ok
@earnest phoenix can you make me a bot?
no
lmao
Wow
@earnest phoenix can you make me one?
:O
people in this server are using your bot all day https://hey.gimme-blea.ch/49f5a27.png
good job
also the nickname 
lmao
@jagged plume I am on mobile not PC
get pc then
You think I have the money?
why not both
🤔
probably both
Ye wuzzah
what is a good method to obtain a bot's ping?
i have a timer that measures one message's time and then says that
@frail terrace are you using d.js
Oh then idk
I should probably update discord.net to 1.0 and see if there’s new methods
anyone know how to count reactions on a message
using a bot
https://i.imgur.com/pHE5KSP.png just from updating
guys
i sexually identify as a female
@jagged plume
i did this but it doesnt work
message.channel.send("[Click Me for TurtleBot!](http://discordapp.com/oauth2/authorize?client_id=361657857223163925&permissions=7863423&scope=bot)")
You cant mask normal chat
I think thats only able im embeds
yes, not normal chat
markdown works in normal messages too, to some degree
I don’t get why it’s not fully supported.
Using Website Name is only supported in embeds and the rest of the markdown works for normal chat
Using Website Name is only supported in embeds and the rest of the markdown works for normal chat
Urm discord rip
yea
???
It’s more than just links that doesn’t work.
its not that they dont work, its just that there is only some markdown
Sure.
But I don’t see why the Discord developers didn’t include that.
I mean
for headings, I understand that.
maybe you should work for Discord and change it
you arent a mod anymore 🤔
tbh, deal with it
I think the only reason all of that isn't actually included in discord is because it would just clutter the chat and make things a lot more complicated than it actually needs t obe
It's a chat application, not a Markdown messenger
Of course. But there are things like quotes and lists that wouldn’t really hurt anyone but could get quite handy.
They did implement formatted code, even with syntax highlighting. So why not that?
Seems unneccessary if you ask me
None of the given markdown commands Discord implements atm are really necessary.
you kinda just disproved that with your emphasis on really
Ronin are you okay to tell us why you left mod or nah?
… no I didn’t.
lmao okay
I just tried to emphasize that they are nice to have – and nothing more. As would the rest of Markdown be.
regardless, i do believe #development isn't for open debate 👀
if that's an issue why dont you complain directly to discord support, they take suggestions.
complaining here isn't giving you anyone nor discord any benefit
I know that they take suggestions, thank you.
👍
@karmic parcel it’s weird seeing your name green and not red
Lol

How would I make a random color geb
A) Guild = Server
B) Check the docs: I don't even know your library
Ask on the API Server
Does the guild increase if the bot is
Maybe they can help u
On many servers
Ye
lol create new bot/account?
What the heck did you do
😂
If don't know it then u shouldnt apply.for that role
@shrewd field If you dont even know what an endpoint is then you clearly havent been in this community long enought to be mod
@upbeat bronze what is the frontend made in?
mm yes alt ping
lul
That's wat I'm focusing on
Angular, jQuery. React. Vue
Didn't see any sense of React
Or angular
No React or Angular
electron
So my guess jQuery or Vue (not familiar with Vue Dom)
That doesn't answer it
What did you mean by your question then?
Semantic requires it
The JS part is wat in asking
Yes, it uses JS
Ugh
No Angular, No React, Yes jQuery
@bitter sundial
I'm asking if they used any front end libs or raw jQuery/js
The site uses jQuery
The existence of jquery doesn't mean much. Since semantic requires I believe
Unless u deved the site ...?
lolwat
jQuery
(not sarcasm)
jQuery
Hey
No
What is a shard
i hate oliy for using a bit of jquery
@shrewd field google it
otherwise no
Tonkku
No for ..?
When will it be checked
0 what

0 patience
If it's raw JS Dom maniplution I would get impressed. Site it good.
Is*
I am patient
patients
Actually
Lol my site has jquery even doe it's react 😂
Yes..
you're acting like you dont know
I do web development.
same
I'm proving the point that the existence of it doesn't prove that's wat the devs made it in. (The source snippit u did post did prove it however)
The site uses jQuery. What else do you want to know?
Yes, it uses jQuery for Semantic and it's custom scripts
Uses != Made in. Was wondering wat was developed in
Wait.
waiting
Not all 😂
"i hate oliy for using a bit of jquery"
Watever
Got my answer. No front end libs
How are you a web dev? 🤔
Semantic is the framework, which requires jQuery (lib)
Yes
I meant if they used react / Vue / angular one of those.
Idk wat it builds to
I did for react
10 hours + (Amount of bots before you in queue * 10 mins) + (Times asked to approve * 1 hour)
@earnest phoenix ^
I mean they export raw html js right...? But usually u can tell. React / angular export has certain tags
At least react and I think some angular. I mostly do React
Oh
And wasn't sure Vue did that same.
Yeah, no angular/react/vue
That's why I knew the site wasn't react
Just jQuery and semnatic is mostly it
How do i make a bot server count on "playing"?
and it's made with JS
🤷
I hate web dev
then quit.
This site actually uses Express which is a javascript library for web hosting
Yea
Yea
Express bae
Yup
Can someone help me getting the list of voters in java using Unirest
okhttp
Okay, and could you guide me a bit on how to do the get request
I'm quite new to rest apis
Ok
Thanks a lot
@inner jewel When I have the response object, how do I read all the returned objects?
ResponseBody#string() and then you need to parse the JSON
Thanks a lot man :)'
idk about discord4j or javacord, but on JDA you already have org.json on the classpath
Yeah with discord4j aswell
Last thing (I promise), how do I add 'onlyids' to the queryparams to the request, I knew how to do it with unirest, but can't find it on okhttp
nvm, got it
ooo i was sent here
what is the whole code
const Discord = require("discord.js")
const help = require("../help.json")
const settings = require("../settings.json")
module.exports.run = (client, message, args) => {
if (message.author.id == "205479482902052864") {
message.reply("You just shut down " + client.user.username)
console.log(client.user.username + " was just shutdown by " + message.author.username).then(process => {
process.exit(2000)
});
}
}
module.exports.help = {
name: "shutdown"
}
//this shuts down the bot, only the owner can do this!
using a command handler
ok

maybe make it exit first then make it send the message
it fine
it wont be cool like i thought
but i have it sent through console that someone shut down the bot
its also like a check cause only i can use the command rn
so if anyone else does it then im in trouble
cause i also have the eval command in here
const Discord = require('discord.js')
exports.run = (client, message, args) => {
let channel = member.guild.channels.find('name', 'suggestions');
let embed = new Discord.RichEmbed()
.setTitle('Suggest Command')
.setDescription('Thank you for your suggestion, I will add it if possible.')
.setColor('')
.addField('Suggestion', message.content);
channel.send(embed)
}
what did i fail at
xD
error message being wat?
@umbral pelican .setTitle('Bot-Invite')
^
TypeError: member.guild.channels.find(...).send(...).setTitle is not a function
at Object.exports.run (C:\Users\JBeda\Desktop\SpadeBot\events\message.js:6:6)
at Client.client.on.args (C:\Users\JBeda\Desktop\SpadeBot\index.js:14:53)
at emitOne (events.js:120:20)
at Client.emit (events.js:210:7)
at MessageCreateHandler.handle (C:\Users\JBeda\Desktop\SpadeBot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\JBeda\Desktop\SpadeBot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\JBeda\Desktop\SpadeBot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:330:35)
at WebSocketConnection.onMessage (C:\Users\JBeda\Desktop\SpadeBot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:293:17)
at WebSocket.onMessage (C:\Users\JBeda\Desktop\SpadeBot\node_modules\ws\lib\EventTarget.js:99:16)
at emitOne (events.js:115:13)
uh, you've got member. but member isn't defined anywhere
can i define it as guild.member
why not just change it to message.guild.channels.find.....
oh
@umbral pelican
what
k
JDA >>>>>> all
Java just ew
Custom doe is least controlling the ew to where u need it 😂
Need CPU ew. Lowlevel ew. Memory ew. Ur choice
I made a new high-level API. It's super easy to use!
what
lol
no
Oh don't ask about custom tokens or commands
Those are too low level
No one needs those
what r u on about
I don't even know.
you need to code events for all of those 
Nope
yes
That's too complicated
._.
XD
have you even tried using these before shitting on them
Without their command handlers
Eris doe I'm meaning to try
all lib command handlers are bad
They have command handlers??
yes djs has commando
I never used them
eris has eris something
Wrote my own lol from the start
ye same
public class MyAutoRegisteredCommand {
@Command(
name = "name",
description = "description",
usage = "usage",
permission = CommandPermission.SOMETHING,
category = CommandCategory.SOMETHING_ELSE
)
public static void whateverthemethodnameisthecommandhandlerdoesntgiveafuck(@Argument("channel") TextChannel channel) {
channel.sendMessage("Hello World").queue();
}
}```
:^)
and help gets auto generated based on that
Psh
Someday I'll finish my lib and not make it shit for everyone but me
And finish it's caching settings.
kek
why not just have it come with features to begin with
i don't see why you don't want a bot to come with features
U just want a mod bot. Download mod plugins.
We have bots that are specialized
Disnode bot just is the pluginable one
pluginable?
We make bots that are Disnode with preloaded plugins and disable downloading more
IE @timber jungle
If I wanted a mod bot just copy Disnode bot. Throw in mod plugins. Release.
minecraft forge but for discord bots
you do you, but i would prefer a bot with all features added in to begin with
yeah
way simpler and way harder to have exploits
@umbral pelican still saying error
I mean
Adding default features is literally drag and drop for me if I wish
I may add a disable thing but workkkk
Just drag and drop wat ever plugins I want into the global server folder and wala
That's how help and information commands work
{"op":0,"s":3,"t":"VOICE_STATE_UPDATE","d":{"self_deaf":false,"user_id":"182245310024777728","guild_id":"310856262235586570","deaf":false,"session_id":"5bdfc0f4071729a9489808a99224f7b2","mute":false,"suppress":false,"self_video":false,"self_mute":true,"channel_id":null}}```
self_video
And Casino

Plugins acrose all downloaded from our site cuz why not
^plugins add eight-ball
All u need bb
Not the most popular approach or most loved but it's was a fun challenge to code. And makes it unique
Plus makes adding new functionality quick.
Development is always about fun challenges
Can make a "normal" bot easily and non would be the wiser it was a plugin system running it
Hell that's the plan
For plugins like Cards Against humanity release it on our plugin repo. And drop it in own standalone bot too .
Makes popping out bots ez
Victoryforphil be poppin 😛
And makes hosting them uniform
still not a fan but some people might find it useful
For some guilds
For ur kind that's why we have dedicated bots
I mean one command doe
To add a plugin
"ur kind"
I already knew that
Just + CasinoPlugin - Pluginmanager
It's fun
Combing and rearranging
I may do that
Add mod plugins and make a mod bot
Just make different combos of bots
Like a nornie bot with the fun plugins
Music bot
Mod bot
Like war casino and cah are gonna do just not as focussed around one plugin
Hm
@jagged plume thx for the idea
-bots
@timber jungle
@trail wing
Is about to grow.
thanks for what idea
here is my start code, this is in my index
hey guys i get an error await is reserved
show us your logs
logs
error logs
Anybody got server count not sharded for node.js???
can you show me the function
should i show the code
thats what i mean
putting async before message => { should do the trick if my memory is working right
ok
also
You can't have await without async
unexpected identifier
What node v
node v
sry try async (message) => {
Node version
8.5.0
Replace
client.on("message", async (message) => {
1 sec
shouldn't matter either way
ok
I believe it does
still same error
i believe it doesn't
How did you write it
write async (message) and resend us a screenshot of your code
I wanna see how you wrote it noe
that ken has
Now
right, what happens if you remove async AND await before kicking the user
remove the } i circled earlier
right
first of all and most of all
you dont have the variable args
there is no args in your message event
int 3.8
lel
I dont have discord on my PC
It dont work
wut
lol
School pc?
It just say 'Could not run app check with the developer to get the version'
And no its my personal PC
google stuff pls
cc @earnest phoenix had the same issue
Cuz you’re blind
Yes yes we are
Smh
👀
oh
ikr
https://i.imgur.com/mNSNH7r.png ???????
i don't get this at all
it's legit the exact same stuff
nvm fixed it
apparently the method name was invalid oops
Help I can't vc bc I'm using safari can yall change it so I can use safari
lol
Plz I need help
Wut 
@tepid dune I know how to fix it
Plz help if u know how
could someone help me
my embed is fine on mobile but messed up on PC
It's part of the mobile for discord, you can't control it
and will discord patch it soon? do u think?
You would have to ask them
thanks 4 your help
Np
It's a unsupported browser
It happends, download the discord app or try a diffrent browser
I'm happy
288817163039670273
oop
const request = require('snekfetch');
exports.run = async (client, message, args) => {
const response = await request('https://random.dog/woof.json', (e,r,b) => {
var imageURL = JSON.parse(b).url
var embed = new Discord.RichEmbed()
.setImage(imageURL)
.setTitle('Random Dog')
message.channel.send({embed})
})}
i need help
:2
how can i catch a mission permissions error
missing
???
does anyone have an idea of why my bot won't work in this server now?
it works in my server
Hey @graceful hedge at least you can embed -_- when u try it just crashes my PC
You're not embedding right
I cant
Embed crashes my PC
Show us the code
Talk is cheap, show me the code
When i put it in it will always so 'Unexpected token' and when its fixed... THE WHOLE CODE IS GONE
?
show me the code
How do i make my bot log a message in console when someone executed a command
Thats like basic stuff ;-;
k
How would I make a cooldown?
I have ${member.user} as a leave message mention how do i made it say the name no @ mention it???
@earnest phoenix How about you read the docs
xD
@earnest phoenix ${member.user.tag}
SpOoNfEeDeR
how could i post my server count to the website in python?
@frail terrace did you update your library?
this server has categories
all libs needed an update else bots wouldn't work in guilds with categories
depending on the lib they might ^
well i know most of them do
yeah eris lib needs update otherwise it crashes when you delete a catagory
some bots crash, others ignore the guild
I think JDA just threw 8 billion errors in another thread for me
and Discordgo hasn't been updated in a bit and it worked fine for me
.NET wouldn't do anything in guilds with categories most of the time
.NET hasn't been updated yet .w.
mmm
-bots abbyclaw100
@gray vine
-botinfo @gray vine
ah .NET
OH LMAO
@surreal peak yes, I did
It’s not the latest discord.net because I couldn’t resolve this one error with conflicting assembly references
two different assembly versions of the same thing were referenced by discord.net and discord.net.commands
wow the update worked this time
thank you @surreal peak
😄
np ^^
what library
js
@shrewd field then define it
define your args