nonsensebot/app/modules/msc_getter.py

17 lines
521 B
Python
Raw Normal View History

2024-09-15 20:25:42 +01:00
import niobot
class MSCGetter(niobot.Module):
@niobot.command()
async def msc(self, ctx: niobot.Context, number: str):
"""Fetches the given MSC"""
if number.startswith("msc"):
number = number[3:]
elif number.startswith("#"):
number = number[1:]
if not number.isdigit():
return await ctx.respond("Invalid MXC number.")
return await ctx.respond(
"https://github.com/matrix-org/matrix-spec-proposals/pull/" + number
)