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.

getting_started.rst 1.6 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Getting Started
  2. ===============
  3. Requirements
  4. ------------
  5. Discord.Net currently requires logging in with a claimed account - anonymous logins are not supported. You can `register for a Discord account here`_.
  6. New accounts are also useless when not connected to a server, so you should create an invite code for whatever server you intend to test on using the official Discord client.
  7. .. _register for a Discord account here: https://discordapp.com/register
  8. Installation
  9. ------------
  10. You can get Discord.Net from NuGet:
  11. * `Discord.Net`_
  12. * `Discord.Net.Commands`_
  13. * `Discord.Net.Modules`_
  14. * `Discord.Net.Audio`_
  15. If you have trouble installing from NuGet, try installing dependencies manually.
  16. You can also pull the latest source from `GitHub`_
  17. .. _Discord.Net: https://www.nuget.org/packages/Discord.Net
  18. .. _Discord.Net.Commands: https://www.nuget.org/packages/Discord.Net.Commands
  19. .. _Discord.Net.Modules: https://www.nuget.org/packages/Discord.Net.Modules
  20. .. _Discord.Net.Modules: https://www.nuget.org/packages/Discord.Net.Audio
  21. .. _GitHub: https://github.com/RogueException/Discord.Net/
  22. Async
  23. -----
  24. Discord.Net uses C# tasks extensively - nearly all operations return one. It is highly recommended that these tasks be awaited whenever possible.
  25. To do so requires the calling method be marked as async, which can be problematic in a console application. An example of how to get around this is provided below.
  26. For more information, go to `MSDN's Await-Async section`_.
  27. .. _MSDN's Await-Async section: https://msdn.microsoft.com/en-us/library/hh191443.aspx
  28. Example
  29. -------
  30. .. literalinclude:: samples/getting_started.cs
  31. :language: csharp6
  32. :tab-width: 2