Skip to content

Instantly share code, notes, and snippets.

Last active October 9, 2022 21:36
What would you like to do?
elif cmd == prefix + 'room':
threading.Thread(target=self.do_room_info, args=(cmd_arg,)).start()
def do_room_info(self, room):
Shows info about a tinychat room.
:param room: str tinychat room.
if self.is_client_mod:
if len(room) is 0:
self.send_undercover_msg(self.active_user.nick, 'Missing room to search for.')
tc_usr = pinylib.apis.tinychat.room_info(room)
if tc_usr is None:
self.send_undercover_msg(self.active_user.nick, 'Could not find tinychat info for: ' + room)
self.send_bot_msg('*Room ID:* ' + tc_usr['tinychat_id'])
//Add the below code to the file located in the apis folder.
def room_info(tc_room):
Finds info for a given tinychat room name.
:param tc_room: str the room name.
:return: dict {'tinychat_id'} or None on error.
url = '' % tc_room
response = util.web.http_get(url=url, json=True)
if response['json'] is not None:
if 'error' not in response['json']:
room_id = response['json']['id']
return {
'tinychat_id': room_id
return None
Copy link

it will output the room/users Tinychat ID

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment