Skip to content

Commit 5f0eeba

Browse files
committed
Merge pull request #33 from andrewtobin/NewBotCommands
Added a command to list all rooms, and one to send any command through t...
2 parents 6628e25 + 870f0ee commit 5f0eeba

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Jabbot/Bot.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,13 @@ public IEnumerable<string> GetRoomOwners(string room)
285285
return owners;
286286
}
287287

288+
public dynamic GetRooms()
289+
{
290+
var result = _chat.Invoke<dynamic>("getRooms").Result;
291+
292+
return result;
293+
}
294+
288295
public void ChangeNote(string note)
289296
{
290297
Send(String.Format("/note {0}", note));
@@ -295,6 +302,16 @@ public void Nudge(string user)
295302
Send(String.Format("/nudge {0}", user));
296303
}
297304

305+
public void SendAdministrativeCommand(string command)
306+
{
307+
if (!command.StartsWith("/"))
308+
{
309+
throw new InvalidOperationException("Only commands are allowed");
310+
}
311+
312+
Send(command);
313+
}
314+
298315
/// <summary>
299316
/// Disconnect the bot from the chat session. Leaves all rooms the bot entered
300317
/// </summary>

0 commit comments

Comments
 (0)