99import org .eclipse .egit .github .core .service .GistService ;
1010import org .mangorage .mangobotcore .api .jda .event .v1 .DiscordMessageReactionAddEvent ;
1111import org .mangorage .mangobotcore .api .jda .event .v1 .DiscordMessageReceivedEvent ;
12- import org .mangorage .mangobotcore .api .plugin .v1 .PluginManager ;
1312import org .mangorage .mangobotcore .api .util .misc .LazyReference ;
1413import org .mangorage .mangobotcore .api .util .misc .TaskScheduler ;
1514import org .mangorage .mangobotgithub .MangoBotGithub ;
16- import org .mangorage .mangobotgithub .core .integration .MangoBotSiteIntegration ;
1715import java .io .IOException ;
1816import java .io .InputStream ;
1917import java .nio .charset .StandardCharsets ;
@@ -82,12 +80,6 @@ public static void createGists(Message msg, User requester) {
8280
8381 HashMap <String , GistFile > FILES = new HashMap <>();
8482
85- String id = null ;
86- if (PluginManager .getInstance ().getPlugin ("mangobotsite" ) != null ) {
87- try {
88- id = MangoBotSiteIntegration .handleUpload (attachments );
89- } catch (IOException ignored ) {}
90- }
9183
9284 attachments .forEach (attachment -> {
9385 try {
@@ -109,18 +101,14 @@ public static void createGists(Message msg, User requester) {
109101
110102 gist .setFiles (FILES );
111103
112- if (FILES .isEmpty () && id != null ) {
113- msg . reply (( "Upload -> [[mango](https://mangobot.mangorage.org/file?id=%s)]" . formatted ( id ))). setSuppressEmbeds ( true ). mentionRepliedUser ( false ). queue ();
104+ if (FILES .isEmpty ()) {
105+
114106 } else {
115107 try {
116108 var remote = service .createGist (gist );
117109 StringBuilder result = new StringBuilder ();
118110 result .append ("Gist -> [[gist](%s)]" .formatted (remote .getHtmlUrl ()));
119111
120- if (id != null ) {
121- result .append (" [[mango](https://mangobot.mangorage.org/file?id=%s)]" .formatted (id ));
122- }
123-
124112 remote .getFiles ().forEach ((key , file ) -> {
125113 result .append (" [[raw %s](%s)]" .formatted (file .getFilename (), file .getRawUrl ()));
126114 });
0 commit comments