Skip to content

Commit a7b0ae4

Browse files
committed
Update the README.md description
Merge from maunium#46 and maunium#49 added more stickers
1 parent 824c553 commit a7b0ae4

78 files changed

Lines changed: 425 additions & 143 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 57 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,57 @@
1-
# Maunium sticker picker
2-
A fast and simple Matrix sticker picker widget. Tested on Element Web, Android & iOS.
3-
4-
## Discussion
5-
Matrix room: [`#stickerpicker:maunium.net`](https://matrix.to/#/#stickerpicker:maunium.net)
6-
7-
## Instructions
8-
For setup and usage instructions, please visit the [wiki](https://github.com/maunium/stickerpicker/wiki):
9-
10-
* [Creating packs](https://github.com/maunium/stickerpicker/wiki/Creating-packs)
11-
* [Enabling the widget](https://github.com/maunium/stickerpicker/wiki/Enabling-the-widget)
12-
* [Hosting on GitHub pages](https://github.com/maunium/stickerpicker/wiki/Hosting-on-GitHub-pages)
13-
14-
If you prefer video tutorials, [Brodie Robertson](https://www.youtube.com/c/BrodieRobertson) has made a great video on setting up the picker and creating some packs: https://youtu.be/Yz3H6KJTEI0.
15-
16-
## Comparison with other sticker pickers
17-
18-
* Scalar is the default integration manager in Element, which can't be self-hosted and only supports predefined sticker packs.
19-
* [Dimension](https://github.com/turt2live/matrix-dimension) is an alternate integration manager. It can be self-hosted, but it's more difficult than Maunium sticker picker.
20-
* Maunium sticker picker is just a sticker picker rather than a full integration manager. It's much simpler than integration managers, but currently has to be set up manually per-user.
21-
22-
| Feature | Scalar | Dimension | Maunium sticker picker |
23-
|---------------------------------|--------|-----------|------------------------|
24-
| Free software || ✔️ | ✔️ |
25-
| Custom sticker packs || ✔️ | ✔️ |
26-
| Telegram import || ✔️ | ✔️ |
27-
| Works on Element mobiles | ✔️ || ✔️ |
28-
| Easy multi-user setup | ✔️ | ✔️ | ❌<sup>[#7][#7]</sup> |
29-
| Frequently used stickers at top ||| ✔️ |
30-
31-
[#7]: https://github.com/maunium/stickerpicker/issues/7
32-
33-
## Preview
34-
### Element Web
35-
![Element Web](preview-element-web.png)
36-
37-
### Element Android
38-
![Element Android](preview-element-android.png)
39-
40-
### Element iOS (dark theme)
41-
![Element iOS](preview-element-ios.png)
1+
# Sanae's collection of Matrix sticker packs
2+
3+
> [Preview address](https://matrix-stickers.pages.dev/)
4+
5+
## How to use this?
6+
7+
This picker only supports Element (Web, Electron, Android, iOS) clients as well as clients based on it.
8+
9+
Type `/devtools` in any chat window of your Element (web or desktop) and send it, a Developer Tools window will open, select Explore account data, find m.widgets in it and add the following to the "content":
10+
11+
```
12+
{
13+
"stickerpicker": {
14+
"content": {
15+
"type": "m.stickerpicker",
16+
"url": "https://matrix-stickers.pages.dev/?theme=$theme",
17+
"name": "Stickerpicker",
18+
"creatorUserId": "@you:matrix.server.name",
19+
"data": {}
20+
},
21+
"sender": "@you:matrix.server.name",
22+
"state_key": "stickerpicker",
23+
"type": "m.widget",
24+
"id": "stickerpicker"
25+
}
26+
}
27+
```
28+
29+
If m.widgets is not found, select Send custom account data event directly in the bottom right corner, select m.widgets for the event type and fill in:
30+
31+
32+
```
33+
{
34+
"type": "m.widgets",
35+
"content": {
36+
"stickerpicker": {
37+
"content": {
38+
"type": "m.stickerpicker",
39+
"url": "https://matrix-stickers.pages.dev/?theme=$theme",
40+
"name": "Stickerpicker",
41+
"data": {}
42+
},
43+
"sender": "@you:matrix.server.name",
44+
"state_key": "stickerpicker",
45+
"type": "m.widget",
46+
"id": "stickerpicker"
47+
}
48+
}
49+
}
50+
```
51+
The same account should only need to be set up once.
52+
53+
## I'd like to add other stickers!
54+
55+
You can fork this repository and follow the [Wiki](https://github.com/maunium/stickerpicker/wiki/Creating-packs) prompts to import new stickers.The repository welcomes new sticker requests, so please initiate Pull Requests (from A to Z) by sorting the links to the original sticker pack.
56+
57+
Note: The repository does not accept stickers that contain explicit pornographic content.

build/lib/sticker/stickerimport.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def add_meta(document: Document, info: matrix.StickerInfo, pack: StickerSetFull)
4545
if isinstance(attr, DocumentAttributeSticker):
4646
info["body"] = attr.alt
4747
info["id"] = f"tg-{document.id}"
48-
info["net.maunium.telegram.sticker"] = {
48+
info["info"]["net.maunium.telegram.sticker"] = {
4949
"pack": {
5050
"id": str(pack.set.id),
5151
"short_name": pack.set.short_name,
@@ -73,7 +73,7 @@ async def reupload_pack(client: TelegramClient, pack: StickerSetFull, output_dir
7373
try:
7474
with util.open_utf8(pack_path) as pack_file:
7575
existing_pack = json.load(pack_file)
76-
already_uploaded = {int(sticker["net.maunium.telegram.sticker"]["id"]): sticker
76+
already_uploaded = {int(sticker["info"]["net.maunium.telegram.sticker"]["id"]): sticker
7777
for sticker in existing_pack["stickers"]}
7878
print(f"Found {len(already_uploaded)} already reuploaded stickers")
7979
except FileNotFoundError:
@@ -97,7 +97,7 @@ async def reupload_pack(client: TelegramClient, pack: StickerSetFull, output_dir
9797
# If there was no sticker metadata, use the first emoji we find
9898
if doc["body"] == "":
9999
doc["body"] = sticker.emoticon
100-
doc["net.maunium.telegram.sticker"]["emoticons"].append(sticker.emoticon)
100+
doc["info"]["net.maunium.telegram.sticker"]["emoticons"].append(sticker.emoticon)
101101

102102
with util.open_utf8(pack_path, "w") as pack_file:
103103
json.dump({
@@ -132,7 +132,7 @@ async def reupload_pack(client: TelegramClient, pack: StickerSetFull, output_dir
132132

133133
async def main(args: argparse.Namespace) -> None:
134134
await matrix.load_config(args.config)
135-
client = TelegramClient(args.session, 298751, "cb676d6bae20553c9996996a8f52b4d7", proxy=("http", "localhost", 7890))
135+
client = TelegramClient(args.session, 298751, "cb676d6bae20553c9996996a8f52b4d7")
136136
await client.start()
137137

138138
if args.list:
@@ -153,7 +153,7 @@ async def main(args: argparse.Namespace) -> None:
153153
return
154154
input_packs.append(InputStickerSetShortName(short_name=match.group(1)))
155155
for input_pack in input_packs:
156-
pack: StickerSetFull = await client(GetStickerSetRequest(input_pack))
156+
pack: StickerSetFull = await client(GetStickerSetRequest(input_pack, hash=0))
157157
await reupload_pack(client, pack, args.output_dir)
158158
else:
159159
parser.print_help()

build/lib/sticker/version.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Generated in setup.py
2-
3-
git_tag = None
4-
git_revision = '86769c52'
5-
version = '0.1.0+dev.86769c52'
6-
linkified_version = '0.1.0+dev.[86769c52](https://github.com/maunium/stickerpicker/commit/86769c5291eef891de09070dbc61eb9248fb2aed)'
1+
# Generated in setup.py
2+
3+
git_tag = None
4+
git_revision = '3cb8276c'
5+
version = '0.1.0+dev.3cb8276c'
6+
linkified_version = '0.1.0+dev.[3cb8276c](https://github.com/maunium/stickerpicker/commit/3cb8276c44c08f7ecbde5138011de6b06141e198)'

preview-element-android.png

-545 KB
Binary file not shown.

preview-element-ios.png

-442 KB
Binary file not shown.

preview-element-web.png

-86 KB
Binary file not shown.

sticker/stickerimport.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def add_meta(document: Document, info: matrix.StickerInfo, pack: StickerSetFull)
4545
if isinstance(attr, DocumentAttributeSticker):
4646
info["body"] = attr.alt
4747
info["id"] = f"tg-{document.id}"
48-
info["net.maunium.telegram.sticker"] = {
48+
info["info"]["net.maunium.telegram.sticker"] = {
4949
"pack": {
5050
"id": str(pack.set.id),
5151
"short_name": pack.set.short_name,
@@ -73,7 +73,7 @@ async def reupload_pack(client: TelegramClient, pack: StickerSetFull, output_dir
7373
try:
7474
with util.open_utf8(pack_path) as pack_file:
7575
existing_pack = json.load(pack_file)
76-
already_uploaded = {int(sticker["net.maunium.telegram.sticker"]["id"]): sticker
76+
already_uploaded = {int(sticker["info"]["net.maunium.telegram.sticker"]["id"]): sticker
7777
for sticker in existing_pack["stickers"]}
7878
print(f"Found {len(already_uploaded)} already reuploaded stickers")
7979
except FileNotFoundError:
@@ -97,7 +97,7 @@ async def reupload_pack(client: TelegramClient, pack: StickerSetFull, output_dir
9797
# If there was no sticker metadata, use the first emoji we find
9898
if doc["body"] == "":
9999
doc["body"] = sticker.emoticon
100-
doc["net.maunium.telegram.sticker"]["emoticons"].append(sticker.emoticon)
100+
doc["info"]["net.maunium.telegram.sticker"]["emoticons"].append(sticker.emoticon)
101101

102102
with util.open_utf8(pack_path, "w") as pack_file:
103103
json.dump({

sticker/version.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Generated in setup.py
2-
3-
git_tag = None
4-
git_revision = '86769c52'
5-
version = '0.1.0+dev.86769c52'
6-
linkified_version = '0.1.0+dev.[86769c52](https://github.com/maunium/stickerpicker/commit/86769c5291eef891de09070dbc61eb9248fb2aed)'
1+
# Generated in setup.py
2+
3+
git_tag = None
4+
git_revision = '3cb8276c'
5+
version = '0.1.0+dev.3cb8276c'
6+
linkified_version = '0.1.0+dev.[3cb8276c](https://github.com/maunium/stickerpicker/commit/3cb8276c44c08f7ecbde5138011de6b06141e198)'

web/packs/Akemi_Homura.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

web/packs/AmashiroNatsukiEars_NoWord.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)