Skip to content

Core library of the retro end2end encrypted terminal messenger.

License

Notifications You must be signed in to change notification settings

lukwies/libretro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libretro

Core library of the retro end2end encrypted terminal messenger.

Install

Installing libretro:

$ pip install .

Installing libretro in development mode:

$ pip install -e .

Uninstall

$ pip uninstall libretro

Modules

Account.py         User account
AccountDb.py       User account database
Config.py          Client configs
crypto.py          Crypto and hash functions
Friend.py          Friend class
FriendDb.py        Encrypted sqlite3 db to resolve friendId's to names
MsgHandler.py      Create/Decrypt end2end messages
MsgStore.py        Message storage (encrypted sqlite)
net.py             Network functions (TLS)
RegKey.py          Registration key
RetroBot.py        Baseclass for creating bots
RetroClient.py     Central client context

Bot Example

Writing an own retro bot is really straight forward. The only thing you need to do is to subclass libretro.RetroBot and overwrite the method handle_message().

from libretro.RetroBot import RetroBot

class MyBot(libretro.RetroBot):
        def __init__(self):
                super().__init__()
                ...

        def handle_message(sender:Friend, text:str):
                # Here we do override the method that
                # is called after receiving a chatmsg.
                # In this case simply send the message
                # back to the sender...
                self.send_msg(sender, text)

A bot needs an account just like a 'normal' user. This is how to create one...

bot = MyBot()
bot.create_account(regkey_file)

To load the bot account call

bot.load(username, password)

Now, since the bot account is loaded you can either add a friend (communication partner) ...

bot.add_friend(friend_name, friend_id)

... or run the bot's mainloop.

bot.run()

About

Core library of the retro end2end encrypted terminal messenger.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages