Exemple #1
0
        private async Task UserJoinedEventHandler(SocketGuildUser user)
        {
            var message = _dataService.RSettings.General.WelcomeMessage;

            //Replace placeholders
            message = message.Replace("[USER]", user.Mention)
                      .Replace("[WELCOME]", _dataService.WelcomeChannel.Mention);

            await _dataService.BotChannel.SendMessageAsync(message);

            await _log.LogMessage($"USER JOINED {user}" +
                                  $"\nCreated At: {user.CreatedAt}" +
                                  $"\nJoined At: {user.JoinedAt}" +
                                  $"\nUser ID: {user.Id}");

            DatabaseUtil.AddJoinedUser(user.Id);

            JobManager.AddJob(async() => await UserWelcomeMessage(user), s => s
                              .WithName($"[UserJoin_{user.Id}]").ToRunOnceAt(DateTime.Now.AddMinutes(10)));
        }