mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-25 10:25:01 +00:00
Merge branch 'ZeppelinBot:master' into master
This commit is contained in:
commit
015a908128
3 changed files with 9 additions and 6 deletions
|
@ -164,7 +164,7 @@ export function getPluginConfigPreprocessor(
|
||||||
|
|
||||||
if (options.overrides) {
|
if (options.overrides) {
|
||||||
for (const override of options.overrides) {
|
for (const override of options.overrides) {
|
||||||
const overrideConfigMergedWithBaseConfig = configUtils.mergeConfig(options.config, override.config || {});
|
const overrideConfigMergedWithBaseConfig = configUtils.mergeConfig(options.config || {}, override.config || {});
|
||||||
const decodedOverrideConfig = blueprint.configSchema
|
const decodedOverrideConfig = blueprint.configSchema
|
||||||
? decodeAndValidateStrict(blueprint.configSchema, overrideConfigMergedWithBaseConfig)
|
? decodeAndValidateStrict(blueprint.configSchema, overrideConfigMergedWithBaseConfig)
|
||||||
: overrideConfigMergedWithBaseConfig;
|
: overrideConfigMergedWithBaseConfig;
|
||||||
|
|
|
@ -8,7 +8,7 @@ import moment from "moment-timezone";
|
||||||
import { isEligible } from "../functions/isEligible";
|
import { isEligible } from "../functions/isEligible";
|
||||||
|
|
||||||
export const AddServerFromInviteCmd = botControlCmd({
|
export const AddServerFromInviteCmd = botControlCmd({
|
||||||
trigger: ["add_server_from_invite", "allow_server_from_invite"],
|
trigger: ["add_server_from_invite", "allow_server_from_invite", "adv"],
|
||||||
permission: "can_add_server_from_invite",
|
permission: "can_add_server_from_invite",
|
||||||
|
|
||||||
signature: {
|
signature: {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { GuildPluginData } from "knub";
|
import { GuildPluginData } from "knub";
|
||||||
import { RemindersPluginType } from "../types";
|
import { RemindersPluginType } from "../types";
|
||||||
import { Reminder } from "../../../data/entities/Reminder";
|
import { Reminder } from "../../../data/entities/Reminder";
|
||||||
import { Snowflake, TextChannel } from "discord.js";
|
import { DiscordAPIError, HTTPError, Snowflake, TextChannel } from "discord.js";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { disableLinkPreviews } from "knub/dist/helpers";
|
import { disableLinkPreviews } from "knub/dist/helpers";
|
||||||
import { DBDateFormat, SECONDS } from "../../../utils";
|
import { DBDateFormat, isDiscordHTTPError, SECONDS } from "../../../utils";
|
||||||
import humanizeDuration from "humanize-duration";
|
import humanizeDuration from "humanize-duration";
|
||||||
|
|
||||||
export async function postReminder(pluginData: GuildPluginData<RemindersPluginType>, reminder: Reminder) {
|
export async function postReminder(pluginData: GuildPluginData<RemindersPluginType>, reminder: Reminder) {
|
||||||
|
@ -31,10 +31,13 @@ export async function postReminder(pluginData: GuildPluginData<RemindersPluginTy
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// If we were unable to post the reminder, we'll try again later
|
|
||||||
// tslint:disable-next-line:no-console
|
// tslint:disable-next-line:no-console
|
||||||
console.warn(`Error when posting reminder for ${reminder.user_id} in guild ${reminder.guild_id}: ${String(err)}`);
|
console.warn(`Error when posting reminder for ${reminder.user_id} in guild ${reminder.guild_id}: ${String(err)}`);
|
||||||
return;
|
|
||||||
|
if (err instanceof HTTPError && err.code >= 500) {
|
||||||
|
// If we get a server error, try again later
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue