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 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. If you have trouble installing from NuGet, try installing dependencies manually.
  15. You can also pull the latest source from `GitHub`_
  16. .. _Discord.Net: https://www.nuget.org/packages/Discord.Net/0.8.1-beta2
  17. .. _Discord.Net.Commands: https://www.nuget.org/packages/Discord.Net.Commands/0.8.1-beta2
  18. .. _Discord.Net.Modules: https://www.nuget.org/packages/Discord.Net.Modules/0.8.1-beta2
  19. .. _GitHub: https://github.com/RogueException/Discord.Net/
  20. Async
  21. -----
  22. Discord.Net uses C# tasks extensively - nearly all operations return one. It is highly recommended that these tasks be awaited whenever possible.
  23. 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.
  24. For more information, go to `MSDN's Await-Async section`_.
  25. .. _MSDN's Await-Async section: https://msdn.microsoft.com/en-us/library/hh191443.aspx
  26. Example
  27. -------
  28. .. literalinclude:: samples/getting_started.cs
  29. :language: csharp6
  30. :tab-width: 2