Minor renames and rewordings

This commit is contained in:
Ske
2020-06-11 21:32:04 +02:00
parent 50c9675963
commit ccb6ba5d30
5 changed files with 32 additions and 25 deletions

View File

@@ -313,27 +313,27 @@ namespace PluralKit.Bot
}
public async Task SystemPing(Context ctx)
{
ctx.CheckSystem();
if (!ctx.HasNext())
{
if (ctx.System.Pings) {await ctx.Reply("Reaction pings are currently **enabled** for your system. To disable reaction pings, type `pk;s ping disable`.");}
else {await ctx.Reply("Reaction pings are currently **disabled** for your system. To enable reaction pings, type `pk;s ping enable`.");}
ctx.CheckSystem();
if (!ctx.HasNext())
{
if (ctx.System.PingsEnabled) {await ctx.Reply("Reaction pings are currently **enabled** for your system. To disable reaction pings, type `pk;s ping disable`.");}
else {await ctx.Reply("Reaction pings are currently **disabled** for your system. To enable reaction pings, type `pk;s ping enable`.");}
}
else {
if (ctx.Match("on", "enable")) {
ctx.System.PingsEnabled = true;
await _data.SaveSystem(ctx.System);
await ctx.Reply("Reaction pings have now been enabled.");
}
if (ctx.Match("off", "disable")) {
ctx.System.PingsEnabled = false;
await _data.SaveSystem(ctx.System);
await ctx.Reply("Reaction pings have now been disabled.");
}
}
}
else {
if (ctx.Match("on", "enable")) {
ctx.System.Pings = true;
await _data.SaveSystem(ctx.System);
await ctx.Reply("Reaction pings have now been enabled.");
}
if (ctx.Match("off", "disable")) {
ctx.System.Pings = false;
await _data.SaveSystem(ctx.System);
await ctx.Reply("Reaction pings have now been disabled.");
}
}
}
public async Task<DateTimeZone> FindTimeZone(Context ctx, string zoneStr) {
// First, if we're given a flag emoji, we extract the flag emoji code from it.

View File

@@ -285,9 +285,16 @@ namespace PluralKit.Bot
var requiredPerms = Permissions.AccessChannels | Permissions.SendMessages;
if ((permissions & requiredPerms) != requiredPerms) return;
if (!msg.System.Pings) {
await args.Channel.SendMessageAsync($"Hey <@{args.User.Id}>, {msg.Member.DisplayName ?? msg.Member.Name}'s system has disabled reaction pings. You can mention them by copy pasting the following message:");
await args.Channel.SendMessageAsync($"`<@{msg.Message.Sender}>`");
if (!msg.System.PingsEnabled) {
// If the target system has disabled pings, tell the pinger and bail
var member = await args.Guild.GetMemberAsync(args.User.Id);
try
{
await member.SendMessageAsync($"{Emojis.Error} {msg.Member.DisplayName ?? msg.Member.Name}'s system has disabled reaction pings. If you want to mention them anyway, you can copy/paste the following message:");
await member.SendMessageAsync($"`<@{msg.Message.Sender}>`");
}
catch (UnauthorizedException) { }
return;
}