mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-15 10:10:12 +00:00
bot: add invite command
This commit is contained in:
parent
6be9a6a89a
commit
bf8387cf52
1 changed files with 27 additions and 0 deletions
27
PluralKit/Bot/Commands/MiscCommands.cs
Normal file
27
PluralKit/Bot/Commands/MiscCommands.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Discord;
|
||||||
|
using Discord.Commands;
|
||||||
|
|
||||||
|
namespace PluralKit.Bot {
|
||||||
|
public class MiscCommands: ModuleBase<PKCommandContext> {
|
||||||
|
[Command("invite")]
|
||||||
|
[Remarks("invite")]
|
||||||
|
public async Task Invite() {
|
||||||
|
var info = await Context.Client.GetApplicationInfoAsync();
|
||||||
|
|
||||||
|
var permissions = new GuildPermissions(
|
||||||
|
addReactions: true,
|
||||||
|
attachFiles: true,
|
||||||
|
embedLinks: true,
|
||||||
|
manageMessages: true,
|
||||||
|
manageWebhooks: true,
|
||||||
|
readMessageHistory: true,
|
||||||
|
sendMessages: true
|
||||||
|
);
|
||||||
|
|
||||||
|
// TODO: allow customization of invite ID
|
||||||
|
var invite = $"https://discordapp.com/oauth2/authorize?client_id={info.Id}&scope=bot&permissions={permissions.RawValue}";
|
||||||
|
await Context.Channel.SendMessageAsync($"{Emojis.Success} Use this link to add PluralKit to your server:\n<{invite}>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue