mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 13:55:03 +00:00
!timezone: add fuzzy matching for timezone name; add reset
This commit is contained in:
parent
4ae8cf85a3
commit
753ceda5ec
6 changed files with 90 additions and 7 deletions
21
backend/src/plugins/TimeAndDate/commands/ResetTimezoneCmd.ts
Normal file
21
backend/src/plugins/TimeAndDate/commands/ResetTimezoneCmd.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { timeAndDateCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { getGuildTz } from "../functions/getGuildTz";
|
||||
|
||||
export const ResetTimezoneCmd = timeAndDateCmd({
|
||||
trigger: "timezone reset",
|
||||
permission: "can_set_timezone",
|
||||
|
||||
signature: {},
|
||||
|
||||
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}**`,
|
||||
);
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue