#development
1 messages ยท Page 322 of 1
^
knowing how to HTTP POST is pretty useful
Updated DBL
Updated DBL
Updated DBL
Updated DBL
Updated DBL
Updated DBL
Updated DBL
Updated DBL
Updated DBL
Updated DBL
Updated DBL
Updated DBL
Updated DBL
So much for spam then
Ok
I took over that project and updated it
Well I don't really understand it that well.
First time having to do anything with API for a bot list
whats with the spam
It's really not bad. I take it you don't have much experience with APIs in general?
This is the first time I've ever started doing anything with Discord. I'm just learning as I go along
but do you have experience with any REST API
I doubt it
or is this your first as well
I don't see why we'd be triggered for you being new at this
You could have just lied and tried to make it seem like you were a pro but actually had no clue. I would have actually been triggered then lol
mhm
I have that feeling because of Discord API I see people get pissed when someone new to Discord asks for help
Well, the wrapper was made for new people or people who didn't feel like writing the code themselves. I personally prefer writing my own requests but eventually you'll do it so much you'll basically write your own wrapper anyways
I just envy the people who can do this shit
We all started somewhere
I'm sooner or later going to stop Discord coding. I'm going to be doing Game Development as a Career
They can go hand in hand
games in discord
lol
gamebridge SDK
This is a screenshot of a video I took of some of my work
UE 5?
Lol, I messed around with Unity. I downloaded a free menu asset and their logic was wrong so it didn't work right 
I had to fix it
I actually remade pong on Unity
It was the most cancerous thing ever
It's probably the most attention I've ever gotten
I got GameJolt API working so I guess I've done some API stuff
idc lol
Uh yeah, well dbl.js was just updated in the past few days since I took it over
I see you were referencing an old version. Look at npmjs.com for dbl.js
Should get you set up
Well I got it working. So I don't want to worry about it
I would suggest updating because that seemed like it was before I updated it, it had things that weren't working and the example page would give you errors lol
const Client = require('../lib/index');
const bot = new Client({token: "token", autorun: true});
bot.on('ready', () =>
{
/*
let message = await bot.sendMessage('352851932273967114', 'Edit me harder')
message.edit('Async edit, too?');
*/
console.log(`Bot Desu's servers: ${JSON.stringify(bot.servers)}`);
});
bot.on('message', (message) =>
{
console.log(`${message.content} posted by ${message.author.username}`);
if(message.content === 'ping desu')
{
bot.sendMessage(message.channel_id, bot.ping);
}
});
bot.on('guildCreate', (server) =>
{
console.log(server);
});
Wew
eris x d.js = dicksword โค
lol
ram usage will depend on the cache and how many servers the bot is on
LOGGING MESSAGES BAN
that's how it works with any lib, tbh
You guys making a music bot?
what
I have some
nvm
I want to maybe rewrite
but I'm not directly supporting voice, because that'll take hella long
I'll include something to use like some lava shit
but I'm focusing on everything but voice at first
๐
voice is pretty rip with the info
I need to rewrite Yumi's music module.
but That will be in the v4.0.0 rewrite ๐
all d.js
so many rewrites lol
not really
the current version isn't one
I had to code really fast to get Yumi booted 
if s["USER"] == points:
continue
if str(user.id) in s["USER"]:
oglosepoints = str(points[0]["LOSES"])
ogtiepoints = int(points[0]["TIES"])
ogwinpoints = str(points[0]["WINS"])
newtiepoints = ogtiepoints + 1
datadel = {"USER": str(user.id),
"LOSES": str(oglosepoints),
"TIES": str(ogtiepoints),
"WINS": str(ogwinpoints)}
points.remove(datadel)
data = {"USER": str(user.id),
"LOSES": str(oglosepoints),
"TIES": str(newtiepoints),
"WINS": str(ogwinpoints)}
points.append(data)
dataIO.save_json("data/general/rpspoints.json", self.points)
elif str(user.id) not in s["USER"]:
data = {"USER": str(user.id),
"LOSES": str(0),
"TIES": str(1),
"WINS": str(0)}
points.append(data)
dataIO.save_json("data/general/rpspoints.json", self.points)```
this is the code i have so far... it wont creat any new users tho... how can i fix?
oh wait
ik
i think
welp
not that

i got it
@rich glade I don't suggest using the dataIO, it's kinda poorly put together but it's up to you, you're probably just as well off making your data interactions yourself
var prem = ""
var forb = this.client.guilds.get(`250486125431488512`)
var donors = forb.roles.find("name", "Donator");
var contris = forb.roles.find("name", "Contributor");
var supports = forb.roles.find("name", "Supporter");
var legends = forb.roles.find("name", "Legendary");
if (message.guild.owner.user.roles.has([donors, contris, supports, legends])) {
prem = "true"
} else {
prem = "false"
}
I'm trying to get if the Guild Owner has one of these roles it returns. It stops at has
message.guild.owner.user.roles is a Collection and there's no has
try using find
Ok
find returned undefined too. Also I'm pretty sure it's has
getUser.roles.has(supportRole.id)
Which also works for this
oh yea I forgot Collection extends Map
I don't think you can pass an array to the key part
Trial and Error
I did forget .id but no change. It still returns false. and .user didn't need to be there
I also figured I was testing it from my current guild (testing one) instead of var forb
Pytho. Is shit
Yeah.. no.
Does any library yet support screen share on canary?
Are you asking if any bot lib has support for endpoints that bots don't have?
Anyone willing to help me?
how would one get all the channels in a guild that the bot has permission to send to, and then get the first one
not yet afaik
I'm not sure it's going to
ye, the only possible scenario is if they bring "video calls in guilds"
in which case.. maybe.
considering they don't have "friends"
nope
RIP vidapi
doubtful, though
sounds unlikely tho
yeah, it is
there is an API but no docs
coughs where's tom at
API for vidcalls or voicecalls?
noticed this in eris docs 
:blobeyes:
bot.guilds.map(guild => {
var broadcastChannel = require('../guilds/broadcastSettings/' + guild.id + '.json').custombroadcastChannel;
var broadcastEnabled = require('../guilds/broadcastSettings/' + guild.id + '.json').broadcastEnabled;
if(broadcastChannel === "") {
var channel = guild.channels.first().then(ch => {
ch.send("This is a broadcast")
})
} else {
guild.channels.get(broadcastChannel).send("This is a broadcast");
}
})```
fix your codeblock
wdym?
the lang is on a new line
Is now
@delicate zephyr just <client>.shard.broadcastEval(send()) and then make an class send() witcha stuff in it
works fine for me
also dont use json for settings
use an db
ty
he's not using broadcastEval as far as I can see
-bots Luke
@neon scarab
How bout go away Im working on a free VPS, I'll do it after I build my server
I'll use a DB when I can be bothered
@delicate zephyr Collection.first() doesn't return a promise
which Djs version
v11.2.0
guild.channels returns all channels, including voice channels
you want to filter it to text channels
and you also want to filter it to the ones your bot can send to
use filter yeah
thats what ive been trying to figure out how to do
channels.filter(c => c.type === 'type')
Oh
where type is the type of the channel
you want the inchannel permission yeah
y
because this is literally being done in my spare time
a db is less of a headache than json storage is
not when its only {"broadcastEnabled":"true","custombroadcastChannel":""}
I mean
I could literally just search the dir for the guild id too if someone has a problem
Either way
I'll set up a database when I have my own server + actually have time dedicated to do this
I have not worked on my bot for about 7/8 weeks
so I have this now ```js
var channels = guild.channels.filter(c => c.type === "text")
How would I make it check permissionFor
I tried this
```js
var channel = guild.channels.filter(c => {
c.type === "text";
c.permissionsFor("SEND_MESSAGES") === true;
})
didnt work tho
&&
ok
oh
so it would be c.permissionsFor(bot.user).hasPermission("SEND_MESSAGES") judging by the docs?
yes
no
Yea
.has
ok
I will stop doing that spamme thing, I keep doing it, I need to break that habbit lmao
๐
yo, can someone tell me why this aint workin
nvm fixed it
the else one isnt working
im trying to add channel customisation my my broadcast command (togglable is already done)
How long does it take for the website moderator or website adminstrator to approve your bot?
We cant pin point the timing, since the queue is large on some days and small on others, just be patient @feral rain
Okay.
thats dope 
whoops
events.js:182
throw er; // Unhandled 'error' event
^
Error: unexpected server response (503)
Uh what?
discord is shitting itself
Why is it crashing on that??
Is there a fix to this? Or do I just wait?
^
wait
It's working now
anyone know why i keep getting problems with client being undefined when i for example call: client.user.id?
Main file - https://hastebin.com/enumuzewih.js (Eris)
Sharder - https://hastebin.com/onikigafil.js (Eris)
@indigo notch how many guilds does your bot have
My test bot has around 3
how many guilds will your actual bot have
then you don't need eris-sharder
ah
just edit maxShards
eris-sharder doesn't actually shard
but when i do hit the point that i need it, how would i fix it?
eris-sharder creates clusters
ahhhhhh
eris in itself already shards for you
ah oki
also I can see you're just taking over memer's code
you can use the exact same code
oki
lol
whatever you do, Memer is licensed under AGPL v3
Ohhh
so if you take our files you need to credit us
I am using the same code I was using with d.js, just edit Discord interactions like messages
yeah ^
didnt knew
Eris and D.js are basically the same, Eris lacks some utility functions but you can add those yourself
just use VSC's repository search, search for msg.guild and change all instances to msg.channel.guild
((i stole the richembed class from d.js because i was using it too much))
search for msg.channel.send and change all instances to msg.channel.createMessage
also embed builders really aren't needed
just write your embeds raw
yeah, so I would recommend you do
it would literally take 1 - 2 seconds to do with js eval replace
sure, up to you
thanks
How can my bot send a DM to me when someone use a commands? I'm using discord.js
you're gonna cry a lot and get your bot ratelimited but k
.author.send()
and owner is my id?
Thank you
var owner = message.guild.members.get("id")
owner.send()
or
message.guild.members.get("id").send()
Wait
just use what solace said
If he wan't in guild make a Varible of getting his guilds id. etc. But yea he could use that ๐
I already have it working
lol
im mod everyware
says "Member" lol
He didn't used my bot ๐ฆ
@earnest phoenix what did it say
useful catch ._.
change "DBL DOWN" to e.stack
Error: 404 Not Found
but it seems to be a functional issue from not understanding quite what you are doing
I could if I knew how to use that :P. I just don't know why this one isn't working
snekfetch.get(`https://discordbots.org/api/bots/${this.client.user.id}/stats`)
.set('Authorization', 'token')
.then(e => message.reply(e.body))
.catch(e => console.log(e.stack))
Error: 404 Not Found
Any ideas why it 404s?
is it an approved bot
Yes
is the id right
Yes
are you sending it before it's ready
idk
Forbidden โจBOT - Today at 12:26 AM
@Duck, [object Object]
It was something to do with ID. This happens
JSON.stringify(e.body)
Got it working thanks
Uh, lol. What would be the most efficient way of having it list like @gilded plank
using an embed
Yea I got that part. JSON.stringify makes look like a JSON file. Would I have to file write into a json file and them embed everything?
I guess I'll do that then
no
it's just an object
@earnest phoenix you would do something like
const res = [...];
msg.channel.send({ embed: {
title: res[value];
fields: [
{ name: 'something', value: res[value] }
]
});
Aight
I'm confused on how to do that. But I'll get trying thanks for the help. I'll let you know if I figure it out
is it possible to redirect nginx 404s to another domain? if so how?
couldn't find anything on google
I've been sitting here for a while and haven't figured it out 
@earnest phoenix I would suggest learning JavaScript basics, in that case.
What you're asking is really simple, and judging by your earlier suggestion of saving the object to a JSON file and then embed it from there, it seems like you aren't familiar with objects
@tawny lava so upon a 404 it goes to (for example) thebest404pageintheworld.com
ya
ok
instead of displaying the 404 for nginx
it's been a while since i've done nginx but i'll try
aight
looks like it is
thanks hljs
How i can receive blob emojis?
step 1: get nitro
step 2: go and ask from another channel
Which channel?
@torpid juniper basically, I have a subdomain that's for sharing images and what I want is that if you try to look for an image that's not there it redirects you
this for example https://leagueoflegends.ruined-my.life/8nayoA9R.png
if you try to type https://leagueoflegends.ruined-my.life/8nakljdfljasdklfjklasdfjsadl.png
server {
location / {
error_page 404 =302 https://http.cat/404.jpg
}
}
try this, it might not work but you can give it a shot
lmao kk
i have another solution if soooo
oo that works
does it?
ya
ty vm
kek
yes
also, it works the same if you move the error_page line outside of the location block
it just means it doesn't get confused with subs
like that
oh
nevermind
this.client.emojis.get("31725181622616064")
I'm trying to send
from another guild but I can't seem to find a way to send it
Yes I have Nitro
bots have nitro with emojis
just send it as 
hmm 
is the bot here
yis
does it have the emoji perm
In the server it is in yes. It has Admin
oh, I copied the message id 
looks like Luca is blind
When I use my f>announce command and I enter the emoji manually. It works. When I add it into the code. Nope
how did you add it into the code
just double checking it wasn't an issue with me ๐
.addField("Owner(s)", `${this.client.users.get(json.owners[0])}\n${this.client.users.get(json.owners[1])}`, true)
odd

hmm
It only seems to work with my Main Server
Maybe send me the
image and I can upload it to there...
Actually
oh, nvm my bot didn't have perms 
I can get it off the website
you need to use `
my bot didn't have perms here tho
I am
yeah ik, but I was saying regardless
@abstract aspen eval e.message.channel.sendMessage()

Input: e.message.channel.sendMessage(``)
Result: [object Promise]
it does work
what would be the best library to develop a bot in 
I'll see what happens if I upload the
to one of my servers
and now it works perfectly fine
ยฏ_(ใ)_/ยฏ
Strange stuff happen here
Anyone know how to do that?
ok
k
can someone help me with 'creating an message'?
@pale umbra what language?
are you using the normal client thing or ext.commands
no u
hey
client.msg.guild.invite.code();
how bad is this
var x = msg.guild.invite.code();
os that how its done?
in discord.js
what the
help
what are you trying to do
How to react with custom emojis?
@umbral pelican Get the server invite of a guild and assign it to a variable
liek i want the server invite link
all from a message
o
yep
fchannel.send({embed}).then(msg => {
msg.react("โ
")
msg.react("โ")
});
Discord Reactions are easy. How do you use Custom Reactins?
it's kinda weird, you've got to put <:name:id
@umbral pelican Returns with promise {(pending)}
yeah, so either make the function async and await it
or use something like
message.guild.fetchInvites().then(invites => invites.map(inv => console.log(inv)))
@umbral pelican I tried <:name:id> but it didn't work
that's not what I said lol
Without the > at the end? lol
yeah
mhm
Very Strange 
should I meme
so should be bot.guilds.size @earnest phoenix
or atleast try that
what/
#commands for your bot to reply
How to add the White Header with nothing but just the Header. As shown here with "Bot info:
Oh, my bad didn't see it in Docs
In the API Botinfo. What's the Date thing
"date":"2017-09-13T08:09:47.065Z"
?
When it was Verified or Added?
When it as Verified
@carmine berry that is not the title
that is the author
there is a difference
How do I see my Tonkku? ๐ฆ
oh, yes then
ye
a lot of the new bots are appearing offline on dbl?


I need help on how to get a random Reddit post with Discord.js and Snekfetch
never mind
%%help
and what is the error?
check what version of dbl.js is
3.10.10
wat
dbl.js
comes up the same?
that's not right lol
is that npm version lol
npm 3.10
it's only on 1.5
dbl.js
do npm list
and check it in there
while in the dir of your project
hm, I'm not having issues when I just tried it
I just set my guild count to 100 ๐
jealous
thats lit
am i doing it in an incorrect order?
or
i tried putting it in bot.on('ready')
yano, to give it time to do its jazz
are you sure you didn't save it with your token blanked out from the constructor?
like 1000000% because that header is for your DBL token
ye
token is the token you get from DBL API yeah?
and then the ID is your bots ID?
or my id?
the token is the one you get from dbl api
the other one is your bot's id
what OS are you on?
yes
lemme try requiring it and testing it that way
ty for this x
why not just use snek 
wew
I just tried the wrapper from a new install of it and it worked fine

ยฏ_(ใ)_/ยฏ
yeah i might try that real quick
other than that, I can test it on debian
yes ples
worked fine on a raspberry pi running raspbian (debian)
cries
just set my count down to 100 again
dude
it's dbltoken
that's why
lmao
not just token
wot
yus
that should work for you then
yeah i got it from the examples LOL
u be goofing on me
ooooh yeah i saw something about taking over
yus
whoops
i shoulda read more into it LOL
huuuuge thanks for your help !
oooooooo boooyoyyyyyy
i probably did something wrong
yeah
yeah
it wasn't a string
FIXED IT
HUEHUEHUE

๐
OwO
I deleted his example because it's incorrect
but yeah, keep an eye for updates and changes to it, I won't do anything that will break how it is now, I'll just probably accept more lists in the future
thanks a million x
this.client.users.get(message.author.id).roles.has(role.id)
Doesn't seem to work
because users don't have roles
rip
anyways, why would you use this.client.users.get(message.author.id) instead of just message.author 
LOL
wew
It was. But stuff kept Erroring over it so I just did that lol
thonk
I heard it was
Can you format https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
Like it says here?
Sure
If I were to use Moment. How would I use it to format .joinedAt?
pretty sure it'd be something like moment(Member.joinedTimestamp).format('...')
Oh I see
Yea, that works. Neet
Does moment go by the Authors time?
Or how does it work?
gonna assume you meant how
When it formats the time. Who's time does it go by?
what
Don't worry
It goes by system time @earnest phoenix
Ok
there's no such thing as "authors time"
the API doesn't really let you detect the authors time
Yea I figured. I just wanted to know
anyone knows why length of undefined? js process.exec(message.content.split(' ').slice(2).join(' '), (er, err, out) => { let output = er || err || out; if(er.length < 1 || err.length < 1 || out.length < 1) output = `*Output is empty*`; if(er.length > 1500 || err.length > 1500 || out.length > 1500) { client.fetch.post('https://hastebin.com/documents') .send(er || err || out) .then(data => output = `*Output Too long: <https://hastebin.com/${data.body.key}>*`).catch(error => message.channel.createMessage(`:x: Somenthing went wrong.`)); }
0-0
add some console logs to see what is undefined
oki
Anyone have any experience with storing usernames in mysql?
using utf8mb4 for the database type
but sitll ahvign issues with incorrect string
Do you require names or just a identifier for the user?
tonkku, its on this line js if($err.length < 1 || $er.length < 1) $output = `*Output is empty*`; if($err.length > 1500 || $er.length > 1500) {
in basic utf8 accents works on names on my bot
@indigo notch $er vs $err
i already fixed
@craggy robin I used to use MySQL and utf8mb4
Still need help?
utf8mb4 still can't store every type of character, that is why I switched to rethink (which can store anything)
hmm
i decided to just encrypt the data
bypass the whole need to store the characters
LoLz
but now i have an other question; howt o fetch an user (Not client.users.get but like in djs fetchUser)
well, you just pointed it out
what lib
Eris

i willt ry to transfer it over then
ty tho
and is client.channels.find("name", channel);an thing?
what should i use then with it? ;3
does someone know how to use canvas in discord.js?
it uses a filter function @indigo notch
if (uuser.presence.status === "offline") {
gpre = "None"
} else if (uuser.presence.game.name == 0) {
gpre = "None"
} else {
gpre = uuser.presence.game.name
}
Keeps saying .name is null
uuser is client user
gpre is Game Presence
then there's no game
It should say "None" not
@Duck, An error occurred while running the command: TypeError: Cannot read property 'name' of null
You shouldn't ever receive an error like this.
Please contact Duck#6879.
do } else if (uuser.presence.game && uuser.presence.game.name == 0) {
const presence = uuser.presence.game ? uuser.presence.game.name : 'None';
RangeError: RichEmbed field values may not be empty
show full code
const presence = uuser.presence.game ? uuser.presence.game.name : 'None';
if (forb.member(uuser.id)) {
if (ufuser.roles.some(r => [donors.id, contris.id, supports.id, legends.id].includes(r.id)) || ["190775609532612608", "268285836187926528", "186683613440376833", "305203825931845632", "313148898883534849", "339364228794155029", "339367267026468865", "290999596140986369"].includes(uuser.id)) {
prem = "true"
} else {
prem = "false"
}
} else {
prem = "not in server"
}
var content = uguser.roles.sort((a, b) => b.position - a.position).map(role => `${role.name}, `).join("")
const embed = new Discord.RichEmbed()
.setColor(`#2095AB`)
.setTimestamp()
.setAuthor(uuser.username, uuser.displayAvatarURL)
.setThumbnail(uuser.displayAvatarURL)
.addField("Name", uuser.tag, true)
.addField("Nickname", unickname,true)
.addField("Premium Member", prem, true)
.addField("ID", uuser.id, true)
.addField("Status", uuser.presence.status, true)
.addField("Game", gpre, true)
.addField("Join Date", moment(uguser.joinedAt).format('MMMM Do YYYY, h:mm:ss a'), true)
.addField("Account Created", moment(uguser.user.createdAt).format('MMMM Do YYYY, h:mm:ss a'), true)
.addField(`Roles [${uguser.roles.size}]`, content, true)
message.channel.send({disableEveryone:true, embed});
This is from presence down
Also don't worry about the IDs I'll be making smaller
Not really.
okay so
what we did with the ? and the : is basically shorten this into one line:
let presence = undefined;
if (uuser.presence.game) {
presence = uuser.presence.game.name;
} else {
presence = 'none';
}
Basically, it means:
'if this is true' ? 'do this' : 'if not, do this'
Oh. 
they can be really useful for cleaning up code, yeah
in addition to making your snippet use the proper values, I also shortened it to one line
I'll start using the in the future.
should, yeah.
you can also "nest them" but that starts getting ugly
var condition1 = true,
condition2 = false,
access = condition1 ? (condition2 ? "true true": "true false") : (condition2 ? "false true" : "false false");
console.log(access); // logs "true false"
and I really disrecommend that
Yea I see
Yea it's much better. I just started doing it to the rest of my Userinfo
::user @gilded blaze
Commands won't work here @gilded blaze only in #commands and #265156322012561408
message.channel.send({disableEveryone:true, embed});
This works?
Maybe do message.channel.send({embed});
@earnest phoenix yes
@earnest phoenix disableEveryone should be in the client constructor tho
// Client constructer
let client = new Discord.Client({
disableEveryone: true
});
Ok
Just wanted to make sure. I didn't want to be listing userinfo and it pinging everyone
embeds don't ping roles
๐
A Detailed Description Of Your Bot (HTML allowed)
Is that where you edit the profile of the bot? Like the background and shit?
yes
How do you get the background to work with the entire page.
๐คฆ
idk use css
ยฏ_(ใ)_/ยฏ
ยฏ_(ใ)_/ยฏ
Can anyone here help me with showing server count with python?
nvm I gotta try something first
yeah I looked in there but I've never done anything with aiohttp before
I get syntax error on
async with aiohttp.ClientSession() as session:```
I solved that
I think I got it, I just need to test with my actual bot
message.channel.send(`Deleted '${numDeleted - 1}' of '${num}' messages \`3\``).then(msg3 => {
setTimeout(() => {
msg3.edit(`Deleted '${numDeleted - 1}' of '${num}' messages \`2\``).then(msg2 => {
setTimeout(() => {
msg2.edit(`Deleted '${numDeleted - 1}' of '${num}' messages \`1\``).then(msg1 => {
setTimeout(() => {
msg1.delete();
}, 1000)
});
},1000);
});
}, 1000);
});
Easier way than this?
woah what the hell are you doing lol
Editing a message to display a counter. In which the message gets deleted
i mean you could just edit the same message
instead of .then everywhere
because it's just returning the same object
or async await because async await is bae
lol
I have it smaller.
well ill throw u some code anyway incase u want it
function deleter(msg){
var time = 5,
mess = "";
var interval = setInterval(function(){
if(time >= 0){
var message = msg.content.replace(/`([0-9])`/g, "");
msg.edit(message += "`"+time+"`");
time--;
}else{
msg.delete();
clearInterval(interval);
return;
}
}, 1000);
}
Yea, I got it smaller
aight
try {
const timeout = ms => new Promise(res => setTimeout(res, ms))
let msg = await message.channel.send(`Deleted **${numDeleted - 1}** of **${num}** messages \`${3}\``)
for(let i = 2; i > 0; i--) {
await timeout(1000);
msg = await msg.edit(`Deleted **${numDeleted - 1}** of **${num}** messages \`${i}\``);
}
msg.delete(1001);
} catch (Error) {
message.channel.send(`${message.author}, not good! There was an Error!\n\`\`\`${Error}\`\`\``)
}
Thanks to my other dev
ah i see
msg.delete is (1001) because it would delete half a second early with 1000
lol
It was strange
@earnest phoenix res()
} catch (err) {
message.channel.send(`${message.author}, not good! There was an Error!\n\`\`\`${err.stack}\`\`\``)
}```
pls



@vital lark Ok ๐
i don't send stack or people would see the retarded folder names that bullet came up with
named the google account "funnymemexdheheh"
Yea neither can I. Just realised it exposes Personal Names
if (message.guild.me.permissions.has('MANAGE_MESSAGES'))
Doesn't seem to work
thonk
message.channel.guild.members.find("id", message.author.id).hasPermission('BAN_MEMBERS')
thonk
/bots
just use .get
not /bot
@languid dragon Didn't work
it returns a boolean
message.member.permissions.has('BAN_MEMBERS') @earnest phoenix
works fine for me
just how i have my code written out
Becauses it's checking bots perms?
that checks the member's perms
message.guild.me.permissions.has('BAN_MEMBERS') checks the bots perms
Thats what it was before
if (!message.guild.me.permissions.has('MANAGE_MESSAGES')) return message.channel.send("I do not have the permission MANAGE_MESSAGES!");
Just won't work
??
what error does it actuallly give?
I found my problem. The bot was saying "You don't" Not "I don't". Therefor it was saying the Author didn't have permission. I was just blind
const timeout = ms => new Promise(res => setTimeout(res, ms))
let msg = await message.channel.send(`Deleted **${numDeleted - 1}** of **${num}** messages \`${3}\``)
for(let i = 2; i > 0; i--) {
await timeout(1000);
msg = await msg.edit(`Deleted **${numDeleted - 1}** of **${num}** messages \`${i}\``);
}
msg.delete(1001);
Also according someone else, this is API Abuse
setTimeout can't be below "60000"
probably is
i mean considering you're sending multiple requests to constantly change and edit a message
its probably why you dont actually see it implemented anywhere
and why i couldn't code a Snake game
Well I removed it anyway
for the better :*
I also love how I get people in Discord API trash talk me saying "It's useless". That's why I also ask here first. lol
yeah i hated the official discord documentation servers
they get really salty if you're not a professional asking simple questions
everything quite laidback here and chill
Yea
can't guarantee any of my answers r perfect but here 2 help if u wanna tag me whenever
lol

@languid dragon you're eww
that hurts me at a very deep and spiritual level
Meh
i wanna add a ban/kick command but i dont know how (using discord.js)
well, you need to get the player to kick/ban's GuildMember object
then .kick() them
I use msg.mentions.members.first(); and have the user mention the player to kick
I'd also recommend making sure you add something to it
permissions.has('KICK_PERMISSIONS') Or whatever it is. It'll make sure no one can just kick/ban someone
How do you check for in presence.game if it's empty? I've tried == 0 === "" === false === null === undefined
and with both .game.name and .game
what are you trying to do
if (!presence.game) // no game
yeah basically just do that
or if you wanna do it like this
you can do some fancy stuff
(presence.game ? presence.game.name : "Not playing a game")
try {
if (uuser.presence.game.name === null || !uuser.presence.game) {
gpre = "None"
} else {
gpre = uuser.presence.game.name
}
} catch(Error) {
gpre = "Invalid"
}
p_p
lol
I made the Try Catch. Someone I knew was making the bot Error using a broken Game
the Null was there to stop that
It was the one thing stopping it
no good checking if the name is null if the game is also null
that will cause an error
It never did?
you are catching it, you wouldn't see e.e
if(user.presence.game) { // do stuff } else { // do ther stuff }
shit
or if(!user.presence.game)
just use !presence.game pls
ok
ye
Well I guess you were right
see 
I'll just do
uuser.presence.game ? uuser.presence.game.name : 'None'
๐
try {
gpre = uuser.presence.game ? uuser.presence.game.name : 'None'
} catch(Error) {
gpre = "Invalid"
}
This is all g?
well at that point the try/catch is superfluous
For just in case moments I guess
why the hell do you have Error inside the catch arguments
Does anyone know the easiest thing to use for Emailing, using a Bot?
Emailing lol
var args = message.content.split(` `).slice(2).join(` `).split(` | `);
Content undefined??? I use
message I don't get why out of all the times I've used it, it stops now
@earnest phoenix using a premade bot or making it?
realises that DiscordMail exists
jk
as far as I know, there is Mailgun to use
sorry 7coil
It's not about that. Atm this code is just testing the command
All good
var args = message.content.split(` `).slice(2).join(` `).split(` | `);
var femail = args[0]
var fsubject = args[1]
var fmessage = args[2]
if (femail == 0) return message.channel.send(`${message.author}, You must input an Email!`);
else if (fsubject == 0) return message.channel.send(`${message.author}, You must input an Subject!`);
else if (fmessage == 0) return message.channel.send(`${message.author}, You must input an Message!`);
How would I fix this? It doesn't like do == 0 it just goes right passed it
if (fsubject >= 150) return message.channel.send(`${message.author}, The subject must not exceed 150 characters`);
if (fmessage >= 1000) return message.channel.send(`${message.author}, The message must not exceed 1000 characters`);
Same with here
why are you checking if it's a number
checking if its empty
ok
TypeError: Cannot read property 'length' of undefined





