mirror of
https://github.com/eRgo35/lyra.git
synced 2026-02-04 04:16:11 +01:00
tools and kashi init
This commit is contained in:
10
src/commands/kashi/kashi.rs
Normal file
10
src/commands/kashi/kashi.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use serenity::{all::Message, client::Context, framework::standard::{macros::command, CommandResult}};
|
||||
|
||||
use crate::commands::misc::check_msg;
|
||||
|
||||
#[command]
|
||||
async fn kashi(ctx: &Context, msg: &Message) -> CommandResult {
|
||||
check_msg(msg.reply(ctx, "Kashi lyrics platform integration").await);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
1
src/commands/kashi/mod.rs
Normal file
1
src/commands/kashi/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod kashi;
|
||||
@@ -1,2 +1,4 @@
|
||||
pub mod kashi;
|
||||
pub mod misc;
|
||||
pub mod music;
|
||||
pub mod misc;
|
||||
pub mod tools;
|
||||
|
||||
0
src/commands/music/play.rs
Normal file
0
src/commands/music/play.rs
Normal file
1
src/commands/tools/mod.rs
Normal file
1
src/commands/tools/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod ping;
|
||||
17
src/commands/tools/ping.rs
Normal file
17
src/commands/tools/ping.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use std::time::SystemTime;
|
||||
|
||||
use serenity::{all::Message, client::Context, framework::standard::{macros::command, CommandResult}};
|
||||
|
||||
use crate::commands::misc::check_msg;
|
||||
|
||||
#[command]
|
||||
async fn ping(ctx: &Context, msg: &Message) -> CommandResult {
|
||||
let system_now = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_millis() as i64;
|
||||
let message_now = msg.timestamp.timestamp_millis();
|
||||
|
||||
// println!("System Time: {} ||| Message Time: {}", system_now, message_now);
|
||||
|
||||
check_msg(msg.reply(ctx, format!("Pong! (latency: {} ms)", system_now - message_now)).await);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
13
src/main.rs
13
src/main.rs
@@ -17,11 +17,18 @@ use serenity::{
|
||||
|
||||
mod commands;
|
||||
|
||||
// music management commands
|
||||
use crate::commands::music::deafen::*;
|
||||
use crate::commands::music::join::*;
|
||||
use crate::commands::music::leave::*;
|
||||
use crate::commands::music::mute::*;
|
||||
|
||||
// tools
|
||||
use crate::commands::tools::ping::*;
|
||||
|
||||
// kashi
|
||||
use crate::commands::kashi::kashi::*;
|
||||
|
||||
struct HttpKey;
|
||||
|
||||
impl TypeMapKey for HttpKey {
|
||||
@@ -38,7 +45,11 @@ impl EventHandler for Handler {
|
||||
}
|
||||
|
||||
#[group]
|
||||
#[commands(join, deafen, leave, mute)]
|
||||
#[commands(
|
||||
join, deafen, leave, mute,
|
||||
ping,
|
||||
kashi
|
||||
)]
|
||||
struct General;
|
||||
|
||||
#[tokio::main]
|
||||
|
||||
Reference in New Issue
Block a user