Browse Source

Merge branch 'master' of teknik.io:u/uncled1023/Combot

tags/3.0.4
Teknikode 4 years ago
parent
commit
3bb0513424
3 changed files with 20 additions and 14 deletions
  1. 17
    11
      Modules/Github/Github.cs
  2. 1
    1
      Modules/Github/Module.config
  3. 2
    2
      Modules/Owner Control/Owner_Control.cs

+ 17
- 11
Modules/Github/Github.cs View File

@@ -43,22 +43,29 @@ namespace Combot.Modules.Plugins
if (foundUser.TotalCount > 0)
{
User user = await github.User.Get(foundUser.Items.First().Login);
if (command.Arguments.ContainsKey("Repository ID"))
if (command.Arguments.ContainsKey("Repository"))
{
string repo = command.Arguments["Repository ID"];
Repository foundRepo = await github.Repository.Get(user.Login, repo);
if (foundRepo != null)
string repo = command.Arguments["Repository"];
try
{
string repoMessage = string.Format("\u0002{0}\u0002 | Created On \u0002{1}\u0002 | \u0002{2}\u0002 Open Issues | \u0002{3}\u0002 Forks | \u0002{4}\u0002 Stargazers | {5}", foundRepo.FullName, foundRepo.CreatedAt.ToString("d"), foundRepo.OpenIssuesCount, foundRepo.ForksCount, foundRepo.StargazersCount, foundRepo.HtmlUrl);
SendResponse(command.MessageType, command.Location, command.Nick.Nickname, repoMessage);
if (foundRepo.Description != string.Empty)
Repository foundRepo = await github.Repository.Get(user.Login, repo);
if (foundRepo != null)
{
SendResponse(command.MessageType, command.Location, command.Nick.Nickname, foundRepo.Description);
string repoMessage = string.Format("\u0002{0}\u0002 | Created On \u0002{1}\u0002 | \u0002{2}\u0002 Open Issues | \u0002{3}\u0002 Forks | \u0002{4}\u0002 Stargazers | {5}", foundRepo.FullName, foundRepo.CreatedAt.ToString("d"), foundRepo.OpenIssuesCount, foundRepo.ForksCount, foundRepo.StargazersCount, foundRepo.HtmlUrl);
SendResponse(command.MessageType, command.Location, command.Nick.Nickname, repoMessage);
if (foundRepo.Description != string.Empty)
{
SendResponse(command.MessageType, command.Location, command.Nick.Nickname, foundRepo.Description);
}
}
else
{
SendResponse(command.MessageType, command.Location, command.Nick.Nickname, "Invalid Repository Name");
}
}
else
catch (Octokit.NotFoundException ex)
{
SendResponse(command.MessageType, command.Location, command.Nick.Nickname, "Invalid Repository ID");
SendResponse(command.MessageType, command.Location, command.Nick.Nickname, "Invalid Repository Name");
}
}
else
@@ -79,7 +86,6 @@ namespace Combot.Modules.Plugins
catch (Octokit.ApiValidationException ex)
{
OnError(ex.Message);
return;
}
}


+ 1
- 1
Modules/Github/Module.config View File

@@ -29,7 +29,7 @@
"Required": false
},
{
"Name": "Repository ID",
"Name": "Repository",
"Description": "The repository you want information on.",
"AllowedValues": [],
"MessageTypes": [

+ 2
- 2
Modules/Owner Control/Owner_Control.cs View File

@@ -32,9 +32,9 @@ namespace Combot.Modules.Plugins
{
SendResponse(command.MessageType, command.Location, command.Nick.Nickname, "You are already identified as an owner.");
}
for (int i = 0; i < Bot.IRC.Channels.Count; i++)
foreach (Channel chan in Bot.IRC.Channels)
{
Nick foundNick = Bot.IRC.Channels[i].Nicks.Find(nick => nick.Nickname == command.Nick.Nickname);
Nick foundNick = chan.Nicks.Find(nick => nick.Nickname == command.Nick.Nickname);
if (foundNick != null)
{
foundNick.AddMode(UserMode.r);

Loading…
Cancel
Save