Browse Source

lint: refactor SlowMode -> SlowModeInterval

this was the name change i always wanted
tags/2.0
Christopher F 6 years ago
parent
commit
232f525b59
8 changed files with 11 additions and 11 deletions
  1. +1
    -1
      src/Discord.Net.Core/Entities/Channels/ITextChannel.cs
  2. +1
    -1
      src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs
  3. +1
    -1
      src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs
  4. +2
    -2
      src/Discord.Net.Rest/DiscordRestApiClient.cs
  5. +1
    -1
      src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs
  6. +2
    -2
      src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs
  7. +1
    -1
      src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs
  8. +2
    -2
      src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs

+ 1
- 1
src/Discord.Net.Core/Entities/Channels/ITextChannel.cs View File

@@ -14,7 +14,7 @@ namespace Discord
string Topic { get; }

///<summary> Gets the current slow-mode delay for this channel. 0 if disabled. </summary>
int SlowMode { get; }
int SlowModeInterval { get; }

/// <summary> Bulk deletes multiple messages. </summary>
Task DeleteMessagesAsync(IEnumerable<IMessage> messages, RequestOptions options = null);


+ 1
- 1
src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs View File

@@ -22,6 +22,6 @@ namespace Discord
/// Users with <see cref="ChannelPermission.ManageMessages"/> will be exempt from slow-mode.
/// </remarks>
/// <exception cref="ArgumentOutOfRangeException">Throws ArgummentOutOfRange if the value does not fall within [0, 120]</exception>
public Optional<int> SlowMode { get; set; }
public Optional<int> SlowModeInterval { get; set; }
}
}

+ 1
- 1
src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs View File

@@ -11,6 +11,6 @@ namespace Discord.API.Rest
[JsonProperty("nsfw")]
public Optional<bool> IsNsfw { get; set; }
[JsonProperty("rate_limit_per_user")]
public Optional<int> SlowMode { get; set; }
public Optional<int> SlowModeInterval { get; set; }
}
}

+ 2
- 2
src/Discord.Net.Rest/DiscordRestApiClient.cs View File

@@ -356,8 +356,8 @@ namespace Discord.API
Preconditions.NotNull(args, nameof(args));
Preconditions.AtLeast(args.Position, 0, nameof(args.Position));
Preconditions.NotNullOrEmpty(args.Name, nameof(args.Name));
Preconditions.AtLeast(args.SlowMode, 0, nameof(args.SlowMode));
Preconditions.AtMost(args.SlowMode, 120, nameof(args.SlowMode));
Preconditions.AtLeast(args.SlowModeInterval, 0, nameof(args.SlowModeInterval));
Preconditions.AtMost(args.SlowModeInterval, 120, nameof(args.SlowModeInterval));
options = RequestOptions.CreateOrClone(options);

var ids = new BucketIds(channelId: channelId);


+ 1
- 1
src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs View File

@@ -46,7 +46,7 @@ namespace Discord.Rest
CategoryId = args.CategoryId,
Topic = args.Topic,
IsNsfw = args.IsNsfw,
SlowMode = args.SlowMode,
SlowModeInterval = args.SlowModeInterval,
};
return await client.ApiClient.ModifyGuildChannelAsync(channel.Id, apiArgs, options).ConfigureAwait(false);
}


+ 2
- 2
src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs View File

@@ -12,7 +12,7 @@ namespace Discord.Rest
public class RestTextChannel : RestGuildChannel, IRestMessageChannel, ITextChannel
{
public string Topic { get; private set; }
public int SlowMode { get; private set; }
public int SlowModeInterval { get; private set; }
public ulong? CategoryId { get; private set; }

public string Mention => MentionUtils.MentionChannel(Id);
@@ -35,7 +35,7 @@ namespace Discord.Rest
base.Update(model);
CategoryId = model.CategoryId;
Topic = model.Topic.Value;
SlowMode = model.SlowMode.Value;
SlowModeInterval = model.SlowMode.Value;
_nsfw = model.Nsfw.GetValueOrDefault();
}



+ 1
- 1
src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs View File

@@ -156,7 +156,7 @@ namespace Discord.Rest
{
CategoryId = props.CategoryId,
Topic = props.Topic,
IsNsfw = props.IsNsfw
IsNsfw = props.IsNsfw,
};
var model = await client.ApiClient.CreateGuildChannelAsync(guild.Id, args, options).ConfigureAwait(false);
return RestTextChannel.Create(client, guild, model);


+ 2
- 2
src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs View File

@@ -16,7 +16,7 @@ namespace Discord.WebSocket
private readonly MessageCache _messages;

public string Topic { get; private set; }
public int SlowMode { get; private set; }
public int SlowModeInterval { get; private set; }
public ulong? CategoryId { get; private set; }
public ICategoryChannel Category
=> CategoryId.HasValue ? Guild.GetChannel(CategoryId.Value) as ICategoryChannel : null;
@@ -48,7 +48,7 @@ namespace Discord.WebSocket
base.Update(state, model);
CategoryId = model.CategoryId;
Topic = model.Topic.Value;
SlowMode = model.SlowMode.GetValueOrDefault(); // some guilds haven't been patched to include this yet?
SlowModeInterval = model.SlowMode.GetValueOrDefault(); // some guilds haven't been patched to include this yet?
_nsfw = model.Nsfw.GetValueOrDefault();
}



Loading…
Cancel
Save