Skip to content

Commit

Permalink
Merge pull request #51 from dassjosh/2.1-bug-fixes
Browse files Browse the repository at this point in the history
2.1 bug fixes
  • Loading branch information
dassjosh authored Aug 25, 2022
2 parents 7b8a051 + 484b0f6 commit 7058b14
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Oxide.Ext.Discord/DiscordClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class DiscordClient
{
internal static readonly Hash<string, DiscordClient> Clients = new Hash<string, DiscordClient>();

private static readonly Regex TokenValidator = new Regex(@"^[\w-]{24}\.[\w-]{6}\.[\w-]+$", RegexOptions.Compiled);
private static readonly Regex TokenValidator = new Regex(@"^[\w-]+\.[\w-]+\.[\w-]+$", RegexOptions.Compiled);

/// <summary>
/// Which plugin is the owner of this client
Expand Down
2 changes: 1 addition & 1 deletion Oxide.Ext.Discord/DiscordExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class DiscordExtension : Extension
/// <summary>
/// Version number of the extension
/// </summary>
private static readonly VersionNumber ExtensionVersion = new VersionNumber(2, 1, 5);
private static readonly VersionNumber ExtensionVersion = new VersionNumber(2, 1, 6);

/// <summary>
/// Global logger for areas that aren't part of a client connection
Expand Down
2 changes: 1 addition & 1 deletion Oxide.Ext.Discord/Entities/Api/RateLimit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class RateLimit
/// The number of seconds to wait before submitting another request.
/// </summary>
[JsonProperty("retry_after")]
public int RetryAfter { get; set; }
public float RetryAfter { get; set; }

/// <summary>
/// A value indicating if you are being globally rate limited or not
Expand Down
8 changes: 4 additions & 4 deletions Oxide.Ext.Discord/Oxide.Ext.Discord.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
<Version>2.0.3.0</Version>
<Version>2.1.6.0</Version>
<AssemblyName>Oxide.Ext.Discord</AssemblyName>
<Authors>Kirollos</Authors>
<Description>An Oxide extension for Discord.</Description>
<RepositoryUrl>https://github.com/Kirollos/Oxide.Ext.Discord</RepositoryUrl>
<TargetFrameworks>net46;net48</TargetFrameworks>
<LangVersion>7.0</LangVersion>
<PackageVersion>2.1.5.0</PackageVersion>
<AssemblyVersion>2.1.5</AssemblyVersion>
<FileVersion>2.1.5</FileVersion>
<PackageVersion>2.1.6.0</PackageVersion>
<AssemblyVersion>2.1.6</AssemblyVersion>
<FileVersion>2.1.6</FileVersion>
</PropertyGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup />
Expand Down
2 changes: 1 addition & 1 deletion Oxide.Ext.Discord/Rest/RateLimitHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class RateLimitHandler
/// </summary>
public RateLimitHandler()
{
_timer = new Timer(ResetInterval);
_timer = new Timer(ResetInterval * 1000);
_timer.Elapsed += ResetGlobal;
_timer.Start();
_lastReset = Time.TimeSinceEpoch();
Expand Down
1 change: 1 addition & 0 deletions Oxide.Ext.Discord/WebSockets/SocketListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@ private void HandleDispatchGuildMemberRemove(EventPayload payload)
if (member != null)
{
guild.Members.Remove(remove.User.Id);
_client.CallHook(DiscordExtHooks.OnDiscordGuildMemberRemoved, member, guild);
}

_logger.Verbose($"{nameof(SocketListener)}.{nameof(HandleDispatchGuildMemberRemove)} Guild ID: {remove.GuildId.ToString()} Guild Name: {guild.Name} User ID: {member?.User.Id.ToString()} User Name: {member?.User.GetFullUserName}");
Expand Down

0 comments on commit 7058b14

Please sign in to comment.