Finding who deleted the message










0















My discord.js bot is programmed to log deleted messages. I have the code setup, but I was wondering if there was a way to see who deleted it? Thanks.



Heres the code:



bot.on("messageDelete", (messageDelete) => 

let DeleteEmbed = new Discord.RichEmbed()
.setTitle("**DELETED MESSAGE**")
.setColor("#fc3c3c")
.addField("Author", messageDelete.author.tag, true)
.addField("Channel", messageDelete.channel, true)
.addField("Message", messageDelete.content)
.setFooter(`Message ID: $messageDelete.id );


Thanks!










share|improve this question




























    0















    My discord.js bot is programmed to log deleted messages. I have the code setup, but I was wondering if there was a way to see who deleted it? Thanks.



    Heres the code:



    bot.on("messageDelete", (messageDelete) => 

    let DeleteEmbed = new Discord.RichEmbed()
    .setTitle("**DELETED MESSAGE**")
    .setColor("#fc3c3c")
    .addField("Author", messageDelete.author.tag, true)
    .addField("Channel", messageDelete.channel, true)
    .addField("Message", messageDelete.content)
    .setFooter(`Message ID: $messageDelete.id );


    Thanks!










    share|improve this question


























      0












      0








      0








      My discord.js bot is programmed to log deleted messages. I have the code setup, but I was wondering if there was a way to see who deleted it? Thanks.



      Heres the code:



      bot.on("messageDelete", (messageDelete) => 

      let DeleteEmbed = new Discord.RichEmbed()
      .setTitle("**DELETED MESSAGE**")
      .setColor("#fc3c3c")
      .addField("Author", messageDelete.author.tag, true)
      .addField("Channel", messageDelete.channel, true)
      .addField("Message", messageDelete.content)
      .setFooter(`Message ID: $messageDelete.id );


      Thanks!










      share|improve this question
















      My discord.js bot is programmed to log deleted messages. I have the code setup, but I was wondering if there was a way to see who deleted it? Thanks.



      Heres the code:



      bot.on("messageDelete", (messageDelete) => 

      let DeleteEmbed = new Discord.RichEmbed()
      .setTitle("**DELETED MESSAGE**")
      .setColor("#fc3c3c")
      .addField("Author", messageDelete.author.tag, true)
      .addField("Channel", messageDelete.channel, true)
      .addField("Message", messageDelete.content)
      .setFooter(`Message ID: $messageDelete.id );


      Thanks!







      javascript json discord discord.js






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 16 '18 at 15:09









      Federico Grandi

      3,19121229




      3,19121229










      asked Nov 15 '18 at 21:21









      pausepause

      82




      82






















          2 Answers
          2






          active

          oldest

          votes


















          0














          I think the only way you can achieve that is by looking at the audit logs.



          client.on("messageDelete", async msg => "Unspecified")
          .setFooter(`Message ID: $msg.id );





          share|improve this answer























          • is that guaranteed to work though? Cause you're just grabbing the first entry. i've seen audit log take a lil while to update before.

            – NealC
            Nov 15 '18 at 22:36











          • Yeah that doesn't work, it just grabs whoever is most recent on the audit log, and deleted messages don't catch up.

            – pause
            Nov 16 '18 at 0:07











          • @pause If this doesn't work I don't think there's a way to do that: the message object doesn't store who deletes it, the audit entry object doesn't store the message that is deleted and the client doesn't emit any event when a new audit entry is created :

            – Federico Grandi
            Nov 16 '18 at 15:09


















          0














          There is no way of doing it except through the audit logs which might be very buggy and hard to work with. I hope this is a little help to you.






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53328061%2ffinding-who-deleted-the-message%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I think the only way you can achieve that is by looking at the audit logs.



            client.on("messageDelete", async msg => "Unspecified")
            .setFooter(`Message ID: $msg.id );





            share|improve this answer























            • is that guaranteed to work though? Cause you're just grabbing the first entry. i've seen audit log take a lil while to update before.

              – NealC
              Nov 15 '18 at 22:36











            • Yeah that doesn't work, it just grabs whoever is most recent on the audit log, and deleted messages don't catch up.

              – pause
              Nov 16 '18 at 0:07











            • @pause If this doesn't work I don't think there's a way to do that: the message object doesn't store who deletes it, the audit entry object doesn't store the message that is deleted and the client doesn't emit any event when a new audit entry is created :

              – Federico Grandi
              Nov 16 '18 at 15:09















            0














            I think the only way you can achieve that is by looking at the audit logs.



            client.on("messageDelete", async msg => "Unspecified")
            .setFooter(`Message ID: $msg.id );





            share|improve this answer























            • is that guaranteed to work though? Cause you're just grabbing the first entry. i've seen audit log take a lil while to update before.

              – NealC
              Nov 15 '18 at 22:36











            • Yeah that doesn't work, it just grabs whoever is most recent on the audit log, and deleted messages don't catch up.

              – pause
              Nov 16 '18 at 0:07











            • @pause If this doesn't work I don't think there's a way to do that: the message object doesn't store who deletes it, the audit entry object doesn't store the message that is deleted and the client doesn't emit any event when a new audit entry is created :

              – Federico Grandi
              Nov 16 '18 at 15:09













            0












            0








            0







            I think the only way you can achieve that is by looking at the audit logs.



            client.on("messageDelete", async msg => "Unspecified")
            .setFooter(`Message ID: $msg.id );





            share|improve this answer













            I think the only way you can achieve that is by looking at the audit logs.



            client.on("messageDelete", async msg => "Unspecified")
            .setFooter(`Message ID: $msg.id );






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 15 '18 at 21:54









            Federico GrandiFederico Grandi

            3,19121229




            3,19121229












            • is that guaranteed to work though? Cause you're just grabbing the first entry. i've seen audit log take a lil while to update before.

              – NealC
              Nov 15 '18 at 22:36











            • Yeah that doesn't work, it just grabs whoever is most recent on the audit log, and deleted messages don't catch up.

              – pause
              Nov 16 '18 at 0:07











            • @pause If this doesn't work I don't think there's a way to do that: the message object doesn't store who deletes it, the audit entry object doesn't store the message that is deleted and the client doesn't emit any event when a new audit entry is created :

              – Federico Grandi
              Nov 16 '18 at 15:09

















            • is that guaranteed to work though? Cause you're just grabbing the first entry. i've seen audit log take a lil while to update before.

              – NealC
              Nov 15 '18 at 22:36











            • Yeah that doesn't work, it just grabs whoever is most recent on the audit log, and deleted messages don't catch up.

              – pause
              Nov 16 '18 at 0:07











            • @pause If this doesn't work I don't think there's a way to do that: the message object doesn't store who deletes it, the audit entry object doesn't store the message that is deleted and the client doesn't emit any event when a new audit entry is created :

              – Federico Grandi
              Nov 16 '18 at 15:09
















            is that guaranteed to work though? Cause you're just grabbing the first entry. i've seen audit log take a lil while to update before.

            – NealC
            Nov 15 '18 at 22:36





            is that guaranteed to work though? Cause you're just grabbing the first entry. i've seen audit log take a lil while to update before.

            – NealC
            Nov 15 '18 at 22:36













            Yeah that doesn't work, it just grabs whoever is most recent on the audit log, and deleted messages don't catch up.

            – pause
            Nov 16 '18 at 0:07





            Yeah that doesn't work, it just grabs whoever is most recent on the audit log, and deleted messages don't catch up.

            – pause
            Nov 16 '18 at 0:07













            @pause If this doesn't work I don't think there's a way to do that: the message object doesn't store who deletes it, the audit entry object doesn't store the message that is deleted and the client doesn't emit any event when a new audit entry is created :

            – Federico Grandi
            Nov 16 '18 at 15:09





            @pause If this doesn't work I don't think there's a way to do that: the message object doesn't store who deletes it, the audit entry object doesn't store the message that is deleted and the client doesn't emit any event when a new audit entry is created :

            – Federico Grandi
            Nov 16 '18 at 15:09













            0














            There is no way of doing it except through the audit logs which might be very buggy and hard to work with. I hope this is a little help to you.






            share|improve this answer



























              0














              There is no way of doing it except through the audit logs which might be very buggy and hard to work with. I hope this is a little help to you.






              share|improve this answer

























                0












                0








                0







                There is no way of doing it except through the audit logs which might be very buggy and hard to work with. I hope this is a little help to you.






                share|improve this answer













                There is no way of doing it except through the audit logs which might be very buggy and hard to work with. I hope this is a little help to you.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 18 '18 at 1:16









                NintendoZaedusNintendoZaedus

                152113




                152113



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53328061%2ffinding-who-deleted-the-message%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Top Tejano songwriter Luis Silva dead of heart attack at 64

                    ReactJS Fetched API data displays live - need Data displayed static

                    政党