How can I listen to mentions in Disord in every message?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







-1















I have developed a private discord and stumbled upon a problem regarding mentions.



I have zero understanding how I should collect mentions in messages without running a command. This is my scenario:



I have a command which sets a personal note for the user who uses the command - e.g. "!Setnote I'm back 16:15". My goal is when a user is mentioned (and has an active note) the bot should reply with the note.



I know how to collect mentions in a message when combined with a command (using the property MentionedUsers). I, however, don't know how to ALWAYS listen for mentions even when a command is not used.



I'm using Discord .Net API. I've tried looking for days about this but I mostly found people having trouble / didn't know about the property MentionedUsers in Context.Message.



I'm going to bed any minute so I'll check this in the morning and reply to your answers / questions if there are any (Crossing thumbs)! Thanks in advance.



Edit: I hope this is kinda okay, but I realized it wasn't an acualt question in the post. Here goes:



How can I always listen for mentions in message even when not a command got executed?










share|improve this question

























  • Good night ... the "question" will be prolly closed in the morining as there is no question in it

    – Selvin
    Jan 3 at 3:48











  • Oh, crap! I didn't even realize. Thanks for mentioning that.

    – rango
    Jan 3 at 3:52


















-1















I have developed a private discord and stumbled upon a problem regarding mentions.



I have zero understanding how I should collect mentions in messages without running a command. This is my scenario:



I have a command which sets a personal note for the user who uses the command - e.g. "!Setnote I'm back 16:15". My goal is when a user is mentioned (and has an active note) the bot should reply with the note.



I know how to collect mentions in a message when combined with a command (using the property MentionedUsers). I, however, don't know how to ALWAYS listen for mentions even when a command is not used.



I'm using Discord .Net API. I've tried looking for days about this but I mostly found people having trouble / didn't know about the property MentionedUsers in Context.Message.



I'm going to bed any minute so I'll check this in the morning and reply to your answers / questions if there are any (Crossing thumbs)! Thanks in advance.



Edit: I hope this is kinda okay, but I realized it wasn't an acualt question in the post. Here goes:



How can I always listen for mentions in message even when not a command got executed?










share|improve this question

























  • Good night ... the "question" will be prolly closed in the morining as there is no question in it

    – Selvin
    Jan 3 at 3:48











  • Oh, crap! I didn't even realize. Thanks for mentioning that.

    – rango
    Jan 3 at 3:52














-1












-1








-1








I have developed a private discord and stumbled upon a problem regarding mentions.



I have zero understanding how I should collect mentions in messages without running a command. This is my scenario:



I have a command which sets a personal note for the user who uses the command - e.g. "!Setnote I'm back 16:15". My goal is when a user is mentioned (and has an active note) the bot should reply with the note.



I know how to collect mentions in a message when combined with a command (using the property MentionedUsers). I, however, don't know how to ALWAYS listen for mentions even when a command is not used.



I'm using Discord .Net API. I've tried looking for days about this but I mostly found people having trouble / didn't know about the property MentionedUsers in Context.Message.



I'm going to bed any minute so I'll check this in the morning and reply to your answers / questions if there are any (Crossing thumbs)! Thanks in advance.



Edit: I hope this is kinda okay, but I realized it wasn't an acualt question in the post. Here goes:



How can I always listen for mentions in message even when not a command got executed?










share|improve this question
















I have developed a private discord and stumbled upon a problem regarding mentions.



I have zero understanding how I should collect mentions in messages without running a command. This is my scenario:



I have a command which sets a personal note for the user who uses the command - e.g. "!Setnote I'm back 16:15". My goal is when a user is mentioned (and has an active note) the bot should reply with the note.



I know how to collect mentions in a message when combined with a command (using the property MentionedUsers). I, however, don't know how to ALWAYS listen for mentions even when a command is not used.



I'm using Discord .Net API. I've tried looking for days about this but I mostly found people having trouble / didn't know about the property MentionedUsers in Context.Message.



I'm going to bed any minute so I'll check this in the morning and reply to your answers / questions if there are any (Crossing thumbs)! Thanks in advance.



Edit: I hope this is kinda okay, but I realized it wasn't an acualt question in the post. Here goes:



How can I always listen for mentions in message even when not a command got executed?







c# discord discord.net






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 3 at 3:56







rango

















asked Jan 3 at 3:45









rangorango

82




82













  • Good night ... the "question" will be prolly closed in the morining as there is no question in it

    – Selvin
    Jan 3 at 3:48











  • Oh, crap! I didn't even realize. Thanks for mentioning that.

    – rango
    Jan 3 at 3:52



















  • Good night ... the "question" will be prolly closed in the morining as there is no question in it

    – Selvin
    Jan 3 at 3:48











  • Oh, crap! I didn't even realize. Thanks for mentioning that.

    – rango
    Jan 3 at 3:52

















Good night ... the "question" will be prolly closed in the morining as there is no question in it

– Selvin
Jan 3 at 3:48





Good night ... the "question" will be prolly closed in the morining as there is no question in it

– Selvin
Jan 3 at 3:48













Oh, crap! I didn't even realize. Thanks for mentioning that.

– rango
Jan 3 at 3:52





Oh, crap! I didn't even realize. Thanks for mentioning that.

– rango
Jan 3 at 3:52












2 Answers
2






active

oldest

votes


















0














I have never used Discord.NET... Thus, I guess I will repeat stuff you already know (I will keep it because I do not know how much of it are reasonable assumptions nor how much of it might help others).



From what I find in the documentation and repositories, you can create a client:



var client = new DiscordSocketClient();


Then hook to MessageReceived (you also want to call LoginAsync and StartAsync).



client.MessageReceived += MessageReceived;

Task MessageReceived(SocketMessage message)
{
// ...
}


Then you can read SocketMessage.MentionedUsers (which you mention you already know how to do), which will be collection of the mentioned users (SocketUser). I guess you will search it and find if it intersects your list... assuming you recognize them by name, and have a method UsersWithNotes that return an IEnumerable<string> with the names you want to match, you could do something like this:



Task MessageReceived(SocketMessage message)
{
// ...
var foundUsers = message.MentionedUsers.Select(u => u.Username).Intersect(UsersWithNotes());
// ...
}




Looking at the examples in source, it seems SocketMessage gets all messages and then you proceed to filter out commands. Example:



async Task HandleCommandAsync(SocketMessage messageParam)
{
// Filter out system messages
var message = messageParam as SocketUserMessage;
if (message == null)
{
return;
}

// Filter out non commands
int argPos = 0;
if (!(message.HasCharPrefix('!', ref argPos) ||
message.HasMentionPrefix(_client.CurrentUser, ref argPos)) ||
message.Author.IsBot)
return;

//...
}


Well, if you need to read SocketMessage.MentionedUsers in all messages, then do it regardless of those checks.



Note: Apparently your bot will get the messages it sends too, so you may want to still filter out messages from itself. Also, you can get the text of the message with message.Content meaning that you could parse it however you want.



See also: How can I have my Discord C# respond to mentions? that shows how to handle when your bot is mentioned.



I have tested nothing of what I say here. I had never used Discord.NET and I still haven't used it. Take with a grain of salt.






share|improve this answer
























  • Thanks for a huge answer with a lot of information. What I'm trying to learn is to read API documentation and actually understanding them. I'm doing this daily since it's obviously a must. I have experimented with the message_recieved but you made me look on the code again and I think I have a plan after your information! I'm grateful for the answer and I hope I'll come up with a solution with this information.

    – rango
    Jan 3 at 15:51





















0














With help from Theraot I started to really looking at the code again and tried to understand what actually happened.



The only thing I really did was making a method which executed every time a message got recieved (what I really didnt understand was how to get the mentioned users into the method) which now I find really silly because it felt so easy. Earlier I didn't really understand how the message_recieved worked since the first 100 rows of code were just a template to get the bot running and after that I've written my own commands.



I removed some lines of code below to clean it up a bit more so the most useful lines stands out:



private async Task Client_MessageReceived(SocketMessage messageParams)
{
var message = messageParams as SocketUserMessage;
var context = new SocketCommandContext(Client, message);

if (context.Message == null || context.Message.Content == "")
return;

if (context.User.IsBot)
return;

NoteCommands.CheckIfUserIsMentioned(context);

var result = await _commands.ExecuteAsync(context, argPos);
}


And then in the method (Notecommands.CheckIfUserIsMentioned) I fetched the mentions, if any, with context.Message.MentionedUsers and checked if they had an active note.



Thanks again. :) I hope someone needs the same help as I did.






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%2f54016080%2fhow-can-i-listen-to-mentions-in-disord-in-every-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 have never used Discord.NET... Thus, I guess I will repeat stuff you already know (I will keep it because I do not know how much of it are reasonable assumptions nor how much of it might help others).



    From what I find in the documentation and repositories, you can create a client:



    var client = new DiscordSocketClient();


    Then hook to MessageReceived (you also want to call LoginAsync and StartAsync).



    client.MessageReceived += MessageReceived;

    Task MessageReceived(SocketMessage message)
    {
    // ...
    }


    Then you can read SocketMessage.MentionedUsers (which you mention you already know how to do), which will be collection of the mentioned users (SocketUser). I guess you will search it and find if it intersects your list... assuming you recognize them by name, and have a method UsersWithNotes that return an IEnumerable<string> with the names you want to match, you could do something like this:



    Task MessageReceived(SocketMessage message)
    {
    // ...
    var foundUsers = message.MentionedUsers.Select(u => u.Username).Intersect(UsersWithNotes());
    // ...
    }




    Looking at the examples in source, it seems SocketMessage gets all messages and then you proceed to filter out commands. Example:



    async Task HandleCommandAsync(SocketMessage messageParam)
    {
    // Filter out system messages
    var message = messageParam as SocketUserMessage;
    if (message == null)
    {
    return;
    }

    // Filter out non commands
    int argPos = 0;
    if (!(message.HasCharPrefix('!', ref argPos) ||
    message.HasMentionPrefix(_client.CurrentUser, ref argPos)) ||
    message.Author.IsBot)
    return;

    //...
    }


    Well, if you need to read SocketMessage.MentionedUsers in all messages, then do it regardless of those checks.



    Note: Apparently your bot will get the messages it sends too, so you may want to still filter out messages from itself. Also, you can get the text of the message with message.Content meaning that you could parse it however you want.



    See also: How can I have my Discord C# respond to mentions? that shows how to handle when your bot is mentioned.



    I have tested nothing of what I say here. I had never used Discord.NET and I still haven't used it. Take with a grain of salt.






    share|improve this answer
























    • Thanks for a huge answer with a lot of information. What I'm trying to learn is to read API documentation and actually understanding them. I'm doing this daily since it's obviously a must. I have experimented with the message_recieved but you made me look on the code again and I think I have a plan after your information! I'm grateful for the answer and I hope I'll come up with a solution with this information.

      – rango
      Jan 3 at 15:51


















    0














    I have never used Discord.NET... Thus, I guess I will repeat stuff you already know (I will keep it because I do not know how much of it are reasonable assumptions nor how much of it might help others).



    From what I find in the documentation and repositories, you can create a client:



    var client = new DiscordSocketClient();


    Then hook to MessageReceived (you also want to call LoginAsync and StartAsync).



    client.MessageReceived += MessageReceived;

    Task MessageReceived(SocketMessage message)
    {
    // ...
    }


    Then you can read SocketMessage.MentionedUsers (which you mention you already know how to do), which will be collection of the mentioned users (SocketUser). I guess you will search it and find if it intersects your list... assuming you recognize them by name, and have a method UsersWithNotes that return an IEnumerable<string> with the names you want to match, you could do something like this:



    Task MessageReceived(SocketMessage message)
    {
    // ...
    var foundUsers = message.MentionedUsers.Select(u => u.Username).Intersect(UsersWithNotes());
    // ...
    }




    Looking at the examples in source, it seems SocketMessage gets all messages and then you proceed to filter out commands. Example:



    async Task HandleCommandAsync(SocketMessage messageParam)
    {
    // Filter out system messages
    var message = messageParam as SocketUserMessage;
    if (message == null)
    {
    return;
    }

    // Filter out non commands
    int argPos = 0;
    if (!(message.HasCharPrefix('!', ref argPos) ||
    message.HasMentionPrefix(_client.CurrentUser, ref argPos)) ||
    message.Author.IsBot)
    return;

    //...
    }


    Well, if you need to read SocketMessage.MentionedUsers in all messages, then do it regardless of those checks.



    Note: Apparently your bot will get the messages it sends too, so you may want to still filter out messages from itself. Also, you can get the text of the message with message.Content meaning that you could parse it however you want.



    See also: How can I have my Discord C# respond to mentions? that shows how to handle when your bot is mentioned.



    I have tested nothing of what I say here. I had never used Discord.NET and I still haven't used it. Take with a grain of salt.






    share|improve this answer
























    • Thanks for a huge answer with a lot of information. What I'm trying to learn is to read API documentation and actually understanding them. I'm doing this daily since it's obviously a must. I have experimented with the message_recieved but you made me look on the code again and I think I have a plan after your information! I'm grateful for the answer and I hope I'll come up with a solution with this information.

      – rango
      Jan 3 at 15:51
















    0












    0








    0







    I have never used Discord.NET... Thus, I guess I will repeat stuff you already know (I will keep it because I do not know how much of it are reasonable assumptions nor how much of it might help others).



    From what I find in the documentation and repositories, you can create a client:



    var client = new DiscordSocketClient();


    Then hook to MessageReceived (you also want to call LoginAsync and StartAsync).



    client.MessageReceived += MessageReceived;

    Task MessageReceived(SocketMessage message)
    {
    // ...
    }


    Then you can read SocketMessage.MentionedUsers (which you mention you already know how to do), which will be collection of the mentioned users (SocketUser). I guess you will search it and find if it intersects your list... assuming you recognize them by name, and have a method UsersWithNotes that return an IEnumerable<string> with the names you want to match, you could do something like this:



    Task MessageReceived(SocketMessage message)
    {
    // ...
    var foundUsers = message.MentionedUsers.Select(u => u.Username).Intersect(UsersWithNotes());
    // ...
    }




    Looking at the examples in source, it seems SocketMessage gets all messages and then you proceed to filter out commands. Example:



    async Task HandleCommandAsync(SocketMessage messageParam)
    {
    // Filter out system messages
    var message = messageParam as SocketUserMessage;
    if (message == null)
    {
    return;
    }

    // Filter out non commands
    int argPos = 0;
    if (!(message.HasCharPrefix('!', ref argPos) ||
    message.HasMentionPrefix(_client.CurrentUser, ref argPos)) ||
    message.Author.IsBot)
    return;

    //...
    }


    Well, if you need to read SocketMessage.MentionedUsers in all messages, then do it regardless of those checks.



    Note: Apparently your bot will get the messages it sends too, so you may want to still filter out messages from itself. Also, you can get the text of the message with message.Content meaning that you could parse it however you want.



    See also: How can I have my Discord C# respond to mentions? that shows how to handle when your bot is mentioned.



    I have tested nothing of what I say here. I had never used Discord.NET and I still haven't used it. Take with a grain of salt.






    share|improve this answer













    I have never used Discord.NET... Thus, I guess I will repeat stuff you already know (I will keep it because I do not know how much of it are reasonable assumptions nor how much of it might help others).



    From what I find in the documentation and repositories, you can create a client:



    var client = new DiscordSocketClient();


    Then hook to MessageReceived (you also want to call LoginAsync and StartAsync).



    client.MessageReceived += MessageReceived;

    Task MessageReceived(SocketMessage message)
    {
    // ...
    }


    Then you can read SocketMessage.MentionedUsers (which you mention you already know how to do), which will be collection of the mentioned users (SocketUser). I guess you will search it and find if it intersects your list... assuming you recognize them by name, and have a method UsersWithNotes that return an IEnumerable<string> with the names you want to match, you could do something like this:



    Task MessageReceived(SocketMessage message)
    {
    // ...
    var foundUsers = message.MentionedUsers.Select(u => u.Username).Intersect(UsersWithNotes());
    // ...
    }




    Looking at the examples in source, it seems SocketMessage gets all messages and then you proceed to filter out commands. Example:



    async Task HandleCommandAsync(SocketMessage messageParam)
    {
    // Filter out system messages
    var message = messageParam as SocketUserMessage;
    if (message == null)
    {
    return;
    }

    // Filter out non commands
    int argPos = 0;
    if (!(message.HasCharPrefix('!', ref argPos) ||
    message.HasMentionPrefix(_client.CurrentUser, ref argPos)) ||
    message.Author.IsBot)
    return;

    //...
    }


    Well, if you need to read SocketMessage.MentionedUsers in all messages, then do it regardless of those checks.



    Note: Apparently your bot will get the messages it sends too, so you may want to still filter out messages from itself. Also, you can get the text of the message with message.Content meaning that you could parse it however you want.



    See also: How can I have my Discord C# respond to mentions? that shows how to handle when your bot is mentioned.



    I have tested nothing of what I say here. I had never used Discord.NET and I still haven't used it. Take with a grain of salt.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 3 at 4:38









    TheraotTheraot

    12.9k43459




    12.9k43459













    • Thanks for a huge answer with a lot of information. What I'm trying to learn is to read API documentation and actually understanding them. I'm doing this daily since it's obviously a must. I have experimented with the message_recieved but you made me look on the code again and I think I have a plan after your information! I'm grateful for the answer and I hope I'll come up with a solution with this information.

      – rango
      Jan 3 at 15:51





















    • Thanks for a huge answer with a lot of information. What I'm trying to learn is to read API documentation and actually understanding them. I'm doing this daily since it's obviously a must. I have experimented with the message_recieved but you made me look on the code again and I think I have a plan after your information! I'm grateful for the answer and I hope I'll come up with a solution with this information.

      – rango
      Jan 3 at 15:51



















    Thanks for a huge answer with a lot of information. What I'm trying to learn is to read API documentation and actually understanding them. I'm doing this daily since it's obviously a must. I have experimented with the message_recieved but you made me look on the code again and I think I have a plan after your information! I'm grateful for the answer and I hope I'll come up with a solution with this information.

    – rango
    Jan 3 at 15:51







    Thanks for a huge answer with a lot of information. What I'm trying to learn is to read API documentation and actually understanding them. I'm doing this daily since it's obviously a must. I have experimented with the message_recieved but you made me look on the code again and I think I have a plan after your information! I'm grateful for the answer and I hope I'll come up with a solution with this information.

    – rango
    Jan 3 at 15:51















    0














    With help from Theraot I started to really looking at the code again and tried to understand what actually happened.



    The only thing I really did was making a method which executed every time a message got recieved (what I really didnt understand was how to get the mentioned users into the method) which now I find really silly because it felt so easy. Earlier I didn't really understand how the message_recieved worked since the first 100 rows of code were just a template to get the bot running and after that I've written my own commands.



    I removed some lines of code below to clean it up a bit more so the most useful lines stands out:



    private async Task Client_MessageReceived(SocketMessage messageParams)
    {
    var message = messageParams as SocketUserMessage;
    var context = new SocketCommandContext(Client, message);

    if (context.Message == null || context.Message.Content == "")
    return;

    if (context.User.IsBot)
    return;

    NoteCommands.CheckIfUserIsMentioned(context);

    var result = await _commands.ExecuteAsync(context, argPos);
    }


    And then in the method (Notecommands.CheckIfUserIsMentioned) I fetched the mentions, if any, with context.Message.MentionedUsers and checked if they had an active note.



    Thanks again. :) I hope someone needs the same help as I did.






    share|improve this answer




























      0














      With help from Theraot I started to really looking at the code again and tried to understand what actually happened.



      The only thing I really did was making a method which executed every time a message got recieved (what I really didnt understand was how to get the mentioned users into the method) which now I find really silly because it felt so easy. Earlier I didn't really understand how the message_recieved worked since the first 100 rows of code were just a template to get the bot running and after that I've written my own commands.



      I removed some lines of code below to clean it up a bit more so the most useful lines stands out:



      private async Task Client_MessageReceived(SocketMessage messageParams)
      {
      var message = messageParams as SocketUserMessage;
      var context = new SocketCommandContext(Client, message);

      if (context.Message == null || context.Message.Content == "")
      return;

      if (context.User.IsBot)
      return;

      NoteCommands.CheckIfUserIsMentioned(context);

      var result = await _commands.ExecuteAsync(context, argPos);
      }


      And then in the method (Notecommands.CheckIfUserIsMentioned) I fetched the mentions, if any, with context.Message.MentionedUsers and checked if they had an active note.



      Thanks again. :) I hope someone needs the same help as I did.






      share|improve this answer


























        0












        0








        0







        With help from Theraot I started to really looking at the code again and tried to understand what actually happened.



        The only thing I really did was making a method which executed every time a message got recieved (what I really didnt understand was how to get the mentioned users into the method) which now I find really silly because it felt so easy. Earlier I didn't really understand how the message_recieved worked since the first 100 rows of code were just a template to get the bot running and after that I've written my own commands.



        I removed some lines of code below to clean it up a bit more so the most useful lines stands out:



        private async Task Client_MessageReceived(SocketMessage messageParams)
        {
        var message = messageParams as SocketUserMessage;
        var context = new SocketCommandContext(Client, message);

        if (context.Message == null || context.Message.Content == "")
        return;

        if (context.User.IsBot)
        return;

        NoteCommands.CheckIfUserIsMentioned(context);

        var result = await _commands.ExecuteAsync(context, argPos);
        }


        And then in the method (Notecommands.CheckIfUserIsMentioned) I fetched the mentions, if any, with context.Message.MentionedUsers and checked if they had an active note.



        Thanks again. :) I hope someone needs the same help as I did.






        share|improve this answer













        With help from Theraot I started to really looking at the code again and tried to understand what actually happened.



        The only thing I really did was making a method which executed every time a message got recieved (what I really didnt understand was how to get the mentioned users into the method) which now I find really silly because it felt so easy. Earlier I didn't really understand how the message_recieved worked since the first 100 rows of code were just a template to get the bot running and after that I've written my own commands.



        I removed some lines of code below to clean it up a bit more so the most useful lines stands out:



        private async Task Client_MessageReceived(SocketMessage messageParams)
        {
        var message = messageParams as SocketUserMessage;
        var context = new SocketCommandContext(Client, message);

        if (context.Message == null || context.Message.Content == "")
        return;

        if (context.User.IsBot)
        return;

        NoteCommands.CheckIfUserIsMentioned(context);

        var result = await _commands.ExecuteAsync(context, argPos);
        }


        And then in the method (Notecommands.CheckIfUserIsMentioned) I fetched the mentions, if any, with context.Message.MentionedUsers and checked if they had an active note.



        Thanks again. :) I hope someone needs the same help as I did.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 3 at 22:19









        rangorango

        82




        82






























            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%2f54016080%2fhow-can-i-listen-to-mentions-in-disord-in-every-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

            MongoDB - Not Authorized To Execute Command

            How to fix TextFormField cause rebuild widget in Flutter

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith