#development
1 messages ยท Page 339 of 1
You have !
I mean yes
take a look at it
Yeah if its not me

That means it's not
no, if its not not you
it wont do anything
O wait

no
if its YOU
it'll return
"f(message.author.id !== "297433416998191127")"
now begone
like I said
Sorry ๐ฆ
Error 404 brain not found
Ok
and you should never say happy now to people trying to help you
unless you want us to tell you to fuck off next time you post bad code
Sorry
is it a boolean operator?
(keep in mind I have never in my life touched JS and would rather kill myself than try)
@gaunt dune That just returns syntax error
๐ค
ERROR SyntaxError: Unexpected string
When I use l.eval "test"
@gaunt dune Are you here? 
ok bie
@rose tangle != means does not equal
how can in add my bot to this server ๐
no shit?
guys
I have no experience with d.py's rewrite
so
would all commands be in
async def on_message(self, message):
as the repo's example bot shows
@hushed oyster have you considered asking in discord api
forgot about it
you cant
so this is the only server it works on
Luca is a custom bot made for this guild only
awe
trust me, I've tried lmao
awwwwwwwwwwwwwwwww
Although some bots can use the API to get botinfo
are there any bots that do the same thing
Yes i have one but the commands are broken right now im already fixing it
Who here uses Eris?
oh
@delicate zephyr 
So, heres my problem lol
I have the connection stored in server.dispatcher in my server object
but when I do server.dispatcher.end() to skip a song it stops working after the first one, any ideas how I can fix this @slow swan
.end doesn't exist?
lolkekgoodmem
Eris, a NodeJS Discord library
there is no '.end'
you didn't say that
Im storing the event in the object too
but its then storing the functions in an array
are you doing .on or .once
Which one works better
Then how would I skip the song?
.stopPlaying()
.stopPlaying().then(//start next)
no
read the docs
.stopPlaying() doesn't return anything (doesn't return a promise in your case)
yes
yes
๐๐ผ

Thanks
my skip command is litterally .stopPlaying()
Im getting used to it
Eris I mean
Its taken about 8 hours to move over
and im not even done
here if you need me
just allow me to .then to shift the queue when it starts playing xD
it starts playing instantly
Im trying to get the queue to shift properly
but its failing
horribly
got it ๐๐ผ
putting the shift in the .once("end") bad idea
xD
I just use a very easy object system
I wont move to databases til I build my own server
Literally
thats it
and then I use them globally

@slow swan whats the Eris version of bulkDelete?
Eris, a NodeJS Discord library
var 
stfu ok, I cba to use let, they basically do the same thing
stop being a triggered person
ok
they dont
but they work for me
I aint gonna change a habbit
@slow swan ```
var messages = message.channel.getMessages(message.channel.id, number);
bot.deleteMessages(message.channel.id, messages)
im getting bad request lmao
which bot name is better? adProd or AdProd or adprod
.editStatus
learn to a b s t r a c t
AdProd @earnest phoenix
wait for it to join the voice channel
oh
before you play

hmmm
maybe add like a half a second delay between songs?
No
No
I mean
if you wanna pay me money on patreon sure
but the answer is pay me or no
lmao
ol
Can somebody send me the commands of Rem? i have a little problem with that bot
-botinfo @slow laurel
!r.help probably @orchid horizonrBroklins#6612
left
help
How do you get a id from a mention? Eris / Javascript
mmm, isn't it just Message.mentions[0].id 
var userIdOnly = userId.replace(/[^0-9]/, '');```
This doesn't work, what's wrong?
@umbral pelican Thanks btw
msg.mentions[0] is the User object of the first mention (if there is a mention)
msg.mentions[0].id should just be the id, no need to use regex
.
Can someone help me with my eval command in discord.js?
thonk
Is that a yes?
no ๐
Ok ๐ข
heh
hi
@quiet bobcat follow the Idiot's Guide tutorial on discord.js
hint: eval()
hint: learn js 
^
Hmm
@rich kiln Im trying to 
codecademy is your friend
Woo
@peak tendon I hate Superior Servers
I also hate Hyplex
I like servers with around ~15 players, that is the best time
Hyplex? 
a Gmod server
big game servers are a mess
just edit & save your bot page and it will update
How do I check the name of the role? Eris / Javascript
role.name('id')
Going to check that
So it's correct?
if you have the role already
I already have the id's yes
it would just be var roleName = role.name;
var in 2017
it was a lazy example
yeah if you have the role defined somewhere else
userRoles.forEach(function(userRoles) {
bot.createMessage(msg.channel.id, `${userRoles} \ ${role.get(userRoles).name}`)
});```
The role.name part isn't working
1 sec
role.get isn't anything
var userRoles = msg.member.roles;
userRoles.forEach(function(index) {
bot.createMessage(msg.channel.id, `${userRoles} \ ${userRoles[index].name}`)
});
try that
okay
that is probably terribly wrong
userRoles can't be stringified properly either
pretty sure it's something along the lines of index.name for the role name
what are you trying to do? List all roles a user has?
then msg.channel.createMessage(msg.member.roles.map(r => r.name).join('\n'))
and style it however you want
member.roles returns an array of role ID's
so you would need to do guild.roles.get(array[index]).properities
wait, does it
Yes it does
let me write something up real quick
cri
then msg.channel.createMessage(msg.member.roles.map(r => msg.guild.get(r).name).join('\n'))
msg.channel.guild *
umm
var userRoles = msg.member.roles;
var messageToSend = "";
for(var i=0;i<userRoles.length;i++){
let role = msg.guild.roles.get(userRoles[i]);
messageToSend += `${role.id} // ${role.name}\n`;
}
msg.channel.send(messageToSend);
that makes sense yeah?
msg.channel.guild instead of bot.createMessage?
no
check my example now LOL
but that's dumb
well that's how i'd do it
why append it to a string and then send the string if you can just join an array
smh
because this is how i was taught to do it and its the easiest shitcode i can shit out
yeet
isn't working..
yeah so I'd do something like This
msg.channel.createMessage(msg.member.roles.map(r => msg.channel.guild.roles.get(r).name).join('\n'))
Isn't there a way to check if there this item inside the array?
That piece of code is working.
I don't understand what you mean
Like
Check every item, and see if there's a item called "Settings"
with items I mean roles
a role name called Settings you mean?
ohh
then you can just check for ```js
msg.member.roles
.map(r => msg.channel.guild.roles.get(r))
.filter(r => r.name === 'Settings')[0]
That would return undefined it if exists
And the role if it exists
You can do it like
let
Const or let
const possibleRole = msg.member.roles
.map(r => msg.channel.guild.roles.get(r))
.filter(r => r.name === 'Settings')[0]
if (possibleRole) {
// Role exists
} else {
// role doesn't exist
}
and yeah use const/let
okay
const is like the name says constant and cant be redefined let can be redefined
Okay, thank you for helping me.
how do i make a say command? This error keeps coming up
same error
ok
try standing in your fridge
it's array.join(" ") where array is args
oof
args don't work
how do i do that
oh
wait
i know
const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase(); like this?
var args = message.content.split(" ");
THX'
Good ideaaaaa
I do @supple shale
y this not working?
request({
"method": "POST",
"url": "https://discordbots.org/api/bots/ay/stats",
"headers": {
"Authorization": "ayyyyy"
},
"body": JSON.stringify({
"server_count": client.guilds.size
})
}, function(){});
{"error":"Required parameter server_count or shards missing"}
!
its form not body
- Use snekfetch because its easier
also no need to stringify
y snekfetch
Easy
@sinful meadow dont recommend bullshit
Mate
Snekfetch isnt bullshit
Using snekfetch has alot of things that are usefull
As in
Not installing another fucking npm that something else can do
And is twice as easy
javascript - for every type of lib there are at least 10 different ones
no request is default.
lol
But is it really now
snekfetch is not default, what are you on \๐ค
Weird for me it is
Well why not use snekfetch tho
I am not saying not to use, i am saying that he could be using Eris or perhaps Discordie, and i am saying that snekfetch uses the same API as superagent
@rich kiln No, it uses body, not form
@earnest phoenix Make sure you are proving Content-Type in the headers list
and set it to application/json
@earnest phoenix body didnt worked for me
I'm new to here. May I know what languages require to create a bot? Java? C++?
Any
any
Most languages have API wrappers
most backend devs arent fucking furrys
I got question. Possible to create a private bot, where public can't find when search the name?
import os
from google.cloud import firestore
# Project ID is determined by the GCLOUD_PROJECT environment variable, so we set it
os.environ["GCLOUD_PROJECT"] = "nodal-algebra-179323"
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = '/home/kot/projects/database-discord-manage/creds.json'
db = firestore.Client()
def getValue(doc_ref, removalWord, attr, attrSplit):
'''
Gets value from firestore.
'''
doc = doc_ref.get()
removed = None
endresults = []
for attribute in attr:
print(attribute)
results = doc.to_dict()[attribute].split(attrSplit)
if removalWord in results:
results.remove(removalWord)
removed=True
if removed != None:
results.append(removed)
endresults.append(results)
print(results)
return endresults
# ''' Example
print(getValue(
doc_ref=db.collection(u'adprod').document(u'config'),
removalWord='@mention',
attr=['token', 'prefixes'],
attrSplit=' | ')
)
# '''
``` help
it only returns the 'token'
but it should return both token and prefixes as shown in attr=['token', 'prefixes'],
@abstract mango you be python right?
:C
I don't have experience with firestore though
bc I don't use dbs
console.log(GuildMember.guild.id)
});```
Why isn't this working? Using javascript / Eris
ill check for you :}
There is something wrong with GuildMember, but I don't know what.
What error are you getting?
ok 1 sec
i believe guildMemberAdd emits two variables
try (guild, member) =>{
and grab guild.id or member.guild.id
ye
Yes, that's working
how can I make the prefix case insensitive?
I'm using CommandClient, Eris
im not sure with that
but you could do something like .toLowerCase();
to force an incoming message to lowercase first
umm
cant really do that with a command client
Or I make a array
heii
Hallo
Someone know a good npm package for cpu usage and shit?
Question: if a music bot leaves a voice vhnael due to inactivity they disconnect but what if I made a Afk bot that will be in the same voice channel, will the music read the afk bot and still play music or will disconnect eventually?
B: are Afk voice channel bots allowed?
@tacit hatch js ${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)}
I use that for memory. Idk for cpu, there is a ton if you search
guys, how do you load commands in bots? for example: are all commands written inside the bot file or all commands are in a folder?
talking to who uses js
Does anyone know y i get error EACESS when i try to use music commands?
I have opusscript & fftmpeg
@earnest phoenix no permission to read something
@tawny geode make a command loader
Hi
hi
@earnest phoenix im hostin it off android, does that mean the os is shit? Cuz my local music cmds worked on my pc (windows)
um
don't host on android
there is fix
Knew it, will github work or that one wilm return eacess too?
github doesn't host node.js lol
Heroku
Does anyone have a tool that you can use to get the correct possition on an image? I'm using Jimp and i really need a tool so i dont have to restart my bot every second. ๐
you will die from laughter if you see my paypal balance... believe me, you dont.
Tbf @earnest phoenix some of use can neither afford one or buy it 
@weak parrot tons of free VPSes out there, and you can probably sell code for a bot
find someone who wants a custom bot, make it for them and use the money for a VPS ๐คท
or you can literally pick up pennies in the street, VPSes are hella cheap nowadays
Well I don't need one anyway xD. Just saying some of us can't because we don't have access to bank account(s) in the first place
you can get a VPS using prepaid cards too, from a physical store with cash money
Or you can try getting money from mowing a lawn or something
One lawn could equal 6 months of a VPS
Depends on who you get the money from xD
if you're old enough to use Discord I'd like to assume you're old enough to have $5 somewhere and you can get a prepaid card
Well yeah but like I said it's not me that needs it just pointing out some people might
How to make a bot respond to a message if it only contains numbers?
regex?
you could do if (parseInt(msg.content))
(\d)+
discord.js btw
example @shy rose ?
ok so dont know your "message strucutre" but
if("1234".match(/(\d)+/)){
//do stuff
}
where 1234 if you message thing
parseInt is way faster though
can cause issues though if you parsed a snowflake
he's not parsing anything, he just needs to see if it's numbers
no, worst case it will round it off to 53b precision which is irrelevant for this use case
cause that will still parse it to an integer only reason it passes statment is cause its a defined value
ok nope just tested it your right
@lethal sun if (!isNaN(Number(msg.content))) {
// all numbers
} else {
// not all numbers
}
mobile sorry
@earnest phoenix why
parseInt is faster and way less messy
and you can drop the isNaN completely
@uncut slate he wants to check if the whole message is numbers
parseInt just checks the first part
parseInt("25"); // true
parseInt("25 yes no"); // true
yeah
should still be able to drop the isNaN though
Doubt you can drop the isNaN because NaN is true
Iirc
Lemme check
never mind
you're right
the joys of Ja\๐ ฑascript
My bot is a failure. I cannot fix the problems on it. ๐ฆ discord.js (if a command is failed the bot stops working)
learn javascript then 
"if a command is failed the bot stops working" get a linter 
Remove the command that let your bot crash, problem fixed.
lol
For life
if its a modular bot it'll be the same as removing the command lol
haha
I mean I have songrequests that works only with links and when someone doesnt use link and then another command comes the bot crashes
first check if the user gives a like.
Then check if someone doesnt input a link
or
o
lel
use another module that checks links & ids
How can I fix this?
Check if there a link.
in noobish language we would do
if(msg.content.toLowerCase().startsWith("https://www.youtube.com/") {
//Add shit here
}
if user doesnt put link
send a message what a noob pls use a link
Written in english
Good lang
oh no boi
typo
discord.en should be a thing 
video tutorials for libs are 99% of the time wrong
yeah
except anidiot's guide
also evie and crawl
@earnest phoenix
https://www.google.com
https://discord.js.org/#/
https://www.codecademy.com/
https://stackoverflow.com/
there you go
Got dammit I cannot learn code by just watching the things
google.com.bananaland
Google.moe
ReferenceError: 'Friends' is not defined
hu i get that error to lemme know when you solve it
Oh solved.
@neon pasture https://mantaro.ratelimited.today/6d1d12.png
webscale programming
kappa
:^)
console.log(friends) //null``` ๐ญ @shy rose
has anyone ever used yandex in their bot?
Lol
ye it is
I want to add translation to my bot but I just can't get it to work
Whatever I do it returns the api docs url
Wonder if Discordia / Luvit is doing something wrong?
mfw saw this from earlier https://oh-no-its.theworstme.me/16360b.png
typos are nice
LMAO
discpatcher
diskpatcher
same
oof
disccpatcher
๐ค
?
hey
@uneven sonnet
hi
<html>
<head>
<style>
body{ ... styles }
.class{ ... styles }
#id{ ... styles }
</style>
</head>
<body>
<div class="class"> ... content </div>
<div id="id"> ... content </div>
</body>
</html>
that would be
index.html
Naga
i know how html works
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}
h2 {
font-family: Lobster, Monospace;
}
p {
font-size: 16px;
font-family: Monospace;
}
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}
.smaller-image {
width: 100px;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<p>Click here for <a href="#">cat photos</a>.</p>
<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back. " src="https://bit.ly/fcc-relaxing-cat"></a>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
this is where you go and learn how to fucking code
Ken
I know html
and
some
css
thats it
i suck
i cant learn anyhting
I dont know where to begin

go have a look at my code on http://somethin.ga/
nice ltt pic
just go into inspect and check out my code, you can get some idea there with my stuff
yano
For a square/block text you do
why didnt you just say that, wow
Fucking internet
Kek
hold shift?
``` nice ```
@weak parrot <3
Np
Ken is vri gay
banned
?
fucc u
@earnest phoenix gay 4k
with ur gey 4k
how do u make these
that was when i was a noob @ code, ok
yes
yes i am aware that pictures do not work
to make websites?
ye
a couple years
i did it cos i think its fun
sorry, all i saw right now was
"do you want to make a website for me?"
windows weeb version..when?
@bitter sundial is this a glitch or? http://prntscr.com/h8b6e2
the top bar should be fully green
for discord.js should i use node-opus or opusscript
thats probably something in your own css
ok thanks
Can someone help me?
Mibro went suddenly down.
When we tried to restart the bot couldnt log in.
It says Invalid token. But its 100% not the token. We changed the token and also specified the new one but it still doesnt work.
Error: 4004
Invalid Token
We already did that
Make sure you're getting Token and not Secret
You definetly have an invalid token
or you're passing it wrong
could be passing undefined accidentally, or you have quotes in it
and your lib might not be checking for String
I do
what
Im just using the bot token
4004 means your token is incorrect
You cant believe how often we tried with new tokens
make sure there are no spaces at the beginning/end
check your email
@silver ore maybe your token got reset
might have been a token reset
I recommend checking your application page to see if your token changed
can you enlarge that SS a bit
where?
whats wrong?
ok wait
Double semicolon at the end, how can that not give an error?
It's javascript...that doesn't care about double simicolon
the problem is not code related.... It's something wrong with the tokens
it works with other tokens
it doesn't. but that's not the problem
Javascript doesn't care about double simicolon
chrome, opera, firefox and edge disagree on that one
^ that's weird since node uses V8 as their engine but so does chrome
Chrome screams at me for no or double semicolons
They could have modified it slightly
chrome screams are you for no semicolons?
Hi
@rose tangle please disable your bot ( @still vector )'s logging in #265156322012561408 , either disable it or move its log messages to #265156361791209475 , until you address this, your bot ( @still vector ) will remain muted (see case 1378)
lol rip
lol
their
xD
fuck spoon with his grammer corrections
fuck me with my lonelyness badum chzz
can confirm spoon is fuckable
best image
https://www.botbreh.cf/images/ugbzk.png
I just got this error, can someone please help me? https://scythe.xyz/images/44951.png
Sounds like a problem with Eris itself
well its causing my bot to restart
how do i make it so it says i need to specify a city to function this command
const Discord = require("discord.js");
const weather = require('weather-js');
exports.run = (client, message, args) => {
message.delete()
weather.find({search: args.join(" "), degreeType: 'F'}, function(err, result) {
if (err) message.channel.send(err);
if (args.length < 1) {
message.channel.send('You need to specify a location!');
}
var current = result[0].current;
var location = result[0].location;
const embed = new Discord.RichEmbed()
.setDescription(`**${current.skytext}**`)
.setAuthor(`Weather for ${current.observationpoint}`)
.setThumbnail(current.imageUrl)
.setColor(Math.round((Math.random() + 1) * 99999))
.addField('Timezone',`UTC${location.timezone}`, true)
.addField('Degree Type',location.degreetype, true)
.addField('Temperature',`${current.temperature} Degrees`, true)
.addField('Feels Like', `${current.feelslike} Degrees`, true)
.addField('Winds',current.winddisplay, true)
.addField('Humidity', `${current.humidity}%`, true)
message.channel.send({embed});
})
}
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ['p'],
permLevel: 0
};
exports.help = {
name: 'weather',
description: 'Shows the weather',
usage: 'weather'
}
You might need to catch disconnects
oh ok
I'm not sure because I don't like dealing with audio, but that's what I'll do
to test
i did the code but it doesnt work
oh lol
should I contact abal?
Probably would kill you for a simple error that I've missrd
why tho
ยฏ_(ใ)_/ยฏ
@earnest phoenix check args first before requesting weather api
if args less than 1
fuck off
else
weather stuff
before the weather
?
because atm
Your code tries to find the weather for a location before you check if it's empty
7coil I got this
return message.channel.send("Invalid Args");
} else {
//weather stuff
}```
@earnest phoenix
I never use return, like at all
ahhh
it's all else if else if else if
It's not cancer it's brilliance
Its cancer
only if my fucking intellij worked for a FUCKING phone to TEST a fucking app im making
reee
Lol
im fucking dumb
I need dev mode on
goddamnit
GODDAMNIT
https://www.botbreh.cf/images/aboj1.png
this is developement so it makes sense
A command that requires upvoting?
ew
I highly frown on those
^
However if you would like to continue
Ping the discordbots.org api
Grab who has upvotes
Upcoted
Upvoted
And then compare to message author id
there a 2 types of bots those that everyone likes and has a few upvotes
and those that people less like and have high upvotes
Your bot will be marked as terrible in high volume guilds
do you get api limited?
0-0
especially for smaller bots
no idea
Check API docs
Hi
have you tried googling the error
try changing it and just putting a 1?
you're trying to assign a variable inside a function :]
^
ops
Btw nice token leak ๐
xd
also try not to expose your bots token
you managed to keep it blurry and uncopyable
regardless it shouldn't be shown to anyone besides yourself
nut wurks :/
have you read the documentation
Also for C# Gidor you can encase variables in a string with https://weeb.hacked-your.webcam/67592d2.png @next wedge
@next wedge
yes?
Read my comment and the pic
hoi
What do ya need
nothing.
It responds undefined @earnest phoenix
oh lol
lol
.
What with? :]
Hmm?
But it isnt working
Show code
Like at all
var command = "---ban @ebon shadow reason";
var args = command.split(" ");
var mention = args[1];
client.on("message", (message) => {
if (message.content.startsWith('---ban')) {
if (message.guild) {
message.mentions.members.filter(member => member.id !== message.client.user.id).forEach(member => member.ban());
} else {
message.reply('You need to be in a guild to do that!');
}
console.log(`Command run: Ban in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
}
});
Theres a bunch of useless vars at the top
message.mentions.first().ban()
Wait
you only need to ban one user?
Yes
just get the first mention
The one you mention
which will be the only mention
Oh!
so do .first()
also checking if a user is in a guild before banning is pointless
no
message.mentions.first().ban();
who did you try it on
what error shows up?
ยฏ_(ใ)_/ยฏ
?
did you test it on yourself
Why would I do that
I'm just ruling out novice mistakes
are you sure the bot has perms + has a higher tole
Okay
role(
Yes
role****
Oh wait hold on
I know whats wrong
Nvm
Imma try this
node .
Whoops
Okay nvm still doesnt work
I have a working mention code for getting a user's tag
message.mentions.members.first().user.tag
Alright so would I replace user with members?
Or just get rid of that altogether