Name: Rocket.Chat.Net
Owner: Rocket.Chat
Description: A Rocket.Chat realtime managed .Net driver and bot
Forked from: Silvenga/Rocket.Chat.Net
Created: 2016-02-15 11:44:42.0
Updated: 2017-12-06 01:41:10.0
Pushed: 2016-10-29 16:30:54.0
Homepage: null
Size: 445
Language: C#
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
| | Pre-release | Stable Release | | ——————- | ——————————————- | — | | Rocket.Chat.Net | | | | Rocket.Chat.Net.Bot | | |
A Rocket.Chat real-time, managed, .Net driver, and bot.
Not compatible with 0.36.0, 0.37.0, 0.37.1, see https://github.com/Silvenga/Rocket.Chat.Net/issues/2 Waiting for things to settle down.
t string username = "m@silvenga.com";
t string password = "silverlight";
t string rocketServerUrl = "demo.rocket.chat:3000";
t bool useSsl = false;
inOption loginOption = new LdapLoginOption
Username = username,
Password = password
ketChatDriver driver = new RocketChatDriver(rocketServerUrl, useSsl);
t driver.ConnectAsync(); // Connect to server
t driver.LoginAsync(loginOption); // Login via LDAP
t driver.SubscribeToRoomAsync(); // Listen on all rooms
er.MessageReceived += Console.WriteLine;
generalRoomIdResult = await driver.GetRoomIdAsync("general");
generalRoomIdResult.HasError)
throw new Exception("Could not find room by name.");
generalRoomId = generalRoomIdResult.Result;
t driver.SendMessageAsync("message", generalRoomId);
t string username = "m@silvenga.com";
t string password = "silverlight";
t string rocketServerUrl = "dev0:3000"; // just the host and port
t bool useSsl = false; // Basically use ws or wss.
reate the bot - an abstraction of the driver
etChatBot bot = new RocketChatBot(rocketServerUrl, useSsl);
onnect to Rocket.Chat
t bot.ConnectAsync();
ogin
inOption loginOption = new EmailLoginOption
Email = username,
Password = password
t bot.LoginAsync(loginOption);
tart listening for messages
t bot.SubscribeAsync();
dd possible responses to be checked in order
his is not thead safe, FYI
Response giphyResponse = new GiphyResponse();
AddResponse(giphyResponse);
nd that's it
heckout GiphyResponse in the example project for more info.