moved the member-getter to as late as possible
This commit is contained in:
parent
3e490bb5c4
commit
84e4952752
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1175,7 +1175,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "reminder_rs"
|
||||
version = "1.0.2"
|
||||
version = "1.1.0"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"async-trait",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "reminder_rs"
|
||||
version = "1.0.2"
|
||||
version = "1.1.0"
|
||||
authors = ["jellywx <judesouthworth@pm.me>"]
|
||||
edition = "2018"
|
||||
|
||||
|
@ -349,8 +349,6 @@ impl Framework for RegexFramework {
|
||||
else if let (Some(guild), Some(Channel::Guild(channel))) =
|
||||
(msg.guild(&ctx).await, msg.channel(&ctx).await)
|
||||
{
|
||||
let member = guild.member(&ctx, &msg.author).await.unwrap();
|
||||
|
||||
if let Some(full_match) = self.command_matcher.captures(&msg.content) {
|
||||
if check_prefix(&ctx, &guild, full_match.name("prefix")).await {
|
||||
let pool = ctx
|
||||
@ -370,6 +368,7 @@ impl Framework for RegexFramework {
|
||||
.commands
|
||||
.get(&full_match.name("cmd").unwrap().as_str().to_lowercase())
|
||||
.unwrap();
|
||||
|
||||
let channel_data = ChannelData::from_channel(
|
||||
msg.channel(&ctx).await.unwrap(),
|
||||
&pool,
|
||||
@ -385,6 +384,8 @@ impl Framework for RegexFramework {
|
||||
.unwrap_or("")
|
||||
.to_string();
|
||||
|
||||
let member = guild.member(&ctx, &msg.author).await.unwrap();
|
||||
|
||||
if command.check_permissions(&ctx, &guild, &member).await {
|
||||
(command.func)(&ctx, &msg, args).await;
|
||||
} else if command.required_perms == PermissionLevel::Restricted
|
||||
|
Loading…
Reference in New Issue
Block a user