Add autosharding

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/13/head
trivernis 3 years ago
parent f1c65bb1e2
commit b87b1770fc
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -36,6 +36,7 @@ async fn stats(ctx: &Context, msg: &Message) -> CommandResult {
let uptime = current_time_seconds - Duration::from_secs(own_process.start_time());
let uptime = ChronoDuration::from_std(uptime).unwrap();
let total_commands_executed = database.get_total_commands_statistic().await?;
let shard_count = ctx.cache.shard_count().await;
let discord_info = format!(
r#"
@ -43,6 +44,7 @@ async fn stats(ctx: &Context, msg: &Message) -> CommandResult {
Compiled with: rustc {}
Owner: <@{}>
Guilds: {}
Shards: {}
Voice Connections: {}
Times Used: {}
"#,
@ -50,6 +52,7 @@ async fn stats(ctx: &Context, msg: &Message) -> CommandResult {
rustc_version_runtime::version(),
bot_info.owner.id,
guild_count,
shard_count,
get_queue_count(ctx).await,
total_commands_executed
);

@ -19,7 +19,7 @@ async fn main() {
let mut client = get_client().await.unwrap();
// start listening for events by starting a single shard
if let Err(why) = client.start().await {
if let Err(why) = client.start_autosharded().await {
log::error!("An error occurred while running the client: {:?}", why);
}
}

Loading…
Cancel
Save