From 84e5bfec721ad9eb6a67a44af15f0b6665814b93 Mon Sep 17 00:00:00 2001 From: Zai <74737630+zai-tm@users.noreply.github.com> Date: Tue, 19 Mar 2024 18:36:48 -0600 Subject: [PATCH] user installable --- XaiSharp/Commands/Message/SuggestAsQuote.cs | 1 + XaiSharp/Commands/Slash/About.cs | 2 ++ XaiSharp/Commands/Slash/Countdown.cs | 2 ++ XaiSharp/Commands/Slash/Crash.cs | 5 ++++- XaiSharp/Commands/Slash/Credit.cs | 2 ++ XaiSharp/Commands/Slash/CtrlAltDel.cs | 2 ++ XaiSharp/Commands/Slash/Dice.cs | 2 ++ XaiSharp/Commands/Slash/DiscordChangelog.cs | 2 ++ XaiSharp/Commands/Slash/EightBall.cs | 2 ++ XaiSharp/Commands/Slash/Info.cs | 6 ++++-- XaiSharp/Commands/Slash/Ping.cs | 2 ++ XaiSharp/Commands/Slash/Quotes.cs | 2 ++ XaiSharp/Commands/Slash/XKCD.cs | 2 ++ XaiSharp/Commands/User/Kill.cs | 2 ++ XaiSharp/XaiSharp.csproj | 14 +++++++------- 15 files changed, 38 insertions(+), 10 deletions(-) diff --git a/XaiSharp/Commands/Message/SuggestAsQuote.cs b/XaiSharp/Commands/Message/SuggestAsQuote.cs index 594b1c4..253da0f 100644 --- a/XaiSharp/Commands/Message/SuggestAsQuote.cs +++ b/XaiSharp/Commands/Message/SuggestAsQuote.cs @@ -5,6 +5,7 @@ namespace XaiSharp.Commands.Message { + [IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)] public class SuggestAsQuote : InteractionModuleBase { Config config = Util.ParseConfig(File.ReadAllText("config.yml")); diff --git a/XaiSharp/Commands/Slash/About.cs b/XaiSharp/Commands/Slash/About.cs index 4df5144..87b14e7 100644 --- a/XaiSharp/Commands/Slash/About.cs +++ b/XaiSharp/Commands/Slash/About.cs @@ -4,6 +4,8 @@ namespace XaiSharp.Commands.Slash { + [IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)] + [CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)] public class About : InteractionModuleBase { Config config = Util.ParseConfig(File.ReadAllText("config.yml")); diff --git a/XaiSharp/Commands/Slash/Countdown.cs b/XaiSharp/Commands/Slash/Countdown.cs index 06003e2..0035acc 100644 --- a/XaiSharp/Commands/Slash/Countdown.cs +++ b/XaiSharp/Commands/Slash/Countdown.cs @@ -4,6 +4,8 @@ namespace XaiSharp.Commands.Slash { + [IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)] + [CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)] public class Countdown : InteractionModuleBase { public class Event diff --git a/XaiSharp/Commands/Slash/Crash.cs b/XaiSharp/Commands/Slash/Crash.cs index e03edad..6b3cbd3 100644 --- a/XaiSharp/Commands/Slash/Crash.cs +++ b/XaiSharp/Commands/Slash/Crash.cs @@ -1,7 +1,10 @@ -using Discord.Interactions; +using Discord; +using Discord.Interactions; namespace XaiSharp.Commands.Slash { + [IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)] + [CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)] public class Crash : InteractionModuleBase { diff --git a/XaiSharp/Commands/Slash/Credit.cs b/XaiSharp/Commands/Slash/Credit.cs index e0de726..36a209a 100644 --- a/XaiSharp/Commands/Slash/Credit.cs +++ b/XaiSharp/Commands/Slash/Credit.cs @@ -3,6 +3,8 @@ namespace XaiSharp.Commands.Slash { + [IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)] + [CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)] public class Credit : InteractionModuleBase { diff --git a/XaiSharp/Commands/Slash/CtrlAltDel.cs b/XaiSharp/Commands/Slash/CtrlAltDel.cs index 0b20e27..a683259 100644 --- a/XaiSharp/Commands/Slash/CtrlAltDel.cs +++ b/XaiSharp/Commands/Slash/CtrlAltDel.cs @@ -4,6 +4,8 @@ using System.Net; namespace XaiSharp.Commands.Slash { + [IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)] + [CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)] public class CtrlAltDel : InteractionModuleBase { [Group("cad", "That other webcomic")] diff --git a/XaiSharp/Commands/Slash/Dice.cs b/XaiSharp/Commands/Slash/Dice.cs index 23007ed..e12cc63 100644 --- a/XaiSharp/Commands/Slash/Dice.cs +++ b/XaiSharp/Commands/Slash/Dice.cs @@ -3,6 +3,8 @@ namespace XaiSharp.Commands.Slash { + [IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)] + [CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)] public class Dice : InteractionModuleBase { diff --git a/XaiSharp/Commands/Slash/DiscordChangelog.cs b/XaiSharp/Commands/Slash/DiscordChangelog.cs index 992c8a3..09f701e 100644 --- a/XaiSharp/Commands/Slash/DiscordChangelog.cs +++ b/XaiSharp/Commands/Slash/DiscordChangelog.cs @@ -7,6 +7,8 @@ namespace XaiSharp.Commands.Slash { + [IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)] + [CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)] public class DiscordChangelog : InteractionModuleBase { public class Changelog diff --git a/XaiSharp/Commands/Slash/EightBall.cs b/XaiSharp/Commands/Slash/EightBall.cs index 69a6872..6f538ae 100644 --- a/XaiSharp/Commands/Slash/EightBall.cs +++ b/XaiSharp/Commands/Slash/EightBall.cs @@ -4,6 +4,8 @@ namespace XaiSharp.Commands.Slash { + [IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)] + [CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)] public class EightBall : InteractionModuleBase { diff --git a/XaiSharp/Commands/Slash/Info.cs b/XaiSharp/Commands/Slash/Info.cs index 30043db..ec480ee 100644 --- a/XaiSharp/Commands/Slash/Info.cs +++ b/XaiSharp/Commands/Slash/Info.cs @@ -15,7 +15,8 @@ public class Info : InteractionModuleBase public class InfoGroup : InteractionModuleBase { - [EnabledInDm(false)] + [IntegrationType(ApplicationIntegrationType.GuildInstall)] + [CommandContextType(InteractionContextType.Guild)] [SlashCommand("server", "View info about the current server")] public async Task HandleServer() { @@ -81,7 +82,8 @@ public async Task HandleServer() } catch (Exception e) { Console.WriteLine(e); } } - [EnabledInDm(false)] + [IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)] + [CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)] [SlashCommand("user", "View info about a user")] public async Task HandleUser(IGuildUser user) { diff --git a/XaiSharp/Commands/Slash/Ping.cs b/XaiSharp/Commands/Slash/Ping.cs index 818d7fc..9ef871f 100644 --- a/XaiSharp/Commands/Slash/Ping.cs +++ b/XaiSharp/Commands/Slash/Ping.cs @@ -4,6 +4,8 @@ namespace XaiSharp.Commands.Slash { + [IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)] + [CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)] public class Ping : InteractionModuleBase { diff --git a/XaiSharp/Commands/Slash/Quotes.cs b/XaiSharp/Commands/Slash/Quotes.cs index b9b1ea4..869ba92 100644 --- a/XaiSharp/Commands/Slash/Quotes.cs +++ b/XaiSharp/Commands/Slash/Quotes.cs @@ -4,6 +4,8 @@ namespace XaiSharp.Commands.Slash { + [IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)] + [CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)] public class Quotes : InteractionModuleBase { diff --git a/XaiSharp/Commands/Slash/XKCD.cs b/XaiSharp/Commands/Slash/XKCD.cs index ec92999..cb41eab 100644 --- a/XaiSharp/Commands/Slash/XKCD.cs +++ b/XaiSharp/Commands/Slash/XKCD.cs @@ -4,6 +4,8 @@ using System.Net; namespace XaiSharp.Commands.Slash { + [IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)] + [CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)] public class XKCD : InteractionModuleBase { [Group("xkcd", "The webcomic everyone knows and loves")] diff --git a/XaiSharp/Commands/User/Kill.cs b/XaiSharp/Commands/User/Kill.cs index 19f4bcb..6f0475e 100644 --- a/XaiSharp/Commands/User/Kill.cs +++ b/XaiSharp/Commands/User/Kill.cs @@ -4,6 +4,8 @@ namespace XaiSharp.Commands.User { + [IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)] + [CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)] public class Kill : InteractionModuleBase { private class DeathMessage diff --git a/XaiSharp/XaiSharp.csproj b/XaiSharp/XaiSharp.csproj index 364913f..23f599c 100644 --- a/XaiSharp/XaiSharp.csproj +++ b/XaiSharp/XaiSharp.csproj @@ -27,20 +27,20 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + - +