You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/obervinov/messages-package/actions/workflows/tests.yml)
1. Creating _configs/messages.json_ and adding an example template
38
54
- all emojis should be wrapped in `:`
39
55
- all variables must be specified in the same form as in your code
40
56
```json
41
-
{ "templates":{"hello_message": {"text": "Hi, <b>{0}</b>! {1}\nAccess for your account - allowed {2}", "args": ["username", ":raised_hand:", ":unlocked:"]}}}
57
+
{ "templates":{"hello_message": {"text": "Hi, <b>{0}</b>! {1}\nAccess for your account - allowed {2}", "args": ["username", ":raised_hand:", ":unlocked:"]}}}
42
58
```
43
59
44
60
```python
45
61
# Import module
46
-
import messages
62
+
from messagesimport Messages
47
63
48
64
# Create instance
49
65
messages = Messages()
50
66
51
67
# Rendering and getting messages
52
68
print(
53
69
messages.render_template(
54
-
'hello_message',
70
+
template_alias='hello_message',
55
71
username="obervinov"
56
72
)
57
73
)
@@ -63,3 +79,31 @@ Hi, <b>obervinov</b>! ✋
63
79
Access for your account - allowed 🔓
64
80
```
65
81
82
+
### Simple message with progress bar
83
+
1. Creating _configs/messages.json_ and adding an example template
84
+
-all emojis should be wrapped in`:`
85
+
-all variables must be specified in the same form asin your code
86
+
```json
87
+
{"templates": {"progressbar_message": {"text": "{0} Messages from the queue have already been processed", "args": [":framed_picture:", "progressbar"]}}
0 commit comments