const { sendMessage } = require('../api');
const { ADMIN_GROUP_IDS } = require('../config');
const { safeExec } = require('../helpers');

const sendToAdmins = safeExec(async (message) => {
  for (const id of ADMIN_GROUP_IDS) {
    await sendMessage(id, message);
  }
});

module.exports = { sendToAdmins };
