Commit 4f870e3d authored by Robert Rudman's avatar Robert Rudman

Add tags to the observation/burnination room

parent a9899554
Pipeline #43339328 failed with stages
in 1 minute and 30 seconds
......@@ -132,13 +132,13 @@ namespace Rodgort.Services
private async Task RenameObservationRoom(int roomId, string metaPostUrl, string tag)
{
await _chatClient.EditRoom(ChatSite.StackOverflow, roomId, $"Burnination progress for the [{tag}] tag", metaPostUrl);
await _chatClient.EditRoom(ChatSite.StackOverflow, roomId, $"Burnination progress for the [{tag}] tag", metaPostUrl, new[] { tag });
}
private async Task<int> CreateBurnRoom(string metaPostUrl, string tag)
{
var roomName = $"Burnination progress for the [{tag}] tag";
var roomId = await _chatClient.CreateRoom(ChatSite.StackOverflow, ChatRooms.SO_BOTICS_WORKSHOP, roomName, metaPostUrl);
var roomId = await _chatClient.CreateRoom(ChatSite.StackOverflow, ChatRooms.SO_BOTICS_WORKSHOP, roomName, metaPostUrl, new[] { tag });
var gemmyMessage = $"@Gemmy start tag [{tag}] {roomId} https://chat.stackoverflow.com/rooms/{roomId}";
......
......@@ -74,7 +74,7 @@ namespace StackExchangeChat
}
private readonly Regex _roomRegex = new Regex(@"\/rooms\/info\/(\d+)\/");
public async Task<int> CreateRoom(ChatSite chatSite, int currentRoomId, string roomName, string roomDescription)
public async Task<int> CreateRoom(ChatSite chatSite, int currentRoomId, string roomName, string roomDescription, IEnumerable<string> tags)
{
return await ThrottlingUtils.Throttle(ChatThrottleGroups.WebRequestThrottle, async () =>
{
......@@ -88,7 +88,7 @@ namespace StackExchangeChat
{"defaultAccess", "read-write"},
{"name", roomName},
{"description", roomDescription},
{"tags", string.Empty},
{"tags", string.Join(" ", tags)},
{"noDupeCheck", "true"}
}));
......@@ -98,7 +98,7 @@ namespace StackExchangeChat
}, _ => Task.Delay(TimeSpan.FromSeconds(5)));
}
public async Task EditRoom(ChatSite chatSite, int roomId, string roomName, string roomDescription)
public async Task EditRoom(ChatSite chatSite, int roomId, string roomName, string roomDescription, IEnumerable<string> tags)
{
await ThrottlingUtils.Throttle(ChatThrottleGroups.WebRequestThrottle, async () =>
{
......@@ -113,7 +113,7 @@ namespace StackExchangeChat
{"roomId", roomId.ToString()},
{"name", roomName},
{"description", roomDescription},
{"tags", string.Empty},
{"tags", string.Join(" ", tags)},
}));
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment