python-o365 icon indicating copy to clipboard operation
python-o365 copied to clipboard

inbox.get_message() only returning very first message

Open jaymaart opened this issue 3 years ago • 0 comments

`

scopes = ["mailbox"]
credentials = (config.EMAIL, config.MAIL_SECRET)
token_backend = FileSystemTokenBackend(token_filename="o365_token.txt")




class CashApp(Cog):
    def __init__(self, bot):
        self.bot = bot
        self.account = Account(credentials, scopes=scopes, token_backend=token_backend)




async def verify_payment(self, code: str):    
    mailbox = self.account.mailbox()
    query = mailbox.new_query().on_attribute('from').contains('[email protected]')
    inbox = mailbox.inbox_folder()
    for message in inbox.get_messages(limit=100, query=query):

`

    for some reason it is only returning the very first email inside the inbox

jaymaart avatar Dec 11 '22 22:12 jaymaart