Exemplo n.º 1
0
 public void AfkCommandCompletenessTestFromEnum()
 {
     JsonController.Initialize();
     ((AfkCommandType[])Enum.GetValues(typeof(AfkCommandType))).ForEach(type =>
     {
         AfkCommand command = AppSettings.CommandList[type];
         Assert.IsNotNull(command);
     });
 }
Exemplo n.º 2
0
    private void CreateMessages()
    {
        if (User is null)
        {
            return;
        }

        AfkCommand afkCommand = AppSettings.CommandList[(AfkCommandType)User.AfkType];

        ComingBack = afkCommand.ComingBack.Replace("{username}", User.Username)
                     .Replace("{time}", $"{TimeHelper.GetUnixDifference(User.AfkTime)} ago")
                     .Replace("{message}", User.AfkMessage.Decode());
        ComingBack = string.IsNullOrEmpty(User.AfkMessage.Decode()) ? ComingBack.Remove(":").ReplaceSpaces() : ComingBack;

        GoingAway = afkCommand.GoingAway.Replace("{username}", User.Username);

        Resuming = afkCommand.Resuming.Replace("{username}", User.Username);
    }