feat(discord): Moved most strings to Strings
- Added Error::AccountIsSelf variant - /balance give to self now returns error
This commit is contained in:
parent
aec4ef8339
commit
787118309a
7 changed files with 247 additions and 85 deletions
|
|
@ -31,8 +31,14 @@ pub async fn unlock(
|
|||
|
||||
let account_path = conf.full_accounts_path();
|
||||
account.save(account_path)?;
|
||||
|
||||
let strings = &ctx.data().strings;
|
||||
let formatter = strings.formatter()
|
||||
.user(ctx.author())
|
||||
.balance(&account, &map)
|
||||
.value(id);
|
||||
|
||||
let reply_string = format!("Unlocked room #{id}. Your balance: {} points", account.balance);
|
||||
let reply_string = formatter.fmt(&strings.map.room_unlocked);
|
||||
ctx.reply(reply_string).await?;
|
||||
|
||||
Ok(())
|
||||
|
|
@ -59,8 +65,13 @@ pub async fn r#move(
|
|||
account.location = id;
|
||||
let account_path = conf.full_accounts_path();
|
||||
account.save(account_path)?;
|
||||
|
||||
let strings = &ctx.data().strings;
|
||||
let formatter = strings.formatter()
|
||||
.user(ctx.author())
|
||||
.value(id);
|
||||
|
||||
let reply_string = format!("Moved to room #{id}.");
|
||||
let reply_string = formatter.fmt(&strings.map.moved_to_room);
|
||||
ctx.reply(reply_string).await?;
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue