settings:
token:
parse_mode: HTML
long_poller:
timeout: "10s"
limit: 100
locales_dir: ./internal/bot/locales
commands:
/start: Start the bot
/help: How to use the bot
buttons:
back:
unique: back_menu_btn
text: '{{ text `back_menu_btn` }}'
subscription:
unique: subscription_btn
text: '{{ text `subscription_btn` }}'
feed:
unique: feed_btn
text: '{{ text `feed_btn` }}'
feed_add_user:
unique: feed_add_user_btn
text: '{{ text `feed_add_user_btn` }}'
callback_data: test # TODO: тут по идеи должен быть tid пользователя. Доделать
settings:
unique: settings_btn
text: '{{ text `settings_btn` }}'
admin_panel:
unique: admin_panel_btn
text: '{{ text `admin_panel_btn` }}'
opts_media_attachment:
unique: opts_media_attachment_btn
text: '{{ .Status }} {{ text `opts_media_attachment_btn` }}'
opts_original_link:
unique: opts_original_link_btn
text: '{{ .Status }} {{ text `opts_original_link_btn` }}'
opts_post_date:
unique: opts_post_date_btn
text: '{{ .Status }} {{ text `opts_post_date_btn` }}'
opts_subscriber_count:
unique: opts_subscriber_count_btn
text: '{{ .Status }} {{ text `opts_subscriber_count_btn` }}'
feed_user:
unique: feed_user_{{.ID}}
text: ' {{ .Username}}'
callback_data: id:{{ .ID }}
feed_previous_btn:
unique: feed_previous_btn
text: ‹
callback_data: uid:{{ .UID }}-limit-{{ .Limit }}-offset:{{ .Offset }}-current:{{ .Current }}-total:{{ .Total }}
feed_next_btn:
unique: feed_previous_btn
text: ›
callback_data: uid:{{ .UID }}-limit-{{ .Limit }}-offset:{{ .Offset }}-current:{{ .Current }}-total:{{ .Total }}
pagination_btn:
unique: pagination_btn
text: '{{ .Current }}/{{ .Total }}'
markups:
start:
- [ subscription, feed ]
- [ settings ]
start_admin:
- [ subscription, feed ]
- [ settings ]
- [ admin_panel ]
settings:
- [ opts_media_attachment,opts_original_link ]
- [ opts_post_date,opts_subscriber_count ]
back:
- [ back ]
feed_pagination:
- [ '{{ range .Users }}feed_user{{ end }}' ]
- [ feed_previous_btn, pagination_btn, feed_next_btn ]
- [ feed_add_user ]
- [ back ]
- [ '{{ range .Users }}feed_user{{ end }}' ]
m := h.lt.Markup(tb, "feed_pagination", struct {
Users []struct {
ID int
Username string
}
UID int64
Limit int
Offset int
Current int
Total int
}{
Users: []struct {
ID int
Username string
}{
{ID: 1, Username: "Test 1"},
{ID: 2, Username: "Test 2"},
{ID: 3, Username: "Test 3"},
{ID: 4, Username: "Test 4"},
{ID: 5, Username: "Test 5"},
},
UID: 1,
Limit: limit,
Offset: offset,
Current: 1,
Total: 1000,
})
failed to create layout: telebot/layout: no {{ range .Users }}feed_user{{ end }} button for feed_pagination markup