Skip to content

Commit 5194e2f

Browse files
Merge pull request #37 from techthoughts2/Enhancements
Enhancements
2 parents f749fa8 + 3927afd commit 5194e2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1241
-494
lines changed

.github/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.12.0]
9+
10+
- Added support for MarkdownV2
11+
- Changed default Parse Mode for all functions from legacy Markdown to HTML
12+
- Added support for Polls v2.0 features
13+
814
## [1.10.1]
915

1016
- Fixed bug where DisableNotification had no effect when running Send-TelegramSticker

docs/PoshGram.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Module Name: PoshGram
33
Module Guid: 277b92bc-0ea9-4659-8f6c-ed5a1dfdfda2
44
Download Help Link: NA
5-
Help Version: 1.10.1
5+
Help Version: 1.12.0
66
Locale: en-US
77
---
88

docs/Send-TelegramContact.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ $firstName = 'Jean-Luc'
3131
Send-TelegramContact -BotToken $botToken -ChatID $chat -PhoneNumber $phone -FirstName $firstName
3232
```
3333

34-
3534
Sends contact via Telegram API
3635

3736
### EXAMPLE 2
@@ -41,17 +40,16 @@ $chat = "-nnnnnnnnn"
4140
$phone = '1-222-222-2222'
4241
$firstName = 'Jean-Luc'
4342
$lastName = 'Picard'
44-
Send-TelegramContact \`
45-
-BotToken $botToken \`
46-
-ChatID $chat \`
47-
-PhoneNumber $phone \`
48-
-FirstName $firstName \`
49-
-LastName $lastName \`
50-
-DisableNotification \`
43+
Send-TelegramContact `
44+
-BotToken $botToken `
45+
-ChatID $chat `
46+
-PhoneNumber $phone `
47+
-FirstName $firstName `
48+
-LastName $lastName `
49+
-DisableNotification `
5150
-Verbose
5251
```
5352

54-
5553
Sends contact via Telegram API
5654

5755
## PARAMETERS
@@ -173,4 +171,3 @@ Use the BotFather https://t.me/BotFather
173171
174172
[https://core.telegram.org/bots/api#sendcontact](https://core.telegram.org/bots/api#sendcontact)
175173
176-

docs/Send-TelegramLocalAnimation.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,42 @@ $animation = "C:\animation\animation.gif"
3232
Send-TelegramLocalAnimation -BotToken $botToken -ChatID $chat -AnimationPath $animation
3333
```
3434

35-
3635
Sends AnimationPath message via Telegram API
3736

3837
### EXAMPLE 2
3938
```
4039
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
4140
$chat = "-nnnnnnnnn"
4241
$animation = "C:\animation\animation.gif"
43-
Send-TelegramLocalAnimation \`
44-
-BotToken $botToken \`
45-
-ChatID $chat \`
46-
-AnimationPath $animation \`
47-
-Caption "Check out this animation" \`
48-
-ParseMode Markdown \`
49-
-DisableNotification \`
42+
Send-TelegramLocalAnimation `
43+
-BotToken $botToken `
44+
-ChatID $chat `
45+
-AnimationPath $animation `
46+
-Caption "Check out this animation" `
47+
-ParseMode MarkdownV2 `
48+
-DisableNotification `
5049
-Verbose
5150
```
5251

53-
5452
Sends animation message via Telegram API
5553

54+
### EXAMPLE 3
55+
```
56+
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
57+
$chat = "-nnnnnnnnn"
58+
$animation = "C:\animation\animation.gif"
59+
$sendTelegramLocalAnimationSplat = @{
60+
BotToken = $botToken
61+
ChatID = $chat
62+
AnimationPath = $animation
63+
Caption = "Check out this __awesome__ animation\."
64+
ParseMode = 'MarkdownV2'
65+
}
66+
Send-TelegramLocalAnimation @sendTelegramLocalAnimationSplat
67+
```
68+
69+
Sends animation message via Telegram API with properly formatted underlined word and escaped special character.
70+
5671
## PARAMETERS
5772

5873
### -BotToken
@@ -117,7 +132,7 @@ Accept wildcard characters: False
117132
118133
### -ParseMode
119134
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
120-
Default is Markdown.
135+
Default is HTML.
121136
122137
```yaml
123138
Type: String
@@ -126,7 +141,7 @@ Aliases:
126141

127142
Required: False
128143
Position: 5
129-
Default value: Markdown
144+
Default value: HTML
130145
Accept pipeline input: False
131146
Accept wildcard characters: False
132147
```
@@ -178,4 +193,9 @@ Get creative by sending Gifs with your bot!
178193
179194
[https://core.telegram.org/bots/api#sendanimation](https://core.telegram.org/bots/api#sendanimation)
180195
196+
[https://core.telegram.org/bots/api#html-style](https://core.telegram.org/bots/api#html-style)
197+
198+
[https://core.telegram.org/bots/api#markdownv2-style](https://core.telegram.org/bots/api#markdownv2-style)
199+
200+
[https://core.telegram.org/bots/api#markdown-style](https://core.telegram.org/bots/api#markdown-style)
181201

docs/Send-TelegramLocalAudio.md

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,47 @@ $audio = "C:\audio\halo_on_fire.mp3"
3434
Send-TelegramLocalAudio -BotToken $botToken -ChatID $chat -Audio $audio
3535
```
3636

37-
3837
Sends audio message via Telegram API
3938

4039
### EXAMPLE 2
4140
```
4241
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
4342
$chat = "-nnnnnnnnn"
4443
$audio = "C:\audio\halo_on_fire.mp3"
45-
Send-TelegramLocalAudio \`
46-
-BotToken $botToken \`
47-
-ChatID $chat \`
48-
-Audio $audio \`
49-
-Caption "Check out this audio track" \`
50-
-ParseMode Markdown \`
51-
-Duration 495 \`
52-
-Performer "Metallica" \`
53-
-Title "Halo On Fire" \`
54-
-DisableNotification \`
44+
Send-TelegramLocalAudio `
45+
-BotToken $botToken `
46+
-ChatID $chat `
47+
-Audio $audio `
48+
-Caption "Check out this audio track" `
49+
-ParseMode MarkdownV2 `
50+
-Duration 495 `
51+
-Performer "Metallica" `
52+
-Title "Halo On Fire" `
53+
-DisableNotification `
5554
-Verbose
5655
```
5756

58-
5957
Sends audio message via Telegram API
6058

59+
### EXAMPLE 3
60+
```
61+
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
62+
$chat = "-nnnnnnnnn"
63+
$audio = "C:\audio\halo_on_fire.mp3"
64+
$sendTelegramLocalAudioSplat = @{
65+
BotToken = $botToken
66+
ChatID = $chat
67+
Audio = $audio
68+
Title = "Halo On Fire"
69+
Performer = "Metallica"
70+
Caption = "Check out this __awesome__ audio track\."
71+
ParseMode = 'MarkdownV2'
72+
}
73+
Send-TelegramLocalAudio @sendTelegramLocalAudioSplat
74+
```
75+
76+
Sends audio message via Telegram API with properly formatted underlined word and escaped special character.
77+
6178
## PARAMETERS
6279

6380
### -BotToken
@@ -122,7 +139,7 @@ Accept wildcard characters: False
122139
123140
### -ParseMode
124141
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
125-
Default is Markdown.
142+
Default is HTML.
126143
127144
```yaml
128145
Type: String
@@ -131,7 +148,7 @@ Aliases:
131148

132149
Required: False
133150
Position: 5
134-
Default value: Markdown
151+
Default value: HTML
135152
Accept pipeline input: False
136153
Accept wildcard characters: False
137154
```
@@ -226,4 +243,9 @@ Use the BotFather https://t.me/BotFather
226243
227244
[https://core.telegram.org/bots/api#sendaudio](https://core.telegram.org/bots/api#sendaudio)
228245
246+
[https://core.telegram.org/bots/api#html-style](https://core.telegram.org/bots/api#html-style)
247+
248+
[https://core.telegram.org/bots/api#markdownv2-style](https://core.telegram.org/bots/api#markdownv2-style)
249+
250+
[https://core.telegram.org/bots/api#markdown-style](https://core.telegram.org/bots/api#markdown-style)
229251

docs/Send-TelegramLocalDocument.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,42 @@ $file = "C:\Logs\Log1.txt"
3232
Send-TelegramLocalDocument -BotToken $botToken -ChatID $chat -File $file
3333
```
3434

35-
3635
Sends document message via Telegram API
3736

3837
### EXAMPLE 2
3938
```
4039
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
4140
$chat = "-nnnnnnnnn"
4241
$file = "C:\Logs\Log1.txt"
43-
Send-TelegramLocalDocument \`
44-
-BotToken $botToken \`
45-
-ChatID $chat \`
46-
-File $file \`
47-
-Caption "Check out this file" \`
48-
-ParseMode Markdown \`
49-
-DisableNotification \`
42+
Send-TelegramLocalDocument `
43+
-BotToken $botToken `
44+
-ChatID $chat `
45+
-File $file `
46+
-Caption "Check out this file" `
47+
-ParseMode MarkdownV2 `
48+
-DisableNotification `
5049
-Verbose
5150
```
5251

53-
5452
Sends document message via Telegram API
5553

54+
### EXAMPLE 3
55+
```
56+
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
57+
$chat = "-nnnnnnnnn"
58+
$file = "C:\Logs\Log1.txt"
59+
$sendTelegramLocalDocumentSplat = @{
60+
BotToken = $botToken
61+
ChatID = $chat
62+
File = $file
63+
Caption = "Check out this __important__ file\."
64+
ParseMode = 'MarkdownV2'
65+
}
66+
Send-TelegramLocalDocument @sendTelegramLocalDocumentSplat
67+
```
68+
69+
Sends document message via Telegram API with properly formatted underlined word and escaped special character.
70+
5671
## PARAMETERS
5772

5873
### -BotToken
@@ -117,7 +132,7 @@ Accept wildcard characters: False
117132
118133
### -ParseMode
119134
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
120-
Default is Markdown.
135+
Default is HTML.
121136
122137
```yaml
123138
Type: String
@@ -126,7 +141,7 @@ Aliases:
126141

127142
Required: False
128143
Position: 5
129-
Default value: Markdown
144+
Default value: HTML
130145
Accept pipeline input: False
131146
Accept wildcard characters: False
132147
```
@@ -175,4 +190,9 @@ Use the BotFather https://t.me/BotFather
175190
176191
[https://core.telegram.org/bots/api#senddocument](https://core.telegram.org/bots/api#senddocument)
177192
193+
[https://core.telegram.org/bots/api#html-style](https://core.telegram.org/bots/api#html-style)
194+
195+
[https://core.telegram.org/bots/api#markdownv2-style](https://core.telegram.org/bots/api#markdownv2-style)
196+
197+
[https://core.telegram.org/bots/api#markdown-style](https://core.telegram.org/bots/api#markdown-style)
178198

docs/Send-TelegramLocalPhoto.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,42 @@ $photo = "C:\photos\aphoto.jpg"
3232
Send-TelegramLocalPhoto -BotToken $botToken -ChatID $chat -PhotoPath $photo
3333
```
3434

35-
3635
Sends photo message via Telegram API
3736

3837
### EXAMPLE 2
3938
```
4039
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
4140
$chat = "-nnnnnnnnn"
4241
$photo = "C:\photos\aphoto.jpg"
43-
Send-TelegramLocalPhoto \`
44-
-BotToken $botToken \`
45-
-ChatID $chat \`
46-
-PhotoPath $photo \`
47-
-Caption "Check out this photo" \`
48-
-ParseMode Markdown \`
49-
-DisableNotification \`
42+
Send-TelegramLocalPhoto `
43+
-BotToken $botToken `
44+
-ChatID $chat `
45+
-PhotoPath $photo `
46+
-Caption "Check out this photo" `
47+
-ParseMode MarkdownV2 `
48+
-DisableNotification `
5049
-Verbose
5150
```
5251

53-
5452
Sends photo message via Telegram API
5553

54+
### EXAMPLE 3
55+
```
56+
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
57+
$chat = "-nnnnnnnnn"
58+
$photo = "C:\photos\aphoto.jpg"
59+
$sendTelegramLocalPhotoSplat = @{
60+
BotToken = $botToken
61+
ChatID = $chat
62+
PhotoPath = $photo
63+
Caption = "Check out this __awesome__ photo\."
64+
ParseMode = 'MarkdownV2'
65+
}
66+
Send-TelegramLocalPhoto @sendTelegramLocalPhotoSplat
67+
```
68+
69+
Sends photo message via Telegram API with properly formatted underlined word and escaped special character.
70+
5671
## PARAMETERS
5772

5873
### -BotToken
@@ -117,7 +132,7 @@ Accept wildcard characters: False
117132
118133
### -ParseMode
119134
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
120-
Default is Markdown.
135+
Default is HTML.
121136
122137
```yaml
123138
Type: String
@@ -126,7 +141,7 @@ Aliases:
126141

127142
Required: False
128143
Position: 5
129-
Default value: Markdown
144+
Default value: HTML
130145
Accept pipeline input: False
131146
Accept wildcard characters: False
132147
```
@@ -176,4 +191,9 @@ Use the BotFather https://t.me/BotFather
176191
177192
[https://core.telegram.org/bots/api#sendphoto](https://core.telegram.org/bots/api#sendphoto)
178193
194+
[https://core.telegram.org/bots/api#html-style](https://core.telegram.org/bots/api#html-style)
195+
196+
[https://core.telegram.org/bots/api#markdownv2-style](https://core.telegram.org/bots/api#markdownv2-style)
197+
198+
[https://core.telegram.org/bots/api#markdown-style](https://core.telegram.org/bots/api#markdown-style)
179199

0 commit comments

Comments
 (0)