update readme

This commit is contained in:
Juzlus 2026-06-10 14:42:00 +02:00
parent 693326c215
commit e653712012
6 changed files with 70 additions and 24 deletions

View file

@ -35,7 +35,7 @@ jRandomSkills to plugin do CounterStrike 2, który wprowadza chaos i frajdę do
## 🖼️ Prezentacja Pluginu
![Preview](https://github.com/Juzlus/jRandomSkills/blob/main/.github/preview.gif?raw=true)
![Preview2](https://github.com/Juzlus/jRandomSkills/blob/main/.github/preview2.gif?raw=true
![Preview2](https://github.com/Juzlus/jRandomSkills/blob/main/.github/preview2.gif?raw=true)
## 🌐 Serwer Testowy
Dołącz do serwera testowego 3v3 i wypróbuj plugin jRandomSkills:

2
.github/readme.md vendored
View file

@ -35,7 +35,7 @@ jRandomSkills is a plugin for CounterStrike 2 that brings chaos and fun to gamep
## 🖼️ Preview
![Preview](https://github.com/Juzlus/jRandomSkills/blob/main/.github/preview.gif?raw=true)
![Preview2](https://github.com/Juzlus/jRandomSkills/blob/main/.github/preview2.gif?raw=true
![Preview2](https://github.com/Juzlus/jRandomSkills/blob/main/.github/preview2.gif?raw=true)
## 🌐 Test Server
Join the 3v3 test server and try out the jRandomSkills plugin:

View file

@ -111,46 +111,75 @@ def get_github_contributors(repo, extra_logins):
def get_discord_users(user_ids):
cells = []
token = os.getenv("DISCORD_BOT_TOKEN")
if not token:
print("DISCORD_BOT_TOKEN not found")
return ""
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:
try:
response = requests.get(
f"https://pfpfinder.com/api/discord/user/{uid}",
f"https://discord.com/api/v10/users/{uid}",
headers=headers,
timeout=10
)
if response.status_code != 200:
print(f"Discord API: Status {response.status_code}")
print(response.text)
continue
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")
if not source_url:
default_index = (int(uid) >> 22) % 6
source_url = f"https://cdn.discordapp.com/embed/avatars/{default_index}.png"
name = (
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
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]
filename = f"discord_{uid_hash}.png"
avatar_url = save_avatar(source_url, filename)
if not avatar_url:
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:
print(f"Discord API Error: {e}")
print(f"Discord API Error for: {e}")
return build_table(cells) if cells else ""

View file

@ -29,6 +29,7 @@ jobs:
env:
DISCORD_USER_IDS: ${{ secrets.DISCORD_USER_IDS }}
EXTRA_USERS_GITHUB: ${{ secrets.EXTRA_USERS_GITHUB }}
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
run: python .github/update_thanks.py
- name: Commit changes

View file

@ -35,7 +35,7 @@ jRandomSkills to plugin do CounterStrike 2, który wprowadza chaos i frajdę do
## 🖼️ Prezentacja Pluginu
![Preview](https://github.com/Juzlus/jRandomSkills/blob/main/.github/preview.gif?raw=true)
![Preview2](https://github.com/Juzlus/jRandomSkills/blob/main/.github/preview2.gif?raw=true
![Preview2](https://github.com/Juzlus/jRandomSkills/blob/main/.github/preview2.gif?raw=true)
## 🌐 Serwer Testowy
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>
ㅤ
[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

View file

@ -35,7 +35,7 @@ jRandomSkills is a plugin for CounterStrike 2 that brings chaos and fun to gamep
## 🖼️ Preview
![Preview](https://github.com/Juzlus/jRandomSkills/blob/main/.github/preview.gif?raw=true)
![Preview2](https://github.com/Juzlus/jRandomSkills/blob/main/.github/preview2.gif?raw=true
![Preview2](https://github.com/Juzlus/jRandomSkills/blob/main/.github/preview2.gif?raw=true)
## 🌐 Test Server
Join the 3v3 test server and try out the jRandomSkills plugin:
@ -362,7 +362,15 @@ This plugin uses content from the following projects:
</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