aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2022-03-13 15:55:59 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2022-03-13 15:55:59 +0300
commit8aa5187e2ec93ec0a0864725cb158b0eb3331499 (patch)
tree37cdab747e71ac6be7032d6357b519506ea107be
parent022a12ce3174ebc53ad7be712fd37077145aaffc (diff)
Fix entity sorting
-rw-r--r--telegram/formatter/formatter.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/telegram/formatter/formatter.go b/telegram/formatter/formatter.go
index d6541cb..53b4625 100644
--- a/telegram/formatter/formatter.go
+++ b/telegram/formatter/formatter.go
@@ -59,8 +59,8 @@ func SortEntities(entities []*client.TextEntity) []*client.TextEntity {
copy(sortedEntities, entities)
sort.Slice(sortedEntities, func(i int, j int) bool {
- entity1 := entities[i]
- entity2 := entities[j]
+ entity1 := sortedEntities[i]
+ entity2 := sortedEntities[j]
if entity1.Offset < entity2.Offset {
return true
} else if entity1.Offset == entity2.Offset {