#development
1 messages · Page 336 of 1
lmao
first of fucking all, i do know how to code, if i didn't then i wouldn't be a fucking bot dev
i am asking for a replacement for message.content.startsWith or someshit like that because it wasn't working
no errors, the code is right, but it ain't working
You're assigning message.content not comparing 
FINALLY
well first of fucking all
message.content is not a variable
yes
second of all
if you want to test something its == or ===
not =
if you knew "code" you'd know this ;]
guess what? i copied your statement and see if it actually works
yes
well, i dont need that shit now
that was pseudo code
since i forgot that i have the code in my docs
anyways, any of you shits know jimp?
yeah i do :]
aight
im quite new to it
yes but guess what, since you know how to code you can try to get stuff yourself
google doesn't work
also a fair amount of explainded documentation here https://www.npmjs.com/package/jimp
i can
you can't
obviously
let me finish can you? bitch
well, nevermind, this "community" is fucking toxic, so im gonna go change to another server, "less-toxic"
the thing is i love these reaterds who call themelf "bot devs" and say stuff like "i know how to code" but are retarded af and dont know how to use google or any docs which easy to understand
Yeah xD
I mean he wouldn't need to ask if he researched up on the documentation 👀
ikr
Tbh half the time i answer questions here i go straight to the docs to check my answers and confirm LOL
Tbh

LOL, that kid is so toxic.
Yup
wouldnt it be sendfile not sendmessage did you check the docs?
Yes
It seems to be correct unless its not suppose to be file.file?
Fs
yeah, readfile or something like that
okay
@median lintel WE NEED YOUR BOT THIS IS THE ONE TIME ITS NEEDED
what are pros and cons of vps
Hosting for 24/7 (with exception of bot error)
🤦
lol
Hmm
Ur face is an error
how to add a role to a user with discord.js?
i been trying to do it but i always get it wrong
what have you been trying
i been tryling like
(message.GuildMember.addRole(members, rip)
rip is for the reason
Wait you can set a reason for adding roles 
you can?
@earnest phoenix first get the member property from the message
then find the correct method to add the role
then look at the arguments for it
@prime cliff
.addRole(rolereason)
Adds a single role to the member.
PARAMETER TYPE OPTIONAL DEFAULT DESCRIPTION
role Role Snowflake
The role or ID of the role to add
reason string none
Reason for adding the role
Returns: Promise<GuildMember>
Lol
it was even in the changelog
maybe the function is guild.member.addRole("members") you think?
to moderation actions which would asume kick and ban for most people
But diddnt know about adding roles xD
a) a guild has no relation to a single member (except the owner)
b) no lib would handle getting role ids by name internally
I mean they could implement that but eh
discord bot maker != too noob friendly
shit dont think you can add one more function with this
i have learned how to code.
you clearly haven't
also
guild not defined
I find that hard to believe since you are asking for help with 'guild is not defined'
fine ill fix it myself.
im not asking for that
im asking how to add a role to a user.
but anyways like i said fine ill fix it myself.
Do you even check to see if the role is correct 
checked 5 times 👀
I didn't know "members" was a correct role id
also no idea how to get a role id
@earnest phoenix If you want to get a role by name you would need to filter through all the roles untill it matches the name with case sensitive
i think discord.js allows for role.find('name', 'members')
prob.
Either way works :/
i wanna kys
:^)
i just giveup on the role command
im mostly better at other functions
@earnest phoenix man
it's need to be a string
So its not (message.GuildMember.addRole(members, rip)
but (message.GuildMember.addRole(members, 'rip')
Is it possible to install FFmpeg to Heroku?
dont use heroku please
No we need more people using it 

I get where he's coming from though

🤔
about sharding
How does it work? Especially discord.py
I just cannot really grasp the concept
Is it really just as easy as setting your shard id and amount of shards and spawning processes for each shard?
shit 2017-10-30 21:42:35,907 :: INFO :: DBotsOrg returned 400 for {"server_count": 1288}
try just the number lol
He needs the server_count
i didnt needed to put the obj 
@hushed pendant You need to use POST method not GET
Why you dont show us your code lol
payload = json.dumps({
'server_count': len(self.bot.servers)
})
## DISCORD BOTS ##
headers = {
'authorization': self.bot.bots_key,
'content-type' : 'application/json'
}
url = '{0}/bots/{1.user.id}/stats'.format(DISCORD_BOTS_API, self.bot)
async with self.session.post(url, data=payload, headers=headers) as resp:
commons.logger.info('DBots statistics returned {0.status} for {1}'.format(resp, payload))
## DISCORS BOTS ORG ##
headers = {'Authorization': self.bot.discord_bots_org_key}
url = '{0}/bots/{1.user.id}/stats'.format(DISCORD_BOTS_ORG_API, self.bot)
async with self.session.post(url, data=payload, headers=headers) as resp:
commons.logger.info('DBotsOrg returned {0.status} for {1}'.format(resp, payload))
First part works right
lol
It was content type
2017-10-30 21:51:56,114 :: INFO :: DBotsOrg returned 200 for {"server_count": 1289}
😃
👌
Thanks ^^
What's wrong with that ?
i tought it were fake counting sorry
Yea this is fake @zealous stag
so
the way I get a user's ID
is by mentioning them and putting a \ at the front
but is the "!" part of the ID?
no
thanks
but u should get a vps 
wrong poof sorry
lol
@lethal sun < It IS possible with buildpacks
but get a vps pls 
@hushed pendant your duck hunt will never be as good as the one i made when i was 7 https://scratch.mit.edu/projects/22849844/
Make games, stories and interactive art with Scratch. (scratch.mit.edu)
wait no this is the first version https://scratch.mit.edu/projects/11079891/
Make games, stories and interactive art with Scratch. (scratch.mit.edu)
wow, that game is 7 years old
I get a syntax error with this code in bot.py:
```from cogs.settings import Settings```
Here is all of the code in cogs.settings:
from discord.ext import commands
class Settings:
def __init__(self):
self.dsettings = {
"OWNERS": ['319503910895222784', '304775824182083585',
'350285525195816970', '201745963394531328'],
"MODS": ['242364991511068673', '350820580578033666']
}```
and here are my files: https://i.stack.imgur.com/YcWUd.png
bad indentation
Hi
Henlo, do you need help with something?
Whatcha doin in #development ? ;]
Wondering why you're #general talking in #development ;]
lol, dev rank role is from when you add a bot
^
i can't add a bot
https://discordapp.com/oauth2/authorize?client_id=371389069764067328&scope=bot&permissions=3533888 <-
someone do it for me then..
xD
That's not how you add a bot to Discordbots
then tell me how.
[1]. Go to https://discordbots.org/
[2]. Login with Discord
[3]. Click 'Add Bot'
[4]. Fill out form details
[5]. Wait patiently for acceptance
Mk
Your invite URL goes here, FYI
http://is-no.fun/88657.png
please note: it can take a while (2-3 weeks to finite amout of time)
(If you are nice it'll be shorter)
You are in the wrong channel or you are gonna ask a silly question i guess
I have an idea for a bot, maybe it allready exist, don´t know
Wow 
yes want to ask 😄
Just develop a bot with your ideas it dosent really matter :/ what is it going to be?
Yea i already knew that with the no pfp
We offend need new names and slogans
You should probably learn about Discord first before making a bot unless you actually know how to learn yourself
I need a bot that can scrape or save names and then when the list is called on. People can vote
well thought maybe this bot already exist
okay maybe I should read rules and info first! I might have misunderstood the meaning with this slack channel
sorry
slack channel 

This channel is for bot development so yes you are right
so like Discord better
Anyone got any ideas on how to search on youtube with my bot?
Do you know any programming languages?
Like for music
Did you understand my question ? sorry English is not my first language
Ehm yes
Iknow a few
Few 👀
but never messed with bots on Discord
Lol
My first project is a bot xd
ytdl-core and simple-youtube-api @quiet bobcat
Simple youtube api?
notice please I edited
Its a module
How do I use it?
Google it
I got ytdl
There are some in-depth music tutorials
Sorry if I'm bad. My first time coding xd
I cant explain it tbh lol
Ok xd
If its your first time you should not be coding a music bot its for people with more experience
You should learn about the lib you are using first
I did the samething tbh
Same
Which language jonasjac?
JS
not even a language lol
Ah that has pretty good docs so it should be simple to do basic things
Think you guys are dicks tbh
What
I will make that bot myself thanks anyway
I think I'm a dick too
Wtf

How are we the dicks

Where did this context come from about dicks
Idk
idk
neither was i
It was a joke
^
Im pretty sure you have to generate ur own google key
ok no problem my bad
On google dev?
Yeah
Yes
But how xd
v3 or?
well can you atleast guide me? some staryer toturial ? I will make the but after ... just need to know the basics
I can find you a tutorial
Tutorial that would fit for a programmer?
But i thought you already said you knew some programming languages?
then idk
thanks
What language are you coding in Az
I have a computer Science degree .. never messed with Discord bots though!
Nice language 
But I´m very eager to play around with it! since I have some ideas
But what language
^
Well a great starter programming language is javascript.
It's easy to understand and great to start off with.
It is somewhat a web-based script but is now server-side thanks to
https://nodejs.org/en/
For a simple Discord bot wrapper to go with Node.JS
You could use the famous Discord.JS
Found here: https://discord.js.org/
Javascript tutorials and other helpful stuff can be found at the official javascript documentation
Here: https://developer.mozilla.org/en-US/docs/Web/JavaScript
JavaScript (JS) is a lightweight interpreted or JIT-compiled programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it, such as node.js, Apache CouchDB and Adobe Acrobat. JavaScript is a prototype-based, multi-paradigm, dynamic language, supporting object-oriented, imperative, and declarative (e.g. functional programming) styles. Read more about JavaScript.
Java , JS , C# , python ! php scripting
Wew
And the discord.js lib :^)
a youtube video about Discord.JS
https://www.youtube.com/watch?v=024upsEuHaU
I'll be explaining how to get started with creating your own Discord bot with discord.js. Install node.js before you watch this, obviously. This is meant as ...
html and css and js php! Idon´t really count them as programming languages lol
thanks guys
appreciate the help
👍
Sorry if I was rude, I misunderstood
Javascript, here, is widely used in Discord Bot Development
long version 👀
Great thanks
Its more descriptive 
cool ^^
And might be better for you, since ur new to Discord
Javascript, here, is widely used in Discord Bot DevelopmentI wish it was used less 
Yay I got an youtube API now
well it´s a very simple bot I need! but yet very useful in all areas gaming , crypto ya you name it
https://weeb.hacked-your.webcam/f57088f.png You need to be no,
Lol
Oh I´m slow! did not get that 😃
@thorny hinge Is there a way to make a bot play a game without having to type a command?
With reactions?
cheating lol
@prime cliff ?
Certain bots use reactions to do stuff
I want it to say Playing .help | IN BETA
But now I have to write a command for it
Is there a way to not make me do that?
I have it
But I need to write a command to activate it
otherwise it doesnt say playing...
You can do it on startup
discord.js docs are easy to understand after reading them for a few days
on.ready{
<client>.user.setPresence()
}```
That's one way to do it
Ok
I am using this
bot.user.setPresence({ status: 'online', game: { name: '.help | IN BETA' } });
👌
looks good
so I do that but on.ready before it?
in the on.ready
Yea once you have it set it lasts forever so you dont need to execute it again unless you want to change it with a command
^
1 sec let me check mine
I might have fixed it
I think you need client.on('ready' =>
bot.on('ready', () => {
bot.user.setPresence({
game: {
name: `hey`,
type: 0
}
})
});```
would it be
Yeah that
np
Glad to hear 👍
👍
I might need help with one more thing
Im trying to add a search feature to my bot
But when I try to use it it somehow searches for talking tom
idk why
Welp that's an issue I have never heard of before xD
now it searches for the spectre
@quiet bobcat Would you mind showing the part of your code with the search command?
sure
youtube.searchVideos('', 4)
.then(results => {
console.log(The video's title is ${results[0].title});
})
.catch(console.log);
i just found it
and wanted to see if it would work
Yeah I figured that out
At this point, it's searching at random
I'm assuming that's an npm package?
That sounds like a good idea
Is the ('', 4) the part where it searches?
idk
A bot which searches for random vids xD
alright
It's probably how many results it brings up
let me try
It'll include the prefix called atm, but it will show something of relevancy.
idk anymore
.search hello
The video's title is The Powerpuff girls - Bubbles funny scene
how is that related
?
So what command isnt included
this one? youtube.searchVideos(message.content, 4)
Hold on, I'll be right back
Ok
Replace message.content with it
ok
It works
.search omfg hello
The video's title is OMFG - Hello
.search asdf movie
The video's title is asdfmovie 1-10 (Complete Collection)
Noice
how do I get it to play that then?
In a voice channel?
Yeah
I have no clue, I've never made a music bot
ok
When I use the ping command I sometimes get this 173.66666666666666ms. I was wondering how do I remove the digits after the comma? The code for the ping command is
case "ping":
var embed = new Discord.RichEmbed()
.setDescription(" :ping_pong: Pong! (" + bot.ping + "ms)")
.setColor(0xffff00)
message.channel.sendEmbed(embed)
split it from the .?
You can just do .split('.');
Cant you?
How do I get it to a round number?
toFixed won't give you a .0
^
Oh. I fixed it
👏
It was at 1 unstead of 0
xD
Thanks @uncut slate
np
Wowza!
I'm looking for someone willing to work with me as a partner to make an image host, a url shortening service, and some other stuff. DM me... Also, I'd be happy to co-create or partner with other bots /their devs. I'm also going to be building my own dedicated server soon, and would be happy to share server space
make a Google bot plz
https://google.gus.host/ cause im nice
@earnest phoenix friend of mine made an image host in PHP which I do like (and works but is still indev) https://github.com/MaxKorlaar/Pxl
ok
that avatar
Ikr
np
is there any example json for a returned request for upvotes endpoint?
hmm, How do I declare a guild id for Discord.js event messageReactionAdd?
your savior is here
i know
i know
stare in awe
now what do you guys need
kek

idk
🤔
Ok but what are you trying to do
I can do ```js
msg.react('<unicode>');
ok
im confused
If they react with ⭐, it goes to a channel that says Starboard shit.
then
ah
That's what you're doing
If they react with ⭐, it sends a message in a channel id in that guild.
ok
then get the channel id
wait
what
do you want to know how to
do it in only trusted guilds?
or
what?

if (guild.id != 'id') { return; }
``` something like that for `messageReactionAdd`.
nah nvm.
I know what they want
@vital lark You want to block every guild except for a specific one, right?
yea
Then you're doing good
Though I'd suggest !== And not just !=
why? Idk
@karmic lake actually
message.guild.id is if a message is sent
If guild is determined somewhere, it doesn't matter
discord.js?
yeah
i'm not sure, but try to eval client.user.setUsername(username in a string)
ok
bot has a guild member object of it's own
first lets clear up
do you want to change username in Username#0000
or a nickname in a server
Nickname on a server
msg.guild.me.setNickname(nick in a string) then
<Guild>.me is the GuildMember of your bot
⬆
with <Guild> I am referring to the Guild object that you get somehow
ok
if msg is your Message then msg.guild is the Guild I was talking about
Ok
I'll tinker on that in a bit
When I startup my bot I get this:
(node:9288) ExperimentalWarning: The http2 module is an experimental API.
MariaDB vs Rethink vs Mongo. What's your thoughts?
hi my dudes its mario here
Who uses Rails?
trains
😂
@opaque bison postgres does all of the things that those dbs u listed do
Sql, document storage(json) , and pub/sub
Interestnig.
Yes
what's the char range for valid usernames? 2-32?
I think
nicknames?
Its 1 to 32
thank
welc x
Its 1 to 32 for guild specific names.
^.{2,32}#[0-9]{4}$ this regex hopefully works then
i can check it for you xox
if you wanna
ok uh
lol
How do I make a command assing a role in discord,js?
command assing ?
?
command.assign ?
I mean like I write for example !mute and then it adds the role mute to a target
nvm got it to work
Can someone help me figure out why I cant use the unmute command? It says roles is undefined. but not on mute? Reason why I have e .g member2 is that it couldnt find member but when I added member it said it was already defined
case "mute":
let member = message.mentions.members.first();
let muteRole = message.guild.roles.find("name", "Muted");
let adminRole = message.guild.roles.find("name", "Administrators");
if(message.member.roles.has(adminRole.id)) {
member.addRole(muteRole).catch(console.error);
}
break;
case "unmute":
let member2 = message.mentions.members.first();
let muteRole2 = message.guild.roles.find("name", "Muted");
let adminRole2 = message.guild.roles.find("name", "Administrators");
if(message.member2.roles.has(adminRole2.id)) {
member2.addRole(muteRole2).catch(console.error);
}
how do you display someones avatar in embeds i tried using the function message.author.displayAvatarURL but it would still show just the link
There are 3 places you can do it small image next to title is the author, thumbnail on the right and large image takes the full embed
{
"embed": {
"image": {
"url": message.author.displayAvatarURL
}
}
}
https://leovoel.github.io/embed-visualizer/
Is helpful as fuck with embeds.
footer as well 
Can someone help me?
Oh yea but who even uses footer image 
case "mute":
let member = message.mentions.members.first();
let muteRole = message.guild.roles.find("name", "Muted");
let adminRole = message.guild.roles.find("name", "Administrators");
if(message.member.roles.has(adminRole.id)) {
member.addRole(muteRole).catch(console.error);
}
break;
I try to do the same to remove a role but it just gives me errors and errors and errors.
I get errors such as ReferenceError: adminRole is not defined. And if I solve those I get this error TypeError: Cannot read property 'roles' of undefined
In what settings?
yeah pretty much its prob role
TypeError: Cannot read property 'role' of undefined
i totally don't use footer image
Its defined on the mute command
as TypeError: Cannot read property 'role' of undefined
oops
as (property) GuildMember.roles: Collection<string, Role>
DM me your guild invite @quiet bobcat
Sent it @prime cliff
why is this a thing? https://i.imgur.com/z9WU9og.png
@quiet bobcat brb a min
pls someone
show full code 
const Discord = require('discord.js');
exports.run = (client, message, args) => {
let helpEmbed = new Discord.RichEmbed()
.setTitle('Commands')
.setDescription('MooseBot\'s commands\n`cs`: coming soon')
.addField('m>help', 'shows this message', true)
.addField('m>info', 'shows info about the bot (cs)', true)
.addField('m>ping', 'pong! shows api and guild latency', true)
.addField('m>google', 'returns result for given search query', true)
.addField('m>avatar', 'mention a user to get a link to their avatar or don\'t mention anyone to see your own', true)
.addBlankField()
.setAuthor('@elfin storm', 'https://cdn.discordapp.com/avatars/199621462586425346/0777fd13a3540236146fb9c332195d9a.webp', 'http://itsmoose.space')
.setTimestamp()
.setColor("#FF0000");
message.channel.send(helpEmbed);
}```
why is your embed like that
easier 2 do JSON objects ❤
its not tho
both work so who cares keke
tru js
but why do I get that error?
also message.channel.send({ embed: helpEmbed })
yeah, but that doens't fix the issue
@earnest phoenix it was renamed to MessageEmbed
damnit
please don't use v12/master if you don't know how to look at docs lol
yeah either just look at docs before asking or go back to stable

Lol RichEmbed is a better term than MessageEmbed why would they change it xD
Yay lets change the embed object and break everyones commands for the lulz
Ik that :/
🤦 Guild.Roles
doesnt work
ok
@supple shale how did you do the "Welcome username to my bot page"?
you could just look at the source
i can't find the part that does it
It's easier to use JSON
@earnest phoenix also, it's Discord.EmbedBuilder I think
🤢 MessageEmbed
https://weeb.hacked-your.webcam/5fd5770.png jonasjac is a pro bot dev 
👏
Lol
#development is a better place to talk about development than the spam heavy #commands
home
where were you?
o.o
flying back in a about an hour
where do you live?
O_O
not bad
sfo to east coast is over 5
this is prob less that 3
maybe 2.5
im going to add a userinfo command I think
awesome
yeah
is there a way to make an unmute command?
I got the mute command down
But I cant get the unmute command to work
👍
Why are you adding the role
At this point I have just given up
On unmute
It was wrong in the cote
member.removeRole(muteRole).catch(console.error);
happy now?
I fixed it
and that didnt work?
nope

😢
member.removeRole(muteRole.id);```

And you should just check for perms, not an admin role
SyntaxError: Identifier 'muteRole' has already been declared
if(msg.member.permissions.has('MANAGE_ROLES')) instead of checking for an admin role

Or whatever permission u want
wait
let me try
Now I got this ReferenceError: member is not defined
Error after error
im giving up
message.member
Don't
are you using msg or message
message
I did that
Coding is hard but it's worth it in the end
Never give up 👀
its wrong here member.removeRole(muteRole.id);
still an error?
yeah
you need to do
let member = message.member;
otherwise member is going to be undefined
I have member set as this let member = message.mentions.members.first();
Wait
No
It didnt work at all
I can mute people
but cant unmute
So I defined member in unmute aswell but I got this TypeError: Cannot read property 'permissions' of undefined
lmao
So somehow permission is now undefined
👍
But permission works with the mute command
makes sense
I'm going to sleep. I'll try to tinker some more tomorrow!
Read the discord.js docs its pretty easy to understand
You need to do a foreach guild to count all the users and guilds
also that'd count members
if any one will love to help me out then can you message me i am trying to make a bot and i need help
thx
oki @inner jewel
if someone can help me then message me i want to make a bot that can play music and do some weird fun stuff (send cat pics memes and more) if any one can please message me thx
nobody will message you tbh
true but maybe some one will be nice @restive silo
no the thing is not if "someone is nice" but your question sounds like "could someone make me a bot for free" to mostly everyone in here and nobody works for free
thats how it is
then you maybe want to learn a Programming language first
yesa
👋
Hello I consider myself a person
Do you hate me? 😢
No
The first time I met you, you were so rude to me lol
Anywho
How would I make a ban command?
I was going to bed
Oh
Then
And I basically couldn't find docs
Rip
The gist of a ban command is to get the ID of the user, then with the guild of the message, grab the member and banne them
Yes
You can use message.mentions
i cheat using regex to match a number
Lmao
works for both mentions and an id
No, since im on d.js
I just use an arry system
Its basically the same thing
Anyways
How would I set up a ban function?
Like
(mention code here).id.ban('Test')
Or is it more complex then that
Yes
Well
I can do this
message.mentions.members.first().id
So ye message.mentions
By bad
*My
Wait wut
Yes
Just do ban on that
Well you need to ban a member
Yes
Ik lol
Oh
Forgot the member part
message.mentions.members.ban("Being a bad person")
I can try it
Well that's a collection
You literally told me to do ban on my code
message.mentions.members.forEach(member => member.ban());
Well you needed to do ban
As well as this
Oh
Interesting
Alright ill try it!
Wait
Nonono
Wouldnt that ban the whole server?
ForEach
message.mentions.members returns a collection of each mentioned user





