Skip to content

Commit 12a99dc

Browse files
committed
Merged
2 parents d602a51 + 8abe043 commit 12a99dc

File tree

15 files changed

+491
-247
lines changed

15 files changed

+491
-247
lines changed

ConsoleChatbot/ConsoleChatService.cs

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,55 @@
44

55
namespace ConsoleChatbot
66
{
7-
public class ConsoleChatService : IChatService
7+
public class ConsoleChatService : IChatService
8+
{
9+
public string Name => "Console";
10+
11+
public bool IsAuthenticated => true;
12+
13+
public string BotUserName => "ConsoleBot";
14+
15+
public event EventHandler<ChatMessageEventArgs> ChatMessage;
16+
public event EventHandler<ChatUserInfoEventArgs> UserJoined;
17+
public event EventHandler<ChatUserInfoEventArgs> UserLeft;
18+
19+
public void ConsoleMessageReceived(string message)
20+
{
21+
22+
ChatMessage.Invoke(this, new ChatMessageEventArgs
23+
{
24+
Message = message,
25+
UserName = "ConsoleUser"
26+
});
27+
28+
}
29+
30+
public Task<bool> BanUserAsync(string userName)
31+
{
32+
throw new NotImplementedException();
33+
}
34+
35+
public Task<bool> SendMessageAsync(string message)
36+
{
37+
Console.Out.WriteLine(message);
38+
return Task.FromResult(true);
39+
}
40+
41+
public Task<bool> SendWhisperAsync(string userName, string message)
42+
{
43+
Console.Out.WriteLine($"<<{userName}>> {message}");
44+
return Task.FromResult(true);
45+
}
46+
47+
public Task<bool> TimeoutUserAsync(string userName, TimeSpan time)
48+
{
49+
throw new NotImplementedException();
50+
}
51+
52+
public Task<bool> UnbanUserAsync(string userName)
853
{
9-
public string Name => "Console";
10-
11-
public bool IsAuthenticated => true;
12-
13-
public event EventHandler<ChatMessageEventArgs> ChatMessage;
14-
public event EventHandler<ChatUserInfoEventArgs> UserJoined;
15-
public event EventHandler<ChatUserInfoEventArgs> UserLeft;
16-
17-
public void ConsoleMessageReceived(string message) {
18-
19-
ChatMessage.Invoke(this, new ChatMessageEventArgs
20-
{
21-
Message = message,
22-
UserName = "ConsoleUser"
23-
});
24-
25-
}
26-
27-
public Task<bool> BanUserAsync(string userName)
28-
{
29-
throw new NotImplementedException();
30-
}
31-
32-
public Task<bool> SendMessageAsync(string message)
33-
{
34-
Console.Out.WriteLine(message);
35-
return Task.FromResult(true);
36-
}
37-
38-
public Task<bool> SendWhisperAsync(string userName, string message)
39-
{
40-
Console.Out.WriteLine($"<<{userName}>> {message}");
41-
return Task.FromResult(true);
42-
}
43-
44-
public Task<bool> TimeoutUserAsync(string userName, TimeSpan time)
45-
{
46-
throw new NotImplementedException();
47-
}
48-
49-
public Task<bool> UnbanUserAsync(string userName)
50-
{
51-
throw new NotImplementedException();
52-
}
54+
throw new NotImplementedException();
5355
}
56+
}
5457

5558
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Fritz.Chatbot.Commands
6+
{
7+
8+
public class SentimentSink
9+
{
10+
11+
public static Queue<string> RecentChatMessages { get; } = new Queue<string>();
12+
13+
}
14+
15+
}

0 commit comments

Comments
 (0)