diff --git a/src/plugins/Timezones/Utils.ts b/src/plugins/Timezones/Utils.ts index 796a281ce..b744e7d7d 100644 --- a/src/plugins/Timezones/Utils.ts +++ b/src/plugins/Timezones/Utils.ts @@ -30,7 +30,7 @@ export interface TimezoneDB { [userId: string]: typeof timezones[number]; } -const API_URL = "https://timezonedb.catvibers.me"; +export const API_URL = "https://timezonedb.catvibers.me"; const Cache: Record = {}; export function getTimeString(timezone: string, timestamp = new Date()): string { diff --git a/src/plugins/Timezones/index.tsx b/src/plugins/Timezones/index.tsx index 15b6f2143..9ac0a1bff 100644 --- a/src/plugins/Timezones/index.tsx +++ b/src/plugins/Timezones/index.tsx @@ -19,7 +19,7 @@ import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands"; import * as DataStore from "@api/DataStore"; -import { Devs } from "@utils/constants"; +import { Devs, VENCORD_USER_AGENT } from "@utils/constants"; import { classes, useForceUpdater } from "@utils/misc"; import definePlugin, { OptionType } from "@utils/types"; import { findByCodeLazy, findByPropsLazy } from "@webpack"; @@ -33,7 +33,7 @@ const DeleteIcon = findByCodeLazy("M15 3.999V2H9V3.999H3V5.999H21V3.999H15Z"); const classNames = findByPropsLazy("customStatusSection"); import { timezones } from "./all_timezones"; -import { DATASTORE_KEY, getTimeString, getUserTimezone, TimezoneDB } from "./Utils"; +import { API_URL, DATASTORE_KEY, getTimeString, getUserTimezone, TimezoneDB } from "./Utils"; const styles = findByPropsLazy("timestampInline"); @@ -56,6 +56,16 @@ export default definePlugin({ default: true, }, }, + settingsAboutComponent: () => { + const href = `${API_URL}?client_mod=${encodeURIComponent(VENCORD_USER_AGENT)}`; + return ( + + A plugin that displays the local time for specific users using their timezone.
+ By default the timezone will be fetched from the open(href)}>TimezoneDB (if available),
+ but you can override that with a custom timezone. +
+ ); + }, commands: [ { name: "settimezone",