Skip to content

Commit

Permalink
🧑‍💻 Update messages exampl
Browse files Browse the repository at this point in the history
  • Loading branch information
RustySnek committed Jan 8, 2024
1 parent 357c286 commit 2c62a8d
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions examples/messages_example.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
from librus_apix.messages import get_recieved, message_content
from librus_apix.get_token import get_token

username = "USERNAME"
password = "PASSWORD"
token = get_token(username, password)

# pages start from 0
recieved = get_recieved(token, page=0)
"""
Structure of Message class:
class Message:
author: str
title: str
date: str
href: str
unread: bool
has_attachment: bool
"""
# Printing out the content of the 10 newest recieved messages.
for message in recieved[:11]:
print()
print(message.title)
print(message_content(token, message.href))
def messages(token):
# pages start from 0
recieved = get_recieved(token, page=0)
"""
Structure of Message class:
class Message:
author: str
title: str
date: str
href: str
unread: bool
has_attachment: bool
"""
# Printing out the content of the 10 newest recieved messages.
for message in recieved[:11]:
print()
print(message.title)
print(message.href)
print(message_content(token, message.href))


if __name__ == "__main__":
username = "USERNAME"
password = "PASSWORD"

token = get_token(username, password)

messages(token)

0 comments on commit 2c62a8d

Please sign in to comment.