yapper.py 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- yapper/__init__.py +13 -0
- yapper/main.py +774 -0
- yapper_py-1.0.0.dist-info/METADATA +71 -0
- yapper_py-1.0.0.dist-info/RECORD +7 -0
- yapper_py-1.0.0.dist-info/WHEEL +5 -0
- yapper_py-1.0.0.dist-info/licenses/LICENSE +674 -0
- yapper_py-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: yapper.py
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: An unofficial Python Library for Yapper
|
|
5
|
+
Author-email: LeAndre C <leandre@lecanact.me>
|
|
6
|
+
License-Expression: GPL-3.0-only
|
|
7
|
+
Project-URL: Repository, https://github.com/our-websites/yapper.py
|
|
8
|
+
Project-URL: Issues, https://github.com/our-websites/yapper.py/issues
|
|
9
|
+
Project-URL: Documentation, https://yapper.website/developers
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: python-dotenv>=1.2.4
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# yapper.py
|
|
19
|
+
|
|
20
|
+
Unofficial Python library for building bots on [Yapper](https://www.yapper.website/developers).
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install yapper.py
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick start
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
import yapper
|
|
32
|
+
|
|
33
|
+
bot = yapper.Bot() # reads YAPPER_BOT_TOKEN from env
|
|
34
|
+
|
|
35
|
+
@bot.command("ping", "Check if the bot is alive")
|
|
36
|
+
def ping(msg):
|
|
37
|
+
msg.reply("pong")
|
|
38
|
+
|
|
39
|
+
@bot.on("member_join")
|
|
40
|
+
def welcome(ev):
|
|
41
|
+
print(f"{ev.username} joined")
|
|
42
|
+
|
|
43
|
+
@bot.button("vote:")
|
|
44
|
+
def vote(i):
|
|
45
|
+
i.ephemeral("You picked " + i.custom_id[5:])
|
|
46
|
+
|
|
47
|
+
bot.run()
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Set `YAPPER_BOT_TOKEN` in your environment (token starts with `yb_`).
|
|
51
|
+
|
|
52
|
+
## Main concepts
|
|
53
|
+
|
|
54
|
+
- **Commands**: register slash/prefix commands with `@bot.command(...)`.
|
|
55
|
+
- **Events**: listen with `@bot.on("event_name")` or `@bot.event`.
|
|
56
|
+
- **Interactions**: handle button clicks with `@bot.button("prefix:")`.
|
|
57
|
+
- **Components**: build rows/buttons with `yapper.row(...)`, `yapper.btn(...)`, and `yapper.link_button(...)`.
|
|
58
|
+
- **Cogs/extensions**: split features into classes/files using `yapper.Cog`, `bot.add_cog(...)`, `bot.load_extension(...)`, and `bot.load_extensions(...)`.
|
|
59
|
+
|
|
60
|
+
## Useful bot methods
|
|
61
|
+
|
|
62
|
+
- Messaging: `send`, `edit`, `delete`, `react`
|
|
63
|
+
- Interactions: `respond`
|
|
64
|
+
- Server data: `servers`, `server`, `channels`, `members`, `roles`, `user`
|
|
65
|
+
- Moderation: `add_role`, `remove_role`, `kick`, `ban`, `unban`, `timeout`
|
|
66
|
+
- Presence/profile: `set_status`, `set_profile`
|
|
67
|
+
|
|
68
|
+
## API reference
|
|
69
|
+
|
|
70
|
+
Use the official Yapper developer docs for API payload details:
|
|
71
|
+
https://www.yapper.website/developers
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
yapper/__init__.py,sha256=ga1WLT_wotd8mkxaSyrg9YZUuzIZ-Xm_AX9PKW35wbk,234
|
|
2
|
+
yapper/main.py,sha256=7-wd0kEshcaQBfQnUc90GkPeipq98Cv3fXFTOd-P_BE,31990
|
|
3
|
+
yapper_py-1.0.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
4
|
+
yapper_py-1.0.0.dist-info/METADATA,sha256=w0kDXtnNfKD_1Ke9E6Drxcl6gKM_r9oE6ROj3c6eWtc,2120
|
|
5
|
+
yapper_py-1.0.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
6
|
+
yapper_py-1.0.0.dist-info/top_level.txt,sha256=GgW0DZpc8bz7eMORwMFS8U8ScRDQdpY3XqpY5F6fob8,7
|
|
7
|
+
yapper_py-1.0.0.dist-info/RECORD,,
|