Add member is public reminder message on member creation (if system has private members)

This commit is contained in:
dev-kittens
2020-10-19 03:50:51 -05:00
parent 9282d5e9fb
commit a5f7bacb3e
3 changed files with 15 additions and 0 deletions

View File

@@ -2,6 +2,8 @@ using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
using Dapper;
using PluralKit.Core;
namespace PluralKit.Bot
@@ -47,6 +49,9 @@ namespace PluralKit.Bot
// Send confirmation and space hint
await ctx.Reply($"{Emojis.Success} Member \"{memberName}\" (`{member.Hid}`) registered! Check out the getting started page for how to get a member up and running: https://pluralkit.me/start#members");
if (await _db.Execute(conn => conn.QuerySingleAsync<bool>("select has_private_members(@System)",
new {System = ctx.System.Id}))) //if has private members
await ctx.Reply($"{Emojis.Warn} This member is currently **public**. To change this, use the `pk;member {member.Hid} privacy` command.");
if (memberName.Contains(" "))
await ctx.Reply($"{Emojis.Note} Note that this member's name contains spaces. You will need to surround it with \"double quotes\" when using commands referring to it, or just use the member's 5-character ID (which is `{member.Hid}`).");
if (memberCount >= Limits.MaxMemberCount)