Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "RustBot"
version = "0.5.1"
version = "0.5.2"
authors = ["Tim Hillier tim.r.hillier@gmail.com"]
edition = "2024"

Expand Down
13 changes: 12 additions & 1 deletion src/commands/runescape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,20 @@ pub async fn grand_exchange_history(
ctx: Context<'_>,
#[description = "The name of the item you want to look up"]
#[rest]
item: String, // make this optional so that if they just do !hs then it just does the last item.
mut item: String, // make this optional so that if they just do !hs then it just does the last item.
) -> Result<(), Error> {
let time_length = 10;
let database = connect_to_database().await;
let alias = sqlx::query!("SELECT item FROM ge_aliases WHERE alias = ?", item)
.fetch_optional(&database)
.await?;

if let Some(alias) = alias
&& alias.item.is_some()
{
item = alias.item.unwrap();
}

let response = RSClient::new().item_name(item).get_price_history().await?;
let item_name_formatted = response
.item
Expand Down
Loading