Closed wlinator closed 1 week ago
This PR implements a character limit for AFK reasons by truncating long messages to 100 characters using Python's textwrap module. The truncated reason is then stored in the database and displayed in the response message.
sequenceDiagram
actor User
participant Bot
participant Database
User->>Bot: /afk <reason>
Bot->>Bot: Truncate reason to 100 characters
Bot->>Database: Insert AFK status with truncated reason
Database-->>Bot: Confirmation
Bot->>User: Send confirmation message with truncated reason
classDiagram
class AFKCommand {
+insert_afk(userId, displayName, reason, guildId)
}
AFKCommand : +afk(ctx, target, reason)
AFKCommand : -Truncate reason to 100 characters
AFKCommand : -Store truncated reason in database
AFKCommand : -Send confirmation message with truncated reason
Change | Details | Files |
---|---|---|
Added character limit to AFK reason messages |
|
tux/cogs/utility/afk.py |
Issue | Objective | Addressed | Explanation |
---|---|---|---|
#639 | Limit AFK message to 100 characters | ✅ |
Fixes #639
Summary by Sourcery
Bug Fixes: