Phineas / lanyard

🏷️   Expose your Discord presence and activities to a RESTful API and WebSocket in less than 10 seconds
https://discord.gg/lanyard
MIT License
967 stars 143 forks source link

Update discord_cdn.ex #205

Closed MrShadowDev closed 1 year ago

MrShadowDev commented 1 year ago
  1. Added type specifications to functions for clarity and readability.
  2. Extracted the logic for constructing the constructed CDN URL into a separate function for better separation of concerns.
  3. Used pattern matching with a guard clause in the get_proxied_avatar/4 function instead of an if statement for readability.
  4. Used the pipe operator to simplify the code and make it more readable.