-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f29b4a4
commit 2f7f622
Showing
7 changed files
with
93 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ obj/* | |
/commands/moderation/Текстовый документ.txt | ||
/commands/other/Текстовый документ.txt | ||
/vk_config.json | ||
.vs/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.7.34009.444 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Discord Bot", "Discord Bot.csproj", "{BEEBAF4C-FDB2-4A66-B476-8E815E46A32E}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{BEEBAF4C-FDB2-4A66-B476-8E815E46A32E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{BEEBAF4C-FDB2-4A66-B476-8E815E46A32E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{BEEBAF4C-FDB2-4A66-B476-8E815E46A32E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{BEEBAF4C-FDB2-4A66-B476-8E815E46A32E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {69C65992-0D6A-4E77-966D-1F016F74FCEC} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace Discord_Bot.handlers | ||
{ | ||
internal class OnUserUpdated | ||
{ | ||
internal static Task onUpdate(Cacheable<SocketGuildUser, ulong> cacheable, SocketGuildUser user) | ||
{ | ||
if (!cacheable.Value.Roles.Equals(user.Roles)) { | ||
var roleChanges = cacheable.Value.Roles.Except(user.Roles); | ||
var data = Program.instance.userDatabase.GetUserData(user.Id).Result; | ||
|
||
foreach (var role in roleChanges) | ||
{ | ||
data.UserRoles.Add(role.Id); | ||
} | ||
|
||
Program.instance.userDatabase.ModifyUserData(user.Id, data); | ||
} | ||
|
||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters