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.

ObjectProperties.Overwrites.md 3.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. ---
  2. uid: Discord.GuildChannelProperties
  3. example: [*content]
  4. ---
  5. The following example uses @Discord.IGuildChannel.ModifyAsync* to
  6. apply changes specified in the properties,
  7. ```cs
  8. var channel = _client.GetChannel(id) as IGuildChannel;
  9. if (channel == null) return;
  10. await channel.ModifyAsync(x =>
  11. {
  12. x.Name = "new-name";
  13. x.Position = channel.Position - 1;
  14. });
  15. ```
  16. ---
  17. uid: Discord.TextChannelProperties
  18. example: [*content]
  19. ---
  20. The following example uses @Discord.ITextChannel.ModifyAsync* to
  21. apply changes specified in the properties,
  22. ```cs
  23. var channel = _client.GetChannel(id) as ITextChannel;
  24. if (channel == null) return;
  25. await channel.ModifyAsync(x =>
  26. {
  27. x.Name = "cool-guys-only";
  28. x.Topic = "This channel is only for cool guys and adults!!!";
  29. x.Position = channel.Position - 1;
  30. x.IsNsfw = true;
  31. });
  32. ```
  33. ---
  34. uid: Discord.VoiceChannelProperties
  35. example: [*content]
  36. ---
  37. The following example uses @Discord.IVoiceChannel.ModifyAsync* to
  38. apply changes specified in the properties,
  39. ```cs
  40. var channel = _client.GetChannel(id) as IVoiceChannel;
  41. if (channel == null) return;
  42. await channel.ModifyAsync(x =>
  43. {
  44. x.UserLimit = 5;
  45. });
  46. ```
  47. ---
  48. uid: Discord.EmoteProperties
  49. example: [*content]
  50. ---
  51. The following example uses @Discord.IGuild.ModifyEmoteAsync* to
  52. apply changes specified in the properties,
  53. ```cs
  54. await guild.ModifyEmoteAsync(x =>
  55. {
  56. x.Name = "blobo";
  57. });
  58. ```
  59. ---
  60. uid: Discord.MessageProperties
  61. example: [*content]
  62. ---
  63. The following example uses @Discord.IUserMessage.ModifyAsync* to
  64. apply changes specified in the properties,
  65. ```cs
  66. var message = await channel.SendMessageAsync("boo");
  67. await Task.Delay(TimeSpan.FromSeconds(1));
  68. await message.ModifyAsync(x => x.Content = "boi");
  69. ```
  70. ---
  71. uid: Discord.GuildProperties
  72. example: [*content]
  73. ---
  74. The following example uses @Discord.IGuild.ModifyAsync* to
  75. apply changes specified in the properties,
  76. ```cs
  77. var guild = _client.GetGuild(id);
  78. if (guild == null) return;
  79. await guild.ModifyAsync(x =>
  80. {
  81. x.Name = "VERY Fast Discord Running at Incredible Hihg Speed";
  82. });
  83. ```
  84. ---
  85. uid: Discord.RoleProperties
  86. example: [*content]
  87. ---
  88. The following example uses @Discord.IRole.ModifyAsync* to
  89. apply changes specified in the properties,
  90. ```cs
  91. var role = guild.GetRole(id);
  92. if (role == null) return;
  93. await role.ModifyAsync(x =>
  94. {
  95. x.Name = "cool boi";
  96. x.Color = Color.Gold;
  97. x.Hoist = true;
  98. x.Mentionable = true;
  99. });
  100. ```
  101. ---
  102. uid: Discord.GuildUserProperties
  103. example: [*content]
  104. ---
  105. The following example uses @Discord.IGuildUser.ModifyAsync* to
  106. apply changes specified in the properties,
  107. ```cs
  108. var user = guild.GetUser(id);
  109. if (user == null) return;
  110. await user.ModifyAsync(x =>
  111. {
  112. x.Nickname = "I need healing";
  113. });
  114. ```
  115. ---
  116. uid: Discord.SelfUserProperties
  117. example: [*content]
  118. ---
  119. The following example uses @Discord.ISelfUser.ModifyAsync* to
  120. apply changes specified in the properties,
  121. ```cs
  122. await selfUser.ModifyAsync(x =>
  123. {
  124. x.Username = "Mercy";
  125. });
  126. ```
  127. ---
  128. uid: Discord.WebhookProperties
  129. example: [*content]
  130. ---
  131. The following example uses @Discord.IWebhook.ModifyAsync* to
  132. apply changes specified in the properties,
  133. ```cs
  134. await webhook.ModifyAsync(x =>
  135. {
  136. x.Name = "very fast fox";
  137. x.ChannelId = newChannelId;
  138. });
  139. ```