A plugin for Devzat that can tell the time at various timezones.

Overview

Devzat Time Teller

On Devzat, people come from all around the time. It is sometime hard to know what time it is for other peoples. This plugin let you see the current time at any timezone with a command.

In-chat usage

For the people in the chat-room, this plugin exposes the command, time_at. This command takes as argument an IANA timezone.

Here is an example of in-chat use:

Arkaeriit: time_at CET
Time-teller: At the timezone CET, it is 14:29.
Arkaeriit: time_at Europe/Paris
Time-teller: At the timezone Europe/Paris, it is 14:29.
Arkaeriit: time_at NotATimeZone
Time-teller: Error, NotATimeZone is not a valid time zone.

As a bonus, this plugin also exposes the command rpn which perform an RPN calculation using the program qalc.

Arkaeriit: rpn 2 2 +
2 + 2 = 4

Admin usage

The plugin is made for a single-file executable. It is configured with the following environment variable.

Variable name Description Default
PLUGIN_HOST URL of the chat-room interface https://devzat.hackclub.com:5556
PLUGIN_TOKEN Authentication token Does not defaults to anything. The program panics if the token is not given.
LOGIN_ROOM Name of the room where the bot will tell when it is connected. #bots
DEV_NICK Nickname of the user the bot will tell when it is connected Arkaeriit
BOT_NAME Name used by the bot to introduce itself. Time-teller

Acknowledgment

Special thanks to Tommy for the library he made to make Devzat plugins in Rust.

You might also like...
SWC plugin for transform Vue3-jsx syntax

swc-plugin-transform-vue3-jsx πŸ’‘ SWC plugin for faster conversion vue3-jsx. Installation npm npm install swc-plugin-transform-vue3-jsx -D yarn yarn ad

A Foundry plugin that enables you to plot charts within solidity.

πŸ–ŒοΈ solplot A Foundry plugin that enables you to plot charts within solidity. Installation First, make sure that you have Rust installed. Then install

Lapce vue plugin, support vue (SFC) syntax highlight, autocomplate,types check
Lapce vue plugin, support vue (SFC) syntax highlight, autocomplate,types check

Lapce Plugin for Vue (based volar) Preview Usage Required: Lapce version must be greater than 2.0, and you can use Lapce nightly version. click here t

Component-based state machine plugin for Bevy

seldom_state is a component-based state machine plugin for Bevy. It's useful for AI, player state, and other entities that occupy various states. It allows for greater reusability of state logic between entities, compared to managing mutually-exclusive components directly in your systems.

Analog subtractive synth (VST Plugin) made with Rust

Synja Analog subtractive synth (VST3 Plugin) made with Rust. More an experiment in making a VST and learning Rust than a production quality Synth, but

πŸ₯ƒ A plugin for swizzling Tauri’s NSWindow to NSPanel

Swizzle Tauri's NSWindow to NSPanel Install There are three general methods of installation that we can recommend. Use crates.io and npm (easiest, and

A Zellij plugin for quickly searching and switching tabs πŸ–€
A Zellij plugin for quickly searching and switching tabs πŸ–€

πŸ–€ room A Zellij plugin for quickly searching and switching between tabs. Usage Tab to cycle through tab list Up and Down to cycle through tab list En

A swc plugin that automatically converts React component libraries into "React Client Component"

A swc plugin that automatically converts React component libraries into "React Client Component". For example, you can automatically convert components from @mui into "React Client Component" without having to wrap a component that uses "use client".

Zellij plugin to quickly navigate your panes (clone of nvim's harpoon)
Zellij plugin to quickly navigate your panes (clone of nvim's harpoon)

harpoon A Zellij plugin for quickly searching and switching between tabs. Copy of the original harpoon for nvim. Usage a to add pane to list Up and Do

Comments
  • Error while validating the timezone.

    Error while validating the timezone.

    use std::process::Command;
    
    const TZ_PATH: &str = "/usr/share/zoneinfo/";
    
    fn f(tz: &str) -> bool {
        let tz_path = TZ_PATH.to_owned() + tz;
    
        dbg!(tz_path.clone());
    
        let output = Command::new("find")
            .arg(tz_path)
            .output()
            .expect("err");
    
        dbg!(std::str::from_utf8(&output.stdout).unwrap());
    
        output.status.success()
    }
    
    fn main() {
        f("Europe/Madrid"); // Success: Valid path
        f("../../../bin/ls"); // Success: Valid path
        f("../"); // Success: Valid path - Spams a lot of text
    }
    

    Suggested fix: Add a check for "." in the beginning of the function to avoid directory traversal.

    fn f(tz: &str) -> bool {
        if tz.contains(".") {
            return false;
        }
    }
    

    Command injection is not possible due to how the arg function works, however this will lead to the TZ env variable being set to an invalid string.

    opened by tommyp6 2
Owner
Maxime Bouillot
Maxime Bouillot
hy-rs, pronounced high rise, provides a unified and portable to the hypervisor APIs provided by various platforms.

Introduction The hy-rs crate, pronounced as high rise, provides a unified and portable interface to the hypervisor APIs provided by various platforms.

S.J.R. van Schaik 12 Nov 1, 2022
Various extention traits for providing asynchronous higher-order functions

async-hofs Various extention traits for providing asynchronous higher-order functions. // This won't make any name conflicts since all imports inside

γ‹γ‚γˆγ‚‚γ‚“ 5 Jun 28, 2022
Stdto provides a set of functional traits for conversion between various data representations.

Stdto stdto provides a set of functional traits for conversion between various data representations. | Examples | Docs | Latest Note | stdto = "0.13.0

Doha Lee 5 Dec 21, 2022
This plugin provides an interface for storing unencrypted values on the application cache folder.

Tauri Plugin Store This plugin provides an interface for storing unencrypted values on the application cache folder. Architecture This repo shape migh

Tauri 128 Jan 1, 2023
This is a Pomodoro Clock implemented as a Zellij plugin.

Pomodoro Clock This is a Pomodoro Clock implemented as a Zellij plugin. It shows a Pomodoro time as well as current date time. Prerequisite You must i

Tw 15 Nov 14, 2022
A VtubeStudio plugin that allows iFacialMocap to stream data to the app, enabling full apple ARkit facial tracking to be used for 2D Vtuber models.

facelink_rs A VtubeStudio plugin that allows iFacialMocap to stream data to the app, enabling full apple ARkit facial tracking to be used for 2D Vtube

Slashscreen 2 May 6, 2022
A rollup plugin that compile Rust code into WebAssembly modules

rollup-plugin-rust tl;dr -- see examples This is a rollup plugin that loads Rust code so it can be interop with Javascript base project. Currently, th

Fahmi Akbar Wildana 37 Aug 1, 2022
[SWC plugin] workaround for jest

[SWC plugin] workaround for jest This is a SWC plugin to handle jest compatibility issues. This SWC plugin should be used with @swc/jest. usage instal

magic-akari 17 Dec 19, 2022
Replicated storage docker plugin.

Fractal Docker Plugin This plugin handles the creation and deletion of docker volumes backed by copy-on-write filesystems (BTRFS currently), regular s

Fractal Networks 5 Sep 2, 2022
Bioinformatics plugin for nushell.

Nushell bio A bioinformatics plugin for nushell. The aim initially is to create a bunch of parsers for all of the common bioinformatics file formats a

Max Brown 7 Jan 8, 2023