Skip to content

Commit a2ffa88

Browse files
committed
update example
1 parent 49b8aec commit a2ffa88

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

examples/botCommand.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
const { Client } = require('tglib')
2-
const { TextStruct } = require('tglib/structs')
1+
const { Client, Structs } = require('tglib')
32

43
void async function() {
54
const client = new Client({
@@ -37,7 +36,7 @@ void async function() {
3736
replyText = `Sorry I do not understand <b>${text}</b>.`
3837
}
3938
await client.tg.sendTextMessage({
40-
'$text': new TextStruct(replyText, 'textParseModeHTML'),
39+
'$text': new Structs.TextStruct(replyText, 'textParseModeHTML'),
4140
'chat_id': 123456789,
4241
'disable_notification': true,
4342
'clear_draft': false,

examples/sendMessage.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { Client } = require('tglib')
1+
const { Client, Structs } = require('tglib')
22

33
void async function() {
44
const client = new Client({
@@ -32,4 +32,10 @@ void async function() {
3232
},
3333
},
3434
})
35+
36+
// or use tglib API
37+
await client.tg.sendTextMessage({
38+
'$text': new Structs.TextStruct('<b>Hi bold</b>', 'textParseModeHTML'),
39+
'chat_id': -123456789,
40+
})
3541
}()

0 commit comments

Comments
 (0)