Skip to content

Commit dc6dbb5

Browse files
committed
提示网址修正
1 parent 3dc64bf commit dc6dbb5

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

README.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,7 @@ function tg_send( $text , $desp = '' , $key = '<sendkey>' )
6262

6363
## Thanks
6464

65-
Heavily modified base [Telegram Bot Boilerplate with Vercel's Serverless Functions](https://github.com/waptik/telegram-bot-boilerplate-now-serverless-api)
66-
67-
## 中文教程
68-
69-
[![image](https://user-images.githubusercontent.com/1294760/115172022-f05da500-a0f6-11eb-9bb8-5919442523c6.png)](https://www.bilibili.com/video/BV1S5411c7Vy/)
70-
71-
[安装视频@B 站,欢迎关注作者](https://www.bilibili.com/video/BV1S5411c7Vy/)
65+
参考项目: <https://github.com/m7mark/telegram-bot-vercel-boilerplate.git>
7266

7367
参数说明:
7468

src/commands/sendkey.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const md5 = require('md5');
2-
const VERCEL_URL = process.env.VERCEL_URL;
2+
const VERCEL_URL = process.env.VERCEL_URL || '';
33
const TCKEY = process.env.TCKEY;
44

55
const replyToMessage = (ctx: any, messageId: string, string: string) =>
@@ -9,10 +9,12 @@ const replyToMessage = (ctx: any, messageId: string, string: string) =>
99

1010
const sendkey = () => (ctx: any) => {
1111
const messageId = ctx.message.message_id;
12-
const userName = ctx.from.last_name ? `${ctx.from.first_name} ${ctx.from.last_name}` : ctx.from.first_name;
12+
const userName = ctx.from.last_name
13+
? `${ctx.from.first_name} ${ctx.from.last_name}`
14+
: ctx.from.first_name;
1315
const sendkey = ctx.from.id + 'T' + md5(TCKEY + ctx.from.id);
1416

15-
const site_url = String(VERCEL_URL).split('-')[0] + '.vercel.app';
17+
const site_url = VERCEL_URL;
1618

1719
replyToMessage(
1820
ctx,

0 commit comments

Comments
 (0)