How to send pictures?
alx168 opened this issue · 2 comments
alx168 commented
I have the bot sending messages on my server properly but how do I tell the bot to look in a directory and choose some random pictures and send those to the server?
alx168 commented
ok so I have this so far:
bot.uploadFile({ to: channelID, file: "file.gif" });
but I'm not sure about the random selection part
alx168 commented
So, basically just use fs package from npm and then grab the filenames from the directory. Then just use Math.random to choose three random ones and use the above code to send the three pics.