13 Commits
Author SHA1 Message Date
AllfatherHatt 5c018ab81b Merge pull request 'Fixed bug where the default unit was "m" instead of sending None' (#27) from default_unit_patch into master
Reviewed-on: #27
2026-08-31 20:53:48 +02:00
T-BENZIN d63d03aead Fixed bug where the default unit was "m" instead of sending None
When the log_activity function receives a value of None for the unit parameter, it logs value without applying a conversion multiplier.
2026-08-31 20:48:51 +02:00
T-BENZIN fffedeccbd Merge pull request 'Fixed typo in aliases key for tonnes' (#26) from tonnes-patch-1 into master
Reviewed-on: #26
2026-08-02 13:50:28 +02:00
T-BENZIN b7bf9494aa Fixed typo in aliases key for tonnes 2026-08-02 13:50:09 +02:00
T-BENZIN dbba4533c3 Merge pull request 'added tonnes, fixed ye-olde kilogramme spelling' (#25) from lift-tonnes into master
Reviewed-on: #25
2026-08-02 13:41:23 +02:00
T-BENZIN e7c0d8485d added tonnes, fixed ye-olde kilogramme spelling 2026-08-02 13:40:52 +02:00
T-BENZIN b5d292e6ca Merge pull request 'Added thread ID for Gainium challenge' (#24) from gainium-thread into master
Reviewed-on: #24
2026-08-02 13:28:13 +02:00
T-BENZIN e19a3b4378 Added thread ID for Gainium challenge
I regert hard-coding thread IDs.
2026-08-02 13:27:50 +02:00
T-BENZIN 5013fffa59 Merge pull request 'added lift.json for lifting activity' (#23) from lifting-activity into master
Reviewed-on: #23
2026-08-02 13:24:58 +02:00
T-BENZIN 69cedfc114 added lift.json for lifting activity 2026-08-02 13:21:04 +02:00
AllfatherHatt d1b6085ee8 Merge pull request '9month-revision-update2' (#22) from 9month-revision-update2 into master
Reviewed-on: #22
2026-03-16 13:22:06 +01:00
AllfatherHatt 78e9cc11a1 Merge branch 'master' into 9month-revision-update2 2026-03-16 13:21:19 +01:00
AllfatherHatt 18137c054b Updating feedback 2026-03-16 13:20:03 +01:00
3 changed files with 85 additions and 38 deletions
+38
View File
@@ -0,0 +1,38 @@
{
"convertable": true,
"units": {
"kilogram": {
"factor": 1,
"aliases": [
"kg",
"kgs",
"kilogram",
"kilograms",
"kilogramme",
"kilogrammes",
"kg.",
"kgs."
]
},
"pound": {
"factor": 0.45,
"aliases": [
"lb",
"lb.",
"lbs",
"lbs.",
"pound",
"pounds"
]
},
"tonne": {
"factor": 1000,
"aliases": [
"t",
"t.",
"tonne",
"tonnes"
]
}
}
}
+2 -2
View File
@@ -12,7 +12,7 @@ class FitnessCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
default_threads = "1457402451530350727,1328363409648910356"
default_threads = "1457402451530350727,1328363409648910356,1533433244186443827"
threads_raw = os.getenv("THREADS_ID", default_threads)
self.threads_id: list[int] = []
@@ -117,7 +117,7 @@ class FitnessCog(commands.Cog):
)
return
unit = parts[2] if len(parts) > 2 else "m"
unit = parts[2] if len(parts) > 2 else None
timestamp = int(message.created_at.timestamp())
username = message.author.name
+26 -17
View File
@@ -25,7 +25,6 @@ CALLABLE_FUNCTIONS = {
DEFAULT_MODEL = "gpt-5-mini-2025-08-07"
DEFAULT_MAX_COMPLETION_TOKENS = 2000
TYPING_HEARTBEAT_INTERVAL_SECONDS = 8
STATUS_UPDATE_MIN_INTERVAL_SECONDS = 1.5
@@ -100,12 +99,6 @@ class ReginaldCog(PermissionsMixin, BlacklistMixin, MemoryMixin, commands.Cog):
}
return tool_statuses.get(tool_name, "Reginald is consulting an external source...")
async def typing_heartbeat(self, channel: discord.TextChannel):
while True:
with suppress(discord.HTTPException):
await channel.trigger_typing()
await asyncio.sleep(TYPING_HEARTBEAT_INTERVAL_SECONDS)
def make_status_updater(
self, status_message: discord.Message
) -> Callable[[str, bool], Awaitable[None]]:
@@ -215,18 +208,37 @@ class ReginaldCog(PermissionsMixin, BlacklistMixin, MemoryMixin, commands.Cog):
status_message = await message.channel.send(self.get_thinking_status_message())
status_update = self.make_status_updater(status_message)
typing_task = asyncio.create_task(self.typing_heartbeat(message.channel))
response_text = None
if hasattr(message.channel, "typing"):
try:
async with message.channel.typing():
response_text = await self.generate_response(
api_key,
formatted_messages,
status_update=status_update,
)
except (discord.HTTPException, AttributeError):
# Fall back to normal processing if typing indicator isn't available.
response_text = await self.generate_response(
api_key,
formatted_messages,
status_update=status_update,
)
else:
response_text = await self.generate_response(
api_key,
formatted_messages,
status_update=status_update,
)
finally:
typing_task.cancel()
with suppress(asyncio.CancelledError):
await typing_task
try:
await self.send_split_message(message.channel, response_text)
finally:
if status_message is not None:
with suppress(discord.HTTPException):
await status_message.delete()
try:
memory.append({"user": user_name, "content": prompt})
memory.append({"user": "Reginald", "content": response_text})
@@ -250,11 +262,8 @@ class ReginaldCog(PermissionsMixin, BlacklistMixin, MemoryMixin, commands.Cog):
).mid_term_memory() as mid_memory:
short_memory[channel_id] = memory
mid_memory[channel_id] = mid_term_summaries[-self.summary_retention_limit :]
await self.send_split_message(message.channel, response_text)
if status_message is not None:
with suppress(discord.HTTPException):
await status_message.delete()
except Exception as error:
print(f"DEBUG: Memory persistence failed after response delivery: {error}")
def should_reginald_interject(self, message_content: str) -> bool:
direct_invocation = {"reginald,"}