Skip to content

Commit

Permalink
Group DM location cache support
Browse files Browse the repository at this point in the history
  • Loading branch information
melnary committed Aug 29, 2020
1 parent 60c961c commit 3278e44
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 47 deletions.
93 changes: 50 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rust-nitro-sniper"
version = "2.6.0"
version = "2.6.1"
authors = ["Mel"]
edition = "2018"

Expand Down
6 changes: 3 additions & 3 deletions src/cache.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use colored::*;
use serenity::http::Http;
use serenity::model::channel::Channel;
use serenity::model::id::{ChannelId, GuildId};
Expand Down Expand Up @@ -26,7 +25,8 @@ impl Location {
let channel_name = match channel {
Channel::Guild(guild_channel) => guild_channel.name,
Channel::Private(private_channel) => private_channel.name(),
_ => unimplemented!(),
Channel::Group(group) => group.name().to_string(),
_ => unreachable!()
};

Location {
Expand Down Expand Up @@ -64,7 +64,7 @@ impl LocationCache {
let location = match (guild_result, channel_result) {
(Some(Ok(guild)), Ok(channel)) => Location::new(Some(guild.name), channel),
(None, Ok(channel)) => Location::new(None, channel),
_ => return Err(())
_ => return Err(()),
};

Ok(location)
Expand Down

0 comments on commit 3278e44

Please sign in to comment.