New memes
+ clippy + fmt
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
use crate::{command, group, GlobalData};
|
||||
use serenity::client::Context;
|
||||
use serenity::framework::standard::{Args, CommandResult};
|
||||
use serenity::model::channel::Message;
|
||||
|
||||
#[group]
|
||||
#[commands(nudetayne, tayne, celeryman)]
|
||||
pub struct CeleryMan;
|
||||
|
||||
#[command]
|
||||
#[aliases("NUDETAYNE")]
|
||||
#[only_in(guilds)]
|
||||
async fn nudetayne(ctx: &Context, msg: &Message, _args: Args) -> CommandResult {
|
||||
if msg.content.starts_with("!nudetayne") {
|
||||
msg.reply(&ctx.http, "Not computing, please repeat.")
|
||||
.await?;
|
||||
} else if msg.content.starts_with("!NUDETAYNE") {
|
||||
let mut data = ctx.data.write().await;
|
||||
let global_data = data.get_mut::<GlobalData>().unwrap();
|
||||
msg.reply(&ctx.http, "This is not suitable for work are you sure?")
|
||||
.await?;
|
||||
|
||||
global_data.bot_state.accepted_nsfw = Some(msg.author.id);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command]
|
||||
#[only_in(guilds)]
|
||||
async fn tayne(ctx: &Context, msg: &Message, _args: Args) -> CommandResult {
|
||||
msg.reply(
|
||||
&ctx.http,
|
||||
"https://media.tenor.com/115eUl2XUaAAAAAM/flarhgunnstow-paul-rudd.gif",
|
||||
)
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command]
|
||||
#[only_in(guilds)]
|
||||
async fn celeryman(ctx: &Context, msg: &Message, _args: Args) -> CommandResult {
|
||||
msg.reply(
|
||||
&ctx.http,
|
||||
"https://media.tenor.com/1iOUXZFLpBgAAAAM/dance-dancing.gif",
|
||||
)
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,17 +1,50 @@
|
||||
pub mod album;
|
||||
pub mod celeryman;
|
||||
pub mod color;
|
||||
|
||||
use crate::error::Error;
|
||||
use crate::{help, hook, imgur, GlobalData};
|
||||
use rand::prelude::SliceRandom;
|
||||
use serenity::async_trait;
|
||||
use serenity::client::Context;
|
||||
use serenity::framework::standard::{
|
||||
help_commands, Args, CommandGroup, CommandResult, HelpOptions,
|
||||
};
|
||||
use serenity::model::channel::Message;
|
||||
use serenity::model::id::UserId;
|
||||
use serenity::model::prelude::Ready;
|
||||
use serenity::prelude::EventHandler;
|
||||
use std::collections::HashSet;
|
||||
|
||||
pub struct Handler;
|
||||
|
||||
#[async_trait]
|
||||
impl EventHandler for Handler {
|
||||
async fn message(&self, ctx: Context, new_message: Message) {
|
||||
if new_message.author.bot {
|
||||
return;
|
||||
}
|
||||
|
||||
if new_message.content.eq_ignore_ascii_case("yes")
|
||||
|| new_message.content.eq_ignore_ascii_case("mhmm")
|
||||
{
|
||||
let mut data = ctx.data.write().await;
|
||||
let global_data = data.get_mut::<GlobalData>().unwrap();
|
||||
|
||||
if let Some(u) = global_data.bot_state.accepted_nsfw {
|
||||
if new_message.author.id == u {
|
||||
new_message.reply(&ctx.http, "||https://cdn.discordapp.com/attachments/614891432079130625/1041545254362423368/unknown.png||").await.unwrap();
|
||||
global_data.bot_state.accepted_nsfw = None;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn ready(&self, _: Context, ready: Ready) {
|
||||
println!("Connected as {}", ready.user.name);
|
||||
}
|
||||
}
|
||||
|
||||
#[hook]
|
||||
pub async fn after(
|
||||
_ctx: &Context,
|
||||
|
||||
Reference in New Issue
Block a user