def friends(): friends = Connection.friendshipRequest("friends", {}).get("friends") Common.printNotificationText(f"Friends: {len(friends)}") for friend in friends: Common.printNotificationText(friend)
def outgoing(): outgoing = Connection.friendshipRequest("outgoing", {}).get("outgoing") Common.printNotificationText( f"Ougoing Friendship Requests: {len(outgoing)}") for username in outgoing: Common.printNotificationText(username)
def incoming(): incoming = Connection.friendshipRequest("incoming", {}).get("incoming") Common.printNotificationText( f"Incoming Friendship Requests: {len(incoming)}") for username in incoming: Common.printNotificationText(username)
def helpCommand(**kwargs): from .commandConfig import CommandConfig controllerName = kwargs.get("controller").__name__ commonCommands = CommandConfig.getCommonCommands() privateCommands = CommandConfig.getSpecialCommands(controllerName) for command, value in commonCommands.items(): Common.printNotificationText( f"{command} -> {value.get('description')}") for command, value in privateCommands.items(): Common.printNotificationText( f"{command} -> {value.get('description')}")
def read(): response = Connection.notificationRequest("read", {}) notifications = response.get("notifications") Common.printNotificationText("Notifications:\n") for notification in notifications: if notification.get("content") is None: continue notificationId = notification.get("id") date = notification.get("date") content = notification.get("content") Common.printNotificationText( f"id -> {notificationId}\ndate -> {date}\ncontent -> {content}\n" )
def whoami(): response = Connection.profileRequest("whoami", {}).get("whoami") Common.printNotificationText( f"Username -> {response.get('username')}\nEmail -> {response.get('email')}" )