17 lines
521 B
Python
17 lines
521 B
Python
|
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
|
||
|
)
|