Example #1
0
        private void _discordEventClient_UserStateChanged(object sender, UserStateChangedEventArgs e)
        {
            GetBotChannel();
            DiscordUser user = _discordEventClient.GetUser(e.UserId);

            _discordEventClient.PostMessage(_botChannel.Id, _name, $"{user.Username} is now {e.CurrentState.ToString()}");
        }
 private void _discordEventClient_newMessage(object sender, NewMessageEventArgs e)
 {
     if (e.NewMessage.Contains("@DefinitionFinder"))
     {
         AppDomain       currentDomain   = AppDomain.CurrentDomain;
         List <Assembly> assems          = currentDomain.GetAssemblies().ToList();
         string          searchString    = _urbanDictionaryAPiURL + e.NewMessage.Replace("@DefinitionFinder", "");
         var             response        = ApiCall(searchString);
         string          formattedResult = FormatResponse(response);
         _discordEventClient.PostMessage(e.ChannelId, _name, formattedResult);
     }
 }