Skip to content

Commit ba4624e

Browse files
committed
This is V2.
1 parent 153913f commit ba4624e

37 files changed

+63
-69
lines changed

Volte/Core/Extensions/HttpExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ namespace Volte.Core.Extensions {
44
public static class HttpExtensions {
55
public static bool IsImage(this HttpResponseMessage msg) {
66
var mime = msg.Content.Headers.ContentType.MediaType;
7-
return mime.Equals("image/png")
8-
|| mime.Equals("image/jpeg")
9-
|| mime.Equals("image.gif");
7+
return mime.EqualsIgnoreCase("image/png")
8+
|| mime.EqualsIgnoreCase("image/jpeg")
9+
|| mime.EqualsIgnoreCase("image.gif");
1010
}
1111
}
1212
}

Volte/Core/Extensions/StringExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@ public static class StringExtensions {
55
public static bool EqualsIgnoreCase(this string str, string str2) {
66
return str.Equals(str2, StringComparison.CurrentCultureIgnoreCase);
77
}
8+
9+
public static bool ContainsIgnoreCase(this string str, string str2) {
10+
return str.Contains(str2, StringComparison.CurrentCultureIgnoreCase);
11+
}
812
}
913
}

Volte/Core/Modules/Admin/AddRoleCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public partial class AdminModule : VolteModule {
1313
[Remarks("Usage: |prefix|addrole {@user} {roleName}")]
1414
public async Task AddRole(SocketGuildUser user, [Remainder] string role) {
1515
if (!UserUtils.IsAdmin(Context)) {
16-
await React(Context.SMessage, RawEmoji.X);
16+
await Context.ReactFailure();
1717
return;
1818
}
1919

Volte/Core/Modules/Admin/AdminRoleCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public partial class AdminModule : VolteModule {
1313
[Remarks("Usage: |prefix|adminrole {roleName}")]
1414
public async Task AdminRole([Remainder] string roleName) {
1515
if (!UserUtils.IsGuildOwner(Context)) {
16-
await React(Context.SMessage, RawEmoji.X);
16+
await Context.ReactFailure();
1717
return;
1818
}
1919
var embed = CreateEmbed(Context, string.Empty).ToEmbedBuilder();

Volte/Core/Modules/Admin/AntilinkCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public partial class AdminModule : VolteModule {
1111
[Remarks("Usage: |prefix|antilink {true|false}")]
1212
public async Task Antilink(bool alIsEnabled) {
1313
if (!UserUtils.IsAdmin(Context)) {
14-
await React(Context.SMessage, RawEmoji.X);
14+
await Context.ReactFailure();
1515
return;
1616
}
1717

Volte/Core/Modules/Admin/AutoroleCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public partial class AdminModule : VolteModule {
1313
[Remarks("Usage: |prefix|autorole {roleName}")]
1414
public async Task Autorole([Remainder]string role) {
1515
if (!UserUtils.IsAdmin(Context)) {
16-
await React(Context.SMessage, RawEmoji.X);
16+
await Context.ReactFailure();
1717
return;
1818
}
1919

Volte/Core/Modules/Admin/BlacklistCommands.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public partial class AdminModule : VolteModule {
1313
[Remarks("Usage: |prefix|blacklistadd {phrase}")]
1414
public async Task BlacklistAdd([Remainder] string arg) {
1515
if (!UserUtils.IsAdmin(Context)) {
16-
await React(Context.SMessage, RawEmoji.X);
16+
await Context.ReactFailure();
1717
return;
1818
}
1919

@@ -29,7 +29,7 @@ public async Task BlacklistAdd([Remainder] string arg) {
2929
[Remarks("Usage: |prefix|blacklistremove {phrase}")]
3030
public async Task BlacklistRemove([Remainder] string arg) {
3131
if (!UserUtils.IsAdmin(Context)) {
32-
await React(Context.SMessage, RawEmoji.X);
32+
await Context.ReactFailure();
3333
return;
3434
}
3535

@@ -51,7 +51,7 @@ await Context.Channel.SendMessageAsync(string.Empty, false,
5151
[Remarks("Usage: |prefix|blacklistclear")]
5252
public async Task BlacklistClear() {
5353
if (!UserUtils.IsAdmin(Context)) {
54-
await React(Context.SMessage, RawEmoji.X);
54+
await Context.ReactFailure();
5555
return;
5656
}
5757

Volte/Core/Modules/Admin/CustomCommandCommands.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public partial class AdminModule : VolteModule {
1212
[Remarks("Usage: |prefix|customcommandadd {cmdName} {cmdResponse}")]
1313
public async Task CustomCommandAdd(string name, [Remainder] string response) {
1414
if (!UserUtils.IsAdmin(Context)) {
15-
await React(Context.SMessage, RawEmoji.X);
15+
await Context.ReactFailure();
1616
return;
1717
}
1818

@@ -33,7 +33,7 @@ await Context.Channel.SendMessageAsync(string.Empty, false,
3333
[Remarks("Usage: |prefix|customcommandrem {cmdName}")]
3434
public async Task CustomCommandRem(string cmdName) {
3535
if (!UserUtils.IsAdmin(Context)) {
36-
await React(Context.SMessage, RawEmoji.X);
36+
await Context.ReactFailure();
3737
return;
3838
}
3939
var config = Db.GetConfig(Context.Guild);
@@ -57,7 +57,7 @@ public async Task CustomCommandRem(string cmdName) {
5757
[Remarks("Usage: |prefix|customcommandclear")]
5858
public async Task CustomCommandClear() {
5959
if (!UserUtils.IsAdmin(Context)) {
60-
await React(Context.SMessage, RawEmoji.X);
60+
await Context.ReactFailure();
6161
return;
6262
}
6363

Volte/Core/Modules/Admin/DebugCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public partial class AdminModule : VolteModule {
1414
[Remarks("Usage: |prefix|debug")]
1515
public async Task Debug() {
1616
if (!UserUtils.IsAdmin(Context)) {
17-
await React(Context.SMessage, RawEmoji.X);
17+
await Context.ReactFailure();
1818
return;
1919
}
2020

Volte/Core/Modules/Admin/DeleteMessageOnCommandCommand.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ public partial class AdminModule : VolteModule {
1212
public async Task DeleteMessageOnCommand(bool arg) {
1313
var config = Db.GetConfig(Context.Guild);
1414
if (!UserUtils.IsAdmin(Context)) {
15-
await React(Context.SMessage, RawEmoji.X);
15+
await Context.ReactFailure();
16+
return;
1617
}
1718

1819
config.DeleteMessageOnCommand = arg;

0 commit comments

Comments
 (0)