| @@ -74,7 +74,7 @@ async main. | |||||
| [!code-csharp[Async Context](samples/intro/async-context.cs)] | [!code-csharp[Async Context](samples/intro/async-context.cs)] | ||||
| As a result of this, your program will now start and immidiately | |||||
| As a result of this, your program will now start and immediately | |||||
| jump into an async context. This will allow us to create a connection | jump into an async context. This will allow us to create a connection | ||||
| to Discord later on without needing to worry about setting up the | to Discord later on without needing to worry about setting up the | ||||
| correct async implementation. | correct async implementation. | ||||
| @@ -80,7 +80,7 @@ class Program | |||||
| private async Task MainAsync() | private async Task MainAsync() | ||||
| { | { | ||||
| // Centralize the logic for commands into a seperate method. | |||||
| // Centralize the logic for commands into a separate method. | |||||
| await InitCommands(); | await InitCommands(); | ||||
| // Login and connect. | // Login and connect. | ||||
| @@ -138,7 +138,7 @@ class Program | |||||
| var context = new SocketCommandContext(_client, msg); | var context = new SocketCommandContext(_client, msg); | ||||
| // Execute the command. (result does not indicate a return value, | // Execute the command. (result does not indicate a return value, | ||||
| // rather an object stating if the command executed succesfully). | |||||
| // rather an object stating if the command executed successfully). | |||||
| var result = await _commands.ExecuteAsync(context, pos, _services); | var result = await _commands.ExecuteAsync(context, pos, _services); | ||||
| // Uncomment the following lines if you want the bot | // Uncomment the following lines if you want the bot | ||||
| @@ -10,7 +10,7 @@ namespace Discord | |||||
| public static Optional<T> Unspecified => default(Optional<T>); | public static Optional<T> Unspecified => default(Optional<T>); | ||||
| private readonly T _value; | private readonly T _value; | ||||
| /// <summary> Gets the value for this paramter. </summary> | |||||
| /// <summary> Gets the value for this parameter. </summary> | |||||
| public T Value | public T Value | ||||
| { | { | ||||
| get | get | ||||
| @@ -48,8 +48,8 @@ namespace Discord.Rest | |||||
| string IChannel.Name => null; | string IChannel.Name => null; | ||||
| Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | ||||
| => Task.FromResult<IUser>(null); //Overriden | |||||
| => Task.FromResult<IUser>(null); //Overridden | |||||
| IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options) | IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options) | ||||
| => AsyncEnumerable.Empty<IReadOnlyCollection<IUser>>(); //Overriden | |||||
| => AsyncEnumerable.Empty<IReadOnlyCollection<IUser>>(); //Overridden | |||||
| } | } | ||||
| } | } | ||||
| @@ -154,14 +154,14 @@ namespace Discord.Rest | |||||
| => await RemovePermissionOverwriteAsync(user, options).ConfigureAwait(false); | => await RemovePermissionOverwriteAsync(user, options).ConfigureAwait(false); | ||||
| IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options) | IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options) | ||||
| => AsyncEnumerable.Empty<IReadOnlyCollection<IGuildUser>>(); //Overriden //Overriden in Text/Voice | |||||
| => AsyncEnumerable.Empty<IReadOnlyCollection<IGuildUser>>(); //Overridden //Overridden in Text/Voice | |||||
| Task<IGuildUser> IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | Task<IGuildUser> IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | ||||
| => Task.FromResult<IGuildUser>(null); //Overriden in Text/Voice | |||||
| => Task.FromResult<IGuildUser>(null); //Overridden in Text/Voice | |||||
| //IChannel | //IChannel | ||||
| IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options) | IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options) | ||||
| => AsyncEnumerable.Empty<IReadOnlyCollection<IUser>>(); //Overriden in Text/Voice | |||||
| => AsyncEnumerable.Empty<IReadOnlyCollection<IUser>>(); //Overridden in Text/Voice | |||||
| Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | ||||
| => Task.FromResult<IUser>(null); //Overriden in Text/Voice | |||||
| => Task.FromResult<IUser>(null); //Overridden in Text/Voice | |||||
| } | } | ||||
| } | } | ||||
| @@ -154,8 +154,8 @@ namespace Discord.WebSocket | |||||
| //IChannel | //IChannel | ||||
| IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options) | IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options) | ||||
| => ImmutableArray.Create<IReadOnlyCollection<IUser>>(Users).ToAsyncEnumerable(); //Overriden in Text/Voice | |||||
| => ImmutableArray.Create<IReadOnlyCollection<IUser>>(Users).ToAsyncEnumerable(); //Overridden in Text/Voice | |||||
| Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | ||||
| => Task.FromResult<IUser>(GetUser(id)); //Overriden in Text/Voice | |||||
| => Task.FromResult<IUser>(GetUser(id)); //Overridden in Text/Voice | |||||
| } | } | ||||
| } | } | ||||