2020-08-19 00:19:12 +03:00
|
|
|
import { getGuildTz } from "../functions/getGuildTz";
|
2021-06-06 23:51:32 +02:00
|
|
|
import { timeAndDateCmd } from "../types";
|
2020-08-19 00:19:12 +03:00
|
|
|
|
|
|
|
export const ViewTimezoneCmd = timeAndDateCmd({
|
|
|
|
trigger: "timezone",
|
|
|
|
permission: "can_set_timezone",
|
|
|
|
|
|
|
|
signature: {},
|
|
|
|
|
2023-05-08 22:58:51 +03:00
|
|
|
async run({ pluginData, message }) {
|
2020-08-19 00:19:12 +03:00
|
|
|
const memberTimezone = await pluginData.state.memberTimezones.get(message.author.id);
|
|
|
|
if (memberTimezone) {
|
2021-06-02 04:07:50 +02:00
|
|
|
message.channel.send(`Your timezone is currently set to **${memberTimezone.timezone}**`);
|
2020-08-19 00:19:12 +03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const serverTimezone = getGuildTz(pluginData);
|
2021-06-02 04:07:50 +02:00
|
|
|
message.channel.send(`Your timezone is currently set to **${serverTimezone}** (server default)`);
|
2020-08-19 00:19:12 +03:00
|
|
|
},
|
|
|
|
});
|