небольшие улучшения

This commit is contained in:
lost+skunk 2024-06-14 00:05:21 +03:00
parent fd031a255b
commit 8f645d7ccb
4 changed files with 57 additions and 37 deletions

View file

@ -6,7 +6,7 @@ import (
"strings"
)
type comments struct {
type Comments struct {
Cursor string
PrevOffset int
HasMore, HasLess bool
@ -33,12 +33,12 @@ type comments struct {
}
// функция для обработки комментариев поста, пользователя, группы и многого другого
func Comments(
func CommentsFunc(
postid string,
cursor string,
page int,
typ int, // 1 - комментарии поста; 4 - комментарии на стене группы или пользователя
) (cmmts comments) {
) (cmmts Comments) {
for x := 0; x <= page; x++ {
ujson(
"dashared/comments/thread?typeid="+strconv.Itoa(typ)+
@ -55,7 +55,7 @@ func Comments(
cmmts.Thread[i].Comment = m
// если начало строки {, а конец }, то срабатывает этот иф
if m[0] == 123 && m[l-1] == 125 {
if m[0] == '{' && m[l-1] == '}' {
var content struct {
Blocks []struct {
Text string