Something went wrong. Try again.
A self-hosted web platform for applications & services with design based on Google's Material 3 Expressive. (Work In Progress)
self-hosted typescript
Something went wrong. Try again.
1.2 kB · 42 lines
TypeScript
at commit 3b00a86a
12345678910111213141516171819202122232425262728293031323334353637383940414243import { WorkspacesNotificationPriority } from "../../notifications.ts";import Command, { type ICommandRuntimeParameters } from "../command.ts";
export default class RestartCommand extends Command { override commandId = "notify"; flags = {}; aliases = []; override shortDescription = "Send a notification to all administrators";
async run(parameters: ICommandRuntimeParameters) { for (const userId of (await this.instance.sys.users.getAllUsers()).map((u) => u.userId)) { this.instance.sys.notifications.send( userId, "commands.notify", WorkspacesNotificationPriority.Important, { title: "Notification Test 1", body: "This is a sample notification from the console!", icon: "person", }, { buttons: [ { id: "a", label: "label", type: "filled", }, { id: "a", label: "label", type: "tonal", }, ], }, ); }
this.log.info("sent notifications");
return this.finishRun(); }}