#development
1 messages ยท Page 346 of 1
Read the docs.....
no
wrong
jk
idk
oof
use message.channel.send(`stuff ${roll}...`) idk if answered yet so k
@abstract mango OH ME GOODS NESS
d.py rewrite is great
JUST
python -m discord newbot --prefix ! --sharded bot-dir
hot isn't it
don't care to be
but channel's ded
@fossil oxide The @worthy nova has a link that has expired.
@bronze mason What do you mean
@earnest phoenix This\
And?
It's expired.
And?
Dont tag Oliy over stuff like that
Thats a bots game, its not our bot thus we dont care about it
If you want to tell someone about the invite being expired. go contact the owner of the bot
@earnest phoenix there IS no dpy guild
is having full command documentation on discordbots.org sufficient for certification or would i need to make my own site?
you can leave it as N/A lol
i did that last time and got rejected with Please add another form of documentation as well as your help commands xD
but i didn't have detailed command documentation on discordbots.org then
so add it to your boat page tho
welp, submitted it again, we'll see how it goes
now to make a bot that asks if the mods have reviewed it yet every 30 mins
rofl
pretty sure there is a api
...
lol
xD
use ๐
i can't use ๐
k
https://discordbots.org/api/docs and then GET /api/bots/:id/votes
np
is it for discord.js ?
just send a get request and read the responce
ok
-bots @lethal sun
@lavish flax
@deft lily
@haughty radish
-.-
xD
don use ze cmd here
.
jk
_>
discordfail
rofl
snekfetch.get?
i know jquery, but not node.js
@tawny lava steal a 150 year old desk
snekfetch
a lib
what da hell is dat
๐
lmao
yeh
kkk
instead of answering with "what's that" google it
snekfetch is a vegetable
GUYSD
lol
kek
-bots
@blissful gate
why
rip
@lavish flax
@deft lily
@haughty radish
no
just get request https://discordbots.org/api/bots/<BOT ID HERE>/votes
var snack = snekfetch.get("https://discordbots.org/api/bots/<BOT ID HERE>/votes")```
there is your json responce with the people that have voted
we noticed
xD
yes
-_-
hm lemme get my code
so.
if(!snack) return;
?
_>
Can someone check my bot?
no
xD
jk..
xD
I wait 5+ hours
i waited 1 month
:3
OMG
ok
there are a lof of bots
just wait
ok
:3
;D
ty
@earnest phoenix you just got one more hour to wait because you said staff to review ur bot
xD
@earnest phoenix my calculation is 10 hours + (Amount of bots before you in queue * 10 mins) + (Times asked to approve * 1 day) sometimes when people are really annoying about asking to get proved the 1 day turns to 1 year, and because of that it is over the limit of waiting time, your bot will get instant denied
@north fog HELP
so now
if(!snack) return msg.reply(You need to upvote for the bot.)
?
ok
ty
very much
_>
no,you need to read the json and look the if the id of the user is in the json
if you they have voted
if not they havent
wait what
snekfetch.get(`https://discordbots.org/api/bots/BOTID/votes`)
.set("Authorization", "DBLTOKEN") //Credit goes to Skweezi! wink```
that may work
what should i replace in "DBLTOKEN"?
ow yeah, forgot about the authorization header
YOUR DBL BOT TOKEN
OK
look at the bottem of the page
wait what
examine https://discordbots.org/api/docs on the bottum of the page, you need to login to generate a DiscordBotList TOKEN (the token you need as authorization, because we cannot see who has voted on your bot, only the bots/people with the authorization token)
...
...
WOW
hacking discord
kk
omg
WHAT ARE U TALKING ABOUT
im using Discord Presence i jus want to tell storm ze wrong and ze bad one
i want to quit but eh
it's a vscode plugin
ok bye
and, again, don't use vs-discord
and, again, i'll use it!
WOW
WHAT
PowerPoint?
Lol
CUTE
dont mind me watching you on your computer trying to install a vs-discord npm package
wait what
WHAT DOES THAT MEAN?
Oliyyy
BRUH
DONME
I GOT IT
:3
ok
wut
what lib
discord.js
show code
const {RichEmbed} = require('discord.js');
const {caseNumber} = require('../util/caseNumber.js');
const {parseUser} = require('../util/parseUser.js');
const settings = require('../settings.json');
exports.run = async (client, message, args) => {
const user = message.mentions.users.first();
parseUser(message, user);
const modlog = client.channels.find('name', 'mod-log');
const caseNum = await caseNumber(client, modlog);
if (!modlog) return message.reply('I cannot find a mod-log channel');
if (message.mentions.users.size < 1) return message.reply('You must mention someone to ban them.').catch(console.error);
// message.guild.ban(user, 2);
const reason = args.splice(1, args.length).join(' ') || Awaiting moderator's input. Use ${settings.prefix}reason ${caseNum} <reason>.;
const embed = new RichEmbed()
.setColor(0x00AE86)
.setTimestamp()
.setDescription(**Action:** Ban/n**Target:** ${user.tag}\n**Moderator:** ${message.author.tag}\n**Reason:** ${reason})
.setFooter(Case ${caseNum});
return client.channels.get(modlog.id).send({embed});
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 2
};
exports.help = {
name: 'ban',
description: 'Bans the mentioned user.',
usage: 'ban [mention] [reason]'
};
?
try wrapping it in this
```JS
for example
```JS
code = goes.here;
```
code = goes.here;
to were?
well as far as I can tell, you have the line message.guild.ban(user, 2) commented out
which, you know, means it never gets executed
and how to make bot online 24/7
get a vps
my bots console just spamming (node:14212) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 18): DiscordAPIError: Missing Access
well obviously your bot doesn't have permission to do something
and presumably you're trying to run that process in a loop somewhere, which you shouldn't be doing
!ban @earnest phoenix
securityBOT - tรคnรครคn klo 18.16
(muokattu)
Action: Ban/nTarget: Hiiva#0173
Moderator: ItzKissaz | Finprison.net#4794
Reason: ei vittu kiinosta
Case 3
sori
๐
unohin ottaa ton @ jutun pois
Channel for chatting about bot development. If you have questions, ask the questions and wait for someone who can answer to help you. Do not ask to ask. Provide all possible information so people know what's up. Just saying "I get an error" doesn't give us enough information on your problem. Do not @mention people randomly.
Do not @mention people randomly.
sori
.
"1": {
"number": "1",
"title": "test",
"synopsis": "test"
},
"2": {
"number": "1",
"title": "",
"synopsis": ""
}
}```
how 2 fix ma json
looks fine to me
TypeError: Cannot read property 'title' of undefined
.setTitle(einfo[1].title)
einfo = const einfo = require("./modules/episodeinfo.json");
that's the error i am getting
i want to be able to grab episode info from a file
for each episode
of something

looks fine to me
what about my code?
something must be wrong
exports.run = (client, msg, args, einfo) => {
let episode = args.slice(0).join(" ")
if (!args[0]) { return msg.channel.send(":x: Sorry, but you must specify an episode to search for.") }
msg.channel.send("", { embed: new Discord.RichEmbed().setTitle(einfo[1].title).setColor("#00D4FF").setDescription("**Description**\n" + einfo[1].synopsis).setFooter("Information sourced from love-live.wikia.com") });
}```
this is the full command
Try giving it a actual string instead of ""
1 sec
{
"1": {
"number": "1",
"title": "test",
"synopsis": "test",
},
"2": {
"number": "1",
"title": "test",
"synopsis": "test"
}
}
Try that
Same error
@neat falcon um
don't use it like that
[
{
"number": "1",
"title": "test",
"synopsis": "test",
},
{
"number": "1",
"title": "test",
"synopsis": "test"
}
]```
Use this code, and use `einfo[0].title` to get the title from the first object
the reason yours wasn't working is because the first index was "1" which is a string, but you were trying a number 1
Only the first ] need to be [
And that looks way cleaner
yea
I always do it like that too
ohlookitsderpy ๐
Hey guys?
My code isnt working as it should be
When, I see nothing wrong at all
Does anybody know why it may not be working?
else if (message.content.startsWith('---shutdown') && !message.author.id === '376147022660632587') {
message.channel.send('Only the bot owner may use this command!')
}
Theres more but this is the part that doesnt work
For some odd reason
!== btw
Oh, I thought it was the same as !expression
๐
also, why don't you do this
Ik
!x === y
if(message.content.startsWith("---shutdown") {
if(message.author.id !== '376147022660632587') {
message.channel.send('Only the bot owner may use this command!')
return
}
//handle shutdown command for owner
}```
is the same as
Ik ik
(!x) === (y)
@cosmic plover Well that would work too
yes but you're checking for that
and then checking again if it starts with shutdown for you
xD
which is kinda wasteful and unclean
Okay
Wait yea why
Its still not working
The console shows no errors
It just doesnt run ๐
And according to the rules of javascript it should be working
So im just rlly confused
Heres my full code
let exit;
function exitProcess() {
exit = client.setTimeout(exitProcessMain, 3000)
}
function exitProcessMain() {
process.exit(1);
}
client.on("message", (message) => {
if (message.content === '---shutdown' && message.author.id === '376147022660632587') {
message.channel.send('Shutting down!')
client.destroy();
exitProcess();
} else if (message.content.startsWith('---shutdown')) {
if (!message.author.id === '376147022660632587') {
message.channel.send('Only the bot owner may use this command!') ;
}
}
});
No
That is not how JS works
you can only use ! to negate a boolean or force negate a variable
You must use !== instead of !x === y
@earnest phoenix
You should really learn JS before making a bot
also why do you have useless exitProcessMain functions?
Trying to use ! on any string will return false
@earnest phoenix Thing is
told you to use !==
I did that
Still didnt work
:/
Plus I know that and because I want a delay
Also I know javascript and I tried both ways
also that check is horrible
^
I literally gave you one 1000% cleaner
^
listen to Kodehawa
seriously
Your the one who-
Okay im done
Lol
You're just ignoring him
Get the Cheat Sheet Here : http://goo.gl/TxNsQO Best Book on JavaScript : http://amzn.to/1WbMYvm Support Me on Patreon : https://www.patreon.com/derekbanas 0...
or her, can't assume
Yea
Watch that
I do know javascript ๐คฆ
Instead of mocking me
do you really?
jk
It would be useful
Okay wait
I wanna hear dis
Anime: Re:Zero kara Hajimeru Isekai Seikatsu sauce: https://www.youtube.com/watch?v=IuyxcKsFWhI Cred to: Gigguk ---------------------------------------------...
Why do you think this isnt working?
@earnest phoenix
I WROTE A CHECK FOR YOU Q~Q
report button where? thanks stable
same
I don't even think it's on Canary yet, is it?
u dont work
it's on A/B testing
LKSDKFJSDLFKJSDF
None of the methods are either
oh I see
error
missing )
if (message.content.startsWith("---shutdown")) {
if (message.author.id !== '376147022660632587') return message.channel.send('Only the bot owner may use this command!');
// handle shutdown command for owner
}```
there have fun
Hm
Okay yeah
Imma try to run dis
lmao
That is literally the same thing Kodehawa posted, but with a fixed )
and moved the return to in-line with if statement
Oh I see!
I thought I might have needed a return
๐คฆ
o my
But I thought against it
No
you didn't really
The code has a return
but it's just simplier
But okay
Wait
Honestly you don't need return, it just reduces the amount of else in your code
But this-
This is the exact same code but with a return
well it works the same
but improved
Okay
also I fixed a bug
it's less ugly
But then
If this is the exact same code
Yes
But with a return
Then why wasnt it working before ๐
prob because you did something wrong
a bug
we don't know, you never posted an error
:/
There was no error
Well you weren't comparing properly
that's why
But i've used that multiple times ๐
And its worked ๐
Well it shouldn't of
Example
} else if (!message.member.hasPermission("MANAGE_GUILD")) {
This works
Yeah, because .hasPermission returns a boolean
๐คฆ
Oh how interesting
LOL
I do know js
Okay well thank you for clarifying that
np
Im just gonna use !== from now on
good
Is there a easy way to test sharding, like be sure that 2 servers are on different shards?
Not that i know of
hmm, just threw a higher number than what I would be and it worked. Was easier than I was thinking
@wanton plover you can run the calculations that Discord does to determine which shard each guild is assigned to
I'm kinda late tho
(guild_id >> 22) % num_shards == shard_id
Can someone help
Error js ]: /app/bot.js:4632017-11-28T13:36:07.462340+00:00 app[worker.1]: } {2017-11-28T13:36:07.462342+00:00 app[worker.1]: ^2017-11-28T13:36:07.462342+00:00 app[worker.1]: 2017-11-28T13:36:07.462350+00:00 app[worker.1]: SyntaxError: Missing catch or finally after try
Code
permissions: [] }); } { catch(err) } }
try{
}catch(e){
}
^
^
try{
// some code here
}catch(e){
// OOF WEW NO!
}```
probably
...
..
});
} catch(err) {
}```
Correct now
...
Yes. Or no
NOOOOOOOOOOOOOOOO
we cant see what ur doing lmfao
the catch part yes
you've posted the tiniest amount of code
^
the }); depends on what's before
how are we supposed to read it at all?
OK I will post more
we don't have a crystal ball to guess what your code is
let role = message.guild.roles.find("name" , "Muted");
if(!role) {
try {
role = message.guild.createRole({
name: "Muted",
color: "#000000",
permissions: []
});
} catch(err){
} ```
let role = message.guild.roles.find("name" , "Muted");
if(!role) {
try {
role = message.guild.createRole({
name: "Muted",
color: "#000000",
permissions: []
});
}catch(err){
// handle "err" here
}
}
<HTML>
<HEAD>
<SCRIPT LANGUAGE = "Javascript">
document.firstline = "Welcome to this page"
</SCRIPT>
<TITLE>some test</TITLE>
</HEAD>
<BODY>
<SCRIPT>
document.open()
document.write(document.firstline)
document.open()
</SCRIPT>
</BODY>
</HTML>```
Ken do you think i did this correct?
What is handle. Err here for
Ken
just console.log(err)
Are you making a site?
log stuff to a document
with html?
document = null
r u trolling with that html or r u being real
he's for real
aaaaaa
Those caps are ugly AF
why are you trying to use javascript to write things
<html>
<head>
<title>Website title</title>
<script>
// ur website-based javascript
</script>
<style>
/* ur website-based styling */
</style>
</head>
<body>
<header>
<h1>Nice header boi</h1>
</header>
<main>
<section></section>
</main>
<footer>
nice footer, nerd
</footer>
</body>
</html>
@stone kiln
It's for #312614469819826177
What guild count
nice html5 tags
Like
Your fucking server count dumbo
Btw ken
ofc not
LOL
Ok
Just wondering, how old are you @shrewd field
Why
Just wondering
14
Nope
12
Nope
13
Far
11
7
10?
4?
Jokes aside, go learn some programming and read #312614469819826177
@languid dragon nah mate was just a joke
Do us a lil favor
and maybe a favor to yourself
i was about 2 slap you @stone kiln
My real code is way better
umm.
Auto updates from private repo 
he's 5
im 5
67
What lib?
"can I help me" 
@languid dragon Discord.js
yes, you can help you
client.user.setPresence(/*presence data here*/);
https://discord.js.org/#/docs/main/stable/typedef/PresenceData
you need master for watching/listening to in d.js
@languid dragon no for
?
@umbral pelican can help me for master xd?
@earnest phoenix thanksโข coding this is gonna be easier now kek
@slim solar what do u need help with
How do I check if a string is inside a list in JavaScript (discord.js)
I can't figure it out 
Aint you the guy with the bot that has been denied and kicked multiple time for lots of stuff Manock ๐
ARRAY.includes("shit") @earnest phoenix
Thanks ๐
Give me a few seconds
Do mw a favor @slim solar
Me*
Go into general and search tyye: 0
Donut types how to do it last night
Donut types how to do it last night
never mind
We aint going to spoon feed u
@ripe harbor
muted LOL

bad stuff like?
He used a selfbot to act like he did nothing @neon pasture
lol
With his selfbot
Yep
Stealing code, not going to help him anymore
Yep same
I really love this server lmao
๐
I basically abandoned my friend just now cause I was so exited of seeing soo many people that knew code
I know html
I don't know html
:3
Normally the servers nice just don't get on people's bad sides or else you might get banned or muted @earnest phoenix
I'm basically a 14 year old programming student, that does python in school, and since it was so basic and my mind was much more advanced than the shit we're doing there, I decided to start in C# and JavaScript, and made bots in both of them
Unless you want to be a sarcastic f*** like me and then everybody just hates me ๐๐
How do I add timestamps to console logs?
js and d.js
let f = new Date()
console.log(f) @quiet bobcat
I'm having trouble with getting thumbnails to work in embeds
Thank you Zambia
nice comment
You put a link
How do you get that though
cause something like discorduser.avatarURL won't work for me
Idk a link of a image or something
I tried clearing space with fields, doesn't work either
Ive been working on a new bot command
How would you get it to be a picture of a discord user though
Hey dwad
@cerulean osprey It already does that?
But it's not tho. There are just a bunch of ??? where it should be
Oh, my bot was kicked. I didn't know having it in here was a requirement to show it as online
@cerulean osprey see https://discordbots.org/bot/361678004067368971
on the page it says online
Ya, like I said I just didn't know it was a requirement. It was kicked last time due to it dming people upon entry. I'll just code an exception for this server and ask to have it added back.
Oh
Thanks for letting me know
How can I check if a string is a number in JavaScript? Please @mention me if you answer.
@earnest phoenix you can do this
if(isNaN(VALUE)) { do some shit } else { do other shit }
Thanks man ๐
Sure, thanks for your help
Np
commando
commando
there's your error
missing an =
yes
a = b sets the value of a to b
a == b compares a to b
better?
I have a question
So, can you do commands but instead of doing a mention you can just type their username?
I'm using discord.js
works with username+discrim
Erm how would you do that?
or
Guild.members.find()
ok thanks!
yw
@warm canopy Members don't have the .username property iirc
you must use guilds.members.filter(m => m.user.username.toLowerCase() === search.toLowerCase()) which will return a collection
ty
np
How do I have my bot token be read from a file so it won't show on github?
google "reading strings from a file <lang>"
thx
@woven birch Or you can use environment variables...
that would work a lot better, because you wouldn't need to read anything
it's native in Node
process.env.DBL_TOKEN
env DBL_TOKEN = "my awesome token" in console.
put that in your .bash_profile somewhere
(If you use Node.js, by the way)
So how do I fix this
you disable redirect url on that bot account
either add a redirect uri or just have scope bot
object = JSON.parse(json, true);```, what's wrong with JSON.parse?
ayy, thanks
var in 2017
let var die
var constantly reminds me of old farts

@slim solar
yes Senpai
@earnest phoenix ask your questions here

Wot
@earnest phoenix look at OVH
Also, it's called a VPS
whats OVH?
oh
A company
He wants free
lmao
lamo my ass
lamo
are you assuming their gender 
Yes
Lol
Why do people recommend OVH instead of say, Hostgator or Vultr?
hey so i'm helpin someone make an automated answering bot for discordtel aand uhh i can't figure out how to use awaitMessages 
collected.first()
hmm
awaitMessages returns a promise
i don't even need that if statement
since awaitmessages would do the job for me
ok but then it instantly avoids the awaitmessages and then just sends it anyway
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await
await can only be used inside an async function
OH
not near one
send returns a promise as well, and you've got max set to 1 for the awaitMessages
ah
the order it's likely executing in:
- send message
- awaitMessages
- message actually sent
you just need to read up on promises tbh
@daring charm because OVH is high quality and has good support
No one uses Hostgator
Well, I would say that the OVH website is poorly designed really, got a VPS during the black Friday sale and it was quite unintuitive to navigate the website. Vultr and Hostgator seem to be much better designed according to reviews. 
I am not saying that the OVH servers are bad, just a poorly designed website.
The server is fine and running great.
you need to create the function yourself
It's not a function
you need to create the function yourself
yes
Which one
but all the commands are working but this one wont work ๐
exports.run = (client, message, args) => {
yes
:+1:
it seems I can't store discord emojis in a mysql VARCHAR ๐ instead of :smile: it stores ????
any ideas?
\๐ถ
I just tried converting from utf8 to utf8mb4 and it still doesn't work
don't tell me about unicode O_o
"bro"
it's like saying
"try using characters"
"try breathing air instead of... air"
I asked for help not for trolling
client.user.setPresence({status:"idle"})``` isn't working.. any idea why?
it was a node js problem and I used the emoji-text package to fix it
You know you could have used the unicode lmfao @ornate shadow
let string1 = message.content.slice(13 + BotSettings.prefix.length);
this was my code. how could I "use the unicode"?
when someone joins how do i find out if they're online, dnd, so on?
and if the user types in
<3greeter join welcome! :smile:
?
using discord.js
member.presence @old badge
will that give me something like online, idle, etc?
Yea
that's how you use my bot to set up the welcoming message
the administrator will never use the backslash or w/e
alright ty
@ornate shadow discord replaces :emojiname: with the raw unicode
it doesn't seem like it because when I was console.log-ing the string I would get two question mark "blocks" instead of the raw unicode @inner jewel
it may be so if your OS is windows and not debian based
what discord sends doesn't matter on the os lol
\๐
it may be true ๐
unicode emojis are ew
I read somewhere that it depends on your OS how your terminal perceives the unicode
anyway it didn't work. now it works cuz I used emoji-text package
how they're displayed depends on the OS
it had nothing to do with mysql (first I thought it had)
but the actual text is the same
hmm then why did mysql perceive it as 4 question marks instead of the raw unicode? I tried using utf8 and utf8mb4
it may be a flaw on my part though
in mysql i think you have to use VARCHAR
some emoji are 4 bytes
I used VARCHAR...
in new discord.js, is it new Discord.RichEmbed() or new Discord.MessageEmbed()? someone said it changed to the latter
alright ty
so I guess mysql stored it as a 4 byte emoji
cuz 4 question marks
so it didn't take it as raw unicode afterall
again
I'm not joking
FUUUUUUUUCK







