File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ import groupJoin from "./events/groups/join";
1313import reaction from "./events/reaction" ;
1414import ready from "./events/ready" ;
1515
16- import fs from "fs" ;
17- import path from "path" ;
18-
1916const client = new Client ( {
2017 authStrategy : new LocalAuth ( ) ,
2118} ) ;
Original file line number Diff line number Diff line change @@ -14,20 +14,7 @@ export default async function ready() {
1414 try {
1515 const tempData = JSON . parse ( fs . readFileSync ( hotReloadPath , "utf-8" ) ) ;
1616
17- let chatId = null ;
18- if ( typeof tempData . id === "string" ) {
19- chatId = tempData . id ;
20- } else if ( tempData . id ?. _serialized ) {
21- chatId = tempData . id . _serialized ;
22- } else if ( tempData . id ?. id ) {
23- chatId = tempData . id . id + "@c.us" ;
24- }
25-
26- if ( chatId ) {
27- await client . sendMessage ( chatId , "Done" ) ;
28- return ;
29- }
30- log . error ( "restart" , "Could not resolve chat ID for message." ) ;
17+ await client . sendMessage ( tempData . id . remote , "Done" ) ;
3118 } catch ( err ) {
3219 log . error ( "restart" , err ) ;
3320 } finally {
@@ -40,4 +27,4 @@ export default async function ready() {
4027 } ) ;
4128 }
4229 }
43- } ;
30+ }
You can’t perform that action at this time.
0 commit comments