FM-17 / poglink

A bot that integrates the ARK Web API with Discord.
MIT License
12 stars 4 forks source link

feat: rates now parse config for dict of url,name,color #73

Closed FM-17 closed 10 months ago

FM-17 commented 10 months ago

Updated rates.py to extract the server name, embed colour, and server URL, directly from the yaml config file rather than inferring the server name from the URL using regex.

Providing explicit URL/Name prevents us from having to develop new regex conditions for every new use case. The number of use cases are only growing now that Poglink is being used for two games (ARK Survival Ascended, ATLAS), various platforms (Xbox, PC, Switch, PS4) and on both official, and unofficial servers.

This was also partially motivated by the changes made to the URLs (endpoints) used by Studio Wildcard during the transition from ARK: Survival Evolved to ARK: Survival Ascended. Their ini files are now hosted on a CDN (CloudFront), which resulted in the new URLs breaking our regex matching, so I figured its better to just get rid of regex all together.

This was the change (for official pc servers), there will be more as they release other platforms. https://arkdedicated.com/dynamicconfig.ini > https://cdn2.arkdedicated.com/asa/dynamicconfig.ini

codecov[bot] commented 10 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (d2237bd) 91.74% compared to head (585d8c7) 91.54%.

Files Patch % Lines
poglink/cogs/rates.py 95.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #73 +/- ## ========================================== - Coverage 91.74% 91.54% -0.21% ========================================== Files 10 10 Lines 412 402 -10 ========================================== - Hits 378 368 -10 Misses 34 34 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

travipross commented 10 months ago

Reminder in case it was overlooked: we have pre-commit set up in this repo if you wanted to catch those formatting errors locally before they ever get pushed to fail in CI.

github-actions[bot] commented 10 months ago

:tada: This PR is included in version 0.11.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: