[Activity] Add CDN refresh
This commit is contained in:
19
Cocotte/Utils/CdnUtils.cs
Normal file
19
Cocotte/Utils/CdnUtils.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace Cocotte.Utils;
|
||||
|
||||
public class CdnUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Use this to force discord media cache to fetch new content from CDN
|
||||
/// </summary>
|
||||
private const string QuerySuffix = $"?q={RandomSuffix}";
|
||||
|
||||
/// <summary>
|
||||
/// Needs to be updated each time a media is updated on the CDN
|
||||
/// </summary>
|
||||
private const string RandomSuffix = "a57z45a";
|
||||
|
||||
public static string GetAsset(string assetName)
|
||||
{
|
||||
return $"https://sage.cdn.ilysix.fr/assets/Cocotte/{assetName}{QuerySuffix}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user