update readme
This commit is contained in:
parent
693326c215
commit
e653712012
6 changed files with 70 additions and 24 deletions
2
.github/readme-pl.md
vendored
2
.github/readme-pl.md
vendored
|
|
@ -35,7 +35,7 @@ jRandomSkills to plugin do CounterStrike 2, który wprowadza chaos i frajdę do
|
||||||
|
|
||||||
## 🖼️ Prezentacja Pluginu
|
## 🖼️ Prezentacja Pluginu
|
||||||

|

|
||||||

|
||||||
|
|
||||||
## 🌐 Serwer Testowy
|
## 🌐 Serwer Testowy
|
||||||
Dołącz do serwera testowego 3v3 i wypróbuj plugin jRandomSkills:
|
Dołącz do serwera testowego 3v3 i wypróbuj plugin jRandomSkills:
|
||||||
|
|
|
||||||
2
.github/readme.md
vendored
2
.github/readme.md
vendored
|
|
@ -35,7 +35,7 @@ jRandomSkills is a plugin for CounterStrike 2 that brings chaos and fun to gamep
|
||||||
|
|
||||||
## 🖼️ Preview
|
## 🖼️ Preview
|
||||||

|

|
||||||

|
||||||
|
|
||||||
## 🌐 Test Server
|
## 🌐 Test Server
|
||||||
Join the 3v3 test server and try out the jRandomSkills plugin:
|
Join the 3v3 test server and try out the jRandomSkills plugin:
|
||||||
|
|
|
||||||
59
.github/update_thanks.py
vendored
59
.github/update_thanks.py
vendored
|
|
@ -111,46 +111,75 @@ def get_github_contributors(repo, extra_logins):
|
||||||
|
|
||||||
|
|
||||||
def get_discord_users(user_ids):
|
def get_discord_users(user_ids):
|
||||||
cells = []
|
token = os.getenv("DISCORD_BOT_TOKEN")
|
||||||
|
|
||||||
|
if not token:
|
||||||
|
print("DISCORD_BOT_TOKEN not found")
|
||||||
|
return ""
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
|
"Authorization": f"Bot {token}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cells = []
|
||||||
|
|
||||||
for uid in user_ids:
|
for uid in user_ids:
|
||||||
try:
|
try:
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
f"https://pfpfinder.com/api/discord/user/{uid}",
|
f"https://discord.com/api/v10/users/{uid}",
|
||||||
headers=headers,
|
headers=headers,
|
||||||
timeout=10
|
timeout=10
|
||||||
)
|
)
|
||||||
|
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
print(f"Discord API: Status {response.status_code}")
|
print(f"Discord API: Status {response.status_code}")
|
||||||
|
print(response.text)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
data = response.json()
|
data = response.json()
|
||||||
global_name = data.get("global_name")
|
|
||||||
username = data.get("username")
|
|
||||||
if global_name:
|
|
||||||
name = global_name
|
|
||||||
else:
|
|
||||||
print(f"Warning: {uid} has no global_name, falling back to username '{username}'")
|
|
||||||
name = username
|
|
||||||
|
|
||||||
source_url = (data.get("avatar") or "").replace(".gif", ".png")
|
name = (
|
||||||
if not source_url:
|
data.get("global_name")
|
||||||
|
or data.get("username")
|
||||||
|
)
|
||||||
|
|
||||||
|
avatar_hash = data.get("avatar")
|
||||||
|
|
||||||
|
if avatar_hash:
|
||||||
|
source_url = (
|
||||||
|
f"https://cdn.discordapp.com/avatars/"
|
||||||
|
f"{uid}/{avatar_hash}.png?size=128"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
discriminator = data.get("discriminator", "0")
|
||||||
|
|
||||||
|
if discriminator == "0":
|
||||||
default_index = (int(uid) >> 22) % 6
|
default_index = (int(uid) >> 22) % 6
|
||||||
source_url = f"https://cdn.discordapp.com/embed/avatars/{default_index}.png"
|
else:
|
||||||
|
default_index = int(discriminator) % 5
|
||||||
|
|
||||||
|
source_url = (
|
||||||
|
f"https://cdn.discordapp.com/embed/avatars/"
|
||||||
|
f"{default_index}.png"
|
||||||
|
)
|
||||||
|
|
||||||
uid_hash = hashlib.sha1(uid.encode()).hexdigest()[:12]
|
uid_hash = hashlib.sha1(uid.encode()).hexdigest()[:12]
|
||||||
filename = f"discord_{uid_hash}.png"
|
filename = f"discord_{uid_hash}.png"
|
||||||
|
|
||||||
avatar_url = save_avatar(source_url, filename)
|
avatar_url = save_avatar(source_url, filename)
|
||||||
|
|
||||||
if not avatar_url:
|
if not avatar_url:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
cells.append(make_cell(avatar_url=avatar_url, name=name))
|
cells.append(
|
||||||
|
make_cell(
|
||||||
|
avatar_url=avatar_url,
|
||||||
|
name=name
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Discord API Error: {e}")
|
print(f"Discord API Error for: {e}")
|
||||||
|
|
||||||
return build_table(cells) if cells else ""
|
return build_table(cells) if cells else ""
|
||||||
|
|
||||||
|
|
|
||||||
1
.github/workflows/update_thanks.yml
vendored
1
.github/workflows/update_thanks.yml
vendored
|
|
@ -29,6 +29,7 @@ jobs:
|
||||||
env:
|
env:
|
||||||
DISCORD_USER_IDS: ${{ secrets.DISCORD_USER_IDS }}
|
DISCORD_USER_IDS: ${{ secrets.DISCORD_USER_IDS }}
|
||||||
EXTRA_USERS_GITHUB: ${{ secrets.EXTRA_USERS_GITHUB }}
|
EXTRA_USERS_GITHUB: ${{ secrets.EXTRA_USERS_GITHUB }}
|
||||||
|
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
|
||||||
run: python .github/update_thanks.py
|
run: python .github/update_thanks.py
|
||||||
|
|
||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
|
|
|
||||||
12
readme-pl.md
12
readme-pl.md
|
|
@ -35,7 +35,7 @@ jRandomSkills to plugin do CounterStrike 2, który wprowadza chaos i frajdę do
|
||||||
|
|
||||||
## 🖼️ Prezentacja Pluginu
|
## 🖼️ Prezentacja Pluginu
|
||||||

|

|
||||||

|
||||||
|
|
||||||
## 🌐 Serwer Testowy
|
## 🌐 Serwer Testowy
|
||||||
Dołącz do serwera testowego 3v3 i wypróbuj plugin jRandomSkills:
|
Dołącz do serwera testowego 3v3 i wypróbuj plugin jRandomSkills:
|
||||||
|
|
@ -360,7 +360,15 @@ Plugin korzysta z zawartości następujących projektów:
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
ㅤ
|
ㅤ
|
||||||
[THANKS]
|
<div align="center">
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr><td align="center"><img src="https://raw.githubusercontent.com/Juzlus/jRandomSkills/main/.github/avatars/discord_7ee4547c02f2.png" width="75" height="75" style="border-radius:50%" alt="Ryuu Jin"/><br/><sub><b>Ryuu Jin</b></sub></td><td align="center"><img src="https://raw.githubusercontent.com/Juzlus/jRandomSkills/main/.github/avatars/discord_f7017ab921b5.png" width="75" height="75" style="border-radius:50%" alt="cj☭"/><br/><sub><b>cj☭</b></sub></td><td align="center"><img src="https://raw.githubusercontent.com/Juzlus/jRandomSkills/main/.github/avatars/discord_20f902436962.png" width="75" height="75" style="border-radius:50%" alt="k4chen"/><br/><sub><b>k4chen</b></sub></td><td align="center"><img src="https://raw.githubusercontent.com/Juzlus/jRandomSkills/main/.github/avatars/discord_a3b321b84dc6.png" width="75" height="75" style="border-radius:50%" alt="luno"/><br/><sub><b>luno</b></sub></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<sub>Jeśli jesteś na tej liście i chcesz usunąć swój profil, skontaktuj się ze mną.</sub>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
## 📋 Lista Zmian
|
## 📋 Lista Zmian
|
||||||
|
|
||||||
|
|
|
||||||
12
readme.md
12
readme.md
|
|
@ -35,7 +35,7 @@ jRandomSkills is a plugin for CounterStrike 2 that brings chaos and fun to gamep
|
||||||
|
|
||||||
## 🖼️ Preview
|
## 🖼️ Preview
|
||||||

|

|
||||||

|
||||||
|
|
||||||
## 🌐 Test Server
|
## 🌐 Test Server
|
||||||
Join the 3v3 test server and try out the jRandomSkills plugin:
|
Join the 3v3 test server and try out the jRandomSkills plugin:
|
||||||
|
|
@ -362,7 +362,15 @@ This plugin uses content from the following projects:
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
ㅤ
|
ㅤ
|
||||||
[THANKS]
|
<div align="center">
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr><td align="center"><img src="https://raw.githubusercontent.com/Juzlus/jRandomSkills/main/.github/avatars/discord_7ee4547c02f2.png" width="75" height="75" style="border-radius:50%" alt="Ryuu Jin"/><br/><sub><b>Ryuu Jin</b></sub></td><td align="center"><img src="https://raw.githubusercontent.com/Juzlus/jRandomSkills/main/.github/avatars/discord_f7017ab921b5.png" width="75" height="75" style="border-radius:50%" alt="cj☭"/><br/><sub><b>cj☭</b></sub></td><td align="center"><img src="https://raw.githubusercontent.com/Juzlus/jRandomSkills/main/.github/avatars/discord_20f902436962.png" width="75" height="75" style="border-radius:50%" alt="k4chen"/><br/><sub><b>k4chen</b></sub></td><td align="center"><img src="https://raw.githubusercontent.com/Juzlus/jRandomSkills/main/.github/avatars/discord_a3b321b84dc6.png" width="75" height="75" style="border-radius:50%" alt="luno"/><br/><sub><b>luno</b></sub></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<sub>If you are on this list and want your profile removed, please contact me.</sub>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
## 📋 Changelog
|
## 📋 Changelog
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue