Use Robloxdotnet to interact with the Roblox Web API with .NET Core!

Robloxdotnet

This is for all the .NET Core developers out there! Robloxdotnet is a Roblox Web API wrapper library for the C# language. It offers various classes and simple methods that make interacting with the Roblox API easy!

Documentation: Home · Loravis/Robloxdotnet Wiki · GitHub
Get it here: NuGet Gallery | Robloxdotnet 1.1.1

If you have any feedback or suggestions for features or improvements, message me on Discord (@loravis) or just post them here. :slight_smile:

Why use Robloxdotnet?

  • Robloxdotnet is very easy to use and well documented.
  • Robloxdotnet is being updated frequently with new features and patches.

Features

(As of version 1.1.1)

  • Get user information
  • Authentication
  • Send group shouts
  • Update user group roles
  • Get user’s group information

Examples

Get a user’s description

using System;
using Robloxdotnet;

ulong userId = 1; //Insert any userId of your choice 

var userInfo = await Roblox.GetUserInfo(userId); //Get the user's information

Console.WriteLine(userInfo.description); //Output the user description

Log into your Roblox account

using System;
using Robloxdotnet;

//Disclaimer: Storing your .ROBLOSECURITY directly in your code is strongly discouraged, especially if you're committing your code to a public github repo!
string roblosecurityCookie = "PASTE_YOUR_.ROBLOSECURITY_COOKIE_HERE"; 

RobloxSession session = new RobloxSession(); 

try
{
    await session.LoginAsync(roblosecurityCookie); //Log into your Roblox account using your roblosecurity cookie
    Console.WriteLine("Logged in as: " + session.name); //Output your Roblox account's username
} catch (Exception ex)
{
    Console.WriteLine(ex.Message); //Output the exception message if the login fails
}

Update a user’s group role

using System;
using Robloxdotnet;
using Robloxdotnet.Utilities.Groups;

//Disclaimer: Storing your .ROBLOSECURITY directly in your code is strongly discouraged, especially if you're committing your code to a public github repo!
string roblosecurityCookie = "PASTE_YOUR_.ROBLOSECURITY_COOKIE_HERE"; 

RobloxSession session = new RobloxSession(); 

try
{
    await session.LoginAsync(roblosecurityCookie); //Log into your Roblox account using your roblosecurity cookie

    ulong userId = 1; //Insert the user's user ID here
    ulong groupId = 12345; //Insert the group's group ID here
    int role = 255; //Insert the roles's role number here

    await MemberManagement.SetUserGroupRole(session, userId, groupId, role); //Update the group role of the specified user
} catch (Exception ex)
{
    Console.WriteLine(ex.Message); //Output the exception message
}
5 Likes

I recently tried C# and software development (for the 4th time…), and I’d like to say that this is a really cool resource! Just like noblox.js, but for C#.

Would it be possible to use Roblox’s OAuth2 so you don’t have to login? Logging in would provide all actions, while OAuth2 would restrict it to a few, and ask the user if the program can have them. It would be a task to add this, but it would be useful!

1 Like

Hi thanks for the feedback! :slight_smile:

I am going to look into implementing OAuth2 for a future update. Can‘t promise anything but I‘ll see what I can do.

1 Like