-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from sudoskys/dev
Fix underline supports, fix `\(`, add some intro
- Loading branch information
Showing
11 changed files
with
235 additions
and
102 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import os | ||
|
||
from dotenv import load_dotenv | ||
from telebot import TeleBot | ||
|
||
import telegramify_markdown | ||
|
||
md = """ | ||
'\_', '\*', '\[', '\]', '\(', '\)', '\~', '\`', '\>', '\#', '\+', '\-', '\=', '\|', '\{', '\}', '\.', '\!' | ||
_ , * , [ , ] , ( , ) , ~ , ` , > , # , + , - , = , | , { , } , . , ! | ||
**bold text** | ||
*bold text* | ||
_italic text_ | ||
__underline__ | ||
~no valid strikethrough~ | ||
~~strikethrough~~ | ||
||spoiler|| | ||
*bold _italic bold ~~italic bold strikethrough ||italic bold strikethrough spoiler||~~ __underline italic bold___ bold* | ||
__underline italic bold__ | ||
[link](https://www.google.com) | ||
- [ ] Uncompleted task list item | ||
- [x] Completed task list item | ||
> Quote | ||
```python | ||
print("Hello, World!") | ||
``` | ||
This is `inline code` | ||
1. First ordered list item | ||
2. Another item | ||
- Unordered sub-list. | ||
1. Actual numbers don't matter, just that it's a number | ||
""" | ||
converted = telegramify_markdown.convert(md) | ||
print(converted) | ||
load_dotenv() | ||
telegram_bot_token = os.getenv("TELEGRAM_BOT_TOKEN", None) | ||
chat_id = os.getenv("TELEGRAM_CHAT_ID", None) | ||
bot = TeleBot(telegram_bot_token) | ||
bot.send_message( | ||
chat_id, | ||
converted, | ||
parse_mode="MarkdownV2" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.