3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-14 21:31:50 +00:00
zeppelin/backend/src/plugins/TimeAndDate/commands/ViewTimezoneCmd.ts

21 lines
656 B
TypeScript
Raw Normal View History

import { getGuildTz } from "../functions/getGuildTz";
import { timeAndDateCmd } from "../types";
export const ViewTimezoneCmd = timeAndDateCmd({
trigger: "timezone",
permission: "can_set_timezone",
signature: {},
async run({ pluginData, message }) {
const memberTimezone = await pluginData.state.memberTimezones.get(message.author.id);
if (memberTimezone) {
message.channel.send(`Your timezone is currently set to **${memberTimezone.timezone}**`);
return;
}
const serverTimezone = getGuildTz(pluginData);
message.channel.send(`Your timezone is currently set to **${serverTimezone}** (server default)`);
},
});