summaryrefslogtreecommitdiff
path: root/query.c
diff options
context:
space:
mode:
Diffstat (limited to 'query.c')
-rw-r--r--query.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/query.c b/query.c
index 3905ae2..d052039 100644
--- a/query.c
+++ b/query.c
@@ -53,6 +53,8 @@ int handle_inline(struct TdUpdateNewInlineQuery *update) {
const bool query = update->query_;
char *query_str = NULL;
int personal_stat = 0;
+ int ranking = 0;
+ int total = 0;
char id_temp[32];
char msg_stat[32];
sqlite3_stmt *stmt_query = query ? stmt_search : stmt_random;
@@ -72,6 +74,8 @@ int handle_inline(struct TdUpdateNewInlineQuery *update) {
switch (r = sqlite3_step(stmt_personal_stat)) {
case SQLITE_ROW: {
personal_stat = sqlite3_column_int(stmt_personal_stat, 0);
+ ranking = sqlite3_column_int(stmt_personal_stat, 1);
+ total = sqlite3_column_int(stmt_personal_stat, 2);
break;
}
case SQLITE_DONE: {
@@ -82,7 +86,7 @@ int handle_inline(struct TdUpdateNewInlineQuery *update) {
}
}
- snprintf(msg_stat, sizeof(msg_stat), "我已经卖了 %d 句菜", personal_stat);
+ snprintf(msg_stat, sizeof(msg_stat), "我已经卖了 %d 句菜,TGCN 排名 %d / %d", personal_stat, ranking, total);
snprintf(id_temp, sizeof(id_temp), "s%lld", update->sender_user_id_);
results_inline[0] = create_inline_result(id_temp, "卖菜统计", "点击发送卖菜统计", msg_stat);
effective_items_count++;