https://github.com/defxult/discord.cs
https://github.com/defxult/discord.cs
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/defxult/discord.cs
- Owner: Defxult
- Created: 2025-06-22T08:56:48.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2025-06-22T18:39:16.000Z (12 months ago)
- Last Synced: 2025-06-22T19:36:17.687Z (12 months ago)
- Language: C#
- Size: 8.79 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# discord.cs
An in development Discord API library written in C#.
## Discord
Join the official [Discord server](https://discord.gg/6TNJHcGRYv) for discord.cs! Get support, updates/announcements, and contribute to development.
## NuGet
Discord.cs is on [NuGet](https://www.nuget.org/packages/Discord.cs/). In the early stages of development, any help testing the library is appreciated!
## Basic Usage
```csharp
// The following simply brings your bot online and responds to a message.
using Discord;
using Discord.Models;
// Set your bot token.
Environment.SetEnvironmentVariable("DISCORD_BOT_TOKEN", "");
var bot = new Bot(Intents.Default);
// Listen for messages.
bot.Events.OnMessageCreate += async (_, message) =>
{
// Don't respond to bot messages (ourselves) to avoid a loop.
if (message.Author.IsBot)
return;
if (message.Content == "hi")
await message.Channel.SendAsync("Hello! 👋")
};
await bot.ConnectAsync();
await Task.Delay(-1);
```