Fix Samples on Docs; Fix Links on Docs; add FAQ page to docs
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Reflection;
|
||||
using Discord;
|
||||
using Discord.WebSocket;
|
||||
using Discord.Commands;
|
||||
|
||||
public class Program
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Discord;
|
||||
using Discord.Commands;
|
||||
using Discord.WebSocket;
|
||||
|
||||
public class Commands
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Discord;
|
||||
using Discord.Commands;
|
||||
using Discord.WebSocket;
|
||||
|
||||
[Module]
|
||||
public class ModuleA
|
||||
|
||||
5
docs/guides/samples/faq/avatar.cs
Normal file
5
docs/guides/samples/faq/avatar.cs
Normal 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
docs/guides/samples/faq/send_message.cs
Normal file
7
docs/guides/samples/faq/send_message.cs
Normal 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
docs/guides/samples/faq/status.cs
Normal file
8
docs/guides/samples/faq/status.cs
Normal 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,4 +1,5 @@
|
||||
using Discord;
|
||||
using Discord.WebSocket;
|
||||
|
||||
class Program
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Discord;
|
||||
using Discord.Rest;
|
||||
|
||||
public class Program
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Discord.Commands;
|
||||
using Discord.WebSocket;
|
||||
|
||||
// Create a module with no prefix
|
||||
[Module]
|
||||
|
||||
Reference in New Issue
Block a user