Commit 3a3c250f authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 748ebf69
...@@ -139,6 +139,9 @@ async function showCount(msg, unit) { ...@@ -139,6 +139,9 @@ async function showCount(msg, unit) {
case 'aed': case 'aed':
msg.data = msg.data.replace("aed_", "") msg.data = msg.data.replace("aed_", "")
break break
case 'can':
msg.data = msg.data.replace("can_", "")
break
} }
...@@ -307,6 +310,11 @@ async function canOrder(data, msg) { ...@@ -307,6 +310,11 @@ async function canOrder(data, msg) {
generateText(user.aed_balance, num, msg) generateText(user.aed_balance, num, msg)
} }
if (data.to === 'can')
if (user.can_balance <= 0 || num > user.can_balance) {
generateText(user.can_balance, num, msg)
}
} }
......
...@@ -105,7 +105,7 @@ function runCurrency(data, user) { ...@@ -105,7 +105,7 @@ function runCurrency(data, user) {
case 'aed': case 'aed':
user.aed_balance = user.aed_balance + (-1 * parseFloat(data.count)) user.aed_balance = user.aed_balance + (-1 * parseFloat(data.count))
break break
case 'aed': case 'can':
user.can_balance = user.can_balance + (-1 * parseFloat(data.count)) user.can_balance = user.can_balance + (-1 * parseFloat(data.count))
break break
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment