fbradyirl / webex_bot

Python package for a Webex Bot based on websockets.
MIT License
68 stars 44 forks source link

removeprefix() is 3.9 only #8

Closed jseynaev-cisco closed 3 years ago

jseynaev-cisco commented 3 years ago

Description

Just running the bot

What I Did

After receiving a message from the socket

ERROR:asyncio:Future exception was never retrieved
future: <Future finished exception=AttributeError("'str' object has no attribute 'removeprefix'")>

fix / workaround

removeprefix is only introduced in 3.9, so might be better to replace by something like this (bottom of the webex_bot.py file)

if message.startswith(command):
    return message[len(command):]
return message
fbradyirl commented 3 years ago

Fixed in #10