Browse Source

Fix Samples on Docs; Fix Links on Docs; add FAQ page to docs

tags/1.0-rc
Christopher F 8 years ago
parent
commit
af4ede31b8
13 changed files with 51 additions and 3 deletions
  1. +1
    -1
      docs/api/.manifest
  2. +20
    -0
      docs/guides/faq.md
  3. +1
    -0
      docs/guides/samples/command_handler.cs
  4. +1
    -0
      docs/guides/samples/dependency_map_setup.cs
  5. +1
    -0
      docs/guides/samples/dependency_module.cs
  6. +5
    -0
      docs/guides/samples/faq/avatar.cs
  7. +7
    -0
      docs/guides/samples/faq/send_message.cs
  8. +8
    -0
      docs/guides/samples/faq/status.cs
  9. +1
    -0
      docs/guides/samples/first-steps.cs
  10. +1
    -0
      docs/guides/samples/logging.cs
  11. +1
    -0
      docs/guides/samples/module.cs
  12. +3
    -1
      docs/guides/toc.yml
  13. +1
    -1
      docs/index.md

+ 1
- 1
docs/api/.manifest
File diff suppressed because it is too large
View File


+ 20
- 0
docs/guides/faq.md View File

@@ -0,0 +1,20 @@
---
title: Frequently Asked Questions
---

# Frequently Asked Questions

>[!NOTE]
>All of these samples assume you have `_client` defined as a `DiscordSocketClient`.

#### Changing the bot's avatar

[!code-csharp[Bot Avatar](samples/faq/avatar.cs)]

#### Changing the bot's status

[!code-sharp[Bot Status](samples/faq/status.cs)]

#### Sending a message to a channel

[!code-csharp[Message to Channel](samples/faq/send_message.cs)]

+ 1
- 0
docs/guides/samples/command_handler.cs View File

@@ -1,6 +1,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Reflection; using System.Reflection;
using Discord; using Discord;
using Discord.WebSocket;
using Discord.Commands; using Discord.Commands;


public class Program public class Program


+ 1
- 0
docs/guides/samples/dependency_map_setup.cs View File

@@ -1,5 +1,6 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Discord.WebSocket;


public class Commands public class Commands
{ {


+ 1
- 0
docs/guides/samples/dependency_module.cs View File

@@ -1,5 +1,6 @@
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Discord.WebSocket;


[Module] [Module]
public class ModuleA public class ModuleA


+ 5
- 0
docs/guides/samples/faq/avatar.cs View File

@@ -0,0 +1,5 @@
public async Task ChangeAvatar()
{
var fileStream = new FileStream("./newAvatar.png", FileMode.Open);
await (await _client.GetCurrentUserAsync()).ModifyAsync(x => x.Avatar = fileStream);
}

+ 7
- 0
docs/guides/samples/faq/send_message.cs View File

@@ -0,0 +1,7 @@
public async Task SendMessageToChannel(ulong ChannelId)
{
var channel = await _client.GetChannelAsync(ChannelId) as IMessageChannel;
await channel?.SendMessageAsync("aaaaaaaaahhh!!!")
/* ^ This question mark is used to indicate that 'channel' may sometimes be null, and
in cases that it is null, we will do nothing here. */
}

+ 8
- 0
docs/guides/samples/faq/status.cs View File

@@ -0,0 +1,8 @@
public async Task ModifyStatus()
{
await (await _client.GetCurrentUserAsync()).ModifyStatusAsync(x =>
{
x.Status = UserStatus.Idle;
x.Game = new Game("Type !help for help");
});
}

+ 1
- 0
docs/guides/samples/first-steps.cs View File

@@ -1,4 +1,5 @@
using Discord; using Discord;
using Discord.WebSocket;


class Program class Program
{ {


+ 1
- 0
docs/guides/samples/logging.cs View File

@@ -1,4 +1,5 @@
using Discord; using Discord;
using Discord.Rest;


public class Program public class Program
{ {


+ 1
- 0
docs/guides/samples/module.cs View File

@@ -1,4 +1,5 @@
using Discord.Commands; using Discord.Commands;
using Discord.WebSocket;


// Create a module with no prefix // Create a module with no prefix
[Module] [Module]


+ 3
- 1
docs/guides/toc.yml View File

@@ -6,4 +6,6 @@
- name: Logging - name: Logging
href: logging.md href: logging.md
- name: Commands - name: Commands
href: commands.md
href: commands.md
- name: FAQ
href: faq.md

+ 1
- 1
docs/index.md View File

@@ -1,6 +1,6 @@


# Discord.Net Documentation # Discord.Net Documentation


Refer to [Guides](guides/) for tutorials on using Discord.Net, or the [API documentation](api/) to review individual objects in the library.
Refer to [Guides](guides/intro.md) for tutorials on using Discord.Net, or the [API documentation](api/index.md) to review individual objects in the library.


**Todo:** Put something meaningful here. **Todo:** Put something meaningful here.

Loading…
Cancel
Save