Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
user installable
Browse files Browse the repository at this point in the history
  • Loading branch information
zai-tm committed Mar 20, 2024
1 parent 6dc2c0d commit 84e5bfe
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 10 deletions.
1 change: 1 addition & 0 deletions XaiSharp/Commands/Message/SuggestAsQuote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace XaiSharp.Commands.Message
{
[IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)]
public class SuggestAsQuote : InteractionModuleBase<SocketInteractionContext>
{
Config config = Util.ParseConfig(File.ReadAllText("config.yml"));
Expand Down
2 changes: 2 additions & 0 deletions XaiSharp/Commands/Slash/About.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace XaiSharp.Commands.Slash
{
[IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)]
[CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)]
public class About : InteractionModuleBase<SocketInteractionContext>
{
Config config = Util.ParseConfig(File.ReadAllText("config.yml"));
Expand Down
2 changes: 2 additions & 0 deletions XaiSharp/Commands/Slash/Countdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace XaiSharp.Commands.Slash
{
[IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)]
[CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)]
public class Countdown : InteractionModuleBase<SocketInteractionContext>
{
public class Event
Expand Down
5 changes: 4 additions & 1 deletion XaiSharp/Commands/Slash/Crash.cs
Original file line number Diff line number Diff line change
@@ -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<SocketInteractionContext>
{

Expand Down
2 changes: 2 additions & 0 deletions XaiSharp/Commands/Slash/Credit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

namespace XaiSharp.Commands.Slash
{
[IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)]
[CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)]
public class Credit : InteractionModuleBase<SocketInteractionContext>
{

Expand Down
2 changes: 2 additions & 0 deletions XaiSharp/Commands/Slash/CtrlAltDel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SocketInteractionContext>
{
[Group("cad", "That other webcomic")]
Expand Down
2 changes: 2 additions & 0 deletions XaiSharp/Commands/Slash/Dice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

namespace XaiSharp.Commands.Slash
{
[IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)]
[CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)]
public class Dice : InteractionModuleBase<SocketInteractionContext>
{

Expand Down
2 changes: 2 additions & 0 deletions XaiSharp/Commands/Slash/DiscordChangelog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace XaiSharp.Commands.Slash
{
[IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)]
[CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)]
public class DiscordChangelog : InteractionModuleBase<SocketInteractionContext>
{
public class Changelog
Expand Down
2 changes: 2 additions & 0 deletions XaiSharp/Commands/Slash/EightBall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace XaiSharp.Commands.Slash
{
[IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)]
[CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)]
public class EightBall : InteractionModuleBase<SocketInteractionContext>
{

Expand Down
6 changes: 4 additions & 2 deletions XaiSharp/Commands/Slash/Info.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public class Info : InteractionModuleBase<SocketInteractionContext>
public class InfoGroup : InteractionModuleBase<SocketInteractionContext>

{
[EnabledInDm(false)]
[IntegrationType(ApplicationIntegrationType.GuildInstall)]
[CommandContextType(InteractionContextType.Guild)]
[SlashCommand("server", "View info about the current server")]
public async Task HandleServer()
{
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 2 additions & 0 deletions XaiSharp/Commands/Slash/Ping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace XaiSharp.Commands.Slash
{
[IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)]
[CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)]
public class Ping : InteractionModuleBase<SocketInteractionContext>
{

Expand Down
2 changes: 2 additions & 0 deletions XaiSharp/Commands/Slash/Quotes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace XaiSharp.Commands.Slash
{
[IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)]
[CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)]
public class Quotes : InteractionModuleBase<SocketInteractionContext>
{

Expand Down
2 changes: 2 additions & 0 deletions XaiSharp/Commands/Slash/XKCD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SocketInteractionContext>
{
[Group("xkcd", "The webcomic everyone knows and loves")]
Expand Down
2 changes: 2 additions & 0 deletions XaiSharp/Commands/User/Kill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace XaiSharp.Commands.User
{
[IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)]
[CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)]
public class Kill : InteractionModuleBase<SocketInteractionContext>
{
private class DeathMessage
Expand Down
14 changes: 7 additions & 7 deletions XaiSharp/XaiSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Discord.Net" Version="3.12.0" />
<PackageReference Include="GitInfo" Version="3.3.1">
<PackageReference Include="Discord.Net" Version="3.14.1" />
<PackageReference Include="GitInfo" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Markdig" Version="0.32.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
<PackageReference Include="Markdig" Version="0.36.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NewTumblrSharp" Version="1.2.0.156" />
<PackageReference Include="SQLite" Version="3.13.0" />
<PackageReference Include="System.Data.SQLite" Version="1.0.118" />
<PackageReference Include="YamlDotNet" Version="13.2.0" />
<PackageReference Include="YamlDotNet" Version="15.1.2" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 84e5bfe

Please sign in to comment.