use crate::{Context, Error};
use poise::serenity_prelude as serenity;
use rand::Rng;
static HUG_VEC: [&'static str; 48] = [
"https://media1.tenor.com/images/2d9902a4de4ad000be9ca64c5abac9a1/tenor.gif?itemid=8766309",
"https://media1.tenor.com/images/dd056f2e708792ce8085649eaf0c3307/tenor.gif?itemid=13964315",
"https://media1.tenor.com/images/4081db5de72d7b225be12e764715cb99/tenor.gif?itemid=13964310",
"https://i.kym-cdn.com/photos/images/original/000/360/344/26e.gif",
"https://media.giphy.com/media/t0K54lpOGUmlO/giphy.gif",
"https://i.kym-cdn.com/photos/images/newsfeed/000/464/096/ccb.gif",
"https://i.kym-cdn.com/photos/images/newsfeed/000/988/544/548.gif",
"https://i.gifer.com/IPJ1.gif",
"https://i.kym-cdn.com/photos/images/original/000/503/185/f38.gif",
"https://thumbs.gfycat.com/TepidPrestigiousAmazontreeboa-max-1mb.gif",
"https://thumbs.gfycat.com/SparseContentHypacrosaurus-small.gif",
"https://i.pinimg.com/originals/6d/7d/dc/6d7ddcb24307c502da6fcc17334251db.gif",
"https://i.pinimg.com/originals/16/b3/49/16b349b54d19818a895a2bd8ecebae3e.gif",
"https://66.media.tumblr.com/8e38820abca85c70a645079929471657/tumblr_oopymyHyz71vtnwhpo1_400.gif",
"https://media1.tenor.com/images/0ea597aa8a27770ff072b004a3dfbcdd/tenor.gif?itemid=14521586",
"https://media1.giphy.com/media/tKJqxkFT1y6qY/giphy.gif&key=909e231cc9819f389143bd5645661eac236a26cffc5bf69578000f0d2f8a6403",
"https://buffy.mlpforums.com/monthly_2019_05/2513213.gif.2bd1eb00f85e8c4ec5e212bac52a2815.gif",
"https://i.kym-cdn.com/photos/images/original/000/546/558/e57.gif",
"https://data.whicdn.com/images/333305271/original.gif",
"https://derpicdn.net/img/2014/4/10/597321/full.gif",
"https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/2b92ff77-0420-4b4a-bc2e-6a81f19bb447/d5o7mtq-61d57c24-4e23-4b3b-a67b-91b68ec155ff.gif?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3sicGF0aCI6IlwvZlwvMmI5MmZmNzctMDQyMC00YjRhLWJjMmUtNmE4MWYxOWJiNDQ3XC9kNW83bXRxLTYxZDU3YzI0LTRlMjMtNGIzYi1hNjdiLTkxYjY4ZWMxNTVmZi5naWYifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6ZmlsZS5kb3dubG9hZCJdfQ._cX9QVNRzOu0YXp89DlFun4gwd-lBx3wRBBQhWz0Uog",
"https://mrwgifs.com/wp-content/uploads/2013/05/Fluttershy-Rainbow-Dash-Excited-Hug-On-My-Little-Pony.gif",
"https://i.kym-cdn.com/photos/images/original/001/284/428/e2c.gif",
"https://i.kym-cdn.com/photos/images/original/001/284/454/d15.gif",
"https://i.kym-cdn.com/photos/images/original/001/508/796/105.gif",
"https://i.kym-cdn.com/photos/images/original/000/453/448/604.gif",
"https://pa1.narvii.com/6513/153ac19fe9f83512ee28e93cec3955eb75391e3f_00.gif",
"https://img.cartoongoodies.com/wp-content/uploads/2019/11/07164015/My-Little-Pony-Bear-Hug.gif",
"https://i.imgur.com/9ko6n.gif",
"https://ii.yuki.la/7/7c/8c06bd8120840fcbd02ec9c6babccb2113bba37844ac605c483987259484a7c7.gif",
"https://derpicdn.net/img/view/2017/5/20/1441283.gif",
"https://i.kym-cdn.com/photos/images/original/001/286/795/785.gif",
"https://i1.wp.com/derpicdn.net/img/2014/2/2/541180/full.gif",
"https://thumbs.gfycat.com/GlossyCloseAfricancivet-size_restricted.gif",
"https://i.pinimg.com/originals/d5/bf/21/d5bf21c9e018d40a6e9a3a0273e52ff1.gif",
"https://i.pinimg.com/originals/14/4f/17/144f17e18f9bb5fbd033bf467affd1b4.gif",
"https://i.kym-cdn.com/photos/images/original/000/334/693/430.gif",
"https://i.kym-cdn.com/photos/images/original/000/968/146/1c5.gif",
"https://i.gifer.com/X3Cw.gif",
"https://www.tamatalk.com/IB/uploads/gallery/album_14/gallery_193175_14_257519.gif",
"https://ii.yuki.la/c/92/dd67cf2750331016171f62e86dbd8fb209700e4ddbfe21a3ac668a006dd0892c.gif",
"https://i0.kym-cdn.com/photos/images/original/000/456/998/a7a.gif",
"https://derpicdn.net/img/view/2016/9/11/1247199__safe_screencap_animated_scootaloo_eyes+closed_hug_griffon_the+fault+in+our+cutie+marks_spoiler-colon-s06e19_hovering.gif",
"https://derpicdn.net/img/2012/7/5/32216/full.gif",
"https://i.kym-cdn.com/photos/images/original/001/166/921/31e.gif",
"https://i.kym-cdn.com/photos/images/original/000/513/996/2b1.gif",
"https://i.kym-cdn.com/photos/images/original/001/284/346/fbe.gif",
"https://derpicdn.net/img/2019/7/6/2084796/medium.gif",
];
static BOOP_VEC: [&'static str; 15] = [
"https://i.pinimg.com/originals/8f/67/20/8f6720fb8b277f120658fbceef9303b0.gif",
"https://66.media.tumblr.com/b916203f91fdc2d3a85aef6e1454d785/tumblr_oxljyr11c01w0by9bo1_400.gif",
"https://i.pinimg.com/originals/a6/39/fe/a639fe75e4e15ae4705fe1cff55aa0fe.gif",
"https://i.kym-cdn.com/photos/images/original/001/406/562/2d4.gif",
"https://66.media.tumblr.com/8ce960ad7d7a100ce87027809c41a728/tumblr_opwdkf56Mc1w0by9bo1_400.gif",
"https://i.pinimg.com/originals/92/8b/47/928b477daf42151c0db18edb9221172f.gif",
"https://thumbs.gfycat.com/AgileRectangularArizonaalligatorlizard-small.gif",
"https://buffy.mlpforums.com/monthly_2017_11/img-1331978-1-mlfw2090-87516_-_animated_boop_fluttershy_rainbow_dash.gif.444b4e7258a9e3e82606a312e87a1cec.gif",
"https://i.imgur.com/GInYrc7.gif",
"https://i.pinimg.com/originals/86/1d/49/861d494ec0115bb96892aad8e937a4a3.gif",
"https://i.kym-cdn.com/photos/images/original/001/243/977/85a.gif",
"https://i.pinimg.com/originals/f7/5b/d4/f75bd4ab2ba0a94a742c67a6df10486b.gif",
"https://i.pinimg.com/originals/e7/59/29/e7592972772130c45aaaea1001edb6dc.gif",
"https://i.pinimg.com/originals/aa/60/27/aa60277149600ea29500aa0318d01289.gif",
"https://derpicdn.net/img/view/2018/3/16/1682500__safe_artist-colon-grypher_derpibooru+exclusive_tempest+shadow_my+little+pony-colon-+the+movie_spoiler-colon-my+little+pony+movie_animated_boop.gif",
];
/// Boops the user! D'awwww
///
/// Usage:
/// ~boop <@User>
#[poise::command(context_menu_command = "Boop!", slash_command, prefix_command)]
pub async fn boop(
ctx: Context<'_>,
#[description = "The user to be booped"] user: serenity::User,
) -> Result<(), Error> {
let url = get_random_url_from_vec(BOOP_VEC.to_vec());
ctx.say(format!(
"<@{}> boops <@{}>! Awwwww!\n{}",
ctx.author().id.0,
user.id.0,
url
))
.await?;
Ok(())
}
/// Hugs the user with a random gif
///
/// Usage:
/// ~hug <@User>
#[poise::command(context_menu_command = "Hug!", slash_command, prefix_command)]
pub async fn hug(
ctx: Context<'_>,
#[description = "The user to be hugged"] user: serenity::User,
) -> Result<(), Error> {
let url = get_random_url_from_vec(HUG_VEC.to_vec());
ctx.say(format!(
"<@{}> hugs <@{}>! So kind of them.\n{}",
ctx.author().id.0,
user.id.0,
url
))
.await?;
Ok(())
}
fn get_random_url_from_vec(vec: Vec<&str>) -> &str {
let mut url = "";
let rand = rand::thread_rng().gen_range(0..vec.len());
url = &vec[rand];
url.clone()
}