diff options
| author | Nathan Perry <avaglir@gmail.com> | 2018-05-03 22:08:54 -0400 |
|---|---|---|
| committer | Nathan Perry <avaglir@gmail.com> | 2018-05-03 22:11:02 -0400 |
| commit | a52eae2964e8e86bf3e587f17d607025f07efdbb (patch) | |
| tree | 4d73278ab811280d57fde01d7635e4b3898b09f2 /src/commands/meme.rs | |
| parent | 652a36f172df43c080d6dc1d3680166ee3045f82 (diff) | |
support message deletion0.1.4
Diffstat (limited to 'src/commands/meme.rs')
| -rw-r--r-- | src/commands/meme.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/commands/meme.rs b/src/commands/meme.rs index 6c78fc5..d1c90d1 100644 --- a/src/commands/meme.rs +++ b/src/commands/meme.rs @@ -61,11 +61,16 @@ pub fn addmeme(_: &mut Context, msg: &Message, mut args: Args) -> Result<()> { metadata_id: 0, }.save(&conn, msg.author.id.0).map(|_| {})?; - return msg.react("👌"); + msg.react("👌") } -pub fn delmeme(_: &mut Context, msg: &Message, _: Args) -> Result<()> { - send(msg.channel_id, "hwaet", msg.tts) +pub fn delmeme(_: &mut Context, msg: &Message, mut args: Args) -> Result<()> { + let title = args.single_quoted::<String>()?; + + let conn = connection()?; + delete_meme(&conn, &title, msg.author.id.0)?; + + msg.react("💀") } pub fn renamememe(_: &mut Context, msg: &Message, _: Args) -> Result<()> { |
