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.md 2.9 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. ---
  2. uid: FAQ.Basics.GetStarted
  3. title: Beginner Questions / How to Get Started
  4. ---
  5. # Basic Concepts / Getting Started
  6. In this following section, you will find commonly asked questions and
  7. answers about how to get started with Discord.Net, as well as basic
  8. introduction to the Discord API ecosystem.
  9. ## How do I add my bot to my server/guild?
  10. You can do so by using the [permission calculator] provided
  11. by [FiniteReality].
  12. This tool allows you to set permissions that the bot will be assigned
  13. with, and invite the bot into your guild. With this method, bots will
  14. also be assigned a unique role that a regular user cannot use; this
  15. is what we call a `Managed` role. Because you cannot assign this
  16. role to any other users, it is much safer than creating a single
  17. role which, intentionally or not, can be applied to other users
  18. to escalate their privilege.
  19. [FiniteReality]: https://github.com/FiniteReality/permissions-calculator
  20. [permission calculator]: https://finitereality.github.io/permissions-calculator
  21. ## What is a token?
  22. A token is a credential used to log into an account. This information
  23. should be kept **private** and for your eyes only. Anyone with your
  24. token can log into your account. This risk applies to both user
  25. and bot accounts. That also means that you should **never** hardcode
  26. your token or add it into source control, as your identity may be
  27. stolen by scrape bots on the internet that scours through
  28. constantly to obtain a token.
  29. ## What is a client/user/object ID?
  30. Each user and object on Discord has its own snowflake ID generated
  31. based on various conditions.
  32. ![Snowflake Generation](images/snowflake.png)
  33. Anyone can see the ID; it is public. It is merely used to
  34. identify an object in the Discord ecosystem. Many things in the
  35. Discord ecosystem require an ID to retrieve or identify the said
  36. object.
  37. There are 2 common ways to obtain the said ID.
  38. ### [Discord Developer Mode](#tab/dev-mode)
  39. By enabling the developer mode you can right click on most objects
  40. to obtain their snowflake IDs (please note that this may not apply to
  41. all objects, such as role IDs, or DM channel IDs).
  42. ![Developer Mode](images/dev-mode.png)
  43. ### [Escape Character](#tab/escape-char)
  44. You can escape an object by using `\` in front the object in the
  45. Discord client. For example, when you do `\@Example#1234` in chat,
  46. it will return the user ID of the aforementioned user.
  47. ![Escaping mentions](images/mention-escape.png)
  48. ***
  49. ## How do I get the role ID?
  50. > [!WARNING]
  51. > Right-clicking on the role and copying the ID will **not** work.
  52. > This will only copy the message ID.
  53. Several common ways to do this:
  54. 1. (Easiest) Right click on the role either in the Server Settings
  55. or in the user's role list.
  56. ![Roles](images/role-copy.png)
  57. 2. Make the role mentionable and mention the role, and escape it
  58. using the `\` character in front.
  59. 3. Inspect the roles collection within the guild via your debugger.