Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
:four_leaf_clover: .NET Async HabitRPG Client Library
C#

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
res
src
.gitattributes
.gitignore
LICENSE
README.md

README.md

HabitRPG API .NET Client

.NET Async HabitRPG Client Library

MyGet Build Status

How to install

To install HabitRPG.Client, run the following command in the Package Manager Console

Install-Package HabitRPG.Client

How to use

var configuration = new HabitRpgConfiguration()
{
  UserId = // UserId guid from HabitRPG,
  ApiToken = // ApiToken guid from HabitRPG,
  ServiceUri = new Uri(@"https://habitrpg.com/")
};

IUserClient _userClient = new UserClient(configuration);

var response = await _userClient.GetTasksAsync();

Supported methods

IUserClient

Task<ScoreResult> ScoreTaskAsync(string id, Direction direction);
Task<List<ITask>> GetTasksAsync();
Task<T> CreateTaskAsync<T>(T task) where T : ITask;
Task<T> GetTaskAsync<T>(string taskId) where T : ITask;
Task<T> UpdateTaskAsync<T>(T task) where T : ITask;
Task DeleteTaskAsync(string taskId);
Task<List<ITask>> ClearCompletedAsync();
Task<List<Item>> GetBuyableItemsAsync();
Task BuyItemAsync(string key);
Task<User> GetUserAsync();
Task CreateTagAsync(Tag tag);
Task UpdateTagAsync(Tag tag);    
Task DeleteTagAsync(string tagId);

IMembersClient

Task<Member> GetMemberAsync(string id);

IGroupsClient

Task<List<Group>> GetGroupsAsync(string types);
Task<Group> GetGroupAsync(string groupId);
Task<List<ChatMessage>> GetGroupChatAsync(string groupId);
Task<ChatMessage> SendChatMessageAsync(string groupId, string message);
Task DeleteChatMessageAsync(string groupId, string messageId);
Task LikeChatMessageAsync(string groupId, string messageId);

IContentClient

Task<Content> GetContentAsync(string language = "");
Something went wrong with that request. Please try again.