slack-notification.js 590 B

1234567891011121314151617181920
  1. const logger = require('@alias/logger')('growi:service:SlackNotification'); // eslint-disable-line no-unused-vars
  2. /**
  3. * the service class of SlackNotificationService
  4. */
  5. class SlackNotificationService {
  6. constructor(configManager) {
  7. this.configManager = configManager;
  8. }
  9. hasSlackConfig() {
  10. const hasSlackToken = !!this.configManager.getConfig('notification', 'slack:token');
  11. const hasSlackIwhUrl = !!this.configManager.getConfig('notification', 'slack:incomingWebhookUrl');
  12. return hasSlackToken || hasSlackIwhUrl;
  13. }
  14. }
  15. module.exports = SlackNotificationService;