
26.06.2022, 15:00
|
|
Познавший АНТИЧАТ
Регистрация: 01.11.2018
Сообщений: 1,010
С нами:
3964085
Репутация:
183
|
|
в
находиться id чата
JavaScript :
Код:
import
{
VK
}
from
"vk-io"
import
{
HearManager
}
from
"@vk-io/hear"
const
vk
=
new
VK
(
{
token
:
"token"
}
)
const
bot
=
new
HearManager
(
)
const
chatForSend
=
1
vk
.
updates
.
on
(
"message_new"
,
bot
.
middleware
)
bot
.
hear
(
"/sendToAnotherChat"
,
async
message
=>
{
message
.
reply
(
`send to chat${chatForSend}`
)
const
msg
=
await
message
.
send
(
{
message
:
"отправлено из shiruwatch"
,
peer_ids
:
2e9
+
chatForSend
}
)
setTimeout
(
(
)
=>
{
msg
.
editMessage
(
{
message
:
"root???????????"
}
)
}
,
1500
)
}
)
vk
.
updates
.
start
(
)
.
then
(
(
)
=>
console
.
log
(
"updates started"
)
)
.
catch
(
console
.
error
)
|
|
|