mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 13:55:03 +00:00
Added Discord attachment link reaction, fixed emoji configuration and moved util functions
This commit is contained in:
parent
a4c4b17a14
commit
592d037148
173 changed files with 1540 additions and 1170 deletions
|
@ -1,4 +1,4 @@
|
|||
import { sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { CommonPlugin } from "../../Common/CommonPlugin";
|
||||
import { getGuildTz } from "../functions/getGuildTz";
|
||||
import { timeAndDateCmd } from "../types";
|
||||
|
||||
|
@ -11,10 +11,8 @@ export const ResetTimezoneCmd = timeAndDateCmd({
|
|||
async run({ pluginData, message }) {
|
||||
await pluginData.state.memberTimezones.reset(message.author.id);
|
||||
const serverTimezone = getGuildTz(pluginData);
|
||||
sendSuccessMessage(
|
||||
pluginData,
|
||||
message.channel,
|
||||
`Your timezone has been reset to server default, **${serverTimezone}**`,
|
||||
);
|
||||
pluginData
|
||||
.getPlugin(CommonPlugin)
|
||||
.sendSuccessMessage(message, `Your timezone has been reset to server default, **${serverTimezone}**`);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { escapeInlineCode } from "discord.js";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { trimLines } from "../../../utils";
|
||||
import { parseFuzzyTimezone } from "../../../utils/parseFuzzyTimezone";
|
||||
import { CommonPlugin } from "../../Common/CommonPlugin";
|
||||
import { timeAndDateCmd } from "../types";
|
||||
|
||||
export const SetTimezoneCmd = timeAndDateCmd({
|
||||
|
@ -16,9 +16,8 @@ export const SetTimezoneCmd = timeAndDateCmd({
|
|||
async run({ pluginData, message, args }) {
|
||||
const parsedTz = parseFuzzyTimezone(args.timezone);
|
||||
if (!parsedTz) {
|
||||
sendErrorMessage(
|
||||
pluginData,
|
||||
message.channel,
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(
|
||||
message,
|
||||
trimLines(`
|
||||
Invalid timezone: \`${escapeInlineCode(args.timezone)}\`
|
||||
Zeppelin uses timezone locations rather than specific timezone names.
|
||||
|
@ -29,6 +28,6 @@ export const SetTimezoneCmd = timeAndDateCmd({
|
|||
}
|
||||
|
||||
await pluginData.state.memberTimezones.set(message.author.id, parsedTz);
|
||||
sendSuccessMessage(pluginData, message.channel, `Your timezone is now set to **${parsedTz}**`);
|
||||
pluginData.getPlugin(CommonPlugin).sendSuccessMessage(message, `Your timezone is now set to **${parsedTz}**`);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue