forked from mirrors/stickerpicker
The stickers for the schizo.cafe Matrix server
https://stickers.schizo.cafe/
web | ||
.gitignore | ||
example-config.json | ||
import.py | ||
LICENSE | ||
preview-element-android.png | ||
preview-element-web.png | ||
README.md | ||
requirements.txt |
Maunium sticker picker
A fast and simple Matrix sticker picker widget. Tested on Element Web & Android.
Importing packs from Telegram
- (Optional) Set up a virtual environment.
- Create with
virtualenv -p python3 .
- Activate with
source ./bin/activate
- Create with
- Install dependencies with
pip install -r requirements.txt
- Copy
example-config.json
toconfig.json
and set your homeserver URL and access token (used for uploading stickers to Matrix). - Run
python3 import.py <pack urls...>
- On the first run, it'll prompt you to log in with a bot token or a telegram account.
The session data is stored in
sticker-import.session
by default. - By default, the pack data will be written to
web/packs/
. - You can pass as many pack URLs as you want.
- You can re-run the command with the same URLs to update packs.
- On the first run, it'll prompt you to log in with a bot token or a telegram account.
The session data is stored in
If you want to list the URLs of all your saved packs, use python3 import.py --list
.
This requires logging in with your account instead of a bot token.
Enabling the sticker widget
-
Serve everything under
web/
using your webserver of choice. Make sure not to serve the top-level data, asconfig.json
and the Telethon session file contain sensitive data. -
Using
/devtools
in Element Web, edit them.widgets
account data event to have the following content:{ "stickerpicker": { "content": { "type": "m.stickerpicker", "url": "https://your.sticker.picker.url/index.html", "name": "Stickerpicker", "data": {} }, "sender": "@you:picker.url", "state_key": "stickerpicker", "type": "m.widget", "id": "stickerpicker" } }
If you do not yet have a
m.widgets
event, simply create it with that content. You can also use the client-server API directly instead of using Element Web. -
Open the sticker picker and enjoy the fast sticker picking experience.