from typing import Tuple
from typing import Optional
import re


def decode_mention(mention: str) -> Tuple[Optional[str], Optional[int]]:
	"""returns whether mention is a member mention or a channel mention (or neither) as well as the id of the mentioned object"""
	match = re.search(r"<(#|@)!?(\d+)>", mention)
	if match is None:
		return None, None
	else:
		groups = match.groups()
		return "channel" if groups[0] == "#" else "member", int(groups[1])