Skip to content

Commit

Permalink
Merge pull request #2 from cremesk/main
Browse files Browse the repository at this point in the history
fix url in "show link" option
  • Loading branch information
kellya committed Jul 14, 2021
2 parents 6e147e1 + 3d2b777 commit d572f99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion maubot.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
maubot: 0.1.0
id: com.arachnitech.weather
version: 0.0.14
version: 0.0.15
license: MIT
modules:
- weather
Expand Down
5 changes: 3 additions & 2 deletions weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from maubot.handlers import command
from typing import Type
from mautrix.util.config import BaseProxyConfig, ConfigUpdateHelper
from yarl import URL


class Config(BaseProxyConfig):
Expand Down Expand Up @@ -40,7 +41,7 @@ async def weather_handler(self, evt: MessageEvent, location=None) -> None:
elif location:
rsp = await self.http.get(f'http://wttr.in/{location}?format=3')
weather = await rsp.text()
link = f'[(wttr.in)](http://wttr.in/{location})'
link = f'[(wttr.in)]({URL("https://wttr.in") / location})'
message = weather
if self.config["show_link"]:
message += link
Expand All @@ -50,7 +51,7 @@ async def weather_handler(self, evt: MessageEvent, location=None) -> None:
location=self.config["default_location"]
rsp = await self.http.get(f'http://wttr.in/{location}?format=3')
weather = await rsp.text()
link = f'[(wttr.in)](http://wttr.in/{location})'
link = f'[(wttr.in)]({URL("https://wttr.in") / location})'
message = weather
if self.config["show_link"]:
message += link
Expand Down

0 comments on commit d572f99

Please sign in to comment.