WithdrawService.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. <?php
  2. namespace App\Services;
  3. use App\Constants\StepStatus;
  4. use App\Models\Address;
  5. use App\Models\BalanceLog;
  6. use App\Models\Bank;
  7. use App\Models\Config;
  8. use App\Models\RoomUser;
  9. use App\Models\User;
  10. use App\Models\Wallet;
  11. use App\Models\Withdraw;
  12. use Illuminate\Support\Facades\Cache;
  13. use LaravelLang\Publisher\Console\Add;
  14. use Telegram\Bot\Api;
  15. use Telegram\Bot\Exceptions\TelegramSDKException;
  16. class WithdrawService
  17. {
  18. private $serviceCharge;
  19. public static function init(Api $telegram, $data, $chatId, $firstName, $messageId): void
  20. {
  21. switch ($data) {
  22. case "withdraw@@address"://地址管理
  23. $res = WithdrawService::getAddress($chatId, $messageId);
  24. $telegram->editMessageText($res);
  25. break;
  26. case "withdrawAddress@@done":
  27. $res = WithdrawService::done($chatId, $messageId, $firstName);
  28. $telegram->editMessageText($res);
  29. break;
  30. case "withdraw@@bill"://点击提现的账单按钮
  31. $res = WithdrawService::bill($chatId, $firstName, $messageId);
  32. $telegram->editMessageText($res);
  33. break;
  34. case "withdrawAddress@@add":
  35. $res = WithdrawService::addAddress($chatId, $messageId);
  36. $telegram->editMessageText($res);
  37. break;
  38. case "withdraw@@apply"://点击提现按钮
  39. $res = WithdrawService::apply($chatId, $messageId);
  40. $telegram->editMessageText($res);
  41. break;
  42. default:
  43. //选择提现地址
  44. $pattern = "/^withdrawAddress@@choose\d+$/";
  45. if (preg_match($pattern, $data)) {
  46. $id = preg_replace('/^withdrawAddress@@choose/', '', $data);
  47. $res = WithdrawService::chooseAddress($chatId, $firstName, $messageId, $id);
  48. $telegram->editMessageText($res);
  49. }
  50. //删除地址
  51. $pattern = "/^withdrawAddress@@del\d+$/";
  52. if (preg_match($pattern, $data)) {
  53. $id = preg_replace('/^withdrawAddress@@del/', '', $data);
  54. $res = WithdrawService::delAddress($chatId, $id, $messageId);
  55. $telegram->editMessageText($res);
  56. }
  57. //地址详情
  58. $pattern = "/^withdrawAddress@@detail\d+$/";
  59. if (preg_match($pattern, $data)) {
  60. $id = preg_replace('/^withdrawAddress@@detail/', '', $data);
  61. $res = WithdrawService::addressDetails($chatId, $messageId, $id);
  62. $telegram->editMessageText($res);
  63. }
  64. //提现账单,下一页
  65. $pattern = "/^withdrawBillNextPage@@\d+$/";
  66. if (preg_match($pattern, $data)) {
  67. $page = preg_replace('/^withdrawBillNextPage@@/', '', $data);
  68. $page = intval($page);
  69. $res = WithdrawService::bill($chatId, $firstName, $messageId, $page);
  70. $telegram->editMessageText($res);
  71. }
  72. break;
  73. }
  74. }
  75. public static function model(): string
  76. {
  77. return Withdraw::class;
  78. }
  79. public static function enum(): string
  80. {
  81. return '';
  82. }
  83. public static function getWhere(array $search = []): array
  84. {
  85. $where = [];
  86. if (isset($search['id']) && !empty($search['id'])) {
  87. $where[] = ['id', '=', $search['id']];
  88. }
  89. if (isset($search['member_id']) && !empty($search['member_id'])) {
  90. $where[] = ['member_id', '=', $search['member_id']];
  91. }
  92. if (isset($search['status']) && $search['status'] != '') {
  93. $where[] = ['status', '=', $search['status']];
  94. }
  95. return $where;
  96. }
  97. public static function findOne(array $search): ?Withdraw
  98. {
  99. return self::model()::where(self::getWhere($search))->first();
  100. }
  101. public static function findAll(array $search = [])
  102. {
  103. return self::model()::where(self::getWhere($search))->get();
  104. }
  105. public static function paginate(array $search = [])
  106. {
  107. $limit = isset($search['limit']) ? $search['limit'] : 10;
  108. $paginator = self::model()::where(self::getWhere($search))
  109. ->orderBy('created_at', 'desc')->paginate($limit);
  110. return ['total' => $paginator->total(), 'data' => $paginator->items()];
  111. }
  112. public function __construct()
  113. {
  114. $serviceCharge = Config::where('field', 'service_charge')->first()->val;
  115. $serviceCharge = floatval($serviceCharge);
  116. $this->serviceCharge = $serviceCharge;
  117. }
  118. public static function getServiceCharge(): float
  119. {
  120. $serviceCharge = Config::where('field', 'service_charge')->first()->val;
  121. return floatval($serviceCharge);
  122. }
  123. public static function notify($data)
  124. {
  125. try {
  126. $telegram = new Api(config('services.telegram.token'));
  127. $telegram->sendMessage($data);
  128. } catch (TelegramSDKException $e) {
  129. return false;
  130. }
  131. return true;
  132. }
  133. //提现账单
  134. public static function bill($chatId, $firstName, $messageId = null, $page = 1, $limit = 5)
  135. {
  136. $list = Withdraw::where('member_id', $chatId)
  137. ->orderBy('id', 'desc')
  138. ->forPage($page, $limit)
  139. ->get();
  140. $count = Withdraw::where('member_id', $chatId)
  141. ->whereIn('status', [0, 1])
  142. ->count();
  143. $status = [lang('等待放行'), lang('已到账'), lang("失败")];
  144. $text = "👤 {$firstName}({$chatId}) " . lang("钱包提现记录") . "\n\n";
  145. foreach ($list as $item) {
  146. $amount = floatval($item->amount);
  147. $balance = floatval($item->after_balance);
  148. $text .= "-------------------------------------\n";
  149. $text .= "➖ {$amount} USDT\n" . lang("余额") . ":{$balance} \n";
  150. $text .= lang("类别") . "类别:" . lang("提现") . "\n";
  151. $text .= lang("状态") . ":{$status[$item->status]}\n";
  152. if ($item->remark) {
  153. $text .= lang("说明") . ":{$item->remark}\n";
  154. }
  155. $text .= lang("日期") . ":{$item->created_at}\n";
  156. }
  157. if ($page > 1) {
  158. $keyboard[] = [
  159. ['text' => lang("👆上一页"), 'callback_data' => "withdrawBillNextPage@@" . ($page - 1)]
  160. ];
  161. }
  162. $allPage = ceil($count / $limit);
  163. if ($allPage > $page) {
  164. if ($page > 1) {
  165. $keyboard[count($keyboard) - 1][] = ['text' => lang("👇下一页"), 'callback_data' => "withdrawBillNextPage@@" . ($page + 1)];
  166. } else {
  167. $keyboard[] = [
  168. ['text' => lang("👇下一页"), 'callback_data' => "withdrawBillNextPage@@" . ($page + 1)]
  169. ];
  170. }
  171. }
  172. $keyboard[] = [
  173. ['text' => lang("↩️返回"), 'callback_data' => "withdraw@@home"]
  174. ];
  175. return [
  176. 'chat_id' => $chatId,
  177. 'text' => $text,
  178. 'message_id' => $messageId,
  179. 'reply_markup' => json_encode(['inline_keyboard' => $keyboard])
  180. ];
  181. }
  182. //删除地址
  183. public static function delAddress($chatId, $id, $messageId)
  184. {
  185. Address::where('id', $id)
  186. ->where('member_id', $chatId)->delete();
  187. return WithdrawService::getAddress($chatId, $messageId);
  188. }
  189. //地址详情
  190. public static function addressDetails($chatId, $messageId, $id)
  191. {
  192. $text = lang("*TRC20 地址管理*") . "\n\n";
  193. $address = Address::where('id', $id)
  194. ->where('member_id', $chatId)->first();
  195. $text .= lang("地址") . ":{$address->address}\n";
  196. $text .= lang("别名") . ":{$address->alias}";
  197. $keyboard = [
  198. [['text' => lang('❌删除该地址'), 'callback_data' => "withdrawAddress@@del{$id}"]],
  199. [['text' => lang('↩️返回列表'), 'callback_data' => 'withdraw@@address']]
  200. ];
  201. return [
  202. 'chat_id' => $chatId,
  203. 'parse_mode' => 'MarkdownV2',
  204. 'text' => $text,
  205. 'reply_markup' => json_encode(['inline_keyboard' => $keyboard]),
  206. 'message_id' => $messageId
  207. ];
  208. }
  209. //输入别名
  210. public static function inputAlias($chatId, $alias, $messageId)
  211. {
  212. if (mb_strlen($alias) > 20) {
  213. return [
  214. 'chat_id' => $chatId,
  215. 'text' => lang("别名不能超过20个字,请重新输入"),
  216. 'reply_to_message_id' => $messageId,
  217. ];
  218. }
  219. $address = Cache::get("{$chatId}_address");
  220. $a = new Address();
  221. $a->address = $address;
  222. $a->alias = $alias;
  223. $a->member_id = $chatId;
  224. $a->save();
  225. Cache::delete("{$chatId}_address");
  226. Cache::delete(get_step_key($chatId));
  227. return self::getAddress($chatId, $messageId);
  228. }
  229. //用户输入TRC20地址
  230. public static function inputAddress($chatId, $address, $messageId)
  231. {
  232. if (!preg_match('/^T[a-zA-Z1-9]{33}$/', $address)) {
  233. return [
  234. 'chat_id' => $chatId,
  235. 'text' => lang("地址输入不正确,请重新输入TRC20地址"),
  236. 'reply_to_message_id' => $messageId,
  237. ];
  238. }
  239. Cache::put("{$chatId}_address", $address);
  240. Cache::put(get_step_key($chatId), StepStatus::INPUT_ADDRESS_ALIAS);
  241. return [
  242. 'chat_id' => $chatId,
  243. 'text' => lang("请输入地址别名,便于区分多个地址"),
  244. ];
  245. }
  246. //添加地址
  247. public static function addAddress($chatId, $messageId)
  248. {
  249. $text = lang('请输入新的TRC20地址') . "\n";
  250. $keyboard = [[
  251. ['text' => lang('❌取消'), 'callback_data' => "message@@close"],
  252. ]];
  253. Cache::put(get_step_key($chatId), StepStatus::INPUT_ADDRESS_TRC20);
  254. return [
  255. 'chat_id' => $chatId,
  256. 'text' => $text,
  257. 'message_id' => $messageId,
  258. 'reply_markup' => json_encode(['inline_keyboard' => $keyboard])
  259. ];
  260. }
  261. //地址管理
  262. public static function getAddress($chatId, $messageId)
  263. {
  264. $text = lang("🏠 地址管理");
  265. $text .= "\n--------------------------\n";
  266. $list = Address::where('member_id', $chatId)
  267. ->get();
  268. $keyboard = [];
  269. foreach ($list as $item) {
  270. $keyboard[] = [['text' => $item->alias, 'callback_data' => "withdrawAddress@@detail{$item->id}"]];
  271. }
  272. if (count($list) < 5) {
  273. $keyboard[] = [['text' => lang("➕ 添加地址"), 'callback_data' => "withdrawAddress@@add"]];
  274. }
  275. $keyboard[] = [['text' => lang("↩️返回"), 'callback_data' => "withdraw@@home"]];
  276. return [
  277. 'chat_id' => $chatId,
  278. 'text' => $text,
  279. 'message_id' => $messageId,
  280. 'reply_markup' => json_encode(['inline_keyboard' => $keyboard])
  281. ];
  282. }
  283. public static function done($chatId, $messageId, $firstName)
  284. {
  285. $serviceCharge = (new WithdrawService())->serviceCharge;
  286. $amount = Cache::get("{$chatId}_WITHDRAW_MONEY", '');
  287. $address = Cache::get("{$chatId}_WITHDRAW_ADDRESS", '');
  288. if (!$amount || !$address) return WithdrawService::index($chatId, $firstName, $messageId);
  289. $real = bcsub($amount, $serviceCharge, 10);
  290. $real = floatval($real);
  291. if ($amount <= $serviceCharge) {
  292. return [
  293. 'chat_id' => $chatId,
  294. 'text' => lang("⚠️提现不能少于") . "{$serviceCharge} USDT," . lang("请重试"),
  295. 'message_id' => $messageId
  296. ];
  297. }
  298. $wallet = Wallet::where('member_id', $chatId)->first();
  299. $temp = floatval($wallet->available_balance);
  300. // 汇率
  301. $rate = Config::where('field', 'exchange_rate_rmb')->first()->val ?? 1;
  302. $exchange_rate_difference = Config::where('field', 'exchange_rate_difference')->first()->val ?? 0;
  303. $rate = bcadd($rate, $exchange_rate_difference, 2);
  304. $rate_usdt_amount = bcdiv($temp, $rate, 2); // 钱包可用余额 折合USDT
  305. $rate_rmb_amount = bcmul($amount, $rate, 2); // 提现金额 折合RMB
  306. if ($amount > $rate_usdt_amount) {
  307. return [
  308. 'chat_id' => $chatId,
  309. 'text' => lang("⚠️可用余额不足,请重试"),
  310. 'message_id' => $messageId
  311. ];
  312. }
  313. $ru = RoomUser::where('member_id', $chatId)
  314. ->whereIn('status', [0, 1, 2, 3])
  315. ->first();
  316. if ($ru) {
  317. $text = lang("游戏未结算") . "\n";
  318. $text .= "⚠️ " . lang("您还有进行中的游戏,所有游戏结算后方可提现") . "\n";
  319. return [
  320. 'chat_id' => $chatId,
  321. 'text' => $text,
  322. 'message_id' => $messageId,
  323. 'reply_markup' => json_encode(['inline_keyboard' => [[
  324. ['text' => lang('进入房间'), 'callback_data' => "games@@home{$ru->room_id}"],
  325. ]]])
  326. ];
  327. }
  328. $wallet = Wallet::where('member_id', $chatId)->first();
  329. $changeAmount = bcmul(($amount * -1), $rate, 2);
  330. $beforeBalance = $wallet->available_balance;
  331. $afterBalance = bcsub($wallet->available_balance, $rate_rmb_amount, 2);
  332. $wallet->available_balance = $afterBalance;
  333. $wallet->save();
  334. $withdraw = Withdraw::create([
  335. 'member_id' => $chatId,
  336. 'amount' => $amount,
  337. 'service_charge' => $serviceCharge,
  338. 'to_account' => $real,
  339. 'address' => $address,
  340. 'exchange_rate' => $rate,
  341. 'status' => 0,
  342. 'after_balance' => $afterBalance
  343. ]);
  344. BalanceLogService::addLog($chatId, $changeAmount, $beforeBalance, $afterBalance, '提现', $withdraw->id, '');
  345. $temp = floatval($afterBalance);
  346. $text = "✅ " . lang("提现申请已提交!") . "\n\n";
  347. $text .= lang("钱包余额") . ":{$temp} RMB\n";
  348. $text .= lang("汇率") . ":1 USDT = {$rate} RMB\n";
  349. $text .= lang("剩余可用USDT余额") . ":" . number_format(bcdiv($temp, $rate, 2), 2) . " USDT\n";
  350. $text .= lang("提现金额") . ":{$amount} USDT\n";
  351. $text .= lang("实际到账") . ":{$real} USDT\n";
  352. $text .= lang("手续费") . ":{$serviceCharge} USDT\n\n";
  353. $text .= lang("⌛️请等待系统处理, 到账时间可能需要几分钟!") . "\n";
  354. Cache::delete(get_step_key($chatId));
  355. return [
  356. 'chat_id' => $chatId,
  357. 'text' => $text,
  358. 'message_id' => $messageId,
  359. ];
  360. }
  361. public static function chooseAddress($chatId, $firstName, $messageId, $id)
  362. {
  363. $serviceCharge = (new WithdrawService())->serviceCharge;
  364. $amount = Cache::get("{$chatId}_WITHDRAW_MONEY", '');
  365. if (!$amount) return WithdrawService::index($chatId, $firstName, $messageId);
  366. $amount = floatval($amount);
  367. $real = bcsub($amount, $serviceCharge, 10);
  368. $real = floatval($real);
  369. $address = Address::where('id', $id)
  370. ->where('member_id', $chatId)->first();
  371. $text = lang("请确认") . "\n\n";
  372. $text .= lang('手续费') . ":{$serviceCharge} USDT\n";
  373. $text .= lang("提现金额") . ":{$amount} USDT\n";
  374. $text .= lang("实际到账") . ":{$real} USDT\n";
  375. $text .= lang("提现地址") . ":{$address->address}\n";
  376. $keyboard = [
  377. [
  378. ['text' => lang('✅ 确认'), 'callback_data' => "withdrawAddress@@done"],
  379. ],
  380. [
  381. ['text' => lang('❌取消'), 'callback_data' => "message@@close"]
  382. ]
  383. ];
  384. Cache::put("{$chatId}_WITHDRAW_ADDRESS", $address->address);
  385. return [
  386. 'chat_id' => $chatId,
  387. 'text' => $text,
  388. 'message_id' => $messageId,
  389. 'reply_markup' => json_encode(['inline_keyboard' => $keyboard])
  390. ];
  391. }
  392. //用户输入提现金额(USDT)
  393. public function inputAmount($chatId, $amount, $messageId)
  394. {
  395. if (!preg_match('/^-?\d+(\.\d+)?$/', $amount)) {
  396. return [[
  397. 'chat_id' => $chatId,
  398. 'text' => lang("金额输入不正确,请发送提现数字"),
  399. 'reply_to_message_id' => $messageId
  400. ]];
  401. }
  402. $rate = Config::where('field', 'exchange_rate_rmb')->first()->val ?? 1;
  403. $amountRmb = bcmul($rate, $amount, 2);
  404. if ($amountRmb < 100) {
  405. return [[
  406. 'chat_id' => $chatId,
  407. 'text' => lang("提现不能少于100 RMB,请重试"),
  408. 'reply_to_message_id' => $messageId
  409. ]];
  410. }
  411. if ($amountRmb > 49999) {
  412. return [
  413. 'chat_id' => $chatId,
  414. 'text' => lang("最多提现 49999 RMB,请重试"),
  415. 'reply_to_message_id' => $messageId
  416. ];
  417. }
  418. $wallet = Wallet::where('member_id', $chatId)->first();
  419. $temp = floatval($wallet->available_balance);
  420. // 汇率
  421. $rate = Config::where('field', 'exchange_rate_rmb')->first()->val ?? 1;
  422. $rate_amount = bcdiv($temp, $rate, 2);
  423. if ($amount <= $this->serviceCharge) {
  424. return [[
  425. 'chat_id' => $chatId,
  426. 'text' => lang("⚠️提现不能少于") . "{$this->serviceCharge} USDT," . lang('请重试'),
  427. 'reply_to_message_id' => $messageId
  428. ]];
  429. }
  430. if ($amount > $rate_amount) {
  431. return [[
  432. 'chat_id' => $chatId,
  433. 'text' => lang("可用余额不足,请重试"),
  434. 'reply_to_message_id' => $messageId
  435. ]];
  436. }
  437. $ru = RoomUser::where('member_id', $chatId)
  438. ->whereIn('status', [0, 1, 2, 3])
  439. ->first();
  440. if ($ru) {
  441. $text = lang('*游戏未结算*') . "\n";
  442. $text .= lang("⚠️ 您还有进行中的游戏,所有游戏结算后方可提现") . "\n";
  443. return [[
  444. 'chat_id' => $chatId,
  445. 'text' => $text,
  446. 'parse_mode' => 'MarkdownV2',
  447. 'reply_markup' => json_encode(['inline_keyboard' => [[
  448. ['text' => lang('进入房间'), 'callback_data' => "games@@home{$ru->room_id}"],
  449. ]]])
  450. ]];
  451. }
  452. $list = Address::where('member_id', $chatId)->get();
  453. $keyboard = [];
  454. foreach ($list as $item) {
  455. $keyboard[] = [['text' => $item->alias, 'callback_data' => "withdrawAddress@@choose{$item->id}"]];
  456. }
  457. $keyboard[] = [
  458. ['text' => lang("🏠 地址管理"), 'callback_data' => "withdraw@@address"],
  459. ['text' => lang('❌取消'), 'callback_data' => "message@@close"]
  460. ];
  461. $text = lang('请直接选择下面的地址') . "\n";
  462. $text .= lang("⚠️提示:请务必确认提现地址正确无误,\n否则资金丢失将无法找回请自负!");
  463. Cache::put("{$chatId}_WITHDRAW_MONEY", $amount);
  464. Cache::put(get_step_key($chatId), StepStatus::CHOOSE_WITHDRAW_ADDRESS);
  465. return [[
  466. 'chat_id' => $chatId,
  467. 'text' => $text,
  468. 'reply_to_message_id' => $messageId,
  469. 'reply_markup' => json_encode(['inline_keyboard' => $keyboard])
  470. ]];
  471. }
  472. //申请提现
  473. public static function apply($chatId, $messageId)
  474. {
  475. $wallet = Wallet::where('member_id', $chatId)->first();
  476. // 汇率
  477. $rate = Config::where('field', 'exchange_rate_rmb')->first()->val ?? 1;
  478. $exchange_rate_difference = Config::where('field', 'exchange_rate_difference')->first()->val ?? 0;
  479. $rate = bcadd($rate, $exchange_rate_difference, 2);
  480. $temp = floatval($wallet->available_balance);
  481. $amount = bcdiv($temp, $rate, 2);
  482. $serviceCharge = static::getServiceCharge();
  483. $text = lang("请发送提现金额");
  484. $text .= " (USDT)";
  485. $text .= "\n💰 " . lang('当前余额') . ":{$temp} RMB ({$amount} USDT)\n";
  486. $text .= "⚠️" . lang('汇率') . ":1 USDT = {$rate} RMB\n";
  487. $text .= "⚠️ " . lang('提现将收取') . "{$serviceCharge}" . lang('U作为手续费') . "\n";
  488. // $keyboard = [[
  489. // ['text' => "🔙返回", 'callback_data' => "withdraw@@home"],
  490. // ]];
  491. Cache::put(get_step_key($chatId), StepStatus::INPUT_WITHDRAW_MONEY);
  492. return [
  493. 'chat_id' => $chatId,
  494. 'text' => $text,
  495. 'message_id' => $messageId,
  496. // 'reply_markup' => json_encode(['inline_keyboard' => $keyboard])
  497. ];
  498. }
  499. //提现管理
  500. public static function index($chatId, $firstName, $messageId = null)
  501. {
  502. $wallet = Wallet::where('member_id', $chatId)->first();
  503. $text = "👤 {$firstName}({$chatId})\n\n";
  504. $text .= "💰钱包余额\n";
  505. $temp = floatval($wallet->available_balance);
  506. $text .= "USDT:{$temp}\n";
  507. $text .= "--------------------------\n";
  508. $serviceAccount = Config::where('field', 'service_account')->first()->val;
  509. $keyboard = [
  510. [
  511. ['text' => '➕ 提现', 'callback_data' => "withdraw@@apply"],
  512. ['text' => '🧾 账单', 'callback_data' => "withdraw@@bill"]
  513. ],
  514. [
  515. ['text' => lang("🏠 地址管理"), 'callback_data' => "withdraw@@address"],
  516. ['text' => lang('👩 客服帮助'), 'url' => "https://t.me/{$serviceAccount}"]
  517. ],
  518. [
  519. ['text' => lang('❌取消'), 'callback_data' => "message@@close"],
  520. ]
  521. ];
  522. return [
  523. 'chat_id' => $chatId,
  524. 'text' => $text,
  525. 'message_id' => $messageId,
  526. 'reply_markup' => json_encode(['inline_keyboard' => $keyboard])
  527. ];
  528. }
  529. }