mirror of
https://github.com/ethanrusz/echbot.git
synced 2024-11-21 11:47:46 -05:00
Remove in progress components from main
This commit is contained in:
parent
f4ccf55906
commit
17dbf3d906
2 changed files with 0 additions and 62 deletions
|
@ -1,31 +0,0 @@
|
||||||
use chrono;
|
|
||||||
use crate::Error;
|
|
||||||
use serde::{Serialize, Deserialize};
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
|
||||||
struct Session {
|
|
||||||
ret_msg: String,
|
|
||||||
session_id: String,
|
|
||||||
timestamp: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) async fn get_random_god() -> Result<(), Error> {
|
|
||||||
let timestamp = chrono::Utc::now().format("%Y%m%d%H%M%S").to_string();
|
|
||||||
let method = "createsession";
|
|
||||||
let dev_id: String = std::env::var("DEV_ID")
|
|
||||||
.expect("Missing DEV_ID");
|
|
||||||
let auth_key = std::env::var("AUTH_KEY")
|
|
||||||
.expect("Missing AUTH_KEY");
|
|
||||||
|
|
||||||
let hash = md5::compute(format!("{}{}{}{}", dev_id, method, auth_key, timestamp));
|
|
||||||
let signature = format!("{:x}", hash);
|
|
||||||
|
|
||||||
let request = format!("https://api.smitegame.com/smiteapi.svc/createsessionJson/{}/{}/{}", dev_id, signature, timestamp);
|
|
||||||
println!("{}", request);
|
|
||||||
let response = reqwest::get(&request).await?;
|
|
||||||
|
|
||||||
let sessions: Vec<Session> = response.json().await?;
|
|
||||||
println!("{:?}", sessions);
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
use crate::{Context, Error};
|
|
||||||
|
|
||||||
use crate::commands::api::get_random_god;
|
|
||||||
|
|
||||||
/// Picks a random something
|
|
||||||
#[poise::command(slash_command, subcommands("god", "mode"))]
|
|
||||||
pub(crate) async fn random(
|
|
||||||
_ctx: Context<'_>,
|
|
||||||
) -> Result<(), Error> {
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Picks a random god
|
|
||||||
#[poise::command(slash_command)]
|
|
||||||
pub(crate) async fn god(
|
|
||||||
ctx: Context<'_>,
|
|
||||||
) -> Result<(), Error> {
|
|
||||||
let god = "some god";
|
|
||||||
get_random_god().await?;
|
|
||||||
// ctx.say(format!("{}", god)).await?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Picks a random mode
|
|
||||||
#[poise::command(slash_command)]
|
|
||||||
pub(crate) async fn mode(
|
|
||||||
ctx: Context<'_>,
|
|
||||||
) -> Result<(), Error> {
|
|
||||||
ctx.say("Waiting for that sweet API access.").await?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
Loading…
Reference in a new issue