Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Commit f5f1b75

Browse files
committed
Backport to .NET Core 3.1
1 parent a045f88 commit f5f1b75

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

.github/workflows/dotnetcore.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Setup .NET Core
1313
uses: actions/setup-dotnet@v1
1414
with:
15-
dotnet-version: 5.0.100-preview.7.20366.6
15+
dotnet-version: '3.1.x'
1616
- name: Install dependencies
1717
run: dotnet restore
1818
- name: Build
@@ -21,9 +21,9 @@ jobs:
2121
uses: actions/upload-artifact@v2
2222
with:
2323
name: storebot.zip-${{ github.sha }}
24-
path: bin/Release/net5.0
24+
path: bin/Release/netcoreapp3.1
2525
- name: Generate zip for release
26-
run: tar.exe -a -c -f Storebot-${{ github.sha }}.zip bin\Release\net5.0
26+
run: tar.exe -a -c -f Storebot-${{ github.sha }}.zip bin\Release\netcoreapp3.1
2727
- name: create release
2828
id: create_release
2929
uses: actions/create-release@v1

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# https://hub.docker.com/_/microsoft-dotnet-core
2-
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
2+
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
33
WORKDIR /source
44

55
# copy csproj and restore as distinct layers
@@ -14,7 +14,7 @@ WORKDIR /source
1414
RUN dotnet publish -c release -o /app --no-restore
1515

1616
# final stage/image
17-
FROM mcr.microsoft.com/dotnet/runtime:5.0
17+
FROM mcr.microsoft.com/dotnet/core/runtime:3.1
1818
WORKDIR /app
1919
COPY --from=build /app ./
2020
ENTRYPOINT ["dotnet", "StoreBot.dll"]

Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace StoreBot
1717
{
1818
public class Program
1919
{
20-
public static Dictionary<ulong, string> TokenDictionary = new();
20+
public static Dictionary<ulong, string> TokenDictionary = new Dictionary<ulong, string>();
2121

2222
public struct ConfigJson
2323
{
@@ -60,7 +60,7 @@ public static async Task<DiscordConfiguration> LoadConfig()
6060
string token = Environment.GetEnvironmentVariable("storebottoken");
6161
if (!String.IsNullOrEmpty(token))
6262
{
63-
DiscordConfiguration configenv = new()
63+
DiscordConfiguration configenv = new DiscordConfiguration()
6464
{
6565
Token = token,
6666
TokenType = TokenType.Bot,
@@ -79,7 +79,7 @@ public static async Task<DiscordConfiguration> LoadConfig()
7979
}
8080
}
8181
var cfgjson = JsonConvert.DeserializeObject<ConfigJson>(json);
82-
DiscordConfiguration config = new()
82+
DiscordConfiguration config = new DiscordConfiguration()
8383
{
8484
Token = cfgjson.Token,
8585
TokenType = TokenType.Bot,

StoreBot.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net5.0</TargetFramework>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

StoreCommands.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public async Task PackagesAsync(CommandContext cct, [Description("Specify a prod
109109
{
110110
if (dcat.ProductListing.Product != null) //One day ill fix the mess that is the StoreLib JSON, one day.
111111
{
112-
dcat.ProductListing.Products = new();
112+
dcat.ProductListing.Products = new List<Product>();
113113
dcat.ProductListing.Products.Add(dcat.ProductListing.Product);
114114
}
115115
if (dcat.ProductListing.Products[0].LocalizedProperties[0].Images[0].Uri.StartsWith("//"))
@@ -337,7 +337,7 @@ public async Task PackagesAsync(CommandContext cct, [Description("Specify a prod
337337
{
338338
if (dcat.ProductListing.Product != null) //One day ill fix the mess that is the StoreLib JSON, one day.
339339
{
340-
dcat.ProductListing.Products = new();
340+
dcat.ProductListing.Products = new List<Product>();
341341
dcat.ProductListing.Products.Add(dcat.ProductListing.Product);
342342
}
343343
//configure product embed
@@ -548,7 +548,7 @@ public async Task PackagesAsync(CommandContext cct, [Description("Specify a prod
548548
{
549549
if (customizedhandler.ProductListing.Product != null) //One day ill fix the mess that is the StoreLib JSON, one day.
550550
{
551-
customizedhandler.ProductListing.Products = new();
551+
customizedhandler.ProductListing.Products = new List<Product>();
552552
customizedhandler.ProductListing.Products.Add(customizedhandler.ProductListing.Product);
553553
}
554554
var productembedded = new DiscordEmbedBuilder()
@@ -689,7 +689,7 @@ public async Task convertid(CommandContext cct, [Description("package ID")] stri
689689
{
690690
if (dcat.ProductListing.Product != null) //One day ill fix the mess that is the StoreLib JSON, one day. Yeah mate just like how one day i'll learn how to fly
691691
{
692-
dcat.ProductListing.Products = new();
692+
dcat.ProductListing.Products = new List<Product>();
693693
dcat.ProductListing.Products.Add(dcat.ProductListing.Product);
694694
}
695695
//start typing indicator

0 commit comments

Comments
 (0)