diff --git a/Oxide.Ext.Discord/DiscordClient.cs b/Oxide.Ext.Discord/DiscordClient.cs index 7e87d0cd3..5302f6bf6 100644 --- a/Oxide.Ext.Discord/DiscordClient.cs +++ b/Oxide.Ext.Discord/DiscordClient.cs @@ -19,7 +19,7 @@ public class DiscordClient { internal static readonly Hash Clients = new Hash(); - 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); /// /// Which plugin is the owner of this client diff --git a/Oxide.Ext.Discord/DiscordExtension.cs b/Oxide.Ext.Discord/DiscordExtension.cs index 223e862c4..15bebe0ad 100644 --- a/Oxide.Ext.Discord/DiscordExtension.cs +++ b/Oxide.Ext.Discord/DiscordExtension.cs @@ -34,7 +34,7 @@ public class DiscordExtension : Extension /// /// Version number of the extension /// - private static readonly VersionNumber ExtensionVersion = new VersionNumber(2, 1, 5); + private static readonly VersionNumber ExtensionVersion = new VersionNumber(2, 1, 6); /// /// Global logger for areas that aren't part of a client connection diff --git a/Oxide.Ext.Discord/Entities/Api/RateLimit.cs b/Oxide.Ext.Discord/Entities/Api/RateLimit.cs index 80d3db285..96b19f968 100644 --- a/Oxide.Ext.Discord/Entities/Api/RateLimit.cs +++ b/Oxide.Ext.Discord/Entities/Api/RateLimit.cs @@ -18,7 +18,7 @@ public class RateLimit /// The number of seconds to wait before submitting another request. /// [JsonProperty("retry_after")] - public int RetryAfter { get; set; } + public float RetryAfter { get; set; } /// /// A value indicating if you are being globally rate limited or not diff --git a/Oxide.Ext.Discord/Oxide.Ext.Discord.csproj b/Oxide.Ext.Discord/Oxide.Ext.Discord.csproj index b37ab2ad8..f06d25143 100644 --- a/Oxide.Ext.Discord/Oxide.Ext.Discord.csproj +++ b/Oxide.Ext.Discord/Oxide.Ext.Discord.csproj @@ -2,16 +2,16 @@ - 2.0.3.0 + 2.1.6.0 Oxide.Ext.Discord Kirollos An Oxide extension for Discord. https://github.com/Kirollos/Oxide.Ext.Discord net46;net48 7.0 - 2.1.5.0 - 2.1.5 - 2.1.5 + 2.1.6.0 + 2.1.6 + 2.1.6 diff --git a/Oxide.Ext.Discord/Rest/RateLimitHandler.cs b/Oxide.Ext.Discord/Rest/RateLimitHandler.cs index f9173de40..614d1299b 100644 --- a/Oxide.Ext.Discord/Rest/RateLimitHandler.cs +++ b/Oxide.Ext.Discord/Rest/RateLimitHandler.cs @@ -29,7 +29,7 @@ public class RateLimitHandler /// public RateLimitHandler() { - _timer = new Timer(ResetInterval); + _timer = new Timer(ResetInterval * 1000); _timer.Elapsed += ResetGlobal; _timer.Start(); _lastReset = Time.TimeSinceEpoch(); diff --git a/Oxide.Ext.Discord/WebSockets/SocketListener.cs b/Oxide.Ext.Discord/WebSockets/SocketListener.cs index 54ac8ff7c..685f9d44c 100644 --- a/Oxide.Ext.Discord/WebSockets/SocketListener.cs +++ b/Oxide.Ext.Discord/WebSockets/SocketListener.cs @@ -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}");