Skip to content

Instantly share code, notes, and snippets.

@nesffer
Last active November 9, 2019 11:54
Show Gist options
  • Save nesffer/3e786aafc2242d1a96a60edd748dc7f2 to your computer and use it in GitHub Desktop.
Save nesffer/3e786aafc2242d1a96a60edd748dc7f2 to your computer and use it in GitHub Desktop.
텔레그램 봇 정각알림
const schedule = require('node-schedule');
schedule.scheduleJob('0 0 * * * *', () => {
var chatParticipantFile = fs.readFileSync('./chat_participant.txt', 'utf8');
var chatParticipant = chatParticipantFile.split('\n');
chatParticipant.forEach((element, index, array) => {
if (element) {
bot.sendMessage(element, '정각입니다.', {disable_notification: true});
}
});
});
CHAT_ID_0
CHAT_ID_1
CHAT_ID_2
CHAT_ID_3
CHAT_ID_4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment