def wrap_watch(pattern, force=False): cmd = 'watch{0}'.format('-force' if force else '') msg = Fake({ "_client": { "host": "stackexchange.com", "get_user": lambda id: Fake({ "name": "J F", "id": id }) }, "owner": { "name": "El'endia Starman", "id": 1 }, "room": { "id": 11540, "get_current_user_ids": lambda: [161943] }, # Ouch, this is iffy # Prevent an error from deep inside do_blacklist "content_source": '!!/{0} {1}'.format(cmd, pattern) }) msg.room._client = msg._client return chatcommands.watch(pattern, alias_used=cmd, original_msg=msg)
def wrap_watch(pattern, force=False): cmd = 'watch{0}'.format('-force' if force else '') msg = Fake({ "_client": { "host": "stackexchange.com", "get_user": lambda id: Fake({"name": "J F", "id": id}) }, "owner": {"name": "ArtOfCode", "id": 121520}, "room": {"id": 11540, "get_current_user_ids": lambda: [161943]}, # Ouch, this is iffy # Prevent an error from deep inside do_blacklist "content_source": '!!/{0} {1}'.format(cmd, pattern) }) msg.room._client = msg._client return chatcommands.watch(pattern, alias_used=cmd, original_msg=msg)
def wrap_watch(pattern, force=False): cmd = 'watch{0}'.format('-force' if force else '') msg = Fake({ "_client": { "host": "stackexchange.com", "get_user": lambda id: Fake({"name": "J F", "id": id}) }, "owner": {"name": "El'endia Starman", "id": 1}, "room": {"id": 11540, "get_current_user_ids": lambda: [161943]}, # Ouch, this is iffy # Prevent an error from deep inside do_blacklist "content_source": '!!/{0} {1}'.format(cmd, pattern) }) msg.room._client = msg._client # Prevent from attempting to check privileges with Metasmoke GlobalVars.code_privileged_users = [1, 161943] return chatcommands.watch(pattern, alias_used=cmd, original_msg=msg)