@SuppressWarnings("unchecked")
    private void readDiscordConfig(Map hooks, Rules rules) {
        Map configs = (Map) hooks.get(AlarmHooksType.discord.name());
        if (configs == null) {
            return;
        }
        configs.forEach((k, v) -> {
            Map<String, Object> config = (Map<String, Object>) v;
            String textTemplate = (String) config.get("text-template");
            List<Map<String, String>> webhooks = (List<Map<String, String>>) config.get("webhooks");
            if (StringUtil.isBlank(textTemplate) || CollectionUtils.isEmpty(webhooks)) {
                return;
            }
            List<DiscordSettings.WebHookUrl> webHookUrls = webhooks.stream().map(
                DiscordSettings.WebHookUrl::generateFromMap
            ).collect(Collectors.toList());

            DiscordSettings settings = new DiscordSettings(
                k.toString(), AlarmHooksType.discord, (Boolean) config.getOrDefault("is-default", false));
            settings.setTextTemplate(textTemplate);
            settings.setWebhooks(webHookUrls);

            rules.getDiscordSettingsMap().put(settings.getFormattedName(), settings);
            if (settings.isDefault()) {
                this.defaultHooks.add(settings.getFormattedName());
            }
            this.allHooks.add(settings.getFormattedName());
        });
    }
Read Discord hook config into {@link DiscordSettings}
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/RulesReader.java