Discord Game SDK implementation
Project description
BridgeCord
pip install bridgecord
Simple example:
import bridgecord as bc
bridge = bc.Instance()
bridge.init(clientID=CLIENT_ID)
bridge.activity_info.details = "Hello, Python"
bridge.activity_info.state = "In game"
bridge.activity_info.large_image = "dreampyavatar"
bridge.set_timestamps_start(int(time.time()))
bridge.edit_current_activity()
while True:
bridge.run_callbacks()
bridge.run_callbacks() should be always running.
Activity:
# Set text, which display on user hovers over large image
bridge.activity_info.large_text = "Large text"
# Set small image, which displayed in right bottom corner
bridge.activity_info.small_image = "dreampy1"
# Set text, which display on user hovers over small image
bridge.activity_info.small_text = "Small text"
If you editing any activity info (except timestamps), you should update activity:
bridge.edit_current_activity()
Party info:
bridge.edit_party_info(cur_size=1, max_size=4, id="test", secret="secret", is_private=True)
This feature allows other users to see the button "Ask to Join", when clicked, will send the user an invitation:
Update user profile
You can detect if user change avatar or discord name:
def test_callback() -> None:
ret, user = bridge.current_user()
if ret == 0:
print(user.username)
print(user.discriminator)
print(user.avatar_hash)
print(user.avatar_url)
print(user.is_bot)
print(user.id)
bridge.on_current_user_update_connect = test_callback
In this example, current_user()returned result code and user object.
Output result:
onyx1a
3440
c240d87788e9e93464872ac80f047568
https://cdn.discordapp.com/avatars/1052579421875339284/c240d87788e9e93464872ac80f047568.png
False
1052579421875339284
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bridgecord-0.3.13-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: bridgecord-0.3.13-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5290898ecb813d438f9cc05ad633fa1fd12113f515875aade0faf5c36a0195b5
|
|
| MD5 |
a2e9069ceb758d2725c170c97ca9c5e8
|
|
| BLAKE2b-256 |
40d528a24b0c2ce89465e87ba7a003b1dbadb2631f691751be59b5707817495e
|
File details
Details for the file bridgecord-0.3.13-cp311-cp311-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: bridgecord-0.3.13-cp311-cp311-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.11, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59912710fae57666c739b80ffa3fa0421bbafc49d73a7ca0e4bc32b13c302b63
|
|
| MD5 |
482f4e144894f392f68dbe610c042c19
|
|
| BLAKE2b-256 |
d1fbed7884639d05c1c42e8be3e0d40d1644032ec7ab50b0fd8184fa0c80f6d2
|
File details
Details for the file bridgecord-0.3.13-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: bridgecord-0.3.13-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5a5db0dc3fc4a6623b4e224946b77dfda90921e12f8b16f0d1fad2aab8611f0
|
|
| MD5 |
e447f8ea8fcce335675b38058cf7160d
|
|
| BLAKE2b-256 |
8d3869a1487faa25cc37fbd245be75717289fb0564480ae6a539b74a70aa4dba
|
File details
Details for the file bridgecord-0.3.13-cp310-cp310-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: bridgecord-0.3.13-cp310-cp310-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.10, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a66db514f0a96ac563a60eebb3a508bd10220118a7e801442145ca220a440588
|
|
| MD5 |
1498025e113f299c51fe76f987723513
|
|
| BLAKE2b-256 |
604306ba84ef4468ca75b94065315808aa54a0f308d236e30e6fdcf37bff5314
|
File details
Details for the file bridgecord-0.3.13-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: bridgecord-0.3.13-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46ebd142d9d3f40a383c4e64aff9cc156b9ceae75bbdfff83a12bc859d2618bd
|
|
| MD5 |
feb39dcb2f5b789e81c8b793bfce7ebb
|
|
| BLAKE2b-256 |
429beeeedc5753df339da1f3830b72c617d9b17311af9ec76bcec3a31dbb3dfc
|
File details
Details for the file bridgecord-0.3.13-cp39-cp39-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: bridgecord-0.3.13-cp39-cp39-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.9, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50f735a7becaa56b90d21324897f69302a5b4705ae9142dd216526f6d72e5ccb
|
|
| MD5 |
8eb1fc5950c78cc94a3f747369f2b380
|
|
| BLAKE2b-256 |
6f7b5bcd8d7db3ad87aeab5e92e4313de0741e4da9bc20744eb474ac3037fc1e
|
File details
Details for the file bridgecord-0.3.13-cp38-cp38-win_amd64.whl.
File metadata
- Download URL: bridgecord-0.3.13-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c93e85e2e8500c50a31aa9396f162c4f4586ed94a9739ba7c149a67dcef3acc3
|
|
| MD5 |
b3d2a6c7dc95119b5e7964af7395c289
|
|
| BLAKE2b-256 |
40baa3bd23707515872a16833c093c8182a14aea492d96ab4009c565413715b3
|
File details
Details for the file bridgecord-0.3.13-cp38-cp38-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: bridgecord-0.3.13-cp38-cp38-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.8, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
672f8c4a4446aa78cc4fbb8f6b2198f6fdccd455a8dfdc0e6c82a3a820f53673
|
|
| MD5 |
5327c8d99594966668ea68facd971692
|
|
| BLAKE2b-256 |
d22d28ca4fcaddfdf3d5f2e9e3505df7dba35dcc2d1a19570a7837c3194354fd
|
File details
Details for the file bridgecord-0.3.13-cp37-cp37m-win_amd64.whl.
File metadata
- Download URL: bridgecord-0.3.13-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
462630dac4dfa89f2535469ce29f1e1fc3b32b3cd19bf8e192d2a32b9b40b635
|
|
| MD5 |
4dfb5fba6e7260db43095e570b64165e
|
|
| BLAKE2b-256 |
f562c69d8d55b35bd74a3ce85e4b27f18877c76ef6723d1e8db222299c1b79ce
|
File details
Details for the file bridgecord-0.3.13-cp37-cp37m-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: bridgecord-0.3.13-cp37-cp37m-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.7m, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
396f1d76b868a1b77dbbe870950f34dedce64c7602dfc06289c7b1cb41e6bcc0
|
|
| MD5 |
77740cb43f72c2e0de99628fd8e4f0a8
|
|
| BLAKE2b-256 |
e590af018f99314c1e9304159eaed042d0751382650efe11bb28197beb4d3403
|