Task: Implement a small embed utilities module with wrappers and a computing helper
Goal
Create a self-contained set of classes that model embed-related resources and compute the total length of an embed's content, based on the documented behavior implied by the tests.
What to implement
EmbedResource
Purpose: Wrap an underlying resource object and expose convenient properties/methods.
Purpose: Wrap a primary resource together with an optional proxy resource, exposing proxy-related attributes.
API:
init(self, resource, proxy_resource)
property proxy_url -> returns proxy_resource.url if proxy_resource is not None, else None
property proxy_filename -> returns proxy_resource.filename if proxy_resource is not None, else None
Embed
Purpose: Represent an embed with optional title, description, author, footer, and fields, and compute its total length.
Data model:
title: optional string
description: optional string
author name: optional string (set via set_author)
footer text: optional string (set via set_footer)
fields: a list of (name, value) pairs (each can be empty string)
API:
init(self, title=None, description=None)
set_author(self, name) -> self
set_footer(self, text) -> self
add_field(self, name, value) -> self
total_length(self) -> int
Total length logic (as inferred from tests):
Start at 0.
If title is provided, add len(title).
If description is provided, add len(description).
If author name is provided, add len(author_name).
If footer text is provided, add len(footer_text).
For each field in fields, add len(field_name) and add len(field_value).
If any of these components are missing (None or empty), treat their length as 0.
Usage notes
The total_length method should return 0 for an empty embed (no title, description, author, footer, or fields).
Length calculations should use standard Python string length.
Project placement
Place the implemented modules under /app/ with appropriate module and class definitions so that the behavior matches the above descriptions and is easily unit-testable.