mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-20 00:43:36 +03:00
Minor changes
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
bef48237a9
commit
1cd309e498
3 changed files with 6 additions and 7 deletions
|
@ -31,7 +31,7 @@ public class Boyfriend {
|
||||||
var services = host.Services;
|
var services = host.Services;
|
||||||
|
|
||||||
var slashService = services.GetRequiredService<SlashService>();
|
var slashService = services.GetRequiredService<SlashService>();
|
||||||
_ = await slashService.UpdateSlashCommandsAsync();
|
await slashService.UpdateSlashCommandsAsync();
|
||||||
|
|
||||||
await host.RunAsync();
|
await host.RunAsync();
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ public class Boyfriend {
|
||||||
.AddSingleton<GuildDataService>()
|
.AddSingleton<GuildDataService>()
|
||||||
.AddSingleton<UtilityService>()
|
.AddSingleton<UtilityService>()
|
||||||
.AddCommandTree()
|
.AddCommandTree()
|
||||||
.WithCommandGroup<BanCommand>();
|
.WithCommandGroup<BanCommandGroup>();
|
||||||
var responderTypes = typeof(Boyfriend).Assembly
|
var responderTypes = typeof(Boyfriend).Assembly
|
||||||
.GetExportedTypes()
|
.GetExportedTypes()
|
||||||
.Where(t => t.IsResponder());
|
.Where(t => t.IsResponder());
|
||||||
|
|
|
@ -19,7 +19,7 @@ using Remora.Results;
|
||||||
|
|
||||||
namespace Boyfriend.Commands;
|
namespace Boyfriend.Commands;
|
||||||
|
|
||||||
public class BanCommand : CommandGroup {
|
public class BanCommandGroup : CommandGroup {
|
||||||
private readonly IDiscordRestChannelAPI _channelApi;
|
private readonly IDiscordRestChannelAPI _channelApi;
|
||||||
private readonly ICommandContext _context;
|
private readonly ICommandContext _context;
|
||||||
private readonly GuildDataService _dataService;
|
private readonly GuildDataService _dataService;
|
||||||
|
@ -28,7 +28,7 @@ public class BanCommand : CommandGroup {
|
||||||
private readonly IDiscordRestUserAPI _userApi;
|
private readonly IDiscordRestUserAPI _userApi;
|
||||||
private readonly UtilityService _utility;
|
private readonly UtilityService _utility;
|
||||||
|
|
||||||
public BanCommand(
|
public BanCommandGroup(
|
||||||
ICommandContext context, IDiscordRestChannelAPI channelApi, GuildDataService dataService,
|
ICommandContext context, IDiscordRestChannelAPI channelApi, GuildDataService dataService,
|
||||||
FeedbackService feedbackService, IDiscordRestGuildAPI guildApi, IDiscordRestUserAPI userApi,
|
FeedbackService feedbackService, IDiscordRestGuildAPI guildApi, IDiscordRestUserAPI userApi,
|
||||||
UtilityService utility) {
|
UtilityService utility) {
|
||||||
|
@ -62,7 +62,7 @@ public class BanCommand : CommandGroup {
|
||||||
Messages.Culture = cfg.Culture;
|
Messages.Culture = cfg.Culture;
|
||||||
|
|
||||||
var existingBanResult = await _guildApi.GetGuildBanAsync(guildId.Value, target.ID, CancellationToken);
|
var existingBanResult = await _guildApi.GetGuildBanAsync(guildId.Value, target.ID, CancellationToken);
|
||||||
if (existingBanResult.IsDefined(out _)) {
|
if (existingBanResult.IsDefined()) {
|
||||||
var embed = new EmbedBuilder().WithSmallTitle(Messages.UserAlreadyBanned, currentUser)
|
var embed = new EmbedBuilder().WithSmallTitle(Messages.UserAlreadyBanned, currentUser)
|
||||||
.WithColour(ColorsList.Red).Build();
|
.WithColour(ColorsList.Red).Build();
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ public class BanCommand : CommandGroup {
|
||||||
Messages.Culture = cfg.Culture;
|
Messages.Culture = cfg.Culture;
|
||||||
|
|
||||||
var existingBanResult = await _guildApi.GetGuildBanAsync(guildId.Value, target.ID, CancellationToken);
|
var existingBanResult = await _guildApi.GetGuildBanAsync(guildId.Value, target.ID, CancellationToken);
|
||||||
if (!existingBanResult.IsDefined(out _)) {
|
if (!existingBanResult.IsDefined()) {
|
||||||
var embed = new EmbedBuilder().WithSmallTitle(Messages.UserNotBanned, currentUser)
|
var embed = new EmbedBuilder().WithSmallTitle(Messages.UserNotBanned, currentUser)
|
||||||
.WithColour(ColorsList.Red).Build();
|
.WithColour(ColorsList.Red).Build();
|
||||||
|
|
|
@ -14,7 +14,6 @@ public class GuildConfiguration {
|
||||||
{ "mctaylors-ru", new CultureInfo("tt-RU") }
|
{ "mctaylors-ru", new CultureInfo("tt-RU") }
|
||||||
};
|
};
|
||||||
|
|
||||||
public string Prefix { get; set; } = "!";
|
|
||||||
public string Language { get; set; } = "en";
|
public string Language { get; set; } = "en";
|
||||||
public string WelcomeMessage { get; set; } = "default";
|
public string WelcomeMessage { get; set; } = "default";
|
||||||
public bool ReceiveStartupMessages { get; set; }
|
public bool ReceiveStartupMessages { get; set; }
|
||||||
|
|
Loading…
Add table
Reference in a new issue