Skip to content

Commit 9a357ec

Browse files
authored
Merge pull request #94 from null8626/v1/new-v1-endpoints
feat: add new v1 endpoints
2 parents 5d333e3 + f87854d commit 9a357ec

25 files changed

Lines changed: 604 additions & 219 deletions

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- name: Install
2020
run: python -m pip install .[dev]
2121
- name: Test with pytest
22-
run: pytest
22+
run: pytest -x --cov=topgg --cov-report term-missing

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dev = ["mock>=5.2.0", "pytest>=9.0.3", "pytest-asyncio>=1.3.0", "pytest-mock>=3.
3333

3434
[project.urls]
3535
Documentation = "https://topggpy.readthedocs.io/en/latest/"
36-
"Raw API Documentation" = "https://docs.top.gg/docs/"
36+
"Raw API Documentation" = "https://docs.top.gg/api/v1/introduction"
3737
Repository = "https://github.com/top-gg-community/python-sdk"
3838
"Support server" = "https://discord.gg/EYHTgJX"
3939

ruff.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ indent-width = 2
44
docstring-code-format = true
55
docstring-code-line-length = 88
66
line-ending = "lf"
7-
quote-style = "single"
7+
quote-style = "single"
8+
9+
[lint]
10+
ignore = ["E722", "E731"]

tests/mocks/404.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{
2-
"title": "User not found",
3-
"status": 404,
4-
"detail": "The user was not resolved into a valid Top.gg user. The user ID might be invalid, or the user may have deleted their account."
1+
{
2+
"title": "User not found",
3+
"status": 404,
4+
"detail": "The user was not resolved into a valid Top.gg user. The user ID might be invalid, or the user may have deleted their account."
55
}

tests/mocks/get_self.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
{
2-
"id": "364806029876555776",
3-
"name": "Top.gg Lib Dev API Access",
4-
"type": "bot",
5-
"platform": "discord",
6-
"headline": "API access for Top.gg Library Developers",
7-
"tags": [
8-
"api",
9-
"library",
10-
"topgg"
11-
],
12-
"votes": 4,
13-
"votes_total": 34,
14-
"review_score": 5,
15-
"review_count": 2
1+
{
2+
"id": "364806029876555776",
3+
"name": "Top.gg Lib Dev API Access",
4+
"type": "bot",
5+
"platform": "discord",
6+
"headline": "API access for Top.gg Library Developers",
7+
"tags": [
8+
"api",
9+
"library",
10+
"topgg"
11+
],
12+
"votes": 4,
13+
"votes_total": 34,
14+
"review_score": 5,
15+
"review_count": 2
1616
}

tests/mocks/get_vote.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{
2-
"created_at": "2026-02-25T22:35:36.978392+00:00",
3-
"expires_at": "2026-02-26T10:35:36.978392+00:00",
4-
"weight": 1
1+
{
2+
"created_at": "2026-02-25T22:35:36.978392+00:00",
3+
"expires_at": "2026-02-26T10:35:36.978392+00:00",
4+
"weight": 1
55
}

tests/mocks/get_votes.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
{
2-
"cursor": "",
3-
"data": [
4-
{
5-
"user_id": "800506814562787328",
6-
"platform_id": "1461830808796139662",
7-
"weight": 2,
8-
"created_at": "2026-01-17T23:36:06.34732Z",
9-
"expires_at": "2026-01-18T11:36:06.34732Z"
10-
},
11-
{
12-
"user_id": "316026718115037184",
13-
"platform_id": "481068576363773972",
14-
"weight": 2,
15-
"created_at": "2026-02-20T05:43:58.392411Z",
16-
"expires_at": "2026-02-20T17:43:58.392411Z"
17-
},
18-
{
19-
"user_id": "794153497215045632",
20-
"platform_id": "1425259851600101457",
21-
"weight": 2,
22-
"created_at": "2026-02-21T18:59:20.660734Z",
23-
"expires_at": "2026-02-22T06:59:20.660734Z"
24-
},
25-
{
26-
"user_id": "8226924471638491136",
27-
"platform_id": "661200758510977084",
28-
"weight": 1,
29-
"created_at": "2026-02-25T22:35:36.978392Z",
30-
"expires_at": "2026-02-26T10:35:36.978392Z"
31-
}
32-
]
1+
{
2+
"cursor": "",
3+
"data": [
4+
{
5+
"user_id": "800506814562787328",
6+
"platform_id": "1461830808796139662",
7+
"weight": 2,
8+
"created_at": "2026-01-17T23:36:06.34732Z",
9+
"expires_at": "2026-01-18T11:36:06.34732Z"
10+
},
11+
{
12+
"user_id": "316026718115037184",
13+
"platform_id": "481068576363773972",
14+
"weight": 2,
15+
"created_at": "2026-02-20T05:43:58.392411Z",
16+
"expires_at": "2026-02-20T17:43:58.392411Z"
17+
},
18+
{
19+
"user_id": "794153497215045632",
20+
"platform_id": "1425259851600101457",
21+
"weight": 2,
22+
"created_at": "2026-02-21T18:59:20.660734Z",
23+
"expires_at": "2026-02-22T06:59:20.660734Z"
24+
},
25+
{
26+
"user_id": "8226924471638491136",
27+
"platform_id": "661200758510977084",
28+
"weight": 1,
29+
"created_at": "2026-02-25T22:35:36.978392Z",
30+
"expires_at": "2026-02-26T10:35:36.978392Z"
31+
}
32+
]
3333
}
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
{
2-
"type": "integration.create",
3-
"data": {
4-
"connection_id": "112402021105124",
5-
"webhook_secret": "whs_abcd",
6-
"project": {
7-
"id": "1230954036934033243",
8-
"platform": "discord",
9-
"platform_id": "3949456393249234923",
10-
"type": "bot"
11-
},
12-
"user": {
13-
"id": "3949456393249234923",
14-
"platform_id": "3949456393249234923",
15-
"name": "username",
16-
"avatar_url": "<avatar url>"
17-
}
18-
}
1+
{
2+
"type": "integration.create",
3+
"data": {
4+
"connection_id": "112402021105124",
5+
"webhook_secret": "whs_abcd",
6+
"project": {
7+
"id": "1230954036934033243",
8+
"platform": "discord",
9+
"platform_id": "3949456393249234923",
10+
"type": "bot"
11+
},
12+
"user": {
13+
"id": "3949456393249234923",
14+
"platform_id": "3949456393249234923",
15+
"name": "username",
16+
"avatar_url": "<avatar url>"
17+
}
18+
}
1919
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{
2-
"type": "integration.delete",
3-
"data": {
4-
"connection_id": "112402021105124"
5-
}
1+
{
2+
"type": "integration.delete",
3+
"data": {
4+
"connection_id": "112402021105124"
5+
}
66
}

tests/mocks/post_announcement.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"title": "Version 2.0 Released!",
3+
"content": "We just released version 2.0 with a bunch of new features and improvements.",
4+
"created_at": "2026-03-14T15:09:26Z"
5+
}

0 commit comments

Comments
 (0)