Fixed a lot of the thigs that Visual Studio was whining about. Suppressed a few warnings. Added supression to unused variable warnings to each file.
This commit is contained in:
1 parent
b2d6cff5ed
commit
843261cf68
11 files changed
+53
-41
No files matched your search
@@ -34,13 +34,15 @@ namespace StarsiegeBot
|
|||||||
{
|
{
|
||||||
// Since we need to creat it, we're going to set some default stuff.
|
// Since we need to creat it, we're going to set some default stuff.
|
||||||
Console.Write("Guild Settings Config File Not Found. Creating One...");
|
Console.Write("Guild Settings Config File Not Found. Creating One...");
|
||||||
GuildSettings item = new GuildSettings();
|
GuildSettings item = new GuildSettings
|
||||||
item.UseAutoRoles = false;
|
{
|
||||||
item.UseGlobalPrefix = true;
|
UseAutoRoles = false,
|
||||||
item.UseLevelRoles = false;
|
UseGlobalPrefix = true,
|
||||||
item.UseLevels = false;
|
UseLevelRoles = false,
|
||||||
item.UseSelfRoles = false;
|
UseLevels = false,
|
||||||
item.AllowRolesPurchase = false;
|
UseSelfRoles = false,
|
||||||
|
AllowRolesPurchase = false
|
||||||
|
};
|
||||||
item.UseAutoRoles = false;
|
item.UseAutoRoles = false;
|
||||||
item.LevelRoles = new Dictionary<int, List<DiscordRole>>();
|
item.LevelRoles = new Dictionary<int, List<DiscordRole>>();
|
||||||
item.Prefixes = new List<string>();
|
item.Prefixes = new List<string>();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace StarsiegeBot
|
|||||||
private readonly Random rnd = new Random();
|
private readonly Random rnd = new Random();
|
||||||
|
|
||||||
// start: neo wanted this shit....
|
// start: neo wanted this shit....
|
||||||
private string[] insult = {
|
private readonly string[] insult = {
|
||||||
"> {0} slaps {1} around a bit with a large trout.",
|
"> {0} slaps {1} around a bit with a large trout.",
|
||||||
"> {0} puts a jellyfish on {1}'s head.",
|
"> {0} puts a jellyfish on {1}'s head.",
|
||||||
"> {0} slaps {1} around a bit with the mustache of Caanon.",
|
"> {0} slaps {1} around a bit with the mustache of Caanon.",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
#pragma warning disable IDE0060 // Remove unused parameter
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -15,7 +16,6 @@ using DSharpPlus.VoiceNext;
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
#pragma warning disable IDE0060 // Remove unused parameter
|
|
||||||
namespace StarsiegeBot
|
namespace StarsiegeBot
|
||||||
{
|
{
|
||||||
class Triggers
|
class Triggers
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// This file is used by Code Analysis to maintain SuppressMessage
|
||||||
|
// attributes that are applied to this project.
|
||||||
|
// Project-level suppressions either have no target or are given
|
||||||
|
// a specific target and scoped to a namespace, type, member, etc.
|
||||||
|
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
|
[assembly: SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression", Justification = "<Pending>")]
|
||||||
@@ -86,7 +86,7 @@ namespace StarsiegeBot
|
|||||||
public async Task EditGroup(CommandContext ctx, [RemainingText] string groupInfo)
|
public async Task EditGroup(CommandContext ctx, [RemainingText] string groupInfo)
|
||||||
{
|
{
|
||||||
await ctx.TriggerTypingAsync();
|
await ctx.TriggerTypingAsync();
|
||||||
string gId = ctx.Guild.Id.ToString();
|
// string gId = ctx.Guild.Id.ToString();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
#pragma warning disable IDE0060 // Remove unused parameter
|
||||||
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
#pragma warning disable IDE0060 // Remove unused parameter
|
||||||
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
#pragma warning disable IDE0060 // Remove unused parameter
|
||||||
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ namespace StarsiegeBot
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Command("toggle"), Aliases("t")]
|
[Command("toggle"), Aliases("t")]
|
||||||
[RequireOwner]
|
[RequireOwner]
|
||||||
public async Task ToggleDM(CommandContext ctx, [RemainingText] string isEnabled = null)
|
public async Task ToggleDM(CommandContext ctx, [RemainingText] string isEnabled = null)
|
||||||
@@ -88,7 +87,7 @@ namespace StarsiegeBot
|
|||||||
|
|
||||||
isEnabled = isEnabled.ToLower();
|
isEnabled = isEnabled.ToLower();
|
||||||
|
|
||||||
string output = "";
|
string output;
|
||||||
|
|
||||||
string[] turnOn = { "on", "true", "1" };
|
string[] turnOn = { "on", "true", "1" };
|
||||||
string[] turnOff = { "off", "false", "0" };
|
string[] turnOff = { "off", "false", "0" };
|
||||||
@@ -136,8 +135,8 @@ namespace StarsiegeBot
|
|||||||
// if there is no target, we're going to "kill" the author.
|
// if there is no target, we're going to "kill" the author.
|
||||||
if (target == null)
|
if (target == null)
|
||||||
{
|
{
|
||||||
int choice = rnd.Next(0, dmLines.generic.Length);
|
int choice = rnd.Next(0, dmLines.Generic.Length);
|
||||||
line = dmLines.generic[choice];
|
line = dmLines.Generic[choice];
|
||||||
await ctx.RespondAsync(string.Format(line, ctx.Message.Author.Mention));
|
await ctx.RespondAsync(string.Format(line, ctx.Message.Author.Mention));
|
||||||
}
|
}
|
||||||
// we have a valid target... Have the bot kill them.
|
// we have a valid target... Have the bot kill them.
|
||||||
@@ -149,14 +148,14 @@ namespace StarsiegeBot
|
|||||||
if (opt == 1)
|
if (opt == 1)
|
||||||
{
|
{
|
||||||
// Pick an Active death message at random, and set our output to it.
|
// Pick an Active death message at random, and set our output to it.
|
||||||
int choice = rnd.Next(0, dmLines.active.Length);
|
int choice = rnd.Next(0, dmLines.Active.Length);
|
||||||
line = dmLines.active[choice];
|
line = dmLines.Active[choice];
|
||||||
}
|
}
|
||||||
else if (opt == 2)
|
else if (opt == 2)
|
||||||
{
|
{
|
||||||
// We picked a Passive death message type. Pick the exact line at random. Set it to the output.
|
// We picked a Passive death message type. Pick the exact line at random. Set it to the output.
|
||||||
int choice = rnd.Next(0, dmLines.passive.Length);
|
int choice = rnd.Next(0, dmLines.Passive.Length);
|
||||||
line = dmLines.passive[choice];
|
line = dmLines.Passive[choice];
|
||||||
}
|
}
|
||||||
// Give the selected death message to the user.
|
// Give the selected death message to the user.
|
||||||
await ctx.RespondAsync(string.Format(line, ctx.Message.Author.Mention, target.Mention));
|
await ctx.RespondAsync(string.Format(line, ctx.Message.Author.Mention, target.Mention));
|
||||||
@@ -177,7 +176,7 @@ namespace StarsiegeBot
|
|||||||
// We're typing here!
|
// We're typing here!
|
||||||
await ctx.TriggerTypingAsync();
|
await ctx.TriggerTypingAsync();
|
||||||
// List all the types of Death Message types, and how many we have of each one.
|
// List all the types of Death Message types, and how many we have of each one.
|
||||||
await ctx.RespondAsync($"\r\nActive: {dmLines.active.Length}\r\nPassive: {dmLines.passive.Length}\r\nGeneric: {dmLines.generic.Length}");
|
await ctx.RespondAsync($"\r\nActive: {dmLines.Active.Length}\r\nPassive: {dmLines.Passive.Length}\r\nGeneric: {dmLines.Generic.Length}");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("Add")]
|
[Command("Add")]
|
||||||
@@ -197,10 +196,10 @@ namespace StarsiegeBot
|
|||||||
// Message the owner know some one wants to add a new death message, along with a code block to that message.
|
// Message the owner know some one wants to add a new death message, along with a code block to that message.
|
||||||
|
|
||||||
// if the Queue is null, make it exist.
|
// if the Queue is null, make it exist.
|
||||||
if (dmLines.queue is null)
|
if (dmLines.Queue is null)
|
||||||
dmLines.queue = new List<string>();
|
dmLines.Queue = new List<string>();
|
||||||
// add the message to the queue list.
|
// add the message to the queue list.
|
||||||
dmLines.queue.Add(msg);
|
dmLines.Queue.Add(msg);
|
||||||
// Store the new stuff to file...
|
// Store the new stuff to file...
|
||||||
await StoreDeathMessages();
|
await StoreDeathMessages();
|
||||||
// Tell the person that the message has been added to a 'queue'.
|
// Tell the person that the message has been added to a 'queue'.
|
||||||
@@ -230,27 +229,27 @@ namespace StarsiegeBot
|
|||||||
using StreamWriter file = new StreamWriter("deathmessages.cs");
|
using StreamWriter file = new StreamWriter("deathmessages.cs");
|
||||||
|
|
||||||
// Write out the total lines for each. Requirement for Starsiege.
|
// Write out the total lines for each. Requirement for Starsiege.
|
||||||
await file.WriteLineAsync($"$deathMessage::genericCount = {dmLines.generic.Length};");
|
await file.WriteLineAsync($"$deathMessage::genericCount = {dmLines.Generic.Length};");
|
||||||
await file.WriteLineAsync($"$deathMessage::activeCount = {dmLines.active.Length};");
|
await file.WriteLineAsync($"$deathMessage::activeCount = {dmLines.Active.Length};");
|
||||||
await file.WriteLineAsync($"$deathMessage::passiveCount = {dmLines.passive.Length};\r\n");
|
await file.WriteLineAsync($"$deathMessage::passiveCount = {dmLines.Passive.Length};\r\n");
|
||||||
|
|
||||||
// Set count to 0. Iterate over each type of Death Message, and put it into the file.
|
// Set count to 0. Iterate over each type of Death Message, and put it into the file.
|
||||||
int count = 0;
|
int count = 0;
|
||||||
foreach (string death in dmLines.generic)
|
foreach (string death in dmLines.Generic)
|
||||||
{
|
{
|
||||||
await file.WriteLineAsync(string.Format($"$deathMessage::generic{count} = \"{death}\";", "%s", "%s"));
|
await file.WriteLineAsync(string.Format($"$deathMessage::generic{count} = \"{death}\";", "%s", "%s"));
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
// Reset the count...
|
// Reset the count...
|
||||||
count = 0;
|
count = 0;
|
||||||
foreach (string death in dmLines.active)
|
foreach (string death in dmLines.Active)
|
||||||
{
|
{
|
||||||
await file.WriteLineAsync(string.Format($"$deathMessage::active{count} = \"{death}\";", "%s", "%s"));
|
await file.WriteLineAsync(string.Format($"$deathMessage::active{count} = \"{death}\";", "%s", "%s"));
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
// Reset the count one last time...
|
// Reset the count one last time...
|
||||||
count = 0;
|
count = 0;
|
||||||
foreach (string death in dmLines.passive)
|
foreach (string death in dmLines.Passive)
|
||||||
{
|
{
|
||||||
await file.WriteLineAsync(string.Format($"$deathMessage::passive{count} = \"{death}\";", "%s", "%s"));
|
await file.WriteLineAsync(string.Format($"$deathMessage::passive{count} = \"{death}\";", "%s", "%s"));
|
||||||
count++;
|
count++;
|
||||||
@@ -283,14 +282,14 @@ namespace StarsiegeBot
|
|||||||
class DeathMessageLines
|
class DeathMessageLines
|
||||||
{
|
{
|
||||||
[JsonProperty("active")]
|
[JsonProperty("active")]
|
||||||
public string[] active { get; set; }
|
public string[] Active { get; set; }
|
||||||
[JsonProperty("passive")]
|
[JsonProperty("passive")]
|
||||||
public string[] passive { get; set; }
|
public string[] Passive { get; set; }
|
||||||
[JsonProperty("generic")]
|
[JsonProperty("generic")]
|
||||||
public string[] generic { get; set; }
|
public string[] Generic { get; set; }
|
||||||
|
[JsonProperty("flagged")]
|
||||||
public List<String> flagged { get; set; }
|
public List<String> Flagged { get; set; }
|
||||||
|
[JsonProperty("queue")]
|
||||||
public List<String> queue { get; set; }
|
public List<String> Queue { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -144,7 +144,7 @@ namespace StarsiegeBot
|
|||||||
|
|
||||||
isEnabled = isEnabled.ToLower();
|
isEnabled = isEnabled.ToLower();
|
||||||
|
|
||||||
string output = "";
|
string;
|
||||||
|
|
||||||
string[] turnOn = { "on", "true", "1" };
|
string[] turnOn = { "on", "true", "1" };
|
||||||
string[] turnOff = { "off", "false", "0" };
|
string[] turnOff = { "off", "false", "0" };
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ namespace StarsiegeBot
|
|||||||
{
|
{
|
||||||
await ctx.TriggerTypingAsync();
|
await ctx.TriggerTypingAsync();
|
||||||
isEnabled = isEnabled.ToLower();
|
isEnabled = isEnabled.ToLower();
|
||||||
string output = "";
|
string output;
|
||||||
string[] turnOn = { "on", "true", "1" };
|
string[] turnOn = { "on", "true", "1" };
|
||||||
string[] turnOff = { "off", "false", "0" };
|
string[] turnOff = { "off", "false", "0" };
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user