/maubot-weather

This is a maubot plugin that uses wttr.in to get a simple representation of the weather

Primary LanguagePythonMIT LicenseMIT

build status latest Release Latest in dev

weather

A simple maubot (which was based on the echobot) that gets the weather from wttr.in and returns the text to the chat

Usage

  • !weather - Reply with the weather based on the default config value;
    if the default location is not provided, it will be detected from IP address by wttr.in
  • !weather <location> - Reply with the location for the specified <location> where <location> can be an airport code, or a city
  • !weather <location> u:[u|m|M] - As above, but specify unit of measure (see below)
  • !weather <location> l:[language code] - current weather and forecast in the specified language;
    available languages are listed on https://wttr.in/:translation
  • !moon - Display lunar phase information

Units

The unit is directly passed to the wttr.in, so the option specified must match what wttr.in expects.

Valid units are as follows:

  • u - USCS (used by default in US)
  • m - metric (SI) (used by default everywhere except US)
  • M - metric (SI), but show wind speed in m/s

(taken from https://github.com/chubin/wttr.in)

Examples

!weather

Entering !weather in the chat will display the default server location setting and display the single-line version of the weather from wttr.in.

oneline

If the show_image setting is true in the settings, the bot will return the png image of the current weather with the forecast

image_weather_oneline

!moon

Entering the !moon command in the chat will display a oneline version of the lunar phase:

image_moon

Installation

  1. Download the current com.arachnitech.weather-vX.Y.Z.mbp file from the Releases page.

  2. Follow the Maubot instructions which boils down to:

    1. In your maubot manager, click the plus sign next to plugins
    2. Upload the plugin you downloaded from step 1 above

Upgrading

Basically the same as the Installation, except since you already have it installed:

  1. Click on the com.arachnitech.weather under the plugins
  2. Upload the new version

Development

If you would like to mess with the source code to add your own stuff, or clean up some python atrocity I have committed, please clone/fork this repo and have at it.

I have built everything using poetry, so the easiest path is:

  1. clone/fork the repo
  2. run poetry shell
  3. run poetry install to add all the dependent packages
  4. Make changes.

Chat

chat

I have created a dedicated #maubot-weather:arachnitech.com channel. I also follow the #maubot:maubot.xyz channel.