You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.0 kB

9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
10 years ago
10 years ago
9 years ago
10 years ago
10 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Discord.Net v0.6.1-beta2
  2. An unofficial .Net API Wrapper for the Discord client (http://discordapp.com).
  3. [Join the discussion](https://discord.gg/0SBTUU1wZTVjAMPx) on Discord.
  4. ### This is an alpha!
  5. The Discord API is still in active development, meaning this library may break at any time without notice.
  6. Discord.Net itself is also in alpha so several functions may be unstable or not work at all.
  7. ### Features
  8. - Server Management (Servers, Channels, Messages, Invites)
  9. - User Moderation (Kick/Ban/Unban/Mute/Unmute/Deafen/Undeafen)
  10. - Alpha Voice Support (Outgoing only currently)
  11. - Supports .Net 4.5, DNX 4.5.1, and DNX Core 5.0
  12. ### NuGet Packages
  13. - [Discord.Net](https://www.nuget.org/packages/Discord.Net/)
  14. - [Discord.Net.Commands](https://www.nuget.org/packages/Discord.Net.Commands/)
  15. ### Example (Echo Client)
  16. ```
  17. var client = new DiscordClient();
  18. client.MessageCreated += async (s, e) =>
  19. {
  20. if (e.Message.UserId != client.User.Id)
  21. await client.SendMessage(e.Message.ChannelId, e.Message.Text);
  22. };
  23. await client.Connect("discordtest@email.com", "Password123");
  24. await client.AcceptInvite("channel-invite-code");
  25. ```
  26. ### Example (Command Client)
  27. (Requires Discord.Net.Commands)
  28. ```
  29. var client = new DiscordBotClient();
  30. client.CreateCommand("acceptinvite")
  31. .ArgsEqual(1)
  32. .Do(async e =>
  33. {
  34. try
  35. {
  36. await _client.AcceptInvite(e.Args[0]);
  37. await _client.SendMessage(e.Channel, $"Invite \"{e.Args[0]}\" accepted.");
  38. }
  39. catch (HttpException ex)
  40. {
  41. await _client.SendMessage(e.Channel, $"Error: {ex.Message}");
  42. }
  43. });
  44. await client.Connect("discordtest@email.com", "Password123");
  45. await client.AcceptInvite("channel-invite-code");
  46. ```
  47. ### Known Issues
  48. - Due to current Discord restrictions, private messages are blocked unless both the sender and recipient are members of the same server.
  49. - Caches do not currently clean up when their entries are no longer referenced, and there is no cap to the message cache. For now, disconencting and reconnecting will clear all caches.