if(message.content === prefix + "avat"){
let args = message.content.split(" ")
let member = message.mentions.members.first() || message.guild.members.get(args[0]) || message.author;
let embed = new Discord.RichEmbed()
.setTitle(member.tag + '\' avatar')
.setImage(member.avatarURL);
message.channel.send({embed})
}
})
``` a!avat give me my avatar but it don't work for mentioned users or args
#development
1 messages · Page 494 of 1
30mb flac 👌
flac is prety cool but im 90% sure what he has right there is an audio conversion site so either way
whatever the source audio is
i may be wrong
wav is better than flac. but for size flac is cool
wav is better then flac?
TIL
i thought the whole idea for flac is well
its flawless
no loss
yeah wav is indeed better
wav is normaly larger too
neat
WAV is equal to FLAC in sound quality
FLAC is compressed but still lossless
so I would say using FLAC is better
^
But if you want to share the audio file with users or upload it somewhere mp3 is the best to go... But otherwise use FLAC for just general encoding/deciding purposes
Anybody know how to do action when a user make a reaction ?
listen to reaction events
How ? @earnest phoenix
what lib
Js
what lib
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-messageReactionAdd
https://img.69420.me/SUixtXXg.gif
Thanks
help
me
rn
how do i make my website avaliable for everyone to see
aaaaand that is?
wamp
confi file
googles wamp
ouch
@earnest phoenix what's your hosting environment?
windows version, network setup, open ports etc
wampserver
if you have a VPS you just set Listen 80 or Listen 443 if you have ssl cert
wampserver only tells me that you use windows
wamp stands for windows, apache, mysql and php, but you probably know this; apache works on windows, you just need to open the right ports (80, 443) and set Listen property to appropriate ports
what if i wanted to host it on a vps?
what do you have as a vps, which os?
my vps is windows server 2016
yes wamp should work
but if you can't access the webserver, you probably don't have the ports open in the firewall
YES
windows firewall
oh
but linux is hard
oof


jesus
yes @earnest phoenix

can i host a website on discord
can i host a website on a website
itwasajoke
i tried opening from the fire wall
and i check it says its clode
closed
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa. i am sooooooooooo pissssssed rn
owo
dbl: making crackable rdps since 2018
^
i have open only port 80
why do flipin is it blocked
do uaactually have the server running and listening on that port
umm that pic is from my
vps
shows ip
and wamp isnt running on it

iooooh
omg
aaaaaaa
can i just freakin
do port 8080
which is https i believe
https is 443
well
8080 is http-alt
yes
what do i put there, sorry because i'm new to this stuff
not to the port part
but yea
do i do [::0]:443
?
do you have a ssl cert?
no
well then you can't use https
http
which is port 80?
indeed
are you using a vps or your computer
Class Summary Apache is the most popular web server software. The course is geared to make you a Apache pro. Once you digest all basics, the course will help you create your very own production Web S
ngl I read that as gru 99 for a second
xd
then use port 8080 on your pc
but if you don't want ppl to enter port in the browser you'll have to use port 80
how do make bot status dnd in d.js 
i tried using port 8080
gave me this
oh
i needed to type in the port
nvm
but
wamp only allows my pc to view the website
thats the whole reason i was asking
oh
my vps has port 80 blocked for non-root users and running node as root says node is not installed/found
i tried running sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000
but the rule doesnt work or show up in the iptables list
im running express on port 3000 which works, but i want to run on http since i have a domain hooked up via dns
any ideas?
how did you install node?
via nvm
nvm install x.x.x
i've read that running node as root is a bad idea, and its best to use port forwarding/redirection
@quartz kindle best bet is to use a reverse proxy
Something like nginx will do fine
in discord.js, i dont get how you use js message.reactions()
i want to check if it has ⬅
i dont get the docs
message.reactions() deprecated?
For one, reactions is a property not a method
what would i use instead?
It's not deprecated
I'm starting to think that he's just adding () to pretty much everything 
Yep
() = function
Did you not read the docs before asking?
i did
Oh wait, you did

message.reactions is a collection of MessageReactions which have an emoji property
Then you read them wrong
So then you can compare MessageReaction.emoji.name to the Unicode of the emoji
no
Do you know what a collection is?
no

it doesnt have snowflake or MessageReaction
i did
No you didn't
i did
If you did, then you wouldn't be saying message.MessageReaction.emoji.left_arrow
So I know you didn't
I think he needs to read js docs than discord.js tbh
well that was for what you said iTexlo
and i dont get Collection<Snowflake, MessageReaction>
I didn't tell you to use that, though
It's a Collection of MessageReactions keyed by their ids
I sent the link to all the collection methods, use your brain and eyes to find one that works
Are you waiting for the user to react before doing something?
when they react it edits the message
the clears reactions, and adds ➡
then changes if they react again
You should use a reactioncollector https://discord.js.org/#/docs/main/stable/class/ReactionCollector
in my opinion, that will be too hard for you while you have so few knowledge of js
How do I round to 2 decimals in python is something I found on google, but is there a simplified version? or can someone please explain me the way it has to be done?
round(number, 2) 
wow... ok
all other examples I found are super overcomplicated then
yeah thanks, that's what I wanted
can someone help me with html ?
what do you need?
I somehow cant add an image on my color background
like when I get the color , the image goes away , and when I have the image the color goes away
googles image api is actually incredibly entertaining to play with
How dafuq i start learn codding ??(like feurst things i need to d)
wot
what
adding image recognition to bot for keks
its going well
but for complex things it starts to freak out
:/
response time from googles servers is also really shitty
hello i have a question can somebody tell me thats using .py please
How could I get my bot to find a chat from a guild that’s provided that the bot has create invite perms in
uh you could loop through each channel in the server
and then check perms
But that is hella API heavy so not good for big bots
I would just make it be the current channel and if not display an error
@earnest phoenix
How would I do that just server.defaultChannel? Or something else idk
@night imp
wait
defaultChannel for guilds is decepercated
decepercated
Okay
https://github.com/AnIdiotsGuide/discordjs-bot-guide/blob/master/frequently-asked-questions.md @earnest phoenix
I mean what you could do is search for the more common chats, such as general, lounge, etc. That's if you want to do that
is there a way for me to convert a discord.js file to .py ?
? @west raptor
I don't know if theres something that would convert it for you, you might have to do it yourself
mmm ok so basically i need to recode the bots as i have 4 running 😦 @west raptor
and the vps server required the bots to be on .py 😢
Weird
Well the thing is the libraries aren't the same, so even if you find something to convert it, it wouldnt do much for you since the libraries are different
OVH ubuntu 16.04 @earnest phoenix
Yes
i did try pm2 for it and doesnt work 😦 but yeah will just have to recode it then
Or you can find another vps
Yes, if you did it right once, then why change it if it works
Yeah
nope google cloud is too expensive but i have the time to do it 😦 so will just have to redu it
you get free credits if you link your credit/debit card
Then find a friend that would host your bot for you
I got £200 free when I did mine
¯_(ツ)_/¯
Just a suggestion but it’s probably the better choice to use google cloud instead of recoding your whole bot
I hate coding with permissions
The great thing about programming is that you learn to problem solve and use it in programming, or in real life and learn to do it better and cheaper. Start using those skills @slate kayak
how would use a string variable on JSON syntax
ie
let foobar = "uwu"
let json = {
uwu : "hastebin no"
}
json.foobar
json[foobar]
thanks
Yeah I know
I did something
That was bad
And it
Yeah
I get those every other day so honestly its nothing
that's actually extremely bad
getting OOM with javascript frequently means you're doing something wrong, and you're doing it really wrong
I have a question for hosting. I wanna move onto a paid form of hosting rather than using the free tier in heroku (need more memory). Could anyone recommend good services that accept PayPal payments? I'm thinking about signing up for digital ocean but I genuinely do not know what to do. My bot runs on node.js btw
literally any cheap VPS provider will do
a lot of people like galaxygate, I myself use both DO and OVH
OVH is great but so far has slow support
I'm really liking DO's plans tbh
They look perfect
will check out OVH and galaxygate
I checked out galaxygate and everything looks good
how do you create a role and in the options specify the permissions, such as SEND_MESSAGES: false
but I'm confused about the hostname part @sick cloud
Do I have to register a domain for this?
Cloud -> VPS
@earnest phoenix what lib
How can I get guild's avatar?
@earnest phoenix what lang and lib
@earnest phoenix guilds usually have an iconURL or icon property
@earnest phoenix look at the docs
stable has Guild#createRole
im using master
master has roles#create
its not that
ok
so use roles.create
speak: false
and add perms to it
add
permissions: ["SEND_MESSAGES off"]
??

wait is it deny: []
https://discord.js.org/#/docs/main/master/typedef/RoleData is what you pass to createRole
createRole doesn't exist in master
yes i know what he means
its Guild#RoleCollection .create
it accepts permissions: [] but that is allowing
Yes
Don't put it in there then
:|
Roles either have permissions or don't, neutral doesn't come into play until permission overwrites
can't find it
check out the functions for guild
already did
what version you on texusak
oof ight
I'm trying to create an event
and it's still giving me this shit error
of undefined
.-.
what's the code and error?
guild.iconURL
guild is undefined
^
and are you on master
already defined it
what event
channel.guild.iconURL()
^
channel.guild
oki
same @zealous veldt
<Client>.on('channelCreate', channel => {
channel.guild
// => Guild object
channel.guild.iconURL()
// => string, containing what you want
});
is 600mb memory usage okay for a bot of this size?
i'm trying to make sure it isn't leaking or anything, never owned a bot this big
depends on what it does
it just does api stuff, and runs a constant setInterval every 30 seconds
seems a bit high
yes CTRL+C 
moose pls
I mean it's the best possible solution
yes
so instead of having two files is there a way to get the keys as its own array and then actually use the keys and get the array from those keys bla
🤔
So im currently using an array[key] type thing in a json file, i'm curious if there's a way that instead of having a seperate file with an array with the list of all the keys if theres a way to grab all the keys along with it so it's all compacted to the same file
so like for example
byp.json
"ass": ["yada"]
}```
and
swears.json
```{
"var": ["ass", "yada"]
}```
so instead of having two files is there a way to get the keys as its own array and then actually use the keys and get the array from those keys bla
is it so you can log what bad word they were trying to say?
i dont understand the purpose of the arrays and such
i guess you could just pop the entire thing into an array and just pop a .includes fro messages
So basically its a byp.json (bypass) and a swears.json, so it first checks if the message matches the swears.var and if it does then it uses the swears.var it matches as a key to byp and tests if it matches any of those
i tried loggin like just byp, and it doesnt seem to have what i needed
i need two seperate arrays
whithout the containing array
ok then in that case get the message, run a foreach on the json file and check every array if they .include
?
let blah = //json object
blah.forEach(obj => {
if(obj.includes(/*WORD*/){
//if they said a baddie
}
})
ye?
would check every array in the json file for the word
yeah thats what i already have set up
im not really sure what your trying to accomplish in that case xF
but it finds the containing array, not the actually keys
we'll use ass as an example because its not as bad
so inside ass, so what i do to check is byp['ass'].forEach( if matches bla
so once you match it and its in the array you want to know what 'category' its in?
no i already got that
but what happens first to see which key to use
is it used swears.var
which is a COMPLETELY seperate file
which means i have to update both to add a word
whats the diffrence between the files?
why not consolidate it?/
so this is swears.var
😂
it contains all those words
ok so it contains the keys
yup
and you wnt to also check for keys?
so i want to not need swears.var and be able to get the words that swears.var has, from byp.json where they're keys
could i do something like this?
{
"words":[
"ass": {"ignore":["wass", ""]}
]
}```
oh oki
maybe index notation 🤔
let obj = //json object
Object.keys(obj).forEach(key => {
//key = keys string
//obj[key] = array
})
i think that should work just find
try that out
and check the word they say against key and obj[key].includes
@slim heart report back to me if that worked
np
i was just adding it to everything cuz everything was crashing when i deleted the file but yeah
thanks so muuuch
npnp
Hey
hi
Do you know what events if we change avatar ?
what library
Discord.js
are that ?
Yeah but how its work ?
the first var in the callback is the old member, second is new member
}else if (oldMember.user.displayAvatarURL !== newMember.user.displayAvatarURL){
editEmbed.setImage(new Discord.Attachment(await updateAvatar))
editEmbed.setFooter("Avatar Updated",oldMember.user.displayAvatarURL)
editEmbed.setColor("RANDOM")
```
I want make it like that
not gunna spoonfeed ya but heres the jist
client.on('guildMemberUpdate', (old, notOld) =>{
old.avatarURL //this is the old avatarurl
notOld.avatarURL //this is the new avatarurl
})```
i have faith you can figure that out
oj
Ok
And the request for Canvas ?
Like await get(oldMember.avatarURL) ? This wrong or true ?
i want make it in canvas
Yeah
do you know how js canvases work?
im assuming ur using nodecanvas
Im using canvas-constructor
const oldAvatar = (await get(oldMember.user.avatarURL)).body;
im not sure how that library works specficially but
normal canvas you can create a buffer with the fs lib
wha..
k
How that things work ?
Djs
learn canvas omegalul
idk the events thing work
I know the canvas
else if (oldMember.avatarURL !== newMember.avatarURL){
editEmbed.setImage(new Discord.Attachment(await updateAvatar))
editEmbed.setFooter("Avatar Updated",oldMember.user.displayAvatarURL) editEmbed.setColor("RANDOM")
Are thats rigth ?

thats not even canvas
i haven't used d.js in months
the canvas im make it an function
const oldAvatar = (await get(oldMember.user.avatarURL)).body;
const newAvatar = (await get(newMember.user.avatarURL)).body;
var hasiln = oldMember.user.username.length > 7 ? oldMember.user.username.substring(0, 7) + ".." : oldMember.user.username;
async function updateAvatar () {
return new Canvas(460,260)
.setColor('#1d1d1d')
.addRect(0, 0, 450, 260)
.addImage(oldAvatar, 0,0, 225, 225)
.addImage(newAvatar, 225, 0, 225, 225)
.setTextFont('24px Impact')
.setColor('white')
.addText(`${hasiln} updated his avatar!`, 40, 250)
}
looks good
but it'snt work
whats the error
is that even a event tho
Maybe
Still not work
Like when you send canvas maybe its need Attachment
Ok lemme try
just keep the await updateAvatar
Wait i will make it short
you just can ignore it
My channel is per server settings
Or maybe the code in event is wrong
smh ok
lol
Why
He pinged for help
He pinged mods
Too bad they don’t have warns here just mute,ban n kick
I need help (d.js)
client.on('messageUpdate', (oldMessage, newMessage) => {
let embed = new Discord.RichEmbed()
.addField("Edited Message", "Original:\n" + oldMessage.content + "\nNew Message:\n" + newMessage.content + "")
client.channels.get(jsonfile.readFileSync("data/moderation.json")[oldMessage.guild.id]).send(embed)
});
whoops
it spams
idk why
ignore the fact im using jsonfile
imma switch to enmaps in the final build
can I help
lol
invite me to a server that you own with the bot in it
k
ok , so I have a problem , each time I have the bg color on the page , the image goes away , and when the image is on the page , the color goes away (html)
eh ye , but none of the stuff works what I find lol
Hey, did someone know how to get reaction of user when they add one to a message in python.
I tried this but it prints directly the class of reaction :
emo = discord.utils.get(client.get_all_emojis(), name='time')
await client.add_reaction(ctx.message, emo)
res = await client.wait_for_reaction(emoji=emo, message=ctx.message)
print(res)```
I tried other things but idk why it doesn't await
Can somebody tell me how can I make a command using python? The method I used didn’t work anymore
what did you use
@client.command
ok I was actually here to ask how can I make a bot say something
command()
client.say don’t work now for me
it also depends what version of discord.py you are using
can I make the bot tag the prefix with an eval command?
sry if that is an stupid question
regex
?
how do you make the bot show #servers on the dbl web page?
mine has said N/A all day
@exotic timber
no
i can't find this my bots page
does anyone know how to keep an JS bot online 24/7 without keeping the pc on?
raspberry pi or vps
Vps is probably better, since you are not using electricity with a vps
But it's up to you

yeah and a pi costs as much as like 2 years on basic w scaleway anyway
Also
dream do you know how i find my token?
k
Ok sorry personal issues
So I'm on mobile so I'm trying to remember
Let me get on PC rq
thanks man
ok so just clicking on your bot will display the token https://i.imgur.com/ZPWpFLN.png
@exotic timber
https://hastebin.com/agaperonez.js
ReferenceError: serverQueue is not defined
...
https://i.imgur.com/ZBQMUQz.png hahayes
hahayes
wut
same problem
wtf
https://hastebin.com/agaperonez.js
ReferenceError: serverQueue is not defined
LOOK WTF
wait
https://hastebin.com/acewuyiyew.js
ReferenceError: serverQueue is not defined
serverQueue isnt defined in the function
define it
const serverQueue = queue.get(guild.id);```
literally change one letter
ok
line 58 btw
ik
ReferenceError: message is not defined
🤦
i can put ```js
function play(guild, song , MESSAGE)
@west raptor
?
but then it's the same thing with the serverqueue
what
const serverqueue = queue.get(guild.id);
var serverQueuef = queue.get(guild.id);
....
i can delete the serverQueuef?
ok so
look
function play(guild, song) {
const serverQueue = queue.get(guild.id);
if(!song){
serverQueue.voiceChannel.leave();
queue.delete(guild.id);
return;
}
const dispatcher = serverqueue.connection.playStream(ytdl(song.url))
.on('end', () => {
console.log('A song was ended.')
serverQueue.song.shift();
play(guild, serverQueue.song[0]);
}).on('error', error => console.error(error));
dispatcher.setVolumeLogarithmic(serverQueue.volume / 5);
}``` why did you out a f at the end
im confused about that
:|
function play(guild, song) {
const serverqueue = queue.get(guild.id);
if(!song){
serverqueue.voiceChannel.leave();
queue.delete(guild.id);
return;
}
const dispatcher = serverqueue.connection.playStream(ytdl(song.url))
.on('end', () => {
console.log('A song was ended.')
serverqueue.song.shift();
play(guild, serverqueue.song[0]);
}).on('error', error => console.error(error));
dispatcher.setVolumeLogarithmic(serverqueue.volume / 5);
}
it's ok now?
what
:/
So i stopped working with Discord Bot maker and startet working with js (visual studio)
now my question.
i made a config.json with the prefix in it and token etc.
how do i get the Bot tag as a prefix too?
thats my config
tag me pls if u answer
node_modules amiright
can anyone help me with heroku?
solution: don't use heroku
deleted
ఋ Triple fesses !
emm, how to upload files from computer to bot?
wut
?
hey...does anyone know how can I draw a image over a image (using Jimp)
hey
?
Like you cant upload files to your bot
¯_(ツ)_/¯
im have some trouble with some code
coding lang?
u have to make it
Lol
hey...does anyone know how can I draw a image over a image (using Jimp)
@lean minnow use canvas 
^
?
How to turn on this bot?
Canvas is na npm package
ok...
@woeful gorge What is the coding lang?
bot.js
node bot.js
i did it in program Discord Bot Maker
oh 
Ew
🤦
And i wan't to always active bot
That program is trash
learn to code and dont use discord bot maker
you coud have asked in their server
you just wasted $10 tbh
Or he could learn Javascript
ask for refund
5$*
hey should i use pycharm
10$
I payed 5$
It is 10
ok
just use visual studio code @cobalt pier
ok thx
free and not laggy 
well any jetbrains ide is slow on my laptop
heh
@woeful gorge you need to pay for a VPS
No you don't
learn to code https://www.codecademy.com/
@lean minnow You don't
you do
Not
I use pm2
oof
not possible
RENT A VPS
Use VPS then
Ehh ok
-_-
@lean minnow Shhhh the kids are sleeping and it is past your bed time
- windows key + r
- type in cmd
- cd to your directory
- node bot.js
or just
So for what is this website?
CTRL + SHIFT + Right Click in the bot folder
and pick Command prompt
then do node bot.js
it will show powershell
ok but For what is this website?
list your bot
I use a thing called a friend who has a linux server and let's me use it
what a shocker
ok im being mean good bye
I cant intall canvas
npm i canvas@next
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@1.6.12 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.6.12 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\alexc\AppData\Roaming\npm-cache_logs\2018-09-29T17_41_00_482Z-debug.log
Ok
??
wait
and cairo
What
You need build tools and cario
¯_(ツ)_/¯
I just read the docs
hey is it possible to make a discord bot in python
yes
yes
ok
i already posted the docs but ok
how can i put 2 prefixes?
or more
.
@earnest phoenix try starting with:
what's your library?
which version?
which language?
FINNALY I DID IT
Where should I even start with an AI chat bot?
I have fairly extensive knowledge of NodeJS.
if you are looking into any deep or machine learning you should look in python
primarily tensorflow
@earnest phoenix you can use a cleverbot API
@earnest phoenix I am looking for a "free" API or to make it myself.
Okay
There are some good free ones out there
I may use Wit
As for making it yourself, good luck...
Heh. Cant be to hard!
😄
I'm sure basic phrases are easy
Mhm.
But you don't want a chat bot just for basic phrases
I do not intend to.
It is quite simple, the bot just needs to extract keywords.
your best bet would be making a model with tones of lines and responses then training it with tensorflow
hi, what program do you prefeer to easy make bots?
discord bot maker
you can get it in steam store
(i don't prefer it, but it's easy)
the other way is to learn a programming language
do the other way
dbl doesnt either
hi so im working on a sudo command 'cause im bored and when trying to set a member property it return this error: js TypeError: Cannot set property member of [object Object] which has only a getter
also here's code
if (!this.client.commands.get(command)) return msg.channel.send('Not really a valid command...')
msg.author = user.user
msg.member = msg.guild.member(user);
msg.content = `${msg.guild.settings.prefix}${command} ${args}`
this.client.commands.get(command).run(msg)```
setting the .author property works fine, im not sure why setting .member property returns that
ive tried everything
my head hurts because i dont understand this error 
oh
also are you using master?
yea
on master its a getter what gets from cache
you dont need that
it will always be up to date




