Показать сообщение отдельно

  #7  
Старый 26.06.2022, 04:47
Kecer
Участник форума
Регистрация: 05.12.2020
Сообщений: 241
С нами: 2862489

Репутация: 18
По умолчанию

Цитата:
Сообщение от Liquit  

а почему у тебя сообщение отправляется в chat_id 1? это должен быть по идее msg.reply
не понял, что за msg.reply

Прикол в том что я с этой ошибкой уже мучаюсь 2 дня,

JavaScript:





Код:
bot
.
hear
(
/^(?:\/test)$/i
,
async
msg
=>
{
await
msg
.
send
(
{
message
:
'command'
,
chat_id
:
1
,
random_id
:
getRandomId
(
)
}
)
.
then
(
message
=>
{
console
.
log
(
msg
)
}
)
}
)


Вот когда я в консоль лог вывожу msg, то у меня выводится всё, и айди сообщения и текст его и кто отправил

JavaScript:





Код:
MessageContext
{
id
:
0
,
conversationMessageId
:
204
,
peerId
:
2000000001
,
peerType
:
'chat'
,
senderId
:
393032625
,
senderType
:
'user'
,
createdAt
:
1656204564
,
updatedAt
:
undefined
,
pinnedAt
:
undefined
,
text
:
'/test'
,
forwards
:
MessageForwardsCollection
(
0
)
[
]
,
attachments
:
[
]
,
isOutbox
:
false
,
'$match'
:
[
'/test'
,
index
:
0
,
input
:
'/test'
,
groups
:
undefined
]
,
type
:
'message'
,
subTypes
:
[
'message_new'
]
,
state
:
{
}
}


А сообщение которое я отправил в беседу

JavaScript:





Код:
bot
.
hear
(
/^(?:\/test)$/i
,
async
msg
=>
{
await
msg
.
send
(
{
message
:
'command'
,
chat_id
:
1
,
random_id
:
getRandomId
(
)
}
)
.
then
(
message
=>
{
console
.
log
(
message
)
}
)
}
)


оно его попросту не видит

JavaScript:





Код:
MessageContext
{
id
:
0
,
conversationMessageId
:
0
,
peerId
:
2000000001
,
peerType
:
'chat'
,
senderId
:
393032625
,
senderType
:
'user'
,
createdAt
:
1656204696
,
updatedAt
:
undefined
,
pinnedAt
:
undefined
,
text
:
undefined
,
forwards
:
MessageForwardsCollection
(
0
)
[
]
,
attachments
:
[
]
,
isOutbox
:
true
,
type
:
'message'
,
subTypes
:
[
'message_new'
]
,
state
:
{
}
}


У него постоянно conversationMessageId: 0

Текст сообщения undefined
 
Ответить с цитированием