diff --git a/PluralKit.Bot/BotConfig.cs b/PluralKit.Bot/BotConfig.cs index 87c2035a..d941fc70 100644 --- a/PluralKit.Bot/BotConfig.cs +++ b/PluralKit.Bot/BotConfig.cs @@ -3,5 +3,6 @@ namespace PluralKit.Bot public class BotConfig { public string Token { get; set; } + public ulong? ClientId { get; set; } } } \ No newline at end of file diff --git a/PluralKit.Bot/Commands/MiscCommands.cs b/PluralKit.Bot/Commands/MiscCommands.cs index d678c701..13b1e29c 100644 --- a/PluralKit.Bot/Commands/MiscCommands.cs +++ b/PluralKit.Bot/Commands/MiscCommands.cs @@ -4,11 +4,13 @@ using Discord.Commands; namespace PluralKit.Bot.Commands { public class MiscCommands: ModuleBase { + public BotConfig BotConfig { get; set; } + [Command("invite")] [Remarks("invite")] - public async Task Invite() { - var info = await Context.Client.GetApplicationInfoAsync(); - + public async Task Invite() + { + var clientId = BotConfig.ClientId ?? (await Context.Client.GetApplicationInfoAsync()).Id; var permissions = new GuildPermissions( addReactions: true, attachFiles: true, @@ -20,7 +22,7 @@ namespace PluralKit.Bot.Commands { ); // TODO: allow customization of invite ID - var invite = $"https://discordapp.com/oauth2/authorize?client_id={info.Id}&scope=bot&permissions={permissions.RawValue}"; + var invite = $"https://discordapp.com/oauth2/authorize?client_id={clientId}&scope=bot&permissions={permissions.RawValue}"; await Context.Channel.SendMessageAsync($"{Emojis.Success} Use this link to add PluralKit to your server:\n<{invite}>"); } }