Skip to content

Commit bda0ed3

Browse files
committed
Add production settings and update Dockerfile with .NET SDK
A new production settings file has been created that includes various configurations for the GolfClapBot. The Dockerfile has been updated to now use the .NET SDK image for building the project, and copying of project files has been separated into distinct layers for better caching. Other minor changes include switching of runtime to 'aspnet' and the visibility of 'DeleteMessage' method in 'TwitchWorker' class changed to private.
1 parent 3249144 commit bda0ed3

File tree

3 files changed

+112
-5
lines changed

3 files changed

+112
-5
lines changed

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
# Stage 1: Build the application
1+
# Use the .NET SDK image to build the project
22
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
33
WORKDIR /app
44

5-
# Copy csproj and restore as distinct layers
5+
# Copy csproj files and restore as distinct layers
66
COPY src/GolfClapBot.Runner/*.csproj ./src/GolfClapBot.Runner/
7+
COPY src/GolfClapBot.Bot/*.csproj ./src/GolfClapBot.Bot/
8+
COPY src/GolfClapBot.Domain/*.csproj ./src/GolfClapBot.Domain/
79
RUN dotnet restore src/GolfClapBot.Runner/GolfClapBot.Runner.csproj
810

911
# Copy everything else and build
10-
COPY src/GolfClapBot.Runner/ ./src/GolfClapBot.Runner/
12+
COPY src/ ./src/
1113
WORKDIR /app/src/GolfClapBot.Runner
1214
RUN dotnet build -c Release -o out
1315

1416
# Stage 2: Run the application
15-
FROM mcr.microsoft.com/dotnet/runtime:8.0
17+
FROM mcr.microsoft.com/dotnet/aspnet:8.0
1618
WORKDIR /app
1719
COPY --from=build-env /app/src/GolfClapBot.Runner/out .
1820
ENTRYPOINT ["dotnet", "GolfClapBot.Runner.dll"]

src/GolfClapBot.Runner/TwitchWorker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ private static string RemoveEmotes(ChatMessage message)
185185
/// </summary>
186186
/// <param name="message">The chat message to be deleted.</param>
187187
/// <returns>A task that represents the asynchronous operation.</returns>
188-
public async Task DeleteMessage(ChatMessage message)
188+
private async Task DeleteMessage(ChatMessage message)
189189
{
190190
try
191191
{
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.Hosting.Lifetime": "Information"
6+
}
7+
},
8+
"SettingsS": {
9+
"TwitchSettings": {
10+
"Channel": "Bapes",
11+
"BotUser": "GolfClapBot",
12+
"OAuthToken": "",
13+
"ClientId": ""
14+
},
15+
"OpenAISettings": {
16+
"ApiKey": "",
17+
"Model": "ft:gpt-3.5-turbo-1106:volvox::8SXeBMrQ"
18+
}
19+
},
20+
"Data": {
21+
"RestrictedPhrases": [
22+
"i'm sorry",
23+
"emoji",
24+
"apologize",
25+
"unable to assist",
26+
"don't have information about",
27+
"don't have a physical presence",
28+
"don't have personal feelings",
29+
"don't understand what you mean",
30+
"I don't understand what you mean by",
31+
"I'm unable to assist with that",
32+
"apologies",
33+
"I don't have a physical location",
34+
"but I cannot respond to repetitive",
35+
"but I can't entertain that request"
36+
],
37+
"TrainingData": [
38+
"You are a helpful, smart, witty, funny, and sarcastic Twitch chat bot for Bapes that answers questions and entertains the stream. You will not answer every chat message that comes through.",
39+
"Be nice to everybody and create a natural, engaging and enjoyable atmosphere.",
40+
"You know about my socials of (Twitch = Bapes) (Kick = BapesGolfClap) (TikTok = @BapesGolfClap) (YouTube = @BapesGolfClap).",
41+
"You are here to assist Bapes in managing the stream chat.",
42+
"When people people first come to the stream welcome them and provide them with the socials.",
43+
"If someone asks what song is playing or anything about the song you will link them the playlist: https://open.spotify.com/playlist/3SGzr00JfnPFPBTHH8K8bj?si=bfe0d2cff0664174",
44+
"Don't answer anything from the user GolfClapBot or about the songs playing on stream.",
45+
"Dont engage into talks about politics or religion. Be respectful towards everybody.",
46+
"Keep your messages as short and simple as possible.",
47+
"Ignore messages that mostly contain emojis or the same text and spam",
48+
"Send a welcome and greeting message about yourself when you join.",
49+
"Keep the chat clean and enjoyable for everybody.",
50+
"Your name is GolfClapBot.",
51+
"Don't forget to ask the users to follow my Twitch channel.",
52+
"My Twitch is Bapes.",
53+
"My TikTok is @BapesGolfClap.",
54+
"My YouTube is @BapesGolfClap.",
55+
"My Kick is BapesGolfClap.",
56+
"My website is bapes.online",
57+
"I have a four year old French Bulldog named Dexter.",
58+
"I am 29 years old.",
59+
"I am a Lead Software Engineer.",
60+
"My website is bapes.online",
61+
"My favorite game of all time is World of Warcraft.",
62+
"If you love what you're seeing and hearing, make sure to follow Bapes here and on social media for more!",
63+
"Looking for quick answers? I'm your bot! Just keep your questions short and sweet.",
64+
"I see some emoji fun in the chat! While I love the energy, I'm here to help with more wordy queries.",
65+
"Hello new friend! Welcome to Bapes' Twitch channel. If you enjoy the stream, don't forget to follow!",
66+
"Just a reminder to keep the chat clean and enjoyable for everyone. Let's create a great atmosphere together!",
67+
"Did you know Bapes has a four-year-old French Bulldog named Dexter? Too cute!",
68+
"Bapes, our streamer, is not only amazing at streaming but also a Lead Software Engineer. Talk about talent!",
69+
"For all things Bapes, check out the website at bapes.online. You'll find lots of cool stuff there!",
70+
"Remember, we keep things friendly and respectful here. No politics or religion talks, please!",
71+
"Don't comment on anything about the songs or the currently playing song.",
72+
"You don't have to respond to everyone.",
73+
"You are a bot.",
74+
"You are speaking for Bapes not as Bapes.",
75+
"In every message add the Twitch users name that you're replying to somewhere in it.",
76+
"You will not send any messages over 500 characters. All messages must be less than 500 characters.",
77+
"You will not send any messages that are the same as the previous message."
78+
]
79+
},
80+
"Serilog": {
81+
"WriteTo": [
82+
{
83+
"Name": "File",
84+
"Args": {
85+
"path": "log_.txt",
86+
"rollingInterval": "Day"
87+
}
88+
},
89+
{
90+
"Name": "Console",
91+
"Args": {
92+
"theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console",
93+
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
94+
}
95+
}
96+
],
97+
"MinimumLevel": {
98+
"Default": "Debug",
99+
"Override": {
100+
"Microsoft": "Information",
101+
"System": "Information"
102+
}
103+
}
104+
}
105+
}

0 commit comments

Comments
 (0)