Skip to content

Latest commit

 

History

History
69 lines (48 loc) · 1.95 KB

index.md

File metadata and controls

69 lines (48 loc) · 1.95 KB

Logo of DSharpPlus

DSharp+

A C# API for Discord based off DiscordSharp :3

Our official server

Discord Server

Getting Started

1. Installation and setup

1.1 NuGet

Start off by creating a new C# console application project. Then open up the NuGet Console (Project -> Manage Nuget Packages...). Enter Install-Package DSharpPlus -Pre.

Then move to Step 2.

1.2 Git

First start off by downloading the git repo

git clone https://github.com/NaamloosDT/SharpCord.git

Then open the project in Visual Studio, and build the class library. After you have done that, make a new C# console application project. Set the class library as a reference. Then use move to Step 2.

2. Connecting

Start your bot off with this code.

using DSharpPlus;

class Program {
  static void Main(string[] args)
        {
            DiscordClient client = new DiscordClient("INSERT YOUR TOKEN HERE", true);

            Console.WriteLine("Attempting to connect!");
            try
            {
                client.SendLoginRequest();
                client.Connect();
            } catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            client.Connected += (sender, e) =>
            {
                Console.WriteLine("CLIENT CONNECTED");
            };
  }
}

In a nutshell, the code will allow your bot to connect to the server. Head to the Example Bot on how to get started with commands and othere portions of the bot.

Documentation

Old Example Bot (might be a bit outdated)

Questions?

Come talk to us here! ❤

Changelog

The changelog can be found in the Changelog.md file