Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
19bb6af
a lot of stuff
BenCos17 Feb 5, 2026
c7a00b0
Update radiosonde.py
BenCos17 Feb 5, 2026
e37c007
more
BenCos17 Feb 5, 2026
43af715
embeds for radiosonde cog
BenCos17 Feb 5, 2026
819e3d0
Update radiosonde.py
BenCos17 Feb 5, 2026
e3b4b22
more
BenCos17 Feb 5, 2026
8a5571a
dashboard support v1
BenCos17 Feb 5, 2026
8864886
bump cog version
BenCos17 Feb 5, 2026
ae05cc2
Update radiosonde.py
BenCos17 Feb 5, 2026
460ca41
dashboard support works
BenCos17 Feb 5, 2026
4e92129
Update radiosonde.py
BenCos17 Feb 5, 2026
7ac77d3
tips cog
BenCos17 Feb 10, 2026
28e1d69
Update tips.py
BenCos17 Feb 10, 2026
4601f63
config support
BenCos17 Feb 10, 2026
2ec62af
per user and per server cooldowns
BenCos17 Feb 10, 2026
682c217
Add auto-post-on-command listener
BenCos17 Feb 10, 2026
7ce5050
Update tips.py
BenCos17 Feb 10, 2026
4b32df1
fixes
BenCos17 Feb 10, 2026
6c4059e
bug fix
BenCos17 Feb 10, 2026
834e8f5
Update tips.py
BenCos17 Feb 10, 2026
a3df032
Update tips.py
BenCos17 Feb 10, 2026
097da0c
I hate indents
BenCos17 Feb 10, 2026
97ba898
Update tips.py
BenCos17 Feb 10, 2026
c76c32f
Update tips.py
BenCos17 Feb 10, 2026
f02f76c
remove changed tips if deleted from default tips
BenCos17 Feb 10, 2026
442e229
Add globe feed URL utilities and enhance map link extraction
BenCos17 Feb 15, 2026
b3314b9
tweaks
BenCos17 Feb 19, 2026
0cbd61d
faa status stuff
BenCos17 Feb 20, 2026
8cabe03
forgot the xml parser file
BenCos17 Feb 20, 2026
105f679
more
BenCos17 Feb 20, 2026
06a6d94
make it nicer to read
BenCos17 Feb 20, 2026
d1d2614
dropdown selector
BenCos17 Feb 20, 2026
30a2144
bvbv
BenCos17 Feb 20, 2026
8855c4e
fix info.json in clusters cog
BenCos17 Feb 20, 2026
7ee2190
Update info.json
BenCos17 Feb 20, 2026
127154a
Update clusters.py
BenCos17 Feb 21, 2026
fb25675
Update clusters.py
BenCos17 Feb 21, 2026
576e8ac
Update clusters.py
BenCos17 Feb 21, 2026
68bc291
Update clusters.py
BenCos17 Feb 21, 2026
9dcb8bc
Update clusters.py
BenCos17 Feb 22, 2026
41ee4dc
fix typo
BenCos17 Feb 22, 2026
38b2533
iss cog
BenCos17 Feb 22, 2026
06a7db5
fixes
BenCos17 Feb 22, 2026
00a85c3
more
BenCos17 Feb 22, 2026
d8619b3
Update iss.py
BenCos17 Feb 22, 2026
3f77435
more
BenCos17 Feb 22, 2026
b892534
more
BenCos17 Feb 22, 2026
fd7b77b
more go brrrrrrrrrrrr
BenCos17 Feb 22, 2026
4a41590
iss status command
BenCos17 Feb 22, 2026
3a7c580
forgot to import time
BenCos17 Feb 22, 2026
302c5fe
Update iss.py
BenCos17 Feb 22, 2026
04e35f0
more tweaks
BenCos17 Feb 22, 2026
6648ac0
Update iss.py
BenCos17 Feb 22, 2026
969763b
Update iss.py
BenCos17 Feb 22, 2026
1245d24
docs and also stuff for the red index
BenCos17 Feb 22, 2026
d97d98d
Update iss.py
BenCos17 Feb 22, 2026
cc1fdfa
Update iss.py
BenCos17 Feb 22, 2026
8bfddd3
Update telemetry.json
BenCos17 Feb 22, 2026
5339a1f
Update iss.py
BenCos17 Feb 22, 2026
affaa45
more
BenCos17 Feb 22, 2026
890e7f7
Update iss.py
BenCos17 Feb 22, 2026
fa9e102
Update iss.py
BenCos17 Feb 22, 2026
a094a83
fix ident
BenCos17 Feb 22, 2026
56f5b85
typo
BenCos17 Feb 22, 2026
21c9012
make iss all work better
BenCos17 Feb 22, 2026
87f3ca2
Update iss.py
BenCos17 Feb 22, 2026
dfb6598
import code notes for future reference
BenCos17 Feb 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 43 additions & 43 deletions clusters/clusters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import discord
import discord
from redbot.core import commands, Config
import psutil, datetime, json, aiohttp
from aiohttp import web
Expand Down Expand Up @@ -55,15 +55,11 @@ async def clusters(self, ctx):
"""Shows the status of all clusters using an embed."""
await self.initialize_shard_names()

# Bot uptime (Red tracks this as bot.uptime)
bot_start_time = getattr(self.bot, "uptime", None)
if bot_start_time is None:
bot_uptime_str = "Unknown"
else:
if isinstance(bot_start_time, datetime.datetime):
td = datetime.datetime.utcnow() - bot_start_time
else:
td = bot_start_time
td = datetime.datetime.utcnow() - bot_start_time if isinstance(bot_start_time, datetime.datetime) else bot_start_time
bot_uptime_str = self.format_timedelta(td)

server_uptime = self.format_timedelta(self.get_server_uptime())
Expand All @@ -75,24 +71,16 @@ async def clusters(self, ctx):
)

for shard_id, name in self.shard_names.items():
cpu = psutil.cpu_percent(interval=None)
ram = psutil.virtual_memory().used / 1024**3
latency = round(self.bot.shards[shard_id].latency * 1000)

guilds = [g for g in self.bot.guilds if g.shard_id == shard_id]
servers = len(guilds)
users = sum(g.member_count or 0 for g in guilds)


value = (
f"**Status:** Alive Running\n"
f"**CPU:** {cpu:.1f}%\n"
f"**RAM:** {ram:.1f} GiB\n"
f"**Latency:** {latency} ms\n"
f"**Servers:** {servers}\n"
f"**Users:** {users}\n"
f"**Servers:** {len(guilds)}\n"
f"**Users:** {sum(g.member_count or 0 for g in guilds)}\n"
f"**Shards:** [{shard_id}]"
)

embed.add_field(name=f"Cluster #{name}", value=value, inline=False)

await ctx.send(embed=embed)
Expand All @@ -109,49 +97,61 @@ async def renamecluster(self, ctx, shard_id: int, *, new_name: str):
custom_names[str(shard_id)] = new_name
await self.config.custom_names.set(custom_names)
self.shard_names[shard_id] = new_name

await ctx.send(f"Cluster {shard_id} has been renamed to **{new_name}**.")


async def web_clusters(self, request):
"""Return cluster data as JSON for web endpoint."""
await self.initialize_shard_names()

virt_mem = psutil.virtual_memory()
swap_mem = psutil.swap_memory()
proc = psutil.Process()
bot_ram_gb = proc.memory_info().rss / 1024**3

# Bot uptime
bot_start_time = getattr(self.bot, "uptime", None)
if bot_start_time is None:
bot_uptime_str = "Unknown"
else:
if isinstance(bot_start_time, datetime.datetime):
td = datetime.datetime.utcnow() - bot_start_time
else:
td = bot_start_time
bot_uptime_str = self.format_timedelta(td)

bot_uptime_str = self.format_timedelta(datetime.datetime.utcnow() - bot_start_time) if bot_start_time else "Unknown"
server_uptime_str = self.format_timedelta(self.get_server_uptime())

data = {
"bot_uptime": bot_uptime_str,
"server_uptime": server_uptime_str,
"system_stats": {
"cpu_total_percent": psutil.cpu_percent(interval=None),
"ram_used_gb": round(virt_mem.used / 1024**3, 2),
"ram_total_gb": round(virt_mem.total / 1024**3, 2),
"bot_ram_gb": round(bot_ram_gb, 2),
"bot_ram_limit_gb": 10.0,
"swap_used_gb": round(swap_mem.used / 1024**3, 2),
"swap_total_gb": round(swap_mem.total / 1024**3, 2)
},
"clusters": []
}

for shard_id, name in self.shard_names.items():
# Use the bot's reported shard count
total_shards = self.bot.shard_count or 1
for shard_id in range(total_shards):
# 1. Get name safely
name = self.shard_names.get(shard_id, MARVEL_NAMES[shard_id % len(MARVEL_NAMES)])

# 2. Get shard object safely
shard = self.bot.get_shard(shard_id)

# 3. Determine status and latency
# We explicitly check shard health to provide the 'status' key
is_online = shard is not None and not shard.is_closed()
latency = round(shard.latency * 1000) if (is_online and shard.latency is not None) else 0

# 4. Count guilds on this shard
guilds = [g for g in self.bot.guilds if g.shard_id == shard_id]
servers = len(guilds)
users = sum(g.member_count or 0 for g in guilds)
latency = round(self.bot.shards[shard_id].latency * 1000)
cpu = psutil.cpu_percent(interval=None)
ram = psutil.virtual_memory().used / 1024**3

cluster_data = {

data["clusters"].append({
"shard_id": shard_id,
"name": name,
"servers": servers,
"users": users,
"servers": len(guilds),
"users": sum(g.member_count or 0 for g in guilds),
"latency_ms": latency,
"cpu_percent": cpu,
"ram_gib": ram
}
data["clusters"].append(cluster_data)
"status": "Online" if is_online else "Offline"
})

return web.Response(text=json.dumps(data, indent=2), content_type="application/json")
return web.json_response(data)
2 changes: 1 addition & 1 deletion clusters/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ for example this is my current output on my bot

<shard\_id> is a number between 0 and your mac amount of shards

<new\_name> what you want the cluter to be called from now on
<new\_name> what you want the cluster to be called from now on

this is how it's used

Expand Down
13 changes: 9 additions & 4 deletions clusters/info.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"name": "Clusters",
"author": "bencos17",
"description": "Shows dynamic Marvel-themed cluster statuses for your bot.",
"author": [
"bencos17"
],
"description": "Shows dynamic Marvel-themed cluster statuses for your bot, curreently it doesn't support physical clusters though but I do want to add support to my red instance for it so some day it will",
"requirements": [],
"tags": ["clusters", "shards", "status"]
}
"tags": [
"shards",
"status"
]
}
8 changes: 8 additions & 0 deletions iss/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from redbot.core.bot import Red

from .iss import ISS

__red_end_user_data_statement__ = "This cog does not store any end user data."

async def setup(bot: Red):
await bot.add_cog(ISS(bot))
78 changes: 78 additions & 0 deletions iss/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
\# 🛰️ J.A.R.V.I.S. ISS-Mimic Telemetry Suite



This documentation covers the setup, operation, and troubleshooting of the ISS-Mimic Discord Cog. This system bridges NASA's public Lightstreamer telemetry feed directly into your Discord server.



---



\## 🛠️ Core Commands



| Command | Usage | Description |

| :--- | :--- | :--- |

| `\*iss` | `\*iss` | \*\*Interactive Console\*\*: Opens a public dropdown menu to browse telemetry by category. |

| `\*iss all` | `\*iss all` | \*\*Master Snapshot\*\*: Sends two massive embeds containing every tracked sensor in the system. |

| `\*iss status` | `\*iss status` | \*\*Stream Health\*\*: Checks which sensors are currently broadcasting live data (updated in the last 60s). |

| `\*iss \[cat]` | `\*iss gnc` | \*\*Quick View\*\*: Direct access to specific categories (gnc, ethos, robotics, russian, etc.). |



---



\## 🚦 Understanding Sensor States



Because NASA uses \*\*MERGE\*\* mode for data transmission, sensors will show different states based on station activity:



\* \*\*🟢 Active (Green Circle)\*\*: Data has been received for this system within the last 60 seconds.

\* \*\*💤 Standby (Zzz Emoji)\*\*: The system is subscribed, but the value hasn't changed recently, so NASA isn't pushing updates.

\* \*\*🔹 Blue Diamond\*\*: Appears next to individual sensors that are currently streaming live data.

\* \*\*--- / Connecting\*\*: The bot is connected but waiting for the very first data packet to arrive for that specific ID.







---



\## 📂 Configuration (`telemetry.json`)



The Cog is entirely data-driven. To add or rename sensors, edit the `telemetry.json` file.



\*\*Format:\*\*

```json

"CATEGORY\_NAME": {

&nbsp; "NASA\_OPCODE": "Display Label"

}

12 changes: 12 additions & 0 deletions iss/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "ISS",
"author": [
"bencos17"
],
"description": "A cog to track the International Space Station's telemetry data and provide information about its current location, speed, altitude, and other relevant data.",
"requirements": [],
"tags": [
"issdata",
"iss"
]
}
Loading
Loading