Removing role from discord

Lets say someone boost your discord i got role on discord Boosters, if user boost my discord server it will get oxide group role on discord "Boosters" and role on server "boosters" , when the boost is ended it automatically remove the role from discord "Boosters" but on server they still are in the group "boosters" and i want to be removed on server too not only on discord.

Do i need to make other changes?

{
  "Sync Nicknames": false,
  "Sync Data": [
    {
      "Oxide Group": "boosters",
      "Discord Role (Name or Id)": "815742654678564874",
      "Sync Source (Umod or Discord)": "Discord",
      "Sync Notification Settings": {
        "Send message to Server": false,
        "Send Message To Discord": false,
        "Discord Message Channel (Name or ID)": "",
        "Send Message When Added": false,
        "Send Message When Removed": false,
        "Server Message Added Override Message": "",
        "Server Message Removed Override Message": "",
        "Discord Message Added Override Message": "",
        "Discord Message Removed Override Message": ""
      }
    }
  ]
  "Debug Level (None, Error, Warning, Info)": "Info"
}

 

 

They should be removed automatically from the group either on plugin reload or when they reconnect to the server after the role has been removed. Can you reload the plugin and when it processes for that player send the log it produces here. I see you have debug level as Info so you should see a lot of output for it.

it works only if i reload the plugin.

 

Unloaded plugin Discord Core Roles v1.3.0 by MJSU
Loaded plugin Discord Core Roles v1.3.0 by MJSU

[Discord Core Roles] Info: OnDiscordCoreJoin Added Tipical Gmaer(76561############) to be processed
[Discord Core Roles] Info: Discord_GuildMemberUpdate Added (Rasmin) to be processed
[Discord Core Roles] Info: Start processing: Player Id: 76561############ Discord Id: 808666713306300456 Is Leaving: False
[Discord Core Roles] Info: Checking player Tipical Gmaer (76561############) Discord: 808666713306300456
[Discord Core Roles] Info: Processing Oxide for Tipical Gmaer(76561############) Discord ID: 808666713306300456 Is Leaving False
[Discord Core Roles] Info: Processing Discord for Tipical Gmaer (76561############) Is Leaving False
[Discord Core Roles] Info: Tipical Gmaer skipping Discord Sync: [test123(821779061566865438)] -> test123 Doesn't have role
[Discord Core Roles] Info: Discord_GuildMemberUpdate Added (Rasmin) to be processed
[Discord Core Roles] Info: Start processing: Player Id: 76561############ Discord Id: 808666713306300456 Is Leaving: False
[Discord Core Roles] Info: Checking player Tipical Gmaer (76561############) Discord: 808666713306300456
[Discord Core Roles] Info: Processing Oxide for Tipical Gmaer(76561############) Discord ID: 808666713306300456 Is Leaving False
[Discord Core Roles] Info: Processing Discord for Tipical Gmaer (76561############) Is Leaving False
[Discord Core Roles] Message: Adding player Tipical Gmaer(76561############) to oxide group test123
Unloaded plugin Discord Core Roles v1.3.0 by MJSU
Loaded plugin Discord Core Roles v1.3.0 by MJSU
[Discord Core Roles] Info: Checking player Tipical Gmaer (76561############) Discord: 808666713306300456
[Discord Core Roles] Info: Processing Oxide for Tipical Gmaer(76561############) Discord ID: 808666713306300456 Is Leaving False
[Discord Core Roles] Info: Processing Discord for Tipical Gmaer (76561############) Is Leaving False
[Discord Core Roles] Message: Removing player Tipical Gmaer(76561############) from oxide group test123

I think I found the issue. Can you please try version 1.3.1 and let me know if it solved it.

Sorry for late respond i test the new version and when they boost the server it will add on oxide group to, when it end the boost from discord on oxide group will still remain but when the player is joining or reconnect it will automatically check the role from discord and it will be removed.

So i think it should work.



Merged post

got error when i want to send message 

(14:43:02) | [Discord Core Roles] Lang Key 'ServerMessageOxideGroupAdded' threw exception:
System.FormatException: Input string was not in a correct format.
  at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x000ae] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00023] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.String.Format (System.String format, System.Object[] args) [0x00020] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at Oxide.Plugins.DiscordCoreRoles.Lang (System.String key, Oxide.Core.Libraries.Covalence.IPlayer player, System.Object[] args) [0x0001c] in <7cf7356aaaf144b4ae1c0375b69f85b2>:0
(14:43:02) | [Discord Extension] [Exception]: Request callback raised an exception (FormatException: Input string was not in a correct format.)
  at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x000ae] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00023] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.String.Format (System.String format, System.Object[] args) [0x00020] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at Oxide.Plugins.DiscordCoreRoles.Lang (System.String key, Oxide.Core.Libraries.Covalence.IPlayer player, System.Object[] args) [0x00041] in <7cf7356aaaf144b4ae1c0375b69f85b2>:0 
  at Oxide.Plugins.DiscordCoreRoles.GetServerMessage (Oxide.Plugins.DiscordCoreRoles+SyncData sync, System.Boolean wasAdded) [0x000be] in <7cf7356aaaf144b4ae1c0375b69f85b2>:0 
  at Oxide.Plugins.DiscordCoreRoles.SendSyncNotification (System.String playerId, System.String discordId, Oxide.Plugins.DiscordCoreRoles+SyncData sync, System.Boolean wasAdded) [0x0004f] in <7cf7356aaaf144b4ae1c0375b69f85b2>:0 
  at Oxide.Plugins.DiscordCoreRoles.HandleDiscordRoles (System.String playerId, System.String discordId, System.Boolean isLeaving, Oxide.Ext.Discord.DiscordObjects.GuildMember member) [0x001d2] in <7cf7356aaaf144b4ae1c0375b69f85b2>:0 
  at Oxide.Plugins.DiscordCoreRoles.HandleUser (System.String playerId, System.String discordId, System.Boolean isLeaving, Oxide.Ext.Discord.DiscordObjects.GuildMember member) [0x00055] in <7cf7356aaaf144b4ae1c0375b69f85b2>:0 
  at Oxide.Plugins.DiscordCoreRoles+<ProcessNextStartupId>c__AnonStorey0.<>m__0 (Oxide.Ext.Discord.DiscordObjects.GuildMember member) [0x00000] in <7cf7356aaaf144b4ae1c0375b69f85b2>:0 
  at Oxide.Ext.Discord.REST.RestHandler+<>c__DisplayClass9_0`1[T].<DoRequest>b__0 (Oxide.Ext.Discord.REST.RestResponse response) [0x00013] in <62c756091a3144dfa2c3b28ad5ea06ab>:0 
  at Oxide.Ext.Discord.REST.Request.Fire (Oxide.Ext.Discord.REST.Bucket bucket) [0x000ef] in <62c756091a3144dfa2c3b28ad5ea06ab>:0


Merged post

If they leave the discord, the oxide group wil not delete.

Merged post

error from member to be removed

(17:25:42) | Failed to call hook 'Discord_MemberRemoved' on plugin 'DiscordCoreRoles v1.3.0' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.DiscordCoreRoles.Discord_MemberRemoved (Oxide.Ext.Discord.DiscordObjects.GuildMember member) [0x00000] in <3e6af4d0fd3241d3adc996a4a4080ff7>:0 
  at Oxide.Plugins.DiscordCoreRoles.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x0072b] in <3e6af4d0fd3241d3adc996a4a4080ff7>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <3606d2af539c45e4b5c61658e6a8b307>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <c2afd8354b8b4f3ca451cf5a1aa111c3>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <c2afd8354b8b4f3ca451cf5a1aa111c3>:0

This looks like more of an issue with the Discord Extension sending a null GuildMember. Do you have "Server Members Intent" and "Presence Intent" enabled for your bot?

Yes i have it

Alright, I added some null checking in that spot. Not sure why it's null but should be handled now.

testing right away the plugin