Core/Prelude: Fix lifetime unsoundness

This commit is contained in:
Natsu Kagami 2020-09-07 02:09:06 -04:00
parent c672a8836c
commit f1719019d1
Signed by: nki
GPG key ID: 73376E117CD20735
9 changed files with 150 additions and 112 deletions

View file

@ -20,26 +20,30 @@ pub use fun::FUN_GROUP;
pub fn setup(
path: &std::path::Path,
client: &serenity::client::Client,
data: &mut youmubot_prelude::ShareMap,
data: &mut TypeMap,
) -> serenity::framework::standard::CommandResult {
db::SoftBans::insert_into(&mut *data, &path.join("soft_bans.yaml"))?;
db::Roles::insert_into(&mut *data, &path.join("roles.yaml"))?;
// Create handler threads
std::thread::spawn(admin::watch_soft_bans(client));
tokio::spawn(admin::watch_soft_bans(
client.cache_and_http.clone(),
client.data.clone(),
));
Ok(())
}
// A help command
#[help]
pub fn help(
context: &mut Context,
pub async fn help(
context: &Context,
msg: &Message,
args: Args,
help_options: &'static HelpOptions,
groups: &[&'static CommandGroup],
owners: HashSet<UserId>,
) -> CommandResult {
help_commands::with_embeds(context, msg, args, help_options, groups, owners)
help_commands::with_embeds(context, msg, args, help_options, groups, owners).await;
Ok(())
}